EBCS Button Module


struct  button_stat_t


#define GEL_MAX_BUTTONS   4


typedef unsigned short button_t
typedef unsigned char button_mask_t


enum  button { BUTTON_1 = 0, BUTTON_2 = 1, BUTTON_3 = 2, BUTTON_4 = 3 }
enum  key_mode { KEY_PRESS, KEY_RELEASE }


void button_initialize (void)
button_mask_t button_get_pressed (void)
void button_enable (void)
void button_disable (void)
int button_is_enabled (void)


event_def button_change_event

Enumeration Type Documentation

enum button

Button enumeration.

Definition at line 39 of file buttons.h.

Function Documentation

void button_disable void   

Disable the polling of buttons.

Disable the polling of buttons. This operation must be called before sending LCD commands. Otherwise, these commands can disturb the button polling.

The accumulator interrupts (PA7) are disabled and the button timers are deactivated.

See also:

void button_enable void   

Enable the polling of buttons.

Enable the polling of buttons. The button are scanned periodically and their state can be queried using button_get_pressed or by waiting for button events.

The accumulator interrupts (PA7) are enabled and the button timer is activated.

While buttons are polled, the application must not print on the LCD panel. It is necessary to disable the polling.

See also:
button_disable, button_get_pressed

button_mask_t button_get_pressed void   

Return a mask for pressed buttons.

the mask identifying pressed buttons
See also:
button_enable, button_disable

void button_initialize void   

Initialize the button module.

Configure the button module. This function must be called once before any other. After initialization, the button polling is disabled.

See also:
button_enable, button_disable, button_get_pressed

int button_is_enabled void   

Return true if the buttons are enabled.

1 if the buttons are enabled.
See also:
button_enable, button_disable

Variable Documentation

struct event_def button_change_event

Button change event.

The button change event is triggerred each time the state of the buttons change. It is activated when a button is pressed or when a button is released.

Definition at line 124 of file buttons.h.