Generic communication interface between the wireless board (mote) and the sensor board. Any kind of sensor board can be connected to the mote using this specification given it provides a SPI peripheral, one input pin with interrupt capability and one digital output. The sensor board must implement a special register set from which all required information can be retrieved. Protocol: http://is.gd/wuQorh Github: http://is.gd/ySj1L9
Diff: sens_itf/sens_util.h
- Revision:
- 1:acdf490d94a7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sens_itf/sens_util.h Tue Apr 08 16:34:20 2014 +0000 @@ -0,0 +1,78 @@ +/** + @file sens_util.h + @brief Utilities routines +*/ +#ifndef __SENS_UTIL__ +#define __SENS_UTIL__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + @defgroup OSUTIL Utilities + @ingroup OSGLOBALS + @{ +*/ + +/** + Assertion like function. + + @param cond Assertion condition. + */ +extern void sens_util_assert(int cond); + +/** + Message log utility. + + @param cond Logs only when the condition is true. + @param line Variable parameters list like printf. +*/ +extern void sens_util_log(int cond, const uint8_t *line, ...); + +/** + Start log. + + @retval 1 Log not started. + @retval 0 Log started. +*/ +extern int sens_util_log_start(void); + +/** + Stop log . + +@retval 1 Log not stopped. +@retval 0 Log stopped. +*/ +extern int sens_util_log_stop(void); + +/** + Remove path and return only the file name. + + @param filename file with full path name + @return filename without path +*/ +extern const uint8_t *sens_util_strip_path(const uint8_t *filename); + +/** + Print a buffer in hexadecimal (16 byte per row). + + @param data Data to be printed. + @param len Data length. +*/ +extern void sens_util_dump_frame(const uint8_t *const data, int len); + +/** + @def SENS_UTIL_ASSERT + @brief Assertion macro +*/ +#define SENS_UTIL_ASSERT(cond) sens_util_assert( !!(cond) ) + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* __SENS_UTIL__ */ +