The section describes the programming interface of the TSI HAL driver. The TSI HAL driver is designed to control the touch sensing input peripheral and provide basic functions to measure the RAW values of electrode capacitance.
|
enum | tsi_status_t { ,
kStatus_TSI_Busy,
kStatus_TSI_LowPower,
kStatus_TSI_Recalibration,
kStatus_TSI_InvalidChannel,
kStatus_TSI_InvalidMode,
kStatus_TSI_Initialized,
kStatus_TSI_Error
} |
| Error codes for the TSI driver. More...
|
|
enum | tsi_n_consecutive_scans_t {
kTsiConsecutiveScansNumber_1time = 0,
kTsiConsecutiveScansNumber_2time = 1,
kTsiConsecutiveScansNumber_3time = 2,
kTsiConsecutiveScansNumber_4time = 3,
kTsiConsecutiveScansNumber_5time = 4,
kTsiConsecutiveScansNumber_6time = 5,
kTsiConsecutiveScansNumber_7time = 6,
kTsiConsecutiveScansNumber_8time = 7,
kTsiConsecutiveScansNumber_9time = 8,
kTsiConsecutiveScansNumber_10time = 9,
kTsiConsecutiveScansNumber_11time = 10,
kTsiConsecutiveScansNumber_12time = 11,
kTsiConsecutiveScansNumber_13time = 12,
kTsiConsecutiveScansNumber_14time = 13,
kTsiConsecutiveScansNumber_15time = 14,
kTsiConsecutiveScansNumber_16time = 15,
kTsiConsecutiveScansNumber_17time = 16,
kTsiConsecutiveScansNumber_18time = 17,
kTsiConsecutiveScansNumber_19time = 18,
kTsiConsecutiveScansNumber_20time = 19,
kTsiConsecutiveScansNumber_21time = 20,
kTsiConsecutiveScansNumber_22time = 21,
kTsiConsecutiveScansNumber_23time = 22,
kTsiConsecutiveScansNumber_24time = 23,
kTsiConsecutiveScansNumber_25time = 24,
kTsiConsecutiveScansNumber_26time = 25,
kTsiConsecutiveScansNumber_27time = 26,
kTsiConsecutiveScansNumber_28time = 27,
kTsiConsecutiveScansNumber_29time = 28,
kTsiConsecutiveScansNumber_30time = 29,
kTsiConsecutiveScansNumber_31time = 30,
kTsiConsecutiveScansNumber_32time = 31
} |
| TSI number of scan intervals for each electrode. More...
|
|
enum | tsi_electrode_osc_prescaler_t {
kTsiElecOscPrescaler_1div = 0,
kTsiElecOscPrescaler_2div = 1,
kTsiElecOscPrescaler_4div = 2,
kTsiElecOscPrescaler_8div = 3,
kTsiElecOscPrescaler_16div = 4,
kTsiElecOscPrescaler_32div = 5,
kTsiElecOscPrescaler_64div = 6,
kTsiElecOscPrescaler_128div = 7
} |
| TSI electrode oscillator prescaler. More...
|
|
enum | tsi_low_power_interval_t {
kTsiLowPowerInterval_1ms = 0,
kTsiLowPowerInterval_5ms = 1,
kTsiLowPowerInterval_10ms = 2,
kTsiLowPowerInterval_15ms = 3,
kTsiLowPowerInterval_20ms = 4,
kTsiLowPowerInterval_30ms = 5,
kTsiLowPowerInterval_40ms = 6,
kTsiLowPowerInterval_50ms = 7,
kTsiLowPowerInterval_75ms = 8,
kTsiLowPowerInterval_100ms = 9,
kTsiLowPowerInterval_125ms = 10,
kTsiLowPowerInterval_150ms = 11,
kTsiLowPowerInterval_200ms = 12,
kTsiLowPowerInterval_300ms = 13,
kTsiLowPowerInterval_400ms = 14,
kTsiLowPowerInterval_500ms = 15
} |
| TSI low power scan intervals. More...
|
|
enum | tsi_reference_osc_charge_current_t {
kTsiRefOscChargeCurrent_2uA = 0,
kTsiRefOscChargeCurrent_4uA = 1,
kTsiRefOscChargeCurrent_6uA = 2,
kTsiRefOscChargeCurrent_8uA = 3,
kTsiRefOscChargeCurrent_10uA = 4,
kTsiRefOscChargeCurrent_12uA = 5,
kTsiRefOscChargeCurrent_14uA = 6,
kTsiRefOscChargeCurrent_16uA = 7,
kTsiRefOscChargeCurrent_18uA = 8,
kTsiRefOscChargeCurrent_20uA = 9,
kTsiRefOscChargeCurrent_22uA = 10,
kTsiRefOscChargeCurrent_24uA = 11,
kTsiRefOscChargeCurrent_26uA = 12,
kTsiRefOscChargeCurrent_28uA = 13,
kTsiRefOscChargeCurrent_30uA = 14,
kTsiRefOscChargeCurrent_32uA = 15,
kTsiRefOscChargeCurrent_500nA = 0,
kTsiRefOscChargeCurrent_1uA = 1,
kTsiRefOscChargeCurrent_2uA = 2,
kTsiRefOscChargeCurrent_4uA = 3,
kTsiRefOscChargeCurrent_8uA = 4,
kTsiRefOscChargeCurrent_16uA = 5,
kTsiRefOscChargeCurrent_32uA = 6,
kTsiRefOscChargeCurrent_64uA = 7
} |
| TSI Reference oscillator charge current select. More...
|
|
enum | tsi_external_osc_charge_current_t {
kTsiExtOscChargeCurrent_2uA = 0,
kTsiExtOscChargeCurrent_4uA = 1,
kTsiExtOscChargeCurrent_6uA = 2,
kTsiExtOscChargeCurrent_8uA = 3,
kTsiExtOscChargeCurrent_10uA = 4,
kTsiExtOscChargeCurrent_12uA = 5,
kTsiExtOscChargeCurrent_14uA = 6,
kTsiExtOscChargeCurrent_16uA = 7,
kTsiExtOscChargeCurrent_18uA = 8,
kTsiExtOscChargeCurrent_20uA = 9,
kTsiExtOscChargeCurrent_22uA = 10,
kTsiExtOscChargeCurrent_24uA = 11,
kTsiExtOscChargeCurrent_26uA = 12,
kTsiExtOscChargeCurrent_28uA = 13,
kTsiExtOscChargeCurrent_30uA = 14,
kTsiExtOscChargeCurrent_32uA = 15,
kTsiExtOscChargeCurrent_500nA = 0,
kTsiExtOscChargeCurrent_1uA = 1,
kTsiExtOscChargeCurrent_2uA = 2,
kTsiExtOscChargeCurrent_4uA = 3,
kTsiExtOscChargeCurrent_8uA = 4,
kTsiExtOscChargeCurrent_16uA = 5,
kTsiExtOscChargeCurrent_32uA = 6,
kTsiExtOscChargeCurrent_64uA = 7
} |
| TSI External oscillator charge current select. More...
|
|
enum | tsi_internal_cap_trim_t {
kTsiIntCapTrim_0_5pF = 0,
kTsiIntCapTrim_0_6pF = 1,
kTsiIntCapTrim_0_7pF = 2,
kTsiIntCapTrim_0_8pF = 3,
kTsiIntCapTrim_0_9pF = 4,
kTsiIntCapTrim_1_0pF = 5,
kTsiIntCapTrim_1_1pF = 6,
kTsiIntCapTrim_1_2pF = 7
} |
| TSI Internal capacitance trim value. More...
|
|
enum | tsi_osc_delta_voltage_t {
kTsiOscDeltaVoltage_100mV = 0,
kTsiOscDeltaVoltage_150mV = 1,
kTsiOscDeltaVoltage_200mV = 2,
kTsiOscDeltaVoltage_250mV = 3,
kTsiOscDeltaVoltage_300mV = 4,
kTsiOscDeltaVoltage_400mV = 5,
kTsiOscDeltaVoltage_500mV = 6,
kTsiOscDeltaVoltage_600mV = 7
} |
| TSI Delta voltage applied to analog oscillators. More...
|
|
enum | tsi_active_mode_clock_divider_t {
kTsiActiveClkDiv_1div = 0,
kTsiActiveClkDiv_2048div = 1
} |
| TSI Active mode clock divider. More...
|
|
enum | tsi_active_mode_clock_source_t {
kTsiActiveClkSource_BusClock = 0,
kTsiActiveClkSource_MCGIRCLK = 1,
kTsiActiveClkSource_OSCERCLK = 2
} |
| TSI Active mode clock source. More...
|
|
enum | tsi_active_mode_prescaler_t {
kTsiActiveModePrescaler_1div = 0,
kTsiActiveModePrescaler_2div = 1,
kTsiActiveModePrescaler_4div = 2,
kTsiActiveModePrescaler_8div = 3,
kTsiActiveModePrescaler_16div = 4,
kTsiActiveModePrescaler_32div = 5,
kTsiActiveModePrescaler_64div = 6,
kTsiActiveModePrescaler_128div = 7
} |
| TSI active mode prescaler. More...
|
|
enum | tsi_analog_mode_select_t {
kTsiAnalogModeSel_Capacitive = 0,
kTsiAnalogModeSel_NoiseNoFreqLim = 4,
kTsiAnalogModeSel_NoiseFreqLim = 8
} |
| TSI analog mode select. More...
|
|
enum | tsi_reference_osc_charge_current_t {
kTsiRefOscChargeCurrent_2uA = 0,
kTsiRefOscChargeCurrent_4uA = 1,
kTsiRefOscChargeCurrent_6uA = 2,
kTsiRefOscChargeCurrent_8uA = 3,
kTsiRefOscChargeCurrent_10uA = 4,
kTsiRefOscChargeCurrent_12uA = 5,
kTsiRefOscChargeCurrent_14uA = 6,
kTsiRefOscChargeCurrent_16uA = 7,
kTsiRefOscChargeCurrent_18uA = 8,
kTsiRefOscChargeCurrent_20uA = 9,
kTsiRefOscChargeCurrent_22uA = 10,
kTsiRefOscChargeCurrent_24uA = 11,
kTsiRefOscChargeCurrent_26uA = 12,
kTsiRefOscChargeCurrent_28uA = 13,
kTsiRefOscChargeCurrent_30uA = 14,
kTsiRefOscChargeCurrent_32uA = 15,
kTsiRefOscChargeCurrent_500nA = 0,
kTsiRefOscChargeCurrent_1uA = 1,
kTsiRefOscChargeCurrent_2uA = 2,
kTsiRefOscChargeCurrent_4uA = 3,
kTsiRefOscChargeCurrent_8uA = 4,
kTsiRefOscChargeCurrent_16uA = 5,
kTsiRefOscChargeCurrent_32uA = 6,
kTsiRefOscChargeCurrent_64uA = 7
} |
| TSI Reference oscillator charge and discharge current select. More...
|
|
enum | tsi_oscilator_voltage_rails_t {
kTsiOscVolRails_Dv_103 = 0,
kTsiOscVolRails_Dv_073 = 1,
kTsiOscVolRails_Dv_043 = 2,
kTsiOscVolRails_Dv_029 = 3
} |
| TSI oscilator's voltage rails. More...
|
|
enum | tsi_external_osc_charge_current_t {
kTsiExtOscChargeCurrent_2uA = 0,
kTsiExtOscChargeCurrent_4uA = 1,
kTsiExtOscChargeCurrent_6uA = 2,
kTsiExtOscChargeCurrent_8uA = 3,
kTsiExtOscChargeCurrent_10uA = 4,
kTsiExtOscChargeCurrent_12uA = 5,
kTsiExtOscChargeCurrent_14uA = 6,
kTsiExtOscChargeCurrent_16uA = 7,
kTsiExtOscChargeCurrent_18uA = 8,
kTsiExtOscChargeCurrent_20uA = 9,
kTsiExtOscChargeCurrent_22uA = 10,
kTsiExtOscChargeCurrent_24uA = 11,
kTsiExtOscChargeCurrent_26uA = 12,
kTsiExtOscChargeCurrent_28uA = 13,
kTsiExtOscChargeCurrent_30uA = 14,
kTsiExtOscChargeCurrent_32uA = 15,
kTsiExtOscChargeCurrent_500nA = 0,
kTsiExtOscChargeCurrent_1uA = 1,
kTsiExtOscChargeCurrent_2uA = 2,
kTsiExtOscChargeCurrent_4uA = 3,
kTsiExtOscChargeCurrent_8uA = 4,
kTsiExtOscChargeCurrent_16uA = 5,
kTsiExtOscChargeCurrent_32uA = 6,
kTsiExtOscChargeCurrent_64uA = 7
} |
| TSI External oscillator charge and discharge current select. More...
|
|
enum | tsi_channel_number_t {
kTsiChannelNumber_0 = 0,
kTsiChannelNumber_1 = 1,
kTsiChannelNumber_2 = 2,
kTsiChannelNumber_3 = 3,
kTsiChannelNumber_4 = 4,
kTsiChannelNumber_5 = 5,
kTsiChannelNumber_6 = 6,
kTsiChannelNumber_7 = 7,
kTsiChannelNumber_8 = 8,
kTsiChannelNumber_9 = 9,
kTsiChannelNumber_10 = 10,
kTsiChannelNumber_11 = 11,
kTsiChannelNumber_12 = 12,
kTsiChannelNumber_13 = 13,
kTsiChannelNumber_14 = 14,
kTsiChannelNumber_15 = 15
} |
| TSI channel number. More...
|
|
|
void | TSI_HAL_Init (TSI_Type *base) |
| Initialize hardware. More...
|
|
void | TSI_HAL_SetConfiguration (TSI_Type *base, tsi_config_t *config) |
| Set configuration of hardware. More...
|
|
uint32_t | TSI_HAL_Recalibrate (TSI_Type *base, tsi_config_t *config, const uint32_t electrodes, const tsi_parameter_limits_t *parLimits) |
| Recalibrate TSI hardware. More...
|
|
void | TSI_HAL_EnableLowPower (TSI_Type *base) |
| Enable low power for TSI module. More...
|
|
void | TSI_HAL_DisableLowPower (TSI_Type *base) |
| Disable low power for TSI module. More...
|
|
static uint32_t | TSI_HAL_IsModuleEnabled (TSI_Type *base) |
| Get module flag enable. More...
|
|
static uint32_t | TSI_HAL_GetScanTriggerMode (TSI_Type *base) |
| Get TSI scan trigger mode. More...
|
|
static uint32_t | TSI_HAL_IsScanInProgress (TSI_Type *base) |
| Get scan in progress flag. More...
|
|
static uint32_t | TSI_HAL_GetEndOfScanFlag (TSI_Type *base) |
| Get end of scan flag. More...
|
|
static uint32_t | TSI_HAL_GetOutOfRangeFlag (TSI_Type *base) |
| Get out of range flag. More...
|
|
static
tsi_electrode_osc_prescaler_t | TSI_HAL_GetPrescaler (TSI_Type *base) |
| Get prescaler. More...
|
|
static tsi_n_consecutive_scans_t | TSI_HAL_GetNumberOfScans (TSI_Type *base) |
| Get number of scans (NSCN). More...
|
|
static void | TSI_HAL_EnableModule (TSI_Type *base) |
| Enable Touch Sensing Input Module. More...
|
|
static void | TSI_HAL_DisableModule (TSI_Type *base) |
| Disable Touch Sensing Input Module. More...
|
|
static void | TSI_HAL_EnableStop (TSI_Type *base) |
| Enable TSI module in stop mode. More...
|
|
static void | TSI_HAL_DisableStop (TSI_Type *base) |
| Disable TSI module in stop mode. More...
|
|
static void | TSI_HAL_EnableOutOfRangeInterrupt (TSI_Type *base) |
| Enable out of range interrupt. More...
|
|
static void | TSI_HAL_EnableEndOfScanInterrupt (TSI_Type *base) |
| Enable end of scan interrupt. More...
|
|
static void | TSI_HAL_EnablePeriodicalScan (TSI_Type *base) |
| Enable periodical (hardware) trigger scan. More...
|
|
static void | TSI_HAL_EnableSoftwareTriggerScan (TSI_Type *base) |
| Enable software trigger scan. More...
|
|
static void | TSI_HAL_EnableErrorInterrupt (TSI_Type *base) |
| Enable error interrupt. More...
|
|
static void | TSI_HAL_DisableErrorInterrupt (TSI_Type *base) |
| Disable error interrupt. More...
|
|
static void | TSI_HAL_ClearOutOfRangeFlag (TSI_Type *base) |
| Clear out of range flag. More...
|
|
static void | TSI_HAL_ClearEndOfScanFlag (TSI_Type *base) |
| Clear end of scan flag. More...
|
|
static void | TSI_HAL_EnableInterrupt (TSI_Type *base) |
| Enable TSI module interrupt. More...
|
|
static void | TSI_HAL_DisableInterrupt (TSI_Type *base) |
| Disable TSI interrupt. More...
|
|
static uint32_t | TSI_HAL_IsInterruptEnabled (TSI_Type *base) |
| Get interrupt enable flag. More...
|
|
static void | TSI_HAL_StartSoftwareTrigger (TSI_Type *base) |
| Start measurement (trigger the new measurement). More...
|
|
static uint32_t | TSI_HAL_IsOverrun (TSI_Type *base) |
| Get overrun flag. More...
|
|
static void | TSI_HAL_ClearOverrunFlag (TSI_Type *base) |
| Clear over run flag. More...
|
|
static uint32_t | TSI_HAL_GetExternalElectrodeErrorFlag (TSI_Type *base) |
| Get external electrode error flag. More...
|
|
static void | TSI_HAL_ClearExternalElectrodeErrorFlag (TSI_Type *base) |
| Clear external electrode error flag. More...
|
|
static void | TSI_HAL_SetPrescaler (TSI_Type *base, tsi_electrode_osc_prescaler_t prescaler) |
| Set prescaler. More...
|
|
static void | TSI_HAL_SetNumberOfScans (TSI_Type *base, tsi_n_consecutive_scans_t number) |
| Set number of scans (NSCN). More...
|
|
static void | TSI_HAL_SetLowPowerScanInterval (TSI_Type *base, tsi_low_power_interval_t interval) |
| Set low power scan interval. More...
|
|
static tsi_low_power_interval_t | TSI_HAL_GetLowPowerScanInterval (TSI_Type *base) |
| Get low power scan interval. More...
|
|
static void | TSI_HAL_SetLowPowerClock (TSI_Type *base, uint32_t clock) |
| Set low power clock. More...
|
|
static uint32_t | TSI_HAL_GetLowPowerClock (TSI_Type *base) |
| Get low power clock. More...
|
|
static void | TSI_HAL_SetReferenceChargeCurrent (TSI_Type *base, tsi_reference_osc_charge_current_t current) |
| Set the reference oscilator charge current. More...
|
|
static
tsi_reference_osc_charge_current_t | TSI_HAL_GetReferenceChargeCurrent (TSI_Type *base) |
| Get the reference oscilator charge current. More...
|
|
static void | TSI_HAL_SetElectrodeChargeCurrent (TSI_Type *base, tsi_external_osc_charge_current_t current) |
| Set electrode charge current. More...
|
|
static
tsi_external_osc_charge_current_t | TSI_HAL_GetElectrodeChargeCurrent (TSI_Type *base) |
| Get electrode charge current. More...
|
|
static void | TSI_HAL_SetScanModulo (TSI_Type *base, uint32_t modulo) |
| Set scan modulo value. More...
|
|
static uint32_t | TSI_HAL_GetScanModulo (TSI_Type *base) |
| Get scan modulo value. More...
|
|
static void | TSI_HAL_SetActiveModeSource (TSI_Type *base, uint32_t source) |
| Set active mode source. More...
|
|
static uint32_t | TSI_HAL_GetActiveModeSource (TSI_Type *base) |
| Get active mode source. More...
|
|
static void | TSI_HAL_SetActiveModePrescaler (TSI_Type *base, tsi_active_mode_prescaler_t prescaler) |
| Set active mode prescaler. More...
|
|
static uint32_t | TSI_HAL_GetActiveModePrescaler (TSI_Type *base) |
| Get active mode prescaler. More...
|
|
static void | TSI_HAL_SetLowPowerChannel (TSI_Type *base, uint32_t channel) |
| Set low power channel. More...
|
|
static uint32_t | TSI_HAL_GetLowPowerChannel (TSI_Type *base) |
| Get low power channel. More...
|
|
static void | TSI_HAL_EnableChannel (TSI_Type *base, uint32_t channel) |
| Enable channel. More...
|
|
static void | TSI_HAL_EnableChannels (TSI_Type *base, uint32_t channelsMask) |
| Enable channels. More...
|
|
static void | TSI_HAL_DisableChannel (TSI_Type *base, uint32_t channel) |
| Disable channel. More...
|
|
static void | TSI_HAL_DisableChannels (TSI_Type *base, uint32_t channelsMask) |
| Disable channels. More...
|
|
static uint32_t | TSI_HAL_GetEnabledChannel (TSI_Type *base, uint32_t channel) |
| Returns if channel is enabled. More...
|
|
static uint32_t | TSI_HAL_GetEnabledChannels (TSI_Type *base) |
| Returns mask of enabled channels. More...
|
|
static uint16_t | TSI_HAL_GetWakeUpChannelCounter (TSI_Type *base) |
| Set the Wake up channel counter. More...
|
|
static uint32_t | TSI_HAL_GetCounter (TSI_Type *base, uint32_t channel) |
| Get tsi counter on actual channel. More...
|
|
static void | TSI_HAL_SetLowThreshold (TSI_Type *base, uint32_t low_threshold) |
| Set low threshold. More...
|
|
static void | TSI_HAL_SetHighThreshold (TSI_Type *base, uint32_t high_threshold) |
| Set high threshold. More...
|
|
static uint32_t | TSI_HAL_GetEnableStop (TSI_Type *base) |
| Gets the TSI STOP enable. More...
|
|
static void | TSI_HAL_EnableHardwareTriggerScan (TSI_Type *base) |
| Enables the periodical (hardware) trigger scan. More...
|
|
static void | TSI_HAL_CurrentSourcePairSwapped (TSI_Type *base) |
| Swaps the current sources (CURSW) of electrode oscillator and reference oscillator. More...
|
|
static void | TSI_HAL_CurrentSourcePairNotSwapped (TSI_Type *base) |
| Does not swap the current sources (CURSW) of electrode oscillator and reference oscillator. More...
|
|
static uint32_t | TSI_HAL_GetCurrentSourcePairSwapped (TSI_Type *base) |
| Gets the current source pair swapped status. More...
|
|
static void | TSI_HAL_SetMeasuredChannelNumber (TSI_Type *base, uint32_t channel) |
| Sets the the measured channel number. More...
|
|
static uint32_t | TSI_HAL_GetMeasuredChannelNumber (TSI_Type *base) |
| Gets the measured channel number. More...
|
|
static void | TSI_HAL_DmaTransferEnable (TSI_Type *base) |
| DMA transfer enable. More...
|
|
static void | TSI_HAL_DmaTransferDisable (TSI_Type *base) |
| DMA transfer disable - does not generate DMA transfer request. More...
|
|
static uint32_t | TSI_HAL_IsDmaTransferEnable (TSI_Type *base) |
| Gets the DMA transfer enable flag. More...
|
|
static uint32_t | TSI_HAL_GetCounter (TSI_Type *base) |
| Gets the conversion counter value. More...
|
|
static void | TSI_HAL_SetMode (TSI_Type *base, tsi_analog_mode_select_t mode) |
| Sets the analog mode of the TSI module. More...
|
|
static tsi_analog_mode_select_t | TSI_HAL_GetMode (TSI_Type *base) |
| Gets the analog mode of the TSI module. More...
|
|
static uint32_t | TSI_HAL_GetNoiseResult (TSI_Type *base) |
| Gets the analog mode of the TSI module. More...
|
|
static void | TSI_HAL_SetOscilatorVoltageRails (TSI_Type *base, tsi_oscilator_voltage_rails_t dvolt) |
| Sets the oscillator's voltage rails. More...
|
|
static
tsi_oscilator_voltage_rails_t | TSI_HAL_GetOscilatorVoltageRails (TSI_Type *base) |
| Gets the oscillator's voltage rails. More...
|
|