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
sens_util.h
00001 /** 00002 @file sens_util.h 00003 @brief Utilities routines 00004 */ 00005 #ifndef __SENS_UTIL__ 00006 #define __SENS_UTIL__ 00007 00008 #ifdef __cplusplus 00009 extern "C" { 00010 #endif 00011 00012 /** 00013 @defgroup OSUTIL Utilities 00014 @ingroup OSGLOBALS 00015 @{ 00016 */ 00017 00018 /** 00019 Assertion like function. 00020 00021 @param cond Assertion condition. 00022 */ 00023 extern void sens_util_assert(int cond); 00024 00025 /** 00026 Message log utility. 00027 00028 @param cond Logs only when the condition is true. 00029 @param line Variable parameters list like printf. 00030 */ 00031 extern void sens_util_log(int cond, const uint8_t *line, ...); 00032 00033 /** 00034 Start log. 00035 00036 @retval 1 Log not started. 00037 @retval 0 Log started. 00038 */ 00039 extern int sens_util_log_start(void); 00040 00041 /** 00042 Stop log . 00043 00044 @retval 1 Log not stopped. 00045 @retval 0 Log stopped. 00046 */ 00047 extern int sens_util_log_stop(void); 00048 00049 /** 00050 Remove path and return only the file name. 00051 00052 @param filename file with full path name 00053 @return filename without path 00054 */ 00055 extern const uint8_t *sens_util_strip_path(const uint8_t *filename); 00056 00057 /** 00058 Print a buffer in hexadecimal (16 byte per row). 00059 00060 @param data Data to be printed. 00061 @param len Data length. 00062 */ 00063 extern void sens_util_dump_frame(const uint8_t *const data, int len); 00064 00065 /** 00066 @def SENS_UTIL_ASSERT 00067 @brief Assertion macro 00068 */ 00069 #define SENS_UTIL_ASSERT(cond) sens_util_assert( !!(cond) ) 00070 00071 /**@}*/ 00072 00073 #ifdef __cplusplus 00074 } 00075 #endif 00076 00077 #endif /* __SENS_UTIL__ */ 00078
Generated on Tue Jul 12 2022 21:04:14 by 1.7.2