mirror of
https://github.com/sipeed/Maixduino.git
synced 2026-03-03 09:04:00 +01:00
Add boards.
This commit is contained in:
98
boards.txt
98
boards.txt
@@ -6,7 +6,7 @@ menu.toolsloc=Tool Install Location
|
||||
##################################################
|
||||
############# Sipeed M1 Dock Board ###############
|
||||
|
||||
m1.name=Sipeed "Maix One Dock"/"Maix Bit" Board
|
||||
m1.name=Sipeed Maix One Dock Board
|
||||
|
||||
## Toolchain
|
||||
m1.menu.toolsloc.default=Default
|
||||
@@ -33,7 +33,7 @@ m1.menu.burn_tool_firmware.dan=Default
|
||||
m1.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
|
||||
|
||||
## Point to the file for ./variants/<variant>/pins_arduino.h
|
||||
m1.build.variant=sipeed_maix_one
|
||||
m1.build.variant=sipeed_maix_one_dock
|
||||
|
||||
## "The 'core' file directory for this board, in ./cores
|
||||
m1.build.core=arduino
|
||||
@@ -50,6 +50,53 @@ m1.upload.tool=kflash
|
||||
m1.upload.maximum_size=8388608
|
||||
m1.build.ldscript={runtime.platform.path}/cores/arduino/kendryte-standalone-sdk/lds/kendryte.ld
|
||||
|
||||
##################################################
|
||||
############# Sipeed Maix Bit Board ###############
|
||||
|
||||
bit.name=Sipeed Maix Bit Board
|
||||
|
||||
## Toolchain
|
||||
bit.menu.toolsloc.default=Default
|
||||
bit.menu.toolsloc.default.compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
|
||||
|
||||
## CPU Clock
|
||||
bit.menu.clksrc.400=400MHz CPU Clock Frequency
|
||||
bit.menu.clksrc.500=500MHz CPU Clock Frequency
|
||||
bit.menu.clksrc.600=600MHz CPU Clock Frequency
|
||||
bit.menu.clksrc.400.build.f_cpu=400000000L
|
||||
bit.menu.clksrc.500.build.f_cpu=500000000L
|
||||
bit.menu.clksrc.600.build.f_cpu=600000000L
|
||||
|
||||
## Burn baud rate
|
||||
bit.menu.burn_baudrate.2000000=2 Mbps
|
||||
bit.menu.burn_baudrate.1500000=1.5 Mbps
|
||||
bit.menu.burn_baudrate.1000000=1 Mbps
|
||||
bit.menu.burn_baudrate.2000000.build.burn_baudrate=2000000
|
||||
bit.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
|
||||
bit.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
|
||||
|
||||
## Burn tool firmware
|
||||
bit.menu.burn_tool_firmware.dan=Default
|
||||
bit.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
|
||||
|
||||
## Point to the file for ./variants/<variant>/pins_arduino.h
|
||||
bit.build.variant=sipeed_maix_bit
|
||||
|
||||
## "The 'core' file directory for this board, in ./cores
|
||||
bit.build.core=arduino
|
||||
|
||||
## This sets a define for use in the compiled code.
|
||||
bit.build.board=BOARD_SIPEED_MAIX_BIT
|
||||
bit.build.sdata.size=512
|
||||
|
||||
## This selects the tool from "programmers.txt"
|
||||
bit.program.tool=kflash
|
||||
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
|
||||
|
||||
|
||||
####################################################
|
||||
############### Sipeed Maix Go Board ###############
|
||||
@@ -99,3 +146,50 @@ 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
|
||||
|
||||
##################################################
|
||||
############# Sipeed Maixduino Board ###############
|
||||
|
||||
mduino.name=Sipeed Maixduino Board
|
||||
|
||||
## Toolchain
|
||||
mduino.menu.toolsloc.default=Default
|
||||
mduino.menu.toolsloc.default.compiler.path={runtime.tools.riscv64-unknown-elf-gcc.path}/bin/
|
||||
|
||||
## CPU Clock
|
||||
mduino.menu.clksrc.400=400MHz CPU Clock Frequency
|
||||
mduino.menu.clksrc.500=500MHz CPU Clock Frequency
|
||||
mduino.menu.clksrc.600=600MHz CPU Clock Frequency
|
||||
mduino.menu.clksrc.400.build.f_cpu=400000000L
|
||||
mduino.menu.clksrc.500.build.f_cpu=500000000L
|
||||
mduino.menu.clksrc.600.build.f_cpu=600000000L
|
||||
|
||||
## Burn baud rate
|
||||
mduino.menu.burn_baudrate.2000000=2 Mbps
|
||||
mduino.menu.burn_baudrate.1500000=1.5 Mbps
|
||||
mduino.menu.burn_baudrate.1000000=1 Mbps
|
||||
mduino.menu.burn_baudrate.2000000.build.burn_baudrate=2000000
|
||||
mduino.menu.burn_baudrate.1500000.build.burn_baudrate=1500000
|
||||
mduino.menu.burn_baudrate.1000000.build.burn_baudrate=1000000
|
||||
|
||||
## Burn tool firmware
|
||||
mduino.menu.burn_tool_firmware.dan=Default
|
||||
mduino.menu.burn_tool_firmware.dan.build.burn_tool_firmware=dan
|
||||
|
||||
## Point to the file for ./variants/<variant>/pins_arduino.h
|
||||
mduino.build.variant=sipeed_maixduino
|
||||
|
||||
## "The 'core' file directory for this board, in ./cores
|
||||
mduino.build.core=arduino
|
||||
|
||||
## This sets a define for use in the compiled code.
|
||||
mduino.build.board=BOARD_SIPEED_MAIX_DUINO
|
||||
mduino.build.sdata.size=512
|
||||
|
||||
## This selects the tool from "programmers.txt"
|
||||
mduino.program.tool=kflash
|
||||
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
|
||||
@@ -25,6 +25,9 @@ extern "C"{
|
||||
#endif // __cplusplus
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h> // for size_t
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
81
variants/sipeed_maix_bit/pins_arduino.h
Normal file
81
variants/sipeed_maix_bit/pins_arduino.h
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifndef _VARIANT_SIPEED_M1_DOCK
|
||||
#define _VARIANT_SIPEED_M1_DOCK
|
||||
|
||||
#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
|
||||
|
||||
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
|
||||
@@ -47,9 +47,6 @@ extern class UARTClass Serial3;
|
||||
#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
|
||||
|
||||
90
variants/sipeed_maixduino/pins_arduino.h
Normal file
90
variants/sipeed_maixduino/pins_arduino.h
Normal file
@@ -0,0 +1,90 @@
|
||||
#ifndef _VARIANT_SIPEED_M1_DOCK
|
||||
#define _VARIANT_SIPEED_M1_DOCK
|
||||
|
||||
#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
|
||||
|
||||
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;
|
||||
|
||||
static uint8_t maixduino_pin_map[14] = {4, 5, 21, 22, 23, 24, 32, 15, 14, 13, 12, 11, 10, 3};
|
||||
|
||||
uint8_t pinToFpio(uint8_t pin){ return maixduino_pin_map[pin]; }
|
||||
|
||||
#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
|
||||
Reference in New Issue
Block a user