Refactor the ll40ls namespace driver methods to more closely match the cm8jl65, mappydot, leddar_one, and other distance sensor driver implementations.

This commit is contained in:
mcsauder
2019-09-27 07:55:53 +01:00
committed by Nuno Marques
parent 8ce4a15778
commit 7b16c3482d
13 changed files with 364 additions and 324 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ namespace device
unsigned int I2C::_bus_clocks[BOARD_NUMBER_I2C_BUSES] = BOARD_I2C_BUS_CLOCK_INIT;
I2C::I2C(const char *name, const char *devname, int bus, uint16_t address, uint32_t frequency) :
I2C::I2C(const char *name, const char *devname, const int bus, const uint16_t address, const uint32_t frequency) :
CDev(name, devname),
_frequency(frequency)
{
@@ -167,7 +167,7 @@ out:
}
int
I2C::transfer(const uint8_t *send, unsigned send_len, uint8_t *recv, unsigned recv_len)
I2C::transfer(const uint8_t *send, const unsigned send_len, uint8_t *recv, const unsigned recv_len)
{
px4_i2c_msg_t msgv[2];
unsigned msgs;
+2 -2
View File
@@ -81,7 +81,7 @@ protected:
* @param address I2C bus address, or zero if set_address will be used
* @param frequency I2C bus frequency for the device (currently not used)
*/
I2C(const char *name, const char *devname, int bus, uint16_t address, uint32_t frequency);
I2C(const char *name, const char *devname, const int bus, const uint16_t address, const uint32_t frequency);
virtual ~I2C();
/**
@@ -101,7 +101,7 @@ protected:
* @return OK if the transfer was successful, -errno
* otherwise.
*/
int transfer(const uint8_t *send, unsigned send_len, uint8_t *recv, unsigned recv_len);
int transfer(const uint8_t *send, const unsigned send_len, uint8_t *recv, const unsigned recv_len);
bool external() { return px4_i2c_bus_external(_device_id.devid_s.bus); }