Commit Graph

7 Commits (87bc6de65a3943d2f1cdba22da70af6b592e2ec7)

Author SHA1 Message Date
Jamie Smith 28815b13d3
DMA SPI support for STM32 devices (#162)
* Start on STM32 DMA SPI

* Update all objects.hs, add interrupt function

* Initial DMA code should be ready to test out...

* Fix SPI interrupt-mode IRQ handlers, add SPI::transfer_and_wait

* Fix CMake error when building for STM32WL processors

* Now builds on all STM devices!

* Properly support STM32U5 / DMA IP v3

* Start on STM32F4 support, fix hardfault on IP v1 and v3 due to incorrect indexing

* Fix Rx-only transfers, add abort code, fix incorrect channel assignments for DMA IP v1 devices

* Start on STM32H7 SPI DMA

* Fixes for H7: Correctly manage data cache, keep SPI ISR enabled

* Implement DMA SPI header constants for all remaining STM32 families.  Also add support for freeing DMA channels

* Try and fix build on STM32G0

* Fix build on STM32G0

* Add SPI_32BIT_WORDS label, start on fixing SPI docs

* SPI: Implement reference counting so that DMA channels get freed properly

* Fix issue where SPI data could get corrupted (by TI mode turning on) depending on memory layout (if your spis pointer & 0x10 was nonzero)

* Mark DMA channels as unallocated when SPI bus is freed

* Simplify spi_abort_asynch()

* Fix some rebase issues, fix failing to allocate DMA channel on STM32U5

* Fix DMA getting stuck on STM32F4, F7, and F2
2023-11-02 20:16:45 -07:00
Jamie Smith ffc33676d1
Lots of usability improvements for the I2C API. Better docs and new top-level functions. (#64)
* Lots of usability improvements for the I2C API.  Better docs and new top-level functions.

* Document frequencies

* Tabs to spaces

* More style fixes

* Run astyle

* Clean up docs

* Add note about addressing, change 10 bit to 11 bit

* Fix spellcheck

* Fix paste error

* Oops, fix accidental change
2022-10-02 21:27:33 -07:00
Vladimir Korneev 4b34f567af Fix hanging with multiple I2C buses
Make the _mutex non-static and remove _owner and acquire()

When two or more I2C buses are used then static__mutex and _owner are
shared between all I2C class instances in the program. That
wastes time to reconfigure periphery on every transfer.

Make _mutex non-static. Remove _owner and acquire() method
because in non-static case they have no practical meaning.
2021-06-20 20:34:00 +03:00
Martin Kojtal 3af058af8b i2c: `start()` should aquire the bus
From the history it looks like aquire was not added explicitely to start. I do not see
why as it's the condition that must be sent when communication is initiated.

write/read/transfer invoke `aquire()`
2021-05-18 12:28:13 +01:00
Przemyslaw Stekiel b2dad08387 Change explicit pinmap to static pinmap 2019-11-28 08:32:12 +01:00
Przemyslaw Stekiel 80b46769aa I2C: Add explicit pinmap support 2019-11-28 08:31:59 +01:00
Hugues Kamba bfa1b4dd84 Drivers/Events/RTOS Public and internal APIs cleanup (#10955)
Separate drivers, events, and rtos internal APIs from public APIs.

* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.

Release Notes

This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
2019-08-02 12:23:47 +01:00