src/drivers/ssd_gpio.c
/* ========================================================================== */
/**
 * @details This function implements the following objectives:
 *		-# Initialise the RPi pin connected (in some way) to the RESET pin on
 *				the SSD1803A such that:
 *			- Mode of the pin is an input, and
 *			- Pull of the pin is to the inactive level of the pin.
 *
 * @retval STATUS_OK If the GPIO hardware was successfully deinitialised.
 * @retval STATUS_NOT_INITIALISED If the GPIO hardware had not been previously
 * initialised with a call to gpio_init().
 * @retval STATUS_INVALID_GPIO, STATUS_INVALID_MODE, STATUS_INVALID_LEVEL, and
 * STATUS_INVALID_PUD are theoretically possible return values from the function
 * gpioSetMode/gpioSetPullUpDown, however they should never occur due to the
 * restrictions on the data type active_level_t.
 * ========================================================================== */
@details This function implements the following objectives:
-# Initialise the RPi pin connected (in some way) to the RESET pin on
the SSD1803A such that:
- Mode of the pin is an input, and
- Pull of the pin is to the inactive level of the pin.

@retval STATUS_OK If the GPIO hardware was successfully deinitialised.
@retval STATUS_NOT_INITIALISED If the GPIO hardware had not been previously
initialised with a call to gpio_init().
@retval STATUS_INVALID_GPIO, STATUS_INVALID_MODE, STATUS_INVALID_LEVEL, and
STATUS_INVALID_PUD are theoretically possible return values from the function
gpioSetMode/gpioSetPullUpDown, however they should never occur due to the
restrictions on the data type active_level_t.
@details This function implements the following objectives : - # Initialise the RPi pin connected ( in some way ) to the RESET pin on the SSD1803A such that : - Mode of the pin is an input and - Pull of the pin is to the inactive level of the pin . @retval STATUS_OK If the GPIO hardware was successfully deinitialised . @retval STATUS_NOT_INITIALISED If the GPIO hardware had not been previously initialised with a call to gpio_init () . @retval STATUS_INVALID_GPIO STATUS_INVALID_MODE STATUS_INVALID_LEVEL and STATUS_INVALID_PUD are theoretically possible return values from the function gpioSetMode / gpioSetPullUpDown however they should never occur due to the restrictions on the data type active_level_t .
status_t gpio_deinit(void) {
	if (!m_HardwareResetEnabled) {
		return STATUS_OK;
	}
	if (m_Pin == STATUS_INVALID_GPIO) {
		LOG_TO_STDERR();
		return STATUS_NOT_INITIALISED;
	}
	status_t ret = gpioSetMode((uint8_t)m_Pin, PI_INPUT);
	if (ret != STATUS_OK) {
		LOG_TO_STDERR();
		return ret;
	}
	ret = gpioSetPullUpDown((uint32_t)m_Pin, !m_ActiveLevel);
	if (ret != STATUS_OK) {
		LOG_TO_STDERR();
	}
	return ret;
}
status_t gpio_deinit ( void ) { if ( ! m_HardwareResetEnabled ) { return STATUS_OK ; } if ( m_Pin == STATUS_INVALID_GPIO ) { LOG_TO_STDERR ( ) ; return STATUS_NOT_INITIALISED ; } status_t ret = gpioSetMode ( ( uint8_t ) m_Pin , PI_INPUT ) ; if ( ret != STATUS_OK ) { LOG_TO_STDERR ( ) ; return ret ; } ret = gpioSetPullUpDown ( ( uint32_t ) m_Pin , ! m_ActiveLevel ) ; if ( ret != STATUS_OK ) { LOG_TO_STDERR ( ) ; } return ret ; }
@details This function implements the following objectives:
              -# Initialise the RPi pin connected (in some way) to the RESET pin on
                              the SSD1803A such that:
                      - Mode of the pin is an input, and
                      - Pull of the pin is to the inactive level of the pin.
@details This function implements the following objectives : - # Initialise the RPi pin connected ( in some way ) to the RESET pin on the SSD1803A such that : - Mode of the pin is an input and - Pull of the pin is to the inactive level of the pin .
/* Hardware reset is not enabled */ /* GPIO has not been previously initialised */ /* Deinitialise the SSD1803A enable pin on the RPi */