librpipGpioConfigPinRead

uint32_t librpipGpioConfigPinRead(uint32_t pin, uint32_t* flags);

Description

Gets the configuration a GPIO pin. Note that it is not possible to read back the pull up/down status. They persists across power down when all registers get cleared. It is up to you to manage the pull up/down status.

Parameters

  • uint32_t pin
    The pin number to read configuration from. The pin should be valid.
  • uint32_t* flags
    A pointer to a uint32_t that will hold the flags. Compare with LIBRPIP_GPIO_FLAG_* constants to establish what flags are set.

Returns

0 on failure, 1 on success.

Example

Read the configuration of GPIO pin 16:

uint32_t feature_set, flags;
feature_set = librpipInit(LIBRPIP_BOARD_DETECT, LIBRPIP_FLAG_DEBUG_ON, 0);
if(feature_set & LIBRPIP_FEATURE_GPIO) { 
        librpipGpioConfigPinRead(16, &flags);

}
librpipClose();