KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dpbasic.h File Reference

This driver is to read the DigiPicco I2C sensor. More...

#include "drv/wb/i2c.h"
#include <stdint.h>
#include <errorcode.h>

Go to the source code of this file.

Data Structures

struct  DpbData
 Structure defines data from the DigiPicco sensor. More...
 

Macros

#define E_DPB_INVALID   ( E_DPB + 1 )
 
#define E_DPB_INVALID_DESCR   "Invalid value"
 
#define DPB_I2C_ADR_DEFAULT   0x78
 
#define DPB_MIN_TEMP_C   -400
 Min value in DpbData.temp, in tenth of degrees.
 
#define DPB_MAX_TEMP_C   1250
 Max value in DpbData.temp, in tenth of degrees.
 
#define DPB_MIN_HUMID_RH   0
 Min value in DpbData.humid, in percent RH.
 
#define DPB_MAN_HUMID_RH   100
 Max value in DpbData.humid, in percent RH.
 

Functions

bool dpbRead (I2C_Device *dev, i2cAddr addr, DpbData *data)
 Read the DigiPicco I2C Basic temperature and humidity control device. More...
 

Detailed Description

This driver is to read the DigiPicco I2C sensor.

Usage:

DpbData data;
if (!dpbRead(I2C2, DPB_I2C_ADR_DEFAULT, &data) return false; // error
printf("Temperature: %d.%d C, Humidity: %d %% RH\n", data.temp / 10, data.temp % 10, data.humid);
Note
This driver is no longer used, as the dp-basic sensor is no longer used.

Definition in file dpbasic.h.

Function Documentation

bool dpbRead ( I2C_Device dev,
i2cAddr  addr,
DpbData data 
)

Read the DigiPicco I2C Basic temperature and humidity control device.

Returns
true on success, false on error.

Definition at line 21 of file dpbasic.c.