Commit Graph

34 Commits

Author SHA1 Message Date
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
Pat Hickey 18329b1a5d AP_HAL: add virtual init method to HAL class 2012-12-20 14:51:19 +11:00
Pat Hickey afd1f36400 AP_HAL: add BetterStream, Stream, and Print interfaces
* BetterStream Means AP_HAL depends on AP_Common, for now, in order to have
  the AVR specific pgm_char_t defined.
  I'll need to factor that out in the future but for now it can stay
2012-12-20 14:51:19 +11:00
Pat Hickey dc03b1190f AP_HAL: Stub implementations of pure virtual AP_HAL classes 2012-12-20 14:51:18 +11:00