Beruflich Dokumente
Kultur Dokumente
To define the peripherals for the actual device. It can use several other
include files to define the peripherals of the actual devices
system_NUC100.c (system_device)
ARM offer 2 files
core_cm0.h
core_cm0.c
in
startup_NUC100Series.s (1/2)
_Vectors DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
DCD
__initial_sp
Reset_Handler
NMI_Handler
HardFault_Handler
0
0
0
0
0
0
0
SVC_Handler
0
0
PendSV_Handler
SysTick_Handler
; Top of Stack
; Reset Handler
; NMI Handler
; Hard Fault Handler
; Reserved
; Reserved
; Reserved
; Reserved
; Reserved
; Reserved
; Reserved
; SVCall Handler
; Reserved
; Reserved
; PendSV Handler
; SysTick Handler
startup_NUC100Series.s (2/2)
; External Interrupts
DCD BOD_IRQHandler
DCD WDT_IRQHandler
DCD EINT0_IRQHandler
DCD EINT1_IRQHandler
DCD GPAB_IRQHandler
DCD GPCDE_IRQHandler
DCD PWMA_IRQHandler
DCD PWMB_IRQHandler
DCD TMR0_IRQHandler
DCD TMR1_IRQHandler
DCD TMR2_IRQHandler
DCD TMR3_IRQHandler
DCD UART02_IRQHandler
DCD UART1_IRQHandler
DCD SPI0_IRQHandler
DCD SPI1_IRQHandler
DCD SPI2_IRQHandler
DCD SPI3_IRQHandler
DCD I2C0_IRQHandler
DCD I2C1_IRQHandler
DCD CAN0_IRQHandler
DCD Default_Handler
DCD Default_Handler
DCD USBD_IRQHandler
DCD PS2_IRQHandler
DCD ACMP_IRQHandler
DCD PDMA_IRQHandler
DCD I2S_IRQHandler
DCD PWRWU_IRQHandler
DCD ADC_IRQHandler
DCD Default_Handler
DCD RTC_IRQHandler
31
30
29
28
27
26
25
24
19
18
17
16
11
10
RESERVED
23
22
21
20
RESERVED
15
14
13
12
PD_WAIT_CPU
7
PWR_DOWN
PD_WU_STS
WINT_EN
WU_DLY
OSC10K_EN
OSC22M_EN
XTL32K_EN
XTL12M_EN
LSB
MSB
typedef struct
{
SYSCLK_PWRCON_T
SYSCLK_AHBCLK_T
SYSCLK_APBCLK_T
uint32_t
SYSCLK_CLKSEL0_T
SYSCLK_CLKSEL1_T
SYSCLK_CLKDIV_T
uint32_t
SYSCLK_PLLCON_T
uint32_t
SYSCLK_TREG_T
} SYSCLK_T;
PWRCON;
AHBCLK;
APBCLK;
RESERVED;
CLKSEL0;
CLKSEL1;
CLKDIV;
RESERVED2;
PLLCON;
RESERVED3[3];
TREG;
Register
Offset
PWRCON
CLK_BA + 00
AHBCLK
CLK_BA + 04
APBCLK
CLK_BA + 08
CLKSEL0
CLK_BA + 10
CLKSEL1
CLK_BA + 14
CLKSEL2
CLK_BA + 1C
CLKDIV
CLK_BA_+ 18
PLLCON
CLK_BA + 20
FRQDIV
GCR_BA + 24
GCR_BA
0x5000_0200 0x5000_02FF
CLK_BA
0x5000_0300 0x5000_03FF
INT_BA
0x5000_4000 0x5000_7FFF
GPIO_BA
0x5000_8000 0x5000_BFFF
PDMA_BA
0x5000_C000 0x5000_FFFF
FMC_BA
SYSCLK->PWRCON.XTL12M_EN = 1;
Core Register
Description
PRIMASK = 0
PRIMASK = 1
PRIMASK = value
uint32_t __get_PRIMASK
(void)
return PRIMASK
void __set_CONTROL
(uint32_t value)
CONTROL = value
uint32_t __get_CONTROL
(void)
return CONTROL
PSP =
TopOfProcStack
return PSP
MSP =
TopOfMainStack
return MSP
CPU Instruction
Description
WFI
WFE
SEV
Set Event
ISB
DSB
DMB
REV
REV16
REVSH
Parameter
Description
IRQ Number
Enable IRQn
IRQ Number
Disable IRQn
IRQ Number
IRQ Number
IRQ Number
IRQ Number
(void)
+ 0x4000)
#define GPIOA_BASE
(GPIO_BASE
)
#define GPIOB_BASE
(GPIO_BASE
+ 0x0040)
#define GPIOC_BASE
(GPIO_BASE
+ 0x0080)
#define GPIOD_BASE
(GPIO_BASE
+ 0x00C0)
#define GPIOE_BASE
(GPIO_BASE
+ 0x0100)
#define GPIO_DBNCECON_BASE (GPIO_BASE
+
0x0180)
#define UART0_BASE
#define UART1_BASE
#define UART2_BASE
(APB1_BASE
(APB2_BASE
(APB2_BASE
+ 0x50000)
+ 0x50000)
+ 0x54000)
#define TIMER0_BASE
#define TIMER1_BASE
#define TIMER2_BASE
#define TIMER3_BASE
#define WDT_BASE
#define SPI0_BASE
#define SPI1_BASE
#define SPI2_BASE
#define SPI3_BASE
#define I2C0_BASE
#define I2C1_BASE
#define RTC_BASE
#define ADC_BASE
#define ACMP_BASE
#define SYSCLK_BASE
#define GCR_BASE
#define INT_BASE
#define FMC_BASE
#define PS2_BASE
#define CAN0_BASE
#define CAN1_BASE
#define C_CAN_BASE
(APB1_BASE + 0x10000)
(APB1_BASE + 0x10020)
(APB2_BASE + 0x10000)
(APB2_BASE + 0x10020)
(APB1_BASE + 0x4000)
(APB1_BASE + 0x30000)
(APB1_BASE + 0x34000)
(APB2_BASE + 0x30000)
(APB2_BASE + 0x34000)
(APB1_BASE + 0x20000)
(APB2_BASE + 0x20000)
(APB1_BASE + 0x08000)
(APB1_BASE + 0xE0000)
(APB1_BASE + 0xD0000)
(AHB_BASE
+ 0x00200)
(AHB_BASE
+ 0x00000)
(AHB_BASE
+ 0x00300)
(AHB_BASE
+ 0x0C000)
(APB2_BASE + 0x00000)
(APB2_BASE + 0x80000)
(APB2_BASE + 0x84000)
(APB2_BASE + 0x88000)
((UART_T *) UART0_BASE)
((UART_T *) UART1_BASE)
((UART_T *) UART2_BASE)
((TIMER_T *) TIMER0_BASE)
((TIMER_T *) TIMER1_BASE)
((TIMER_T *) TIMER2_BASE)
((TIMER_T *) TIMER3_BASE)
((WDT_T *) WDT_BASE)
((SPI_T *) SPI0_BASE)
((SPI_T *) SPI1_BASE)
((SPI_T *) SPI2_BASE)
((SPI_T *) SPI3_BASE)
#define I2C0
#define I2C1
#define I2S
#define RTC
#define ADC
#define ACMP
#define SYSCLK
#define SYS
#define SYSINT
#define FMC
#define PS2
#define CAN
#define USBD
((I2C_T *) I2C0_BASE)
((I2C_T *) I2C1_BASE)
((I2S_T *) I2S_BASE)
((RTC_T *) RTC_BASE)
((ADC_T *) ADC_BASE)
((ACMP_T *) ACMP_BASE)
((SYSCLK_T *) SYSCLK_BASE)
((GCR_T *) GCR_BASE)
((GCR_INT_T *) INT_BASE)
((FMC_T *) FMC_BASE)
((PS2_T *) PS2_BASE)
((CAN_T *) CAN0_BASE)
((USBD_T *) USBD_BASE))