Commit Graph

293 Commits

Author SHA1 Message Date
Julien BERAUD a057a8a009 AP_HAL_Linux: Add Support for RCInput_UDP
very simple protocol to receive RC cmds via UDP
Add support for it on the bebop
2015-09-07 12:10:08 +10:00
Lucas De Marchi 0000ff45cb AP_HAL_Linux: RCOutput_PCA9685: remove trailing whitespace 2015-09-03 18:43:21 +10:00
Lucas De Marchi 18321a77c4 AP_HAL_Linux: rename RCOutput_Navio to RCOutput_PCA9685
The RCOutput_Navio is now generic enough to be used by other boards.
Rename it to use the name of the chip, PCA9685.
2015-09-03 18:43:21 +10:00
Lucas De Marchi e1f0284df2 AP_HAL_Linux: PCA9685: build on all Linux boards 2015-09-03 18:43:21 +10:00
Fabio Mello c0caed1b64 AP_HAL_Linux: RCOutput_Navio: allow to use internal clock
It's possible to use the internal clock in PCA96895 if we account for
the drift it contains. This is a bit different from solutions in other
projects like the Adafruit library and the PX4 firmware: instead of
applying a correction to the final frequency we apply the correction to
the clock since this is the source of the error.

With this fix we arrived to much better results across different lots of
sensors.

The Navio board continues to use the external clock and should have no
difference behavior.
2015-09-03 18:43:21 +10:00
Lucas De Marchi 6c042b6666 AP_HAL_Linux: RCOutput_Navio: allow to have other offset 2015-09-03 18:43:21 +10:00
Lucas De Marchi 3beaf34aa1 AP_HAL_Linux: RCOutput_Navio: allow to have other OE pin
While at it also rename enable_pin to follow the convention of starting
with underscore for private members.
2015-09-03 18:43:21 +10:00
Gustavo Jose de Sousa 4af2a9a9cc AP_HAL_Linux: SPI: adapt to the new signature of transaction() 2015-09-01 20:26:05 +10:00
Lucas De Marchi dabfeff440 AP_HAL_Linux: standardize inclusion of libaries headers
Do the missing header changes due to changing the code before the pr
getting accepted.
2015-08-18 17:12:51 +10:00
Gustavo Jose de Sousa 124b750c10 AP_HAL_Linux: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00
Andrew Tridgell 45a7c37734 HAL_Linux: added bcast flag for udp broadcast 2015-07-29 16:46:53 +10:00
Andrew Tridgell b99740cb93 HAL_Linux: sped up UDP transfers by about 25x
allow more than 1 packetised transfer per tick
2015-07-29 14:19:46 +10:00
Andrew Tridgell a5c7aa1b19 HAL_Linux: allow startup before network bringup
this makes it possible to bootup ardupilot before the desired network
interface is available. This is very useful for when using 3G dongles
in aircraft
2015-07-29 09:55:47 +10:00
Andrew Tridgell 55fc66ec65 HAL_Linux: implemented TCP server as a single driver
the wait flag just changes startup behaviour. The TCP server should
always be a server with listen and accept. We don't need two drivers
2015-07-29 09:37:57 +10:00
Andrew Tridgell f72d9c6393 HAL_Linux: replace recvfrom with recv 2015-07-29 08:39:29 +10:00
Andrew Tridgell 3f3aaa3c50 HAL_Linux: removed 0 timeout from sendto call 2015-07-29 08:36:50 +10:00
Staroselskii Georgii aa3efecef3 AP_HAL_Linux: fixed _parseDevicePath() in LinuxUARTDRiver
The current implementation doesn't throw an error on a malformed path string.

i.e. udp:192.168.1.1.14550 instead of udp:192.168.1.1:14550 may result in a memory leak or whatsoever.

The commit fixes the issue and outputs a nice error message if anything's wrong.
2015-07-29 08:36:09 +10:00
Staroselskii Georgii 0362128265 AP_HAL_Linux: renamed TCPClientDevice 2015-07-29 08:36:09 +10:00
Staroselskii Georgii 211acbec9c AP_HAL_Linux: renamed TCPServerDevice
A more appropriate name for the class.
2015-07-29 08:36:08 +10:00
Staroselskii Georgii a3f47878a2 AP_HAL_Linux: made UARTDriver use TCPServerDevice 2015-07-29 08:36:08 +10:00
Staroselskii Georgii 56f760f022 AP_HAL_Linux: added TCPServerDevice 2015-07-29 08:36:08 +10:00
Staroselskii Georgii eacc085289 AP_HAL_Linux: made UARTDriver use TCPClientDevice 2015-07-29 08:36:07 +10:00
Staroselskii Georgii a5ef931f5c AP_HAL_Linux: added TCPClientDevice 2015-07-29 08:36:07 +10:00
Staroselskii Georgii 6e34dd9669 AP_HAL_Linux: got rid of TCP connection 2015-07-29 08:36:07 +10:00
Staroselskii Georgii de6b2b4bce AP_HAL_Linux: made UARTDriver use ConsoleDevice 2015-07-29 08:36:07 +10:00
Staroselskii Georgii a9c9d91f09 AP_HAL_Linux: added ConsoleDevice 2015-07-29 08:36:06 +10:00
Staroselskii Georgii 6ec67a9bfd AP_HAL_Linux: made UARTDriver use UDPDevice 2015-07-29 08:36:06 +10:00
Staroselskii Georgii 1881878c3a AP_HAL_Linux: added UDPDevice 2015-07-29 08:36:06 +10:00
Staroselskii Georgii 656399541f AP_HAL_Linux: encapsulated LinuxUARTDriver::_deallocate_buffers 2015-07-29 08:36:06 +10:00
Staroselskii Georgii f117134443 AP_HAL_Linux: made UARTDriver use UARTDevice 2015-07-29 08:36:05 +10:00
Staroselskii Georgii acd180ae96 AP_HAL_Linux: added UARTDevice 2015-07-29 08:36:05 +10:00
Staroselskii Georgii 6b94fd7603 AP_HAL_Linux: added SerialDevice interface
Adds the interface that will be used for encapsulating various mediums
that can be used in the Linux port.
2015-07-29 08:36:05 +10:00
Staroselskii Georgii dacbdb57c4 AP_HAL_Linux: added _serial_start_connection 2015-07-29 08:36:05 +10:00
Staroselskii Georgii 44198bd4eb AP_HAL_Linux: encapsulated LinuxUARTDriver::allocate_buffers 2015-07-29 08:36:04 +10:00
Staroselskii Georgii 94de9416fe AP_HAL_Linux: use defines instead of hardcoding fd numbers in UARTDriver 2015-07-29 08:36:04 +10:00
Jean-Baptiste Dubois f6aba6c952 HAL_Linux: add read_obs_data to RCOutput_Bebop 2015-07-23 21:49:28 +09:00
Staroselskii Georgii d7ac725a64 AP_HAL_Linux: fixed signal handler in RCInput_Navio
DMA is getting stopped in the separate method now. This is the best we
can get at the current time. It does yield slightly better experience
and works in the majority of cases.

The patch is a no bulletproof solution, though.

There's a possibility of corruption in case of e.g. a SIGKILL. There's
no signal framework at the time and the commit doesn't add one. That's
why all signals are handled in the same erroneous way. This is not a
good nor a final solution to the issue.

For the issue at hand a better fix might be porting the code to kernel
space but it's a rather tediuos task that we cannot undertake in the
couple of weeks.
2015-07-23 08:51:38 +10:00
Staroselskii Georgii 8528a7d159 AP_HAL_Linux: added deinit logic for RCInput_Navio
DMA needs to be stopped if a panic occurs.
2015-07-23 08:51:37 +10:00
Staroselskii Georgii f4d14f73ba AP_HAL_Linux: extended panic handling with RCInput deinitialization
The issue has already come up. There's no deinitialization mechanisms at the moment. As APM is rather software than firmware on Linux, there're some clean-up work that needs to be done. This commit triggers deinitialization of RCInput on a panic.
2015-07-23 08:51:37 +10:00
Lucas De Marchi cfc2972e51 AP_HAL_Linux: use ARRAY_SIZE macro 2015-07-21 14:24:58 +09:00
Jean-Baptiste Dubois 7dcfe1c667 RCOutput_Bebop: group channels write 2015-07-20 09:23:13 +10:00
Jean-Baptiste Dubois 9e5d13c1de RCOutput_Bebop: use CLOCK_MONOTONIC instead of CLOCK_REALTIME
CLOCK_MONOTONIC is not affected by discontinuous jumps in the system time.
2015-07-15 12:08:44 +02:00
Staroselskii Georgii 72820303d4 AP_HAL_Linux: set higher SPI speed for Navio
We can set a higher speed on newer Linux kernels since
52469b2a38.
The older ones will just floor the value.
2015-07-10 18:59:18 +10:00
Julien BERAUD 954ec71630 HAL_Linux: added rcout implementation for bebop 2015-07-10 16:46:30 +10: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
Daniel Frenzel c49e44d02c HAL_LInux: RCInput for Navio
Cleaned the code a bit

Signed-off-by: Daniel Frenzel <dgdanielf@gmail.com>
2015-07-06 11:19:33 +10:00
Lucas De Marchi fde43a77b3 AP_HAL_Linux: allow to change spi device state
Allowing to change the SPI device state allows us to save the
information whether the device was already initialized and avoid 2
separate drivers to initialize it.
2015-07-06 10:48:06 +10:00
mirkix e6363ea95d AP_HAL_Linux: BBBMINI uses /dev/i2c-2 2015-07-06 10:09:21 +10:00
Lucas De Marchi b211b86204 AP_HAL_Linux: don't manually define number of spi devices
It's error-prone, let's make the compiler define it for us.
2015-07-06 10:07:22 +10:00
Andrew Tridgell 5f0302ed9f HAL_Linux: fixed chaining of getopt calls 2015-07-01 20:44:07 +10:00