Microchip® Advanced Software Framework

s_pushb.c File Reference
#include <string.h>
#include <stdio.h>
#include "compiler.h"
#include "s_pushb.h"
#include "gpio.h"
#include "FreeRTOS.h"

Macros

#define PB1_POSITION   GPIO_PUSH_BUTTON_0
 
#define PB2_POSITION   GPIO_PUSH_BUTTON_1
 
#define PB3_POSITION   GPIO_PUSH_BUTTON_2
 
#define PUSHB_EVENT_PRESS   true
 
#define PUSHB_EVENT_RELEASE   false
 
#define SENSOR_PB1_CONFIG_FILE   "CFG/PB1.TXT"
 
#define SENSOR_PB2_CONFIG_FILE   "CFG/PB2.TXT"
 
#define SENSOR_PB3_CONFIG_FILE   "CFG/PB3.TXT"
 

Functions

bool b_pushb1_get_value (char *buf)
 Get a pushbutton current state. More...
 
bool b_pushb2_get_value (char *buf)
 Get a pushbutton current state. More...
 

Variables

const signed portCHAR * acpc_pushb_events [2]
 
static bool b_pushb1 = PUSHB_EVENT_RELEASE
 
static bool b_pushb2 = PUSHB_EVENT_RELEASE
 

#define PB1_POSITION   GPIO_PUSH_BUTTON_0

Referenced by b_pushb1_get_value().

#define PB2_POSITION   GPIO_PUSH_BUTTON_1

Referenced by b_pushb2_get_value().

#define PB3_POSITION   GPIO_PUSH_BUTTON_2
#define PUSHB_EVENT_PRESS   true

Pushbutton events.

Referenced by b_pushb1_get_value(), and b_pushb2_get_value().

#define PUSHB_EVENT_RELEASE   false
#define SENSOR_PB1_CONFIG_FILE   "CFG/PB1.TXT"
#define SENSOR_PB2_CONFIG_FILE   "CFG/PB2.TXT"
#define SENSOR_PB3_CONFIG_FILE   "CFG/PB3.TXT"

bool b_pushb1_get_value ( char *  buf)

Get a pushbutton current state.

Parameters
bufchar buffer in which the push button state is stored.
Returns
true upon success, false if error.

References acpc_pushb_events, b_pushb1, gpio_get_pin_value(), PB1_POSITION, PUSHB_EVENT_PRESS, and PUSHB_EVENT_RELEASE.

Referenced by device_full_custom_task().

bool b_pushb2_get_value ( char *  buf)

Get a pushbutton current state.

Parameters
bufchar buffer in which the push button state is stored.
Returns
true upon success, false if error.

References acpc_pushb_events, b_pushb2, gpio_get_pin_value(), PB2_POSITION, PUSHB_EVENT_PRESS, and PUSHB_EVENT_RELEASE.

Referenced by device_full_custom_task().

const signed portCHAR* acpc_pushb_events[2]
Initial value:
= {
(signed portCHAR *)"RELEASE",
(signed portCHAR *)"PRESS"
}

Pushbutton events string.

Referenced by b_pushb1_get_value(), and b_pushb2_get_value().

bool b_pushb1 = PUSHB_EVENT_RELEASE
static

Pushbutton events emulation.

Referenced by b_pushb1_get_value().

bool b_pushb2 = PUSHB_EVENT_RELEASE
static

Referenced by b_pushb2_get_value().