📄 drvadc.lst
字号:
N * The interrupt number cannot be a negative value.
N */
Nstatic __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
Xstatic __inline void NVIC_DisableIRQ(IRQn_Type IRQn)
N{
N NVIC->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
X ((NVIC_Type *) ((0xE000E000) + 0x0100))->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
N}
N
N/**
N * @brief Read the interrupt pending bit for a device specific interrupt source
N *
N * @param IRQn The number of the device specifc interrupt
N * @return 1 = interrupt pending, 0 = interrupt not pending
N *
N * Read the pending register in NVIC and return 1 if its status is pending,
N * otherwise it returns 0
N */
Nstatic __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
Xstatic __inline uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
N{
N return((uint32_t) ((NVIC->ISPR[0] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
X return((uint32_t) ((((NVIC_Type *) ((0xE000E000) + 0x0100))->ISPR[0] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0));
N}
N
N/**
N * @brief Set the pending bit for an external interrupt
N *
N * @param IRQn The number of the interrupt for set pending
N *
N * Set the pending bit for the specified interrupt.
N * The interrupt number cannot be a negative value.
N */
Nstatic __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
Xstatic __inline void NVIC_SetPendingIRQ(IRQn_Type IRQn)
N{
N NVIC->ISPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
X ((NVIC_Type *) ((0xE000E000) + 0x0100))->ISPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
N}
N
N/**
N * @brief Clear the pending bit for an external interrupt
N *
N * @param IRQn The number of the interrupt for clear pending
N *
N * Clear the pending bit for the specified interrupt.
N * The interrupt number cannot be a negative value.
N */
Nstatic __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
Xstatic __inline void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
N{
N NVIC->ICPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
X ((NVIC_Type *) ((0xE000E000) + 0x0100))->ICPR[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
N}
N
N/**
N * @brief Set the priority for an interrupt
N *
N * @param IRQn The number of the interrupt for set priority
N * @param priority The priority to set
N *
N * Set the priority for the specified interrupt. The interrupt
N * number can be positive to specify an external (device specific)
N * interrupt, or negative to specify an internal (core) interrupt.
N *
N * Note: The priority cannot be set for every core interrupt.
N */
Nstatic __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
Xstatic __inline void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
N{
N if(IRQn < 0) {
N SCB->SHP[_SHP_IDX(IRQn)] = (SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
X ((SCB_Type *) ((0xE000E000) + 0x0D00))->SHP[( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )] = (((SCB_Type *) ((0xE000E000) + 0x0D00))->SHP[( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )] & ~(0xFF << ( (((uint32_t)(IRQn) ) & 0x03) * 8 ))) |
N (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
X (((priority << (8 - 2)) & 0xFF) << ( (((uint32_t)(IRQn) ) & 0x03) * 8 )); }
N else {
N NVIC->IPR[_IP_IDX(IRQn)] = (NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |
X ((NVIC_Type *) ((0xE000E000) + 0x0100))->IPR[( ((uint32_t)(IRQn) >> 2) )] = (((NVIC_Type *) ((0xE000E000) + 0x0100))->IPR[( ((uint32_t)(IRQn) >> 2) )] & ~(0xFF << ( (((uint32_t)(IRQn) ) & 0x03) * 8 ))) |
N (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }
X (((priority << (8 - 2)) & 0xFF) << ( (((uint32_t)(IRQn) ) & 0x03) * 8 )); }
N}
N
N/**
N * @brief Read the priority for an interrupt
N *
N * @param IRQn The number of the interrupt for get priority
N * @return The priority for the interrupt
N *
N * Read the priority for the specified interrupt. The interrupt
N * number can be positive to specify an external (device specific)
N * interrupt, or negative to specify an internal (core) interrupt.
N *
N * The returned priority value is automatically aligned to the implemented
N * priority bits of the microcontroller.
N *
N * Note: The priority cannot be set for every core interrupt.
N */
Nstatic __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
Xstatic __inline uint32_t NVIC_GetPriority(IRQn_Type IRQn)
N{
N
N if(IRQn < 0) {
N return((uint32_t)((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M0 system interrupts */
X return((uint32_t)((((SCB_Type *) ((0xE000E000) + 0x0D00))->SHP[( ((((uint32_t)(IRQn) & 0x0F)-8) >> 2) )] >> ( (((uint32_t)(IRQn) ) & 0x03) * 8 ) ) >> (8 - 2))); }
N else {
N return((uint32_t)((NVIC->IPR[_IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
X return((uint32_t)((((NVIC_Type *) ((0xE000E000) + 0x0100))->IPR[( ((uint32_t)(IRQn) >> 2) )] >> ( (((uint32_t)(IRQn) ) & 0x03) * 8 ) ) >> (8 - 2))); }
N}
N
N
N
N/* ################################## SysTick function ############################################ */
N
N#if (!defined (__Vendor_SysTickConfig)) || (__Vendor_SysTickConfig == 0)
X#if (!1L) || (0 == 0)
N
N/**
N * @brief Initialize and start the SysTick counter and its interrupt.
N *
N * @param ticks number of ticks between two interrupts
N * @return 1 = failed, 0 = successful
N *
N * Initialise the system tick timer and its interrupt and start the
N * system tick timer / counter in free running mode to generate
N * periodical interrupts.
N */
Nstatic __INLINE uint32_t SysTick_Config(uint32_t ticks)
Xstatic __inline uint32_t SysTick_Config(uint32_t ticks)
N{
N if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
X if (ticks > (0xFFFFFFul << 0)) return (1);
N
N SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
X ((SysTick_Type *) ((0xE000E000) + 0x0010))->LOAD = (ticks & (0xFFFFFFul << 0)) - 1;
N NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
X NVIC_SetPriority (SysTick_IRQn, (1<<2) - 1);
N SysTick->VAL = 0; /* Load the SysTick Counter Value */
X ((SysTick_Type *) ((0xE000E000) + 0x0010))->VAL = 0;
N SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
X ((SysTick_Type *) ((0xE000E000) + 0x0010))->CTRL = (1ul << 2) |
N SysTick_CTRL_TICKINT_Msk |
X (1ul << 1) |
N SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
X (1ul << 0);
N return (0); /* Function successful */
N}
N
N#endif
N
N
N
N
N/* ################################## Reset function ############################################ */
N
N/**
N * @brief Initiate a system reset request.
N *
N * Initiate a system reset request to reset the MCU
N */
Nstatic __INLINE void NVIC_SystemReset(void)
Xstatic __inline void NVIC_SystemReset(void)
N{
N SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
X ((SCB_Type *) ((0xE000E000) + 0x0D00))->AIRCR = ((0x5FA << 16) |
N SCB_AIRCR_SYSRESETREQ_Msk);
X (1ul << 2));
N __DSB(); /* Ensure completion of memory access */
X __dsb(0);
N while(1); /* wait until reset */
N}
N
N/*@}*/ /* end of group CMSIS_CM0_Core_FunctionInterface */
N
N#ifdef __cplusplus
S}
N#endif
N
N/*@}*/ /* end of group CMSIS_CM0_core_definitions */
N
N#endif /* __CM0_CORE_H__ */
N
N/*lint -restore */
L 75 "..\Lib\CMSIS\CM0\DeviceSupport\Nuvoton\NUC1xx\NUC1xx.h" 2
N#include "system_NUC1xx.h" /* NUC1xx System */
L 1 "..\Lib\CMSIS\CM0\DeviceSupport\Nuvoton\NUC1xx\system_NUC1xx.h" 1
N/*---------------------------------------------------------------------------------------------------------*/
N/* */
N/* Copyright(c) 2009 Nuvoton Technology Corp. All rights reserved. */
N/* */
N/*---------------------------------------------------------------------------------------------------------*/
N#ifndef __SYSTEM_NUC1xx_H
N#define __SYSTEM_NUC1xx_H
N
N#ifdef __cplusplus
S extern "C" {
N#endif
N/*---------------------------------------------------------------------------------------------------------*/
N/* Macro Definition */
N/*---------------------------------------------------------------------------------------------------------*/
N
N//#define DEBUG_ENABLE_SEMIHOST /* To enable semihosted. !!!The SEMIHOSTED of startup_NUC1xx.s must be {TRUE} */
N
N/* Using UART0 or UART1 */
N#define DEBUG_PORT 0 /*0:UART0 1:UART1 2:UART2 */
N
N/*----------------------------------------------------------------------------
N Define SYSCLK
N *----------------------------------------------------------------------------*/
N#define __XTAL (12000000UL)
N#define __RTC_XTAL (32768UL)
N#define __IRC22M (22118400UL)
N#define __IRC10K (10000UL)
N#define __HSI (__IRC22M) /* Factory Default is internal 22MHz */
N
Nextern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
Nextern uint32_t CyclesPerUs; /* Cycles per micro second */
N
N/**
N * Initialize the system
N *
N * @param none
N * @return none
N *
N * @brief Setup the microcontroller system
N * Initialise GPIO directions and values
N */
Nextern void SystemInit(void);
N
N
N/**
N * Update SystemCoreClock variable
N *
N * @param none
N * @return none
N *
N * @brief Updates the SystemCoreClock with current core Clock
N * retrieved from cpu registers.
N */
Nextern void SystemCoreClockUpdate (void);
N
N#ifdef __cplusplus
S}
N#endif
N
N#endif
L 76 "..\Lib\CMSIS\CM0\DeviceSupport\Nuvoton\NUC1xx\NUC1xx.h" 2
N#include "System\SysInfra.h"
L 1 "..\Lib\Include\System\SysInfra.h" 1
N/*---------------------------------------------------------------------------------------------------------*/
N/* */
N/* Copyright (c) Nuvoton Technology Corp. All rights reserved. */
N/* */
N/*---------------------------------------------------------------------------------------------------------*/
N
N
N#ifndef __SYSINFRA_H__
N#define __SYSINFRA_H__
N
N/*---------------------------------------------------------------------------------------------------------*/
N/* Includes of system headers */
N/*---------------------------------------------------------------------------------------------------------*/
N#include "ModuleID.h"
L 1 "..\Lib\Include\System\ModuleID.h" 1
N/*---------------------------------------------------------------------------------------------------------*/
N/* */
N/* Copyright (c) Nuvoton Technology Corp. All rights reserved. */
N/* */
N/*---------------------------------------------------------------------------------------------------------*/
N
N#ifndef __MODULE_ID_H__
N#define __MODULE_ID_H__
N
N
Ntypedef enum
N{
N /* Module ID valid range: 0 ~ 255 */
N
N /* Driver: Module ID Module Name */
N MODULE_ID_DRVPROTECT = 0, /* DrvProtect */
N
N MODULE_ID_DRVADC = 2, /* DrvADC */
N MODULE_ID_DRVAIC = 4, /* DrvAIC */
N MODULE_ID_DRVAPU = 6, /* DrvAPU */
N MODULE_ID_DRVAUDIOADC = 8, /* DrvAudioADC */
N MODULE_ID_DRVCACHE = 10, /* DrvCache */
N MODULE_ID_DRVCAN = 11, /* DrvCAN */
N MODULE_ID_DRVEBI = 12, /* DrvEBI */
N MODULE_ID_DRVEDMA = 13, /* DrvEDMA */
N MODULE_ID_DRVGDMA = 14, /* DrvGDMA */
N MODULE_ID_DRVFSC = 15, /* DrvFSC */
N MODULE_ID_DRVGE = 16, /* DrvGE */
N MODULE_ID_DRVFMC = 17, /* DrvFMC */
N MODULE_ID_DRVGPIO = 18, /* DrvGPIO */
N
N MODULE_ID_DRVGPU = 20, /* DrvGPU */
N MODULE_ID_DRVI2C = 22, /* DrvI2C (S/W I2C for Non-UL; H/W I2C for UL) */
N
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -