Skip to content

Commit 0f0dd7f

Browse files
committed
Add boards.
1 parent ff02b8e commit 0f0dd7f

File tree

6 files changed

+270
-5
lines changed

6 files changed

+270
-5
lines changed

boards.txt

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ menu.toolsloc=Tool Install Location
66
##################################################
77
############# Sipeed M1 Dock Board ###############
88

9-
m1.name=Sipeed "Maix One Dock"/"Maix Bit" Board
9+
m1.name=Sipeed Maix One Dock Board
1010

1111
## Toolchain
1212
m1.menu.toolsloc.default=Default
@@ -33,7 +33,7 @@ m1.menu.burn_tool_firmware.dan=Default
3333
m1.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
3434

3535
## Point to the file for ./variants/<variant>/pins_arduino.h
36-
m1.build.variant=sipeed_maix_one
36+
m1.build.variant=sipeed_maix_one_dock
3737

3838
## "The 'core' file directory for this board, in ./cores
3939
m1.build.core=arduino
@@ -50,6 +50,53 @@ m1.upload.tool=kflash
5050
m1.upload.maximum_size=8388608
5151
m1.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
5252

53+
##################################################
54+
############# Sipeed Maix Bit Board ###############
55+
56+
bit.name=Sipeed Maix Bit Board
57+
58+
## Toolchain
59+
bit.menu.toolsloc.default=Default
60+
bit.menu.toolsloc.default.compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
61+
62+
## CPU Clock
63+
bit.menu.clksrc.400=400MHz CPU Clock Frequency
64+
bit.menu.clksrc.500=500MHz CPU Clock Frequency
65+
bit.menu.clksrc.600=600MHz CPU Clock Frequency
66+
bit.menu.clksrc.400.build.f_cpu=400000000L
67+
bit.menu.clksrc.500.build.f_cpu=500000000L
68+
bit.menu.clksrc.600.build.f_cpu=600000000L
69+
70+
## Burn baud rate
71+
bit.menu.burn_baudrate.2000000=2 Mbps
72+
bit.menu.burn_baudrate.1500000=1.5 Mbps
73+
bit.menu.burn_baudrate.1000000=1 Mbps
74+
bit.menu.burn_baudrate.2000000.build.burn_baudrate=2000000
75+
bit.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
76+
bit.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
77+
78+
## Burn tool firmware
79+
bit.menu.burn_tool_firmware.dan=Default
80+
bit.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
81+
82+
## Point to the file for ./variants/<variant>/pins_arduino.h
83+
bit.build.variant=sipeed_maix_bit
84+
85+
## "The 'core' file directory for this board, in ./cores
86+
bit.build.core=arduino
87+
88+
## This sets a define for use in the compiled code.
89+
bit.build.board=BOARD_SIPEED_MAIX_BIT
90+
bit.build.sdata.size=512
91+
92+
## This selects the tool from "programmers.txt"
93+
bit.program.tool=kflash
94+
bit.upload.tool=kflash
95+
96+
## Limit is the 16MB Flash. Assume half is used for something else.
97+
bit.upload.maximum_size=8388608
98+
bit.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
99+
53100

54101
####################################################
55102
############### Sipeed Maix Go Board ###############
@@ -99,3 +146,50 @@ go.upload.tool=kflash
99146
## Limit is the 16MB Flash. Assume half is used for something else.
100147
go.upload.maximum_size=8388608
101148
go.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
149+
150+
##################################################
151+
############# Sipeed Maixduino Board ###############
152+
153+
mduino.name=Sipeed Maixduino Board
154+
155+
## Toolchain
156+
mduino.menu.toolsloc.default=Default
157+
mduino.menu.toolsloc.default.compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
158+
159+
## CPU Clock
160+
mduino.menu.clksrc.400=400MHz CPU Clock Frequency
161+
mduino.menu.clksrc.500=500MHz CPU Clock Frequency
162+
mduino.menu.clksrc.600=600MHz CPU Clock Frequency
163+
mduino.menu.clksrc.400.build.f_cpu=400000000L
164+
mduino.menu.clksrc.500.build.f_cpu=500000000L
165+
mduino.menu.clksrc.600.build.f_cpu=600000000L
166+
167+
## Burn baud rate
168+
mduino.menu.burn_baudrate.2000000=2 Mbps
169+
mduino.menu.burn_baudrate.1500000=1.5 Mbps
170+
mduino.menu.burn_baudrate.1000000=1 Mbps
171+
mduino.menu.burn_baudrate.2000000.build.burn_baudrate=2000000
172+
mduino.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
173+
mduino.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
174+
175+
## Burn tool firmware
176+
mduino.menu.burn_tool_firmware.dan=Default
177+
mduino.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
178+
179+
## Point to the file for ./variants/<variant>/pins_arduino.h
180+
mduino.build.variant=sipeed_maixduino
181+
182+
## "The 'core' file directory for this board, in ./cores
183+
mduino.build.core=arduino
184+
185+
## This sets a define for use in the compiled code.
186+
mduino.build.board=BOARD_SIPEED_MAIX_DUINO
187+
mduino.build.sdata.size=512
188+
189+
## This selects the tool from "programmers.txt"
190+
mduino.program.tool=kflash
191+
mduino.upload.tool=kflash
192+
193+
## Limit is the 16MB Flash. Assume half is used for something else.
194+
mduino.upload.maximum_size=8388608
195+
mduino.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld

cores/arduino/Print.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ extern "C"{
2525
#endif // __cplusplus
2626
#include <inttypes.h>
2727
#include <stdio.h> // for size_t
28+
#include <stdint.h>
29+
#include <stddef.h>
30+
#include <stdarg.h>
2831
#ifdef __cplusplus
2932
} // extern "C"
3033
#endif // __cplusplus
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#ifndef _VARIANT_SIPEED_M1_DOCK
2+
#define _VARIANT_SIPEED_M1_DOCK
3+
4+
#include <stdint.h>
5+
6+
#define RISCV
7+
#include "platform.h"
8+
9+
#include "Arduino.h"
10+
#include "pwm.h"
11+
12+
#ifdef __cplusplus
13+
#include "UARTClass.h"
14+
extern class UARTHSClass Serial;
15+
extern class UARTClass Serial1;
16+
extern class UARTClass Serial2;
17+
extern class UARTClass Serial3;
18+
#endif
19+
20+
/* BOARD PIN DEFINE */
21+
/* LEDs */
22+
#define PIN_LED_GREEN 13
23+
#define PIN_LED_BLUE 12
24+
#define PIN_LED_RED 14
25+
#define PIN_LED 13
26+
#define LED_BUILTIN 13
27+
#define LED_GREEN 13
28+
#define LED_BLUE 12
29+
#define LED_RED 14
30+
/* KEY */
31+
#define KEY0 16
32+
/* MIC ARRAY */
33+
#define MIC_BCK 18
34+
#define MIC_WS 19
35+
#define MIC_DAT3 20
36+
#define MIC_DAT2 21
37+
#define MIC_DAT1 22
38+
#define MIC_DAT0 23
39+
#define MIC_LED_DAT 24
40+
/* SPI0 */
41+
#define SPI0_CS1 25
42+
#define SPI0_MISO 26
43+
#define SPI0_SCLK 27
44+
#define SPI0_MOSI 28
45+
#define SPI0_CS0 29
46+
/* LCD */
47+
#define LCD_CS 36
48+
#define LCD_RST 37
49+
#define LCD_DC 38
50+
#define LCD_WR 39
51+
52+
#define RX0 4
53+
#define TX0 5
54+
55+
#define RX1 6
56+
#define TX1 7
57+
58+
#define SDA 31
59+
#define SCL 30
60+
61+
static const uint8_t SS = SPI0_CS0 ;
62+
static const uint8_t MOSI = SPI0_MOSI;
63+
static const uint8_t MISO = SPI0_MISO;
64+
static const uint8_t SCK = SPI0_SCLK;
65+
66+
typedef struct _pwm_fpio_set_t{
67+
pwm_channel_number_t channel;
68+
pwm_device_number_t device;
69+
uint8_t inuse;
70+
}pwm_fpio_set_t;
71+
72+
73+
74+
#define VARIANT_NUM_GPIOHS (32)
75+
#define VARIANT_NUM_GPIO ( 8)
76+
#define VARIANT_NUM_PWM (12)
77+
#define VARIANT_NUM_I2C ( 3)
78+
#define VARIANT_NUM_SPI ( 3)
79+
#define VARIANT_NUM_UART ( 3)
80+
81+
#endif

variants/sipeed_maix_go/pins_arduino.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ extern class UARTClass Serial3;
4747
#define SPI0_MOSI 28
4848
#define SPI0_CS0 29
4949
/* I2S */
50-
#define MIC0_WS 30
51-
#define MIC0_DATA 31
52-
#define MIC0_BCK 32
5350
#define I2S_WS 33
5451
#define I2S_DA 34
5552
#define I2S_BCK 35
File renamed without changes.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#ifndef _VARIANT_SIPEED_M1_DOCK
2+
#define _VARIANT_SIPEED_M1_DOCK
3+
4+
#include <stdint.h>
5+
6+
#define RISCV
7+
#include "platform.h"
8+
9+
#include "Arduino.h"
10+
#include "pwm.h"
11+
12+
#ifdef __cplusplus
13+
#include "UARTClass.h"
14+
extern class UARTHSClass Serial;
15+
extern class UARTClass Serial1;
16+
extern class UARTClass Serial2;
17+
extern class UARTClass Serial3;
18+
#endif
19+
20+
/* BOARD PIN DEFINE */
21+
/* LEDs */
22+
#define PIN_LED_GREEN 13
23+
#define PIN_LED_BLUE 12
24+
#define PIN_LED_RED 14
25+
#define PIN_LED 13
26+
#define LED_BUILTIN 13
27+
#define LED_GREEN 13
28+
#define LED_BLUE 12
29+
#define LED_RED 14
30+
/* KEY */
31+
#define KEY0 16
32+
/* MIC ARRAY */
33+
#define MIC_BCK 18
34+
#define MIC_WS 19
35+
#define MIC_DAT3 20
36+
#define MIC_DAT2 21
37+
#define MIC_DAT1 22
38+
#define MIC_DAT0 23
39+
#define MIC_LED_DAT 24
40+
/* SPI0 */
41+
#define SPI0_CS1 25
42+
#define SPI0_MISO 26
43+
#define SPI0_SCLK 27
44+
#define SPI0_MOSI 28
45+
#define SPI0_CS0 29
46+
/* I2S */
47+
#define MIC0_WS 30
48+
#define MIC0_DATA 31
49+
#define MIC0_BCK 32
50+
#define I2S_WS 33
51+
#define I2S_DA 34
52+
#define I2S_BCK 35
53+
/* LCD */
54+
#define LCD_CS 36
55+
#define LCD_RST 37
56+
#define LCD_DC 38
57+
#define LCD_WR 39
58+
59+
#define RX0 4
60+
#define TX0 5
61+
62+
#define RX1 6
63+
#define TX1 7
64+
65+
#define SDA 31
66+
#define SCL 30
67+
68+
static const uint8_t SS = SPI0_CS0 ;
69+
static const uint8_t MOSI = SPI0_MOSI;
70+
static const uint8_t MISO = SPI0_MISO;
71+
static const uint8_t SCK = SPI0_SCLK;
72+
73+
typedef struct _pwm_fpio_set_t{
74+
pwm_channel_number_t channel;
75+
pwm_device_number_t device;
76+
uint8_t inuse;
77+
}pwm_fpio_set_t;
78+
79+
static uint8_t maixduino_pin_map[14] = {4, 5, 21, 22, 23, 24, 32, 15, 14, 13, 12, 11, 10, 3};
80+
81+
uint8_t pinToFpio(uint8_t pin){ return maixduino_pin_map[pin]; }
82+
83+
#define VARIANT_NUM_GPIOHS (32)
84+
#define VARIANT_NUM_GPIO ( 8)
85+
#define VARIANT_NUM_PWM (12)
86+
#define VARIANT_NUM_I2C ( 3)
87+
#define VARIANT_NUM_SPI ( 3)
88+
#define VARIANT_NUM_UART ( 3)
89+
90+
#endif

0 commit comments

Comments
 (0)