/
atxmega_spi.h
79 lines (67 loc) · 2.3 KB
/
atxmega_spi.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Generated by PeakRDL-cheader - A free and open-source header generator
// https://github.com/SystemRDL/PeakRDL-cheader
#ifndef ATXMEGA_SPI_H
#define ATXMEGA_SPI_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <assert.h>
// Reg - atxmega_spi::CTRL
#define ATXMEGA_SPI__CTRL__PRESCALER_bm 0x3
#define ATXMEGA_SPI__CTRL__PRESCALER_bp 0
#define ATXMEGA_SPI__CTRL__PRESCALER_bw 2
#define ATXMEGA_SPI__CTRL__PRESCALER_reset 0x0
#define ATXMEGA_SPI__CTRL__MODE_bm 0xc
#define ATXMEGA_SPI__CTRL__MODE_bp 2
#define ATXMEGA_SPI__CTRL__MODE_bw 2
#define ATXMEGA_SPI__CTRL__MODE_reset 0x0
#define ATXMEGA_SPI__CTRL__MASTER_bm 0x10
#define ATXMEGA_SPI__CTRL__MASTER_bp 4
#define ATXMEGA_SPI__CTRL__MASTER_bw 1
#define ATXMEGA_SPI__CTRL__MASTER_reset 0x0
#define ATXMEGA_SPI__CTRL__DORD_bm 0x20
#define ATXMEGA_SPI__CTRL__DORD_bp 5
#define ATXMEGA_SPI__CTRL__DORD_bw 1
#define ATXMEGA_SPI__CTRL__DORD_reset 0x0
#define ATXMEGA_SPI__CTRL__ENABLE_bm 0x40
#define ATXMEGA_SPI__CTRL__ENABLE_bp 6
#define ATXMEGA_SPI__CTRL__ENABLE_bw 1
#define ATXMEGA_SPI__CTRL__ENABLE_reset 0x0
#define ATXMEGA_SPI__CTRL__CLK2X_bm 0x80
#define ATXMEGA_SPI__CTRL__CLK2X_bp 7
#define ATXMEGA_SPI__CTRL__CLK2X_bw 1
#define ATXMEGA_SPI__CTRL__CLK2X_reset 0x0
// Reg - atxmega_spi::INTCTRL
#define ATXMEGA_SPI__INTCTRL__INTLVL_bm 0x3
#define ATXMEGA_SPI__INTCTRL__INTLVL_bp 0
#define ATXMEGA_SPI__INTCTRL__INTLVL_bw 2
#define ATXMEGA_SPI__INTCTRL__INTLVL_reset 0x0
// Reg - atxmega_spi::STATUS
#define ATXMEGA_SPI__STATUS__WRCOL_bm 0x40
#define ATXMEGA_SPI__STATUS__WRCOL_bp 6
#define ATXMEGA_SPI__STATUS__WRCOL_bw 1
#define ATXMEGA_SPI__STATUS__WRCOL_reset 0x0
#define ATXMEGA_SPI__STATUS__IF_bm 0x80
#define ATXMEGA_SPI__STATUS__IF_bp 7
#define ATXMEGA_SPI__STATUS__IF_bw 1
#define ATXMEGA_SPI__STATUS__IF_reset 0x0
// Reg - atxmega_spi::DATA
#define ATXMEGA_SPI__DATA__WDATA_bm 0xff
#define ATXMEGA_SPI__DATA__WDATA_bp 0
#define ATXMEGA_SPI__DATA__WDATA_bw 8
#define ATXMEGA_SPI__DATA__RDATA_bm 0xff
#define ATXMEGA_SPI__DATA__RDATA_bp 0
#define ATXMEGA_SPI__DATA__RDATA_bw 8
// Addrmap - atxmega_spi
typedef struct __attribute__ ((__packed__)) {
uint8_t CTRL;
uint8_t INTCTRL;
uint8_t STATUS;
uint8_t DATA;
} atxmega_spi_t;
static_assert(sizeof(atxmega_spi_t) == 0x4, "Packing error");
#ifdef __cplusplus
}
#endif
#endif /* ATXMEGA_SPI_H */