Sensor Application Programming Interfaces (APIs)
MTOUCH_Sensor_Initialize
Description: This Application Programming Interface (API) enables, calibrates, and resets the sensor when it is called.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| enum mtouch_sensor_error | Enumerator containing the list of errors with respect to sensor |
MTOUCH_Sensor_Scan_Initialize
Description: This function initializes the Analog-to-Digital Converter (ADC) and pin module for guard/Tx.
Parameter: None
Return: None
MTOUCH_Sensor_InitializeAll
Description: This function initializes all the sensors configured.
Parameter: None
Return: None
MTOUCH_Sensor_SetSampledCallback
Description: This function sets the callback function of sampling completion. The parameter of this callback function is the name (index) of the sensor, which just finishes its sampling.
MTOUCH_Sensor_SampleAll
Description: This function checks whether sampling is completed for all the configured sensors and returns 0/ false.
Parameter: None
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_isSamplingComplete
Description: For each sensor, this API checks whether sampling is completed or not.
Parameter: None
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_postAcquisitionProcess
Description: This function updates the raw sample value of all the sensors.
Parameter: None
Return: None
MTOUCH_Sensor_ADCC_Initialize
Description: This function initializes the Analog-to-Digital Converter with Computation (ADCC).
Parameter: None
Return: None
ADCC_ThresholdISR_mTouch
Description: This interrupt service routine clears the ADC threshold Interrupt flag and then starts the sensor service.
Parameter: None
Return: None
MTOUCH_Sensor_isSampling
Description: This function returns the sampling flag value.
Parameter: None
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_isAnySensorActive
Description: This function checks if any sensor is active or not.
Parameter: None
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_isActive
Description: This function returns whether the specified sensor is currently active.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_wasSampled
Description: This function checks whether the particular sensor is sampled or not.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_isCalibrated
Description: This function checks whether the sensor is calibrated or not.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_isEnabled
Description: This function checks whether the sensor is enabled or not.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| bool | Returns 0 or 1 |
MTOUCH_Sensor_Sampled_ResetAll
Description: This function resets the sampled status of all configured sensors that have been sampled.
Parameter: None
Return: None
MTOUCH_Sensor_Disable
Description: This function disables the specified sensor.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return: None
MTOUCH_Sensor_Enable
Description: This function enables the sensor.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return: None
MTOUCH_Sensor_Calibrate
Description: This function calibrates the specified sensors.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return: None
MTOUCH_Sensor_RawSample_Get
Description: This function returns the oversampled sensor reading from the ADC. This is used by the higher-level module, like button and proximity sensor modules. It is also useful if you want to implement their own high-level decoding, such as humidity sensor, liquid level sensor, etc.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| mtouch_sensor_sample_t | Range between 0 and 65535 |
MTOUCH_Sensor_CVDSample_Get
Description: This function returns the Charge Voltage Discharge (CVD) sample value.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| mtouch_sensor_sample_t | Range between 0 and 65535 |
MTOUCH_Sensor_AdditionalCap_Get
Description: This function returns the additional capacitance value.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| uint8_t | Range between 0 and 255 |
MTOUCH_Sensor_AcquisitionTime_Get
Description: This function returns the acquisition time of the specified sensor considering the delay.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| uint8_t | Range between 0 and 255 |
MTOUCH_Sensor_PreChargeTime_Get
Description: This function returns the pre-charge time of the specified sensor.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| uint8_t | Range between 0 and 255 |
MTOUCH_Sensor_Oversampling_Get
Description: This function returns the oversampling value of the specified sensor.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| uint8_t | Range between 0 and 255 |
MTOUCH_Sensor_Oversampling_Set
Description: Oversampling of the specified sensor can be set manually using this API.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_sensor_names sensor | Enumerator for the configured sensor names |
Return:
| Type | Description |
|---|---|
| uint8_t | Range between 0 and 255 |