Skip to content

Commit

Permalink
Add RPI3B+ support and remove IMX6UL
Browse files Browse the repository at this point in the history
Update samples to add RPI3B+ and remove IMX6UL support.

Bug: 112590677
Bug: 112603667
Change-Id: I61d320ae5ddc1ca7421786886bd3691be1120495
  • Loading branch information
mangini committed Aug 14, 2018
1 parent 2db9f32 commit 68d5999
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,13 +30,12 @@ public class BoardDefaults {
public static String getI2CPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";
/**
* Return the preferred I2C port for each board.
*/
public static String getSPIPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "SPI0.0";
case DEVICE_IMX6UL_PICO:
return "SPI3.0";
case DEVICE_IMX7D_PICO:
return "SPI3.1";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,13 +30,12 @@ public class BoardDefaults {
public static String getI2CPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,9 +30,8 @@ public class BoardDefaults {
public static String getI2CPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,9 +30,8 @@ public class BoardDefaults {
public static String getUartName() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "UART0";
case DEVICE_IMX6UL_PICO:
return "UART3";
case DEVICE_IMX7D_PICO:
return "UART6";
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,13 +30,12 @@ public class BoardDefaults {
public static String getI2CPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@

public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

public static String[] getRowPins() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return new String[] {"BCM27", "BCM5", "BCM6", "BCM26"};
case DEVICE_IMX7D_PICO:
return new String[] {"GPIO2_IO03", "GPIO2_IO01", "GPIO2_IO02", "GPIO2_IO05"};
case DEVICE_IMX6UL_PICO:
return new String[] {"GPIO4_IO23", "GPIO4_IO21", "GPIO4_IO22", "GPIO4_IO18"};
default:
throw new UnsupportedOperationException("Unknown device: " + Build.DEVICE);
}
Expand All @@ -39,11 +38,10 @@ public static String[] getRowPins() {
public static String[] getColPins() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return new String[] {"BCM16", "BCM24", "BCM23"};
case DEVICE_IMX7D_PICO:
return new String[] {"GPIO2_IO07", "GPIO6_IO12", "GPIO6_IO13"};
case DEVICE_IMX6UL_PICO:
return new String[] {"GPIO5_IO02", "GPIO2_IO01", "GPIO2_IO00"};
default:
throw new UnsupportedOperationException("Unknown device: " + Build.DEVICE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,13 +30,12 @@ public class BoardDefaults {
public static String getI2CPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

public static String getPwmPin() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "PWM0";
case DEVICE_IMX6UL_PICO:
return "PWM7";
case DEVICE_IMX7D_PICO:
return "PWM1";
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

public static String getPwmPin() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "PWM1";
case DEVICE_IMX6UL_PICO:
return "PWM8";
case DEVICE_IMX7D_PICO:
return "PWM2";
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -30,13 +30,12 @@ public class BoardDefaults {
public static String getI2CPort() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
private static final String DEVICE_RPI3 = "rpi3";
private static final String DEVICE_IMX6UL_PICO = "imx6ul_pico";
private static final String DEVICE_RPI3BP = "rpi3bp";
private static final String DEVICE_IMX7D_PICO = "imx7d_pico";

/**
Expand All @@ -31,9 +31,8 @@ public static String getGPIOforData() {

switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "BCM20";
case DEVICE_IMX6UL_PICO:
return "GPIO2_IO02";
case DEVICE_IMX7D_PICO:
return "GPIO6_IO15";
default:
Expand All @@ -47,13 +46,12 @@ public static String getGPIOforData() {
public static String getGPIOforClock() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
case DEVICE_RPI3BP:
return "BCM21";
case DEVICE_IMX6UL_PICO:
return "GPIO2_IO03";
case DEVICE_IMX7D_PICO:
return "GPIO6_IO14";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
}
}

0 comments on commit 68d5999

Please sign in to comment.