/** ##########################################################################
**     Filename  : common_types.h
**     Project   :
**     Module    :
**     Processor :
**     Version   : V1.1
**     Compiler  :
**     Date/Time :
**     Abstract  :
**     Contents  : 类型
**     Note      :
**
**     (c) Copyright dmdz Co.,Ltd
**  --------------------------------------------------------------------------
**               R E V I S I O N   H I S T O R Y
**  --------------------------------------------------------------------------
**  Date       Ver   Author             Description


**  -20230602-  --V1.0--  --mingyea---  --优化--
**  -20231012-  --V1.1--  --mingyea---  去掉对ide的库文件依赖,删除多余的定义
** #########################################################################*/
#ifndef COMMON_TYPES__H
#define COMMON_TYPES__H


/*--------------------------------各變量類型--------------------------------*/

/*---------------------------------------------------------------------------
- I N C L U D E   F I L E S
----------------------------------------------------------------------------*/




/*#include "stdint_copy.h"    */            /*!< standard types definitions */

/*---------------------------------------------------------------------------
- D E F I N E S / M A C R O S
----------------------------------------------------------------------------*/
#define     __VC    volatile const         /*!< defines 'read only' permissions     */
#define     __I     volatile const         /*!< defines 'read only' permissions     */
#define     __O     volatile               /*!< defines 'write only' permissions     */
#define     __IO    volatile               /*!< defines 'read / write' permissions   */



#define     __VC    volatile const         /*!< defines 'read only' permissions     */
#define     __I     volatile const         /*!< defines 'read only' permissions     */
#define     __O     volatile               /*!< defines 'write only' permissions     */
#define     __IO    volatile               /*!< defines 'read / write' permissions   */


#define COMMON_FALSE 0u
#define COMMON_TRUE 1u

//#define  NULL   0
#define  NULL_POINT   0
#ifndef NULL_PTR
#define  NULL_PTR   (void*)0
#endif

#define U8_MAX     (255)
#define S8_MAX     (127)
#define S8_MIN     (-128)
#define U16_MAX    (65535u)
#define S16_MAX    (32767)
#define S16_MIN    (-32768)
#define U32_MAX    (4294967295uL)
#define S32_MAX    (2147483647)
#define S32_MIN    (-2147483648uL)



/*---------------------------------------------------------------------------
- T Y P E   D E F I N I T I O N S
----------------------------------------------------------------------------*/

/*!< Signed integer types  */
typedef   signed char     int8_t;
typedef   signed short    int16_t;
typedef   signed long     int32_t;
typedef   signed long long    int64_t;

/*!< Unsigned integer types  */
typedef unsigned char     uint8_t;
/*STM32芯片和 STM8芯片 調試發現 SHORT 都是16位  */
typedef unsigned short    uint16_t;
/*STM32芯片調試發現 INT 和 LONG 都是32位 ;
	而在STM8時 INT 是16位  */
typedef unsigned long     uint32_t;
typedef unsigned long long    uint64_t;

typedef float    float32_t;
typedef double    float64_t;
typedef long double    float128_t;

typedef int64_t  s64;
typedef int32_t  s32;
typedef int16_t s16;
typedef int8_t  s8;

typedef const int64_t sc64;  /*!< Read Only */
typedef const int32_t sc32;  /*!< Read Only */
typedef const int16_t sc16;  /*!< Read Only */
typedef const int8_t sc8;   /*!< Read Only */

typedef __IO int32_t  vs32;
typedef __IO int16_t  vs16;
typedef __IO int8_t   vs8;

typedef __I int32_t vsc32;  /*!< Read Only */
typedef __I int16_t vsc16;  /*!< Read Only */
typedef __I int8_t vsc8;   /*!< Read Only */

typedef uint64_t  u64;
typedef uint32_t  u32;
typedef uint16_t u16;
typedef uint8_t  u8;

typedef const uint32_t uc32;  /*!< Read Only */
typedef const uint16_t uc16;  /*!< Read Only */
typedef const uint8_t uc8;   /*!< Read Only */

typedef __IO uint32_t  vu32;
typedef __IO uint16_t vu16;
typedef __IO uint8_t  vu8;

typedef __I uint32_t vuc32;  /*!< Read Only */
typedef __I uint16_t vuc16;  /*!< Read Only */
typedef __I uint8_t vuc8;   /*!< Read Only */

typedef uint16_t size_n_t;

#if 0
typedef float32_t    f32;
typedef float64_t    f64;
typedef float128_t    f128;

typedef const float32_t    fc32;
typedef const  float64_t    fc64;
typedef const  float128_t    fc128;

typedef __IO float32_t    vf32;
typedef __IO  float64_t   vf64;
typedef __IO  float128_t    vf128;


typedef __I float32_t    vfc32;
typedef __I  float64_t   vfc64;
typedef __I  float128_t    vfc128;
#endif


typedef enum
{
		RESET = 0,
		SET = !RESET
/*} FlagStatus, ITStatus,BitStatus, BitAction;*/
} FlagStatus, ITStatus,BitStatus;

typedef enum
{
		DISABLE = 0,
		ENABLE = !DISABLE
} FunctionalState;




//以后不用 TRUE和FALSE
//如果是bool型，就用 bool_m_t

typedef enum
{
	FALSE_M = 0u,      /* 假 */
	TRUE_M  = !FALSE_M   /* 真 */
}bool_m_t;  /* 布爾運算 */


typedef enum
{
	FALSE = 0u,      /* 假 */
	TRUE  = !FALSE   /* 真 */
}bool;  /* 布爾運算 */



/*操作的結果*/
typedef enum
{
	FAILED = 0u,      /* 失敗 */
	RIGHT = !FAILED  /* 成功 */
}operate_status_e;








/*********符號類型的值範圍************/



























/************************************以上是枚舉標誌定義***********************************/



/************************************基本運算的公用函數宏***********************************/











/*---------------------------------------------------------------------------
- G L O B A L   V A R I A B L E S
- only configuration table allowed here,variables are not allowed!
----------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------
- C O N S T A N T S
----------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------
- F U N C T I O N   P R O T O T Y P E
----------------------------------------------------------------------------*/



#endif /* COMMON_TYPES__H */

/* [] END OF FILE */
