3.2.4 Software Driven Shield APIs

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

void drivenshield_configure(void)

Description: Initializes driven shield related APIs for touch library. 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: This function is called by touch library before starting the dummy measurement. Here, EVSYS is configured to map PTC EOC event to start 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, presclaer 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 Timer Peripheral.

Parameters:None

Return:None