ODROID-M1S: New support for ODROID-M1S
Signed-off-by: Steve Jeong <steve@how2flow.net> Change-Id: Ib134094f7a35298b1274a60fbfc56a07a14ed965
This commit is contained in:
@@ -27,6 +27,7 @@ cc_library_shared {
|
|||||||
"wiringPi/odroidc4.c",
|
"wiringPi/odroidc4.c",
|
||||||
"wiringPi/odroidhc4.c",
|
"wiringPi/odroidhc4.c",
|
||||||
"wiringPi/odroidm1.c",
|
"wiringPi/odroidm1.c",
|
||||||
|
"wiringPi/odroidm1s.c",
|
||||||
"wiringPi/drcSerial.c",
|
"wiringPi/drcSerial.c",
|
||||||
"wiringPi/mcp23s08.c",
|
"wiringPi/mcp23s08.c",
|
||||||
"wiringPi/odroidn1.c",
|
"wiringPi/odroidn1.c",
|
||||||
|
|||||||
@@ -652,6 +652,69 @@ static const char *physNamesOdroidM1 [64] =
|
|||||||
NULL,NULL,NULL,
|
NULL,NULL,NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
static const char *physNamesOdroidM1SAll [64] =
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
|
||||||
|
" 3.3V", "5V ",
|
||||||
|
"I2C0_SDA", "5V ",
|
||||||
|
"I2C0_SCL", "GND(0V) ",
|
||||||
|
"GPIO0_B6", "UART1_TX",
|
||||||
|
" GND(0V)", "UART1_RX",
|
||||||
|
"GPIO0_C0", "GPIO2_A7",
|
||||||
|
"GPIO0_C1", "GND(0V) ",
|
||||||
|
"GPIO0_C2", "GPIO2_B5",
|
||||||
|
" 3.3V", "GPIO2_B6",
|
||||||
|
"SPI_MOSI", "GND(0V) ",
|
||||||
|
"SPI_MISO", "GPIO2_B0",
|
||||||
|
" SPI_CLK", "SPI_CS0 ",
|
||||||
|
" GND(0V)", "GPIO2_B1",
|
||||||
|
"I2C1_SDA", "I2C1_SCL",
|
||||||
|
"GPIO2_C0", "GND(0V) ",
|
||||||
|
"GPIO2_B7", "GPIO2_B2",
|
||||||
|
"GPIO0_B5", "GND(0V) ",
|
||||||
|
"GPIO2_A5", "GPIO2_A6",
|
||||||
|
"ADC.AIN1", "1V8 ",
|
||||||
|
" GND(0V)", "ADC.AIN0",
|
||||||
|
|
||||||
|
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
|
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
|
NULL,NULL,NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
static const char *physNamesOdroidM1S [64] =
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
|
||||||
|
" 3.3V", "5V ",
|
||||||
|
" SDA0", "5V ",
|
||||||
|
" SCL0", "0V ",
|
||||||
|
" IO0_B6", "UART.TX",
|
||||||
|
" 0V", "UART.RX",
|
||||||
|
" IO0_C0", "IO2_A7 ",
|
||||||
|
" IO0_C1", "0V ",
|
||||||
|
" IO0_C2", "IO2_B5 ",
|
||||||
|
" 3.3V", "IO2_B6 ",
|
||||||
|
"SPI.TXD", "0V ",
|
||||||
|
"SPI.RXD", "IO2_B0 ",
|
||||||
|
"SPI.CLK", "SPI.CS0",
|
||||||
|
" 0V", "IO2_B1 ",
|
||||||
|
" SDA1", "SCL1 ",
|
||||||
|
" IO2_C0", "0V ",
|
||||||
|
" IO2_B7", "IO2_B2 ",
|
||||||
|
" IO0_B5", "0V ",
|
||||||
|
" IO2_A5", "IO2_A6 ",
|
||||||
|
" AIN1", "1V8 ",
|
||||||
|
" 0V", "AIN0 ",
|
||||||
|
|
||||||
|
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
|
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||||
|
NULL,NULL,NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
static void readallPhys(int model, int UNU rev, int physPin, const char *physNames[], int isAll) {
|
static void readallPhys(int model, int UNU rev, int physPin, const char *physNames[], int isAll) {
|
||||||
int pin ;
|
int pin ;
|
||||||
@@ -706,6 +769,7 @@ static void readallPhys(int model, int UNU rev, int physPin, const char *physNam
|
|||||||
case MODEL_ODROID_N2:
|
case MODEL_ODROID_N2:
|
||||||
case MODEL_ODROID_C4:
|
case MODEL_ODROID_C4:
|
||||||
case MODEL_ODROID_M1:
|
case MODEL_ODROID_M1:
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
printf (" | %2d | %5s", getDrive(pin), pupd[getPUPD(pin)]);
|
printf (" | %2d | %5s", getDrive(pin), pupd[getPUPD(pin)]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -748,6 +812,7 @@ static void readallPhys(int model, int UNU rev, int physPin, const char *physNam
|
|||||||
case MODEL_ODROID_N2:
|
case MODEL_ODROID_N2:
|
||||||
case MODEL_ODROID_C4:
|
case MODEL_ODROID_C4:
|
||||||
case MODEL_ODROID_M1:
|
case MODEL_ODROID_M1:
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
printf (" | %-5s | %-2d", pupd[getPUPD(pin)], getDrive(pin));
|
printf (" | %-5s | %-2d", pupd[getPUPD(pin)], getDrive(pin));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -970,6 +1035,10 @@ void doReadall(int argc, char *argv[]) {
|
|||||||
headerName = (isAll == FALSE) ? "--- M1 ---" : "---- Model ODROID-M1 ----";
|
headerName = (isAll == FALSE) ? "--- M1 ---" : "---- Model ODROID-M1 ----";
|
||||||
physNames = (char *) ((isAll == FALSE) ? physNamesOdroidM1 : physNamesOdroidM1All);
|
physNames = (char *) ((isAll == FALSE) ? physNamesOdroidM1 : physNamesOdroidM1All);
|
||||||
break;
|
break;
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
|
headerName = (isAll == FALSE) ? " M1S " : " Model ODROID-M1S ";
|
||||||
|
physNames = (char *) ((isAll == FALSE) ? physNamesOdroidM1S : physNamesOdroidM1SAll);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf("Oops - unknown model: %d\n", model);
|
printf("Oops - unknown model: %d\n", model);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ libwiringPi_la_SOURCES = \
|
|||||||
odroidc4.c \
|
odroidc4.c \
|
||||||
odroidhc4.c \
|
odroidhc4.c \
|
||||||
odroidm1.c \
|
odroidm1.c \
|
||||||
|
odroidm1s.c \
|
||||||
odroidn1.c \
|
odroidn1.c \
|
||||||
odroidn2.c \
|
odroidn2.c \
|
||||||
odroidxu3.c \
|
odroidxu3.c \
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void init_odroidm1 (struct libodroid *libwiring);
|
extern void init_odroidm1 (struct libodroid *libwiring);
|
||||||
|
extern void init_odroidm1s (struct libodroid *libwiring);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
1602
wiringPi/odroidm1s.c
Normal file
1602
wiringPi/odroidm1s.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -64,6 +64,7 @@ const char *piModelNames [16] =
|
|||||||
"ODROID-C4",
|
"ODROID-C4",
|
||||||
"ODROID-HC4",
|
"ODROID-HC4",
|
||||||
"ODROID-M1",
|
"ODROID-M1",
|
||||||
|
"ODROID-M1S",
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *piRevisionNames [16] =
|
const char *piRevisionNames [16] =
|
||||||
@@ -538,6 +539,11 @@ int piGpioLayout (void) {
|
|||||||
libwiring.mem = 5;
|
libwiring.mem = 5;
|
||||||
libwiring.rev = 1;
|
libwiring.rev = 1;
|
||||||
break;
|
break;
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
|
libwiring.maker = MAKER_ROCKCHIP;
|
||||||
|
libwiring.mem = 5;
|
||||||
|
libwiring.rev = 1;
|
||||||
|
break;
|
||||||
case MODEL_UNKNOWN:
|
case MODEL_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
libwiring.model = MAKER_UNKNOWN;
|
libwiring.model = MAKER_UNKNOWN;
|
||||||
@@ -1260,6 +1266,9 @@ int wiringPiSetup (void)
|
|||||||
case MODEL_ODROID_M1:
|
case MODEL_ODROID_M1:
|
||||||
init_odroidm1(&libwiring);
|
init_odroidm1(&libwiring);
|
||||||
break;
|
break;
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
|
init_odroidm1s(&libwiring);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return wiringPiFailure (WPI_ALMOST,
|
return wiringPiFailure (WPI_ALMOST,
|
||||||
"wiringPiSetup: Unknown model\n");
|
"wiringPiSetup: Unknown model\n");
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
#define MODEL_ODROID_C4 6
|
#define MODEL_ODROID_C4 6
|
||||||
#define MODEL_ODROID_HC4 7
|
#define MODEL_ODROID_HC4 7
|
||||||
#define MODEL_ODROID_M1 8
|
#define MODEL_ODROID_M1 8
|
||||||
|
#define MODEL_ODROID_M1S 9
|
||||||
|
|
||||||
#define MAKER_UNKNOWN 0
|
#define MAKER_UNKNOWN 0
|
||||||
#define MAKER_AMLOGIC 1
|
#define MAKER_AMLOGIC 1
|
||||||
|
|||||||
@@ -267,6 +267,9 @@ int wiringPiI2CSetup (const int devId)
|
|||||||
else
|
else
|
||||||
device = "/dev/i2c-2";
|
device = "/dev/i2c-2";
|
||||||
break;
|
break;
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
|
device = "/dev/i2c-0";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return wiringPiI2CSetupInterface (device, devId) ;
|
return wiringPiI2CSetupInterface (device, devId) ;
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ int wiringPiSPISetupMode (int channel, int speed, int mode)
|
|||||||
case MODEL_ODROID_N2:
|
case MODEL_ODROID_N2:
|
||||||
case MODEL_ODROID_C4:
|
case MODEL_ODROID_C4:
|
||||||
case MODEL_ODROID_M1:
|
case MODEL_ODROID_M1:
|
||||||
|
case MODEL_ODROID_M1S:
|
||||||
sprintf(device, "%s%d", spiDevType0, channel);
|
sprintf(device, "%s%d", spiDevType0, channel);
|
||||||
break;
|
break;
|
||||||
case MODEL_ODROID_XU3:
|
case MODEL_ODROID_XU3:
|
||||||
|
|||||||
Reference in New Issue
Block a user