Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Update Packages' Patches
Browse files Browse the repository at this point in the history
  • Loading branch information
khoih-prog authored Oct 13, 2022
1 parent 73d1fbc commit 32e04fd
Show file tree
Hide file tree
Showing 12 changed files with 3,485 additions and 0 deletions.
1,730 changes: 1,730 additions & 0 deletions Packages_Patches/Fab_SAM_Arduino/hardware/samd/1.7.0/boards.txt

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions Packages_Patches/Seeeduino/hardware/rp2040/2.7.2/boards.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
menu.split=Flash split
Seeed_XIAO_RP2040.name=SEEED XIAO RP2040
Seeed_XIAO_RP2040.build.core=arduino
Seeed_XIAO_RP2040.build.crossprefix=arm-none-eabi-
Seeed_XIAO_RP2040.build.compiler_path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/

# KH fix for Linux case-sensitive path
#Seeed_XIAO_RP2040.build.variant=SEEED_XIAO_RP2040
Seeed_XIAO_RP2040.build.variant=Seeed_XIAO_RP2040
######

Seeed_XIAO_RP2040.build.mcu=cortex-m0plus
Seeed_XIAO_RP2040.build.extra_flags=
Seeed_XIAO_RP2040.build.fpu=
Seeed_XIAO_RP2040.build.float-abi=
Seeed_XIAO_RP2040.build.architecture=cortex-m0plus
Seeed_XIAO_RP2040.build.board=SEEED_XIAO_RP2040
Seeed_XIAO_RP2040.build.ldscript=linker_script.ld
Seeed_XIAO_RP2040.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
Seeed_XIAO_RP2040.compiler.mbed.defines={build.variant.path}/defines.txt
Seeed_XIAO_RP2040.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
Seeed_XIAO_RP2040.compiler.mbed.cflags={build.variant.path}/cflags.txt
Seeed_XIAO_RP2040.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
Seeed_XIAO_RP2040.compiler.mbed.includes={build.variant.path}/includes.txt
Seeed_XIAO_RP2040.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
Seeed_XIAO_RP2040.compiler.mbed="{build.variant.path}/libs/libmbed.a"
Seeed_XIAO_RP2040.vid.0=0x2886
Seeed_XIAO_RP2040.pid.0=0x8042
Seeed_XIAO_RP2040.upload_port.0.vid=0x2886
Seeed_XIAO_RP2040.upload_port.0.pid=0x8042
Seeed_XIAO_RP2040.upload.tool=picotool
Seeed_XIAO_RP2040.upload.tool.default=picotool
Seeed_XIAO_RP2040.upload.protocol=
Seeed_XIAO_RP2040.upload.transport=
Seeed_XIAO_RP2040.upload.use_1200bps_touch=true
Seeed_XIAO_RP2040.upload.wait_for_upload_port=false
Seeed_XIAO_RP2040.upload.native_usb=true
Seeed_XIAO_RP2040.upload.maximum_size=16777216
Seeed_XIAO_RP2040.upload.maximum_data_size=270336
Seeed_XIAO_RP2040.bootloader.tool=openocd
Seeed_XIAO_RP2040.bootloader.tool.default=openocd
Seeed_XIAO_RP2040.bootloader.config=-f target/rp2040.cfg
Seeed_XIAO_RP2040.bootloader.programmer=-f interface/cmsis-dap.cfg

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

menu.split=Flash split
WIO_RP2040_MINI_DEV_BOARD.name=Wio RP2040 Mini Dev Board
WIO_RP2040_MINI_DEV_BOARD.build.core=arduino
WIO_RP2040_MINI_DEV_BOARD.build.crossprefix=arm-none-eabi-
WIO_RP2040_MINI_DEV_BOARD.build.compiler_path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
WIO_RP2040_MINI_DEV_BOARD.build.variant=WIO_RP2040_MINI_DEV_BOARD
WIO_RP2040_MINI_DEV_BOARD.build.mcu=cortex-m0plus
WIO_RP2040_MINI_DEV_BOARD.build.extra_flags=
WIO_RP2040_MINI_DEV_BOARD.build.fpu=
WIO_RP2040_MINI_DEV_BOARD.build.float-abi=
WIO_RP2040_MINI_DEV_BOARD.build.architecture=cortex-m0plus
WIO_RP2040_MINI_DEV_BOARD.build.board=WIO_RP2040_MINI_DEV_BOARD
WIO_RP2040_MINI_DEV_BOARD.build.ldscript=linker_script.ld
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.defines={build.variant.path}/defines.txt
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.cflags={build.variant.path}/cflags.txt
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.includes={build.variant.path}/includes.txt
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed="{build.variant.path}/libs/libmbed.a"
WIO_RP2040_MINI_DEV_BOARD.vid.0=0x2886
WIO_RP2040_MINI_DEV_BOARD.pid.0=0x8043
WIO_RP2040_MINI_DEV_BOARD.upload_port.0.vid=0x2886
WIO_RP2040_MINI_DEV_BOARD.upload_port.0.pid=0x8043
WIO_RP2040_MINI_DEV_BOARD.upload.tool=picotool
WIO_RP2040_MINI_DEV_BOARD.upload.tool.default=picotool
WIO_RP2040_MINI_DEV_BOARD.upload.protocol=
WIO_RP2040_MINI_DEV_BOARD.upload.transport=
WIO_RP2040_MINI_DEV_BOARD.upload.use_1200bps_touch=true
WIO_RP2040_MINI_DEV_BOARD.upload.wait_for_upload_port=false
WIO_RP2040_MINI_DEV_BOARD.upload.native_usb=true
WIO_RP2040_MINI_DEV_BOARD.upload.maximum_size=16777216
WIO_RP2040_MINI_DEV_BOARD.upload.maximum_data_size=270336
WIO_RP2040_MINI_DEV_BOARD.bootloader.tool=openocd
WIO_RP2040_MINI_DEV_BOARD.bootloader.tool.default=openocd
WIO_RP2040_MINI_DEV_BOARD.bootloader.config=-f target/rp2040.cfg
WIO_RP2040_MINI_DEV_BOARD.bootloader.programmer=-f interface/cmsis-dap.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#pragma once
#include <macros.h>
#include <stdint.h>

#ifndef __PINS_ARDUINO__
#define __PINS_ARDUINO__

#ifdef __cplusplus
extern "C" unsigned int PINCOUNT_fn();
#endif

// Pin count
// ----
#define PINS_COUNT (PINCOUNT_fn())
#define NUM_DIGITAL_PINS (30u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)

extern PinName digitalPinToPinName(pin_size_t P);

// LEDs
// ----
#define PIN_LED (25u)
#define LED_BUILTIN PIN_LED

// Digital pins
// ----
#define PIN_D0 (26u)
#define PIN_D1 (27u)
#define PIN_D2 (28u)
#define PIN_D3 (29u)
#define PIN_D4 (6u)
#define PIN_D5 (7u)
#define PIN_D6 (0u)
#define PIN_D7 (1u)
#define PIN_D8 (2u)
#define PIN_D9 (4u)
#define PIN_D10 (3u)

static const uint8_t D0 = PIN_D0;
static const uint8_t D1 = PIN_D1;
static const uint8_t D2 = PIN_D2;
static const uint8_t D3 = PIN_D3;
static const uint8_t D4 = PIN_D4;
static const uint8_t D5 = PIN_D5;
static const uint8_t D6 = PIN_D6;
static const uint8_t D7 = PIN_D7;
static const uint8_t D8 = PIN_D8;
static const uint8_t D9 = PIN_D9;
static const uint8_t D10 = PIN_D10;


// Analog pins
// -----------
#define PIN_A0 (26u)
#define PIN_A1 (27u)
#define PIN_A2 (28u)
#define PIN_A3 (29u)

static const uint8_t A0 = PIN_A0;
static const uint8_t A1 = PIN_A1;
static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;

#define ADC_RESOLUTION 12

// Serial
#define PIN_SERIAL_TX (0ul)
#define PIN_SERIAL_RX (1ul)

// SPI
//#define PIN_SPI_MISO (16u)
//#define PIN_SPI_MOSI (19u)
//#define PIN_SPI_SCK (18u)
//#define PIN_SPI_SS (17u)
// KH fix wrong pin
#define PIN_SPI_MISO (D9)
#define PIN_SPI_MOSI (D10)
#define PIN_SPI_SCK (D8)
#define PIN_SPI_SS (D7)
//////

static const uint8_t SS = PIN_SPI_SS; // SPI Slave SS not used. Set here only for reference.
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;

// Wire
#define SDA (6u)
#define SCL (7u)

#define SERIAL_HOWMANY 1
#define SERIAL1_TX (digitalPinToPinName(PIN_SERIAL_TX))
#define SERIAL1_RX (digitalPinToPinName(PIN_SERIAL_RX))

#define SERIAL_CDC 1
#define HAS_UNIQUE_ISERIAL_DESCRIPTOR
#define BOARD_VENDORID 0x2886
#define BOARD_PRODUCTID 0x8042
#define BOARD_NAME "RaspberryPi Pico"

uint8_t getUniqueSerialNumber(uint8_t* name);
void _ontouch1200bps_();

#define SPI_HOWMANY (1)
#define SPI_MISO (digitalPinToPinName(PIN_SPI_MISO))
#define SPI_MOSI (digitalPinToPinName(PIN_SPI_MOSI))
#define SPI_SCK (digitalPinToPinName(PIN_SPI_SCK))

#define WIRE_HOWMANY (1)
#define I2C_SDA (digitalPinToPinName(SDA))
#define I2C_SCL (digitalPinToPinName(SCL))

#define digitalPinToPort(P) (digitalPinToPinName(P)/32)

#define SERIAL_PORT_USBVIRTUAL SerialUSB
#define SERIAL_PORT_MONITOR SerialUSB
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1

#define USB_MAX_POWER (500)

#endif //__PINS_ARDUINO__
181 changes: 181 additions & 0 deletions Packages_Patches/Seeeduino/hardware/samd/1.8.3/cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef Arduino_h
#define Arduino_h

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define CORE_HAS_LIBB64

typedef bool boolean;
typedef uint8_t byte;
typedef uint16_t word;

// some libraries and sketches depend on this AVR stuff,
// assuming Arduino.h or WProgram.h automatically includes it...
//
#include "avr/pgmspace.h"
#include "avr/interrupt.h"
#include "avr/dtostrf.h"
#include "avr/io.h"

#include "binary.h"
#include "itoa.h"

#ifdef __cplusplus
extern "C"{
#endif // __cplusplus

// Include Atmel headers
#include "sam.h"

#include "wiring_constants.h"

#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L )
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) )
#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) )

void yield( void ) ;

/* system functions */
int main( void );
void init( void );

/* sketch */
void setup( void ) ;
void loop( void ) ;

int __debug_buf(const char* head, char* buf, int len);

#include "WVariant.h"

#ifdef __cplusplus
} // extern "C"
#endif

// The following headers are for C++ only compilation
#ifdef __cplusplus
#include "WCharacter.h"
#include "WString.h"
#include "Tone.h"
#include "WMath.h"
#include "HardwareSerial.h"
#include "pulse.h"
#endif
#include "delay.h"
#ifdef __cplusplus
#include "Uart.h"
#endif

// Include board variant
#include "variant.h"

#include "wiring.h"
#include "wiring_digital.h"
#include "wiring_analog.h"
#include "wiring_shift.h"
#include "wiring_pwm.h"
#include "WInterrupts.h"

// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif // abs
// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif // abs

#ifdef __cplusplus
template<class T, class L>
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
{
return (b < a) ? b : a;
}

template<class T, class L>
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
{
return (a < b) ? b : a;
}
#else
#ifndef min
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
#endif
#ifndef max
#define max(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#endif
#endif

#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))

#define interrupts() __enable_irq()
#define noInterrupts() __disable_irq()
#ifndef interruptsStatus
static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused));
static inline unsigned char __interruptsStatus(void)
{
// See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/CHDBIBGJ.html
return (__get_PRIMASK() ? 0 : 1);
}
#define interruptsStatus() __interruptsStatus()
#endif

#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))

#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))

#define bit(b) (1UL << (b))

#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606)
// Interrupts
#define digitalPinToInterrupt(P) ( P )
#endif

// USB
#ifdef USE_TINYUSB
#include "Adafruit_TinyUSB_Core.h"
#else
#include "USB/USBDesc.h"
#include "USB/USBCore.h"
#include "USB/USBAPI.h"
#include "USB/USB_host.h"
#endif

#endif // Arduino_h
Loading

0 comments on commit 32e04fd

Please sign in to comment.