4.32. IO

4.32.1. Module Files

4.32.1.1. Driver

  • src/app/driver/io/io.c

  • src/app/driver/io/io.h

4.32.1.2. Configuration

none

4.32.1.3. Unit Test

  • tests/unit/app/driver/io/test_io.c

4.32.2. Detailed Description

The IO module provides small helper functions for bit-based access to memory-mapped peripheral registers used as GPIO-like control and status registers.

It abstracts common operations used throughout the driver layer:

  • configure a pin direction as output,

  • configure a pin direction as input,

  • set an output pin,

  • reset an output pin,

  • read and decode a pin state.

4.32.2.1. API Behavior

All functions validate their inputs using assertions:

  • register pointer must not be NULL_PTR,

  • pin index must be within the supported MCU bit range.

4.32.2.2. Implementation Details

The implementation in io.c performs direct bit manipulation on the passed register address:

  • output direction/set operations use bitwise OR,

  • input direction/reset operations use bitwise AND with inverted mask,

  • pin read operation extracts the addressed bit and returns STD_PIN_LOW or STD_PIN_HIGH.

The module does not own any state and does not perform hardware initialization by itself; it is used by other modules that pass the appropriate register addresses and pin numbers.