platforms: remove unnecessary i2c platform abstraction

This commit is contained in:
Daniel Agar
2020-01-11 11:55:06 -05:00
parent 54e4b65daa
commit d1e3ff553b
11 changed files with 7 additions and 180 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ I2C::transfer(const uint8_t *send, const unsigned send_len, uint8_t *recv, const
do {
DEVICE_DEBUG("transfer out %p/%u in %p/%u", send, send_len, recv, recv_len);
px4_i2c_msg_t msgv[2] {};
i2c_msg_s msgv[2] {};
unsigned msgs = 0;
if (send_len > 0) {
+2 -2
View File
@@ -42,7 +42,7 @@
#include "../CDev.hpp"
#include <px4_platform_common/i2c.h>
#include <nuttx/i2c/i2c_master.h>
#if !defined(CONFIG_I2C)
# error I2C support requires CONFIG_I2C
@@ -113,7 +113,7 @@ protected:
private:
uint32_t _frequency{0};
px4_i2c_dev_t *_dev{nullptr};
i2c_master_s *_dev{nullptr};
};
+1 -1
View File
@@ -142,7 +142,7 @@ I2C::transfer(const uint8_t *send, const unsigned send_len, uint8_t *recv, const
if (recv_len > 0) {
msgv[msgs].addr = get_device_address();
msgv[msgs].flags = I2C_M_READ;
msgv[msgs].flags = I2C_M_RD;
msgv[msgs].buf = recv;
msgv[msgs].len = recv_len;
msgs++;
-2
View File
@@ -42,8 +42,6 @@
#include "../CDev.hpp"
#include <px4_platform_common/i2c.h>
namespace device __EXPORT
{
+1 -1
View File
@@ -75,7 +75,7 @@ I2C::init()
// Open the actual I2C device
char dev_path[16] {};
snprintf(dev_path, sizeof(dev_path), "/dev/iic-%i", get_device_bus());
snprintf(dev_path, sizeof(dev_path), DEV_FS_I2C_DEVICE_TYPE_STRING"%i", get_device_bus());
_fd = ::open(dev_path, O_RDWR);
if (_fd < 0) {
-2
View File
@@ -42,8 +42,6 @@
#include "../CDev.hpp"
#include <px4_platform_common/i2c.h>
namespace device __EXPORT
{
+1 -2
View File
@@ -42,7 +42,6 @@
#include <px4_platform_common/log.h>
#include <px4_platform_common/module.h>
#include <px4_platform_common/getopt.h>
#include <px4_platform_common/i2c.h>
namespace i2cdetect
{
@@ -80,7 +79,7 @@ int detect(int bus)
do {
uint8_t send_data = 0;
uint8_t recv_data = 0;
px4_i2c_msg_t msgv[2];
i2c_msg_s msgv[2] {};
// send
msgv[0].frequency = 100000;