egoShield
Classes | Macros | Functions | Variables
egoShieldS.h File Reference

Class definition for the egoShieldS library. More...

#include "Arduino.h"
#include <avr/pgmspace.h>
#include "screen.h"

Go to the source code of this file.

Classes

struct  buttons
 struct to hold information required to debounce button. More...
 
class  egoShield
 
class  egoShieldTimeLapse
 
class  egoShieldTeach
 

Macros

#define NOPAGE   0
 
#define RECORDPAGE   1
 
#define IDLEPAGE   2
 
#define PLAYPAGE   3
 
#define PAUSEPAGE   4
 
#define TIMEPAGE   5
 
#define DRAWPAGE(x)
 
#define BWBT   5
 
#define PLBT   4
 
#define RECBT   3
 
#define FWBT   6
 
#define CNT   50
 
#define OPTO   2
 
#define FULL   1
 
#define HALF   2
 
#define QUARTER   4
 
#define EIGHT   8
 
#define SIXTEEN   16
 
#define DEPRESSED   0 /** Definition of DEPRESSED button state */
 
#define PRESSED   1 /** Definition of PRESSED button state */
 
#define HOLD   2 /** Definition of HOLD button state */
 
#define HOLDTIME   50 /** Number of PRESSED samples before the button should be considered HOLD */
 
#define HOLDTICK   4 /** Number of HOLD samples before a new button press should be issued */
 
#define RESETWDT   asm volatile("WDR \n\t")
 

Functions

void TIMER4_COMPA_vect (void) __attribute__((signal
 Watchdog timer interrupt handler, for examining the buttons periodically. More...
 

Variables

void used
 

Detailed Description

Class definition for the egoShieldS library.

Author
Mogens Groth Nicolaisen (mogen.nosp@m.s@us.nosp@m.teppe.nosp@m.r.co.nosp@m.m)

Definition in file egoShieldS.h.

Macro Definition Documentation

◆ BWBT

#define BWBT   5

Forward button pin definition

Definition at line 122 of file egoShieldS.h.

◆ CNT

#define CNT   50

Max record count definition

Definition at line 130 of file egoShieldS.h.

◆ DRAWPAGE

#define DRAWPAGE (   x)
Value:
do\
{\
if(this->screen->busFailure)\
{\
cli();\
this->lastPage = NOPAGE;\
this->screen->init();\
x;\
sei();\
}\
else\
{\
x;\
}\
}\
while(this->screen->busFailure);\

Definition at line 104 of file egoShieldS.h.

◆ EIGHT

#define EIGHT   8

Eighth step definition

Definition at line 141 of file egoShieldS.h.

◆ FULL

#define FULL   1

Full step definition

Definition at line 135 of file egoShieldS.h.

◆ FWBT

#define FWBT   6

Backward button pin definition

Definition at line 128 of file egoShieldS.h.

◆ HALF

#define HALF   2

Half step definition

Definition at line 137 of file egoShieldS.h.

◆ OPTO

#define OPTO   2

Optocoupler pin definition

Definition at line 132 of file egoShieldS.h.

◆ PLBT

#define PLBT   4

Play button pin definition

Definition at line 124 of file egoShieldS.h.

◆ QUARTER

#define QUARTER   4

Quarter step definition

Definition at line 139 of file egoShieldS.h.

◆ RECBT

#define RECBT   3

Record button pin definition

Definition at line 126 of file egoShieldS.h.

◆ RESETWDT

#define RESETWDT   asm volatile("WDR \n\t")

Macro for resetting watchdog timer

Definition at line 164 of file egoShieldS.h.

◆ SIXTEEN

#define SIXTEEN   16

Sixteenth step definition

Definition at line 143 of file egoShieldS.h.

Function Documentation

◆ TIMER4_COMPA_vect()

void TIMER4_COMPA_vect ( void  )

Watchdog timer interrupt handler, for examining the buttons periodically.

The Watchdog is configured to interrupt once every 16ms, to examine the IO state of the buttons, and performing the debouncing. The debouncing algorithm looks at the last five measured IO states of each button individually, to determine whether a button has finished bouncing or not. In order to see if the button is held or just pressed, a counter (seperate for each button) is incremented every time all the last five measurements are identical and if this counter reaches the value "HOLDTIME", the button are considered held. If any IO measurement is different from the last one, the counter is reset.

Definition at line 38 of file egoShieldS.cpp.