Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example

Public functions of the push button device driver library. More...

+ Collaboration diagram for Public Functions:

Functions

volatile uint16_t drv_PushButton_Initialize (volatile struct PUSH_BUTTON_OBJECT_s *pushbtn)
 Initializes the push button device driver. More...
 
volatile uint16_t drv_PushButton_Execute (volatile struct PUSH_BUTTON_OBJECT_s *pushbtn)
 Initializes the push button device driver. More...
 
volatile uint16_t drv_PushButton_Dispose (volatile struct PUSH_BUTTON_OBJECT_s *pushbtn)
 Initializes the push button device driver. More...
 

Detailed Description

Public functions of the push button device driver library.

This is the detailed description of public API functions of the push button device driver library.

Function Documentation

◆ drv_PushButton_Dispose()

volatile uint16_t drv_PushButton_Dispose ( volatile struct PUSH_BUTTON_OBJECT_s pushbtn)

Initializes the push button device driver.

Parameters
pushbtnPush button data object of type struct PUSH_BUTTON_OBJECT_s*
Returns
unsigned int (0=failure, 1=success) This function will unload the push-button function driver and free its resources. All user settings will get reset. The PUSH_BUTTON_t data object holding all user-defined settings of the push-button object need to be re-initialized before this function driver can be used again.

Definition at line 153 of file drv_push_button.c.

+ Here is the caller graph for this function:

◆ drv_PushButton_Execute()

volatile uint16_t drv_PushButton_Execute ( volatile struct PUSH_BUTTON_OBJECT_s pushbtn)

Initializes the push button device driver.

Parameters
pushbtnPointer to push button data object of type struct PUSH_BUTTON_OBJECT_s
Returns
unsigned int (0=failure, 1=success)

This function has to be called by a task scheduler at a constant frequency. With ever function call the state of the digital I/O is scanned and monitoring timers are updated to detect the most recent status of the push button and detect events like short press, long press and raise the respective events.

Definition at line 70 of file drv_push_button.c.

+ Here is the caller graph for this function:

◆ drv_PushButton_Initialize()

volatile uint16_t drv_PushButton_Initialize ( volatile struct PUSH_BUTTON_OBJECT_s pushbtn)

Initializes the push button device driver.

Parameters
pushbtnPush button object of type struct PUSH_BUTTON_OBJECT_s*
Returns
unsigned integer (0=failure, 1=success)

The push button driver offers typical functions of a human-machine interface push button such as

  • hardware debouncing
  • detection of short press
  • detection of long press
  • push-button status (pressed/unpressed)
  • switch event indication

Users of this function driver can define and tune delay to adopt detection delays and related responses to the task execution period and hardware circuit related dependencies.

Definition at line 38 of file drv_push_button.c.

+ Here is the caller graph for this function: