1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00
Commit graph

51 commits

Author SHA1 Message Date
Steve Evans
c593629fca Add support for SPI DMA 2025-06-28 21:23:45 +01:00
Jay Blackman
0d0c00f341
REFACTOR: Adding DMA_FIRST_HANDLER (#14474)
* REFACTOR: Adding DMA_FIRST_HANDLER

 dmaIdentifier_e could be zero based in the future and align to descriptor array index directly

Also removed unused DMA_INPUT_STRING

* Removed magic number following code rabbit review
2025-06-26 07:34:29 +10:00
Jay Blackman
1d3c661c06
REFACTOR: Moving platform specific DMA code to include/platform (#14320)
* REFACTOR: Moving platform specific DMA code to include/platform

* Cleanup
2025-04-01 22:17:25 +11:00
nerdCopter
ed6a4a4769
duplicate emptyline removal (#14027)
* trailing space removal

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

* deduplicate empty lines

---------

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-11-15 23:07:25 +01:00
nerdCopter
493b9bf819
trailing whitespace removal (#14026)
trailing space removal

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
2024-11-15 22:19:13 +01:00
J Blackman
b21cfe3282
Code re-organisation: src/platform/xxx for the MCU type (#13955) 2024-10-13 03:07:17 +11:00
luckk
6dcc268918
Add apm32f405/f407 support (#13796)
* Add APM32F4 driver libraries and USB middleware

* Add the APM32F405 and APM32F407 target files

* Add APM32 startup files

* Add APM32F4 linker files

* Add APM32F4.mk

* Add APM32 driver files

* Add APM32F40X MCU type

* Sync with the Betaflight master branch and modify the driver directory structure

* Implement CLI on the APM32

* Implement ADC on the APM32

* Implement  config streamer on the APM32

* Implement I2C on the APM32

* Implement SPI on the APM32

* Implement DSHOT on the APM32

* Implement transponder ir on the APM32

* Implement serial uart on the APM32

* Implement MCO on the APM32

* Implement DWT on the APM32

* Update the init.c file, adding APM32 MCO configuration

* Remove all duplicated APM32 driver files and retaining only the APM32 LIB directory

* Create APM32F4.mk

* Add linker files for APM32F405 and APM32F407

* Add startup and library config files for APM32F405 and APM32F407

* Add target files for APM32F405 and APM32F407

* Add apm32 MCU driver files

* Add build configuration for APM32 MCU

* Implement config streamer on APM32

* Implement CLI on the APM32

* Implement ADC on the APM32

* Implement RCC on the APM32

* Implement MCO on the APM32

* Implement I2C on the APM32

* Implement SPI on the APM32

* Implement serial uart on the APM32

* Implement IO on the APM32

* Implement DMA on the APM32

* Implement DSHOT on the APM32

* Implement transponder ir on the APM32

* Update init.c

* Add the inclusion of the 'platform.h' file to the APM USB driver source file

* Merge bus SPI duplicate code from APM32 to STM32

* Update timer_apm32.c

* Merge motor duplicate code from APM32 to STM32

* Merge serial uart duplicate code from APM32 to STM32

* Update APM32F4.mk

* Update cli.c

* Update APM32F4.mk

* Remove the apm32_flash_f4_split.ld

* Associate the apm32 linker file with stm32_flash_f4_split.ld
2024-08-19 08:34:31 +10:00
J Blackman
c2c3d6740c
CLEANUP: MCU file locations (#13692) 2024-06-22 09:21:08 +10:00
James
c5f3f86413
AT32 initial dshot support (#12464)
* AT32 dshot part1

Just enough dshot implementation to do timer pwm dshot output only.
Still to do:
  telemetry, burst mode, bitbang

* AT32 Implement dshot telemetry

Enables bidir dshot for telemetry on AT32. Only timer-pwm is
supported, without burst mode.

* Updates for target.h and config.h

Removed a conflicting definition from target.h and added the PA9/10 uart pins
for the at-link serial connection, but these don't seem to be active until
added from the cli.

* Wrap erpmToRpm in #def

Hopefully fix problems with unit tests by making erpmToRpm conditionally
compiled again.

---------

Co-authored-by: J Blackman <blckmn@users.noreply.github.com>
2023-03-09 18:20:35 +11:00
J Blackman
74be33dfbc
AT32 development, introduction of AT32F435 target (#12247)
* AT32F435: new target (#12159)
* AT32F435: New target (WIP)
* IO and Timer Updates
* Adding pseudonyms for the STM TypeDef items.
- implementation to follow
* Adding config_streamer support for AT32
* Implementation for IO
* Adding in Peripheral mapping from emsr.
* Warnings cleanup for AT drivers
* Getting things to the linking stage
* Add AT-START-F435 LEDs as default in AT32F435 as a temporary measure to aid bringup
* Remove tabs
* Enable selection of serial port to use for MSP
* Setup defaults for AT-START-F435 to use MSP on UART1
* Fix for most recent 4.5.0 Makefile changes
* Solve for sanity check.
* Add AT32F435 MCU type
* Fix compilation issue with SITL
* Merge conflict resolution
* Minor cleanup
* Adding line feed.

---------

Co-authored-by: Steve Evans <Steve@SCEvans.com>
2023-01-31 11:31:23 +11:00
Steve Evans
701b0ae55c Remove F1 and F3 support 2022-06-14 19:10:13 +01:00
Dominic Clifton
0b7fcb7df4 STM32H7 - Use FAST_CODE on all HOT ISRs to avoid flash access on targets where
FAST_CODE functions are placed in RAM.
2021-12-23 15:02:12 +01:00
Michael Keller
80be08f050 Added resource allocation for DMA. 2021-09-28 02:44:07 +13:00
Steve Evans
ab66795eeb G4 SPI DMA support 2021-08-31 23:29:51 +12:00
Steve Evans
87c8847c13 New SPI API supporting DMA
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc

Drop SPI clock during binding

Remove debug

Add per device SPI DMA enable

Fix sdioPinConfigure() declaration warning

Reduce clock speed during SPI RX initialisation
2021-07-25 12:40:25 +12:00
Michael Keller
7bf84b2a38 Fixed SPI access for SD cards for STM32G4 and STM32H7. 2021-05-30 15:52:52 +12:00
jflyper
697d0f7ed3 [H7] H7A3 support 2020-11-01 00:32:39 +09:00
jflyper
fe1a05fa2a [H7] BB-Dshot support (TIM1/TIM8 limited version) 2020-09-30 23:27:23 +09:00
jflyper
ff16686893 White space tidy 2020-02-17 23:54:57 +13:00
jflyper
a58f55c840 [G4] DMA support 2020-01-21 11:47:33 +09:00
Dominic Clifton
8731e4a003 Use CCM_CODE for DMA handlers on F3.
This shaves a few cycles when handling the DSHOT telemetry responses.
Fewer invalid packets.
2019-09-02 18:40:13 +02:00
Dominic Clifton
d016aa2fc4 DSHOT - Use cycle counting instead of recording timestamp in dshot motor_DMA_IRQHandler.
It turns out that two calls to micros() and the calculation of
directionChangeDurationUs took 581 cycles, vs 396 cycles without the
calls to micros() and deferred calculation of the duration which is only
needed in the CLI.

This brings the time down from around 7 microseconds to 5.5 microseconds
on an F3 at 72Mhz.

This makes the difference between 100% invalid telemetry and 4% invalid
telemetry on the first motor on the F3.

Squashed commits:
* Remove the forward declaration for `pwmDshotSetDirectionInput` and make
it static.
* Remove unneeded forward declaration of `motor_DMA_IRQHandler`.
* Remove duplication in DMA IRQ Handler.
  Doesn't affect resulting code but improves readability.
* Use an inline function to read DWT->CYCCNT.
* Remove unneeded forward declarations from cli.c now that the correct
header is included.
* Update DWT unlock method.
2019-08-29 20:01:20 +02:00
mikeller
768b345166 Added resource index display. 2019-08-08 11:49:51 +12:00
jflyper
a103de784e DMA Stream/Channel unification on LL-DShot 2019-07-31 11:59:02 +09:00
jflyper
7ddfd7dea6 Unify DMA stream and channel handling 2019-07-27 21:20:34 +09:00
jflyper
c797775cf6 [H7] Enable DMA facility 2019-05-06 18:56:51 +09:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
blckmn
7245c79dce Fixes error in DMA irq handling 2018-01-30 04:11:57 +11:00
blckmn
39bb6ffe04 Configurable SDCARD, and clean up of DMA. 2018-01-29 11:50:14 +11:00
blckmn
834289e456 Move all F7 to use LL 2017-07-30 12:10:46 +10:00
Martin Budden
3d4f0bb137 Whitespace tidy 2017-07-05 06:36:22 +01:00
borisbstyle
d3ac73a0a0 Revert DSHOT Interrupt 2017-03-02 17:55:40 +01:00
J Blackman
792941606f Initial preparation for cleaning up multiple files per MCU (#2500)
* Initial preparation for cleaning up multiple files per MCU

* Combined DSHOT for F3 and F4 (F7 todo)

* Build fixes (mixed some adjustments needed in transponder_ir.c)

* Fix F7 warnings/bugs

* Updated timer periods for transponder.

Fixed FURY including old pwm_output files.

* Added method to calculate prescaler and period on the fly for varying clock speeds.

This can be used for overclocking :)

* Consolidated led_strip

* Moved led strip to use system clock for timing (allowing overclocking)

* Fixed incorrect channel, and removed comparison warning.

* More cleanup

* Fix KIWIF4 target

* Cleaned up target.mk files
2017-03-01 19:50:23 +00:00
Sami Korhonen
1102df5d68 Disable F7 D-cache until more knowledge is acquired 2017-02-14 22:48:49 +01:00
blckmn
b2fa0779ef Standardised the use of dma descriptor (outside of int) 2017-01-09 22:58:50 +11:00
blckmn
ccd07cf03e F3 and F7 updates to remove DSHOT interrupt. 2017-01-09 22:43:49 +11:00
Sami Korhonen
358bdf76f3 Fix F7 ADC 2017-01-07 11:45:15 +02:00
Sami Korhonen
8d76579c9e F7 performance improvements 2016-12-24 13:48:20 +02:00
Martin Budden
19901730fc Removed trailing spaces from device drivers 2016-11-11 08:11:48 +00:00
blckmn
8dc3bee80d Adding DMA ownership for ADC, LED STRIP, USART and MOTOR 2016-11-08 13:47:37 +11:00
blckmn
8304becff7 Adding both AirbotF4 and Revolt targets 2016-11-05 06:32:13 +11:00
blckmn
fe3ac4754e Timer code simplification in preparation of led strip being assignable.
Moved some repeated code into timer.c - preparation for allowing resource command for led strip
2016-10-23 14:16:55 +11:00
Sami Korhonen
1f8805cdf0 squash betaflightF7
Parts and driver boost from @npsm
2016-10-21 08:51:02 +03:00
Martin Budden
141b369667 Removed trailing whitespace 2016-07-16 07:54:58 +01:00
blckmn
89b288a498 Fix for F4 telemetry 2016-07-15 22:49:24 +10:00
Evgeny Sychov
325f4297cc Fix typo - replace rrc by rcc 2016-07-03 03:49:39 -07:00
Evgeny Sychov
801add3ce3 Fix F4 targets 2016-07-02 17:14:08 -07:00
Evgeny Sychov
2d070a3507 Re-design DMA driver 2016-07-01 01:53:45 -07:00
blckmn
7ca39bbde6 STM32F4: Drivers 2016-06-08 05:37:08 +10:00