Analog Open-Source Pins

Description

General-purpose analog + open-source pins (can drive to VDDS)

This resource implements a single or an array of analog + open-source pins. The open-source functionality can be used to clamp the analog pin to VDDS. The pins are mapped in the I/O Mapping Panel .

When the SCIF driver is initialized, the pins are configured to operate in analog + open-source mode, but are not yet connected physically to the peripherals. The connection is done at run-time by calling one of the following procedures from task code:

  • adcSelectGpioInput() : Selects external input for ADC (and COMPB)
  • compaSelectGpioInput() : Selects external input for COMPA
  • compaSelectGpioRef() : Selects external reference for COMPA

When the SCIF driver is uninitialized, the pins are returned to the MCU domain GPIO module, with no pull. Note that the uninitialization does not modify the GPIO module’s output enable settings, and it is assumed that the pins have not been configured as outputs.

Digital clamping to VDDS is enabled and disabled using gpioSetOutput() and gpioClearOutput() , respectively.

Name and Label

A short name and a descriptive label must be specifed for each I/O usage:

  • The name is used for references in task code, for example as parameter to compaSelectGpioRef() . For a name XYZ:
    • If selecting accessed by constant , a single constant AUXIO_AXS_XYZ is created automatically
    • If selecting accessed by look-up table , a data structure member cfg.pAuxioAxsXyz[] is created automatically
  • The label is displayed in the I/O Mapping Panel , and is also used in automatically generated code documentation

Output Drive Strength

Output drive strength is configurable per resource I/O usage, with the same options as in the SDK-provided PIN or GPIO driver.

See the device datasheet to find which I/O pins have high-drive capability.

Examples

Selecting COMPA Input

// Select COMPA input (and ISRC output)
compaSelectGpioInput(AUXIO_AXS_SIGNAL);

Procedures Overview

Name Brief description
gpioClearOutput() Clears a single GPIO output pin (to low). More …
gpioSetOutput() Sets a single GPIO output pin (to high). More …
gpioToggleOutput() Toggles a single GPIO output pin (to low if previously high, or to high if previously low). More …
gpioWaitForLevel() Waits forever for the specified level on the specified GPIO pin. More …
gpioWaitForLevelUs() Waits for the specified level on the specified I/O pin, or until the specified number of microseconds have elapsed. More …

Constants

None.

Global Variables

None.

Procedures

gpioClearOutput

Prototype: gpioClearOutput(auxio)

Clears a single GPIO output pin (to low).

Note: This procedure is more efficient if the auxio parameter is specifed as a constant (rather than a variable).

Parameter value(s)

  • auxio : The GPIO pin to be cleared (index of AUX I/O pin)

gpioSetOutput

Prototype: gpioSetOutput(auxio)

Sets a single GPIO output pin (to high).

Note: This procedure is more efficient if the auxio parameter is specifed as a constant (rather than a variable).

Parameter value(s)

  • auxio : The GPIO pin to be set (index of AUX I/O pin)

gpioToggleOutput

Prototype: gpioToggleOutput(auxio)

Toggles a single GPIO output pin (to low if previously high, or to high if previously low).

Note: This procedure is more efficient if the auxio parameter is specifed as a constant (rather than a variable).

Parameter value(s)

  • auxio : The GPIO pin to be toggled (index of AUX I/O pin)

gpioWaitForLevel

Prototype: gpioWaitForLevel(auxio, #level)

Waits forever for the specified level on the specified GPIO pin.

Parameter value(s)

  • auxio : The GPIO pin to be cleared (index of AUX I/O pin)
  • #level : GPIO level to wait for

gpioWaitForLevelUs

Prototype: gpioWaitForLevelUs(auxio, #level, timeout)

Waits for the specified level on the specified I/O pin, or until the specified number of microseconds have elapsed.

Parameter value(s)

  • auxio : The GPIO pin to be cleared (index of AUX I/O pin)
  • #level : GPIO level to wait for
  • timeout : Timeout value in microseconds (1-65535)