pushb.c File Reference


Detailed Description

AVR32 UC3 Control Panel joystick sensor module.

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

Definition in file pushb.c.

#include <string.h>
#include "compiler.h"
#include "gpio.h"
#include "FreeRTOS.h"
#include "task.h"
#include "datalog.h"
#include "shell.h"
#include "board.h"
#include "sensor.h"
#include "MMI.h"
#include "pushb.h"
#include "config_file.h"
#include "fsaccess.h"
#include "BasicSMTP.h"

Go to the source code of this file.

Defines

#define PB1_POSITION   GPIO_PUSH_BUTTON_0
#define PB2_POSITION   GPIO_PUSH_BUTTON_1
#define PB3_POSITION   GPIO_PUSH_BUTTON_2
#define PUSHB_EVENT_PRESS   TRUE
#define PUSHB_EVENT_RELEASE   FALSE
#define PUSHB_GETCONF_MAXLEN   12
#define SENSOR_PB1_CONFIG_FILE   "A:/CFG/PB1.TXT"
#define SENSOR_PB2_CONFIG_FILE   "A:/CFG/PB2.TXT"
#define SENSOR_PB3_CONFIG_FILE   "A:/CFG/PB3.TXT"

Functions

Bool b_pushb1_get_value (xLogDef *pxLog)
 Get a pushbutton current state.
Bool b_pushb1_init (void)
 Init the push button 1 sensor.
Bool b_pushb2_get_value (xLogDef *pxLog)
 Get a pushbutton current state.
Bool b_pushb2_init (void)
 Init the push button 2 sensor.
Bool b_pushb3_get_value (xLogDef *pxLog)
 Get a pushbutton current state.
Bool b_pushb3_init (void)
 Init the push button 3 sensor.
eExecStatus e_pushb1_get_config (signed portCHAR **ppcStringReply)
 Get the pushbutton1 sensor config.
eExecStatus e_pushb1_set_config (signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 set push button config command: set the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: set_sensor_config sensor=name param=value
eExecStatus e_pushb2_get_config (signed portCHAR **ppcStringReply)
 Get the pushbutton2 sensor config.
eExecStatus e_pushb2_set_config (signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 set push button config command: set the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: set_sensor_config sensor=name param=value
eExecStatus e_pushb3_get_config (signed portCHAR **ppcStringReply)
 Get the pushbutton3 sensor config.
eExecStatus e_pushb3_set_config (signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 set push button config command: set the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: set_sensor_config sensor=name param=value
static eExecStatus prv_e_pushb_get_config (signed portCHAR **ppcStringReply, Bool bAlarm)
 The get config command: get the config fields value of a sensor.
static eExecStatus prv_e_pushb_set_config (Bool *bAlarm, portCHAR *filename, signed portCHAR **ppcStringReply, int ac, signed portCHAR *av[])
 set push button config command: set the config fields value of a sensor.
static portBASE_TYPE prvpushb_ISR_NonNakedBehaviour (void)
 push button interrupt handler. Here, declarations should be done
void v_pushb1_stop (void)
 Stop the push button 1 sensor.
void v_pushb2_stop (void)
 Stop the push button 2 sensor.
void v_pushb3_stop (void)
 Stop the push button 3 sensor.
void vpushb_ISR (void)
 push button naked interrupt handler.

Variables

const signed portCHAR * acpc_pushb_events [2]
static Bool b_pushb1 = PUSHB_EVENT_RELEASE
static Bool b_pushb2 = PUSHB_EVENT_RELEASE
static Bool b_pushb3 = PUSHB_EVENT_RELEASE
static Bool bAlarm1 = pdFALSE
static Bool bAlarm2 = pdFALSE
static Bool bAlarm3 = pdFALSE
xSemaphoreHandle xCFGMutex
 The CFG system mutex.


Define Documentation

#define PB1_POSITION   GPIO_PUSH_BUTTON_0

Definition at line 79 of file pushb.c.

Referenced by b_pushb1_init(), prvpushb_ISR_NonNakedBehaviour(), and v_pushb1_stop().

#define PB2_POSITION   GPIO_PUSH_BUTTON_1

Definition at line 80 of file pushb.c.

Referenced by b_pushb2_init(), prvpushb_ISR_NonNakedBehaviour(), and v_pushb2_stop().

#define PB3_POSITION   GPIO_PUSH_BUTTON_2

Definition at line 81 of file pushb.c.

Referenced by b_pushb3_init(), prvpushb_ISR_NonNakedBehaviour(), and v_pushb3_stop().

#define PUSHB_EVENT_PRESS   TRUE

Pushbutton events.

Definition at line 72 of file pushb.c.

Referenced by prvpushb_ISR_NonNakedBehaviour().

#define PUSHB_EVENT_RELEASE   FALSE

Definition at line 73 of file pushb.c.

Referenced by prvpushb_ISR_NonNakedBehaviour().

#define PUSHB_GETCONF_MAXLEN   12

Max string length of a get config.

Definition at line 69 of file pushb.c.

#define SENSOR_PB1_CONFIG_FILE   "A:/CFG/PB1.TXT"

Definition at line 75 of file pushb.c.

Referenced by b_pushb1_init(), and e_pushb1_set_config().

#define SENSOR_PB2_CONFIG_FILE   "A:/CFG/PB2.TXT"

Definition at line 76 of file pushb.c.

Referenced by b_pushb2_init(), and e_pushb2_set_config().

#define SENSOR_PB3_CONFIG_FILE   "A:/CFG/PB3.TXT"

Definition at line 77 of file pushb.c.

Referenced by b_pushb3_init(), and e_pushb3_set_config().


Function Documentation

Bool b_pushb1_get_value ( xLogDef pxLog  ) 

Get a pushbutton current state.

Parameters:
pxLog a Log structure. The id field identifies the pushbutton.
Returns:
TRUE upon success, FALSE if error.

Definition at line 360 of file pushb.c.

References acpc_pushb_events, b_pushb1, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

Referenced by b_sensor_get_value().

00361 {
00362    // Build the log string.
00363    pxLog->pfFreeStringLog = NULL; // We use a constant.
00364    pxLog->pcStringLog = (portCHAR *)acpc_pushb_events[b_pushb1];
00365 
00366    return( TRUE );
00367 }

Bool b_pushb1_init ( void   ) 

Init the push button 1 sensor.

Returns:
TRUE upon success, FALSE if error.

Definition at line 133 of file pushb.c.

References bAlarm1, config_file_get_value(), PB1_POSITION, SENSOR_PB1_CONFIG_FILE, vpushb_ISR(), x_supervisor_SemaphoreGive(), x_supervisor_SemaphoreTake(), and xCFGMutex.

00134 {
00135 portCHAR token[6];
00136 
00137    // Get the xCFGMutex.
00138    if( pdTRUE == x_supervisor_SemaphoreTake( xCFGMutex, 20 ) )
00139    {
00140        // get the field
00141        if (config_file_get_value(SENSOR_PB1_CONFIG_FILE, "alarm" , token) >= 0)
00142        {
00143          // update value
00144          if (!strcmp(token, "on"))
00145          {
00146            bAlarm1 = pdTRUE;
00147          }
00148        }
00149      // Release the xCFGMutex.
00150      x_supervisor_SemaphoreGive( xCFGMutex );
00151    }
00152    /* configure push button to produce IT on input change */
00153    gpio_enable_pin_interrupt(PB1_POSITION , GPIO_PIN_CHANGE);
00154    /* Disable all interrupts */
00155    Disable_global_interrupt();
00156    /* register push button 1 handler on level 3 */
00157    INTC_register_interrupt( (__int_handler)&vpushb_ISR, AVR32_GPIO_IRQ_0 + (PB1_POSITION/8), AVR32_INTC_INT3);
00158    /* Enable all interrupts */
00159    Enable_global_interrupt();
00160    return (TRUE);
00161 }

Bool b_pushb2_get_value ( xLogDef pxLog  ) 

Get a pushbutton current state.

Parameters:
pxLog a Log structure. The id field identifies the pushbutton.
Returns:
TRUE upon success, FALSE if error.

Definition at line 376 of file pushb.c.

References acpc_pushb_events, b_pushb2, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

Referenced by b_sensor_get_value().

00377 {
00378    // Build the log string.
00379    pxLog->pfFreeStringLog = NULL; // We use a constant.
00380    pxLog->pcStringLog = (portCHAR *)acpc_pushb_events[b_pushb2];
00381 
00382    return( TRUE );
00383 }

Bool b_pushb2_init ( void   ) 

Init the push button 2 sensor.

Returns:
TRUE upon success, FALSE if error.

Definition at line 177 of file pushb.c.

References bAlarm2, config_file_get_value(), PB2_POSITION, SENSOR_PB2_CONFIG_FILE, vpushb_ISR(), x_supervisor_SemaphoreGive(), x_supervisor_SemaphoreTake(), and xCFGMutex.

00178 {
00179 portCHAR token[6];
00180 
00181    // Get the xCFGMutex.
00182    if( pdTRUE == x_supervisor_SemaphoreTake( xCFGMutex, 20 ) )
00183    {
00184        // get the field
00185        if (config_file_get_value(SENSOR_PB2_CONFIG_FILE, "alarm" , token) >= 0)
00186        {
00187          // update value
00188          if (!strcmp(token, "on"))
00189          {
00190            bAlarm2 = pdTRUE;
00191          }
00192        }
00193      // Release the xCFGMutex.
00194      x_supervisor_SemaphoreGive( xCFGMutex );
00195    }
00196    /* configure push button to produce IT on input change */
00197    gpio_enable_pin_interrupt(PB2_POSITION , GPIO_PIN_CHANGE);
00198    /* Disable all interrupts */
00199    Disable_global_interrupt();
00200    /* register push button 2 handler on level 3 */
00201    INTC_register_interrupt( (__int_handler)&vpushb_ISR, AVR32_GPIO_IRQ_0 + (PB2_POSITION/8), AVR32_INTC_INT3);
00202    /* Enable all interrupts */
00203    Enable_global_interrupt();
00204    return (TRUE);
00205 }

Bool b_pushb3_get_value ( xLogDef pxLog  ) 

Get a pushbutton current state.

Parameters:
pxLog a Log structure. The id field identifies the pushbutton.
Returns:
TRUE upon success, FALSE if error.

Definition at line 392 of file pushb.c.

References acpc_pushb_events, b_pushb3, LogDef::pcStringLog, and LogDef::pfFreeStringLog.

Referenced by b_sensor_get_value().

00393 {
00394    // Build the log string.
00395    pxLog->pfFreeStringLog = NULL; // We use a constant.
00396    pxLog->pcStringLog = (portCHAR *)acpc_pushb_events[b_pushb3];
00397 
00398    return( TRUE );
00399 }

Bool b_pushb3_init ( void   ) 

Init the push button 3 sensor.

Returns:
TRUE upon success, FALSE if error.

Definition at line 221 of file pushb.c.

References bAlarm3, config_file_get_value(), PB3_POSITION, SENSOR_PB3_CONFIG_FILE, vpushb_ISR(), x_supervisor_SemaphoreGive(), x_supervisor_SemaphoreTake(), and xCFGMutex.

00222 {
00223 portCHAR token[6];
00224 
00225    // Get the xCFGMutex.
00226    if( pdTRUE == x_supervisor_SemaphoreTake( xCFGMutex, 20 ) )
00227    {
00228        // get the field
00229        if (config_file_get_value(SENSOR_PB3_CONFIG_FILE, "alarm" , token) >= 0)
00230        {
00231          // update value
00232          if (!strcmp(token, "on"))
00233          {
00234            bAlarm3 = pdTRUE;
00235          }
00236        }
00237      // Release the xCFGMutex.
00238      x_supervisor_SemaphoreGive( xCFGMutex );
00239    }
00240    /* configure push button to produce IT on input change */
00241    gpio_enable_pin_interrupt(PB3_POSITION , GPIO_PIN_CHANGE);
00242    /* Disable all interrupts */
00243    Disable_global_interrupt();
00244    /* register push button 3 handler on level 3 */
00245    INTC_register_interrupt( (__int_handler)&vpushb_ISR, AVR32_GPIO_IRQ_0 + (PB3_POSITION/8), AVR32_INTC_INT3);
00246    /* Enable all interrupts */
00247    Enable_global_interrupt();
00248    return (TRUE);
00249 }

eExecStatus e_pushb1_get_config ( signed portCHAR **  ppcStringReply  ) 

Get the pushbutton1 sensor config.

Parameters:
ppcStringReply Input/Output. The response string. NEVER NULL AS INPUT. A malloc for the response string is performed here; the caller must free this string.
Returns:
the status of the command execution.

Definition at line 269 of file pushb.c.

References bAlarm1, and prv_e_pushb_get_config().

00270 {
00271    return( prv_e_pushb_get_config( ppcStringReply, bAlarm1 ) );
00272 }

eExecStatus e_pushb1_set_config ( signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
)

set push button config command: set the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: set_sensor_config sensor=name param=value

Set the sensor config.

Parameters:
ac Input. The argument counter. For this command, should be 2.
av Input. The argument vector.
ppcStringReply Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed here; the caller must free this string.
Returns:
the status of the command execution.

Definition at line 318 of file pushb.c.

References bAlarm1, prv_e_pushb_set_config(), and SENSOR_PB1_CONFIG_FILE.

00319 {
00320   return (prv_e_pushb_set_config(&bAlarm1, SENSOR_PB1_CONFIG_FILE, ppcStringReply, ac, av));
00321 }

eExecStatus e_pushb2_get_config ( signed portCHAR **  ppcStringReply  ) 

Get the pushbutton2 sensor config.

Parameters:
ppcStringReply Input/Output. The response string. NEVER NULL AS INPUT. A malloc for the response string is performed here; the caller must free this string.
Returns:
the status of the command execution.

Definition at line 284 of file pushb.c.

References bAlarm2, and prv_e_pushb_get_config().

00285 {
00286    return( prv_e_pushb_get_config( ppcStringReply, bAlarm2 ) );
00287 }

eExecStatus e_pushb2_set_config ( signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
)

set push button config command: set the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: set_sensor_config sensor=name param=value

Set the sensor config.

Parameters:
ac Input. The argument counter. For this command, should be 2.
av Input. The argument vector.
ppcStringReply Input/Output. The response string.
Returns:
the status of the command execution.

Definition at line 333 of file pushb.c.

References bAlarm2, prv_e_pushb_set_config(), and SENSOR_PB2_CONFIG_FILE.

00334 {
00335   return (prv_e_pushb_set_config(&bAlarm2, SENSOR_PB2_CONFIG_FILE, ppcStringReply, ac, av));
00336 }

eExecStatus e_pushb3_get_config ( signed portCHAR **  ppcStringReply  ) 

Get the pushbutton3 sensor config.

Parameters:
ppcStringReply Input/Output. The response string. NEVER NULL AS INPUT. A malloc for the response string is performed here; the caller must free this string.
Returns:
the status of the command execution.

Definition at line 299 of file pushb.c.

References bAlarm3, and prv_e_pushb_get_config().

00300 {
00301    return( prv_e_pushb_get_config( ppcStringReply, bAlarm3 ) );
00302 }

eExecStatus e_pushb3_set_config ( signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
)

set push button config command: set the config fields value of a sensor. Takes one parameter, that is the sensor's name. Format: set_sensor_config sensor=name param=value

Set the sensor config.

Parameters:
ac Input. The argument counter. For this command, should be 2.
av Input. The argument vector.
ppcStringReply Input/Output. The response string.
Returns:
the status of the command execution.

Definition at line 348 of file pushb.c.

References bAlarm3, prv_e_pushb_set_config(), and SENSOR_PB3_CONFIG_FILE.

00349 {
00350   return (prv_e_pushb_set_config(&bAlarm3, SENSOR_PB3_CONFIG_FILE, ppcStringReply, ac, av));
00351 }

static eExecStatus prv_e_pushb_get_config ( signed portCHAR **  ppcStringReply,
Bool  bAlarm 
) [static]

The get config command: get the config fields value of a sensor.

Parameters:
bAlarm Input. the alarm value to return.
ppcStringReply Input/Output. The response string.
Returns:
the status of the command execution.

Definition at line 413 of file pushb.c.

References SENSOR_MSG_ALARM_OFF, SENSOR_MSG_ALARM_ON, and SHELL_EXECSTATUS_OK_NO_FREE.

Referenced by e_pushb1_get_config(), e_pushb2_get_config(), and e_pushb3_get_config().

00415 {
00416    if ( bAlarm == TRUE )
00417      *ppcStringReply = (signed portCHAR *)SENSOR_MSG_ALARM_ON;
00418    else
00419      *ppcStringReply = (signed portCHAR *)SENSOR_MSG_ALARM_OFF;
00420    return( SHELL_EXECSTATUS_OK_NO_FREE );
00421 }

static eExecStatus prv_e_pushb_set_config ( Bool *  bAlarm,
portCHAR *  filename,
signed portCHAR **  ppcStringReply,
int  ac,
signed portCHAR *  av[] 
) [static]

set push button config command: set the config fields value of a sensor.

Parameters:
bAlarm Input. The flag to set or clear.
filename Input. The configuration filename to update.
ppcStringReply Input/Output. The response string.
ac Input. The argument counter. For this command, should be 2.
av Input. The argument vector.
Returns:
the status of the command execution.

Definition at line 433 of file pushb.c.

References config_file_set_value(), SENSOR_MSG_ALARM_OFF, SENSOR_MSG_ALARM_ON, SHELL_ERRMSG_CONFIGERROR, SHELL_EXECSTATUS_KO, and SHELL_EXECSTATUS_OK_NO_FREE.

Referenced by e_pushb1_set_config(), e_pushb2_set_config(), and e_pushb3_set_config().

00434 {
00435   if (config_file_set_value(filename, ac, av) != 0)
00436   {
00437     *ppcStringReply = (signed portCHAR *)SHELL_ERRMSG_CONFIGERROR;
00438     // return error
00439     return( SHELL_EXECSTATUS_KO );
00440   }
00441   if (!strcmp((char *)av[1] , "on"))
00442   {
00443     *bAlarm = pdTRUE;
00444     *ppcStringReply = (signed portCHAR *)SENSOR_MSG_ALARM_ON;
00445     return( SHELL_EXECSTATUS_OK_NO_FREE );
00446   }
00447   else if (!strcmp( (char *)av[1], "off"))
00448   {
00449     *bAlarm = pdFALSE;
00450     *ppcStringReply = (signed portCHAR *)SENSOR_MSG_ALARM_OFF;
00451     return( SHELL_EXECSTATUS_OK_NO_FREE );
00452   }
00453   else
00454   {
00455     *ppcStringReply = (signed portCHAR *)SHELL_ERRMSG_CONFIGERROR;
00456     return( SHELL_EXECSTATUS_KO );
00457   }
00458 }

static portBASE_TYPE prvpushb_ISR_NonNakedBehaviour ( void   )  [static]

push button interrupt handler. Here, declarations should be done

Definition at line 488 of file pushb.c.

References acpc_pushb_events, b_pushb1, b_pushb2, b_pushb3, bAlarm1, bAlarm2, bAlarm3, DATALOG_ID_PB1, DATALOG_ID_PB2, DATALOG_ID_PB3, LogDef::id, PB1_POSITION, PB2_POSITION, PB3_POSITION, LogDef::pcStringLog, LogDef::pfFreeStringLog, PUSHB_EVENT_PRESS, PUSHB_EVENT_RELEASE, pxdatalog_log_alloc_init_FromISR, v_SMTP_PostFromISR(), and x_datalog_AddLogFromISR().

Referenced by vpushb_ISR().

00489 {
00490 xLogDef *pxLog;
00491 portBASE_TYPE xSwitchRequired = pdFALSE;
00492 
00493   /* depending on the push buttons */
00494   if (gpio_get_pin_interrupt_flag(PB1_POSITION))
00495   {
00496       /* input is pulled up, if 1 : input is not active */
00497       if (gpio_get_pin_value(PB1_POSITION))
00498       {
00499          b_pushb1 = PUSHB_EVENT_RELEASE;
00500       }
00501       else
00502       {
00503          b_pushb1 = PUSHB_EVENT_PRESS;
00504          if ( bAlarm1 == pdTRUE )
00505          {
00506            // post alarm to SMTP task
00507            v_SMTP_PostFromISR("Push Button 1 Alarm", NULL);
00508          }
00509       }
00510       // Alloc and init a log.
00511       pxLog = pxdatalog_log_alloc_init_FromISR();
00512       if( NULL != pxLog )
00513       {
00514          // Init the id field of the log.
00515          pxLog->id = DATALOG_ID_PB1;
00516          /* set log event string */
00517          pxLog->pcStringLog = (portCHAR *)acpc_pushb_events[b_pushb1];
00518          /* set free function pointer */
00519          pxLog->pfFreeStringLog = NULL;
00520          /* add the log entry */
00521          xSwitchRequired = x_datalog_AddLogFromISR( pxLog );
00522       }
00523       /* allow new interrupt : clear the IFR flag */
00524       gpio_clear_pin_interrupt_flag(PB1_POSITION);
00525   }
00526   if (gpio_get_pin_interrupt_flag(PB2_POSITION))
00527   {
00528       /* input is pulled up, if 1 : input is not active */
00529       if (gpio_get_pin_value(PB2_POSITION))
00530       {
00531          b_pushb2 = PUSHB_EVENT_RELEASE;
00532       }
00533       else
00534       {
00535          b_pushb2 = PUSHB_EVENT_PRESS;
00536          if ( bAlarm2 == pdTRUE )
00537          {
00538            // post alarm to SMTP task
00539            v_SMTP_PostFromISR("Push Button 2 Alarm", NULL);
00540          }
00541       }
00542       // Alloc and init a log.
00543       pxLog = pxdatalog_log_alloc_init_FromISR();
00544       if( NULL != pxLog )
00545       {
00546          // Init the id field of the log.
00547          pxLog->id = DATALOG_ID_PB2;
00548          /* set log event string */
00549          pxLog->pcStringLog = (portCHAR *)acpc_pushb_events[b_pushb2];
00550          /* set free function pointer */
00551          pxLog->pfFreeStringLog = NULL;
00552          /* add the log entry */
00553          xSwitchRequired = x_datalog_AddLogFromISR( pxLog );
00554       }
00555       /* allow new interrupt : clear the IFR flag */
00556       gpio_clear_pin_interrupt_flag(PB2_POSITION);
00557   }
00558   if (gpio_get_pin_interrupt_flag(PB3_POSITION))
00559   {
00560       /* input is pulled up, if 1 : input is not active */
00561       if (gpio_get_pin_value(PB3_POSITION))
00562       {
00563          b_pushb3 = PUSHB_EVENT_RELEASE;
00564       }
00565       else
00566       {
00567          b_pushb3 = PUSHB_EVENT_PRESS;
00568          if ( bAlarm3 == pdTRUE )
00569          {
00570            // post alarm to SMTP task
00571            v_SMTP_PostFromISR("Push Button 3 Alarm", NULL);
00572          }
00573       }
00574       // Alloc and init a log.
00575       pxLog = pxdatalog_log_alloc_init_FromISR();
00576       if( NULL != pxLog )
00577       {
00578          // Init the id field of the log.
00579          pxLog->id = DATALOG_ID_PB3;
00580          /* set log event string */
00581          pxLog->pcStringLog = (portCHAR *)acpc_pushb_events[b_pushb3];
00582          /* set free function pointer */
00583          pxLog->pfFreeStringLog = NULL;
00584          /* add the log entry */
00585          xSwitchRequired = x_datalog_AddLogFromISR( pxLog );
00586       }
00587       /* allow new interrupt : clear the IFR flag */
00588       gpio_clear_pin_interrupt_flag(PB3_POSITION);
00589   }
00590   return( xSwitchRequired );
00591 }

void v_pushb1_stop ( void   ) 

Stop the push button 1 sensor.

Definition at line 166 of file pushb.c.

References PB1_POSITION.

00167 {
00168   /* Disable the IT. */
00169   gpio_disable_pin_interrupt( PB1_POSITION );
00170 }

void v_pushb2_stop ( void   ) 

Stop the push button 2 sensor.

Definition at line 210 of file pushb.c.

References PB2_POSITION.

00211 {
00212   /* Disable the IT. */
00213   gpio_disable_pin_interrupt( PB2_POSITION );
00214 } 

void v_pushb3_stop ( void   ) 

Stop the push button 3 sensor.

Stop the push button 1 sensor.

Definition at line 254 of file pushb.c.

References PB3_POSITION.

00255 {
00256   /* Disable the IT. */
00257   gpio_disable_pin_interrupt( PB3_POSITION );
00258 } 

void vpushb_ISR ( void   ) 

push button naked interrupt handler.

Definition at line 468 of file pushb.c.

References prvpushb_ISR_NonNakedBehaviour().

Referenced by b_pushb1_init(), b_pushb2_init(), and b_pushb3_init().

00469 {
00470  /* This ISR can cause a context switch, so the first statement must be a
00471      call to the portENTER_SWITCHING_ISR() macro.  This must be BEFORE any
00472      variable declarations. */
00473   portENTER_SWITCHING_ISR();
00474 
00475   prvpushb_ISR_NonNakedBehaviour();
00476 
00477   portEXIT_SWITCHING_ISR();
00478 }


Variable Documentation

const signed portCHAR* acpc_pushb_events[2]

Initial value:

 {
   (signed portCHAR *)"RELEASE",
   (signed portCHAR *)"PRESS"
}
Pushbutton events string.

Definition at line 87 of file pushb.c.

Referenced by b_pushb1_get_value(), b_pushb2_get_value(), b_pushb3_get_value(), and prvpushb_ISR_NonNakedBehaviour().

Bool b_pushb1 = PUSHB_EVENT_RELEASE [static]

Pushbutton events emulation.

Definition at line 93 of file pushb.c.

Referenced by b_pushb1_get_value(), and prvpushb_ISR_NonNakedBehaviour().

Bool b_pushb2 = PUSHB_EVENT_RELEASE [static]

Definition at line 94 of file pushb.c.

Referenced by b_pushb2_get_value(), and prvpushb_ISR_NonNakedBehaviour().

Bool b_pushb3 = PUSHB_EVENT_RELEASE [static]

Definition at line 95 of file pushb.c.

Referenced by b_pushb3_get_value(), and prvpushb_ISR_NonNakedBehaviour().

Bool bAlarm1 = pdFALSE [static]

Alarm upon event.

Definition at line 98 of file pushb.c.

Referenced by b_pushb1_init(), e_pushb1_get_config(), e_pushb1_set_config(), and prvpushb_ISR_NonNakedBehaviour().

Bool bAlarm2 = pdFALSE [static]

Bool bAlarm3 = pdFALSE [static]

xSemaphoreHandle xCFGMutex

The CFG system mutex.

The CFG system mutex.

Definition at line 203 of file supervisor.c.


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