Commit Graph

60 Commits

Author SHA1 Message Date
ladyada 186ea35211 reclang 2025-01-08 15:05:13 -05:00
Martino Facchin c99c8564a2 fixup: clang-format fix 2024-12-16 09:41:55 +01:00
Martino Facchin 9eeac1d181 Avoid fast pins IO on RTOS based boards
Better fix than 80943e663f
2024-12-13 15:54:58 +01:00
Tamas Jozsi 95e8f81499 Fix compatibility with Silicon Labs boards
The Silicon Labs core moved to use ArduinoCore-API which
has a native 'BitOrder' definition
2024-05-10 17:48:14 +02:00
mecparts 5f170d8e4f
Amended code formatting 2024-02-11 14:16:08 -07:00
mecparts d5aa1a353e
Add compatibility with Arduino R4 boards 2024-02-11 13:28:45 -07:00
Tamas Jozsi 16e4726718 Add compatibility with Silicon Labs Arduino boards 2024-01-05 17:14:45 +01:00
Filies Olaf (IFAG DES TOC PSA) 5162b240d7 Forgot the || inthe macro list 2023-09-11 17:21:18 +02:00
Filies Olaf (IFAG DES TOC PSA) 8097aa568f By adding two macros all Infineons XMC MCUs are now able to use the library 2023-09-11 16:50:03 +02:00
caternuson 369413c66d init hw spi members 2022-11-01 12:23:15 -07:00
caternuson 3736ebfde1 refactor for better sw spi only support 2022-08-22 15:18:26 -07:00
Limor "Ladyada" Fried 02665fd93f
Merge pull request #96 from KurtE/t4x_neutered
T4.x - Software SPI - don't use FAST_PINIO
2022-05-02 18:29:41 -04:00
KurtE 17cf18bf5b T4.x - Software SPI - don't use FAST_PINIO
The original problem was that the code defined the registers and mask as 8 bits, when the T4.x ones are 32 bits.  So it only worked on a subset of pins.

So first fix would be to simply define these values as 32 bits.  But doing so leaves you code at risk as the Set/Clear code in this library is not atomic,
Example: *clkPort |= clkPinMask;

So if something happens in the small time window after the time the register is retrieved and then manipulated and written back, such as an interrupt.
Or maybe if other hardware is driving the pin.  These changes would be
clobbered by the above code.

Not sure how many other boards (if any) may be hit by the same issue.

It is not an issue with T3.x as the Teensy code uses the M3/M4 bitband support, so for each pin there is a unique memory address for it and these operations are atomic.

Note: the Arm M7 does not support bitbands.  However  in these caseAtomic code can be written for the T4.x by instead using the DR register of the IO port, you use the DR_SET, DR_CLEAR, DR_TOGGLE registers instead which do as the names imply
the do that operation only those pins who have a 1 bit set to the value...
2022-05-02 15:16:52 -07:00
Christian Riggenbach 41635e3c68 beginTransactionWithAssertingCS() and endTransactionWithDeassertingCS()
These two methods are similar to beginTransaction() and endTransaction(),
but, as the name implies, with CS management. They are both public, as
beginTransaction() and endTransaction() are too.
2022-05-02 22:35:38 +02:00
Christian Riggenbach 4b18d396dc use the typesafe replacement nullptr instead of NULL (since C++11) 2022-04-17 15:03:17 +02:00
Walt b6f7b3abe1 applied clang-format 2022-03-14 22:45:53 -07:00
Walt c41e829dcc write method parameter const-ness
fix https://github.com/adafruit/Adafruit_FRAM_SPI/issues/25
2022-03-10 21:43:30 -08:00
Limor "Ladyada" Fried afbd408d17
Merge pull request #79 from EBD232/master
Add support for Heltec CubeCell modules with ASR6502
2022-01-26 01:06:07 -05:00
caternuson 7961058057 refinements for no CS configs 2022-01-24 16:56:58 -08:00
Erik Backlund 5e12460a55 Add support for Heltec CubeCell modules with ASR6502 2022-01-22 18:14:58 +01:00
Christian Riggenbach c43e0ae83e added write_and_read()
This method adds a wrapper for transfer() with CS-pin and
transaction management
2021-12-31 11:32:36 +01:00
lady ada 3feb7f9690 add more arduinoh 2021-11-20 00:56:35 -05:00
Phillip Burgess cc1fd93f02 No functional change, cleaning up shotgun-style #includes 2021-11-19 12:00:35 -08:00
caternuson c6965bd471 selectively remove spi 2021-09-28 14:31:23 -07:00
lady ada d33a16468f fix for samd 2021-07-17 16:09:09 -04:00
lady ada 8ad008a699 fix busorder enum to deal with arc32 2021-07-17 15:54:07 -04:00
ladyada f28f3ae7f0 clang 2021-07-01 11:40:28 -04:00
ladyada 05398d9395 add trinket/attiny8 support 2021-06-30 16:46:43 -04:00
lady ada 4795819af6 bl0ng 2021-03-27 17:07:44 -04:00
lady ada 6352cd1847 quick fix for RP2040 2021-03-27 16:46:44 -04:00
Limor "Ladyada" Fried a8c9c5183c
Merge pull request #40 from jgfoster/memory_leak
Release memory allocated in constructor to avoid memory leak
2020-11-30 19:07:32 -05:00
James Foster 3fc89c5835 Release memory allocated in constructors 2020-11-30 15:47:49 -08:00
WereCatf 808cb38772
Update Adafruit_SPIDevice.h 2020-11-23 23:40:45 +02:00
WereCatf 031e1c2d31
Make compatible with Heltec's CubeCell Arduino-core
The functions fast pin-I/O uses are currently missing, so don't define BUSIO_USE_FAST_PINIO. Also, we need typedef for BitOrder, but it refuses to compile without also including Arduino.h, at least under PlatformIO.
2020-11-23 20:42:22 +02:00
Spence Konde (aka Dr. Azzy) c3be1c190b
Fix support for megaTinyCore, add DxCore support
Testing for the define from build.board is not a good test (I recently updated them to refer to the specific part, instead of just the number of pins, for example) - instead, test for the MEGATINYCORE define, which is defined by Arduino.h and will always be there , and will be for all future versions of megaTinyCore. Also added a test for DxCore, which supports the new AVR Dx-series parts, and does SPI bit order in the same way. I confirmed that the examples now compile again on megaTinyCore with this change - and now compile for DxCore as well
2020-10-23 17:25:24 -04:00
Robin Giese 28cc900343 Help library compile for Spark/Particle 2020-08-23 21:18:19 -07:00
Hans 8af8000694
Add support for more megaAVR targets
Specifically ATmega4809/3209/1609/809 and ATmega4808/3208/1608/808
2020-07-22 21:43:03 +02:00
lady ada 0b1dbbd0e4 add fast software spi 2020-07-18 14:18:07 -04:00
lady ada 2179775500 add begin/end transaction helpers (needed for really odd devices like SHARP memory display which has inverted CS) 2020-07-18 12:03:30 -04:00
lady ada 22ea3a921c fix dox 2020-05-30 20:50:06 -04:00
lady ada 03b2c978a4 make ifdef for SPI defs from over-greedy 2020-05-30 20:21:42 -04:00
lady ada 374b86a186 add attiny support 2020-05-30 19:12:24 -04:00
Roelof 9cc2bcc2d7
Update Adafruit_SPIDevice.h for Sony Spresense.
Add support for the Sony Spresense architecture. This has no BitOrder enum, so it's added here.
2020-05-22 19:32:35 +02:00
Daniel Stuart 38ea25d88a SPI: Add Infineon XMC boards to BitOrder quirk
As many (all?) ARM Cortex based chips, Infineon xmc boards also need
this quirk for BusIO to compile.

Original commit: 4921ca2cea ("Update Adafruit_SPIDevice.h")
XMC for arduino: https://github.com/Infineon/XMC-for-Arduino
2020-01-08 23:19:44 -03:00
Lady Ada ddee2a2339 remove travis, add actions, clang, bump version 2019-12-27 19:49:16 -05:00
ElPercha 4921ca2cea Update Adafruit_SPIDevice.h 2019-11-05 20:21:28 -06:00
ladyada 959a207580 fix for https://github.com/adafruit/Adafruit_BusIO/issues/6 2019-10-31 23:59:49 -04:00
ladyada eb61fd3404 add stm32duino support 2019-10-13 15:57:24 -04:00
Ladyada 4bfbfd612d update for all nRF boards 2019-08-04 21:17:14 -04:00
scott snyder fe7ae08615 Fix for compiling on NRF52.
SPI_BITORDER_MSBFIRST / SPI_BITORDER_LSBFIRST not defined when compiling
on nrf52.
2019-07-16 23:31:40 -04:00