Skip to content

Commit

Permalink
added alternate GPIO assignments to support CAN hats; renamed overlay…
Browse files Browse the repository at this point in the history
… for v2.90
  • Loading branch information
kwindrem committed Sep 18, 2022
1 parent 432c4a3 commit bac2d43
Show file tree
Hide file tree
Showing 13 changed files with 183 additions and 246 deletions.
Binary file modified FileSets/.DS_Store
Binary file not shown.
File renamed without changes.
36 changes: 21 additions & 15 deletions FileSets/gpio_list
Original file line number Diff line number Diff line change
@@ -1,45 +1,51 @@
#### modified for use by the RpiGpio package on Raspberry PI platforms ONLY
#### LEGACY assignments for Relay 1, 5 and 6 and Dig In 4
#### WILL CONFLICT with second channel on WaveShare dual channel CANbus hats, and possiblly others
#### interrupts, chip selects and second SPI bus
#### single channel CANbus hats should be OK with these assignments
#### this includes using only the first channel of the WaveShare dual channel hats
#### note that WaveShare sells two different dual channel CANbus hats: the non FD and FD (flexible data rate)

# This is a list of gpio pins, set by the script /etc/rcS.d/S90gpio_pins.sh
### for use by the RpiGpio package on Raspberry PI platforms ONLY

# This is a list of GPIO pins, set by the script /etc/rcS.d/S90gpio_pins.sh
# They are documented at: https://github.com/victronenergy/venus/wiki/bbb-gpio
# Format: <pin_number> <direction: in/out> <name>
#
# The <name> part is used to create an symlink in /dev/gpio.

# relays are active HIGH
# Relay 1 Pin 40 / GPIO 21
# Relay 1 GPIO 21 / header pin 40
21 out relay_1
# Relay 2 Pin 11 / GPIO 17
# Relay 2 GPIO 17 / header pin 11
17 out relay_2

# Relay 3 Pin 13 / GPIO 27
# Relay 3 GPIO 27 / header pin 13
27 out relay_3
# Relay 4 Pin 15 / GPIO 22
# Relay 4 GPIO 22 / header pin 15
22 out relay_4
# Relay 5 Pin 16 / GPIO 23
# Relay 5 GPIO 23 / header pin 16
23 out relay_5
# Relay 6 Pin 18 / GPIO 24
# Relay 6 GPIO 24 / header pin 18
24 out relay_6

# these have pull UPs
# Digital input 1 Pin 29 / GPIO 05
# Digital input 1 GPIO 5 / header pin 29
5 in digital_input_1
# Digital input 2 Pin 31 / GPIO 06
# Digital input 2 PIO 6 / header pin 31
6 in digital_input_2


# in stock code these have pull DOWNs
#### modified to pull UPs by the GPIO overlay that is installed as part of this package

# Digital input 3 Pin 33 / GPIO 13
# Digital input 3 GPIO 13 / header pin 33
13 in digital_input_3
# Digital input 4 Pin 35 / GPIO 19
# Digital input 4 GPIO 19 / header pin 35
19 in digital_input_4
# Digital input 5 Pin 37 / GPIO 26
# Digital input 5 GPIO 26 / header pin 37
26 in digital_input_5

#### Gracefull shutdown input
#### Note this input is NOT added to the available I/O used by Venus OS !!!!
# Pin 36 / GPIO 16
# GPIO 16 / header pin 36
16 in digital_input_6

59 changes: 59 additions & 0 deletions FileSets/gpio_listForCanHats
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#### ALTERNATE assignments for Relay 1, 5 and 6 and Dig In 4
#### avoids conflict with second CANbus hat interface
#### supports Waveshare dual CAN and dual CAN FD
#### should work with CAN FD mode A or mode B
#### but not more than 1 CAN FD hat board
#### NO i2c bus is possible since relay 1 and dig in 4 use these pins !!!!
#### must use spi1-1cs.dtbo overlay, NOT spi1-3cs.dtbo because of conflicts
#### digital input 3 conflicts with spi0-1 interrupt on CAN FD hat
#### Shutdown monitor shutdown GPIO spi1-2 chip select on CAN FD hat
#### relay 2 conflicts wih spi1-1 chip select on CAN FD hat
#### relay 4 conflicts wih spi1-2 interrupt on CAN FD hat
#
#### other conflicts must be resolved manually by carefully selecting hat boards
#### and creating a custom gpio_list file

#### for use by the RpiGpio package on Raspberry PI platforms ONLY

# This is a list of GPIO pins, set by the script /etc/rcS.d/S90gpio_pins.sh
# They are documented at: https://github.com/victronenergy/venus/wiki/bbb-gpio
# Format: <pin_number> <direction: in/out> <name>
#
# The <name> part is used to create an symlink in /dev/gpio.

# relays are active HIGH
# Relay 1 GPIO 2 / header pin 3 ALTERNATE assignment
2 out relay_1
# Relay 2 GPIO 17 / header pin 11
17 out relay_2

# Relay 3 GPIO 27 / header pin 13
27 out relay_3
# Relay 4 GPIO 22 / header pin 15
22 out relay_4
# Relay 5 GPIO 12 / header pin 32 ALTERNATE assignment
12 out relay_5
# Relay 6 GPIO 4 / header pin 7 ALTERNATE assignment
4 out relay_6

# these have pull UPs
# Digital input 1 GPIO 5 / header pin 29
5 in digital_input_1
# Digital input 2 GPIO 6 / header pin 31
6 in digital_input_2

# in stock code these have pull DOWNs
#### modified to pull UPs by the GPIO overlay that is installed as part of this package

# Digital input 3 GPIO 13 / header pin 33
13 in digital_input_3
# Digital input 4 GPIO 3 / header pin 5 ALTERNATE assignment
3 in digital_input_4
# Digital input 5 GPIO 26 / header pin 37
26 in digital_input_5

#### Gracefull shutdown input
#### Note this input is NOT added to the available I/O used by Venus OS !!!!
# GPIO 16 / header pin 36
16 in digital_input_6

Binary file added FileSets/spi1-1cs.dtbo
Binary file not shown.
Binary file removed FileSets/v2.42/.DS_Store
Binary file not shown.
107 changes: 0 additions & 107 deletions FileSets/v2.42/relaystate.py

This file was deleted.

102 changes: 0 additions & 102 deletions FileSets/v2.42/relaystate.py.orig

This file was deleted.

12 changes: 4 additions & 8 deletions OverlayInstructions
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@

compile:
dtc -@ -I dts -O dtb -o VenusGpioOverlay.dtb VenusGpioOverlay.dts
----------- or ??? -----------
dtc -@ -I dts -O dtb -o VenusGpioOverlay.dtbo VenusGpioOverlay.dts

Put it in /boot/overlays:
sudo cp VenusGpioOverlay.dtb /boot/overlays/VenusGpioOverlay.dtb
----------- or ??? -----------
sudo cp VenusGpioOverlay.dtbo /boot/overlays/VenusGpioOverlay.dtbo
Put it in /u-boot/overlays:
sudo cp VenusGpioOverlay.dtbo /u-boot/overlays/VenusGpioOverlay.dtbo

Add a line to /boot/config.txt:
Add a line to /u-boot/config.txt:
dtoverlay=VenusGpioOverlay

Note /boot might be /u-boot
Note /u-boot typically appears as /boot when the SD card is mounted on a computer
Loading

0 comments on commit bac2d43

Please sign in to comment.