summaryrefslogtreecommitdiffhomepage
path: root/source/cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/cmds.c')
-rw-r--r--source/cmds.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/source/cmds.c b/source/cmds.c
new file mode 100644
index 0000000..f0f9124
--- /dev/null
+++ b/source/cmds.c
@@ -0,0 +1,48 @@
+/*
+ * cmds.c
+ *
+ * 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.
+ *
+ * function: convenience structs for sending commands to FPGA internal controller
+ *
+ */
+
+
+
+
+#include "cmds.h"
+
+
+struct gen0_config i_init = {.cmd = 'i', .term = '\r'};
+
+struct gen0_config pcs_s = {.cmd = 'p', .term = '\r'};
+struct gen0_config link_s = {.cmd = 'l', .term = '\r'};
+
+struct gen1_config m0 = {.cmd = 'm', .b0 = 0x0, .term = '\r'};
+struct gen1_config m1 = {.cmd = 'm', .b0 = 0x1, .term = '\r'};
+
+struct gen0_config test_tx_pkt = {.cmd = 't', .term = '\r'};
+
+struct x_config x_reset = {.cmd = 'x', .ch0 = 0x3, .ch1 = 0x3, .ch2 = 0x3, .ch3 = 0x3, .term = '\r'};
+struct x_config x_init0 = {.cmd = 'x', .ch0 = 0x1, .ch1 = 0x1, .ch2 = 0x1, .ch3 = 0x1, .term = '\r'};
+struct x_config x_init1 = {.cmd = 'x', .ch0 = 0x0, .ch1 = 0x0, .ch2 = 0x0, .ch3 = 0x0, .term = '\r'};
+
+struct u_config u_reset = {.cmd = 'u', .dcu0 = 0x7, .dcu1 = 0x7, .term = '\r'};
+struct u_config u_init = {.cmd = 'u', .dcu0 = 0x0, .dcu1 = 0x0, .term = '\r'};
+
+struct c_config c_reset = {.cmd = 'c', .ch0 = 0x7, .ch1 = 0x7, .ch2 = 0x7, .ch3 = 0x7, .term = '\r'};
+struct c_config c_init0 = {.cmd = 'c', .ch0 = 0x5, .ch1 = 0x5, .ch2 = 0x5, .ch3 = 0x5, .term = '\r'};
+struct c_config c_init1 = {.cmd = 'c', .ch0 = 0x0, .ch1 = 0x0, .ch2 = 0x0, .ch3 = 0x0, .term = '\r'};
+struct c_config c_init_pcsr = {.cmd = 'c', .ch0 = 0x0, .ch1 = 0x0, .ch2 = 0x1, .ch3 = 0x1, .term = '\r'};