📄 at91sam9261.h
字号:
/* -------- RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register -------- */#define AT91C_RSTC_PROCRST ((unsigned int) 0x1 << 0) /* (RSTC) Processor Reset */#define AT91C_RSTC_ICERST ((unsigned int) 0x1 << 1) /* (RSTC) ICE Interface Reset */#define AT91C_RSTC_PERRST ((unsigned int) 0x1 << 2) /* (RSTC) Peripheral Reset */#define AT91C_RSTC_EXTRST ((unsigned int) 0x1 << 3) /* (RSTC) External Reset */#define AT91C_RSTC_KEY ((unsigned int) 0xFF << 24) /* (RSTC) Password *//* -------- RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register -------- */#define AT91C_RSTC_URSTS ((unsigned int) 0x1 << 0) /* (RSTC) User Reset Status */#define AT91C_RSTC_RSTTYP ((unsigned int) 0x7 << 8) /* (RSTC) Reset Type */#define AT91C_RSTC_RSTTYP_GENERAL ((unsigned int) 0x0 << 8) /* (RSTC) General reset. Both VDDCORE and VDDBU rising. */#define AT91C_RSTC_RSTTYP_WAKEUP ((unsigned int) 0x1 << 8) /* (RSTC) WakeUp Reset. VDDCORE rising. */#define AT91C_RSTC_RSTTYP_WATCHDOG ((unsigned int) 0x2 << 8) /* (RSTC) Watchdog Reset. Watchdog overflow occured. */#define AT91C_RSTC_RSTTYP_SOFTWARE ((unsigned int) 0x3 << 8) /* (RSTC) Software Reset. Processor reset required by the software. */#define AT91C_RSTC_RSTTYP_USER ((unsigned int) 0x4 << 8) /* (RSTC) User Reset. NRST pin detected low. */#define AT91C_RSTC_NRSTL ((unsigned int) 0x1 << 16) /* (RSTC) NRST pin level */#define AT91C_RSTC_SRCMP ((unsigned int) 0x1 << 17) /* (RSTC) Software Reset Command in Progress. *//* -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register -------- */#define AT91C_RSTC_URSTEN ((unsigned int) 0x1 << 0) /* (RSTC) User Reset Enable */#define AT91C_RSTC_URSTIEN ((unsigned int) 0x1 << 4) /* (RSTC) User Reset Interrupt Enable */#define AT91C_RSTC_ERSTL ((unsigned int) 0xF << 8) /* (RSTC) User Reset Enable *//* ***************************************************************************** *//* SOFTWARE API DEFINITION FOR Periodic Interval Timer Controller Interface *//* ***************************************************************************** */typedef struct _AT91S_PITC { AT91_REG PITC_PIMR; /* Period Interval Mode Register */ AT91_REG PITC_PISR; /* Period Interval Status Register */ AT91_REG PITC_PIVR; /* Period Interval Value Register */ AT91_REG PITC_PIIR; /* Period Interval Image Register */} AT91S_PITC, *AT91PS_PITC;/* -------- PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register -------- */#define AT91C_PITC_PIV ((unsigned int) 0xFFFFF << 0) /* (PITC) Periodic Interval Value */#define AT91C_PITC_PITEN ((unsigned int) 0x1 << 24) /* (PITC) Periodic Interval Timer Enabled */#define AT91C_PITC_PITIEN ((unsigned int) 0x1 << 25) /* (PITC) Periodic Interval Timer Interrupt Enable *//* -------- PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register -------- */#define AT91C_PITC_PITS ((unsigned int) 0x1 << 0) /* (PITC) Periodic Interval Timer Status *//* -------- PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register -------- */#define AT91C_PITC_CPIV ((unsigned int) 0xFFFFF << 0) /* (PITC) Current Periodic Interval Value */#define AT91C_PITC_PICNT ((unsigned int) 0xFFF << 20) /* (PITC) Periodic Interval Counter *//* ***************************************************************************** *//* SOFTWARE API DEFINITION FOR Usart *//* ***************************************************************************** */typedef struct _AT91S_USART { AT91_REG US_CR; /* Control Register */ AT91_REG US_MR; /* Mode Register */ AT91_REG US_IER; /* Interrupt Enable Register */ AT91_REG US_IDR; /* Interrupt Disable Register */ AT91_REG US_IMR; /* Interrupt Mask Register */ AT91_REG US_CSR; /* Channel Status Register */ AT91_REG US_RHR; /* Receiver Holding Register */ AT91_REG US_THR; /* Transmitter Holding Register */ AT91_REG US_BRGR; /* Baud Rate Generator Register */ AT91_REG US_RTOR; /* Receiver Time-out Register */ AT91_REG US_TTGR; /* Transmitter Time-guard Register */ AT91_REG Reserved0[5]; AT91_REG US_FIDI; /* FI_DI_Ratio Register */ AT91_REG US_NER; /* Nb Errors Register */ AT91_REG Reserved1[1]; AT91_REG US_IF; /* IRDA_FILTER Register */ AT91_REG Reserved2[44]; AT91_REG US_RPR; /* Receive Pointer Register */ AT91_REG US_RCR; /* Receive Counter Register */ AT91_REG US_TPR; /* Transmit Pointer Register */ AT91_REG US_TCR; /* Transmit Counter Register */ AT91_REG US_RNPR; /* Receive Next Pointer Register */ AT91_REG US_RNCR; /* Receive Next Counter Register */ AT91_REG US_TNPR; /* Transmit Next Pointer Register */ AT91_REG US_TNCR; /* Transmit Next Counter Register */ AT91_REG US_PTCR; /* PDC Transfer Control Register */ AT91_REG US_PTSR; /* PDC Transfer Status Register */} AT91S_USART, *AT91PS_USART;/* -------- US_CR : (USART Offset: 0x0) Debug Unit Control Register -------- */#define AT91C_US_STTBRK ((unsigned int) 0x1 << 9) /* (USART) Start Break */#define AT91C_US_STPBRK ((unsigned int) 0x1 << 10) /* (USART) Stop Break */#define AT91C_US_STTTO ((unsigned int) 0x1 << 11) /* (USART) Start Time-out */#define AT91C_US_SENDA ((unsigned int) 0x1 << 12) /* (USART) Send Address */#define AT91C_US_RSTIT ((unsigned int) 0x1 << 13) /* (USART) Reset Iterations */#define AT91C_US_RSTNACK ((unsigned int) 0x1 << 14) /* (USART) Reset Non Acknowledge */#define AT91C_US_RETTO ((unsigned int) 0x1 << 15) /* (USART) Rearm Time-out */#define AT91C_US_DTREN ((unsigned int) 0x1 << 16) /* (USART) Data Terminal ready Enable */#define AT91C_US_DTRDIS ((unsigned int) 0x1 << 17) /* (USART) Data Terminal ready Disable */#define AT91C_US_RTSEN ((unsigned int) 0x1 << 18) /* (USART) Request to Send enable */#define AT91C_US_RTSDIS ((unsigned int) 0x1 << 19) /* (USART) Request to Send Disable *//* -------- US_MR : (USART Offset: 0x4) Debug Unit Mode Register -------- */#define AT91C_US_USMODE ((unsigned int) 0xF << 0) /* (USART) Usart mode */#define AT91C_US_USMODE_NORMAL ((unsigned int) 0x0) /* (USART) Normal */#define AT91C_US_USMODE_RS485 ((unsigned int) 0x1) /* (USART) RS485 */#define AT91C_US_USMODE_HWHSH ((unsigned int) 0x2) /* (USART) Hardware Handshaking */#define AT91C_US_USMODE_MODEM ((unsigned int) 0x3) /* (USART) Modem */#define AT91C_US_USMODE_ISO7816_0 ((unsigned int) 0x4) /* (USART) ISO7816 protocol: T = 0 */#define AT91C_US_USMODE_ISO7816_1 ((unsigned int) 0x6) /* (USART) ISO7816 protocol: T = 1 */#define AT91C_US_USMODE_IRDA ((unsigned int) 0x8) /* (USART) IrDA */#define AT91C_US_USMODE_SWHSH ((unsigned int) 0xC) /* (USART) Software Handshaking */#define AT91C_US_CLKS ((unsigned int) 0x3 << 4) /* (USART) Clock Selection (Baud Rate generator Input Clock */#define AT91C_US_CLKS_CLOCK ((unsigned int) 0x0 << 4) /* (USART) Clock */#define AT91C_US_CLKS_FDIV1 ((unsigned int) 0x1 << 4) /* (USART) fdiv1 */#define AT91C_US_CLKS_SLOW ((unsigned int) 0x2 << 4) /* (USART) slow_clock (ARM) */#define AT91C_US_CLKS_EXT ((unsigned int) 0x3 << 4) /* (USART) External (SCK) */#define AT91C_US_CHRL ((unsigned int) 0x3 << 6) /* (USART) Clock Selection (Baud Rate generator Input Clock */#define AT91C_US_CHRL_5_BITS ((unsigned int) 0x0 << 6) /* (USART) Character Length: 5 bits */#define AT91C_US_CHRL_6_BITS ((unsigned int) 0x1 << 6) /* (USART) Character Length: 6 bits */#define AT91C_US_CHRL_7_BITS ((unsigned int) 0x2 << 6) /* (USART) Character Length: 7 bits */#define AT91C_US_CHRL_8_BITS ((unsigned int) 0x3 << 6) /* (USART) Character Length: 8 bits */#define AT91C_US_SYNC ((unsigned int) 0x1 << 8) /* (USART) Synchronous Mode Select */#define AT91C_US_NBSTOP ((unsigned int) 0x3 << 12) /* (USART) Number of Stop bits */#define AT91C_US_NBSTOP_1_BIT ((unsigned int) 0x0 << 12) /* (USART) 1 stop bit */#define AT91C_US_NBSTOP_15_BIT ((unsigned int) 0x1 << 12) /* (USART) Asynchronous (SYNC=0) 2 stop bits Synchronous (SYNC=1) 2 stop bits */#define AT91C_US_NBSTOP_2_BIT ((unsigned int) 0x2 << 12) /* (USART) 2 stop bits */#define AT91C_US_MSBF ((unsigned int) 0x1 << 16) /* (USART) Bit Order */#define AT91C_US_MODE9 ((unsigned int) 0x1 << 17) /* (USART) 9-bit Character length */#define AT91C_US_CKLO ((unsigned int) 0x1 << 18) /* (USART) Clock Output Select */#define AT91C_US_OVER ((unsigned int) 0x1 << 19) /* (USART) Over Sampling Mode */#define AT91C_US_INACK ((unsigned int) 0x1 << 20) /* (USART) Inhibit Non Acknowledge */#define AT91C_US_DSNACK ((unsigned int) 0x1 << 21) /* (USART) Disable Successive NACK */#define AT91C_US_MAX_ITER ((unsigned int) 0x1 << 24) /* (USART) Number of Repetitions */#define AT91C_US_FILTER ((unsigned int) 0x1 << 28) /* (USART) Receive Line Filter *//* -------- US_IER : (USART Offset: 0x8) Debug Unit Interrupt Enable Register -------- */#define AT91C_US_RXBRK ((unsigned int) 0x1 << 2) /* (USART) Break Received/End of Break */#define AT91C_US_TIMEOUT ((unsigned int) 0x1 << 8) /* (USART) Receiver Time-out */#define AT91C_US_ITERATION ((unsigned int) 0x1 << 10) /* (USART) Max number of Repetitions Reached */#define AT91C_US_NACK ((unsigned int) 0x1 << 13) /* (USART) Non Acknowledge */#define AT91C_US_RIIC ((unsigned int) 0x1 << 16) /* (USART) Ring INdicator Input Change Flag */#define AT91C_US_DSRIC ((unsigned int) 0x1 << 17) /* (USART) Data Set Ready Input Change Flag */#define AT91C_US_DCDIC ((unsigned int) 0x1 << 18) /* (USART) Data Carrier Flag */#define AT91C_US_CTSIC ((unsigned int) 0x1 << 19) /* (USART) Clear To Send Input Change Flag *//* -------- US_IDR : (USART Offset: 0xc) Debug Unit Interrupt Disable Register -------- *//* -------- US_IMR : (USART Offset: 0x10) Debug Unit Interrupt Mask Register -------- *//* -------- US_CSR : (USART Offset: 0x14) Debug Unit Channel Status Register -------- */#define AT91C_US_RI ((unsigned int) 0x1 << 20) /* (USART) Image of RI Input */#define AT91C_US_DSR ((unsigned int) 0x1 << 21) /* (USART) Image of DSR Input */#define AT91C_US_DCD ((unsigned int) 0x1 << 22) /* (USART) Image of DCD Input */#define AT91C_US_CTS ((unsigned int) 0x1 << 23) /* (USART) Image of CTS Input *//* ***************************************************************************** *//* SOFTWARE API DEFINITION FOR Serial Parallel Interface *//* ***************************************************************************** */typedef struct _AT91S_SPI { AT91_REG SPI_CR; /* Control Register */ AT91_REG SPI_MR; /* Mode Register */ AT91_REG SPI_RDR; /* Receive Data Register */ AT91_REG SPI_TDR; /* Transmit Data Register */ AT91_REG SPI_SR; /* Status Register */ AT91_REG SPI_IER; /* Interrupt Enable Register */ AT91_REG SPI_IDR; /* Interrupt Disable Register */ AT91_REG SPI_IMR; /* Interrupt Mask Register */ AT91_REG Reserved0[4]; AT91_REG SPI_CSR[4]; /* Chip Select Register */ AT91_REG Reserved1[48]; AT91_REG SPI_RPR; /* Receive Pointer Register */ AT91_REG SPI_RCR; /* Receive Counter Register */ AT91_REG SPI_TPR; /* Transmit Pointer Register */ AT91_REG SPI_TCR; /* Transmit Counter Register */ AT91_REG SPI_RNPR; /* Receive Next Pointer Register */ AT91_REG SPI_RNCR; /* Receive Next Counter Register */ AT91_REG SPI_TNPR; /* Transmit Next Pointer Register */ AT91_REG SPI_TNCR; /* Transmit Next Counter Register */ AT91_REG SPI_PTCR; /* PDC Transfer Control Register */ AT91_REG SPI_PTSR; /* PDC Transfer Status Register */} AT91S_SPI, *AT91PS_SPI;/* -------- SPI_CR : (SPI Offset: 0x0) SPI Control Register -------- */#define AT91C_SPI_SPIEN ((unsigned int) 0x1 << 0) /* (SPI) SPI Enable */#define AT91C_SPI_SPIDIS ((unsigned int) 0x1 << 1) /* (SPI) SPI Disable */#define AT91C_SPI_SWRST ((unsigned int) 0x1 << 7) /* (SPI) SPI Software reset */#define AT91C_SPI_LASTXFER ((unsigned int) 0x1 << 24) /* (SPI) SPI Last Transfer *//* -------- SPI_MR : (SPI Offset: 0x4) SPI Mode Register -------- */#define AT91C_SPI_MSTR ((unsigned int) 0x1 << 0) /* (SPI) Master/Slave Mode */#define AT91C_SPI_PS ((unsigned int) 0x1 << 1) /* (SPI) Peripheral Select */#define AT91C_SPI_PS_FIXED ((unsigned int) 0x0 << 1) /* (SPI) Fixed Peripheral Select */#define AT91C_SPI_PS_VARIABLE ((unsigned int) 0x1 << 1) /* (SPI) Variable Peripheral Select */#define AT91C_SPI_PCSDEC ((unsigned int) 0x1 << 2) /* (SPI) Chip Select Decode */#define AT91C_SPI_FDIV ((unsigned int) 0x1 << 3) /* (SPI) Clock Selection */#define AT91C_SPI_MODFDIS ((unsigned int) 0x1 << 4) /* (SPI) Mode Fault Detection */#define AT91C_SPI_LLB ((unsigned int) 0x1 << 7) /* (SPI) Clock Selection */#define AT91C_SPI_PCS ((unsigned int) 0xF << 16) /* (SPI) Peripheral Chip Select */#define AT91C_SPI_DLYBCS ((unsigned int) 0xFF << 24) /* (SPI) Delay Between Chip Selects *//* -------- SPI_RDR : (SPI Offset: 0x8) Receive Data Register -------- */#define AT91C_SPI_RD ((unsigned int) 0xFFFF << 0) /* (SPI) Receive Data */#define AT91C_SPI_RPCS ((unsigned int) 0xF << 16) /* (SPI) Peripheral Chip Select Status *//* -------- SPI_TDR : (SPI Offset: 0xc) Transmit Data Register -------- */#define AT91C_SPI_TD ((unsigned int) 0xFFFF << 0) /* (SPI) Transmit Data */#define AT91C_SPI_TPCS ((unsigned int) 0xF << 16) /* (SPI) Peripheral Chip Select Status *//* -------- SPI_SR : (SPI Offset: 0x10) Status Register -------- */#define AT91C_SPI_RDRF ((unsigned int) 0x1 << 0) /* (SPI) Receive Data Register Full */#define AT91C_SPI_TDRE ((unsigned int) 0x1 << 1) /* (SPI) Transmit Data Register Empty */#define AT91C_SPI_MODF ((unsigned int) 0x1 << 2) /* (SPI) Mode Fault Error */#define AT91C_SPI_OVRES ((unsigned int) 0x1 << 3) /* (SPI) Overrun Error Status */#define AT91C_SPI_ENDRX ((unsigned int) 0x1 << 4) /* (SPI) End of Receiver Transfer */#define AT91C_SPI_ENDTX ((unsigned int) 0x1 << 5) /* (SPI) End of Receiver Transfer */#define AT91C_SPI_RXBUFF ((unsigned int) 0x1 << 6) /* (SPI) RXBUFF Interrupt */#define AT91C_SPI_TXBUFE ((unsigned int) 0x1 << 7) /* (SPI) TXBUFE Interrupt */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -