MeterLogger
c_types.h
Go to the documentation of this file.
1 /*
2  * ESPRSSIF MIT License
3  *
4  * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5  *
6  * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
7  * it is free of charge, to any person obtaining a copy of this software and associated
8  * documentation files (the "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11  * to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or
14  * substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef _C_TYPES_H_
26 #define _C_TYPES_H_
27 
28 #include <stdint.h>
29 #include <stdbool.h>
30 //typedef unsigned char uint8_t;
31 typedef signed char sint8_t;
32 //typedef signed char int8_t;
33 //typedef unsigned short uint16_t;
34 typedef signed short sint16_t;
35 //typedef signed short int16_t;
36 //typedef unsigned int uint32_t;
37 typedef signed long sint32_t;
38 //typedef signed int int32_t;
39 typedef signed long long sint64_t;
40 //typedef unsigned long long uint64_t;
41 typedef unsigned long long u_int64_t;
42 typedef float real32_t;
43 typedef double real64_t;
44 
45 typedef unsigned char uint8;
46 typedef unsigned char u8;
47 typedef signed char sint8;
48 typedef signed char int8;
49 typedef signed char s8;
50 typedef unsigned short uint16;
51 typedef unsigned short u16;
52 typedef signed short sint16;
53 typedef signed short s16;
54 typedef unsigned int uint32;
55 typedef unsigned int u_int;
56 typedef unsigned int u32;
57 typedef signed int sint32;
58 typedef signed int s32;
59 typedef int int32;
60 typedef signed long long sint64;
61 typedef unsigned long long uint64;
62 typedef unsigned long long u64;
63 typedef float real32;
64 typedef double real64;
65 
66 #define __le16 u16
67 
68 typedef unsigned int size_t;
69 
70 #define __packed __attribute__((packed))
71 
72 #define LOCAL static
73 
74 #ifndef NULL
75 #define NULL (void *)0
76 #endif /* NULL */
77 
78 /* probably should not put STATUS here */
79 typedef enum {
80  OK = 0,
85 } STATUS;
86 
87 #define BIT(nr) (1UL << (nr))
88 
89 #define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b))
90 #define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b))
91 
92 #define DMEM_ATTR __attribute__((section(".bss")))
93 #define SHMEM_ATTR
94 
95 #ifdef ICACHE_FLASH
96 #define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
97 #define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
98 #else
99 #define ICACHE_FLASH_ATTR
100 #define ICACHE_RODATA_ATTR
101 #endif /* ICACHE_FLASH */
102 
103 #define STORE_ATTR __attribute__((aligned(4)))
104 
105 #ifndef __cplusplus
106 //typedef unsigned char bool;
107 #define BOOL bool
108 //#define true (1)
109 //#define false (0)
110 #define TRUE true
111 #define FALSE false
112 
113 
114 #endif /* !__cplusplus */
115 
116 #endif /* _C_TYPES_H_ */
int int32
Definition: c_types.h:59
Definition: c_types.h:84
unsigned int u_int
Definition: c_types.h:55
signed short s16
Definition: c_types.h:53
unsigned int size_t
Definition: c_types.h:68
unsigned short uint16
Definition: c_types.h:50
Definition: c_types.h:83
unsigned int u32
Definition: c_types.h:56
float real32
Definition: c_types.h:63
float real32_t
Definition: c_types.h:42
Definition: c_types.h:81
signed char sint8_t
Definition: c_types.h:31
signed long sint32_t
Definition: c_types.h:37
signed long long sint64
Definition: c_types.h:60
signed short sint16_t
Definition: c_types.h:34
double real64
Definition: c_types.h:64
signed short sint16
Definition: c_types.h:52
unsigned char uint8
Definition: c_types.h:45
unsigned short u16
Definition: c_types.h:51
unsigned long long u64
Definition: c_types.h:62
STATUS
Definition: c_types.h:79
Definition: c_types.h:80
unsigned char u8
Definition: c_types.h:46
unsigned long long u_int64_t
Definition: c_types.h:41
unsigned int uint32
Definition: c_types.h:54
double real64_t
Definition: c_types.h:43
unsigned long long uint64
Definition: c_types.h:61
signed long long sint64_t
Definition: c_types.h:39
signed int sint32
Definition: c_types.h:57
signed char sint8
Definition: c_types.h:47
signed int s32
Definition: c_types.h:58
signed char s8
Definition: c_types.h:49
signed char int8
Definition: c_types.h:48