Baremetal-NN
Baremetal-NN API documentation
Loading...
Searching...
No Matches
metal.h
Go to the documentation of this file.
1
12
#ifndef __METAL_H
13
#define __METAL_H
14
15
#include <stdint.h>
16
#include <stddef.h>
17
18
/* ================ Memory register attributes ================ */
19
#ifdef __cplusplus
20
#define __I volatile
21
#else
22
#define __I volatile const
23
#endif
24
#define __O volatile
25
#define __IO volatile
27
/* following defines should be used for structure members */
28
#define __IM volatile const
29
#define __OM volatile
30
#define __IOM volatile
33
/* ================ Bit Operation definitions ================ */
34
#define SET_BITS(REG, BIT) ((REG) |= (BIT))
35
#define CLEAR_BITS(REG, BIT) ((REG) &= ~(BIT))
36
#define READ_BITS(REG, BIT) ((REG) & (BIT))
37
#define WRITE_BITS(REG, CLEARMASK, SETMASK) ((REG) = (((REG) & (~(CLEARMASK))) | (SETMASK)))
38
39
40
/* ================ Common definitions ================ */
41
typedef
enum
{
42
RESET
= 0UL,
43
SET
= !
RESET
,
44
45
DISABLE
=
RESET
,
46
ENABLE
=
SET
,
47
48
LOW
=
RESET
,
49
HIGH
=
SET
,
50
}
State
;
51
52
typedef
enum
{
53
OK
= 0U,
54
ERROR
,
55
BUSY
,
56
TIMEOUT
57
}
Status
;
58
59
#endif
/* __METAL_H */
State
State
Definition:
metal.h:41
HIGH
@ HIGH
Definition:
metal.h:49
RESET
@ RESET
Definition:
metal.h:42
LOW
@ LOW
Definition:
metal.h:48
ENABLE
@ ENABLE
Definition:
metal.h:46
SET
@ SET
Definition:
metal.h:43
DISABLE
@ DISABLE
Definition:
metal.h:45
Status
Status
Definition:
metal.h:52
OK
@ OK
Definition:
metal.h:53
ERROR
@ ERROR
Definition:
metal.h:54
BUSY
@ BUSY
Definition:
metal.h:55
TIMEOUT
@ TIMEOUT
Definition:
metal.h:56
nn
metal.h
Generated by
1.9.5