Memory-Mapped Input/Output (MMIO)

Collaboration diagram for Memory-Mapped Input/Output (MMIO):

Modules

 Internal Register Definitions

Functions

static uint16_t mmio_read16 (const void *p)
 16-bit read from I/O register
static void mmio_write16 (void *p, uint16_t val)
 16-bit write to I/O register
void mmio_ccp_write8 (void *addr, uint8_t value)
 Write to a CCP-protected 8-bit register.

Detailed Description

These accessors are used to access memory-mapped I/O registers on the chip as well as external devices hooked up through the external bus interface. Accessing such registers usually have side-effects, so these accessors ensure that the registers are accessed exactly as many times as specified.

Traditionally, such registers are accessed through pointers declared as "volatile", but using dedicated accessors has a number of advantages:


Function Documentation

void mmio_ccp_write8 ( void *  addr,
uint8_t  value 
)

Write to a CCP-protected 8-bit register.

Parameters:
addr Address of the I/O register
value Value to be written
static uint16_t mmio_read16 ( const void *  p  )  [inline, static]

16-bit read from I/O register

Reads LSB from address p and MSB from address p+1, in this order.

Note:
Interrupts are not disabled in this function. This must be done in the calling code if interrupts can corrupt reads, i.e., they access 16-bit registers in the same peripheral module and at the same time as this function.
Parameters:
p Address of LSB I/O register to read from

Definition at line 72 of file io.h.

static void mmio_write16 ( void *  p,
uint16_t  val 
) [inline, static]

16-bit write to I/O register

Writes LSB to address p and MSB to address p+1, in this order.

Note:
Interrupts are not disabled in this function. This must be done in the calling code if interrupts can corrupt writes, i.e., they access 16-bit registers in the same peripheral module and at the same time as this function.
Parameters:
p Address of LSB I/O register to write to
val 16-bit value to write to registers

Definition at line 95 of file io.h.

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