diff --git a/MikuPi.cpp b/MikuPi.cpp index 074d6a6..49fdbd8 100755 --- a/MikuPi.cpp +++ b/MikuPi.cpp @@ -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]; diff --git a/MikuPi.h b/MikuPi.h index 918806a..3d096a8 100755 --- a/MikuPi.h +++ b/MikuPi.h @@ -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); diff --git a/boards/bpi-m2u.h b/boards/bpi-m2u.h new file mode 100755 index 0000000..e69de29 diff --git a/examples/apple b/examples/apple new file mode 100755 index 0000000..d40bdb2 Binary files /dev/null and b/examples/apple differ diff --git a/examples/arg_oled b/examples/arg_oled new file mode 100755 index 0000000..82a5d49 Binary files /dev/null and b/examples/arg_oled differ diff --git a/examples/blink b/examples/blink new file mode 100755 index 0000000..6423adc Binary files /dev/null and b/examples/blink differ diff --git a/examples/blink-qubot b/examples/blink-qubot new file mode 100755 index 0000000..2150e96 Binary files /dev/null and b/examples/blink-qubot differ diff --git a/examples/oled b/examples/oled new file mode 100755 index 0000000..8abb862 Binary files /dev/null and b/examples/oled differ diff --git a/examples/oled_text b/examples/oled_text new file mode 100755 index 0000000..2c225f4 Binary files /dev/null and b/examples/oled_text differ diff --git a/examples/pwmtest b/examples/pwmtest new file mode 100755 index 0000000..564b357 Binary files /dev/null and b/examples/pwmtest differ diff --git a/examples/relay b/examples/relay new file mode 100755 index 0000000..9e802ff Binary files /dev/null and b/examples/relay differ diff --git a/examples/sht2x b/examples/sht2x new file mode 100755 index 0000000..7ee7542 Binary files /dev/null and b/examples/sht2x differ