mirror of
https://github.com/sipeed/Maixduino.git
synced 2026-03-24 02:46:59 +01:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85c0d7d24e | ||
|
|
31fa216fd0 | ||
|
|
4dd21db55e | ||
|
|
6f7873a49c | ||
|
|
4f5585a0dd | ||
|
|
485cf192ba | ||
|
|
2570fd3b5a | ||
|
|
3ffdbe9768 | ||
|
|
d19982e248 | ||
|
|
a8a5e39e9e | ||
|
|
4fad772219 | ||
|
|
546dc5e894 | ||
|
|
5d85ca78a3 | ||
|
|
a241ae41a7 | ||
|
|
1eb49c57da | ||
|
|
db7a98b893 | ||
|
|
9b2f110f0b | ||
|
|
99ab059752 | ||
|
|
7d66935095 | ||
|
|
18164baf25 | ||
|
|
656abee8aa | ||
|
|
240bb27d0b | ||
|
|
b47d512182 | ||
|
|
ba0fd67e4e | ||
|
|
98756e8832 | ||
|
|
e75526f51f | ||
|
|
363b2bade7 | ||
|
|
b6da4a0466 | ||
|
|
25d62719d4 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -10,3 +10,6 @@
|
|||||||
[submodule "libraries/lv_arduino"]
|
[submodule "libraries/lv_arduino"]
|
||||||
path = libraries/lv_arduino
|
path = libraries/lv_arduino
|
||||||
url = https://github.com/btx000/lv_arduino.git
|
url = https://github.com/btx000/lv_arduino.git
|
||||||
|
[submodule "libraries/lv_maixduino"]
|
||||||
|
path = libraries/lv_maixduino
|
||||||
|
url = https://github.com/littlevgl/lv_maixduino.git
|
||||||
|
|||||||
105
boards.txt
105
boards.txt
@@ -48,7 +48,7 @@ m1.upload.tool=kflash
|
|||||||
|
|
||||||
## Limit is the 16MB Flash. Assume half is used for something else.
|
## Limit is the 16MB Flash. Assume half is used for something else.
|
||||||
m1.upload.maximum_size=8388608
|
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 ###############
|
############# Sipeed Maix Bit Board ###############
|
||||||
@@ -95,7 +95,53 @@ bit.upload.tool=kflash
|
|||||||
|
|
||||||
## Limit is the 16MB Flash. Assume half is used for something else.
|
## Limit is the 16MB Flash. Assume half is used for something else.
|
||||||
bit.upload.maximum_size=8388608
|
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"
|
||||||
|
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
############# Sipeed Maix Bit with Mic Board ###############
|
||||||
|
|
||||||
|
bitm.name=Sipeed Maix Bit-Mic Board
|
||||||
|
|
||||||
|
## Toolchain
|
||||||
|
bitm.menu.toolsloc.default=Default
|
||||||
|
bitm.menu.toolsloc.default.compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
|
||||||
|
|
||||||
|
## CPU Clock
|
||||||
|
bitm.menu.clksrc.400=400MHz CPU Clock Frequency
|
||||||
|
bitm.menu.clksrc.500=500MHz CPU Clock Frequency
|
||||||
|
bitm.menu.clksrc.600=600MHz CPU Clock Frequency
|
||||||
|
bitm.menu.clksrc.400.build.f_cpu=400000000L
|
||||||
|
bitm.menu.clksrc.500.build.f_cpu=500000000L
|
||||||
|
bitm.menu.clksrc.600.build.f_cpu=600000000L
|
||||||
|
|
||||||
|
## Burn baud rate
|
||||||
|
bitm.menu.burn_baudrate.1500000=1.5 Mbps
|
||||||
|
bitm.menu.burn_baudrate.1000000=1 Mbps
|
||||||
|
bitm.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
|
||||||
|
bitm.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
|
||||||
|
|
||||||
|
## Burn tool firmware
|
||||||
|
bitm.menu.burn_tool_firmware.bitm=Default
|
||||||
|
bitm.menu.burn_tool_firmware.bitm.build.burn_tool_firmware=bit-mic
|
||||||
|
|
||||||
|
## Point to the file for ./variants/<variant>/pins_arduino.h
|
||||||
|
bitm.build.variant=sipeed_maix_bit_mic
|
||||||
|
|
||||||
|
## "The 'core' file directory for this board, in ./cores
|
||||||
|
bitm.build.core=arduino
|
||||||
|
|
||||||
|
## This sets a define for use in the compiled code.
|
||||||
|
bitm.build.board=BOARD_SIPEED_MAIX_BIT
|
||||||
|
bitm.build.sdata.size=512
|
||||||
|
|
||||||
|
## This selects the tool from "programmers.txt"
|
||||||
|
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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
@@ -145,7 +191,7 @@ go.upload.tool=kflash
|
|||||||
|
|
||||||
## Limit is the 16MB Flash. Assume half is used for something else.
|
## Limit is the 16MB Flash. Assume half is used for something else.
|
||||||
go.upload.maximum_size=8388608
|
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 ###############
|
############# Sipeed Maixduino Board ###############
|
||||||
@@ -171,8 +217,8 @@ mduino.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
|
|||||||
mduino.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
|
mduino.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
|
||||||
|
|
||||||
## Burn tool firmware
|
## Burn tool firmware
|
||||||
mduino.menu.burn_tool_firmware.dan=Default
|
mduino.menu.burn_tool_firmware.mduino=Default
|
||||||
mduino.menu.burn_tool_firmware.dan.build.burn_tool_firmware=goE
|
mduino.menu.burn_tool_firmware.mduino.build.burn_tool_firmware=maixduino
|
||||||
|
|
||||||
## Point to the file for ./variants/<variant>/pins_arduino.h
|
## Point to the file for ./variants/<variant>/pins_arduino.h
|
||||||
mduino.build.variant=sipeed_maixduino
|
mduino.build.variant=sipeed_maixduino
|
||||||
@@ -190,4 +236,51 @@ mduino.upload.tool=kflash
|
|||||||
|
|
||||||
## Limit is the 16MB Flash. Assume half is used for something else.
|
## Limit is the 16MB Flash. Assume half is used for something else.
|
||||||
mduino.upload.maximum_size=8388608
|
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
|
||||||
|
|||||||
Submodule cores/arduino/kendryte-standalone-sdk updated: 9add324a05...1d52a1aaa0
@@ -76,7 +76,7 @@ public:
|
|||||||
* e.g. two RED pixel: {0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}
|
* e.g. two RED pixel: {0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00}
|
||||||
*/
|
*/
|
||||||
virtual uint8_t* getRGB888(){ return nullptr; };
|
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;
|
virtual void setInvert(bool invert) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,39 @@
|
|||||||
#include <MSA300.h>
|
#include <MSA300.h>
|
||||||
#include <Wire.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;
|
acc_t data;
|
||||||
MSA300 msa;
|
MSA300 msa;
|
||||||
|
|
||||||
void setup() {
|
static char outstr[formattedStringLength];
|
||||||
// put your setup code here, to run once:
|
|
||||||
|
char * formatValue(float value)
|
||||||
|
{
|
||||||
|
dtostrf(value, formattedStringLength, numVarsAfterDecimal, outstr);
|
||||||
|
return outstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup()
|
||||||
|
{
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
msa.begin();
|
msa.begin();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop()
|
||||||
// put your main code here, to run repeatedly:
|
{
|
||||||
data = msa.getAcceleration();
|
data = msa.getAcceleration();
|
||||||
Serial.print("Xa:");
|
|
||||||
Serial.print(data.x);
|
Serial.printf("Xa:%s ", formatValue(data.x));
|
||||||
Serial.print("Ya:");
|
Serial.printf("Ya:%s ", formatValue(data.y));
|
||||||
Serial.print(data.y);
|
Serial.printf("Za:%s", formatValue(data.z));
|
||||||
Serial.print("Za:");
|
Serial.println();
|
||||||
Serial.println(data.z);
|
|
||||||
delay(100);
|
delay(100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ void setup()
|
|||||||
pinMode(key, INPUT);
|
pinMode(key, INPUT);
|
||||||
lcd.begin(15000000, COLOR_RED);
|
lcd.begin(15000000, COLOR_RED);
|
||||||
touchscreen.begin();
|
touchscreen.begin();
|
||||||
touchscreen.calibrate(320,240);
|
touchscreen.calibrate(320, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
@@ -29,20 +29,16 @@ void loop()
|
|||||||
touchscreen_status = touchscreen.getStatus();
|
touchscreen_status = touchscreen.getStatus();
|
||||||
touchscreen_x = touchscreen.getX();
|
touchscreen_x = touchscreen.getX();
|
||||||
touchscreen_y = touchscreen.getY();
|
touchscreen_y = touchscreen.getY();
|
||||||
if(draw){
|
if (draw) {
|
||||||
lcd.writeLine(x_last,y_last,touchscreen_x,touchscreen_y,COLOR_WHITE);
|
lcd.writeLine(x_last,y_last,touchscreen_x,touchscreen_y,COLOR_WHITE);
|
||||||
}
|
}
|
||||||
if(status_last!=touchscreen_status){
|
if (status_last != touchscreen_status) {
|
||||||
if (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE)
|
draw = (touchscreen_status == TOUCH_BEGIN || touchscreen_status == TOUCH_MOVE);
|
||||||
draw = true;
|
status_last = touchscreen_status;
|
||||||
else
|
|
||||||
draw = false;
|
|
||||||
status_last=touchscreen_status;
|
|
||||||
}
|
}
|
||||||
x_last = touchscreen_x;
|
x_last = touchscreen_x;
|
||||||
y_last = touchscreen_y;
|
y_last = touchscreen_y;
|
||||||
if(digitalRead(key) == LOW)
|
if (digitalRead(key) == LOW) {
|
||||||
{
|
|
||||||
lcd.fillScreen(COLOR_BLACK);
|
lcd.fillScreen(COLOR_BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
#define USE_SPI_LIB
|
#define USE_SPI_LIB
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "Sd2Card.h"
|
#include "Sd2Card.h"
|
||||||
|
#include "fpioa.h"
|
||||||
|
#include "gpio.h"
|
||||||
|
#include "wiring_digital.h"
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
#ifndef SOFTWARE_SPI
|
#ifndef SOFTWARE_SPI
|
||||||
#ifdef USE_SPI_LIB
|
#ifdef USE_SPI_LIB
|
||||||
@@ -251,6 +254,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
|||||||
// set pin modes
|
// set pin modes
|
||||||
pinMode(chipSelectPin_, OUTPUT);
|
pinMode(chipSelectPin_, OUTPUT);
|
||||||
digitalWrite(chipSelectPin_, HIGH);
|
digitalWrite(chipSelectPin_, HIGH);
|
||||||
|
|
||||||
#ifndef USE_SPI_LIB
|
#ifndef USE_SPI_LIB
|
||||||
pinMode(SPI_MISO_PIN, INPUT);
|
pinMode(SPI_MISO_PIN, INPUT);
|
||||||
pinMode(SPI_MOSI_PIN, OUTPUT);
|
pinMode(SPI_MOSI_PIN, OUTPUT);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include <Sipeed_OV2640.h>
|
#include <Sipeed_OV2640.h>
|
||||||
#include <Sipeed_ST7789.h>
|
#include <Sipeed_ST7789.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
SPIClass spi_(SPI0); // MUST be SPI0 for Maix series on board LCD
|
SPIClass spi_(SPI0); // MUST be SPI0 for Maix series on board LCD
|
||||||
Sipeed_ST7789 lcd(320, 240, spi_);
|
Sipeed_ST7789 lcd(320, 240, spi_);
|
||||||
@@ -10,11 +9,12 @@ Sipeed_OV2640 camera(FRAMESIZE_QVGA, PIXFORMAT_RGB565);
|
|||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
Serial.begin(115200);
|
||||||
lcd.begin(15000000, COLOR_RED);
|
lcd.begin(15000000, COLOR_RED);
|
||||||
if(!camera.begin())
|
if(!camera.begin())
|
||||||
printf("camera init fail\n");
|
Serial.printf("camera init fail\n");
|
||||||
else
|
else
|
||||||
printf("camera init success\n");
|
Serial.printf("camera init success\n");
|
||||||
camera.run(true);
|
camera.run(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ void loop()
|
|||||||
{
|
{
|
||||||
uint8_t*img = camera.snapshot();
|
uint8_t*img = camera.snapshot();
|
||||||
if(img == nullptr || img==0)
|
if(img == nullptr || img==0)
|
||||||
printf("snap fail\n");
|
Serial.printf("snap fail\n");
|
||||||
else
|
else
|
||||||
lcd.drawImage(0, 0, camera.width(), camera.height(), (uint16_t*)img);
|
lcd.drawImage(0, 0, camera.width(), camera.height(), (uint16_t*)img);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ Ticker KEYWORD1
|
|||||||
|
|
||||||
attach KEYWORD2
|
attach KEYWORD2
|
||||||
attach_ms KEYWORD2
|
attach_ms KEYWORD2
|
||||||
|
attach_us KEYWORD2
|
||||||
once KEYWORD2
|
once KEYWORD2
|
||||||
once_ms KEYWORD2
|
once_ms KEYWORD2
|
||||||
|
once_us KEYWORD2
|
||||||
detach KEYWORD2
|
detach KEYWORD2
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
|
|||||||
@@ -25,6 +25,17 @@ Ticker::_attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callb
|
|||||||
sysctl_enable_irq();
|
sysctl_enable_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Ticker::_attach_us(uint32_t microseconds, bool repeat, callback_with_arg_t callback, size_t arg)
|
||||||
|
{
|
||||||
|
user_callback = callback;
|
||||||
|
_arg = arg;
|
||||||
|
timer_set_interval(timer_device_number_t(timer_id), TIMER_CHANNEL_0, microseconds * 1000);
|
||||||
|
timer_irq_register(timer_device_number_t(timer_id), TIMER_CHANNEL_0, !repeat, 4, timer_callback, this);
|
||||||
|
timer_set_enable(timer_device_number_t(timer_id), TIMER_CHANNEL_0, 1);
|
||||||
|
sysctl_enable_irq();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Ticker::detach()
|
Ticker::detach()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ public:
|
|||||||
_attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
_attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void attach_us(uint32_t microseconds, callback_t callback)
|
||||||
|
{
|
||||||
|
_attach_us(microseconds, true, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename TArg>
|
template<typename TArg>
|
||||||
void attach(float seconds, void (*callback)(TArg), TArg arg)
|
void attach(float seconds, void (*callback)(TArg), TArg arg)
|
||||||
{
|
{
|
||||||
@@ -48,6 +53,14 @@ public:
|
|||||||
_attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), arg32);
|
_attach_ms(milliseconds, true, reinterpret_cast<callback_with_arg_t>(callback), arg32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename TArg>
|
||||||
|
void attach_us(uint32_t microseconds, void (*callback)(TArg), TArg arg)
|
||||||
|
{
|
||||||
|
configASSERT(sizeof(TArg) <= sizeof(size_t));
|
||||||
|
size_t arg32 = (size_t)arg;
|
||||||
|
_attach_us(microseconds, true, reinterpret_cast<callback_with_arg_t>(callback), arg32);
|
||||||
|
}
|
||||||
|
|
||||||
void once(float seconds, callback_t callback)
|
void once(float seconds, callback_t callback)
|
||||||
{
|
{
|
||||||
_attach_ms(seconds * 1000, false, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
_attach_ms(seconds * 1000, false, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
||||||
@@ -58,6 +71,11 @@ public:
|
|||||||
_attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
_attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void once_us(uint32_t microseconds, callback_t callback)
|
||||||
|
{
|
||||||
|
_attach_us(microseconds, false, reinterpret_cast<callback_with_arg_t>(callback), 0);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename TArg>
|
template<typename TArg>
|
||||||
void once(float seconds, void (*callback)(TArg), TArg arg)
|
void once(float seconds, void (*callback)(TArg), TArg arg)
|
||||||
{
|
{
|
||||||
@@ -74,6 +92,14 @@ public:
|
|||||||
_attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), arg32);
|
_attach_ms(milliseconds, false, reinterpret_cast<callback_with_arg_t>(callback), arg32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename TArg>
|
||||||
|
void once_us(uint32_t microseconds, void (*callback)(TArg), TArg arg)
|
||||||
|
{
|
||||||
|
configASSERT(sizeof(TArg) <= sizeof(size_t));
|
||||||
|
size_t arg32 = (size_t)(arg);
|
||||||
|
_attach_us(microseconds, false, reinterpret_cast<callback_with_arg_t>(callback), arg32);
|
||||||
|
}
|
||||||
|
|
||||||
void detach();
|
void detach();
|
||||||
bool active();
|
bool active();
|
||||||
|
|
||||||
@@ -82,6 +108,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, size_t arg);
|
void _attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, size_t arg);
|
||||||
|
void _attach_us(uint32_t microseconds, bool repeat, callback_with_arg_t callback, size_t arg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
timer_id_t timer_id;
|
timer_id_t timer_id;
|
||||||
|
|||||||
Submodule libraries/lv_arduino deleted from 3a1df1b16b
1
libraries/lv_maixduino
Submodule
1
libraries/lv_maixduino
Submodule
Submodule libraries/lv_maixduino added at 6bcae290e5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "framework-maixduino",
|
"name": "framework-maixduino",
|
||||||
"description": "Arduino Wiring-based Framework (K210 Core)",
|
"description": "Arduino Wiring-based Framework (K210 Core)",
|
||||||
"version": "0.3.9",
|
"version": "0.3.11",
|
||||||
"url": "https://github.com/sipeed/Maixduino"
|
"url": "https://github.com/sipeed/Maixduino"
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
name = Maixduino
|
name=Maixduino
|
||||||
version = 0.3.9
|
version=0.3.11
|
||||||
|
|
||||||
# arch
|
# arch
|
||||||
arch = k210
|
arch=k210
|
||||||
arch_for_c_cpp = K210
|
arch_for_c_cpp=K210
|
||||||
|
|
||||||
# Compile variables
|
# Compile variables
|
||||||
compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
|
compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
|
||||||
|
|||||||
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
|
||||||
84
variants/sipeed_maix_bit_mic/pins_arduino.h
Normal file
84
variants/sipeed_maix_bit_mic/pins_arduino.h
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#ifndef _VARIANT_SIPEED_MAIX_BIT_MIC
|
||||||
|
#define _VARIANT_SIPEED_MAIX_BIT_MIC
|
||||||
|
|
||||||
|
#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
|
||||||
|
/* 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
|
#endif
|
||||||
|
|
||||||
/* BOARD PIN DEFINE */
|
/* BOARD PIN DEFINE */
|
||||||
/* LEDs */
|
/* LEDs (USE Builtin TX PIN led)*/
|
||||||
#define PIN_LED 13
|
#define PIN_LED 1
|
||||||
#define LED_BUILTIN 13
|
#define LED_BUILTIN 1
|
||||||
|
|
||||||
/* KEY */
|
/* KEY */
|
||||||
#define KEY0 16
|
#define KEY0 16
|
||||||
@@ -71,7 +71,7 @@ typedef struct _pwm_fpio_set_t{
|
|||||||
uint8_t inuse;
|
uint8_t inuse;
|
||||||
}pwm_fpio_set_t;
|
}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};
|
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