Analog Open-Drain Pins

Description

General-purpose analog + open-drain pins (can drive to GND, for cap. touch)

This resource implements a single or an array of analog + open-drain pins. For capacitive touch sensing the open-drain functionality is used to speed up clamping of the ISRC output, and to prevent the touch areas from floating between measurements. 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-drain 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 (and output for ISRC), used for capacitive touch sensing
  • compaSelectGpioRef() : Selects external reference for COMPA

For capacitive touch sensing, analog (ISRC) + digital clamping is controlled by isrcClamp() and isrcRelease() . For use-cases without ISRC, digital clamping to ground is enabled and disabled using gpioClearOutput() and gpioSetOutput() , respectively.

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.

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_AXD_XYZ is created automatically
    • If selecting accessed by look-up table , a data structure member cfg.pAuxioAxdXyz[] 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_AXD_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)