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
6typedef uint32_t u32;
7typedef uint16_t u16;
8typedef uint8_t u8;
9
10typedef int32_t i32;
11typedef int16_t i16;
12typedef int8_t i8;
13
14typedef enum
15{
18 INT_PRIO_DEF = -1
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
int32_t i32
Definition types.h:10
INT_Priority
Definition types.h:15
@ INT_PRIO_MAX
Definition types.h:16
@ INT_PRIO_DEF
Definition types.h:18
@ INT_PRIO_MIN
Definition types.h:17
uint8_t u8
Definition types.h:8
uint16_t u16
Definition types.h:7
int16_t i16
Definition types.h:11
int8_t i8
Definition types.h:12
uint32_t u32
Definition types.h:6