Commit Graph

56 Commits

Author SHA1 Message Date
Mark Charlebois 78dd177e86 Linux: removed documentation of parameter
The parameter is not present in the linux implementation so removed
the documentation for the parameter.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois ccd18929fc Linux: changed CDev to VDev for virtual device implementation
To avoid confusion when a real device and a virtual device is
being used, changed CDev to VDev for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois 8c8f57b5b4 Fixed std::isfinite vs isfinite differences
Added PX4_ISFINITE(x) to px4_defines.h to handle the differences on
NuttX and Linux.

This change also picked up some file renaming for virtual character devices

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois 340beac672 Linux: I2C virtual device
Create and open I2C virtual device and support I2C_RDWR ioctl

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:16:26 -07:00
Mark Charlebois 653c14fcbb Linux: Handle nullptr passed to I2C constructor
I2C class derives from CDev class which requires a devname
but in at least some instances, a nullptr is passed for devname.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois 62eb403e4d Linus: print format fixes to build with clang on IFC6410
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois 13d84ef17b Linux: I2C opens /dev/i2c-x
For now it uses the bus number as the id. Not sure how this should
actually be mapped.

Seems like the I2C devices come up in random order and have random
id but that a specific device can be found in the /sys/bus/i2c
interface.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois cd30b4d5ca Linux: added I2C class
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois 2feeecdab1 Linux: Added config and stubs to compile I2C device for Linux
Not yet functional. Full implementation will provide an IOCTL interface to
do bi-directional transfer. will model the interface after Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois d013ac0927 Support for building more modules with Linux
Added more queue support to linux/px4_layer.

Use virt char devices for ms5611, and mavlink.

Added more HRT functionality. uORB latency test
now fails. Likely due to bad HRT impl for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 7b0783a070 Added MuORB based on virtual CDev implementation
uORB module now compiles and runs for Linux using the
virtual CDev implementation.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois 9718404d7f Added new file for virt dev posix-like functions and test case
Moved posix-like functions to vcdev_posix.cpp and updated the
copyright notice.

Added test case to make sure poll unblocks when a write occurs.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:17 -07:00
Mark Charlebois 97a72563b8 Fixes to compile again for NuttX
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:17 -07:00
Mark Charlebois f3596e555b Added
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:16 -07:00
Mark Charlebois 9758112e31 Use px4_config.h instead of nuttx/config.h
Modified code to use OS independent header file for config settings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -07:00
Daniel Agar 8aae66b893 trivial code style cleanup round 2 2015-03-27 23:38:58 -04:00
Andrew Tridgell 1b8a830a38 i2c: prevent double free of _dev pointer
this caused heap corruption
2015-02-14 11:16:02 +01:00
Lorenz Meier f9d3cfc493 SPI: Log device clock on startup 2015-02-13 09:13:20 +01:00
Lorenz Meier c0d246e8e4 CDEV::I2C: Enforce one speed per bus 2015-02-13 09:12:38 +01:00
Lorenz Meier 138058d547 Device class reg: Always use 0-based index 2015-02-09 22:56:21 +01:00
Lorenz Meier f99c29c50c Dev info: Reflect address changes 2015-01-03 17:54:49 +01:00
Lorenz Meier bf134e6979 Allow to get access to dev name 2015-01-02 12:28:21 +01:00
Randy Mackay ac9e9835ac i2c: const get_address 2014-12-30 13:43:08 +09:00
Holger Steinhaus 51ffb887c3 UAVCAN: initialize device id for mag and baro to allow DEVIOCGDEVICEID ioctl to return useful data 2014-11-11 11:29:35 +01:00
Randy Mackay 0e51b99915 device: initialise device id
Conflicts:
	mavlink/include/mavlink/v1.0
2014-10-08 10:39:17 +02:00
Lorenz Meier c5e4f33bb3 Merge sensor_startup_cleanup 2014-07-16 15:26:22 +02:00
Lorenz Meier 11eeb7466d Merge branch 'ext_mag_param' into logging 2014-07-16 15:00:58 +02:00
Lorenz Meier da4967e8e4 I2C driver: forbid copy constructor 2014-07-16 08:54:17 +02:00
Lorenz Meier 8107205b9e device driver: Fix compile warnings 2014-07-16 08:47:31 +02:00
Lorenz Meier 9e97994ef9 drivers: Up to three units support 2014-07-15 23:20:02 +02:00
Lorenz Meier e696ed5509 Merged master 2014-07-15 22:07:03 +02:00
Lorenz Meier b0b6ee0644 Forbid copy constructor in CDev 2014-07-15 18:22:38 +02:00
Andrew Tridgell 20cd5026d8 device: use bitfields to keep DeviceStructure small
this keeps it small enough to fit in a float, which makes it possible
to see the full value in a MAVLink tlog

Conflicts:
	mavlink/include/mavlink/v1.0
2014-07-12 16:27:19 +02:00
Andrew Tridgell 6cffa948fe device: pass CDev::ioctl() to superclass
this allows DEVIOCGDEVICEID to work.
2014-07-12 16:26:21 +02:00
Andrew Tridgell 93d444d1aa device: added a _device_id to all drivers
this device ID identifies a specific device via the tuple of (bus, bus
type, address, devtype). This allows device specific configuration
data to be stored along with a device ID, so the code can know when
the user has changed device configuration (such as removing an
external compass), and either invalidate the device configuration or
force the user to re-calibrate
2014-07-12 16:25:43 +02:00
Lorenz Meier a2f528c5ba Merged master 2014-07-12 16:11:43 +02:00
Lorenz Meier a6b52f1c9f HMC5883 post merge cleanup 2014-07-08 13:49:24 +02:00
Andrew Tridgell fea4845ed9 SPI: make _bus protected
this allows runtime use of internal/external bus to determine if DRDY
should be used on the L3GD20
2014-07-08 11:43:58 +02:00
px4dev ef6c99c1ab Restructure the locking around SPI transfers 2014-07-06 11:40:28 -07:00
Lorenz Meier a2ef04146a Introduce enum / define for multiple devices 2014-06-10 15:05:22 +02:00
Lorenz Meier bb7962936e CDev: Fixed printf format specifier 2014-03-16 18:37:16 +01:00
Lorenz Meier bb8956c84e Fixed return value 2014-01-14 16:04:12 +01:00
Lorenz Meier 9bf512cac8 Framework to support disabling publications via IOCTL 2014-01-12 11:52:41 +01:00
Andrew Tridgell b2b9665e44 device: added register_class_devname() API
this allows drivers to register generic device names for a device
class, with automatic class instance handling
2013-12-10 11:31:04 +01:00
Andrew Tridgell 244c3602f2 SPI: added set_frequency() API
this allows the bus speed to be changed on the fly by device
drivers. This is needed for the MPU6000
2013-11-30 20:17:09 +11:00
px4dev 19fdaf2009 Use the generic device::SPI locking strategy. 2013-09-12 23:56:53 -07:00
Andrew Tridgell 760b3ab2e7 ringbuffer: converted to item_size units
this fixes a number of indexing bugs
2013-09-12 00:53:14 +02:00
px4dev cefc7ac00e Rework the ringbuffer class so that it's not templated, and refactor its clients so they aren't dancing around the linker anymore. 2013-09-12 00:53:08 +02:00
Andrew Tridgell 3329e3c38c ringbuffer: added resize() and print_info() methods
this simplifies the drivers
2013-09-12 00:51:34 +02:00
px4dev 1828b57c58 ringbuffer: added force() and use lockless methods
this adds force() which can be used for drivers wanting consumers to
get the latest data when the buffer overflows
2013-09-12 00:51:24 +02:00