IoT - Modular - Functions.h

From The TinkerNet Wiki
Jump to navigation Jump to search
  1 #ifndef FUNCTIONS_H
  2 #define FUNCTIONS_H
  3 
  4 // WiFi ////////////////////////////////////////////////////////////////////////
  5 
  6 void WiFi_init();    // Initialize the WiFi
  7 int WiFi_strength(); // Check the signal strength
  8 void WiFi_Test();
  9 void WiFi_Test2();
 10 void WiFi_Test3();
 11 
 12 // MQTT ////////////////////////////////////////////////////////////////////////
 13 
 14 void MQTT_init();
 15 
 16 void MQTT_callback(char *topic, byte *payload, int length);
 17 void MQTT_reconnect();
 18 void MQTT_beacon();
 19 
 20 void MQTT_handler();
 21 
 22 void MQTT_SendTELE(const char *Topic, const char *Message);
 23 void MQTT_SendSTAT(const char *Topic, const char *Message);
 24 void MQTT_SendCMND(const char *Topic, const char *Message);
 25 
 26 void MQTT_HandleMessages();
 27 
 28 // Debug ///////////////////////////////////////////////////////////////////////
 29 void debug_TitleScreen();                   // Title block for the project
 30 void debug_ReadyScreen();                   // Indicate setup is finished
 31 void debug_Separator();                     // Make a line
 32 void debug_SectionTitle(const char *Title); // Text at the left
 33 void debug_LineOut(const char *Line);       // Text 3 characters inset
 34 void debug_Action(const char *Line);        // Text centred
 35 void debug_Trouble(const char *Line);       //
 36 void debug_Success(const char *Line);       //
 37 void debug_ProgressBar0();
 38 void debug_ProgressBar1();
 39 void debug_ProgressBar2(int dotcount);
 40 void debug_ESP_info();
 41 
 42 // Pixels //////////////////////////////////////////////////////////////////////
 43 void Pixels_init();
 44 void SetAPixel(int, int *);
 45 
 46 // Noise ///////////////////////////////////////////////////////////////////////
 47 void Noise_init();
 48 void ScreamBloodyMurder();
 49 void STFU();
 50 void Boop();
 51 
 52 // Depth Probes ////////////////////////////////////////////////////////////////
 53 void Depth_init();
 54 void CheckProbes();
 55 
 56 // Hall Effect Trigger /////////////////////////////////////////////////////////
 57 void DumpDetect();
 58 void DumpDetect2();
 59 
 60 // BMP180 //////////////////////////////////////////////////////////////////////
 61 
 62 int BMP180_init();
 63 void BMP180_main();
 64 void BMP180_getReadings(int deviceNumber);
 65 void BMP180_SendData();
 66 void BMP180_debug();
 67 
 68 void BMP180_Display();
 69 
 70 // BME280 //////////////////////////////////////////////////////////////////////
 71 
 72 int BME280_init();
 73 void BME280_main();
 74 void BME280_getReadings(int deviceNumber);
 75 void BME280_SendData();
 76 void BME280_debug();
 77 
 78 void BME280_Display();
 79 
 80 float Climate_Pressure_Correction(float Pressure_Actual);
 81 
 82 // SSD1306 OLED ////////////////////////////////////////////////////////////////
 83 
 84 void SSD1306_init();
 85 bool SSD1306_Exists();
 86 void SSD1306_title(const char *Title);
 87 void SSD1306_Static(const char *Line, int Row);
 88 // void SSD1306_Display_DS18B20_Temps(struct DS18B20_Readings);
 89 // void SSD1306_Display_3_DS18B20_Temps(int SetCount, struct DS18B20_Readings Data);
 90 // void SSD1306_Display_BMP180_Temps(struct BMP180_Readings);
 91 
 92 void SSD1306_Display_Sensor_Data(
 93     const char TitleText[10],
 94     const char L1Text[6], float L1Data,
 95     const char L2Text[6], float L2Data,
 96     const char L3Text[6], float L3Data);
 97 
 98 void SSD1306_Display_Sensor_Data2(
 99     const char TitleText[10],
100     const char L1Text[6], float L1Data,
101     const char L2Text[6], float L2Data,
102     const char L3Text[6], float L3Data);
103 
104 // void SSD1306_Display_Si7021_Temps(struct Si7021_Readings Datum);
105 // void SSD1306_Display_HiH6130_Temps(struct hih6130_Readings Datum);
106 
107 void SSD1306_Indicate_Action();
108 
109 void WalkingDude();
110 void WavingDude();
111 void beerStickDude(int LEFT, int TOP);
112 
113 /*
114  * Display Controls
115  */
116 void SSD1306_off();
117 void SSD1306_on();
118 void SSD1306_Dim();
119 void SSD1306_Bright();
120 
121 // Supplimental Stuff //////////////////////////////////////////////////////////
122 
123 void blinkLED(int speed); // Just a little function to blink the LED
124 
125 /*
126  * I2C Management
127  */
128 bool I2C_Test(int SDA, int SCL); // Sometimes I2C acts dumb on reset of the MCU
129 int I2C_ClearBus(int SDA, int SCL);
130 
131 #endif // FUNCTIONS_H