User Manual Please read the Important Notice and Warnings at the end of this document Version 5.0
www.infineon.com page 1 of 17 2019-01-14
R E S T R I C T E D
Special Function Registers
32-bit TriCore™ AURIX™ TC3xx microcontroller family
About this document
Scope and purpose
This User Manual provides an overview of the Special Function Register headers and explains how to use the
header files, in general, with any of the targeted microcontroller product.
Note: This document contains examples, which may carry specific register name from specific product.
These are to be treated as examples only and may or may not be correct to their actual hardware
function in a product.
Intended audience
This document is intended for anyone using the Special Function Register files.
Glossary of terms
Table 1 Glossary
Reference document
This User Manual should be read in conjunction with the following document:
TC3xx User Manual / Target Specification [Corresponding version in Release Notes]
Term
Description
IFX
Infineon Technologies
MCU
Micro Controller Unit
SFR
Special Function Registers
AoU
Assumptions of Use
µC
Micro Controller
UM
User Manual
TS
Target Specification
User Manual 2 of 17 Version 5.0
2019-01-14
Special Function Register User Manual
32-bit TriCore™ AURIX™ TC3xx microcontroller family
Table of contents
R E S T R I C T E D
Table of contents
About this document ............................................................................................................................1
Table of contents ................................................................................................................................. 2
1 Introduction ................................................................................................................................3
2 Including SFR headers ................................................................................................................. 4
2.1 Package structure ............................................................................................................................... 4
2.2 SFR header files naming ..................................................................................................................... 4
2.3 Include structure within the SFR header files ...................................................................................... 5
2.4 Hints on including the register header files .........................................................................................6
2.4.1 Usage with peripheral driver files ..................................................................................................6
2.4.2 Access SFRs from more than one peripheral ..................................................................................6
2.4.3 Handling different derivatives ....................................................................................................... 7
3 Accessing individual registers ....................................................................................................... 8
3.1 Accessing the register targeting an individual bit-field ....................................................................... 8
3.2 Accessing the register targeting multiple bit-fields ............................................................................ 8
3.3 Accessing the registers with its bit mask values ..................................................................................9
4 Accessing register through grouped structures ............................................................................. 11
5 Specific hints ............................................................................................................................. 12
5.1 Dos and Don’ts ................................................................................................................................. 12
6 Assumptions of Use (AoU) .......................................................................................................... 14
7 PC Lint + MISRA ......................................................................................................................... 15
Revision history .................................................................................................................................. 16
User Manual 3 of 17 Version 5.0
2019-01-14
Special Function Register User Manual
32-bit TriCore™ AURIX™ TC3xx microcontroller family
Introduction
R E S T R I C T E D
1 Introduction
The product, SFR header files, is the bridge to connect software domain with microcontroller hardware domain.
Software accessibility to microcontroller hardware is, always, only through the registers. These are commonly
called as Special Function Registers (SFR). These registers in a way carry the commands, configuration or status
to and from the microcontroller hardware. Each of the registers contains important attributes called as bit-fields.
Each bit-field of a register represents specific functionality. The User Manual of microcontroller hardware
product states the accessible registers along with their bit-field and their respective functionalities.
As the microcontroller hardware is very sensitive to the information these bit-fields carry the user commands or
configuration. Software functionalities are also sensitive to these bit-fields, which carry the status information.
Because of this sensitivity, the registers with their bit-fields are crucial for both the domains, that is, software and
hardware to function together to fulfil the intended functionality.
SFR header files are C language representation of microcontroller registers because most of the software
functionality are constructed with the C language (on the contrary the header files for assembly language are
Register ASM headers).
Note: This product targets to represent only C language and not assembly language usage.
Figure 1 Register memory map notations
User Manual representation of registers memory map
C header file representation of registers memory map
User Manual 4 of 17 Version 5.0
2019-01-14
Special Function Register User Manual
32-bit TriCore™ AURIX™ TC3xx microcontroller family
Including SFR headers
R E S T R I C T E D
2 Including SFR headers
This section provides an overview of the package structure, file naming conventions and including the register
headers in different use-cases.
2.1 Package structure
A separate SFR Header files package is delivered for each microcontroller derivative. User must choose the
correct package for the target microcontroller.
The release contains individual packages for each microcontroller. These are an installer packages with the name
same as their version tag.
Figure 2 SFR Header release package name tag
For example:
Package REG_TC39XB_UM/TS_V2.3.0.R0.exe
Contains registers for TC39xB derivative
Registers are generated from UM/TS SFR reference file version 2.3.0
R0 represents the first incremental release for the generated registers from same file
Once the package is installed, the following folders are created:
Table 2
Folder
Description
_Reg
Contains actual C header files, which are to be
included in to the applications
SupportDocuments
Contains documents to support user during
development and project quality audits. User Manual
is also a part of the SupportDocuments.
2.2 SFR header files naming
For each peripheral within the microcontroller, SFR representation is realized with three different files.
REG_<µC Derivative>_<UM/TS>_<Version of UM/TS>.R<Register C Header Files Rev>.exe
Incremental revision number of the generated C header files
Version of the SFR UM/TS
UM: User Manual as SFR reference; TS: Target Spec as SFR reference
Target µC Name
User Manual 5 of 17 Version 5.0
2019-01-14
Special Function Register User Manual
32-bit TriCore™ AURIX™ TC3xx microcontroller family
Including SFR headers
R E S T R I C T E D
REGDEF files: definition of Register/Peripheral Module Types: Representation of hardware register memory
map or bit-field map for any peripheral are done through structure and union type definitions
Naming convention: Ifx<peripheral name>_regdef.h
− where, peripheral name represents the peripheral IP name of the microcontroller. For example,
IfxCpu_regdef.h, IfxCan_regdef.h and IfxGeth_regdef.h
− for peripheral IPs such as MCMCAN, the generic name CAN is used
REG files: definition of register memory map: Register memory map representation of any peripheral is done
through #define macros assigning the register names to their memory address.
Naming convention: Ifx<peripheral name>_reg.h
− where, peripheral name represents the peripheral IP name of the microcontroller. For example,
IfxCpu_reg.h, IfxCan_reg.h and IfxGeth_reg.h
BF files: definitions of register bit-fields to use the masked way of register access are done in BF files. These
files contain the register bit-field mask, bit-field length and bit-field position.
Naming convention: Ifx<peripheral name>_bf.h
− where, peripheral name represents the peripheral IP name of the microcontroller. For example,
IfxCpu_bf.h, IfxCan_bf.h and IfxGeth_bf.h
SUPERSET REG file: includes all the individual peripherals registers in one file. This is useful when an
application use the registers from many different modules.
File name: Ifx_reg.h
BASICTYPES: define the basic data types for the Registers bit-fields. Some of the registers need the special
keyword to tell the compiler that, such registers bit-fields can only be accessed as 32- or 16-bit. Compiler will
not optimize access to such register bit-fields.
File name: Ifx_TypesReg.h
2.3 Include structure within the SFR header files
SFR headers files have fixed include structure hierarchy in such a way that user has flexibility and ease of use
across different use cases. The following figure depicts the hierarchy.
- 1
- 2
前往页