Hardware Registers

This document describes how device drivers use hardware registers.

The APIs to access hardware peripheral registers are provided by a Symbian base port. For example, the base port for the OMAP 2420 provides the TOmap::SetRegister() and TOmap::GetRegister() functions to access its peripheral controller registers. Peripheral drivers would generally use these APIs. Some examples:

  1. To set the UART LCR register:

    TOmap::SetRegister8(iPortAddr+KHoUART_LCR, KHbUartLCRFifoConfig);
  2. To get the UART MDR register:

    TOmap::Register8(iPortAddr+KHoUART_MDR1)
  3. To modify only the specified bits of the register: here, the UART LCR register bit 6 is being set to 0 (LCR[6] = 0)

    TOmap::ModifyRegister8(iPortAddr+KHoUART_LCR,
                      (TUint8)KHtUartLCRBreakEnable,
                      (TUint8)KSetNone);