s_pushb.h File Reference


Detailed Description

AVR32 UC3 Control Panel joystick sensor interface.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file s_pushb.h.

#include "compiler.h"

Go to the source code of this file.

Functions

Bool b_pushb1_get_value (char *buf)
 Get a pushbutton current state.
Bool b_pushb2_get_value (char *buf)
 Get a pushbutton current state.
Bool b_pushb3_get_value (char *buf)
 Get a pushbutton current state.


Function Documentation

Bool b_pushb1_get_value ( char *  buf  ) 

Get a pushbutton current state.

Parameters:
buf char buffer in which the push button state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 94 of file s_pushb.c.

References acpc_pushb_events, b_pushb1, PB1_POSITION, PUSHB_EVENT_PRESS, and PUSHB_EVENT_RELEASE.

Referenced by device_full_custom_task().

00095 {
00096    // input is pulled up, if 1 : input is not active
00097    if (gpio_get_pin_value(PB1_POSITION)) {
00098       b_pushb1 = PUSHB_EVENT_RELEASE;
00099    } else {
00100       b_pushb1 = PUSHB_EVENT_PRESS;
00101    }
00102    // Build the log string.
00103    sprintf( buf, "%s\r\n", (portCHAR *)acpc_pushb_events[b_pushb1]);
00104    return TRUE;
00105 }

Bool b_pushb2_get_value ( char *  buf  ) 

Get a pushbutton current state.

Parameters:
buf char buffer in which the push button state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 116 of file s_pushb.c.

References acpc_pushb_events, b_pushb2, PB2_POSITION, PUSHB_EVENT_PRESS, and PUSHB_EVENT_RELEASE.

Referenced by device_full_custom_task().

00117 {
00118    // input is pulled up, if 1 : input is not active
00119    if (gpio_get_pin_value(PB2_POSITION)) {
00120       b_pushb2 = PUSHB_EVENT_RELEASE;
00121    } else {
00122       b_pushb2 = PUSHB_EVENT_PRESS;
00123    }
00124    // Build the log string.
00125    sprintf( buf, "%s\r\n", (portCHAR *)acpc_pushb_events[b_pushb2]);
00126    return TRUE;
00127 }

Bool b_pushb3_get_value ( char *  buf  ) 

Get a pushbutton current state.

Parameters:
buf char buffer in which the push button state is stored.
Returns:
TRUE upon success, FALSE if error.

Definition at line 139 of file s_pushb.c.

References acpc_pushb_events, b_pushb3, PB3_POSITION, PUSHB_EVENT_PRESS, and PUSHB_EVENT_RELEASE.

00140 {
00141    // input is pulled up, if 1 : input is not active
00142    if (gpio_get_pin_value(PB3_POSITION)) {
00143       b_pushb3 = PUSHB_EVENT_RELEASE;
00144    } else {
00145       b_pushb3 = PUSHB_EVENT_PRESS;
00146    }
00147    // Build the log string.
00148    sprintf( buf, "%s\r\n", (portCHAR *)acpc_pushb_events[b_pushb3]);
00149    return TRUE;
00150 }


Generated on Fri Feb 19 02:22:52 2010 for AVR32 - Control Panel demonstration. by  doxygen 1.5.5