Class GPIOPAL

Inheritance Relationships

Derived Type

Class Documentation

class GPIOPAL

GPIO abstract API.

Subclassed by hss::GPIOIno

Public Types

enum IntEvent_t

Interrupt event.

Values:

enumerator INT_FALLING_EDGE

Interrupt on falling edge

enumerator INT_RISING_EDGE

Interrupt on rising edge

enum VLevel_t

Voltage level.

Values:

enumerator GPIO_LOW

Level low

enumerator GPIO_HIGH

Level high

enum VLogic_t

Voltage logic.

Values:

enumerator NEGATIVE

Negative logic. 0 on voltage level high, 1 on voltage low

enumerator POSITIVE

Positive logic. 1 on voltage level high, 0 on voltage low

Public Functions

virtual Error_t init() = 0

Initializes the GPIO.

Return values:
  • OK – If success

  • INIT_ERROR – If initialization error

Returns:

High-side switch error code

virtual Error_t deinit() = 0

Deinitializes the GPIO.

Return values:
  • OK – If success

  • INIT_ERROR – If deinitialization error

Returns:

High-side switch error code

virtual VLevel_t read() = 0

Reads the GPIO voltage level.

Return values:
  • GPIO_LOW – If voltage low

  • GPIO_HIGH – If voltage high

Returns:

VLevel_t

virtual Error_t write(VLevel_t level) = 0

Writes the GPIO output voltage level.

Parameters:

level[in] Voltage level

Return values:
  • OK – If success

  • WRITE_ERROR – If write error

Returns:

High-side switch error code

virtual Error_t enable() = 0

Enables the GPIO output according to the GPIO logic.

  • Low if negative

  • High if positive

Return values:
  • OK – If success

  • WRITE_ERROR – If write error

Returns:

High-side switch error code

virtual Error_t disable() = 0

Disables the GPIO output according to the GPIO logic.

  • Low if positive

  • High if negative

Return values:
  • OK – If success

  • WRITE_ERROR – If write error

Returns:

High-side switch error code