Commit Graph

53 Commits

Author SHA1 Message Date
Peter Barker 9e5edefc4a AP_HAL: guard against DSP being compiled out of code 2024-01-03 11:45:31 +11:00
Thomas Watson ebbcf42236 AP_HAL: constructor now accepts UARTs in SERIALn order 2023-12-19 06:53:15 +11:00
Thomas Watson 6a6c3ce7a1 AP_HAL: inline serial accessor function
Saves a bit more flash.
2023-12-19 06:53:15 +11:00
Thomas Watson 8747ae539f AP_HAL: move serial re-mapping to driver array initialization
Saves a bit of flash and execution time.
2023-12-19 06:53:15 +11:00
Thomas Watson de45437704 AP_HAL: use array of UART drivers instead of consecutive variables
Avoids UB-inducing assumption that UART drivers are consecutive in the
serial() function.
2023-12-19 06:53:15 +11:00
Andy Piper a73945c1b3 AP_HAL: rename QSPIDevice to WSPIDevice 2023-04-28 08:31:15 +10:00
murata 15a39c1649 AL_HAL: Console output can be disabled 2022-05-17 09:53:06 +10:00
Peter Barker 650ef59be8 AP_HAL: create HAL::SIMState object to hold simulation state 2022-03-17 14:39:55 +11:00
Andy Piper 5a7f5844d4 AP_HAL: nuke clang warnings 2022-03-03 16:34:14 +11:00
Andrew Tridgell 8c2074907b AP_HAL: support up to 9 UARTs 2021-11-22 22:48:59 +11:00
Siddharth Purohit a323807644 AP_HAL: add support for QSPIDevice 2021-06-30 19:33:17 +10:00
Andrew Tridgell 19723e6e75 AP_HAL: make uart pointers private
this ensures they cannot be used by library or vehicle code, so we
will be able to remove them in future
2020-12-15 10:32:46 +11:00
Andrew Tridgell 8678759da4 AP_HAL: added hal.serial() access to uarts
this gives access to serial ports in the SERIALn_ order. It is inlined
by the compiler so using hal.uartB and hal.serial(3) generates
idential code on stm32 (tested on H7).

This is a step towards eliminating hal.uartX completely and the
horrible uartB ordering
2020-12-15 10:32:46 +11:00
Andrew Tridgell 68fdf033ee AP_HAL: support uartI, allowing a total of 9 uarts
this allows for OTG2 on the MatekH743 board, which makes SLCAN much
easier
2020-11-30 14:09:31 +11:00
Siddharth Purohit fa0f1e4c71 AP_HAL: add CANIface HAL, replace uavcan dependent one 2020-08-19 17:31:09 +10:00
Andy Piper f4a99a1589 AP_HAL: hardware abstraction for FFT.
control inclusion of FFT based on HAL_WITH_DSP and HAL_GYROFFT_ENABLED. target appropriate ARM cpus
define hanning window and quinn's estimator
start/analyse version of FFT to support threading
allocate memory in a specific region
calculate frequency and noise bandwidth of two noisiest peaks
control inclusion of DSP based on board size
2020-02-22 11:15:37 +11:00
Andrew Tridgell bee487e9da AP_HAL: added uartH 2019-07-12 17:01:21 +10:00
Andrew Tridgell 65d051cbc9 AP_HAL: added hal.flash driver
needed for semaphore
2019-04-11 13:22:53 +10:00
Andrew Tridgell c04f1180c9 AP_HAL: removed F4Light 2019-01-21 21:57:21 +11:00
Andrew Tridgell d1fcf2bab6 AP_HAL: added uartG
one more uart ...
2018-06-29 08:17:38 +10:00
night-ghost f8569ac39e AP_HAL: added F4Light HAL 2018-02-10 09:14:41 +11:00
Eugene Shamaev 8f2306fd19 AP_HAL: support of several CAN managers (virtual drivers) 2017-07-03 11:44:32 +01:00
Eugene Shamaev 9b98c304c4 AP_HAL: top level HAL definitions for CAN bus driver 2017-04-10 21:31:07 +01:00
Lucas De Marchi 57ec968b44 AP_HAL: remove SPIDriver
SPIDevice now controls all accesses to SPI bus.
2016-07-29 15:01:15 -03:00
Lucas De Marchi b21ad36676 AP_HAL: remove I2CDriver 2016-07-28 18:08:56 -03:00
Andrew Tridgell 76868dd070 AP_HAL: added uartF 2016-04-20 09:39:48 +10:00
Lucas De Marchi dbf2aedf1e AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Lucas De Marchi 2250d9d768 AP_HAL: initialize I2C manager
Add I2CManager to AP_HAL's contructor.
2016-02-16 19:49:08 -02:00
Lucas De Marchi c7668479bb AP_HAL: follow coding style 2015-12-18 17:56:03 +11:00
Julien BERAUD 2b681f2f13 AP_HAL: Add support for an Optflow driver
This is meant to be used for onboard optical flow
2015-12-18 17:56:03 +11:00
Caio Marcelo de Oliveira Filho efbc7648b1 AP_HAL: create AP_HAL namespace and use for some HAL functionality
For certain basic functionality, there aren't much benefit to be able to
vary the implementation easily at runtime. So instead of using virtual
functions, use regular functions that are "resolved" at link time. The
implementation of such functions is provided per board/platform.

Examples of functions that fit this include: getting the current
time (since boot), panic'ing, getting system information, rebooting.

These functions are less likely to benefit from the indirection provided
by virtual interfaces. For more complex hardware access APIs the
indirection makes more sense and ease the testing (when we have it!).

The idea is that instead of calling

    hal.scheduler->panic("on the streets of london");

now use

    AP_HAL::panic("on the streets of london");

A less important side-effect is that call-site code gets
smaller. Currently the compiler needs to get the hal, get the scheduler
pointer, get the right function pointer in the vtable for that
scheduler. And the call must include an extra parameter ("this"). Now it
will be just a function call, with the address resolved at link time.

This patch introduces the first functions that will be in the namespace,
further patches will implementations for each board and then switch the
call-sites. The extra init() function allow any initial setup needed for
the functions to work.
2015-11-20 12:25:24 +09:00
Lucas De Marchi eef4d5819f AP_HAL: HAL: don't use relative includes
Includes in the same dir should not be relative. Also sort them
alphabetically.
2015-10-21 15:54:27 -02:00
Caio Marcelo de Oliveira Filho 6fc60e2d5e AP_HAL: remove unused init() from the interface
And make run() pure virtual to ensure future implementations provide it.
2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 72cd5ef185 AP_HAL: add run() method
Add run method, that encapsulate any mainloop logic on behalf of the
client code. The setup/loop functions are passed via a HAL::Callbacks
interface. The AP_HAL_MAIN() macro should be kept as trivial as
possible.

This interface should be implemented by the existing vehicle objects. To
make easy for the examples (that don't have the equivalent of vehicle
objects), a FunCallbacks was added to bridge to the functions directly.
2015-10-21 09:16:07 +11:00
Julien BERAUD 7275e33e79 AP_HAL: add the possibility to have more than 1 i2c
Bebop drone has 3 i2c
2015-07-10 14:23:17 +10:00
Andrew Tridgell 4cb61f1f08 AP_HAL: support uartE 2014-02-26 08:18:20 +11:00
Andrew Tridgell cbc0f3ec27 AP_HAL: support uartD on some boards
PX4 and SITL get an extra UART
2013-11-23 19:29:22 +11:00
Andrew Tridgell 9f24c45502 AP_HAL: removed separate Console class
the idea of a separate console class was never really used, and just
added confusion in a HAL port. It also consumes some much needed ram
and flash space on APM2
2013-10-05 18:32:00 +10:00
Pat Hickey 0d702045b8 AP_HAL: Add Util member for string utilities 2012-12-20 14:52:37 +11:00
Andrew Tridgell e10e3ee3be AP_HAL: fixed argv declaration to match getopt() 2012-12-20 14:52:29 +11:00
Andrew Tridgell 18824c7ef5 AP_HAL: expose argc/argv in hal.init()
used for SITL port
2012-12-20 14:52:29 +11:00
Pat Hickey 9cee6cc941 AP_HAL: remove Dataflash driver 2012-12-20 14:51:37 +11:00
Pat Hickey dbb6a2a0e5 AP_HAL: change uart0,1,2,3 to uartA,B,C 2012-12-20 14:51:32 +11:00
Pat Hickey f543cede01 AP_HAL & AP_HAL_AVR: new SPI driver model 2012-12-20 14:51:31 +11:00
Pat Hickey 017f592eef AP_HAL: add ConsoleDriver interface 2012-12-20 14:51:24 +11:00
Pat Hickey 279a755ab3 AP_HAL: AnalogIn interface fleshed out 2012-12-20 14:51:23 +11:00
Pat Hickey 3b697fe299 AP_HAL: rename Log to Dataflash
* I'd love to build a proper abstraction for logging, but I don't have the
  time to do so right now.
* The dataflash libs need to be pushed into the AP_HAL_AVR anyway, so I'll
  do that now and replace the interface with a better logging driver later.
2012-12-20 14:51:21 +11:00
Pat Hickey 5d2327f52f AP_HAL: Don't need a separate Console class, BetterStream will do. 2012-12-20 14:51:21 +11:00
Pat Hickey db76562cd5 AP_HAL: global rename PPMInput -> RCInput, PWMOutput -> RCOutput
* for clarity. nobody cares that PPM/PWM is the implementation, and with
  sbus etc it might not be
2012-12-20 14:51:20 +11:00
Pat Hickey ea8242ace1 AP_HAL: Add scheduler interface, move Arduino init code to implementation 2012-12-20 14:51:19 +11:00