Commit graph

33 commits

Author SHA1 Message Date
Rudolph Riedel
3c7a2d5bad Added a isBusy() method to SPI calls to allow non-blocking polling of the DMA transfer status. 2020-12-28 13:51:55 +01:00
Phillip Burgess
1e92424a50 Obscure SPI DMA bug fixed. Also, big non-blocking transfers supported. 2020-08-20 20:22:39 -07:00
Henry Gabryjelski
9ab68e1aff avoid warnings on unused parameter 2020-01-17 01:16:20 -08:00
Phillip Burgess
a2c0a5b547 SAMD21: Fix freq clipping in SPI.h, allow 24 MHz SPI
SPI clock freq previously clipped at MAX_SPI/2 (6 MHz) rather than MAX_SPI. Now works correctly.
Additionally, MAX_SPI set at 24 MHz on SAMD21. This is only slightly beyond spec and so far seems reliable with SD and SdFat tests on M0 Adalogger, eyes on HalloWing M0.
2019-11-04 14:45:51 -08:00
Phillip Burgess
8f123f315b SPI DMA WIP and still not working :/ 2019-05-22 14:22:50 -07:00
Phillip Burgess
91e43ef443 SPIClass DMA transfer() function WIP 2019-05-21 22:14:45 -07:00
Phillip Burgess
e86546521f Separated getDMACID() function into getDMAC_ID_TX() and getDMAC_ID_RX() 2019-05-10 17:46:33 -07:00
Phillip Burgess
7616dab297 SERCOM stuff - simplify, cleanup, add SAMD21 dummy funcs 2019-05-08 09:44:05 -07:00
Phillip Burgess
59d869d79d WIP change SPI SERCOM clock source at runtime rather than compile-time 2019-05-07 23:05:52 -07:00
Phillip Burgess
2b2b8f0610 Add max SPI speed select menu for M4 2019-04-21 22:30:57 -07:00
ladyada
a2d9587950 up to 24 mhz SPI on SAMD51. added another ESP32 def 2019-04-04 13:44:37 -04:00
José Ángel Jiménez
4294d36b89 Fix calculation of SPI_MIN_CLOCK_DIVIDER in SPI.h
The previous version of SPI.h works only for the SAMD21G18A variant and only for a 48 MHz system clock. For the rest of variants, it sets SPI_MIN_CLOCK_DIVIDER to 2, which is incorrect for a 48 MHz system clock.

The SAMD21 datasheet specifies a typical SPI SCK period (tSCK) of 42 ns, see "Table 36-48. SPI Timing Characteristics and Requirements", which translates into a maximum SPI clock of 23.8 MHz.

The new code conservatively sets the divider for a 12 MHz maximum SPI clock, taking into account any value for the system clock (not only 48 MHz). It also executes for other variants of the SAMD, not only SAMD21G18A.

Can you, please, review this patch?
2018-01-31 16:50:12 +01:00
Sandeep Mistry
78f79ed2c0 Add SPI.notUsingInterrupt(...) 2018-01-02 11:57:40 -05:00
Sandeep Mistry
e77ae8fe8e Optimize SPI transfers 2016-11-17 17:17:05 -05:00
Cristian Maglie
4568471543 Made multiple SPI instances fully configurable from variant 2015-11-17 17:13:07 +01:00
Sandeep Mistry
82ddeb0eef Add SPI. transfer16(...) API 2015-11-04 15:06:02 -05:00
Thibaut VIARD
7fbd66521e [zero] Bring more customization to SPI class 2015-08-10 13:39:31 +02:00
Cristian Maglie
30f23fb9ac Other license cleanup 2015-06-15 14:25:42 +02:00
Cristian Maglie
e3a367f878 Fixed SPI datamode settings
The missing break in every case will have MODE0 always selected
2015-05-19 16:41:31 +02:00
Claudio Indellicati
cb722cfd06 Implemented SPI Transaction API. 2015-03-27 17:53:30 +01:00
Cristian Maglie
f0e76f9af8 SPI: fix indent 2014-10-28 15:20:22 +01:00
Cristian Maglie
eca1341c7b Limit SPI max clock speed to 12Mhz
SAMD21G18A doesn't operate correctly with clock dividers lower than 4
2014-10-28 15:20:21 +01:00
Cristian Maglie
98341bfb82 Added SPI clock divisor for compatibility with legacy SPI library for AVR 2014-09-11 22:25:49 +02:00
Cristian Maglie
4206a3cd77 Simplified formula for SPI divisor calculation 2014-09-11 18:57:00 +02:00
Cristian Maglie
c7866bfce4 Added SPI block-transfer method 2014-09-11 18:45:11 +02:00
Cristian Maglie
29bc12e762 Added stub for SPI transactions 2014-09-11 18:45:11 +02:00
Cristian Maglie
adcfb53e96 Fixed includes in SPI library 2014-09-08 14:37:18 +02:00
Jonathan BAUDIN
280bc4e001 Fix SPI 2014-06-05 12:15:20 +02:00
Jonathan BAUDIN
e4ab3ba3ef Few UART corrections, modifiy Variant files 2014-05-15 11:54:59 +02:00
Jonathan BAUDIN
7e75870756 Correction compilation errors. 2014-05-07 16:02:25 +02:00
Jonathan BAUDIN
1014ac90c1 Add txBuffer (ring buffer) to SercomUart.
Add SPI functions into SERCOM class and create SPI class
2014-04-28 15:49:42 +02:00
Jonathan BAUDIN
8fe524de16 Add function for Sercom SPI 2014-04-25 11:53:15 +02:00
Thibaut VIARD
ac73b87928 Cleanup and adding more needed files 2014-04-16 10:53:11 +02:00