IoT-MBBR (masterthesis)
Masterthesis upgrading a Moving Bed BioReactor with extra sensors and cloud connectivity.
DS18B20.c
Go to the documentation of this file.
1 /***************************************************************************//**
2  * @file DS18B20.c
3  * @brief All code for the DS18B20 temperature sensor.
4  * @version 4.0
5  * @author
6  * Alec Vanderhaegen & Sarah Goossens@n
7  * Heavily modified by Brecht Van Eeckhoudt
8  *
9  * ******************************************************************************
10  *
11  * @section Versions
12  *
13  * @li v1.0: Reformatted existing methods to use pin_mapping.h, changed unsigned char to
14  * uint8_t values, added comments and cleaned up includes.
15  * @li v1.1: Added documentation, removed unnecessary GPIO statements regarding
16  * DOUT values of VDD pin.
17  * @li v1.2: Removed some unnecessary GPIO lines and added comments about `out` (DOUT) argument.
18  * @li v1.3: Changed some methods to be static (~hidden).
19  * @li v1.4: Cleaned up includes.
20  * @li v1.5: Made more methods static.
21  * @li v1.6: Updated documentation.
22  * @li v1.7: Started using new delay functionality.
23  * @li v1.8: Added line to disable DATA pin after a measurement, this breaks the code but fixes the sleep current.
24  * @li v1.9: Enabled and disabled timer each time a measurement is taken.
25  * @li v2.0: Updated documentation.
26  * @li v2.1: Changed method to return `uint32_t` instead of float.
27  * @li v2.2: Changed error numbering, moved definition from header to source file and updated header file include.
28  * @li v2.3: Changed *timeout* variable and changed types to `int32_t`.
29  * @li v2.4: Fixed temperature measurement and refined timeout functionality.
30  * @li v2.5: Updated documentation.
31  * @li v2.6: Updated code to don't execute code further if the first initialization failed.
32  * @li v3.0: Disabled initialized functionality before entering an `error` function, added
33  * functionality to exit methods after `error` call and updated version number.
34  * @li v3.1: Removed `static` before the local variable (not necessary).
35  * @li v4.0: Fixed timing for reading/writing bytes.
36  *
37  * ******************************************************************************
38  *
39  * @section License
40  *
41  * **Copyright (C) 2020 - Brecht Van Eeckhoudt**
42  *
43  * This program is free software: you can redistribute it and/or modify
44  * it under the terms of the **GNU General Public License** as published by
45  * the Free Software Foundation, either **version 3** of the License, or
46  * (at your option) any later version.
47  *
48  * This program is distributed in the hope that it will be useful,
49  * but WITHOUT ANY WARRANTY; without even the implied warranty of
50  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51  * GNU General Public License for more details.
52  *
53  * *A copy of the GNU General Public License can be found in the `LICENSE`
54  * file along with this source code.*
55  *
56  * @n
57  *
58  * Some methods also use code obtained from examples from [Silicon Labs' GitHub](https://github.com/SiliconLabs/peripheral_examples).
59  * These sections are licensed under the Silabs License Agreement. See the file
60  * "Silabs_License_Agreement.txt" for details. Before using this software for
61  * any purpose, you must agree to the terms of that agreement.
62  *
63  ******************************************************************************/
64 
65 
66 #include <stdint.h> /* (u)intXX_t */
67 #include <stdbool.h> /* "bool", "true", "false" */
68 #include "em_cmu.h" /* Clock Management Unit */
69 #include "em_gpio.h" /* General Purpose IO (GPIO) peripheral API */
70 
71 #include "DS18B20.h" /* Corresponding header file */
72 #include "pin_mapping.h" /* PORT and PIN definitions */
73 #include "debug_dbprint.h" /* Enable or disable printing to UART */
74 #include "delay.h" /* Delay functionality */
75 #include "util.h" /* Utility functionality */
76 #include "ustimer.h" /* Timer functionality */
77 
78 
79 /* Local definitions */
80 /** Enable (1) or disable (0) printing the timeout counter value using DBPRINT */
81 #define DBPRINT_TIMEOUT 0
82 
83 /* Maximum values for the counters before exiting a `while` loop */
84 #define TIMEOUT_INIT 100
85 #define TIMEOUT_CONVERSION 500 /* 12 bit resolution (reset default) = 750 ms max resolving time */
86 
87 
88 /* Local variable */
89 bool TEMP0_VDD_initialized = false;
90 bool TEMP1_VDD_initialized = false;
91 
92 
93 /* Local prototypes */
94 static void powerDS18B20 (uint8_t number, bool enabled);
95 static bool init_DS18B20 (uint8_t number);
96 static void writeByteDS18B20 (uint8_t number, uint8_t data);
97 static uint8_t readByteDS18B20 (uint8_t number);
98 static int32_t convertTempData (uint8_t tempLS, uint8_t tempMS);
99 
100 
101 /**************************************************************************//**
102  * @brief
103  * Get a temperature value from the DS18B20.
104  *
105  * @details
106  * USTimer gets initialized, the sensor gets powered, the data-transmission
107  * takes place, the timer gets de-initialized to disable the clocks and interrupts,
108  * the data and power pin get disabled and finally the read values are converted
109  * to an `int32_t` value.@n
110  * **Negative temperatures work fine.**
111  *
112  * @param[in] number
113  * @li `0` - TEMP0 selected.
114  * @li `1` - TEMP1 selected.
115  *
116  * @return
117  * The read temperature data.
118  *****************************************************************************/
120 {
121  /* Timeout counter */
122  uint16_t counter = 0;
123 
124  /* Variable to indicate if a conversion has been completed */
125  bool conversionCompleted = false;
126 
127  /* Variable to hold raw data bytes */
128  uint8_t rawDataDS18B20[9] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
129 
130  /* Initialize timer
131  * Initializing and disabling the timer again adds about 40 µs active time but should conserve sleep energy... */
132  USTIMER_Init();
133 
134  /* Initialize and power VDD pin */
135  powerDS18B20(number, true);
136 
137  /* Power-up delay of 5 ms */
138  delay(5);
139 
140  /* Initialize communication and only continue if successful */
141  if (init_DS18B20(number))
142  {
143  writeByteDS18B20(number, 0xCC); /* 0xCC = "Skip Rom" (address all devices on the bus simultaneously without sending out any ROM code information) */
144  writeByteDS18B20(number, 0x44); /* 0x44 = "Convert T" */
145 
146  /* MASTER now generates "read time slots", the DS18B20 will write HIGH to the bus if the conversion is completed
147  * The datasheet gives the following directions for time slots, but reading bytes also seems to work...
148  * - Read time slots have a 60 µs duration and 1 µs recovery between slots
149  * - After the master pulls the line low for 1 µs, the data is valid for up to 15 µs */
150  while ((counter < TIMEOUT_CONVERSION) && !conversionCompleted)
151  {
152  uint8_t testByte = readByteDS18B20(number);
153  if (testByte > 0) conversionCompleted = true;
154 
155  counter++;
156  }
157 
158  /* Exit the function if the maximum waiting time was reached */
159  if (counter == TIMEOUT_CONVERSION)
160  {
161 
162 #if DEBUG_DBPRINT == 1 /* DEBUG_DBPRINT */
163  dbcrit("Waiting time for DS18B20 conversion reached!");
164 #endif /* DEBUG_DBPRINT */
165 
166  /* Disable interrupts and turn off the clock to the underlying hardware timer. */
167  USTIMER_DeInit();
168 
169  /* Disable data pin (otherwise we got a "sleep" current of about 330 µA due to the on-board (10k) pull-up) */
170  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeDisabled, 0);
171  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeDisabled, 0);
172 
173  /* Disable the VDD pin */
174  powerDS18B20(number, false);
175 
176  error(29);
177 
178  /* Exit function */
179  return (0);
180 
181  }
182 #if DBPRINT_TIMEOUT == 1 /* DBPRINT_TIMEOUT */
183  else
184  {
185 
186 #if DEBUG_DBPRINT == 1 /* DEBUG_DBPRINT */
187  dbwarnInt("DS18B20 conversion (", counter, ")");
188 #endif /* DEBUG_DBPRINT */
189 
190  }
191 #endif /* DBPRINT_TIMEOUT */
192 
193  init_DS18B20(number); /* Initialize communication */
194  writeByteDS18B20(number, 0xCC); /* 0xCC = "Skip Rom" */
195  writeByteDS18B20(number, 0xBE); /* 0xBE = "Read Scratchpad" */
196 
197  /* Read the bytes */
198  for (uint8_t i = 0; i < 9; i++) rawDataDS18B20[i] = readByteDS18B20(number);
199 
200  /* Disable interrupts and turn off the clock to the underlying hardware timer. */
201  USTIMER_DeInit();
202 
203  /* Disable data pin (otherwise we got a "sleep" current of about 330 µA due to the on-board (10k) pull-up) */
204  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeDisabled, 0);
205  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeDisabled, 0);
206 
207  /* Disable the VDD pin */
208  powerDS18B20(number, false);
209 
210  /* Return the converted byte */
211  return (convertTempData(rawDataDS18B20[0], rawDataDS18B20[1]));
212  }
213  else
214  {
215  /* Disable interrupts and turn off the clock to the underlying hardware timer. */
216  USTIMER_DeInit();
217 
218 #if DEBUG_DBPRINT == 1 /* DEBUG_DBPRINT */
219  dbcrit("DS18B20 INIT failed!");
220 #endif /* DEBUG_DBPRINT */
221 
222  /* Disable data pin (otherwise we got a "sleep" current of about 330 µA due to the on-board (10k) pull-up) */
223  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeDisabled, 0);
224  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeDisabled, 0);
225 
226  /* Disable the VDD pin */
227  powerDS18B20(number, false);
228 
229  /* Exit function */
230  return (0);
231  }
232 }
233 
234 
235 /**************************************************************************//**
236  * @brief
237  * Enable or disable the power to the temperature sensor.
238  *
239  * @details
240  * This method also initializes the pin-mode if necessary.
241  *
242  * @note
243  * This is a static method because it's only internally used in this file
244  * and called by other methods if necessary.
245  *
246  * @param[in] number
247  * @li `0` - TEMP0 selected.
248  * @li `1` - TEMP1 selected.
249  *
250  * @param[in] enabled
251  * @li `true` - Enable the GPIO pin connected to the VDD pin of the temperature sensor.
252  * @li `talse` - Disable the GPIO pin connected to the VDD pin of the temperature sensor.
253  *****************************************************************************/
254 static void powerDS18B20 (uint8_t number, bool enabled)
255 {
256  /* Enable necessary clocks (just in case) */
257  CMU_ClockEnable(cmuClock_HFPER, true); /* GPIO is a High Frequency Peripheral */
258  CMU_ClockEnable(cmuClock_GPIO, true);
259 
260  if (number == 0) {
261  /* Initialize VDD pin if not already the case */
263  {
264  /* In the case of gpioModePushPull", the last argument directly sets the pin state */
265  GPIO_PinModeSet(TEMP0_VDD_PORT, TEMP0_VDD_PIN, gpioModePushPull, enabled);
266 
267  TEMP0_VDD_initialized = true;
268  }
269  else
270  {
271  if (enabled) GPIO_PinOutSet(TEMP0_VDD_PORT, TEMP0_VDD_PIN); /* Enable VDD pin */
272  else GPIO_PinOutClear(TEMP0_VDD_PORT, TEMP0_VDD_PIN); /* Disable VDD pin */
273  }
274  }
275  else if (number == 1) {
276  /* Initialize VDD pin if not already the case */
278  {
279  /* In the case of gpioModePushPull", the last argument directly sets the pin state */
280  GPIO_PinModeSet(TEMP1_VDD_PORT, TEMP1_VDD_PIN, gpioModePushPull, enabled);
281 
282  TEMP1_VDD_initialized = true;
283  }
284  else
285  {
286  if (enabled) GPIO_PinOutSet(TEMP1_VDD_PORT, TEMP1_VDD_PIN); /* Enable VDD pin */
287  else GPIO_PinOutClear(TEMP1_VDD_PORT, TEMP1_VDD_PIN); /* Disable VDD pin */
288  }
289  }
290 }
291 
292 
293 /**************************************************************************//**
294  * @brief
295  * Initialize communication to the DS18B20.
296  *
297  * @note
298  * This is a static method because it's only internally used in this file
299  * and called by other methods if necessary.
300  *
301  * @param[in] number
302  * @li `0` - TEMP0 selected.
303  * @li `1` - TEMP1 selected.
304  *
305  * @return
306  * @li `true` - *Presence* pulse detected in time.
307  * @li `false` - No *presence* pulse detected.
308  *****************************************************************************/
309 static bool init_DS18B20 (uint8_t number)
310 {
311  /* Timeout counter */
312  uint32_t counter = 0;
313 
314  /* MASTER RESET: Pull data line LOW for at least 480 µs (Master TX) */
315  /* gpioModePushPull: Last argument directly sets the pin state */
316  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModePushPull, 0);
317  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModePushPull, 0);
318  USTIMER_DelayIntSafe(480);
319 
320  /* Change pin-mode to input - External pull-up resistor pulls data line back HIGH */
321  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeInput, 0);
322  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeInput, 0);
323 
324  /* Check if the line becomes LOW (~ wait while it stays high) during the maximum waiting time
325  * The DS18B20 should detect the data line rising due to the pull-up resistor, waits 15 - 50 µs
326  * and then pulls the line back LOW (for 60 - 240 µs) to indicate it's PRESENCE */
327  if (number == 0) while ((counter < TIMEOUT_INIT) && (GPIO_PinInGet(TEMP0_DATA_PORT, TEMP0_DATA_PIN) == 1)) counter++;
328  else if (number == 1) while ((counter < TIMEOUT_INIT) && (GPIO_PinInGet(TEMP1_DATA_PORT, TEMP1_DATA_PIN) == 1)) counter++;
329 
330  /* Exit the function if the maximum waiting time was reached */
331  if (counter == TIMEOUT_INIT)
332  {
333 
334 #if DEBUG_DBPRINT == 1 /* DEBUG_DBPRINT */
335  dbcrit("No DS18B20 presence pulse detected in time!");
336 #endif /* DEBUG_DBPRINT */
337 
338  error(28);
339 
340  return (false);
341  }
342 #if DBPRINT_TIMEOUT == 1 /* DBPRINT_TIMEOUT */
343  else
344  {
345 
346 #if DEBUG_DBPRINT == 1 /* DEBUG_DBPRINT */
347  dbwarnInt("DS18B20 INIT (", counter, ")");
348 #endif /* DEBUG_DBPRINT */
349 
350  }
351 #endif /* DBPRINT_TIMEOUT */
352 
353  /* Master RX should be at least 480 µs */
354  USTIMER_DelayIntSafe(480);
355 
356  return (true);
357 }
358 
359 
360 /**************************************************************************//**
361  * @brief
362  * Write a byte (`uint8_t`) to the DS18B20.
363  *
364  * @note
365  * This is a static method because it's only internally used in this file
366  * and called by other methods if necessary.
367  *
368  * @param[in] number
369  * @li `0` - TEMP0 selected.
370  * @li `1` - TEMP1 selected.
371  *
372  * @param[in] data
373  * The data to write to the DS18B20.
374  *****************************************************************************/
375 static void writeByteDS18B20 (uint8_t number, uint8_t data)
376 {
377  /* Write the byte, bit by bit */
378  for (uint8_t i = 0; i < 8; i++)
379  {
380  /* Check if we need to write a "1" */
381  if (data & 0x01)
382  {
383  /* Pull line low */
384  /* In the case of gpioModePushPull", the last argument directly sets the pin state */
385  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModePushPull, 0);
386  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModePushPull, 0);
387 
388  /* 5 µs delay should be called here but this loop works fine too... */
389  for (uint8_t i=0; i<5; i++);
390 
391  /* Let line rise because of the pull-up resistor */
392  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeInput, 0);
393  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeInput, 0);
394 
395  USTIMER_DelayIntSafe(60);
396  }
397  /* If not, write a "0" */
398  else
399  {
400  /* Pull line low */
401  /* In the case of gpioModePushPull", the last argument directly sets the pin state */
402  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModePushPull, 0);
403  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModePushPull, 0);
404 
405  USTIMER_DelayIntSafe(60);
406 
407  /* Let line rise because of the pull-up resistor */
408  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeInput, 0);
409  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeInput, 0);
410 
411  /* 5 µs delay should be called here but this loop works fine too... */
412  for (uint8_t i=0; i<5; i++);
413  }
414  /* Right shift bits once */
415  data >>= 1;
416  }
417 }
418 
419 
420 /**************************************************************************//**
421  * @brief
422  * Read a byte (`uint8_t`) from the DS18B20.
423  *
424  * @note
425  * This is a static method because it's only internally used in this file
426  * and called by other methods if necessary.
427  *
428  * @param[in] number
429  * @li `0` - TEMP0 selected.
430  * @li `1` - TEMP1 selected.
431  *
432  * @return
433  * The byte read from the DS18B20.
434  *****************************************************************************/
436 {
437  /* Data to eventually return */
438  uint8_t data = 0x0;
439 
440  /* Read the byte, bit by bit */
441  for (uint8_t i = 0; i < 8; i++)
442  {
443  /* Pull line low */
444  /* In the case of gpioModePushPull", the last argument directly sets the pin state */
445  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModePushPull, 0);
446  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModePushPull, 0);
447 
448  /* 5 µs delay should be called here but this loop works fine too... */
449  for (uint8_t i=0; i<5; i++);
450 
451  /* Let line rise because of the pull-up resistor */
452  if (number == 0) GPIO_PinModeSet(TEMP0_DATA_PORT, TEMP0_DATA_PIN, gpioModeInput, 0);
453  else if (number == 1) GPIO_PinModeSet(TEMP1_DATA_PORT, TEMP1_DATA_PIN, gpioModeInput, 0);
454 
455  /* Right shift bits once */
456  data >>= 1;
457 
458  /* If the line is high, OR the first bit of the data:
459  * 0x80 = 1000 0000 */
460  if ((number == 0) && (GPIO_PinInGet(TEMP0_DATA_PORT, TEMP0_DATA_PIN))) data |= 0x80;
461  else if (number == 1) if (GPIO_PinInGet(TEMP1_DATA_PORT, TEMP1_DATA_PIN)) data |= 0x80;
462 
463  /* Wait some time before going into next loop */
464  USTIMER_DelayIntSafe(70);
465  }
466  return (data);
467 }
468 
469 
470 /**************************************************************************//**
471  * @brief
472  * Convert temperature data.
473  *
474  * @note
475  * This is a static method because it's only internally used in this file
476  * and called by other methods if necessary.
477  *
478  * @param[in] tempLS
479  * Least significant byte.
480  *
481  * @param[in] tempMS
482  * Most significant byte.
483  *
484  * @return
485  * The converted temperature data.
486  *****************************************************************************/
487 static int32_t convertTempData (uint8_t tempLS, uint8_t tempMS)
488 {
489  uint16_t rawDataMerge;
490  uint16_t reverseRawDataMerge;
491 
492  int32_t finalTemperature;
493 
494  /* Check if it is a negative temperature value
495  * 0xF8 = 0b1111 1000 */
496  if (tempMS & 0xF8)
497  {
498  rawDataMerge = tempMS;
499 
500  /* Left shift 8 times */
501  rawDataMerge <<= 8;
502 
503  /* Add the second part */
504  rawDataMerge += tempLS;
505 
506  /* Invert the value since we have a negative temperature */
507  reverseRawDataMerge = ~rawDataMerge;
508 
509  /* Calculate the final temperature */
510  finalTemperature = -(reverseRawDataMerge + 1) * 62.5;
511  }
512  /* We're dealing with a positive temperature */
513  else
514  {
515  rawDataMerge = tempMS;
516 
517  /* Left shift 8 times */
518  rawDataMerge <<= 8;
519 
520  /* Add the second part */
521  rawDataMerge += tempLS;
522 
523  /* Calculate the final temperature */
524  finalTemperature = rawDataMerge * 62.5;
525  }
526 
527  return (finalTemperature);
528 }
int32_t readTempDS18B20(uint8_t number)
Get a temperature value from the DS18B20.
Definition: DS18B20.c:119
MeasurementData_t data
Definition: main.c:86
void dbwarnInt(char *message1, int32_t value, char *message2)
Print a warning value surrounded by two strings (char array) to USARTx.
Definition: dbprint.c:600
#define TIMEOUT_CONVERSION
Definition: DS18B20.c:85
bool TEMP1_VDD_initialized
Definition: DS18B20.c:90
void error(uint8_t number)
Error method.
Definition: util.c:122
#define TEMP0_VDD_PIN
Definition: pin_mapping.h:102
int int32_t
Typedef defining 32 bit int type. The developer should modify this to suit the platform being deploye...
Definition: vl53l1_types.h:83
Utility functionality.
static bool init_DS18B20(uint8_t number)
Initialize communication to the DS18B20.
Definition: DS18B20.c:309
static int32_t convertTempData(uint8_t tempLS, uint8_t tempMS)
Convert temperature data.
Definition: DS18B20.c:487
The pin definitions for the custom board.
Delay functionality.
bool TEMP0_VDD_initialized
Definition: DS18B20.c:89
#define TEMP1_VDD_PORT
Definition: pin_mapping.h:105
Enable or disable printing to UART with dbprint.
#define TEMP1_DATA_PORT
Definition: pin_mapping.h:103
void delay(uint32_t msDelay)
Wait for a certain amount of milliseconds in EM2/3.
Definition: delay.c:124
#define TIMEOUT_INIT
Definition: DS18B20.c:84
#define TEMP0_DATA_PORT
Definition: pin_mapping.h:99
static void powerDS18B20(uint8_t number, bool enabled)
Enable or disable the power to the temperature sensor.
Definition: DS18B20.c:254
#define TEMP1_VDD_PIN
Definition: pin_mapping.h:106
#define TEMP1_DATA_PIN
Definition: pin_mapping.h:104
#define TEMP0_VDD_PORT
Definition: pin_mapping.h:101
void dbcrit(char *message)
Print a critical error string (char array) in red to USARTx and go to the next line.
Definition: dbprint.c:541
static uint8_t readByteDS18B20(uint8_t number)
Read a byte (uint8_t) from the DS18B20.
Definition: DS18B20.c:435
unsigned short uint16_t
Typedef defining 16 bit unsigned short type. The developer should modify this to suit the platform be...
Definition: vl53l1_types.h:88
static void writeByteDS18B20(uint8_t number, uint8_t data)
Write a byte (uint8_t) to the DS18B20.
Definition: DS18B20.c:375
#define TEMP0_DATA_PIN
Definition: pin_mapping.h:100
unsigned char uint8_t
Typedef defining 8 bit unsigned char type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:98
unsigned int uint32_t
Typedef defining 32 bit unsigned int type. The developer should modify this to suit the platform bein...
Definition: vl53l1_types.h:78
All code for the DS18B20 temperature sensor.