SPRAA85E November 2005 – December 2017 SM320F2812 , SM320F2812-EP , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F2801 , TMS320F2801-Q1 , TMS320F2802 , TMS320F2802-Q1 , TMS320F28044 , TMS320F2806 , TMS320F2806-Q1 , TMS320F28062 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28063 , TMS320F28064 , TMS320F28065 , TMS320F28066 , TMS320F28066-Q1 , TMS320F28067 , TMS320F28067-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069 , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1 , TMS320F28075 , TMS320F28075-Q1 , TMS320F2808 , TMS320F2808-Q1 , TMS320F2809 , TMS320F2810 , TMS320F2810-Q1 , TMS320F2811 , TMS320F2811-Q1 , TMS320F2812 , TMS320F2812-Q1 , TMS320F28232 , TMS320F28232-Q1 , TMS320F28234 , TMS320F28234-Q1 , TMS320F28235 , TMS320F28235-Q1 , TMS320F28332 , TMS320F28333 , TMS320F28334 , TMS320F28335 , TMS320F28335-Q1 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S , TMS320R2811
Example 1 showed a hardware abstraction implementation using #define macros. In this section, the implementation is changed to a simple register file structure. Table 2 lists the registers that belong to the SCI peripheral. This register file is identical for each instance of the SCI, i.e., SCI-A and SCI-B.
Name | Size | Address Offset | Description |
---|---|---|---|
SCICCR | 16 bits | 0 | SCI Communications Control Register |
SCICTL1 | 16 bits | 1 | SCI Control Register 1 |
SCIHBAUD | 16 bits | 2 | SCI Baud Register, High Bits |
SCILBAUD | 16 bits | 3 | SCI Baud Register, Low Bits |
SCICTL2 | 16 bits | 4 | SCI Control Register 2 |
SCIRXST | 16 bits | 5 | SCI Receive Status Register |
SCIRXEMU | 16 bits | 6 | SCI Receive Emulation Data Buffer Register |
SCIRXBUF | 16 bits | 7 | SCI Receive Data Buffer Register |
SCITXBUF | 16 bits | 9 | SCI Transmit Data Buffer Register |
SCIFFTX | 16 bits | 10 | SCI FIFO Transmit Register |
SCIFFRX | 16 bits | 11 | SCI FIFO Receive Register |
SCIFFCT | 16 bits | 12 | SCI FIFO Control Register |
SCIPRI | 16 bits | 15 | SCI Priority Control Register |
The code in Example 3 groups the SCI registers together as members of a C/C++ structure. The register in the lowest memory location is listed first in the structure and the register in the highest memory location is listed last. Reserved memory locations are held with variables that are not used except as space holders, for example, rsvd1, rsvd2, rsvd3, and so forth. The register's size is indicated by its type: Uint16 for 16-bit (unsigned int) and Uint32 for 32-bit (unsigned long). The SCI peripheral registers are all 16-bits so only Uint16 has been used.