|
virtual int | init ()=0 |
| Initialise the driver and make it ready for use. More...
|
|
virtual int | read (unsigned offset, void *data, unsigned count=1) |
| Read directly from the device. More...
|
|
virtual int | write (unsigned address, void *data, unsigned count=1) |
| Write directly to the device. More...
|
|
virtual | ~Device ()=default |
| Destructor. More...
|
|
virtual int | ioctl (unsigned operation, unsigned &arg) |
| Perform a device-specific operation. More...
|
|
uint8_t | get_device_bus () const |
| Return the bus ID the device is connected to. More...
|
|
uint32_t | get_device_id () const |
|
DeviceBusType | get_device_bus_type () const |
| Return the bus type the device is connected to. More...
|
|
uint8_t | get_device_address () const |
| Return the bus address of the device. More...
|
|
void | set_device_address (int address) |
|
void | set_device_type (uint8_t devtype) |
| Set the device type. More...
|
|
virtual bool | external () |
|
|
enum | DeviceBusType { DeviceBusType_UNKNOWN = 0,
DeviceBusType_I2C = 1,
DeviceBusType_SPI = 2,
DeviceBusType_UAVCAN = 3
} |
| Device bus types for DEVID.
|
|
static const char * | get_device_bus_string (DeviceBusType bus) |
|
static int | device_id_print_buffer (char *buffer, int length, uint32_t id) |
| Print decoded device id string to a buffer. More...
|
|
§ init() [1/2]
virtual int PX4IO_serial::init |
( |
| ) |
|
|
pure virtual |
Initialise the driver and make it ready for use.
- Returns
- OK if the driver initialized OK, negative errno otherwise;
Reimplemented from device::Device.
§ init() [2/2]
int PX4IO_serial::init |
( |
IOPacket * |
io_buffer | ) |
|
|
protected |
Does the PX4IO_serial instance initialization.
- Parameters
-
io_buffer | The IO buffer that should be used for transfers. |
- Returns
- 0 on success.
§ read()
int PX4IO_serial::read |
( |
unsigned |
address, |
|
|
void * |
data, |
|
|
unsigned |
count = 1 |
|
) |
| |
|
virtual |
Read directly from the device.
The actual size of each unit quantity is device-specific.
- Parameters
-
offset | The device address at which to start reading |
data | The buffer into which the read values should be placed. |
count | The number of items to read. |
- Returns
- The number of items read on success, negative errno otherwise.
Reimplemented from device::Device.
§ write()
int PX4IO_serial::write |
( |
unsigned |
address, |
|
|
void * |
data, |
|
|
unsigned |
count = 1 |
|
) |
| |
|
virtual |
Write directly to the device.
The actual size of each unit quantity is device-specific.
- Parameters
-
address | The device address at which to start writing. |
data | The buffer from which values should be read. |
count | The number of items to write. |
- Returns
- The number of items written on success, negative errno otherwise.
Reimplemented from device::Device.
The documentation for this class was generated from the following files: