support BPI-M2U

This commit is contained in:
MikuQ 2017-01-01 13:23:03 +08:00
parent aed5fa5a27
commit 686d90a2c1
12 changed files with 25 additions and 4 deletions

View File

@ -30,7 +30,7 @@ const char *i2cDevices[3] =
"/dev/i2c-2"
} ;
const char *piModelNames [7] =
const char *piModelNames [9] =
{
"Unknown",
"BPI-M1",
@ -39,9 +39,10 @@ const char *piModelNames [7] =
"BPI-M1+",
"BPI-M3",
"BPI-M2+",
"BPI-M2U",
} ;
const char *piModelFullNames [7] =
const char *piModelFullNames [9] =
{
"Unknown",
"BananaPi-M1",
@ -50,6 +51,7 @@ const char *piModelFullNames [7] =
"BananaPi-M1+",
"BananaPi-M3",
"BananaPi-M2+",
"BananaPi-M2U",
} ;
int MikuPiDebug = FALSE;
@ -88,6 +90,14 @@ static int wPinToGpioM3 [32] =
204,132,205,133, 146,147,227,226
} ;
static int wPinToGpioM2u [32] =
{
276,273,277,249, 272,250,251,35,
53,52,87,248, 64,65,66,274,
275,-1,-1,-1, -1,224,225,226,
227,228,116,231, 230,229,257,256
} ;
const int bPinTowPin[41] =
{
-1, // 0
@ -225,6 +235,12 @@ void piBoardId(int *model, int *mem)
*model = PI_MODEL_M3;
*mem = 2048;
}
if (strstr(line,"sun8iw11p1") != NULL)
{
//R40-M2U
*model = PI_MODEL_M2u;
*mem = 2048;
}
if (MikuPiDebug)
{
printf ("Hardware:%s\n",line) ;
@ -303,6 +319,10 @@ void mikuPiSetup (void)
wPinToGpio=wPinToGpioM2p;
i2cDevice=(char *)i2cDevices[0];
}
if (model == PI_MODEL_M2u) {
wPinToGpio=wPinToGpioM2u;
i2cDevice=(char *)i2cDevices[2];
}
if (model == PI_MODEL_M3) {
wPinToGpio=wPinToGpioM3;
i2cDevice=(char *)i2cDevices[2];

View File

@ -28,14 +28,15 @@
#define PI_MODEL_M1p 4
#define PI_MODEL_M3 5
#define PI_MODEL_M2p 6
#define PI_MODEL_M2u 7
extern char *i2cDevice;
extern const int bPinTowPin[41];
#define VERSION "0.31"
extern const char *piModelNames [7] ;
extern const char *piModelFullNames [7];
extern const char *piModelNames [9] ;
extern const char *piModelFullNames [9];
void delay (unsigned int howLong);

0
boards/bpi-m2u.h Executable file
View File

BIN
examples/apple Executable file

Binary file not shown.

BIN
examples/arg_oled Executable file

Binary file not shown.

BIN
examples/blink Executable file

Binary file not shown.

BIN
examples/blink-qubot Executable file

Binary file not shown.

BIN
examples/oled Executable file

Binary file not shown.

BIN
examples/oled_text Executable file

Binary file not shown.

BIN
examples/pwmtest Executable file

Binary file not shown.

BIN
examples/relay Executable file

Binary file not shown.

BIN
examples/sht2x Executable file

Binary file not shown.