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 ================ */
41typedef enum {
42 RESET = 0UL,
44
47
50} State;
51
52typedef enum {
53 OK = 0U,
58
59#endif /* __METAL_H */
State
Definition: metal.h:41
@ HIGH
Definition: metal.h:49
@ RESET
Definition: metal.h:42
@ LOW
Definition: metal.h:48
@ ENABLE
Definition: metal.h:46
@ SET
Definition: metal.h:43
@ DISABLE
Definition: metal.h:45
Status
Definition: metal.h:52
@ OK
Definition: metal.h:53
@ ERROR
Definition: metal.h:54
@ BUSY
Definition: metal.h:55
@ TIMEOUT
Definition: metal.h:56