📄 uf32reg.h
字号:
#define LOCK 3 // PLL Lock Status
#define TRACK 2 // Track/Acquisition mode indication
#define SCMIF 1 // Self-Clock Mode IRQ Flag
#define SCM 0 // Self-Clock Mode Status
//.............................................................................................
#define CRGINT *(volatile UINT8*)(CRG_BASE+0x04) /* CRG Interrupt Control Register */
#define RTIE 7 // Real-Time IRQ Enable
#define LOCKIE 4 // PLL Lock IRQ Enable
#define SCMIE 1 // Self-Clock Mode IRQ Enable
//.............................................................................................
#define PLL_SEL 0x80
#define CLKSEL *(volatile UINT8*)(CRG_BASE+0x05) /* CLK Setting Register */
#define PLLSEL 7 // Enable PLL Clk as SYSCLK
#define PSTP 6 // Pseudo Stop Mode. (Clk running, CPU stopped)
#define SYSWAI 5 // Stop the SYSCLK in WAIT mode.
#define ROAWAI 4 // Reduced Osc. Amplitude in WAIT mode.
#define PLLWAI 3 // PLL Stops in WAIT mode.
#define CWAI 2 // CLK24 & CLK23 stops in WAIT mode.
#define RTIWAI 1 // Real-Time IRQ stops in WAIT mode.
#define COPWAI 0 // COP stops in WAIT mode.
//.............................................................................................
#define PLLCTL *(volatile UINT8*)(CRG_BASE+0x06) /* PLL Control Register */
#define CME 7 // Clock Monitor Enable
#define PLLON 6 // Turn On PLL
#define AUTO 5 // Automatic Bandwidth Control
#define ACQ 4 // Acquisition
#define SCME 0 // Self-Clock Mode Enable
//.............................................................................................
/*Real-Time Interrupt prescaler*/
#define RTICTL *(volatile UINT8*)(CRG_BASE+0x07) /* Real-Time IRQ Control Register */
//.............................................................................................
#define COPCTL *(volatile UINT8*)(CRG_BASE+0x08) /* COP Control Register */
#define WCOP 7 // Window/Normal COP mode.
#define CR2 2 // COP Timer Rate Selection
#define CR1 1 // COP Timer Rate Selection
#define CR0 0 // COP Timer Rate Selection
//.............................................................................................
// Write 0x55 to this reg first, then write 0xAA as second to Arm & Reset COP timer.
#define ARMCOP *(volatile UINT8*)(CRG_BASE+0x0B) /* Arm & Reset COP Timer */
//.............................................................................................
/*Input Capture / Output Compare Selection */
#define TIOS *(volatile UINT8*)(ECT_BASE+0x00) /* IC/OC Selection register */
#define IOS7 7 // IC/OC selection for channel #7
#define IOS6 6 // IC/OC selection for channel #6
#define IOS5 5 // IC/OC selection for channel #5
#define IOS4 4 // IC/OC selection for channel #4
#define IOS3 3 // IC/OC selection for channel #3
#define IOS2 2 // IC/OC selection for channel #2
#define IOS1 1 // IC/OC selection for channel #1
#define IOS0 0 // IC/OC selection for channel #0
//...................................................................................
#define TCFORC *(volatile UINT8*)(ECT_BASE+0x01) /* Force OC Occured register */
#define FOC7 7 // Force OC Occured for channel #7
#define FOC6 6 // Force OC Occured for channel #6
#define FOC5 5 // Force OC Occured for channel #5
#define FOC4 4 // Force OC Occured for channel #4
#define FOC3 3 // Force OC Occured for channel #3
#define FOC2 2 // Force OC Occured for channel #2
#define FOC1 1 // Force OC Occured for channel #1
#define FOC0 0 // Force OC Occured for channel #0
//...................................................................................
#define OC7M *(volatile UINT8*)(ECT_BASE+0x02) /* O/C7 Mask register */
#define OC7M7 7 // OC7M7 mask for channel #7
#define OC7M6 6 // OC7M6 mask for channel #6
#define OC7M5 5 // OC7M5 mask for channel #5
#define OC7M4 4 // OC7M4 mask for channel #4
#define OC7M3 3 // OC7M3 mask for channel #3
#define OC7M2 2 // OC7M2 mask for channel #2
#define OC7M1 1 // OC7M1 mask for channel #1
#define OC7M0 0 // OC7M0 mask for channel #0
//...................................................................................
#define OC7D *(volatile UINT8*)(ECT_BASE+0x03) /* O/C7 Data register */
#define OC7D7 7 // OC7D7 Data for channel #7
#define OC7D6 6 // OC7D6 Data for channel #6
#define OC7D5 5 // OC7D5 Data for channel #5
#define OC7D4 4 // OC7D4 Data for channel #4
#define OC7D3 3 // OC7D3 Data for channel #3
#define OC7D2 2 // OC7D2 Data for channel #2
#define OC7D1 1 // OC7D1 Data for channel #1
#define OC7D0 0 // OC7D0 Data for channel #0
//...................................................................................
#define TCNT *(volatile mint16*)(ECT_BASE+0x04) /* timer counter 16-bit register */
#define TCNT_H *(volatile UINT8*)(ECT_BASE+0x04) /* timer counter high */
#define TCNT_L *(volatile UINT8*)(ECT_BASE+0x05) /* timer counter low */
//...................................................................................
#define TSCR1 *(volatile UINT8*)(ECT_BASE+0x06) /* Timer System Control #1 register */
#define TEN 7 // Timer Enable
#define TSWAI 6 // Timer Stopped in WAIT mode
#define TSFRZ 5 // Timer & Modulus Counter stopped in FREEZE mode
#define TFFCA 4 // Timer Fast Flag Clear All
//...................................................................................
#define TTOV *(volatile UINT8*)(ECT_BASE+0x07) /* Toggle on Overflow register */
#define TOV7 7 // Toggle output on Overflow for channel #7
#define TOV6 6 // Toggle output on Overflow for channel #6
#define TOV5 5 // Toggle output on Overflow for channel #5
#define TOV4 4 // Toggle output on Overflow for channel #4
#define TOV3 3 // Toggle output on Overflow for channel #3
#define TOV2 2 // Toggle output on Overflow for channel #2
#define TOV1 1 // Toggle output on Overflow for channel #1
#define TOV0 0 // Toggle output on Overflow for channel #0
//...................................................................................
#define TCTL1 *(volatile UINT8*)(ECT_BASE+0x08) /* Timer Control #1 register */
#define OM7 7 // Output Mode for channel #7
#define OL7 6 // Output Level for channel #7
#define OM6 5 // Output Mode for channel #6
#define OL6 4 // Output Level for channel #6
#define OM5 3 // Output Mode for channel #5
#define OL5 2 // Output Level for channel #5
#define OM4 1 // Output Mode for channel #4
#define OL4 0 // Output Level for channel #4
//...................................................................................
#define TCTL2 *(volatile UINT8*)(ECT_BASE+0x09) /* Timer Control #2 register */
#define OM3 7 // Output Mode for channel #3
#define OL3 6 // Output Level for channel #3
#define OM2 5 // Output Mode for channel #2
#define OL2 4 // Output Level for channel #2
#define OM1 3 // Output Mode for channel #1
#define OL1 2 // Output Level for channel #1
#define OM0 1 // Output Mode for channel #0
#define OL0 0 // Output Level for channel #0
//...................................................................................
#define TCTL3 *(volatile UINT8*)(ECT_BASE+0x0A) /* Timer Control #3 register */
#define EDG7B 7 // Edge Control for channel #7
#define EDG7A 6 // Edge Control for channel #7
#define EDG6B 5 // Edge Control for channel #6
#define EDG6A 4 // Edge Control for channel #6
#define EDG5B 3 // Edge Control for channel #5
#define EDG5A 2 // Edge Control for channel #5
#define EDG4B 1 // Edge Control for channel #4
#define EDG4A 0 // Edge Control for channel #4
//...................................................................................
#define TCTL4 *(volatile UINT8*)(ECT_BASE+0x0B) /* Timer Control #4 register */
#define EDG3B 7 // Edge Control for channel #3
#define EDG3A 6 // Edge Control for channel #3
#define EDG2B 5 // Edge Control for channel #2
#define EDG2A 4 // Edge Control for channel #2
#define EDG1B 3 // Edge Control for channel #1
#define EDG1A 2 // Edge Control for channel #1
#define EDG0B 1 // Edge Control for channel #0
#define EDG0A 0 // Edge Control for channel #0
//...................................................................................
#define TIE *(volatile UINT8*)(ECT_BASE+0x0C) /* Timer Interrupt Enable register */
#define C7I 7 // Timer IRQ Enable for channel #7
#define C6I 6 // Timer IRQ Enable for channel #6
#define C5I 5 // Timer IRQ Enable for channel #5
#define C4I 4 // Timer IRQ Enable for channel #4
#define C3I 3 // Timer IRQ Enable for channel #3
#define C2I 2 // Timer IRQ Enable for channel #2
#define C1I 1 // Timer IRQ Enable for channel #1
#define C0I 0 // Timer IRQ Enable for channel #0
//...................................................................................
#define TSCR2 *(volatile UINT8*)(ECT_BASE+0x0D) /* Timer System Control #1 register */
#define TOI 7 // Timer Overflow IRQ Enable
#define TCRE 3 // Timer Counter Reset
#define PR2 2 // Timer Prescaler Selection #2
#define PR1 1 // Timer Prescaler Selection #1
#define PR0 0 // Timer Prescaler Selection #0
//...................................................................................
#define TFLG1 *(volatile UINT8*)(ECT_BASE+0x0E) /* Timer Interrupt Flags #1 register */
#define C7F 7 // Timer IRQ Flag for channel #7
#define C6F 6 // Timer IRQ Flag for channel #6
#define C5F 5 // Timer IRQ Flag for channel #5
#define C4F 4 // Timer IRQ Flag for channel #4
#define C3F 3 // Timer IRQ Flag for channel #3
#define C2F 2 // Timer IRQ Flag for channel #2
#define C1F 1 // Timer IRQ Flag for channel #1
#define C0F 0 // Timer IRQ Flag for channel #0
//...................................................................................
#define TFLG2 *(volatile UINT8*)(ECT_BASE+0x0F) /* Timer Interrupt Flags #2 register */
#define TOF 7 // Timer Overflow Flag for channel
/*The followings are Input Capture & Output Compare regs for each channel. */
//...................................................................................
#define TC0 *(volatile UINT16*)(ECT_BASE+0x10) /* Timer IC/OC 16-bit register */
#define TC0_H *(volatile UINT8*)(ECT_BASE+0x10) /* Timer IC/OC High register */
#define TC0_L *(volatile UINT8*)(ECT_BASE+0x11) /* Timer IC/OC Low register */
//...................................................................................
#define TC1 *(volatile UINT16*)(ECT_BASE+0x12) /* Timer IC/OC 16-bit register */
#define TC1_H *(volatile UINT8*)(ECT_BASE+0x12) /* Timer IC/OC High register */
#define TC1_L *(volatile UINT8*)(ECT_BASE+0x13) /* Timer IC/OC Low register */
//...................................................................................
#define TC2 *(volatile UINT16*)(ECT_BASE+0x14) /* Timer IC/OC High 16-bit register */
#define TC2_H *(volatile UINT8*)(ECT_BASE+0x14) /* Timer IC/OC High register */
#define TC2_L *(volatile UINT8*)(ECT_BASE+0x15) /* Timer IC/OC Low register */
//...................................................................................
#define TC3 *(volatile UINT16*)(ECT_BASE+0x16) /* Timer IC/OC High 16-bit register */
#define TC3_H *(volatile UINT8*)(ECT_BASE+0x16) /* Timer IC/OC High register */
#define TC3_L *(volatile UINT8*)(ECT_BASE+0x17) /* Timer IC/OC Low register */
//...................................................................................
#define TC4 *(volatile UINT16*)(ECT_BASE+0x18) /* Timer IC/OC High 16-bit register */
#define TC4_H *(volatile UINT8*)(ECT_BASE+0x18) /* Timer IC/OC High register */
#define TC4_L *(volatile UINT8*)(ECT_BASE+0x19) /* Timer IC/OC Low register */
//...................................................................................
#define TC5 *(volatile UINT16*)(ECT_BASE+0x1A) /* Timer IC/OC High 16-bit register */
#define TC5_H *(volatile UINT8*)(ECT_BASE+0x1A) /* Timer IC/OC High register */
#define TC5_L *(volatile UINT8*)(ECT_BASE+0x1B) /* Timer IC/OC Low register */
//...................................................................................
#define TC6 *(volatile UINT16*)(ECT_BASE+0x1C) /* Timer IC/OC High 16-bit register */
#define TC6_H *(volatile UINT8*)(ECT_BASE+0x1C) /* Timer IC/OC High register */
#define TC6_L *(volatile UINT8*)(ECT_BASE+0x1D) /* Timer IC/OC Low register */
//...................................................................................
#define TC7 *(volatile UINT16*)(ECT_BASE+0x1E) /* Timer IC/OC High 16-bit register */
#define TC7_H *(volatile UINT8*)(ECT_BASE+0x1E) /* Timer IC/OC High register */
#define TC7_L *(volatile UINT8*)(ECT_BASE+0x1F) /* Timer IC/OC Low register */
//...................................................................................
#define PACTL *(volatile UINT8*)(ECT_BASE+0x20) /* Pulse Accumulator Control register */
#define PAEN 6 // Pulse Accumulator A Enable
#define PAMOD 5 // Pulse Accumulator A Mode
#define PEDGE 4 // Pulse Accumulator A Edge Control
#define CLK1 3 // Clock Select bit 1
#define CLK0 2 // Clock Select bit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -