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

62 commits

Author SHA1 Message Date
jflyper
d9d878d88e UART DMA refactor
- Add UART DMA configurability

- Consolidation of DMA settings code
  DMA setting code for all MCUs is now in serial_uart.c

- Consolidation of UART buffer
  UART buffers are not embedded in uartDevice[] array anymore for all MCUs.

- Consolidation of HAL DMA IRQ handler

- Add missing defs for DMA on UART4 for F3
2019-10-04 12:58:11 +09:00
jflyper
ff759034f3 Refactor (consolidation and separation of stdperiph and hal) 2019-08-02 04:11:22 +09:00
jflyper
7ddfd7dea6 Unify DMA stream and channel handling 2019-07-27 21:20:34 +09:00
jflyper
00dab4288f More strict application of USE_UART and USE_INVERTER 2018-10-08 15:06:42 +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
SteveCEvans
5558174d33 Support programming of Arduino devices in serial passthrough mode (#5129)
* Support DTR in serial passthrough mode to enable programming of Arduino
based devices such as MinimOSD.

Use 'serialpassthrough 5 57600 rxtx 56' and then use Ardino to program MinimOSD
Use 'serialpassthrough 5 115200' and then use MWOSD configurator to setup

* Fix comment for CDC_SetCtrlLineStateCb routine

* Handle F7 CDC interface

* Use strToPin() to allow easy port/pin specification

* Fix use of CDC_SetCtrlLineStateCb for all processor types

* Only set baud when specified

* Fix unit tests for cli

* Only register callback if needed

* Fix white space

* Provide implementation of IOConfigGPIO in SITL

* Update serialpassthrough help text

* DTR handling through serial drivers

* Fix F3, F7 and SITL builds

* If serialpassthrough command specifies baud rate of 0, set baud rate over USB. MWOSD configurator can now access config and reflash MinimOSD without rebooting and changing baud rate.

* Fix F3 build

* Fix failing unit tests

* Use resources to declare DTR pin assignment

* Don't assert DTR during normal operation as MW_OSD doesn't like it

* MW_OSD must be built with MAX_SOFTRESET defined in order to support DTR resets

* Minimise changes after dropping DTR pin param from serialpassthrough cmd

* Remove DTR pin param from serialpassthrough cmd

* Treat ioDtrTag as boolean in conditional statements

* Tidy buffer check

* Check buffer size in CDC_Itf_Control

* Fix unit test

* Add documentation for DTR

* Add note on MAX_SOFTRESET to documentation

* Remove superfluous function definitions

* Fix tabs

* Fix tabs

* Removed superfluous entried from vtable

* Backout whitespace changes unrelated to this PR

* Pass true/false to IOWrite()

* Fix line coding packing

* Add LINE_CODING structure defintion

* Revise serial documentation

* Prevent tx buffer overflow in serialPassthrough()

* Revert change unrelated to PR

* Review feedback from ledvinap

* Fix unit test

* Use PINIO to drive DTR

* Fix unit test

* Remove change unrelated to PR

* Fix SITL build

* Use shifted bits for mask definition

* Fix serialpassthrough documentation

* Only compile PINIO functionality if USE_PINIO defined

* IOConfigGPIO not needed

* Move cbCtrlLine callback to cli.c

* serialPassthrough params changed

* Check packed structure size

* Fix unit test

* Tidy up baud rate handling
2018-03-21 23:17:31 +13:00
jflyper
18c29a2b6e Make VTable functions static
jetiexbus.c: Use serialRxBytesWaiting instead of uartTotalRxBytesWaiting
2017-12-27 22:08:23 +09:00
Martin Budden
8dd4a584c1 Fixed whitespace 2017-08-17 08:32:37 +01:00
Martin Budden
944fe0761c Tidied UART enum definitions 2017-07-29 13:30:37 +01:00
blckmn
e8c4ef83d9 IO Clean up and use of Low level for F7
- Move F7 to optional LL driver for IO and
- cleaned up and removed the remaining old gpio functions from other targets
2017-07-28 04:03:56 +10:00
jflyper
697e5d3925 Fix UART TX DMA corruption
- Use ATOMIC while examining and updating DMA status
- Mask premature TC interrupt by examining transfer count register
(CNTDR/NTDR) for F1 and F4.
2017-06-25 17:21:29 +09:00
jflyper
fdfe9e8af3 Configurable UART 2017-05-24 11:49:21 +09:00
jflyper
0cf5161ec4 Remove reference to USART_TypeDef in io, refactor uartOpen and serialUART 2017-05-11 09:59:43 +09:00
Martin Budden
2493c214b0 Created subdirectories in drivers directory 2017-04-12 08:06:22 +01:00
Michael Keller
19c1709250 Added support for multiple serial inverters. 2017-01-14 00:27:02 +13:00
fishpepper
7ec2031ce5 bugfix for sending when parity is enabled 2016-11-24 20:07:19 +01:00
J Blackman
855e0a9f90 Merge pull request #1305 from martinbudden/bf_serial_callback_rename
Renamed serial port callback
2016-10-13 04:26:37 +11:00
borisbstyle
aaafd4f661 Merge branch 'master' into development 2016-10-12 10:15:13 +02:00
Martin Budden
53981adbb7 Renamed serial port callback 2016-10-12 08:39:06 +01:00
nathan
3c5beffb99 optionally guard uart1 for ppm, depends on #1290 2016-10-10 22:54:24 -07:00
Martin Budden
661aa7469d Made serial const correct 2016-10-03 23:00:16 +01:00
blckmn
9c303d6669 VCP improvements to remove need for delay in serial_cli for F4 targets. 2016-08-13 11:23:35 +10:00
Martin Budden
541f4d4018 Directory rearrangement to reflect cleanflight changes 2016-08-07 13:44:00 +01:00
Martin Budden
168469236b Tidied serial and telemetry files 2016-08-01 06:45:59 +01:00
Martin Budden
3d8ee50934 Removed unnecesary #includes from drivers 2016-07-11 18:45:35 +01:00
blckmn
c4e75e456c Move to UART naming convention where possible (rather than USART). 2016-07-09 14:51:23 +10:00
Scott Shawcroft
a4e5e30152 Stop using uint8_t to determine if bytes are available from USB. If we buffer more than that we'll never be able to read it all. 2016-06-25 10:52:54 -07:00
blckmn
51a99e74c6 STM32F4: USARTS 4,5,6 added
Flag initialisation for motor_pwm_protocol
Fixes for AlienFlightF4 and timers
2016-06-08 05:43:28 +10:00
blckmn
7ca39bbde6 STM32F4: Drivers 2016-06-08 05:37:08 +10:00
Michael Hope
195456f9ac serial: allow buffering to speed up USB virtual COM ports.
Add begin write and end write hints.  If implemented by the serial
driver, then the driver can buffer up data sent via serialWrite() and
flush it when serialEndWrite() is called.

Implemented at the buffer level as it requires the least change to how
serial_msp and serial_cli are architected.

Also tidy up the visibility in the VCP driver.

Signed-off-by: Michael Hope <mlhx@google.com>
2016-02-02 23:36:25 +01:00
Michael Hope
96306ff9ab serial: add writeBuf() and implement for USB.
This lets USB send up to 32 bytes in a frame instead of 32 one byte
frames.  Add a fallback for drivers that don't implement writeBuf().

Signed-off-by: Michael Hope <mlhx@google.com>
2016-02-02 23:36:24 +01:00
borisbstyle
4b3ba927e9 Merge branch 'master' into betaflight
Conflicts:
	src/main/blackbox/blackbox_io.c
	src/main/drivers/serial_usb_vcp.c
	src/main/flight/imu.c
	src/main/mw.c
	src/main/target/CC3D/target.h
2015-10-12 23:53:43 +02:00
Nicholas Sherlock
6e504ca52a Ability to see how many Tx bytes are free in serial port buffer 2015-10-01 16:48:56 +13:00
Konstantin Sharlaimov (DigitalEntity)
45a4f11f92 Added #define for imu debug output (+16 squashed commit)
Squashed local commits:

from       : e4265d4a13f63f82d5cf55eea2c091622f96660b
up to (inc): 72416dc74745fa8bae1aded79aa4b9ed0e389076
2015-09-19 14:50:53 +02:00
Petr Ledvina
4c60f6c795 Fix 303 serial inversion and bidir mode
- USART_HalfDuplexCmd must be called only when USART is disabled
- input should be PullDown for inverted serial
- INVERTED BIDIR mode changed to GPIO_OType_PP (not opendrain) - opendrain won't work well for inverted serial; USART releases pin when transmission is done, so PP is OK
2015-03-31 15:01:28 +02:00
Nicholas Sherlock
3c543d36c8 Change port mode MODE_BIDIR into a port option instead 2015-03-19 13:42:13 +13:00
Nicholas Sherlock
344e8fbf04 Make serial port option checks consistent 2015-03-19 12:56:11 +13:00
Nicholas Sherlock
159f57f583 Add new serial port options field (inversion, stop bits, etc) 2015-03-19 12:56:11 +13:00
Nicholas Sherlock
cee021706b Merge remote-tracking branch 'upstream/master' into blackbox-serial-baud 2015-03-11 13:31:30 +13:00
Nicholas Sherlock
cbaa67f1d0 Add 230400 & 250000 baud rates, 2 stop-bits port mode 2015-03-06 20:07:07 +13:00
Petr Ledvina
7c62ec9755 Move internal serial interface into separate header file
Declaring function from other file is quite dangerous - there is no warning if interfaces get out of sync
2015-02-23 09:17:06 +01:00
Dominic Clifton
53406a7ac7 Relocate some structures and code to the right places.
This cleans up the include file order somewhat and fixes a couple of
dependencies.

The goal of this is to rename flight.c/flight.h to pid.c/pid.h.
2015-01-31 23:47:51 +01:00
Dominic Clifton
916aa60254 STM32F3 - Support hardware serial inversion.
Tested on the Sparky board with an FrSky X4RSB without external hardware
inverter.
2014-12-26 12:16:24 +00:00
Dominic Clifton
e8dbb77db5 UART1 - Fix interrupt race condition which resulted in UART randomly
stopping transmission of data.
2014-12-13 19:45:02 +00:00
Dominic Clifton
ea9633f2b1 Minor usart code readability improvement. 2014-12-13 18:05:22 +00:00
Dominic Clifton
6d1b0cec40 USART fixes based on feedback from @ledvinap. 2014-12-13 11:38:01 +00:00
Dominic Clifton
9b81dea320 Fix USART total bytes waiting when tx/rx buffer sizes are not equal.
Avoid using % operator.  Allow buffer sizes that are not powers of two.
2014-12-13 03:29:24 +00:00
Petr Ledvina
57c308538f Whitespace cleanup
Misplaced whitespace fixed, no functional changes
2014-11-24 21:39:25 +01:00
Frank Zhao
6311dc8f8c added single wire half duplex UART
Conflicts:

	src/main/telemetry/telemetry.h
2014-11-12 00:29:42 +00:00