summaryrefslogtreecommitdiffhomepage
path: root/source/cmds.h
blob: f03f8e460693e78de5b91eccc06b5c78a8103753 (plain)
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
/*
 *       cmds.h
 *
 *       Copyright (C) 2018, 2019 Mind Chasers Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 *
 */

#ifndef CMDS_H_
#define CMDS_H_

#include "stdint.h"

// PCS Bit Map
#define	RX_CDR_LOL_0	0x01
#define	RX_CDR_LOL_1	0x02
#define	RX_CDR_LOL_2	0x04
#define	PLL_LOL_0		0x08
#define	PLL_LOL_1		0x10

// Link Status Bit Map
#define	PORT_UP_0		0x1
#define PORT_UP_1		0x2

// SCI Address Definitions

#define SCI_SEL_CH0		0x00
#define SCI_SEL_CH1		0x40
#define SCI_SEL_AUX		0xC0

struct x_config {
	char cmd;
	uint8_t ch3;
	uint8_t ch2;
	uint8_t ch1;
	uint8_t ch0;
	char term;
};

struct c_config {
	char cmd;
	uint8_t ch3;
	uint8_t ch2;
	uint8_t ch1;
	uint8_t ch0;
	char term;
};

struct u_config {
	char cmd;
	uint8_t dcu1;
	uint8_t dcu0;
	char term;
};

struct gen0_config {
	char cmd;
	char term;
};

struct gen1_config {
	char cmd;
	uint8_t b0;
	char term;
};

extern struct gen0_config i_init;
extern struct gen0_config pcs_s;
extern struct gen0_config link_s;

extern struct gen1_config m0;
extern struct gen1_config m1;

extern struct gen0_config test_tx_pkt;

extern struct x_config x_reset;
extern struct x_config x_init0;
extern struct x_config x_init1;

extern struct u_config u_reset;
extern struct u_config u_init;

extern struct c_config c_reset;
extern struct c_config c_init0;
extern struct c_config c_init1;
extern struct c_config c_init_pcsr;

#endif /* CMDS_H_ */



X-ray Engineering Services