16FXlib
Buttons (buttons.h)

Detailed Description

#include "buttons.h"
Overview
Routines to initialize and query the buttons

Modules

 Internal configurations (buttons.cfg.h)
 

Functions

void buttons_init (void)
 
int8_t buttons_get (uint8_t pin)
 
int8_t buttons_event (uint8_t pin)
 

Function Documentation

void buttons_init ( void  )

Initializes I/Os for buttons

Definition at line 28 of file buttons.c.

int8_t buttons_get ( uint8_t  pin)

Get the state of the button on pin N

Parameters
pinPin number (0 = left button, 1 = right button)
Returns
1 if pressed, 0 if released, -1 if wrong pin number

Definition at line 34 of file buttons.c.

int8_t buttons_event ( uint8_t  pin)

Check if button on pin N was pressed down since the last call

Parameters
pinPin number (0 = left button, 1 = right button)
Returns
1 if button was pressed down since last call, -1 if wrong pin number, 0 otherwise

Definition at line 40 of file buttons.c.