You are on page 1of 1

/****************************************************************************

Header file for ButtonDB.c


based on the Gen2 Events and Services Framework

****************************************************************************/

#ifndef ButtonDB_H
#define ButtonDB_H

// Event Definitions
#include "ES_Configure.h" /* gets us event definitions */
#include "ES_Types.h" /* gets bool type for returns */

#define Button_Tris TRISBbits.TRISB8 //b8 will be input


#define Button_Port PORTBbits.RB8 // b8 is where button will be connected to

// typedefs for the states


// State definitions for use with the query function
typedef enum
{
InitButtonState, Waiting, DB_FallingEdge,
DB_RisingEdge
} ButtonState_t;

typedef enum
{
Down = 0, //when button pressed, connects to ground
Up = 1
} ButtonActions_t;

// Public Function Prototypes

bool InitButtonDB(uint8_t Priority);


ES_Event_t RunButtonDB(ES_Event_t ThisEvent);
bool PostButtonDB(ES_Event_t ThisEvent);
bool CheckButton(void);

#endif /* ButtonDB_H */

You might also like