projet Iot

Dependencies:   BMP180 DHT11 SoftPWM SparkFun_APDS9960 mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers configuration.h Source File

configuration.h

00001 /*************************************************************************************/
00002 /*************************************************************************************/
00003 /*                   PROJET IOT / GROUPE AGIR / EISE5 2015-2016                      */
00004 /*                            Fichier de configuration                               */
00005 /*************************************************************************************/
00006 /*************************************************************************************/
00007 
00008     typedef struct {
00009          int  temperature_01;
00010          int  temperature_02;
00011          int  humidite;
00012          long pression;
00013          int  luminosite;
00014          int  mouvement;
00015          } Informations;
00016 
00017 /*************************************************************************************/
00018 /*************************************************************************************/
00019 /*                          THREAD TEMPERATURE ET HUMIDITE                           */
00020 /*************************************************************************************/
00021 /*************************************************************************************/
00022 
00023     #define PIN_TEMPERATURE_HUMIDITY_SENSOR             P2_12
00024     #define TIME_WAIT_MS_TEMPERATURE_HUMIDITY_SENSOR    3000
00025 
00026 /*************************************************************************************/
00027 /*************************************************************************************/
00028 /*                               THREAD LED ET DEMUX                                 */
00029 /*************************************************************************************/
00030 /*************************************************************************************/
00031 
00032     #define PIN_MUX_P0              P2_13
00033     #define PIN_MUX_P1              P0_1
00034     #define PIN_MUX_P2              P0_0
00035     #define LED_ON                  1
00036     #define LED_OFF                 0
00037     #define TIME_WAIT_BLINK_LED     500
00038 
00039 /*************************************************************************************/
00040 /*************************************************************************************/
00041 /*                        THREAD TEMPERATURE ET PRESSION                             */
00042 /*************************************************************************************/
00043 /*************************************************************************************/
00044 
00045     #define PIN_PRESURE_SENSOR_SDA          P0_27
00046     #define PIN_PRESURE_SENSOR_SCL          P0_28
00047     #define TIME_WAIT_MS_PRESURE_SENSOR     3000
00048 
00049 /*************************************************************************************/
00050 /*************************************************************************************/
00051 /*                                THREAD PRESENCE                                    */
00052 /*************************************************************************************/
00053 /*************************************************************************************/
00054 
00055     #define PIN_MOUVEMENT_SENSOR_SDA                P0_27
00056     #define PIN_MOUVEMENT_SENSOR_SCL                P0_28
00057     #define PIN_MOUVEMENT_SENSOR_INTERRUPTION       P0_24
00058     #define TIME_WAIT_MS_INITIALISATION_FAILURE     20
00059     #define TIME_WAIT_MS_MOUVEMENT_SENSOR           100
00060 
00061 /*************************************************************************************/
00062 /*************************************************************************************/
00063 /*                                      BLE                                          */
00064 /*************************************************************************************/
00065 /*************************************************************************************/
00066 
00067     #define PIN_BLE_TX              P4_28
00068     #define PIN_BLE_RX              P4_29
00069     #define TIME_MS_PERIODE_BLE     5000  
00070 
00071 /*************************************************************************************/
00072 /*************************************************************************************/
00073 /*                                   POT & PWM                                       */
00074 /*************************************************************************************/
00075 /*************************************************************************************/
00076 
00077     #define PWM_PERIODE_MS      1
00078     #define PIN_POTENTIOMETRE   P1_31
00079     #define PIN_PWM_LED         P2_5
00080     #define PWM_VALUE_MIN       0.05
00081     #define PWM_VALUE_MAX       0.95
00082     #define PWM_LED_OFF         0
00083     #define PWM_LED_ON          1
00084 
00085 
00086 /*************************************************************************************/
00087 /*************************************************************************************/
00088 /*                           PROTOTYPAGE DE FONCTIONS                                */
00089 /*************************************************************************************/
00090 /*************************************************************************************/ 
00091 
00092     void thread_temperature(void const *name);
00093     void thread_pression(void const *name);  
00094     void thread_presence(void const *name);
00095     void thread_led(void const *name); 
00096     void trigger();
00097     void printGesture(int gesture); 
00098     int  getGesture(apds9960 *sensor); 
00099     void bleCallBack(void const *name); 
00100     void potAndPwm();
00101 
00102 /*************************************************************************************/
00103 /*************************************************************************************/
00104 /*                                  FIN PROGRAMME                                    */
00105 /*************************************************************************************/
00106 /*************************************************************************************/