ftypes.h 2.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
/*
 * Copyright : (C) 2022 Phytium Information Technology, Inc.
 * All Rights Reserved.
 *
 * This program is OPEN SOURCE software: you can redistribute it and/or modify it
 * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
 * either version 1.0 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the Phytium Public License for more details.
 *
 *
 * FilePath: ftypes.h
 * Date: 2021-05-27 13:30:03
 * LastEditTime: 2022-02-18 08:24:15
 * Description:  This files is for
 *
 * Modify History:
 *  Ver   Who        Date         Changes
 * ----- ------     --------    --------------------------------------
 */


#ifndef _BSP_COMMON_FT_TYPE_H
#define _BSP_COMMON_FT_TYPE_H

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>
#include <stddef.h>

#define FT_COMPONENT_IS_READY 0x11111111U
#define FT_COMPONENT_IS_STARTED 0x22222222U

typedef uint8_t u8;            /* unsigned 8-bit */
typedef char s8;               /* signed 8-bit */
typedef uint16_t u16;          /* unsigned 16-bit */
typedef short s16;             /* signed 16-bit */
typedef uint32_t u32;          /* unsigned 32-bit */
typedef int32_t s32;           /* signed 32-bit */
typedef uint64_t u64;          /* unsigned 64-bit */
typedef int64_t s64;           /* unsigned */
typedef float f32;             /* 32-bit floating point */
typedef double f64;            /* 64-bit double precision FP */
typedef unsigned long boolean; /* boolean */
typedef uint64_t _time_t;
typedef size_t fsize_t;

typedef intptr_t intptr; /* intptr_t是为了跨平台,其长度总是所在平台的位数,所以用来存放地址。 */
typedef uintptr_t uintptr;
typedef ptrdiff_t ptrdiff;

#ifdef __aarch64__
typedef u64 tick_t;
#else
typedef u32 tick_t;
#endif

/** @}*/
#if !defined(LONG) || !defined(ULONG)
typedef long LONG;
typedef unsigned long ULONG;
#endif

#define ULONG64_HI_MASK 0xFFFFFFFF00000000U
#define ULONG64_LO_MASK ~ULONG64_HI_MASK

#ifndef TRUE
#define TRUE 1U
#endif

#ifndef FALSE
#define FALSE 0U
#endif

#ifndef NULL
#define NULL 0U
#endif

#define _INLINE inline
#define _WEAK __attribute__((weak))

typedef void (*FIrqHandler)(void *InstancePtr);

typedef void (*FExceptionHandler)(void *InstancePtr);

#ifdef __cplusplus
}
#endif

#endif // !