From 0c00cd3f3e3b9fe77ecc9ae0ee8ccb89332e6ede Mon Sep 17 00:00:00 2001
From: kruger <kruger@astron.nl>
Date: Thu, 29 Apr 2021 13:48:28 +0200
Subject: [PATCH] RCU on/off

---
 config/RCU.yaml | 38 ++++++++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/config/RCU.yaml b/config/RCU.yaml
index a7bfc73..03b8e75 100644
--- a/config/RCU.yaml
+++ b/config/RCU.yaml
@@ -394,10 +394,11 @@ methods:
 #     - RCU_GPIO1: Update
 #     - RCU_GPIO2: Update
 #     - RCU_attenuator: [10,10,10]  #Set OPC-UA variable
-#     - WAIT: 500         #ms to wait
-#     - ADC1_on: 0        #call another opc-ua method
-#     - ADC2_on: 0
-#     - WAIT: 500         #ms to wait
+     - WAIT: 500         #ms to wait
+     - ADC1_on: 0        #call another opc-ua method
+     - ADC2_on: 0
+     - ADC3_on: 0
+     - WAIT: 500         #ms to wait
      - RCU_update: 0
 
   - name: RCU_update
@@ -406,12 +407,12 @@ methods:
     debug: True
     instructions:
       - RCU_Pwr_dig: Update  #Read value and update the OPC-UA variable
-      - RCU_ADC_lock: Update
       - RCU_ID: Update
       - RCU_version: Update
       - RCU_LED0: Update
       - RCU_attenuator: Update
       - RCU_band: Update
+      - RCU_ADC_lock: Update
 
 
   - name: ADC1_on
@@ -420,22 +421,39 @@ methods:
 #    rw: hidden
     instructions:
      - ADC1.JESD_control1 : 0x14
-#     - ADC1.SYNC_control: 1  #Setup ADCs
-#     - ADC1.CML_level: 0x7
+     - ADC1.SYNC_control: 1  #Setup ADCs
+     - ADC1.CML_level: 0x7
      - ADC1.Update: 1       #Needed to update ADC registers
+     
   - name: ADC2_on
     driver: I2C_RCU
     debug: True
 #    rw: hidden
     instructions:
      - ADC2.JESD_control1 : 0x14
-#     - ADC2.SYNC_control: 1  #Setup ADCs
-#     - ADC2.CML_level: 0x7
+     - ADC2.SYNC_control: 1  #Setup ADCs
+     - ADC2.CML_level: 0x7
      - ADC2.Update: 1       #Needed to update ADC registers
- 
+
+  - name: ADC3_on
+    driver: I2C_RCU
+    debug: True
+#    rw: hidden
+    instructions:
+     - ADC3.JESD_control1 : 0x14
+     - ADC3.SYNC_control: 1  #Setup ADCs
+     - ADC3.CML_level: 0x7
+     - ADC3.Update: 1       #Needed to update ADC registers
+
   - name: RCU_off
     instructions:
      - RCU_Pwr_dig: 0 #Switch power off
+     - IO2.GPIO1: 0
+     - IO2.GPIO2: 0
+     - IO3.GPIO1: 0
+     - IO3.GPIO2: 0
+     - IO1.GPIO1: 0
+     - IO1.GPIO2: 0
      #todo, also make all GPIO pins (except power enables) inputs to remove all power from devices.
 
   - name: RCU_HBAT_WAIT_PPS
-- 
GitLab