19 Commits

Author SHA1 Message Date
bigbits
85c0d7d24e release new version 2019-10-12 09:27:11 +08:00
Bits
31fa216fd0 Merge pull request #58 from vanvuongngo/patch-1
prettier drawline.ino example
2019-10-11 12:10:23 +08:00
Van Vuong Ngo
4dd21db55e prettier 2019-10-11 06:07:55 +02:00
Bits
6f7873a49c Merge pull request #57 from vanvuongngo/patch-1
outputs values as formatted strings
2019-10-10 11:40:56 +08:00
Van Vuong Ngo
4f5585a0dd outputs values as formatted strings 2019-10-10 05:31:11 +02:00
Bits
485cf192ba Merge pull request #55 from richardclli/fix-compile-error
Added quotes in library path to fix sketch compile error
2019-09-30 18:52:14 +08:00
Richard Li
2570fd3b5a Added quotes in library path to fix sketch compile error when Windows username has space. 2019-09-30 11:10:20 +08:00
Bits
3ffdbe9768 Merge pull request #41 from majenkotech/master
Fix module path for non-windows OS
2019-09-13 12:04:09 +08:00
Bits
d19982e248 Merge pull request #43 from sajattack/patch-1
Fix Issue #33
2019-09-13 12:03:47 +08:00
Bits
a8a5e39e9e Merge pull request #39 from iZhangHui/master
fix issue #38
2019-09-13 12:03:25 +08:00
Bits
4fad772219 Merge pull request #45 from lamloei/patch-2
Create pins_arduino.h
2019-08-07 11:44:56 +08:00
Bits
546dc5e894 Merge pull request #44 from lamloei/patch-1
Update boards.txt
2019-08-07 11:44:43 +08:00
lamloei
5d85ca78a3 Create pins_arduino.h
ADD LamLoei AIoT DaaN
2019-08-04 00:34:05 +07:00
lamloei
a241ae41a7 Update boards.txt
ADD LamLoei AIoT DaaN Board
2019-08-04 00:31:46 +07:00
Paul
1eb49c57da Fix Issue #33 2019-08-02 17:13:33 -04:00
Majenko Technologies
db7a98b893 Fix module path for non-windows OS
`/` is the universal path separator. `\` is specific to Windows. Other OSes don't understand `\`
2019-07-31 23:22:13 +01:00
Henry Zhang
9b2f110f0b fix bug of SD init failed 2019-07-31 11:19:25 +08:00
Henry Zhang
99ab059752 Keep Maixduino board backward compatibility 2019-07-31 11:18:28 +08:00
Bits
7d66935095 Maixduino board can use tx led to run blink #36 2019-07-30 13:12:44 +08:00
10 changed files with 186 additions and 49 deletions

4
.gitmodules vendored
View File

@@ -10,6 +10,6 @@
[submodule "libraries/lv_arduino"]
path = libraries/lv_arduino
url = https://github.com/btx000/lv_arduino.git
[submodule "libraries\\lv_maixduino"]
path = libraries\\lv_maixduino
[submodule "libraries/lv_maixduino"]
path = libraries/lv_maixduino
url = https://github.com/littlevgl/lv_maixduino.git

View File

@@ -48,7 +48,7 @@ m1.upload.tool=kflash
## Limit is the 16MB Flash. Assume half is used for something else.
m1.upload.maximum_size=8388608
m1.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
m1.build.ldscript="{runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld"
##################################################
############# Sipeed Maix Bit Board ###############
@@ -95,7 +95,7 @@ bit.upload.tool=kflash
## Limit is the 16MB Flash. Assume half is used for something else.
bit.upload.maximum_size=8388608
bit.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
bit.build.ldscript="{runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld"
##################################################
@@ -140,7 +140,7 @@ bitm.upload.tool=kflash
## Limit is the 16MB Flash. Assume half is used for something else.
bitm.upload.maximum_size=8388608
bitm.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
bitm.build.ldscript="{runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld"
@@ -191,7 +191,7 @@ go.upload.tool=kflash
## Limit is the 16MB Flash. Assume half is used for something else.
go.upload.maximum_size=8388608
go.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
go.build.ldscript="{runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld"
##################################################
############# Sipeed Maixduino Board ###############
@@ -236,4 +236,51 @@ mduino.upload.tool=kflash
## Limit is the 16MB Flash. Assume half is used for something else.
mduino.upload.maximum_size=8388608
mduino.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
mduino.build.ldscript="{runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld"
##################################################
############# LamLoei AIoT DaaN Board ###############
aiotdaan.name=LamLoei AIoT DaaN Board
## Toolchain
aiotdaan.menu.toolsloc.default=Default
aiotdaan.menu.toolsloc.default.compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
## CPU Clock
aiotdaan.menu.clksrc.400=400MHz CPU Clock Frequency
aiotdaan.menu.clksrc.500=500MHz CPU Clock Frequency
aiotdaan.menu.clksrc.600=600MHz CPU Clock Frequency
aiotdaan.menu.clksrc.400.build.f_cpu=400000000L
aiotdaan.menu.clksrc.500.build.f_cpu=500000000L
aiotdaan.menu.clksrc.600.build.f_cpu=600000000L
## Burn baud rate
aiotdaan.menu.burn_baudrate.2000000=2 Mbps
aiotdaan.menu.burn_baudrate.1500000=1.5 Mbps
aiotdaan.menu.burn_baudrate.1000000=1 Mbps
aiotdaan.menu.burn_baudrate.2000000.build.burn_baudrate=2000000
aiotdaan.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
aiotdaan.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
## Burn tool firmware
aiotdaan.menu.burn_tool_firmware.dan=Default
aiotdaan.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
## Point to the file for ./variants/<variant>/pins_arduino.h
aiotdaan.build.variant=lamloei_aiot_daan
## "The 'core' file directory for this board, in ./cores
aiotdaan.build.core=arduino
## This sets a define for use in the compiled code.
aiotdaan.build.board=BOARD_SIPEED_MAIX_ONE_DOCK
aiotdaan.build.sdata.size=512
## This selects the tool from "programmers.txt"
aiotdaan.program.tool=kflash
aiotdaan.upload.tool=kflash
## Limit is the 16MB Flash. Assume half is used for something else.
aiotdaan.upload.maximum_size=8388608
aiotdaan.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld

View File

@@ -76,7 +76,7 @@ public:
* e.g. two RED pixel: {0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}
*/
virtual uint8_t* getRGB888(){ return nullptr; };
virtual void setRotaion(uint8_t rotation) = 0;
virtual void setRotation(uint8_t rotation) = 0;
virtual void setInvert(bool invert) = 0;

View File

@@ -1,27 +1,39 @@
#include <MSA300.h>
#include <Wire.h>
// This is the length of the string that will be created
// included minus and decimal point
const signed char formattedStringLength = 11;
// The number of digits after the deimal point to print
const unsigned char numVarsAfterDecimal = 6;
acc_t data;
MSA300 msa;
void setup() {
// put your setup code here, to run once:
static char outstr[formattedStringLength];
char * formatValue(float value)
{
dtostrf(value, formattedStringLength, numVarsAfterDecimal, outstr);
return outstr;
}
void setup()
{
Serial.begin(9600);
Wire.begin();
msa.begin();
}
void loop() {
// put your main code here, to run repeatedly:
void loop()
{
data = msa.getAcceleration();
Serial.print("Xa:");
Serial.print(data.x);
Serial.print("Ya:");
Serial.print(data.y);
Serial.print("Za:");
Serial.println(data.z);
Serial.printf("Xa:%s ", formatValue(data.x));
Serial.printf("Ya:%s ", formatValue(data.y));
Serial.printf("Za:%s", formatValue(data.z));
Serial.println();
delay(100);
}

View File

@@ -20,7 +20,7 @@ void setup()
pinMode(key, INPUT);
lcd.begin(15000000, COLOR_RED);
touchscreen.begin();
touchscreen.calibrate(320,240);
touchscreen.calibrate(320, 240);
}
void loop()
@@ -29,20 +29,16 @@ void loop()
touchscreen_status = touchscreen.getStatus();
touchscreen_x = touchscreen.getX();
touchscreen_y = touchscreen.getY();
if(draw){
if (draw) {
lcd.writeLine(x_last,y_last,touchscreen_x,touchscreen_y,COLOR_WHITE);
}
if(status_last!=touchscreen_status){
if (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE)
draw = true;
else
draw = false;
status_last=touchscreen_status;
if (status_last != touchscreen_status) {
draw = (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE);
status_last = touchscreen_status;
}
x_last = touchscreen_x;
y_last = touchscreen_y;
if(digitalRead(key) == LOW)
{
if (digitalRead(key) == LOW) {
lcd.fillScreen(COLOR_BLACK);
}
}

View File

@@ -252,18 +252,9 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
uint32_t arg;
// set pin modes
//#ifdef BOARD_SIPEED_MAIXDUINO
int gpionum = get_gpio(chipSelectPin_);
if(gpionum >= 0){
fpioa_function_t function = fpioa_function_t(FUNC_GPIOHS0 + gpionum);
fpioa_set_function(chipSelectPin_, function);
gpiohs_set_drive_mode((uint8_t)gpionum, GPIO_DM_OUTPUT);
gpiohs_set_pin((uint8_t)gpionum, GPIO_PV_HIGH);
}
//#else
// pinMode(chipSelectPin_, OUTPUT);
// digitalWrite(chipSelectPin_, HIGH);
//#endif
pinMode(chipSelectPin_, OUTPUT);
digitalWrite(chipSelectPin_, HIGH);
#ifndef USE_SPI_LIB
pinMode(SPI_MISO_PIN, INPUT);
pinMode(SPI_MOSI_PIN, OUTPUT);

View File

@@ -1,6 +1,6 @@
{
"name": "framework-maixduino",
"description": "Arduino Wiring-based Framework (K210 Core)",
"version": "0.3.10",
"version": "0.3.11",
"url": "https://github.com/sipeed/Maixduino"
}

View File

@@ -1,5 +1,5 @@
name=Maixduino
version=0.3.10
version=0.3.11
# arch
arch=k210

View File

@@ -0,0 +1,91 @@
#ifndef _VARIANT_LAMLOEI_AIOT_DAAN
#define _VARIANT_LAMLOEI_AIOT_DAAN
#include <stdint.h>
#define RISCV
#include "platform.h"
#include "Arduino.h"
#include "pwm.h"
#ifdef __cplusplus
#include "UARTClass.h"
extern class UARTHSClass Serial;
extern class UARTClass Serial1;
extern class UARTClass Serial2;
extern class UARTClass Serial3;
#endif
/* BOARD PIN DEFINE */
/* LEDs */
#define PIN_LED_GREEN 13
#define PIN_LED_BLUE 12
#define PIN_LED_RED 14
#define PIN_LED 13
#define LED_BUILTIN 13
#define LED_GREEN 13
#define LED_BLUE 12
#define LED_RED 14
/* KEY */
#define KEY0 16
/* MIC ARRAY */
#define MIC_BCK 18
#define MIC_WS 19
#define MIC_DAT3 20
#define MIC_DAT2 21
#define MIC_DAT1 22
#define MIC_DAT0 23
#define MIC_LED_DAT 24
/* SPI0 */
#define SPI0_CS1 25
#define SPI0_MISO 26
#define SPI0_SCLK 27
#define SPI0_MOSI 28
#define SPI0_CS0 29
/* I2S */
#define MIC0_WS 30
#define MIC0_DATA 31
#define MIC0_BCK 32
#define I2S_WS 33
#define I2S_DA 34
#define I2S_BCK 35
/* LCD */
#define LCD_CS 36
#define LCD_RST 37
#define LCD_DC 38
#define LCD_WR 39
#define RX0 4
#define TX0 5
#define RX1 6
#define TX1 7
#define SDA 31
#define SCL 30
#define MD_PIN_MAP(fpio) (fpio)
#define ORG_PIN_MAP(org_pin) (org_pin)
static const uint8_t SS = SPI0_CS0 ;
static const uint8_t MOSI = SPI0_MOSI;
static const uint8_t MISO = SPI0_MISO;
static const uint8_t SCK = SPI0_SCLK;
typedef struct _pwm_fpio_set_t{
pwm_channel_number_t channel;
pwm_device_number_t device;
uint8_t inuse;
}pwm_fpio_set_t;
#define VARIANT_NUM_GPIOHS (32)
#define VARIANT_NUM_GPIO ( 8)
#define VARIANT_NUM_PWM (12)
#define VARIANT_NUM_I2C ( 3)
#define VARIANT_NUM_SPI ( 3)
#define VARIANT_NUM_UART ( 3)
#endif

View File

@@ -18,9 +18,9 @@ extern class UARTClass Serial3;
#endif
/* BOARD PIN DEFINE */
/* LEDs */
#define PIN_LED 13
#define LED_BUILTIN 13
/* LEDs (USE Builtin TX PIN led)*/
#define PIN_LED 1
#define LED_BUILTIN 1
/* KEY */
#define KEY0 16
@@ -71,7 +71,7 @@ typedef struct _pwm_fpio_set_t{
uint8_t inuse;
}pwm_fpio_set_t;
#define MD_PIN_MAP(fpio) _maixduino_pin_map[(fpio)]
#define MD_PIN_MAP(fpio) (((fpio) < 17) ? _maixduino_pin_map[(fpio)] : (fpio))
static const uint8_t _maixduino_pin_map[17] = {4, 5, 21, 22, 23, 24, 32, 15, 14, 13, 12, 11, 10, 3, 31, 30, 16};