util.h

来自「cc2x30_sw_examples: 适用于SmartRF05EB 支持CC」· C头文件 代码 · 共 60 行

H
60
字号

/*******************************************************************************
  Filename:     util.h

  Description:  Utility library header file

*******************************************************************************/

#ifndef UTIL_H
#define UTIL_H

/*******************************************************************************
* INCLUDES
*/
#include <hal_types.h>

/*******************************************************************************
* TYPEDEFS
*/

typedef struct {
  const char* szDescr;      // Textual description
  const uint8  value;        // Value
} menuItem_t;

typedef struct {
  const menuItem_t* pMenuItems;
  const uint8 nItems;
} menu_t;




/*******************************************************************************
* CONSTANTS AND DEFINES
*/

// Number of elements in an array
#define N_ITEMS(arr)                sizeof(arr)/sizeof(arr[0])

/*******************************************************************************
* GLOBAL FUNCTIONS
*/
char* convInt32ToText(int32 value);
const char* utilChipIdToStr(uint8 chipID);

#ifndef WIN32
uint8 min(uint8 v1, uint8 v2);
void utilReverseBuf(uint8* pBuf, uint8 length);
#endif

#endif

/*------------------------------------------------------------------------------
										  0ooo                                     
								ooo0	 (	 )                                     
								(	)	  ) /                                      
								 \ (	 (_/                                       
								  \_)		 Modify By:cuiqingwei [gary]                  
------------------------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?