CELIS/UDS/uds_types.h
2024-05-07 17:04:36 +08:00

95 lines
2.3 KiB
C

/*!
* @file uds_types.h
* @brief user defined types for UDS
*
*/
#ifndef UDS_TYPES_H_
#define UDS_TYPES_H_
//typedef signed char int8_t;
//typedef unsigned char uint8_t;
typedef volatile signed char vint8_t;
typedef volatile unsigned char vuint8_t;
//typedef signed short int16_t;
//typedef unsigned short uint16_t;
typedef volatile signed short vint16_t;
typedef volatile unsigned short vuint16_t;
//typedef signed int int32_t;
//typedef unsigned int uint32_t;
typedef volatile signed int vint32_t;
typedef volatile unsigned int vuint32_t;
typedef unsigned char BOOLEAN;
typedef unsigned char INT8U;
typedef signed char INT8S;
typedef unsigned short INT16U;
typedef signed short INT16S;
typedef unsigned int INT32U;
typedef signed int INT32S;
typedef unsigned long INT64U;
typedef signed long INT64S;
typedef unsigned char U8;
#define U8_DISP U8
#define U8_CAL volatile const U8
#define U8_MIN (0U)
#define U8_MAX (255U)
typedef signed char S8;
#define S8_DISP S8
#define S8_CAL volatile const S8
#define S8_MIN (-128)
#define S8_MAX (127)
typedef unsigned short int U16;
#define U16_DISP U16
#define U16_CAL volatile const U16
#define U16_MIN (0U)
#define U16_MAX (65535U)
typedef signed short int S16;
#define S16_DISP S16
#define S16_CAL volatile const S16
#define S16_MIN (-32768)
#define S16_MAX (32767)
typedef unsigned long U32;
#define U32_DISP U32
#define U32_CAL volatile const U32
#define U32_MIN (0UL)
#define U32_MAX (4294967295UL)
typedef signed long S32;
#define S32_DISP S32
#define S32_CAL volatile const S32
#define S32_MIN (-2147483648L)
#define S32_MAX (2147483647L)
#if 0
typedef enum BOOL_TYPE_
{
FALSE = 0,
TRUE
} BOOL_TYPE;
#endif
typedef U8 UINT8;
//typedef U8 BYTE;
typedef U16 UINT16;
typedef U16 WORD;
typedef U32 UINT32;
typedef S32 INT32;
#define LSB(WORD) (uint8_t)(WORD)
#define MSB(WORD) (uint8_t)(WORD>>8)
#define WORD(MSB,LSB) (uint16_t)(((uint16_t) MSB << 8) + LSB)
#endif /* UDS_TYPES_H_ */