5.5.1 IO Port Access

In a system with separate IO space and memory space, an IO port access function accesses IO space. In a system with memory-mapped IO only, an IO port access function accesses memory space. Using these functions will improve software portability and readability even in a memory-mapped IO system.

— _w Word (32-bit) units

—_h Half-word (16-bit) units

—_b Byte (8-bit) units

  • void out_w( INT port, UW data )
  • void out_h( INT port, UH data )
  • void out_b( INT port, UB data )

port IO port address data Data to be written

Writes data to an IO port.

  • UW in_w( INT port )
  • UH in_h( INT port )
  • UB in_b( INT port ) port IO port address return code Data to be read

Reads data from an IO port.

Comments