|
Open Garden
0.10.1-21
|
structures. More...


Go to the source code of this file.
Data Structures | |
| struct | program_t |
| struct | queue_t |
| the queue buffer More... | |
| struct | programs_t |
Macros | |
| #define | CHECK_VALID_CODE 0x09 |
| check code to control if a valid program is in memory. More... | |
| #define | SERNO_SIZE 0x10 |
| #define | MAX_PROGS 20 |
| maximum number of programs | |
| #define | PROG_MAX_FACTOR 3.0 |
| #define | PROG_TOMORROW_FACTOR 2.0 |
| #define | Q_NEW 0 |
| #define | Q_OFF 1 |
| #define | Q_RUN 2 |
| #define | Q_DELAYED 3 |
| #define | FULLSUN 0 |
| #define | HALFSUN 1 |
| #define | SHADOW 2 |
| #define | MONOSTABLE 1 |
| #define | BISTABLE 2 |
| #define | FL_SUNSITE 0 |
| #define | FL_VTYPE 2 |
| #define | FL_LOG 3 |
| #define | FL_LEVEL 4 |
| #define | FL_LED 5 |
| #define | FL_ALRM 6 |
| #define | ALRM_THRESHOLD 3 |
| #define | FALSE 0 |
| #define | TRUE 1 |
| #define | LOW 0 |
| #define | HIGH 1 |
| #define | OFF 0 |
| #define | ON 1 |
Functions | |
| void | flag_set (struct programs_t *progs, const uint8_t bit, const uint8_t val) |
| uint8_t | flag_get (struct programs_t *progs, const uint8_t bit) |
structures.
| #define ALRM_THRESHOLD 3 |
Number of consecutive alarm to be active to switch alarm on/off
| #define BISTABLE 2 |
valve type
| #define CHECK_VALID_CODE 0x09 |
check code to control if a valid program is in memory.
Change this code any time the struct program_t has been changed when reprogram the micro. During boot the program read from flash this code, and, if it is valid, retrive from flash the stored programs. If the structs are changed, we should change this code too, to avoid retrival of wrong data. If, during programming, you nuke the flash memory too, this check code is useless.
| #define FALSE 0 |
Macro FALSE
| #define FL_ALRM 6 |
flag alarm active
| #define FL_LED 5 |
flag leds ON or OFF
| #define FL_LEVEL 4 |
flag alarm level High or Low
| #define FL_LOG 3 |
flag log enable/disable
| #define FL_SUNSITE 0 |
flag sunsite 2 bit (0, 1)
| #define FL_VTYPE 2 |
flag valve type mono/bi-stable
| #define FULLSUN 0 |
sunlight position.
| #define HALFSUN 1 |
sunlight position.
| #define HIGH 1 |
Macro HIGH
| #define LOW 0 |
Macro LOW
| #define MONOSTABLE 1 |
valve type
| #define OFF 0 |
Macro OFF
| #define ON 1 |
Macro ON
| #define PROG_MAX_FACTOR 3.0 |
Maximum increment factor for time increase.
| #define PROG_TOMORROW_FACTOR 2.0 |
Factor increment for tomorrow program reschedule.
| #define Q_DELAYED 3 |
queue status DELAYED
| #define Q_NEW 0 |
queue status NEW
| #define Q_OFF 1 |
queue status OFF
| #define Q_RUN 2 |
queue status RUN
| #define SERNO_SIZE 0x10 |
Serial number size in byte.
Like: PPVVYYMMDDxxxx0C where: PP - Hardware manufacturer code VV - Hardware version YY - Year MM - Month DD - Day xxxx - Incremental number 0 - \0 string terminator C - crc8 checksum
| #define SHADOW 2 |
sunlight position.
| #define TRUE 1 |
Macro TRUE
| uint8_t flag_get | ( | struct programs_t * | progs, |
| const uint8_t | bit | ||
| ) |
Get flag value.
This function will get the correspondent bit in the flags byte.
ex. check the led flag value is if (flag_get(progs, FL_LEDS)) ...
| *progs | the ogstruct. |
| bit | the bit of the flag's byte. |
| void flag_set | ( | struct programs_t * | progs, |
| const uint8_t | bit, | ||
| const uint8_t | val | ||
| ) |
1.8.13