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
/////////////////////////////////////////////////////////////////////
//
// Snippet from hw_memmap.h showing base address #defines
//
/////////////////////////////////////////////////////////////////////
...
#define SCIA_BASE 0x00007050U // SCI A Registers
#define SCIB_BASE 0x00007750U // SCI B Registers
...
/////////////////////////////////////////////////////////////////////
//
// Snippet from sci.h showing API description and base parameter
//
/////////////////////////////////////////////////////////////////////
//
//! Sets the FIFO interrupt level at which interrupts are generated.
//!
//! \param base is the base address of the SCI port.
//!
//! \param txLevel is the transmit FIFO interrupt level, specified as
//! one of the following:
//! SCI_FIFO_TX0, SCI_FIFO_TX1, SCI_FIFO_TX2, ... or SCI_FIFO_TX16.
//!
//! \param rxLevel is the receive FIFO interrupt level, specified as one
//! of the following:
//! SCI_FIFO_RX0, SCI_FIFO_RX1, SCI_FIFO_RX2, ... or SCI_FIFO_RX16.
//!
//! This function sets the FIFO level at which transmit and receive
//! interrupts are generated.
//!
//! \return None.
//
static inline void
SCI_setFIFOInterruptLevel(uint32_t base, SCI_TxFIFOLevel txLevel,
SCI_RxFIFOLevel rxLevel)
For the other parameters, #defines or enumerated types are often supplied to provide a readable way to specify the desired value. Typically #defines are used when a parameter is a uint32_t or uint16_t and able to take a bitwise OR of several #defined values. Enumerated types are used when only a single value is applicable.
These values determine what is written to the peripheral registers to configure the peripheral. The function will determine which register or registers to write to and what value to write. The function will also perform any necessary EALLOW or EDIS instructions. Since these details are hidden by the functions, it is not required for the user to have complete knowledge of the hardware to program a peripheral. Example 28 shows code that could be found in a user application that demonstrates this; given a source clock rate and a desired baud rate, the function calculates the necessary prescalers and writes them to the appropriate registers.