Button Application Programming Interfaces (APIs)
MTOUCH_Button_Initialize
Description: Initializes the individual button state, baseline, state counter, baseline counter, and then calibrates it.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return: None
MTOUCH_Button_InitializeAll
Description: Initializes all the configured buttons.
Parameters: None
Return: None
Button_Service
Description: Starts the button service by updating the button reading and deviation.
Parameter:
| Type | Description |
|---|---|
| enum | Enumerator for the configured button names |
Return: None
MTOUCH_Button_ServiceAll
Description: Initializes service for all configured buttons.
Parameters: None
Return: None
MTOUCH_Button_Tick
Description: Updates the button state counter based on real time button press.
Parameters: None
Return: None
MTOUCH_Button_Deviation_Get
Description: Returns the button deviation based on the baseline value change.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return:
| Type | Description |
|---|---|
| mtouch_button_deviation_t | Button deviation value |
MTOUCH_Button_Reading_Get
Description: Gets the current button reading.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return:
| Type | Description |
|---|---|
| mtouch_button_reading_t | Current button reading value |
MTOUCH_Button_Baseline_Get
Description: Gets the current button reading.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return:
| Type | Description |
|---|---|
| mtouch_button_reading_t | Current button reading value |
MTOUCH_Button_Scaling_Get
Description: Gets the current button scaling value.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return:
| Type | Description |
|---|---|
| mtouch_button_scaling_t | Current button scaling value |
MTOUCH_Button_Scaling_Set
Description: Sets the button scaling with respect to current value.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
| mtouch_button_scaling_t scaling | Current scaling value |
Return: None
MTOUCH_Button_Threshold_Get
Description: Obtains the current value of the button threshold.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return:
| Type | Description |
|---|---|
| mtouch_button_threshold_t | Configured button threshold value |
MTOUCH_Button_Threshold_Set
Description: Sets the button threshold based on the range configured.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
| mtouch_button_threshold_t threshold | Initially configured threshold value |
Return: None
MTOUCH_Button_Oversampling_Get
Description: Gets the button oversampling value.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return: uint8_t
MTOUCH_Button_Oversampling_Set
Description: Oversampling value for each button can be set manually with this API.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
| uint8_t oversampling | Manually configured oversampling value |
Return: None
MTOUCH_Button_isPressed
Description: Checks whether the button is pressed or not and returns 0 or 1.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return: bool
MTOUCH_Button_isInitialized
Description: Checks whether the particular button is initialized or not and returns 0 or 1.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return: bool
MTOUCH_Button_Buttonmask_Get
Description: Checks whether button is pressed or not and returns the button mask output.
Parameter: None
Return:
| Type | Description |
|---|---|
| mtouch_buttonmask_t | Returns the button mask value |
MTOUCH_Button_State_Get
Description: Gets the button state.
Parameter:
| Type | Description |
|---|---|
| enum mtouch_button_names | Enumerator for the configured button names |
Return: uint8_t