SZS ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
Switch 0 sensor (Button)

Button press count. More...

Files

file  but.c
 Button implementation.
 
file  but.h
 Button interface.
 

Functions

void but_init ()
 This function initializes the button control variables. More...
 
UInt16 but_proccess ()
 This function processes the tasks of the button control. More...
 
void but_clearPending ()
 This function clear pending button presses.
 
UInt8 but_getPending ()
 This function get number of button presses on the time window. More...
 
void BUT_ISR ()
 Button Interrupt Service Request on port 1. More...
 

Detailed Description

Button press count.

Function Documentation

UInt8 but_getPending ( )

This function get number of button presses on the time window.

Returns
Number of pending presses on the time window.

Definition at line 204 of file but.c.

References but_pendingPress.

void but_init ( )

This function initializes the button control variables.

This function initializes counters and sets interruption on button press.

Definition at line 108 of file but.c.

References but_currentState, but_pendingPress, but_presses, BUT_S_IDLE, and BUT_SW0BIT.

Referenced by main().

+ Here is the caller graph for this function:

void BUT_ISR ( )

Button Interrupt Service Request on port 1.

This function must be called only on sw0 interrupt, not on others IFG from the port on with sw0 is connected.

Definition at line 216 of file but.c.

References but_currentState, BUT_S_IDLE, BUT_S_PRESSED, and BUT_SW0BIT.

UInt16 but_proccess ( )

This function processes the tasks of the button control.

When last bit of but_press is set, it represents a button press 3.2s ago, count number of bits set, that represents number of presses, and write it to but_pendingPress. Then executes tasks depending on current state. The program must check the pending presses to verify adequate actions.

Returns
Time to run again (ms); 0 means 65536ms.

Definition at line 132 of file but.c.

References but_currentState, but_pendingPress, but_presses, BUT_S_DEBOUNCE, BUT_S_IDLE, BUT_S_PRESSED, BUT_SW0BIT, NWK_DEVTYPE_ENDDEVICE, NWK_DEVTYPE_ROUTER, and nwk_setDeviceType().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: