-
Notifications
You must be signed in to change notification settings - Fork 0
/
std_types.h
47 lines (34 loc) · 1.43 KB
/
std_types.h
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
/*
* std_types.h
* Author: Mohamed
*/
#ifndef STD_TYPES_H_
#define STD_TYPES_H_
/************************************************************************/
/* typedefs for standard types */
/************************************************************************/
#define NULL ((void *)0)
typedef unsigned char uint8_t;
typedef unsigned int uint16_t;
typedef unsigned long int uint32_t;
typedef unsigned long long uint64_t;
typedef signed char sint8_t;
typedef signed int sint16_t;
typedef signed long int sint32_t;
typedef signed long long sint64_t;
typedef volatile uint8_t* const reg_type8_t;
typedef volatile uint16_t* const reg_type16_t;
/************************************************************************/
/* defining boolean values */
/************************************************************************/
#define FALSE 0 // defines boolean false
#define TRUE 1 // defines boolean true
/************************************************************************/
/* LOW/HIGH defines */
/************************************************************************/
#define LOW 0 // defines LOW value for a bit
#define HIGH 0xFF // defines HIGH value for a bit
#define SET_BIT(REG,BIT) (REG |=(1<<BIT))
#define CLEAR_BIT(REG,BIT) (REG &=(~(1<<BIT)))
#define READBIT(REG,BIT) ( (REG >> BIT) & 1 )
#endif /* STD_TYPES_H_ */