API Reference: Libraries

 Top

pitx-sp_gpio

NAME

pitx-sp_gpio - GPIO driver for pITX-SP

ROUTINES

pitxGpioGetCount( ) - get number of active GPIOs
pitxGpioGetDirectionCaps( ) - get possible directions of a selected GPIO
pitxGpioGetDirection( ) - get the current direction of a selected GPIO (1 - output)
pitxGpioSetDirection( ) - set direction for a selected GPIO
pitxGpioGetLevel( ) - get level of a selected input GPIO
pitxGpioSetLevel( ) - set level of a selected output GPIO
pitxGpioSetTriState( ) - enable tri-state for a selected output GPIO
pitxGpioIntEnable( ) - enable/disable interrupt for a selected GPIO
pitxGpioSetIntPolarity( ) - set interrupt polarity (rising or falling edge) for a selected GPIO

DESCRIPTION

Functions to control GPIOs implemented in the pITX-SP CPLD. (KEAPI compatible).

For details see: KTD-S0003-C pITX-SP Software Guide


API Reference: Routines

 Top

pitxGpioGetCount( )

NAME

pitxGpioGetCount( ) - get number of active GPIOs

SYNOPSIS

void pitxGpioGetCount(UINT32 *pGpioCount)

DESCRIPTION

This function returns the number of active GPIOs

PARAMETERS

pGpioCount [out] - number of active GPIOs

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioGetDirectionCaps( )

NAME

pitxGpioGetDirectionCaps( ) - get possible directions of a selected GPIO

SYNOPSIS

void pitxGpioGetDirectionCaps(UINT32 gpioNr, BOOL *pIsInput, BOOL *pIsOutput)

DESCRIPTION

This function returns possible directions of a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      pIsInput [out] - TRUE if input is supported.
      pIsOutput [out] - TRUE if output is supported.

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioGetDirection( )

NAME

pitxGpioGetDirection( ) - get the current direction of a selected GPIO (1 - output)

SYNOPSIS

void pitxGpioGetDirection(UINT32 gpioNr, UINT8 *pDir)

DESCRIPTION

This function returns the current direction of a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      pDir [out] - direction : 0 is input, 1 is output

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioSetDirection( )

NAME

pitxGpioSetDirection( ) - set direction for a selected GPIO

SYNOPSIS

void pitxGpioSetDirection(UINT32 gpioNr, UINT8 dir)

DESCRIPTION

This function sets direction for a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      dir [in] - direction : 0 is input, 1 is output

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioGetLevel( )

NAME

pitxGpioGetLevel( ) - get level of a selected input GPIO

SYNOPSIS

void pitxGpioGetLevel(UINT32 gpioNr, UINT8 *pLevel)

DESCRIPTION

This function returns level of a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      pLevel [out] - level : 0 or 1

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioSetLevel( )

NAME

pitxGpioSetLevel( ) - set level of a selected output GPIO

SYNOPSIS

void pitxGpioSetLevel(UINT32 gpioNr, UINT8 Level)

DESCRIPTION

This function sets level of a selected output GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      Level [in] - level : 0 or 1

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioSetTriState( )

NAME

pitxGpioSetTriState( ) - enable tri-state for a selected output GPIO

SYNOPSIS

void pitxGpioSetTriState(UINT32 gpioNr, UINT8 State)

DESCRIPTION

This function sets/resets tri-state for a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      State [in] - 1 : tri-state is enabled; 0 : normal output

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioIntEnable( )

NAME

pitxGpioIntEnable( ) - enable/disable interrupt for a selected GPIO

SYNOPSIS

void pitxGpioIntEnable(UINT32 gpioNr, UINT8 State)

DESCRIPTION

This function enables/disables interrupt for a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      State [in] - 1 : interrupt is enabled; 0 : interrupt is disabled

RETURNS

N/A

ERRNO

SEE ALSO

pitx


API Reference: Routines

 Top

pitxGpioSetIntPolarity( )

NAME

pitxGpioSetIntPolarity( ) - set interrupt polarity (rising or falling edge) for a selected GPIO

SYNOPSIS

void pitxGpioSetIntPolarity(UINT32 gpioNr, UINT8 Pol)

DESCRIPTION

This function sets interupt polarity for a selected GPIO

PARAMETERS

      gpioNr [in] - number of GPIO.
      Pol [in] - 1 : rising edge; 0 : falling edge

RETURNS

N/A

ERRNO

SEE ALSO

pitx