Internal Register Definitions
[Memory-Mapped Input/Output (MMIO)]

Collaboration diagram for Internal Register Definitions:

Modules

 Xmega Clock Register Definitions
 Xmega Oscillator Register Definitions
 XMEGA Power Reduction Register Definitions
 I/O Ports Register Definitions
 Port Configuration
 SPI Register Defintions
 XMEGA TC Register Definitions
 EBI Register Definitions
 EBI Chip Select Register Definitions
 ADC Register Definitions
 ADC Channel Register Definitions

Detailed Description

This group contains definitions of the internal registers on all supported chips. Some of the register interfaces are highly chip-dependent, but most of them are usable with only minor variations over a wide range of chips.

Common Conventions

Each module may define convenience wrappers for the MMIO accessor functions which will paste in the correct module prefix and do other transformations as appropriate. Most modules use the form

    <module>_read_reg(base, reg)
    <module>_write_reg(base, reg, value)

where module is the short name of the module in all lowercase, base is the base address of the module instance, reg is the name of the register without the module prefix, and value is the value to be written to the register. Modules of which there will never be more than one instance (e.g. the Power Manager), may leave out the base argument and provide the correct value automatically using the definitions in chip/memory-map.h.

All registers are defined as an offset relative to the base address of the module. This ensures that the same register definitions may be used for all modules on a chip with multiple modules of the same type. The constants are named in all uppercase using the short name of the module and the name of the register as specified by the data sheet, separated by an underscore character.

Single bits in the register are specified as a single bit number indicating the position of the bit counting from the LSB. The name is on the form module_register_name_BIT, in all uppercase. A bit definition may be turned into a bit mask by passing it through the module_BIT() macro.

Multi-bit fields in the register are specified by two definitions:

Bit and bitfield definitions which are used with multiple registers (for example interrupt flags) may drop the reg part of the name.

The single- and multi-bit field definitions may be used as is in manual shift and mask operations. However, the most common bit manipulations are supported by a set of helper macros:

Constants indicating special values that certain bitfields may be set to have names on the form module_bitfield_name in all uppercase. The value is not shifted, so the user is responsible for shifting the value into the correct bitfield, for example by passing it to one of the bit manipulation macros above.

Generated on Thu Apr 29 14:10:00 2010 for display-demo by  doxygen 1.6.3