Commit Graph

60 Commits

Author SHA1 Message Date
Siddharth Purohit a323807644 AP_HAL: add support for QSPIDevice 2021-06-30 19:33:17 +10:00
Peter Barker 55f72c1534 AP_HAL: create and use new AP_HAL::PWMSource object 2020-09-08 16:10:50 +10:00
Siddharth Purohit fa0f1e4c71 AP_HAL: add CANIface HAL, replace uavcan dependent one 2020-08-19 17:31:09 +10:00
Siddharth Purohit 697e4141cb AP_HAL: add common Event interface 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 29a2351fd0 AP_HAL: rename AP_HAL::CAN to AP_HAL::CANHal
avoid conflict with ChibiOS STM32F3xx headers
2019-11-01 10:53:53 +11:00
Andrew Tridgell 65d051cbc9 AP_HAL: added hal.flash driver
needed for semaphore
2019-04-11 13:22:53 +10:00
Francisco Ferreira 0645a5b11a
AP_HAL: introduce a CANProtocol interface and remove HAL CAN thread management 2018-08-12 13:35:01 +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 3a5e8a17c7 AP_HAL: remove enum id for Ublox and RASPIO 2016-07-29 15:01:15 -03:00
Lucas De Marchi 81345cc112 AP_HAL: Remove enum for Dataflash 2016-07-29 14:47:04 -03:00
Lucas De Marchi b21ad36676 AP_HAL: remove I2CDriver 2016-07-28 18:08:56 -03:00
Lucas De Marchi cfb3124f2c AP_HAL_Linux: remove types for spi drivers
Those drivers using SPIDevice interface don't need a global id for each
of them. Remove those that were already converted.
2016-07-21 16:05:03 -03:00
Patrick J.P eb44d75ed8 AP_HAL: Remove trailing spaces from AP_HAL_Namespace.h 2016-06-22 16:03:30 -03:00
Staroselskii Georgii b677f975e7 AP_Compass: added LSM9DS1 magnetometer support 2016-05-10 17:24:43 -03:00
Julien Beraud d0114eac05 AP_HAL: Add bebop SPI Device to spi devices
Added to namespace
2016-05-03 16:43:39 -03:00
Lucas De Marchi dbf2aedf1e AP_HAL: replace header guard with pragma once 2016-02-18 14:52:34 -02:00
Lucas De Marchi 66f644c50d AP_HAL: add interface for SPIDevice devices
In order to interoperate with SPIDeviceDriver this is re-using the same
SPIDeviceManager interface.
2016-02-16 19:49:09 -02:00
Lucas De Marchi 872b255384 AP_HAL: Add interface for I2CDevice
This is a new interface to replace I2CDriver in future, when all drivers
are converted.
2016-02-16 19:49:08 -02:00
Lucas De Marchi 0eb450d379 AP_HAL: Add interface for I2C/SPI devices
These interfaces are intended to abstract I2C and SPI devices for
drivers.
2016-02-16 19:49:08 -02:00
Lucas De Marchi 9d5fb97819 Global: rename enum SPIDevice to SPIDeviceType
Free the SPIDevice name so to have a consistent name for I2C/SPI device
classes.
2016-02-01 14:18:50 -02: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 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
raspilot dcc7cf2739 AP_HAL: raspilot board type 2015-09-14 14:22:15 +10:00
Lucas De Marchi 1d39f548dc AP_HAL: remove aliases FUNCTOR_[BIND|TYPEF]_VOID
Nobody is using them anymore, so kill them.
2015-06-04 13:37:41 +09:00
Andrew Tridgell 1bd61ae96e AP_HAL: no need to include AP_Vehicle_Type.h here any more 2015-06-01 17:28:24 +10:00
Andrew Tridgell 4dd47ead0e AP_HAL: removed old fastdelegate code 2015-06-01 15:18:30 +10:00
Andrew Tridgell 1a2b02a563 AP_HAL: removed AVR special case
no longer needed
2015-05-26 14:34:13 +10:00
Lucas De Marchi 84f399ec3c APMrover2: Start using new Functor implementation
It both reduces flash size and move symbols to read-only sections.
The scheduler_tasks table is one known not to be in read-only section before due
to the FastDelegate implementation. Before and after this patch:

	APMrover2 $ size APMrover2.elf{.old,}
	   text	   data	    bss	    dec	    hex	filename
	 611406	   4832	  40920	 657158	  a0706	APMrover2.elf.old
	 609686	   4824	  38936	 653446	  9f886	APMrover2.elf

	APMrover2 $ nm -C APMrover2.elf{.old,} |grep tasks
	0000000000696f80 B Rover::scheduler_tasks
	000000000047c440 R Rover::scheduler_tasks

As can be seen above, now the scheduler_tasks symbol is in a read-only data
section and in all of them we decreased the total size.

For APM2 we have a similar situation, but the table was already in text section
because it was using plain C pointers:

	APMrover2 $ size APMrover2.elf{.old,}
	   text	   data	    bss	    dec	    hex	filename
	 189518	   1038	   3494	 194050	  2f602	APMrover2.elf.old
	 189216	   1038	   3480	 193734	  2f4c6	APMrover2.elf

	APMrover2 $ nm -C APMrover2.elf{.old,} |grep tasks
	00001f92 T Rover::scheduler_tasks
	00001f8a T Rover::scheduler_tasks
2015-05-26 13:46:55 +10:00
Lucas De Marchi 20ef7efaf6 AP_HAL: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:55 +10:00
Lucas De Marchi 9f0af5b9cb AP_HAL: add fallback implementation of functor macros 2015-05-26 13:46:51 +10:00
Lucas De Marchi 83efb9280b AP_HAL: use variadic templates in FastDelegate
Now that we are using C++11 we can use variadic templates to simplify
the FastDelegate classes. It also simplifies moving away from the
FastDelegate implementation.
2015-05-26 13:46:51 +10:00
Lucas De Marchi 4b5cf24a81 Allow to change to functor implementation
Start to add code behind APM_BUILD_FUNCTOR to support changing the
functor implementation (without breaking the build while the change is
not complete).
2015-05-26 13:46:49 +10:00
Andrew Tridgell d57fcf7e46 AP_HAL: added workaround for AVR delegates in PROGMEM 2015-05-21 07:48:45 +10:00
Staroselskii Georgii bf860ee41f AP_HAL_Linux: Ublox SPI stub 2014-11-14 10:28:34 +11:00
Víctor Mayoral Vilches 37793cd7fa AP_HAL_Namespace: Change LSM9DS0 into two different devices. 2014-08-19 10:08:15 +10:00
Víctor Mayoral Vilches 82186a3961 HAL: Add two new SPI devices
SPIDevice_LSM303D and SPIDevice_L3GD20 added to the enum.
The code has also been formated.
2014-08-19 10:08:15 +10:00
Andrew Tridgell 9b23921626 AP_HAL: added LSM9DSO_G SPI device 2014-07-19 13:22:24 +10:00
Víctor Mayoral Vilches 8af1b6faa7 AP_HAL_Linux: Add support for SPIDevice_LSM9DS0
The LSM9DS0 SPI device is connected to
SPI0, thereby SPIDriver class should return the
corresponding device.
2014-07-14 09:10:23 +10:00
Víctor Mayoral Vilches 5493be1b0d AP_HAL: Add SPIDevice_MPU9250 as a device. 2014-07-14 09:02:46 +10: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
Andrew Tridgell f2de4bb7b0 AP_HAL: implement AP_HAL::MemberProc via FastDelegate.h
this provides a more portable way to encapsulate member functions in
variables
2013-09-30 20:51:13 +10:00
Andrew Tridgell f0f5761e8d AP_HAL: make timed processes take void *argument
this allows the class to be passed in, meaning that drivers that use
register_timer_process() and register_io_process() don't need to use
static members. That results in simpler, easier to read code
2013-09-28 21:24:02 +10:00
Andrew Tridgell d3f154bbae AP_HAL: include stdbool.h for ARM build 2013-01-02 14:45:09 +11:00
Pat Hickey 0d702045b8 AP_HAL: Add Util member for string utilities 2012-12-20 14:52:37 +11:00
Pat Hickey b79bd01761 SPIDriver: namespace explicit to better permit copypasta 2012-12-20 14:52:30 +11:00
Pat Hickey 9cee6cc941 AP_HAL: remove Dataflash driver 2012-12-20 14:51:37 +11:00
Pat Hickey f543cede01 AP_HAL & AP_HAL_AVR: new SPI driver model 2012-12-20 14:51:31 +11:00
Pat Hickey 73ccfaf2d7 AP_HAL: implement DigitalSource abstraction
* GPIO's complement to AnalogSource
2012-12-20 14:51:25 +11:00