Skip to content
Snippets Groups Projects
Commit 9561105b authored by Paulus Kruger's avatar Paulus Kruger
Browse files

L2TS ADCs GPIO pin change

parent 58ab4a47
No related branches found
No related tags found
No related merge requests found
Pipeline #47430 passed
#!/bin/bash
sudo systemctl stop recvtr.service
sudo systemctl stop apscttr.service
sudo systemctl stop apsputr.service
sudo systemctl stop unb2tr.service
sudo python3 setup.py install
sudo systemctl start recvtr.service
sudo systemctl start apscttr.service
sudo systemctl start apsputr.service
sudo systemctl start unb2tr.service
sudo python3.11 setup.py install
sudo systemctl restart recvtr.service
sudo systemctl restart apscttr.service
sudo systemctl restart apsputr.service
sudo systemctl restart unb2tr.service
#!/bin/bash
sudo cp bin/*.service /lib/systemd/system/.
sudo systemctl daemon-reload
sudo systemctl enable recvtr.service
sudo systemctl enable apscttr.service
sudo systemctl enable apsputr.service
sudo systemctl enable unb2tr.service
......@@ -50,12 +50,12 @@ drivers:
- name: SPIbb2
type: spibitbang1
devreg: [IO3.GPIO1,IO3.GPIO1,IO3.CONF1,IO3.GPIO2]
parameters: [3,2,2,1]
parameters: [1,2,2,1]
parent: I2C_RCU
- name: SPIbb3
type: spibitbang1
devreg: [IO3.GPIO1,IO3.GPIO1,IO3.CONF1,IO3.GPIO2]
parameters: [5,4,4,2]
parameters: [1,4,4,2]
parent: I2C_RCU
# - name: SPI3bb
......@@ -474,9 +474,22 @@ variables:
- name: RCU_DTH_shutdown
description: False means dither source & ADC powered on.
driver: I2C_RCU
devreg: [IO3.GPIO1,IO3.GPIO1,IO3.GPIO2]
devreg: IO3.GPIO2
width: 1
bitoffset: [7,6,7]
bitoffset: 7
rw: ro
dtype: boolean
dim: 32
# dim2: [3,32]
mask: RCU_mask
debug: True
- name: RCU_ADC_shutdown
description: False means ADC powered on.
driver: I2C_RCU
devreg: [IO3.GPIO1,IO3.GPIO1,IO3.GPIO1]
width: 1
bitoffset: [6,3,5]
rw: ro
dtype: boolean
dim: 96
......@@ -511,7 +524,7 @@ variables:
description: RCU version number
driver: I2C_RCU
devreg: ROM.Version
width: 0x80 #16 characters
width: 0x100 #32 characters
rw: ro
dtype: string
dim: 32
......@@ -522,7 +535,7 @@ variables:
description: PCB number (astron.nl/webforms/IenS-Boarden/view.php?id=xxx)
driver: I2C_RCU
devreg: ROM.Serial
width: 0x80 #16 characters
width: 0x100 #32 characters
rw: ro
dtype: string
dim: 32
......@@ -744,8 +757,8 @@ methods:
# - IO3.GPIO2: 0xC7 #ADC SC=high, DTH_SDA=high
- IO3.POL1: 0
- IO3.POL2: 0
- IO3.GPIO1: 0x15 #ADC_SDIO=high, clk=low, DTH_EN=low
- IO3.GPIO2: 0x47 #ADC SC=high, DTH_SDA=high
- IO3.GPIO1: 0x15 # x001 0101 #ADC_SDIO=high, clk=low, PWDN=low=on DTH_EN=low
- IO3.GPIO2: 0x47 # 0100 0111 #ADC SC=high, DTH_SDA=high
- IO1.GPIO1: 0x0A #0x0a = 10dB att
- IO1.GPIO2: 0x8A #0x80 Analog on, 0x0a=10dB att
- IO2.CONF2: 0
......@@ -770,9 +783,9 @@ methods:
- ADC3_on: 0
# - IO3.GPIO1: 0xD5 #DTH_EN=high -> ADCs disables
# - IO3.GPIO2: 0xC7 #
- RCU_DTH_shutdown : [1,1,1]
- RCU_ADC_shutdown : [1,1,1]
- WAIT: 100 #ms to wait
- RCU_DTH_shutdown : [0,0,0]
- RCU_ADC_shutdown : [0,0,0]
# - IO3.GPIO1: 0x15 #DTH_EN=low -> ADC enabled
# - IO3.GPIO2: 0x47
- RCU_DTH_on: Update #check dither while giving ADCs some time to lock
......
#!/usr/local/bin/python3.11
import RPi.GPIO as gpio
ID_PINS = [7, 8, 16, 12, 21] # Reverse ID bits
gpio.setmode(gpio.BCM) # Set IO pins used for the APSCT-ID
for pin in ID_PINS:
gpio.setup(pin, gpio.IN)
bits=[gpio.input(pin) for pin in ID_PINS]
#print(bits)
loc_id=0
for bit in bits:
loc_id = 2*loc_id + bit
ip='10.99.0.%i'%(100+loc_id)
#ip='10.87.6.213'
print(ip)
[Unit]
Description=change ip address
After=dhcpcd.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/root/setip/setip.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
loc_id=`/root/setip/getip.py`
if [ -z "$loc_id" ]
then
echo "error"
else
echo ifconfig eth0 $loc_id netmask 255.255.0.0
sleep 1
ifconfig eth0
ifconfig -v eth0 down
ifconfig -v eth0 $loc_id netmask 255.255.0.0
ifconfig -v eth0 up
ifconfig eth0
fi
#!/bin/bash
sudo systemctl stop recvtr.service
sudo systemctl stop apscttr.service
sudo systemctl stop apsputr.service
sudo systemctl stop unb2tr.service
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment