Microchip® Advanced Software Framework

pushb.h File Reference
#include "compiler.h"
#include "FreeRTOS.h"
#include "datalog.h"

Functions

bool b_pushb1_get_value (xLogDef *pxLog)
 Get a pushbutton current state. More...
 
bool b_pushb1_init (void)
 Init the push button 1 sensor. More...
 
bool b_pushb2_get_value (xLogDef *pxLog)
 Get a pushbutton current state. More...
 
bool b_pushb2_init (void)
 Init the push button 2 sensor. More...
 
bool b_pushb3_get_value (xLogDef *pxLog)
 Get a pushbutton current state. More...
 
bool b_pushb3_init (void)
 Init the push button 3 sensor. More...
 
eExecStatus e_pushb1_get_config (signed portCHAR **ppcStringReply)
 Get the pushbutton1 sensor config. More...
 
eExecStatus e_pushb1_set_config (signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 Set the sensor config. More...
 
eExecStatus e_pushb2_get_config (signed portCHAR **ppcStringReply)
 Get the pushbutton2 sensor config. More...
 
eExecStatus e_pushb2_set_config (signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 Set the sensor config. More...
 
eExecStatus e_pushb3_get_config (signed portCHAR **ppcStringReply)
 Get the pushbutton3 sensor config. More...
 
eExecStatus e_pushb3_set_config (signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 Set the sensor config. More...
 
void v_pushb1_stop (void)
 Stop the push button 1 sensor. More...
 
void v_pushb2_stop (void)
 Stop the push button 2 sensor. More...
 
void v_pushb3_stop (void)
 Stop the push button 1 sensor. More...
 

bool b_pushb1_get_value ( xLogDef pxLog)

Get a pushbutton current state.

Parameters
pxLoga Log structure. The id field identifies the pushbutton.
Returns
true upon success, false if error.

References acpc_pushb_events, b_pushb1, NULL, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

Referenced by b_sensor_get_value().

bool b_pushb2_get_value ( xLogDef pxLog)

Get a pushbutton current state.

Parameters
pxLoga Log structure. The id field identifies the pushbutton.
Returns
true upon success, false if error.

References acpc_pushb_events, b_pushb2, NULL, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

Referenced by b_sensor_get_value().

bool b_pushb3_get_value ( xLogDef pxLog)

Get a pushbutton current state.

Parameters
pxLoga Log structure. The id field identifies the pushbutton.
Returns
true upon success, false if error.

References acpc_pushb_events, b_pushb3, NULL, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

Referenced by b_sensor_get_value().

eExecStatus e_pushb1_get_config ( signed portCHAR **  ppcStringReply)

Get the pushbutton1 sensor config.

Parameters
ppcStringReplyInput/Output. The response string. NEVER NULL AS INPUT. A malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References bAlarm1, and prv_e_pushb_get_config().

eExecStatus e_pushb1_set_config ( signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
)

Set the sensor config.

Parameters
ppcStringReplyInput/Output. The response string. NEVER NULL AS INPUT.
acInput. Number of args
avInput. pointer to args
Returns
the status of the command execution.

Set the sensor config.

Parameters
acInput. The argument counter. For this command, should be 2.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References bAlarm1, prv_e_pushb_set_config(), and SENSOR_PB1_CONFIG_FILE.

eExecStatus e_pushb2_get_config ( signed portCHAR **  ppcStringReply)

Get the pushbutton2 sensor config.

Parameters
ppcStringReplyInput/Output. The response string. NEVER NULL AS INPUT. A malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References bAlarm2, and prv_e_pushb_get_config().

eExecStatus e_pushb2_set_config ( signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
)

Set the sensor config.

Parameters
ppcStringReplyInput/Output. The response string. NEVER NULL AS INPUT.
acInput. Number of args
avInput. pointer to args
Returns
the status of the command execution.

Set the sensor config.

Parameters
acInput. The argument counter. For this command, should be 2.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string.
Returns
the status of the command execution.

References bAlarm2, prv_e_pushb_set_config(), and SENSOR_PB2_CONFIG_FILE.

eExecStatus e_pushb3_get_config ( signed portCHAR **  ppcStringReply)

Get the pushbutton3 sensor config.

Parameters
ppcStringReplyInput/Output. The response string. NEVER NULL AS INPUT. A malloc for the response string is performed here; the caller must free this string.
Returns
the status of the command execution.

References bAlarm3, and prv_e_pushb_get_config().

eExecStatus e_pushb3_set_config ( signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
)

Set the sensor config.

Parameters
ppcStringReplyInput/Output. The response string. NEVER NULL AS INPUT.
acInput. Number of args
avInput. pointer to args
Returns
the status of the command execution.

Set the sensor config.

Parameters
acInput. The argument counter. For this command, should be 2.
avInput. The argument vector.
ppcStringReplyInput/Output. The response string.
Returns
the status of the command execution.

References bAlarm3, prv_e_pushb_set_config(), and SENSOR_PB3_CONFIG_FILE.

void v_pushb1_stop ( void  )

Stop the push button 1 sensor.

References gpio_disable_pin_interrupt(), and PB1_POSITION.

void v_pushb2_stop ( void  )

Stop the push button 2 sensor.

References gpio_disable_pin_interrupt(), and PB2_POSITION.

void v_pushb3_stop ( void  )

Stop the push button 1 sensor.

Stop the push button 1 sensor.

References gpio_disable_pin_interrupt(), and PB3_POSITION.