Software Driven Shield Application Programming Interfaces (APIs)

Last modified by Microchip on 2026/02/20 10:52

DO_NOT_REMOVE

The Application Programming Interfaces (APIs) defined in this section are applicable only for devices that support the software driven shield option.

drivenshield_configure

void drivenshield_configure(void)

Description: The drivenshield_configure function initializes all driven shield-related APIs required by the touch library. It configures additional peripherals like Direct Memory Access (DMA), Event System (EVSYS), Timer/Counter (TC)/Timer/Counter for Control Applications (TCC) as required.

Parameters: None

Return: None

Back to Top

drivenshield_start

void drivenshield_start(uint8_t csd, uint8_t sds, uint8_t prescaler, uint8_t volatile *dst_addr, uint8_t value)

Description: This function is called by the touch library before starting the dummy measurement. Here, EVSYS is configured to map a Peripheral Touch Controller (PTC) End Of Conversion (EOC) event to start DMA transfer and a DMA transfer complete event to start PTC measurement. Timer’s count, period and compare channel registers are configured based on the current channel’s Charge Share Delay (CSD), prescaler and acquisition frequency. The EVENT generated from the dummy measurement will start a DMA conversion (to configure proper oversampling to PTC) and when the DMA transfer is completed, PTC measurement is started using EVSYS. For some devices, Filter Level registers are 32-bit.

Parameters:

TypeDescription.
uint8_tCurrent Channel’s CSD Value
uint8_tIndicates current acquisition frequency
uint8_tCurrent Channel’s Prescaler Value
uint8_t volatile *Address of PTC’s Filter Level Register. For some devices Filter Level registers are 32-bit
uint8_tFilter Level value that needs to be written. For some devices Filter Level values are 32-bit

Return: None

Back to Top

drivenshield_port_mux_config

void drivenshield_port_mux_config(uint8_t pin, uint8_t mux)

Description: This reconfigures the pin to the timer or PTC (depends on the mux value).

Parameters:

TypeDescription
uint8_tPin Details
uint8_tMux Value

Return: None

Back to Top

drivenshield_stop

void drivenshield_stop(void)

Description: This disables driven shield by disabling the timer peripheral.

Parameters: None

Return: None

Back to Top