The friendly Operating System for the Internet of Things
phydat.h File Reference

Generic data container for physical data interface. More...

Detailed Description

#include <stdint.h>
#include <errno.h>
+ Include dependency graph for phydat.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  phydat_t
 Generic data structure for expressing physical values. More...
 

Macros

#define PHYDAT_DIM   (3U)
 The fixed number of dimensions we work with. More...
 
#define PHYDAT_SCALE_STR_MAXLEN   (sizeof("*E-128\0"))
 The maximum length of a scaling string.
 

Enumerations

enum  {
  UNIT_UNDEF, UNIT_NONE, UNIT_TEMP_C, UNIT_TEMP_F,
  UNIT_TEMP_K, UNIT_LUX, UNIT_M, UNIT_M2,
  UNIT_M3, UNIT_G, UNIT_DPS, UNIT_GR,
  UNIT_A, UNIT_V, UNIT_GS, UNIT_BAR,
  UNIT_PA, UNIT_CD, UNIT_BOOL, UNIT_PERCENT,
  UNIT_PERMILL, UNIT_PPM, UNIT_TIME, UNIT_DATE
}
 Definition of physical units and comparable data types. More...
 

Functions

void phydat_dump (phydat_t *data, uint8_t dim)
 Dump the given data container to STDIO. More...
 
const char * phydat_unit_to_str (uint8_t unit)
 Convert the given unit to a string. More...
 
char phydat_scale_to_str (int8_t scale)
 Convert the given scale factor to a NULL terminated string. More...