Skip to content

Commit

Permalink
Merge pull request #210 from abalanonline/main
Browse files Browse the repository at this point in the history
aml-s905x-cc, jetson-nano
  • Loading branch information
mattjlewis authored Aug 5, 2024
2 parents e00ef71 + 77953f3 commit 336c484
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,18 @@ public int getGpio() {
public boolean getValue() throws RuntimeIOException {
if (mmapGpio == null) {
return line.getValue() == 0 ? false : true;
} else {
return mmapGpio.gpioRead(gpio);
}
return mmapGpio.gpioRead(gpio);
}

@Override
public void setValue(boolean value) throws RuntimeIOException {
if (mmapGpio == null) {
line.setValue(value ? 1 : 0);
} else {
mmapGpio.gpioWrite(gpio, value);
}
mmapGpio.gpioWrite(gpio, value);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://libre.computer/blogs/gpio-headers-reference-for-aml-s905x-cc/

General, DEFAULT, 1, 3v3
General, DEFAULT, 2, 5v
General, DEFAULT, 4, 5v
General, DEFAULT, 6, GND
General, DEFAULT, 9, GND
General, DEFAULT, 14, GND
General, DEFAULT, 17, 3v3
General, DEFAULT, 20, GND
General, DEFAULT, 25, GND
General, DEFAULT, 30, GND
General, DEFAULT, 34, GND
General, DEFAULT, 39, GND

# GPIO, Header, GPIO#, Name, Physical Pin, Modes, Chip, Line Offset
GPIO, DEFAULT, 5, 7J1 Header Pin3, 3, 0, 5, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 4, 7J1 Header Pin5, 5, 0, 4, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 98, 7J1 Header Pin7, 7, 1, 98, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 91, 7J1 Header Pin8, 8, 1, 91, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 92, 7J1 Header Pin10, 10, 1, 92, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 8, 9J3 Switch HDMI CEC/7J1 Header , 11, 0, 8, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 6, 7J1 Header Pin12, 12, 0, 6, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 9, 7J1 Header Pin13, 13, 0, 9, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 10, 7J1 Header Pin15, 15, 0, 10, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 93, 7J1 Header Pin16, 16, 1, 93, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 94, 7J1 Header Pin18, 18, 1, 94, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 87, 7J1 Header Pin19, 19, 1, 87, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 88, 7J1 Header Pin21, 21, 1, 88, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 79, 7J1 Header Pin22, 22, 1, 79, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 90, 7J1 Header Pin23, 23, 1, 90, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 89, 7J1 Header Pin24, 24, 1, 89, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 80, 7J1 Header Pin26, 26, 1, 80, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 75, 7J1 Header Pin27, 27, 1, 75, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 76, 7J1 Header Pin28, 28, 1, 76, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 96, 7J1 Header Pin29, 29, 1, 96, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 97, 7J1 Header Pin31, 31, 1, 97, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 95, 7J1 Header Pin32, 32, 1, 95, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 85, 7J1 Header Pin33, 33, 1, 85, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 86, 7J1 Header Pin35, 35, 1, 86, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 81, 7J1 Header Pin36, 36, 1, 81, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 84, 7J1 Header Pin37, 37, 1, 84, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 82, 7J1 Header Pin38, 38, 1, 82, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 83, 7J1 Header Pin40, 40, 1, 83, DIGITAL_INPUT | DIGITAL_OUTPUT
44 changes: 44 additions & 0 deletions diozero-core/src/main/resources/boarddefs/nvidia_jetson-nano.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://developer.nvidia.com/embedded/learn/jetson-nano-2gb-devkit-user-guide

General, DEFAULT, 1, 3v3
General, DEFAULT, 2, 5v
General, DEFAULT, 4, 5v
General, DEFAULT, 6, GND
General, DEFAULT, 9, GND
General, DEFAULT, 14, GND
General, DEFAULT, 17, 3v3
General, DEFAULT, 20, GND
General, DEFAULT, 25, GND
General, DEFAULT, 30, GND
General, DEFAULT, 34, GND
General, DEFAULT, 39, GND

# GPIO, Header, GPIO#, Name, Physical Pin, Modes, Chip, Line Offset
GPIO, DEFAULT, 75, I2C1_SDA, 3, 0, 75, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 74, I2C1_SCL, 5, 0, 74, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 216, AUD_CLK, 7, 0, 216, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 48, UART1_TXD, 8, 0, 48, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 49, UART1_RXD, 10, 0, 49, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 50, UART1_RTS, 11, 0, 50, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 79, I2S0_SCLK, 12, 0, 79, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 14, SPI1_SCK, 13, 0, 14, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 194, GPIO12, 15, 0, 194, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 232, SPI1_CS1, 16, 0, 232, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 15, SPI1_CS0, 18, 0, 15, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 16, SPI0_MOSI, 19, 0, 16, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 17, SPI0_MISO, 21, 0, 17, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 13, SPI1_MISO, 22, 0, 13, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 18, SPI0_SCK, 23, 0, 18, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 19, SPI0_CS0, 24, 0, 19, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 20, SPI0_CS1, 26, 0, 20, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 13, I2C0_SDA, 27, 0, 13, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 18, I2C0_CLK, 28, 0, 18, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 149, GPIO01, 29, 0, 149, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 200, GPIO11, 31, 0, 200, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 168, GPIO07, 32, 0, 168, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 38, GPIO13, 33, 0, 38, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 76, I2S0_FS, 35, 0, 76, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 51, UART1_CTS, 36, 0, 51, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 12, SPI1_MOSI, 37, 0, 12, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 77, I2S0_DIN, 38, 0, 77, DIGITAL_INPUT | DIGITAL_OUTPUT
GPIO, DEFAULT, 78, I2S0_DOUT, 40, 0, 78, DIGITAL_INPUT | DIGITAL_OUTPUT

0 comments on commit 336c484

Please sign in to comment.