Class GPIOPAL

Inheritance Relationships

Derived Type

Class Documentation

class GPIOPAL

Subclassed by tle5012::GPIOIno

Interrupt event

enum IntEvent_t

Values:

enumerator INT_FALLING_EDGE

Interrupt on falling edge

enumerator INT_RISING_EDGE

Interrupt on rising edge

Voltage level

enum VLevel_t

Values:

enumerator GPIO_LOW

Level low

enumerator GPIO_HIGH

Level high

Voltage logic

enum VLogic_t

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:

GPIO error code

virtual Error_t deinit() = 0

Deinitialize the GPIO.

Return values:
  • OK – if success

  • INIT_ERROR – if deinitialization error

Returns:

GPIO error code

virtual Error_t changeMode(uint8_t mode) = 0

Changes the IN/OUT mode.

Parameters:

mode[in] INPUT or OUTPUT mode of pin

Return values:
  • OK – if success

  • INIT_ERROR – if deinitialization error

Returns:

GPIO 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:

GPIO voltage level

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:

GPIO 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:

GPIO interrupt event

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:

GPIO error code