greiman / digitalio Goto Github PK
View Code? Open in Web Editor NEWFast Digital I/O, Software I2C, and Software SPI for AVR Arduino
Fast Digital I/O, Software I2C, and Software SPI for AVR Arduino
Apparently some functions and constants have the same name in digitalIO and in the SD libraries (as of 12/2019).
The functions having problems are:
badPinNumber(
fastDigitalRead(
fastDigitalWrite(
Please rename in the DigitalIO library.
Also SDA_PIN and SCL_PIN are used in the examples in DigitalIO, and are defined as constants in the SD library.
Please rename in the DigitalIO library.
I will test the above changes.
Arduino: 1.8.19 (Linux), Board: "Raspberry Pi Pico, 2MB (Sketch: 1536KB, FS: 512KB), 133 MHz, Fast (-Ofast) (maybe slower), Disabled, Disabled, Disabled, Disabled, None, Pico SDK"
In file included from /home/t/Arduino/libraries/DigitalIO/src/DigitalIO.h:31,
from /home/t/Arduino/RoboRemotev3v1-tt/RoboRemotev3v1-tt.ino:5:
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:278:13: error: variable or field 'fastPinMode' declared void
278 | inline void fastPinMode(pin, mode) {
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:278:25: error: 'pin' was not declared in this scope; did you mean 'min'?
278 | inline void fastPinMode(pin, mode) {
| ^~~
| min
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:278:30: error: 'mode' was not declared in this scope; did you mean 'modf'?
278 | inline void fastPinMode(pin, mode) {
| ^~~~
| modf
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h: In member function 'void DigitalPin<PinNumber>::config(uint8_t, bool)':
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:4: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
328 | fastPinConfig(PinNumber, mode, level);
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:4: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
328 | fastPinConfig(PinNumber, mode, level);
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h: In member function 'void DigitalPin<PinNumber>::mode(uint8_t)':
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:352:5: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
352 | fastPinMode(PinNumber, mode);
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/SoftSPI.h: In member function 'void SoftSPI<MisoPin, MosiPin, SckPin, Mode>::begin()':
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:4: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/SoftSPI.h:55:5: note: in expansion of macro 'fastPinConfig'
55 | fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL);
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:4: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/SoftSPI.h:56:5: note: in expansion of macro 'fastPinConfig'
56 | fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode));
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:4: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/SoftSPI.h:57:5: note: in expansion of macro 'fastPinConfig'
57 | fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode));
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h: In instantiation of 'void DigitalPin<PinNumber>::config(uint8_t, bool) [with unsigned char PinNumber = 5; uint8_t = unsigned char]':
/home/t/Arduino/libraries/PsxNewLib/src/PsxControllerBitBang.h:82:14: required from 'boolean PsxControllerBitBang<PIN_ATT, PIN_CMD, PIN_DAT, PIN_CLK>::begin() [with unsigned char PIN_ATT = 5; unsigned char PIN_CMD = 4; unsigned char PIN_DAT = 3; unsigned char PIN_CLK = 2; boolean = bool]'
/home/t/Arduino/RoboRemotev3v1-tt/RoboRemotev3v1-tt.ino:251:21: required from here
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:15: error: 'fastPinMode' was not declared in this scope; did you mean 'PinMode'?
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ~~~~~~~~~~~^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
328 | fastPinConfig(PinNumber, mode, level);
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h: In instantiation of 'void DigitalPin<PinNumber>::config(uint8_t, bool) [with unsigned char PinNumber = 4; uint8_t = unsigned char]':
/home/t/Arduino/libraries/PsxNewLib/src/PsxControllerBitBang.h:83:14: required from 'boolean PsxControllerBitBang<PIN_ATT, PIN_CMD, PIN_DAT, PIN_CLK>::begin() [with unsigned char PIN_ATT = 5; unsigned char PIN_CMD = 4; unsigned char PIN_DAT = 3; unsigned char PIN_CLK = 2; boolean = bool]'
/home/t/Arduino/RoboRemotev3v1-tt/RoboRemotev3v1-tt.ino:251:21: required from here
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:15: error: 'fastPinMode' was not declared in this scope; did you mean 'PinMode'?
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ~~~~~~~~~~~^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
328 | fastPinConfig(PinNumber, mode, level);
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h: In instantiation of 'void DigitalPin<PinNumber>::config(uint8_t, bool) [with unsigned char PinNumber = 2; uint8_t = unsigned char]':
/home/t/Arduino/libraries/PsxNewLib/src/PsxControllerBitBang.h:84:14: required from 'boolean PsxControllerBitBang<PIN_ATT, PIN_CMD, PIN_DAT, PIN_CLK>::begin() [with unsigned char PIN_ATT = 5; unsigned char PIN_CMD = 4; unsigned char PIN_DAT = 3; unsigned char PIN_CLK = 2; boolean = bool]'
/home/t/Arduino/RoboRemotev3v1-tt/RoboRemotev3v1-tt.ino:251:21: required from here
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:15: error: 'fastPinMode' was not declared in this scope; did you mean 'PinMode'?
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ~~~~~~~~~~~^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
328 | fastPinConfig(PinNumber, mode, level);
| ^~~~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h: In instantiation of 'void DigitalPin<PinNumber>::config(uint8_t, bool) [with unsigned char PinNumber = 3; uint8_t = unsigned char]':
/home/t/Arduino/libraries/PsxNewLib/src/PsxControllerBitBang.h:85:14: required from 'boolean PsxControllerBitBang<PIN_ATT, PIN_CMD, PIN_DAT, PIN_CLK>::begin() [with unsigned char PIN_ATT = 5; unsigned char PIN_CMD = 4; unsigned char PIN_DAT = 3; unsigned char PIN_CLK = 2; boolean = bool]'
/home/t/Arduino/RoboRemotev3v1-tt/RoboRemotev3v1-tt.ino:251:21: required from here
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:290:15: error: 'fastPinMode' was not declared in this scope; did you mean 'PinMode'?
290 | {fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
| ~~~~~~~~~~~^~~~~~~~~~~
/home/t/Arduino/libraries/DigitalIO/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
328 | fastPinConfig(PinNumber, mode, level);
| ^~~~~~~~~~~~~
exit status 1
Error compiling for board Raspberry Pi Pico.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
will not compile for any rp2040 and unfortunately i need this to work as it is a dependency for the library i need,
Hi Bill,
As your repo layout is very specific, and seems tailored for doxygen and such, would you be happy with me forking this, modifying the directory structure, and adding it to the Arduino IDE library manager?
I know we are free to fork it, but I have seen authors get cranky at others when they have tried to add their fork to the lib manager.
Great lib by the way, I have been using it for years.
please how we can use this library with bluepil
Any chance to add ATMEGA8 AND ATMEGA8 AVR support?
In looking through the code I noticed you are not setting a CS pin anyway. Am I assuming it is in effect always selected for that group of pins? Also if there is no CS function then am I assuming correctly you can only have I device attached for the set of pins selected?
Another question is I am trying to attach a 9250 to a new board and use the lib to read say the whoami register. Do I use the send/receive combo or use transfer (the first to send the addr and the second to read the data).
Thanks
Mike
Please add support for Nano Every (ATmega4809)
Build for Wemos D1 Mini (ESP8266) fails with the below output.
> Executing task: platformio run <
[Wed Dec 6 16:50:24 2017] Processing d1_mini (monitor_baud: 115200; platform: espressif8266; board: d1_mini; framework: arduino)
----------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Collected 57 compatible libraries
Looking for dependencies...
Library Dependency Graph ( http://bit.ly/configure-pio-ldf )
|-- <DigitalIO> v1.0.0
|-- <OneButton>
Compiling .pioenvs/d1_mini/src/digitalio-test.o
In file included from /home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalIO.h:31:0,
from src/digitalio-test.cpp:2:
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:278:25: error: variable or field 'fastPinMode' declared void
inline void fastPinMode(pin, mode) {
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:278:25: error: 'pin' was not declared in this scope
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:278:30: error: 'mode' was not declared in this scope
inline void fastPinMode(pin, mode) {
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h: In member function 'void DigitalPin<PinNumber>::config(uint8_t, bool)':
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(PinNumber, mode, level);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(PinNumber, mode, level);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h: In member function 'void DigitalPin<PinNumber>::mode(uint8_t)':
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:352:32: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
fastPinMode(PinNumber, mode);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h: In member function 'void SoftSPI<MisoPin, MosiPin, SckPin, Mode>::begin()':
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h:55:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h:56:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode));
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h:57:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode));
^
*** [.pioenvs/d1_mini/src/digitalio-test.o] Error 1
============================================= [ERROR] Took 0.93 seconds =============================================
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
> Executing task: platformio run <
[Wed Dec 6 16:50:30 2017] Processing d1_mini (monitor_baud: 115200; platform: espressif8266; board: d1_mini; framework: arduino)
----------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Collected 57 compatible libraries
Looking for dependencies...
Library Dependency Graph ( http://bit.ly/configure-pio-ldf )
|-- <DigitalIO> v1.0.0
|-- <OneButton>
Compiling .pioenvs/d1_mini/src/digitalio-test.o
In file included from /home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalIO.h:31:0,
from src/digitalio-test.cpp:2:
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:278:25: error: variable or field 'fastPinMode' declared void
inline void fastPinMode(pin, mode) {
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:278:25: error: 'pin' was not declared in this scope
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:278:30: error: 'mode' was not declared in this scope
inline void fastPinMode(pin, mode) {
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h: In member function 'void DigitalPin<PinNumber>::config(uint8_t, bool)':
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(PinNumber, mode, level);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:328:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(PinNumber, mode, level);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h: In member function 'void DigitalPin<PinNumber>::mode(uint8_t)':
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:352:32: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
fastPinMode(PinNumber, mode);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h: In member function 'void SoftSPI<MisoPin, MosiPin, SckPin, Mode>::begin()':
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h:55:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL);
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h:56:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode));
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/DigitalPin.h:290:25: error: there are no arguments to 'fastPinMode' that depend on a template parameter, so a declaration of 'fastPinMode' must be available [-fpermissive]
{fastPinMode(pin, mode); fastDigitalWrite(pin, level);}
^
/home/ristomatti/.platformio/lib/DigitalIO_ID200/src/SoftSPI.h:57:5: note: in expansion of macro 'fastPinConfig'
fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode));
^
*** [.pioenvs/d1_mini/src/digitalio-test.o] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.