Skip to content

Add BananaPi-BIT Development Board Support #1810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2249,3 +2249,46 @@ wipy3.menu.DebugLevel.debug=Debug
wipy3.menu.DebugLevel.debug.build.code_debug=4
wipy3.menu.DebugLevel.verbose=Verbose
wipy3.menu.DebugLevel.verbose.build.code_debug=5

##############################################################

bpi-bit.name=BPI-BIT

bpi-bit.upload.tool=esptool
bpi-bit.upload.maximum_size=1310720
bpi-bit.upload.maximum_data_size=294912
bpi-bit.upload.wait_for_upload_port=true

bpi-bit.serial.disableDTR=true
bpi-bit.serial.disableRTS=true

bpi-bit.build.mcu=esp32
bpi-bit.build.core=esp32
bpi-bit.build.variant=bpi-bit
bpi-bit.build.board=BPI-BIT

bpi-bit.build.f_cpu=160000000L
bpi-bit.build.flash_mode=dio
bpi-bit.build.flash_size=4MB
bpi-bit.build.boot=dio
bpi-bit.build.partitions=default

bpi-bit.menu.FlashFreq.80=80MHz
bpi-bit.menu.FlashFreq.80.build.flash_freq=80m
bpi-bit.menu.FlashFreq.40=40MHz
bpi-bit.menu.FlashFreq.40.build.flash_freq=40m

bpi-bit.menu.UploadSpeed.921600=921600
bpi-bit.menu.UploadSpeed.921600.upload.speed=921600
bpi-bit.menu.UploadSpeed.115200=115200
bpi-bit.menu.UploadSpeed.115200.upload.speed=115200
bpi-bit.menu.UploadSpeed.256000.windows=256000
bpi-bit.menu.UploadSpeed.256000.upload.speed=256000
bpi-bit.menu.UploadSpeed.230400.windows.upload.speed=256000
bpi-bit.menu.UploadSpeed.230400=230400
bpi-bit.menu.UploadSpeed.230400.upload.speed=230400
bpi-bit.menu.UploadSpeed.460800.linux=460800
bpi-bit.menu.UploadSpeed.460800.macosx=460800
bpi-bit.menu.UploadSpeed.460800.upload.speed=460800
bpi-bit.menu.UploadSpeed.512000.windows=512000
bpi-bit.menu.UploadSpeed.512000.upload.speed=512000
63 changes: 63 additions & 0 deletions variants/bpi-bit/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This define is used to convert from A[n] to gpio pin. Since you are choosing not to define analog input pins should you change both NUM_ANALOG_INPUTS and analogInputtoDigitalPin() to reflect this choice?

#define NUM_ANALOG_INPUTS 0
#define analogInputToDigitalPin(p) -1

Chuck.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the definition here can be retained, because we not only have to consider the primary users, but also the people with certain Arduino and ESP32 programming development foundations, they can not use our prepared P(n) in their own code , from the line definition A (n) such a pin, and, our board does not give up the ADC function.

#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t BUZZER = 25;

static const uint8_t BUTTON_A = 35;
static const uint8_t BUTTON_B = 27;

static const uint8_t RGB_LED = 4;
static const uint8_t RGB_LED_POWER = 2;

static const uint8_t LIGHT_SENSOR1 = 36;
static const uint8_t LIGHT_SENSOR2 = 39;

static const uint8_t TEMPERATURE_SENSOR = 34;

static const uint8_t MPU9250_AD0 = 0;

static const uint8_t TX = 1;
static const uint8_t RX = 3;

static const uint8_t SDA = 21;
static const uint8_t SCL = 22;

static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 23;

static const uint8_t P0 = 25;
static const uint8_t P1 = 32;
static const uint8_t P2 = 33;
static const uint8_t P3 = 13;
static const uint8_t P4 = 15;
static const uint8_t P5 = 35;
static const uint8_t P6 = 12;
static const uint8_t P7 = 14;
static const uint8_t P8 = 16;
static const uint8_t P9 = 17;
static const uint8_t P10 = 26;
static const uint8_t P11 = 27;
static const uint8_t P12 = 2;
static const uint8_t P13 = 18;
static const uint8_t P14 = 19;
static const uint8_t P15 = 23;
static const uint8_t P16 = 5;
static const uint8_t P19 = 22;
static const uint8_t P20 = 21;

static const uint8_t DAC1 = 26;
static const uint8_t DAC2 = 25;

#endif /* Pins_Arduino_h */