3.2.4 Software Driven Shield APIs

The APIs defined in this sections are applicable only for devices which support the software drivenshield option.

void drivenshield_configure(void)

Description: Initializes Driven Shield related APIs for the Touch library, and configures additional peripherals like DMA, EVSYS, TC/TCC, as required.

Parameters: None.

Return: None.

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

Description: Called by touch library before starting the dummy measurement. Here, EVSYS is configured to map the PTC EOC event to start the DMA transfer and DMA transfer complete event to start PTC measurement. Timer’s count, period and compare channel registers are configured based on the current channel’s 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_t Filter Level value which needs to be written. For some devices, Filter Level values are 32-bit.

Return: None.

void drivenshield_port_mux_config(uint8_t pin, uint8_t mux)

Description: Reconfigures the pin to Timer or PTC (depends on the mux value).

Parameters:

TypeDescription
uint8_tPin details
uint8_tMux value

Return: None.

void drivenshield_stop(void)

Description: Disables Driven Shield by disabling the Timer peripheral.

Parameters: None.

Return: None.