Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_tsi_driver.h File Reference
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include "fsl_os_abstraction.h"
#include "fsl_tsi_hal.h"

Data Structures

struct  tsi_user_config_t
 User configuration structure for TSI driver. More...
 
struct  tsi_operation_mode_t
 Driver operation mode data hold structure. More...
 
struct  tsi_state_t
 Driver data storage place. More...
 

Typedefs

typedef void(* tsi_callback_t )(uint32_t instance, void *usrData)
 Call back routine of TSI driver. More...
 

Enumerations

enum  tsi_modes_t {
  tsi_OpModeNormal = 0,
  tsi_OpModeProximity,
  tsi_OpModeLowPower,
  tsi_OpModeNoise,
  tsi_OpModeCnt,
  tsi_OpModeNoChange
}
 Driver operation mode definition. More...
 

Functions

Initialization
tsi_status_t TSI_DRV_Init (uint32_t instance, tsi_state_t *tsiState, const tsi_user_config_t *tsiUserConfig)
 Initializes a TSI instance for operation. More...
 
tsi_status_t TSI_DRV_DeInit (uint32_t instance)
 Shuts down the TSI by disabling interrupts and the peripheral. More...
 
tsi_status_t TSI_DRV_EnableElectrode (uint32_t instance, const uint32_t channel, const bool enable)
 Enables/disables one electrode of the TSI module. More...
 
uint32_t TSI_DRV_GetEnabledElectrodes (uint32_t instance)
 Returns a mask of the enabled electrodes of the TSI module. More...
 
tsi_status_t TSI_DRV_Measure (uint32_t instance)
 Starts the measure cycle of the enabled electrodes. More...
 
tsi_status_t TSI_DRV_MeasureBlocking (uint32_t instance)
 Starts the measure cycle of the enabled electrodes in blocking mode. More...
 
tsi_status_t TSI_DRV_AbortMeasure (uint32_t instance)
 Aborts the measure cycle in non standard use of the driver. More...
 
tsi_status_t TSI_DRV_GetCounter (uint32_t instance, const uint32_t channel, uint16_t *counter)
 Returns the last measured value. More...
 
tsi_status_t TSI_DRV_GetStatus (uint32_t instance)
 Returns the current status of the driver. More...
 
tsi_status_t TSI_DRV_EnableLowPower (uint32_t instance)
 Enters the low power mode of the TSI driver. More...
 
tsi_status_t TSI_DRV_DisableLowPower (uint32_t instance, const tsi_modes_t mode)
 This function returns back the TSI driver from the low power to standard operation. More...
 
tsi_status_t TSI_DRV_Recalibrate (uint32_t instance, uint32_t *lowestSignal)
 Automatically recalibrates all important TSI settings. More...
 
tsi_status_t TSI_DRV_SetCallBackFunc (uint32_t instance, const tsi_callback_t pFuncCallBack, void *usrData)
 Sets the callback function that is called when the measure cycle ends. More...
 
tsi_status_t TSI_DRV_ChangeMode (uint32_t instance, const tsi_modes_t mode)
 Changes the current working operation mode. More...
 
tsi_modes_t TSI_DRV_GetMode (uint32_t instance)
 Returns the current working operation mode. More...
 
tsi_status_t TSI_DRV_LoadConfiguration (uint32_t instance, const tsi_modes_t mode, const tsi_operation_mode_t *operationMode)
 Loads the new configuration into a specific mode. More...
 
tsi_status_t TSI_DRV_SaveConfiguration (uint32_t instance, const tsi_modes_t mode, tsi_operation_mode_t *operationMode)
 Saves the TSI driver configuration for a specific mode. More...
 

Variables

TSI_Type *const g_tsiBase []
 Table of base addresses for TSI instances. More...
 
const IRQn_Type g_tsiIrqId [TSI_INSTANCE_COUNT]
 Table to save TSI IRQ enumeration numbers defined in CMSIS header file. More...
 
tsi_state_tg_tsiStatePtr [TSI_INSTANCE_COUNT]
 Table to save pointers to context data. More...