Registers

Peripheral Control Registers

In most systems, peripheral control registers are located in memory space and are memory-mapped, so they are easily accessed in C in the same ways that any memory location is read or written.

I/O Space Register Access

These registers are used to set some I/O pins as Input or Output, and they can be only accessed by using assembly language or specialized libraries. These are commonly referred as GPIO pin registers.

General description of GPIO here.

GPIO in Linux here.

Example

For a beautiful example on how to use registers see Chapter 3 of Programming Embedded Systems, Barr & Massa.