Andrew Tridgell
a587b1140a
AP_HAL: added voltage_latest() interface
...
this will be used for reading the 5V rail
2013-09-12 13:23:04 +10:00
Andrew Tridgell
7082e0f8aa
AP_HAL: added hold_in_bootloader parameter to scheduler->reboot()
2013-09-04 11:58:13 +10:00
Andrew Tridgell
97b7130bb9
libraries: update license header to GPLv3
...
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00
Randy Mackay
ac36a09747
AP_HAL: add toggle to GPIO
2013-08-30 13:01:34 +10:00
Andrew Tridgell
ef5a42fabc
AP_HAL: added RCOutput example sketch
...
useful for testing all 14 channels via APM API
2013-08-30 13:01:32 +10:00
Tobias
d3ea88e8c7
AP_HAL: resolved -Woverloaded-virtual warning
...
the function:
virtual size_t AP_HAL::Print::write(const uint8_t *buffer, size_t size);
was hidden in all derived classes by their
virtual size_t write(uint8_t) = 0; implementations.
To solve this, a non-virtual write(const uint8_t *, size_t) that calls a
virtual write_implementation was added.
This isn't necessary atm, because the derived classes don't call
write(const uint8_t *, size_t), BUT this decreases the apm2-quad Program
size by 40 bytes :D and removes warnings.
2013-07-08 12:17:34 +10:00
Andrew Tridgell
2316c3bd11
AP_HAL: make storage->write_block() take a const pointer
2013-06-04 14:02:13 +10:00
Andrew Tridgell
a5b20b4dfc
AP_HAL: removed scaling factor on analog sources
...
these are not use anymore, as voltage_average() is used instead
2013-05-13 15:29:42 +10:00
Andrew Tridgell
589b8cdb58
AP_HAL: added voltage_average_ratiometric() call to AnalogIn
...
this is for ratiometric sensors such as the 3DR airspeed sensor and
the Maxbotix analog sonar
2013-05-13 15:12:43 +10:00
Andrew Tridgell
0b6cfc7294
AP_HAL: added set_stop_pin() and set_settle_time() interfaces to analogin
...
this is for multiple sonars on one vehicle, to prevent them
interfering with each other
2013-05-03 09:45:19 +10:00
Andrew Tridgell
500497f5fa
AP_HAL: update AnalogIn test to show the first 16 pins
2013-05-02 21:31:55 +10:00
Randy Mackay
bbbd90c430
AP_HAL: rename RCInput's valid() fn to valid_channels
2013-04-29 15:05:53 +09:00
Andrew Tridgell
3b0250b414
AP_HAL: define RC_12
...
we have 12 channels on PX4FMU+PX4IO
2013-04-25 20:10:53 +10:00
Andrew Tridgell
af7381e9e0
AP_HAL: added register_io_process()
...
this is used to register a low priority IO task. Used for file IO in
DataFlash_File.cpp
2013-04-17 21:33:50 +10:00
Andrew Tridgell
eb6c66af7e
AP_HAL: added gpio->analogPinToDigitalPin() API
2013-03-22 12:31:14 +11:00
Andrew Tridgell
7681f3b639
AP_HAL: update AnalogIn example to show voltages not raw values
2013-03-15 08:39:22 +11:00
Andrew Tridgell
b1c27407a2
AP_HAL: added voltage_average() interface to AnalogIn
...
returns voltage in Volts, using averaged reading over samples.
Where possible this should be auto-scaled against a known reference
voltage
2013-03-03 16:16:01 +11:00
Andrew Tridgell
8ed2f7d21c
AnalogIn: run the example sketch a bit slower
...
5Hz is plenty
2013-03-01 11:19:26 +11:00
Andrew Tridgell
5a55fd9a2f
AP_HAL: added HAL_BOARD_NAME define
2013-03-01 07:18:25 +11:00
Andrew Tridgell
a3ef58ac92
AP_HAL: moved AnalogIn example to generic examples
...
it is not AVR specific anymore
2013-02-22 12:50:47 +11:00
Andrew Tridgell
70f7cde9b8
AP_HAL: added run_debug_shell() hal.util method
2013-02-07 15:04:33 +11:00
Andrew Tridgell
76092eb590
AP_HAL: remove unused peek() interface from UART drivers
...
this is a bit tricky to implement on some platforms, and is unused
anyway
2013-01-16 14:43:18 +11:00
James Bielman
4fa7bb1486
Add AVR compatibility header for missing math.h definitions.
...
- Define float versions of math functions to the double versions
on AVR (eg. #define sinf sin).
- These macros appear to be missing in older versions of avr-libs.
- Include AP_Math.h rather than math.h to get these definitions.
2013-01-16 13:52:17 +11:00
James Bielman
5631f865b2
Update floating point calculations to use floats instead of doubles.
...
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell
2ce18f588b
AP_HAL: added AP_HAL_Macros.h
...
this adds a define for constexpr, allowing code to build either with
or without -std=gnu++0x
2013-01-16 09:12:55 +11:00
Andrew Tridgell
6415f00ce3
AP_HAL: added a bulk transfer() method
...
very useful for dataflash
2013-01-13 17:31:42 +11:00
Pat Hickey
7a0f95c11c
AP_HAL: add Scheduler methods in_timerprocess, system_initialize
2013-01-10 14:07:43 -08:00
Andrew Tridgell
e76c77e86a
AP_HAL: mark semaphore take operations as WARN_IF_UNUSED
...
this prevents common bugs
2013-01-09 20:42:02 +11:00
Andrew Tridgell
90523ae975
AP_HAL: added WARN_IF_UNUSED macro
...
useful for key functions
2013-01-09 20:41:37 +11:00
Pat Hickey
3da864499d
AP_HAL Semaphore: don't use limits, they don't work on c++
2013-01-04 16:19:15 -08:00
James Bielman
eca1417858
AP_HAL: Add semaphores to I2C driver.
...
- Guard I2C transactions with this semaphore in the MS5611 and
HMC5843 drivers.
2013-01-04 15:43:43 -08:00
Pat Hickey
ea2a03344e
AP_HAL Scheduler: remove begin_atomic and end_atomic from api
...
* application-level atomic operations can now only be defined in
terms of suspend/resume_timer_procs
2013-01-03 17:33:14 -08:00
Pat Hickey
81d77d4a70
AP_HAL: New semaphore interface
...
* it now looks like a semaphore!
2013-01-03 13:48:07 -08:00
James Bielman
a4af314b57
Add AP_HAL_SMACCM implementation.
...
- Add a board definition for SMACCMPilot.
- Support the SMACCM HAL in required utility libraries.
2013-01-03 13:48:06 -08:00
Andrew Tridgell
a3c26d44e4
AP_HAL: rename Sempahore.h to Semaphores.h
...
this is needed to allow build on MacOS, as its case-insensitive
filesystem picks up the NuttX semaphore.h
2013-01-02 18:22:13 +11:00
Andrew Tridgell
ba1a6eb073
AP_HAL: fixed SITL build
2013-01-02 14:48:15 +11:00
Andrew Tridgell
d3f154bbae
AP_HAL: include stdbool.h for ARM build
2013-01-02 14:45:09 +11:00
Andrew Tridgell
0ef003a45f
AP_HAL: added PX4 board support
2012-12-30 20:02:45 +11:00
Andrew Tridgell
0186fabb3b
build: allow building with the "Empty" HAL
...
useful for porting
2012-12-24 07:30:50 +11:00
Pat Hickey
1678dcc6f0
AP_HAL: GPIO INTERRUPT defines
2012-12-22 09:11:11 +11:00
Andrew Tridgell
93040e5725
AP_HAL: removed the defer_timer_process() function
...
this is now unused
2012-12-21 20:01:42 +11:00
Andrew Tridgell
60d3df50ae
AP_HAL: changed delay() to take a uint16_t
...
this allows for up to 32 second delays, and saves a bit of flash space
2012-12-20 14:53:23 +11:00
Pat Hickey
7681fef988
AP_HAL: BetterStream gets vprintf and vprintf_P methods
2012-12-20 14:53:22 +11:00
Pat Hickey
0d702045b8
AP_HAL: Add Util member for string utilities
2012-12-20 14:52:37 +11:00
Andrew Tridgell
4cff98dcae
AP_HAL: added AP_HAL_BOARD_DRIVER define
...
this makes example sketches easier to read
2012-12-20 14:52:33 +11:00
Pat Hickey
d2f7402243
AP_HAL: add bulk transaction to SPIDeviceDriver
2012-12-20 14:52:32 +11:00
Pat Hickey
c86004d676
AP_HAL: Add panic method to scheduler
2012-12-20 14:52:31 +11:00
Pat Hickey
eda450a166
AP_HAL: I2CDriver bug fixed for pure virtual base class
2012-12-20 14:52:31 +11:00
Pat Hickey
b79bd01761
SPIDriver: namespace explicit to better permit copypasta
2012-12-20 14:52:30 +11:00
Pat Hickey
527dfb5af4
AP_HAL: remove EmptyUARTDriver
2012-12-20 14:52:30 +11:00
Pat Hickey
d18b9feaa1
AP_HAL: add HAL_BOARD_EMPTY to AP_HAL_BOARDS
2012-12-20 14:52:30 +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
fa02ad7d4c
AP_HAL: preprocessor enum of HAL_BOARD
2012-12-20 14:51:37 +11:00
Pat Hickey
9cee6cc941
AP_HAL: remove Dataflash driver
2012-12-20 14:51:37 +11:00
Pat Hickey
cb38651df5
AP_HAL: RCInput has overrides
2012-12-20 14:51:34 +11:00
Pat Hickey
8879cbbc69
AP_HAL: Console uses only sized int types
2012-12-20 14:51:33 +11:00
Pat Hickey
de4adefe4e
AP_HAL: AnalogIn uses only sized int types
2012-12-20 14:51:33 +11:00
Pat Hickey
243590bb73
AP_HAL: UARTDriver & Stream uses only sized int types
...
Signed-off-by: Pat Hickey <pat@galois.com>
2012-12-20 14:51:33 +11:00
Pat Hickey
709869f8ce
AP_HAL: use sized ints in GPIO
2012-12-20 14:51:33 +11:00
Pat Hickey
ca4bc8d760
AP_HAL: AnalogIn read changed to read_latest and read_average
2012-12-20 14:51:33 +11:00
Pat Hickey
6218d7779f
AP_HAL: expose DF_LOGGING_FORMAT to user
2012-12-20 14:51:33 +11:00
Pat Hickey
3bca50f422
AP_HAL: BetterStream removes printf attribute from _printf_P
2012-12-20 14:51:33 +11:00
Pat Hickey
592d32ba47
AP_HAL: add reboot to scheduler
2012-12-20 14:51:32 +11:00
Pat Hickey
7049934a69
AP_HAL: AnalogIn channel gets scale, source gets set_pin
2012-12-20 14:51:32 +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
2a12392b9e
AP_HAL: export semaphore header
2012-12-20 14:51:30 +11:00
Pat Hickey
b2c44d8a81
AP_HAL: move AP_Semaphore to be part of the HAL
2012-12-20 14:51:30 +11:00
Pat Hickey
f4b5ef9fad
AP_HAL AnalogIn: gets constants for BOARD_VCC and NONE
2012-12-20 14:51:30 +11:00
Pat Hickey
47f555feac
AP_HAL_AVR: I2CDriver increments lockup count on any error
...
tridge made these changes to the "I2c" lib in a3589f2956
2012-12-20 14:51:30 +11:00
Pat Hickey
c9541d3b00
AP_HAL: added begin_atomic and end_atomic to scheduler
2012-12-20 14:51:29 +11:00
Pat Hickey
7908e41416
AP_HAL Storage: use a int type rather than pointer type for location
2012-12-20 14:51:29 +11:00
Pat Hickey
a399851ca2
AP_HAL: Depend on AP_Progmem rather than AP_Common to provide pstr
2012-12-20 14:51:28 +11:00
Pat Hickey
bae7e4b88e
AP_HAL Scheduler: simplify register_timer_process, min time for delay cb
2012-12-20 14:51:27 +11:00
Andrew Tridgell
87e300b119
AP_HAL: added double print functions
...
this copes with the fact that the compiler doesn't really know that
float and double are the same things
2012-12-20 14:51:27 +11:00
Pat Hickey
7480707f9e
AP_HAL: Add attach_interrupt method to GPIO
2012-12-20 14:51:26 +11:00
Pat Hickey
d422ab7806
AP_HAL: Extend Scheduler to support defered timer procs
...
* based on queue_proc from AP_PeriodicProcess
2012-12-20 14:51:26 +11:00
Pat Hickey
73ccfaf2d7
AP_HAL: implement DigitalSource abstraction
...
* GPIO's complement to AnalogSource
2012-12-20 14:51:25 +11:00
Pat Hickey
017f592eef
AP_HAL: add ConsoleDriver interface
2012-12-20 14:51:24 +11:00
Pat Hickey
36154559fc
AP_HAL: change txspace from a BetterStream method to a Stream method.
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
6671310399
AP_HAL Scheduler: interface has AP_PeriodicProcess functionality
2012-12-20 14:51:22 +11:00
Pat Hickey
af68c09591
AP_HAL Namespace: typedef Proc and TimedProc
2012-12-20 14:51:22 +11:00
Pat Hickey
187571cca9
AP_HAL Scheduler fixes & AP_HAL_AVR Scheduler changed to match
2012-12-20 14:51:22 +11:00
Pat Hickey
2adfc4fbc5
AP_HAL Scheduler add method register_delay_callback (unimplemented)
2012-12-20 14:51:22 +11:00
Pat Hickey
1d89419059
AP_HAL: Scheduler should use stdint types, conform names
2012-12-20 14:51:22 +11:00
Pat Hickey
06441b4117
AP_HAL_AVR Dataflash implemented, tested for APM2
...
* Need to get my APM1 board from home to test it on there...
2012-12-20 14:51:21 +11:00
Pat Hickey
34ec5081e2
AP_HAL: Dataflash interface populated
2012-12-20 14:51:21 +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
261ef791a7
AP_HAL Storage: trivial interface and implementation wraps avr/eeprom funcs
2012-12-20 14:51:21 +11:00
Pat Hickey
b0d8f43111
AP_HAL_AVR: Implemented SPIDriver based on Arduino, but it doesn't work yet
...
* I don't have an APM2.5 board I can easily connect a logic analyzer to see
the traffic on the bus...
2012-12-20 14:51:21 +11:00
Pat Hickey
5445ad02f8
AP_HAL_AVR: RCOutput tested implementation for APM2
2012-12-20 14:51:21 +11:00
Pat Hickey
acfbddef0d
AP_HAL: proper RCOutput interface specification
2012-12-20 14:51:20 +11:00
Pat Hickey
fb6abbe191
AP_HAL: proper RCInput interface specification
2012-12-20 14:51:20 +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
46f31aa69c
AP_HAL_AVR: Implement I2CDriver based on libraries/I2C
...
* Removed a ton of code we don't need from that driver, which should make
writing new drivers easier.
2012-12-20 14:51:20 +11:00
Pat Hickey
cae931a93a
AP_HAL_AVR UARTDriver does basic hello world printing
...
* will import more complex tests next
2012-12-20 14:51:20 +11:00
Pat Hickey
e9c5f07db2
AP_HAL: Working GPIO interface & implementation
...
* actually, tested the output only... gotta do input next
2012-12-20 14:51:20 +11:00