35 lines
689 B
C
35 lines
689 B
C
#ifndef __GENERAL_API_H_
|
|
#define __GENERAL_API_H_
|
|
#include "type.h"
|
|
|
|
uint8 get_check_sum(void *p,uint32 len);
|
|
|
|
/*
|
|
__inline __asm uint32 asm_rev_l(uint32 data);
|
|
__inline __asm uint32 asm_rev_s(uint32 data);
|
|
__inline __asm uint32 asm_rbit_l(uint32 data);
|
|
*/
|
|
|
|
uint16 cal_crc_zb(const uint8 *ptr, uint32 len);
|
|
uint8 bcd2byte(uint8 bcd);
|
|
uint8 byte2bcd(uint8 value);
|
|
|
|
/*
|
|
//将long类型的变量按半字进行字节反转 0x12345678->0x78563412
|
|
#define rev_l(data) asm_rev_l(data)
|
|
|
|
//将short类型的变量按字节进行反转 0x1234 ->0x3412
|
|
#define rev_s(data) asm_rev_s(data)
|
|
|
|
//按位反转
|
|
#define rbit_l(data) asm_rbit_l(data)
|
|
|
|
|
|
*/
|
|
|
|
void str_trunc_space(char *pstr);
|
|
|
|
|
|
#endif
|
|
|