demos_source/code_TestDoorLight.c File Reference

#include "femtoos_code.h"

Include dependency graph for code_TestDoorLight.c:

Go to the source code of this file.

Defines

#define pinLEDbeacon   PA0
 This file is the program for controlling a lamp using one capacitive switch.
#define pinLEDsignal   PA1
#define pinLAMP   PA2
#define pinSWITCH   PB0
#define setChannel(channel, state)   if (!state) { PORTA |= (1 << (channel)); } else { PORTA &= ~(1 << (channel)); }

Functions

void appBoot (void)
 Prototype for the general initialization.
void appTick16 (void)
 Tick hook called every tick rollover (65536 ticks).
void appLoop_ReadSwitch (void)
static void LedOff ()
static void LedFlash ()
static void LedOn ()
static void LedBeacon ()
void appLoop_DriveLed (void)
void appLoop_DriveLamp (void)

Variables

volatile Tuint08 uiLedMode
volatile Tuint08 uiDelayMode
volatile Tuint08 uiDelayTimer


Define Documentation

#define pinLAMP   PA2

Definition at line 55 of file code_TestDoorLight.c.

Referenced by appLoop_DriveLamp().

#define pinLEDbeacon   PA0

This file is the program for controlling a lamp using one capacitive switch.

State of the system is displayed using one led. In steady state the led is weakly lit, just enough to find the switch in the dark. Touching the switch once, activates the lamp, for about 2 minutes. The led will start blinking. The following scheme is displayed in repetition: 5 sec on: Switching now increased the on-timer 1,2,3 or 4 blinks: Showing the internal mode: (2min, 15min, 60min, 4hour on). 5 sec on: Switching now turns lamp of. See also the schematics attached.

Definition at line 53 of file code_TestDoorLight.c.

Referenced by LedBeacon(), LedFlash(), LedOff(), and LedOn().

#define pinLEDsignal   PA1

Definition at line 54 of file code_TestDoorLight.c.

Referenced by LedBeacon(), LedFlash(), LedOff(), and LedOn().

#define pinSWITCH   PB0

Definition at line 56 of file code_TestDoorLight.c.

Referenced by appLoop_ReadSwitch().

#define setChannel ( channel,
state   )     if (!state) { PORTA |= (1 << (channel)); } else { PORTA &= ~(1 << (channel)); }

Definition at line 65 of file code_TestDoorLight.c.

Referenced by appLoop_DriveLamp(), LedBeacon(), LedFlash(), LedOff(), and LedOn().


Function Documentation

void appBoot ( void   ) 

Prototype for the general initialization.

This is the first application code called. It is called only after a reset, thus in principle once.

Definition at line 58 of file code_TestDoorLight.c.

void appLoop_DriveLamp ( void   ) 

Definition at line 161 of file code_TestDoorLight.c.

References pinLAMP, setChannel, taskDelayFromNow(), and uiDelayMode.

Here is the call graph for this function:

void appLoop_DriveLed ( void   ) 

Definition at line 149 of file code_TestDoorLight.c.

References LedBeacon(), LedFlash(), LedOff(), and LedOn().

Here is the call graph for this function:

void appLoop_ReadSwitch ( void   ) 

Definition at line 92 of file code_TestDoorLight.c.

References pinSWITCH, taskDelayFromNow(), Tuint08, uiDelayMode, uiDelayTimer, and uiLedMode.

Here is the call graph for this function:

void appTick16 ( void   ) 

Tick hook called every tick rollover (65536 ticks).

Keep code inside short. API calls inside are not allowed, even the genXXX are not allowed. The tick counter may not be valid when called. This call is executed inside OS realm. In case of low power down, missed ticks are catched up, but may be deferred.

Definition at line 86 of file code_TestDoorLight.c.

Referenced by genAddtoTickCount(), and privIncrementTick().

Here is the caller graph for this function:

static void LedBeacon (  )  [static]

Definition at line 142 of file code_TestDoorLight.c.

References pinLEDbeacon, pinLEDsignal, setChannel, taskDelayFromNow(), uiDelayMode, and uiLedMode.

Referenced by appLoop_DriveLed().

Here is the call graph for this function:

Here is the caller graph for this function:

static void LedFlash (  )  [static]

Definition at line 124 of file code_TestDoorLight.c.

References pinLEDbeacon, pinLEDsignal, setChannel, taskDelayFromNow(), Tuint08, uiDelayMode, and uiLedMode.

Referenced by appLoop_DriveLed().

Here is the call graph for this function:

Here is the caller graph for this function:

static void LedOff (  )  [static]

Definition at line 117 of file code_TestDoorLight.c.

References pinLEDbeacon, pinLEDsignal, setChannel, taskDelayFromNow(), uiDelayMode, and uiLedMode.

Referenced by appLoop_DriveLed().

Here is the call graph for this function:

Here is the caller graph for this function:

static void LedOn (  )  [static]

Definition at line 135 of file code_TestDoorLight.c.

References pinLEDbeacon, pinLEDsignal, setChannel, taskDelayFromNow(), uiDelayMode, and uiLedMode.

Referenced by appLoop_DriveLed().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

volatile Tuint08 uiDelayMode

Definition at line 82 of file code_TestDoorLight.c.

Referenced by appLoop_DriveLamp(), appLoop_ReadSwitch(), appTick16(), LedBeacon(), LedFlash(), LedOff(), and LedOn().

volatile Tuint08 uiDelayTimer

Definition at line 83 of file code_TestDoorLight.c.

Referenced by appLoop_ReadSwitch(), and appTick16().

volatile Tuint08 uiLedMode

Definition at line 81 of file code_TestDoorLight.c.

Referenced by appLoop_ReadSwitch(), LedBeacon(), LedFlash(), LedOff(), and LedOn().


Generated on Fri Oct 16 00:05:22 2009 for FemtoOS by  doxygen 1.5.2