mirror of
https://github.com/sipeed/Maixduino.git
synced 2026-03-23 18:36:57 +01:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85c0d7d24e | ||
|
|
31fa216fd0 | ||
|
|
4dd21db55e | ||
|
|
6f7873a49c | ||
|
|
4f5585a0dd | ||
|
|
485cf192ba | ||
|
|
2570fd3b5a | ||
|
|
3ffdbe9768 | ||
|
|
d19982e248 | ||
|
|
a8a5e39e9e | ||
|
|
4fad772219 | ||
|
|
546dc5e894 | ||
|
|
5d85ca78a3 | ||
|
|
a241ae41a7 | ||
|
|
1eb49c57da | ||
|
|
db7a98b893 | ||
|
|
9b2f110f0b | ||
|
|
99ab059752 | ||
|
|
7d66935095 |
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -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
|
||||
|
||||
57
boards.txt
57
boards.txt
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
name=Maixduino
|
||||
version=0.3.10
|
||||
version=0.3.11
|
||||
|
||||
# arch
|
||||
arch=k210
|
||||
|
||||
91
variants/lamloei_aiot_daan/pins_arduino.h
Normal file
91
variants/lamloei_aiot_daan/pins_arduino.h
Normal 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
|
||||
@@ -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};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user