Landtiger LPC1768 C BigLib
1
A self made, custom C library for the LandTiger board.
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1
#ifndef __TYPES_H
2
#define __TYPES_H
3
4
#include <stdint.h>
5
6
typedef
uint32_t
u32
;
7
typedef
uint16_t
u16
;
8
typedef
uint8_t
u8
;
9
10
typedef
int32_t
i32
;
11
typedef
int16_t
i16
;
12
typedef
int8_t
i8
;
13
14
typedef
enum
15
{
16
INT_PRIO_MAX
= 0,
17
INT_PRIO_MIN
= 15,
18
INT_PRIO_DEF
= -1
19
}
INT_Priority
;
20
21
// MACROS
22
23
#define IS_BETWEEN_EQ(value, low, hi) ((value) >= (low) && (value) <= (hi))
24
#define IS_BIT_SET(reg, bit) (((reg) & (1 << bit)) == 1)
25
26
#define SET_BIT(reg, bit) (reg |= (1 << bit))
27
#define CLR_BIT(reg, bit) (reg &= ~(1 << bit))
28
29
#define SET_BITS(reg, value, bit) (reg |= ((value) << bit))
30
#define CLR_BITS(reg, value, bit) (reg &= ~((value) << bit))
31
32
#define _FORCE_INLINE __attribute__((always_inline)) inline
33
#define _CBACK
34
35
#define _USED_EXTERNALLY volatile
36
#define _DECL_EXTERNALLY extern
37
#define _PRIVATE static
38
#define _PROTOTYPE_ONLY
39
40
#define NO_PRESCALER 0
41
42
#define IS_DEF_PRIORITY(prio) (((int)prio) <= INT_PRIO_DEF)
43
#define IS_NO_PRESCALER(presc) (((int)presc) <= NO_PRESCALER)
44
45
#endif
i32
int32_t i32
Definition
types.h:10
INT_Priority
INT_Priority
Definition
types.h:15
INT_PRIO_MAX
@ INT_PRIO_MAX
Definition
types.h:16
INT_PRIO_DEF
@ INT_PRIO_DEF
Definition
types.h:18
INT_PRIO_MIN
@ INT_PRIO_MIN
Definition
types.h:17
u8
uint8_t u8
Definition
types.h:8
u16
uint16_t u16
Definition
types.h:7
i16
int16_t i16
Definition
types.h:11
i8
int8_t i8
Definition
types.h:12
u32
uint32_t u32
Definition
types.h:6
Keil
Include
types.h
Generated by
1.9.8