Cleanup, add licenses to all files
This commit is contained in:
parent
0d8a475b6c
commit
b3dad2ba62
11 changed files with 295 additions and 153 deletions
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
* Arduino header for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
|
||||
|
|
@ -10,24 +30,6 @@ extern "C"{
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if 0
|
||||
typedef enum {
|
||||
LOW = 0,
|
||||
HIGH = 1,
|
||||
CHANGE = 2,
|
||||
FALLING = 3,
|
||||
RISING = 4,
|
||||
} PinStatus;
|
||||
|
||||
typedef enum {
|
||||
INPUT = 0x0,
|
||||
OUTPUT = 0x1,
|
||||
INPUT_PULLUP = 0x2,
|
||||
INPUT_PULLDOWN = 0x3,
|
||||
} PinMode;
|
||||
typedef uint8_t pin_size_t;
|
||||
#endif
|
||||
|
||||
#include <pins_arduino.h>
|
||||
|
||||
void pinMode(pin_size_t pinNumber, PinMode pinMode);
|
||||
|
|
|
|||
|
|
@ -1,15 +1,38 @@
|
|||
/*
|
||||
* Serial-Over-USB for the Raspberry Pi Pico RP2040
|
||||
* Implements an ACM which will reboot into UF2 mode on a 1200bps DTR toggle.
|
||||
* Much of this was modified from the Raspberry Pi Pico SDK stdio_usb.c file.
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
SerialUSB Serial;
|
||||
extern "C" {
|
||||
|
||||
#include "tusb.h"
|
||||
#include "pico/time.h"
|
||||
#include "pico/binary_info.h"
|
||||
#include "pico/bootrom.h"
|
||||
extern "C" {
|
||||
#include "pico/bootrom.h"
|
||||
}
|
||||
#include "hardware/irq.h"
|
||||
#include "pico/mutex.h"
|
||||
#include "hardware/watchdog.h"
|
||||
}
|
||||
|
||||
#define PICO_STDIO_USB_TASK_INTERVAL_US 1000
|
||||
#define PICO_STDIO_USB_LOW_PRIORITY_IRQ 31
|
||||
|
||||
|
|
@ -235,12 +258,10 @@ static int _bps = 115200;
|
|||
static void CheckSerialReset() {
|
||||
if ((_bps == 1200) && (!_dtr)) {
|
||||
reset_usb_boot(0,0);
|
||||
// watchdog_enable(100, 1);
|
||||
while (1); // WDT will fire here
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
|
||||
_dtr = dtr ? true : false;
|
||||
_rts = rts ? true : false;
|
||||
|
|
@ -252,3 +273,5 @@ extern "C" void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_l
|
|||
CheckSerialReset();
|
||||
}
|
||||
|
||||
|
||||
SerialUSB Serial;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
* Serial-over-USB for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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 __SERIALUSB_H__
|
||||
#define __SERIALUSB_H__
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,40 @@
|
|||
#include "../../pico-sdk/src/common/pico_base/include/pico.h"
|
||||
#include "../../pico-sdk/src/common/pico_time/include/pico/time.h"
|
||||
/*
|
||||
* delay() for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <pico.h>
|
||||
#include <pico/time.h>
|
||||
|
||||
extern "C" void delay( unsigned long ms )
|
||||
{
|
||||
if (!ms) {
|
||||
return;
|
||||
}
|
||||
if (!ms) {
|
||||
return;
|
||||
}
|
||||
|
||||
sleep_ms(ms);
|
||||
sleep_ms(ms);
|
||||
}
|
||||
|
||||
extern "C" void delayMicroseconds( unsigned int usec )
|
||||
{
|
||||
if (!usec) {
|
||||
return;
|
||||
}
|
||||
sleep_us(usec);
|
||||
if (!usec) {
|
||||
return;
|
||||
}
|
||||
sleep_us(usec);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,33 @@
|
|||
/*
|
||||
* Main handler for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
extern void setup();
|
||||
extern void loop();
|
||||
|
||||
extern "C" {
|
||||
|
||||
int main() {
|
||||
Serial.begin();
|
||||
setup();
|
||||
while (1) loop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int main() {
|
||||
Serial.begin();
|
||||
setup();
|
||||
while (1) {
|
||||
loop();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,24 @@
|
|||
#include "../../pico-sdk/src/common/pico_time/include/pico/time.h"
|
||||
/*
|
||||
* Millis() for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <pico/time.h>
|
||||
|
||||
extern "C" unsigned long millis() {
|
||||
return to_ms_since_boot(get_absolute_time());
|
||||
|
|
|
|||
|
|
@ -1,26 +1,29 @@
|
|||
/*
|
||||
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
|
||||
*/
|
||||
* PWM and analogRead for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_pwm/include/hardware/pwm.h"
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_clocks/include/hardware/clocks.h"
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_pll/include/hardware/pll.h"
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_clocks/include/hardware/clocks.h"
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_adc/include/hardware/adc.h"
|
||||
#include <hardware/gpio.h>
|
||||
#include <hardware/pwm.h>
|
||||
#include <hardware/clocks.h>
|
||||
#include <hardware/pll.h>
|
||||
#include <hardware/adc.h>
|
||||
|
||||
static int32_t analogScale = 255;
|
||||
static uint32_t analogMap = 0;
|
||||
|
|
@ -28,66 +31,66 @@ static uint16_t analogFreq = 1000;
|
|||
static bool pwmInitted = false;
|
||||
|
||||
extern "C" void analogWriteFreq(uint32_t freq) {
|
||||
if (freq == analogFreq) {
|
||||
return;
|
||||
}
|
||||
if (freq < 100) {
|
||||
analogFreq = 100;
|
||||
} else if (freq > 60000) {
|
||||
analogFreq = 60000;
|
||||
} else {
|
||||
analogFreq = freq;
|
||||
}
|
||||
pwmInitted = false;
|
||||
if (freq == analogFreq) {
|
||||
return;
|
||||
}
|
||||
if (freq < 100) {
|
||||
analogFreq = 100;
|
||||
} else if (freq > 60000) {
|
||||
analogFreq = 60000;
|
||||
} else {
|
||||
analogFreq = freq;
|
||||
}
|
||||
pwmInitted = false;
|
||||
}
|
||||
|
||||
extern "C" void analogWriteRange(uint32_t range) {
|
||||
if (range == analogScale) {
|
||||
return;
|
||||
}
|
||||
if ((range >= 15) && (range <= 65535)) {
|
||||
analogScale = range;
|
||||
pwmInitted = false;
|
||||
}
|
||||
if (range == analogScale) {
|
||||
return;
|
||||
}
|
||||
if ((range >= 15) && (range <= 65535)) {
|
||||
analogScale = range;
|
||||
pwmInitted = false;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void analogWriteResolution(int res) {
|
||||
if ((res >= 4) && (res <= 16)) {
|
||||
analogWriteRange((1 << res) - 1);
|
||||
}
|
||||
if ((res >= 4) && (res <= 16)) {
|
||||
analogWriteRange((1 << res) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void analogWrite(pin_size_t pin, int val) {
|
||||
if (!pwmInitted) {
|
||||
pwm_config c = pwm_get_default_config();
|
||||
pwm_config_set_clkdiv( &c, clock_get_hz(clk_sys) / 1.0 * (analogScale * analogFreq) );
|
||||
pwm_config_set_wrap( &c, analogScale );
|
||||
for (int i=0; i<30; i++) {
|
||||
pwm_init(pwm_gpio_to_slice_num(i), &c, true);
|
||||
if (!pwmInitted) {
|
||||
pwm_config c = pwm_get_default_config();
|
||||
pwm_config_set_clkdiv( &c, clock_get_hz(clk_sys) / 1.0 * (analogScale * analogFreq) );
|
||||
pwm_config_set_wrap( &c, analogScale );
|
||||
for (int i=0; i<30; i++) {
|
||||
pwm_init(pwm_gpio_to_slice_num(i), &c, true);
|
||||
}
|
||||
pwmInitted = true;
|
||||
}
|
||||
pwmInitted = true;
|
||||
}
|
||||
|
||||
if (val < 0) {
|
||||
val = 0;
|
||||
} else if (val > analogScale) {
|
||||
val = analogScale;
|
||||
}
|
||||
if (val < 0) {
|
||||
val = 0;
|
||||
} else if (val > analogScale) {
|
||||
val = analogScale;
|
||||
}
|
||||
|
||||
gpio_set_function(pin, GPIO_FUNC_PWM);
|
||||
pwm_set_gpio_level(pin, val);
|
||||
gpio_set_function(pin, GPIO_FUNC_PWM);
|
||||
pwm_set_gpio_level(pin, val);
|
||||
}
|
||||
|
||||
extern "C" int analogRead(pin_size_t pinNumber) {
|
||||
if ((pinNumber < A0) || (pinNumber > A3)) {
|
||||
return 0;
|
||||
}
|
||||
static bool adcInitted = false;
|
||||
if (!adcInitted) {
|
||||
adc_init();
|
||||
}
|
||||
adc_gpio_init(pinNumber);
|
||||
adc_select_input(pinNumber - A0);
|
||||
return adc_read();
|
||||
if ((pinNumber < A0) || (pinNumber > A3)) {
|
||||
return 0;
|
||||
}
|
||||
static bool adcInitted = false;
|
||||
if (!adcInitted) {
|
||||
adc_init();
|
||||
}
|
||||
adc_gpio_init(pinNumber);
|
||||
adc_select_input(pinNumber - A0);
|
||||
return adc_read();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +1,66 @@
|
|||
#include "Arduino.h"
|
||||
#include "../../pico-sdk/src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
||||
/*
|
||||
* pinMode and digitalRead/Write for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
extern "C" void pinMode( pin_size_t ulPin, PinMode ulMode )
|
||||
{
|
||||
switch (ulMode) {
|
||||
case INPUT:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, false);
|
||||
break;
|
||||
case INPUT_PULLUP:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, false);
|
||||
gpio_pull_up(ulPin);
|
||||
break;
|
||||
case INPUT_PULLDOWN:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, false);
|
||||
gpio_pull_down(ulPin);
|
||||
break;
|
||||
case OUTPUT:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, true);
|
||||
break;
|
||||
default:
|
||||
// Error
|
||||
break;
|
||||
}
|
||||
#include "Arduino.h"
|
||||
#include <hardware/gpio.h>
|
||||
|
||||
extern "C" void pinMode( pin_size_t ulPin, PinMode ulMode ) {
|
||||
switch (ulMode) {
|
||||
case INPUT:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, false);
|
||||
break;
|
||||
case INPUT_PULLUP:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, false);
|
||||
gpio_pull_up(ulPin);
|
||||
break;
|
||||
case INPUT_PULLDOWN:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, false);
|
||||
gpio_pull_down(ulPin);
|
||||
break;
|
||||
case OUTPUT:
|
||||
gpio_init(ulPin);
|
||||
gpio_set_dir(ulPin, true);
|
||||
break;
|
||||
default:
|
||||
// Error
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void digitalWrite( pin_size_t ulPin, PinStatus ulVal )
|
||||
{
|
||||
if (!gpio_is_dir_out(ulPin)) {
|
||||
if (ulVal == LOW) {
|
||||
gpio_pull_down(ulPin);
|
||||
} else {
|
||||
gpio_pull_up(ulPin);
|
||||
}
|
||||
} else {
|
||||
gpio_put(ulPin, ulVal == LOW ? 0 : 1);
|
||||
}
|
||||
extern "C" void digitalWrite( pin_size_t ulPin, PinStatus ulVal ) {
|
||||
if (!gpio_is_dir_out(ulPin)) {
|
||||
if (ulVal == LOW) {
|
||||
gpio_pull_down(ulPin);
|
||||
} else {
|
||||
gpio_pull_up(ulPin);
|
||||
}
|
||||
} else {
|
||||
gpio_put(ulPin, ulVal == LOW ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" PinStatus digitalRead( pin_size_t ulPin )
|
||||
{
|
||||
return gpio_get(ulPin) ? HIGH : LOW;
|
||||
return gpio_get(ulPin) ? HIGH : LOW;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
* SPI Master library for the Raspberry Pi Pico RP2040
|
||||
*
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "SPI.h"
|
||||
#include <hardware/spi.h>
|
||||
#include <hardware/gpio.h>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
/*
|
||||
* SPI Master library for the Raspberry Pi Pico RP2040
|
||||
* Copyright (c) 2021 Earle F. Philhower, III
|
||||
*
|
||||
* Based on the Arduino Zero SPI.h file, (2) 2015 Arduino, Inc. and
|
||||
* licensed as LGPL.
|
||||
* Copyright (c) 2021 Earle F. Philhower, III <earlephilhower@yahoo.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ compiler.warning_flags.more=-Wall
|
|||
compiler.warning_flags.all=-Wall -Wextra
|
||||
|
||||
compiler.defines={build.led}
|
||||
compiler.includes=-I{runtime.platform.path}/pico_base/ -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_platform/include/ -I{runtime.platform.path}/pico-sdk/src/common/pico_base/include/ -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/ -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_timer/include/ -I{runtime.platform.path}/pico-sdk/src/common/pico_stdlib/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_gpio/include -I{runtime.platform.path}/pico-sdk/src/common/pico_base/include -I{runtime.platform.path}/pico-examples/build/generated/pico_base -I{runtime.platform.path}/pico-sdk/src/boards/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_platform/include -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_base/include -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_structs/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_claim/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_sync/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_uart/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_divider/include -I{runtime.platform.path}/pico-sdk/src/common/pico_time/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_timer/include -I{runtime.platform.path}/pico-sdk/src/common/pico_sync/include -I{runtime.platform.path}/pico-sdk/src/common/pico_util/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_runtime/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_clocks/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_resets/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_watchdog/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_xosc/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_pll/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_vreg/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_irq/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_printf/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_bootrom/include -I{runtime.platform.path}/pico-sdk/src/common/pico_bit_ops/include -I{runtime.platform.path}/pico-sdk/src/common/pico_divider/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_double/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_int64_ops/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_float/include -I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_stdio/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_stdio_uart/include -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/ -I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/ -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_stdio_usb/include -I{runtime.platform.path}/cores/rp2040/api -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_spi/include
|
||||
compiler.includes=-I{runtime.platform.path}/pico_base/ -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_platform/include/ -I{runtime.platform.path}/pico-sdk/src/common/pico_base/include/ -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/ -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_timer/include/ -I{runtime.platform.path}/pico-sdk/src/common/pico_stdlib/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_gpio/include -I{runtime.platform.path}/pico-sdk/src/common/pico_base/include -I{runtime.platform.path}/pico-examples/build/generated/pico_base -I{runtime.platform.path}/pico-sdk/src/boards/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_platform/include -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_base/include -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_structs/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_claim/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_sync/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_uart/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_divider/include -I{runtime.platform.path}/pico-sdk/src/common/pico_time/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_timer/include -I{runtime.platform.path}/pico-sdk/src/common/pico_sync/include -I{runtime.platform.path}/pico-sdk/src/common/pico_util/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_runtime/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_clocks/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_resets/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_watchdog/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_xosc/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_pll/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_vreg/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_irq/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_printf/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_bootrom/include -I{runtime.platform.path}/pico-sdk/src/common/pico_bit_ops/include -I{runtime.platform.path}/pico-sdk/src/common/pico_divider/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_double/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_int64_ops/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_float/include -I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_stdio/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_stdio_uart/include -I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/ -I{runtime.platform.path}/pico-sdk/lib/tinyusb/src/ -I{runtime.platform.path}/pico-sdk/src/rp2_common/pico_stdio_usb/include -I{runtime.platform.path}/cores/rp2040/api -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_spi/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_pwm/include -I{runtime.platform.path}/pico-sdk/src/rp2_common/hardware_adc/include
|
||||
compiler.flags=-Os -march=armv6-m -mcpu=cortex-m0plus -mthumb -Os -DNDEBUG -ffunction-sections -fdata-sections
|
||||
compiler.wrap=-Wl,--wrap=acos -Wl,--wrap=acosf -Wl,--wrap=acosh -Wl,--wrap=acoshf -Wl,--wrap=__aeabi_cdcmpeq -Wl,--wrap=__aeabi_cdcmple -Wl,--wrap=__aeabi_cdrcmple -Wl,--wrap=__aeabi_cfcmpeq -Wl,--wrap=__aeabi_cfcmple -Wl,--wrap=__aeabi_cfrcmple -Wl,--wrap=__aeabi_d2f -Wl,--wrap=__aeabi_d2iz -Wl,--wrap=__aeabi_d2lz -Wl,--wrap=__aeabi_d2uiz -Wl,--wrap=__aeabi_d2ulz -Wl,--wrap=__aeabi_dadd -Wl,--wrap=__aeabi_dcmpeq -Wl,--wrap=__aeabi_dcmpge -Wl,--wrap=__aeabi_dcmpgt -Wl,--wrap=__aeabi_dcmple -Wl,--wrap=__aeabi_dcmplt -Wl,--wrap=__aeabi_dcmpun -Wl,--wrap=__aeabi_ddiv -Wl,--wrap=__aeabi_dmul -Wl,--wrap=__aeabi_drsub -Wl,--wrap=__aeabi_dsub -Wl,--wrap=__aeabi_f2d -Wl,--wrap=__aeabi_f2iz -Wl,--wrap=__aeabi_f2lz -Wl,--wrap=__aeabi_f2uiz -Wl,--wrap=__aeabi_f2ulz -Wl,--wrap=__aeabi_fadd -Wl,--wrap=__aeabi_fcmpeq -Wl,--wrap=__aeabi_fcmpge -Wl,--wrap=__aeabi_fcmpgt -Wl,--wrap=__aeabi_fcmple -Wl,--wrap=__aeabi_fcmplt -Wl,--wrap=__aeabi_fcmpun -Wl,--wrap=__aeabi_fdiv -Wl,--wrap=__aeabi_fmul -Wl,--wrap=__aeabi_frsub -Wl,--wrap=__aeabi_fsub -Wl,--wrap=__aeabi_i2d -Wl,--wrap=__aeabi_i2f -Wl,--wrap=__aeabi_idiv -Wl,--wrap=__aeabi_idivmod -Wl,--wrap=__aeabi_l2d -Wl,--wrap=__aeabi_l2f -Wl,--wrap=__aeabi_ldivmod -Wl,--wrap=__aeabi_lmul -Wl,--wrap=__aeabi_memcpy -Wl,--wrap=__aeabi_memcpy4 -Wl,--wrap=__aeabi_memcpy8 -Wl,--wrap=__aeabi_memset -Wl,--wrap=__aeabi_memset4 -Wl,--wrap=__aeabi_memset8 -Wl,--wrap=__aeabi_ui2d -Wl,--wrap=__aeabi_ui2f -Wl,--wrap=__aeabi_uidiv -Wl,--wrap=__aeabi_uidivmod -Wl,--wrap=__aeabi_ul2d -Wl,--wrap=__aeabi_ul2f -Wl,--wrap=__aeabi_uldivmod -Wl,--wrap=asin -Wl,--wrap=asinf -Wl,--wrap=asinh -Wl,--wrap=asinhf -Wl,--wrap=atan -Wl,--wrap=atan2 -Wl,--wrap=atan2f -Wl,--wrap=atanf -Wl,--wrap=atanh -Wl,--wrap=atanhf -Wl,--wrap=calloc -Wl,--wrap=cbrt -Wl,--wrap=cbrtf -Wl,--wrap=ceil -Wl,--wrap=ceilf -Wl,--wrap=__clz -Wl,--wrap=__clzdi2 -Wl,--wrap=__clzl -Wl,--wrap=__clzll -Wl,--wrap=__clzsi2 -Wl,--wrap=copysign -Wl,--wrap=copysignf -Wl,--wrap=cos -Wl,--wrap=cosf -Wl,--wrap=cosh -Wl,--wrap=coshf -Wl,--wrap=__ctzdi2 -Wl,--wrap=__ctzsi2 -Wl,--wrap=drem -Wl,--wrap=dremf -Wl,--wrap=exp -Wl,--wrap=exp10 -Wl,--wrap=exp10f -Wl,--wrap=exp2 -Wl,--wrap=exp2f -Wl,--wrap=expf -Wl,--wrap=expm1 -Wl,--wrap=expm1f -Wl,--wrap=floor -Wl,--wrap=floorf -Wl,--wrap=fma -Wl,--wrap=fmaf -Wl,--wrap=fmod -Wl,--wrap=fmodf -Wl,--wrap=free -Wl,--wrap=hypot -Wl,--wrap=hypotf -Wl,--wrap=ldexp -Wl,--wrap=ldexpf -Wl,--wrap=log -Wl,--wrap=log10 -Wl,--wrap=log10f -Wl,--wrap=log1p -Wl,--wrap=log1pf -Wl,--wrap=log2 -Wl,--wrap=log2f -Wl,--wrap=logf -Wl,--wrap=malloc -Wl,--wrap=memcpy -Wl,--wrap=memset -Wl,--wrap=__popcountdi2 -Wl,--wrap=__popcountsi2 -Wl,--wrap=pow -Wl,--wrap=powf -Wl,--wrap=powint -Wl,--wrap=powintf -Wl,--wrap=printf -Wl,--wrap=putchar -Wl,--wrap=puts -Wl,--wrap=remainder -Wl,--wrap=remainderf -Wl,--wrap=remquo -Wl,--wrap=remquof -Wl,--wrap=round -Wl,--wrap=roundf -Wl,--wrap=sin -Wl,--wrap=sincos -Wl,--wrap=sincosf -Wl,--wrap=sinf -Wl,--wrap=sinh -Wl,--wrap=sinhf -Wl,--wrap=snprintf -Wl,--wrap=sprintf -Wl,--wrap=sqrt -Wl,--wrap=sqrtf -Wl,--wrap=tan -Wl,--wrap=tanf -Wl,--wrap=tanh -Wl,--wrap=tanhf -Wl,--wrap=trunc -Wl,--wrap=truncf -Wl,--wrap=vprintf -Wl,--wrap=vsnprintf
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue