-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct_ssp.h
More file actions
127 lines (112 loc) · 2.08 KB
/
struct_ssp.h
File metadata and controls
127 lines (112 loc) · 2.08 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
*\file
*\brief Файл данных для генератора кода SSP
*\author Меловидов Алексей
*\version 1.0
*\date 30 июня 2016 года
*В этом файле находится набор стрктур для генерации кода SSP
*/
#ifndef STRUCT_SSP_H
#define STRUCT_SSP_H
enum SSP_FRF
{
SPI_M = 0b00,
SSI_TI = 0b01,
MW_NS = 0b10,
RSRV = 0b11
};
enum SSP_DSS
{
RSRV1 = 0b0000,
RSRV2 = 0b0001,
RSRV3 = 0b0010,
bit4 = 0b0011,
bit5 = 0b0100,
bit6 = 0b0101,
bit7 = 0b0110,
bit8 = 0b0111,
bit9 = 0b1000,
bit10 = 0b1001,
bit11 = 0b1010,
bit12 = 0b1011,
bit13 = 0b1100,
bit14 = 0b1101,
bit15 = 0b1110,
bit16 = 0b1111
};
struct SSP_CR0
{
unsigned char SCR;
enum SSP_DSS DDS;
enum Switches SPH;
enum Switches SPO;
enum SSP_FRF FRF;
};
struct SSP_CR1
{
enum Switches SOD;
enum Switches MS;
enum Switches SSE;
enum Switches LBM;
};
struct SSP_DR
{
enum Switches SSP_read_DATA;
};
struct SSP_SR
{
enum Switches read_BSY;
enum Switches read_RFF;
enum Switches read_RNE;
enum Switches read_TNF;
enum Switches read_TFE;
};
struct SSP_CPSR
{
unsigned char CPSDVSR;
};
struct SSP_IMSC
{
enum Switches TXIM;
enum Switches RXIM;
enum Switches RTIM;
enum Switches RORIM;
};
struct SSP_RIS
{
enum Switches read_TXRIS;
enum Switches read_RXRIS;
enum Switches read_RTRIS;
enum Switches read_RORRIS;
};
struct SSP_MIS
{
enum Switches read_TXMIS;
enum Switches read_RXMIS;
enum Switches read_RTMIS;
enum Switches read_RORMIS;
};
struct SSP_ICR
{
enum Switches write_RTIC;
enum Switches write_RORIC;
};
struct SSP_DMACR
{
enum Switches TXDMAE;
enum Switches RXDMAE;
};
struct global_SSP
{
struct SSP_CR0 SSP_CR0R;
struct SSP_CR1 SSP_CPR;
struct SSP_DR SSP_DRR;
struct SSP_SR SSP_SRR;
struct SSP_CPSR SSP_CPSRR;
struct SSP_IMSC SSP_IMSCR;
struct SSP_RIS SSP_RISR;
struct SSP_MIS SSP_MISR;
struct SSP_ICR SSP_ICRR;
struct SSP_DMACR SSP_DMACRR;
};
#endif // STRUCT_SSP_H