Mario Bambagini / Mbed 2 deprecated supervisor

Dependencies:   mbed-rtos mbed ssWi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers config.h Source File

config.h

00001 #ifndef __SUPERVISOR_CONFIG__
00002 #define __SUPERVISOR_CONFIG__
00003 
00004 // TIME
00005 #define TIMEOUT_READ                10.0
00006 #define INTERVAL_SAMPLING           40.0
00007 #define INTERVAL_SYNC               5.0
00008 #define INTERVAL_1_SECOND           1.0
00009 #define INTERVAL_60_SECONDS         60
00010 #define INTERVAL_POWER_START        20.0
00011 
00012 // COMM VALUES
00013 #define COMM_NO_VALUE               0x0000
00014 #define COMM_START_SAMPLING         0xAAAA
00015 #define COMM_STOP_SAMPLING          0x1111
00016 #define COMM_START_WATERING_OFFSET  0xFF00
00017 #define COMM_SHUTDOWN               0x00FF
00018 #define COMM_EXIT                   0x2244
00019 #define COMM_SAMPLING_KO            0x2222
00020 #define COMM_SAMPLING_OUT           0x5555
00021 #define COMM_SAMPLING_OK            0xBBBB
00022 #define COMM_WATERING_KO            0x3333
00023 #define COMM_WATERING_OK            0xCCCC
00024 #define COMM_LOW_WATER_LEVEL        0x7777
00025 
00026 // PORTS
00027 #define PORT_COMMANDS               0x00
00028 #define PORT_HUMIDITY_OFFSET        0x01
00029 #define PORT_TEMPERATURE_OFFSET     0x02
00030 #define PORT_MOISTURE_OFFSET        0x03
00031 #define PORT_WATER_OFFSET           0x04
00032 #define PORT_RESPONSE_OFFSET        0x05
00033 
00034 #define MAX_NUM_NODES               10
00035 
00036 // FILES
00037 #define FILE_CNT                    "/local/CNT.txt"
00038 #define FILE_CFG                    "/local/cfg.txt"
00039 #define FILE_SNS                    "/local/SNS.txt"
00040 #define FILE_WTR                    "/local/WTR.txt"
00041 #define FILE_BSY                    "/local/BSY.txt"
00042 
00043 // NETWORK
00044 #define PAN_ID                      102
00045 #define CHANNEL_ID                  14
00046 #define XBEE_TX_PER_SECOND          3
00047 #define XBEE_RX_PER_SECOND          10
00048 #define XBEE_PIN_TX                 p9
00049 #define XBEE_PIN_RX                 p10
00050 
00051 #define POWER_EN_PIN                p27
00052 #define POWER_ON                    0
00053 #define POWER_OFF                   1
00054 
00055 struct watering_unit_node_t {
00056     int address;
00057     int watering_wait;
00058     int watering_seconds;
00059 };
00060 
00061 struct global_confg_t {
00062     int count;
00063     int wait_minutes;
00064     int num_units;
00065     watering_unit_node_t nodes[MAX_NUM_NODES];
00066 };
00067 
00068 #endif //__SUPERVISOR_CONFIG__