Commit Graph

18 Commits

Author SHA1 Message Date
David J. Fiddes
dac493fb92 SPI: Fix discarded-qalifiers warning when compiling with all warnings (#3458)
* SPI: Fix discarded-qalifiers warning when compiling with all warnings

This fixes an error introduced with changeset b847f41 which
tightened the use of const for read-only data. The helper
funtion __transferBytes also requires the const qualifier on
outgoing data. Without this change a warning is displayed
when compiling with the Arduino IDE set to display "All"
compiler warnings.

Tests:
 - Build an ESP32 SPI sketch that uses static const data to send
   to an SPI device using the SPI.transferBytes() API

* SPI:Ensure all local functions are marked static

This audits all functions in the esp32-hal-xpi.c module and
ensures that any functions entirely local to the module are
marked as static.

Tests:
 - Build with Arduino set to show all warnings and ensure none
   are displayed

* SPI: Remove unused local __spiTranslate24 function

This removes the __spiTranslate24() function which is unused.
2019-11-11 17:44:49 +01:00
David J. Fiddes
b847f41e24 SPI: Ensure all read-only data pointers are marked as const (#3356)
This changes all SPI functions that take data pointers which are
not modified so that the declaration is const. This allows them
to be used with const data (i.e. held in flash). No functional
changes are required.

The defnitions of spiWrite() and spiTransferBytes()  in
esp-hal-spi.h/c have been updated to be consistent.

Tests:
 - Build a simple sketch using SPI.writePattern() and
   SPI.transferBytes()  which uses const data and verify that the
   attached device functions as expected.
2019-10-14 20:39:27 +03:00
Me No Dev
2fd39b1aff
Handle APB frequency change (#2250)
* Add APB change callbacks and move cpu code to own file

* Properly set esp_timer and FreeRTOS tick dividers

* Improve updated devisors

* No need to update REF_TICK yet

* Add initial handling for UART baud change

* fix uartWriteBuf and uartDetectBaudrate

* trigger callbacks even when APB did not change

* toggle UART ISR on CPU change

* add XTAL freq getter and add cpu freq validation

* Support CPU frequency changes in I2C (#2287)

**esp32-hal-i2c.c**
* add callback for cpu frequency changes
* adjust fifo thresholds based on cpu frequency and i2c bus frequency
* reduce i2c bus frequency if differential is too small
**Wire.h**
* version to 1.1.0

* Implement clock change for the other peripherals

* remove bad CPU clock values from the menu

* Add note to CPU freqs that support WiFi and BT
2019-01-09 10:07:54 +01:00
Me No Dev
c827bb4177
CPU and APB Frequency support (#2220)
* Add support to HAL for APB frequencies different than 80MHz

* Add support for CPU frequencies in the IDE board menu

* Switch to fast set_config

* Add method to uart so debug can be reassigned after apb frequency switch

* Return real APB frequency
2018-12-20 01:57:32 +01:00
Bernardo Ramos
0f9595e31e Fixes SPI mode setting (Issue #1094) (#1096)
Fixes #1094
2018-03-04 20:56:33 +01:00
me-no-dev
ab0ea2f6da Fix missing method from SPI HAL
Fixes: https://github.com/espressif/arduino-esp32/issues/640
2017-09-18 12:14:41 +08:00
me-no-dev
9fc3f1ebdd Fix wrong SPI peripheral enabled
Related: https://github.com/espressif/arduino-esp32/issues/634
2017-09-13 17:21:34 +03:00
me-no-dev
befebb7242 Change DPORT access macros 2017-05-15 20:53:09 +03:00
Severin Smith
cc73f17add SPI_MODE2 and SPI_MODE3 configurations inverted (#345)
It appears that the configurations for `ck_out_edge` were inverted for `SPI_MODE2` and `SPI_MODE3`. You can check the technical reference manual on page 76, table 23 "Clock Polarity and Phase, and Corresponding SPI Register Values for SPI Master".

I've check with my oscilloscope that the current configuration is wrong and this fix corrects the issue.
2017-05-05 09:59:18 +03:00
me-no-dev
dda89947a7 Fix writePixels 2017-03-22 02:26:18 +02:00
me-no-dev
d0232d126a SPI implement transaction locking
Use transactions to skip mutex locks for reads and writes
2017-02-14 04:15:38 +02:00
me-no-dev
de017a8a1b Optimize SPI transfers to take one lock and do not return until completed 2017-02-01 02:14:36 +02:00
Angus Gratton
ce5df79674 SDK headers: Use new esp-idf signal name VSPICLK_OUT_IDX (#130) 2017-01-16 12:12:13 +02:00
me-no-dev
c30012ab78 Add Kconfig for IDF and option to disable HAL mutexes
IDF Options:
- Autostart Arduino (implements app_main)
- Disable HAL locks
- Set HAL debug level
- Auto-connect STA if configured (else will connect after WiFi.begin())
2016-11-18 15:07:25 +02:00
me-no-dev
47babd2098 shave off some time when sending multiple bytes through SPI 2016-11-14 13:08:30 +02:00
me-no-dev
cdee64cb07 remove unnecessary locks 2016-10-14 03:16:02 +03:00
me-no-dev
d4dd33d2df implement thread-safe spi 2016-10-11 15:51:09 +03:00
me-no-dev
5f3a205955 initial import 2016-10-06 07:09:44 -06:00