i2ccmds: abstract i2c dev from bus implementation

Added wrapper around sw/hw bus API,
pins.py code will ensure that pins will not mix
between HW/SW buses.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
Timofey Titovets
2024-09-13 22:02:05 +02:00
committed by KevinOConnor
parent 39f08aeda1
commit 08a85ba869
4 changed files with 37 additions and 25 deletions

View File

@@ -7,7 +7,6 @@
#include <string.h> // memcpy
#include "basecmd.h" // oid_alloc
#include "board/gpio.h" // i2c_read
#include "board/irq.h" // irq_disable
#include "board/misc.h" // timer_read_time
#include "command.h" // DECL_COMMAND
@@ -147,7 +146,7 @@ check_home(struct ldc1612 *ld, uint32_t data)
static void
read_reg(struct ldc1612 *ld, uint8_t reg, uint8_t *res)
{
i2c_read(ld->i2c->i2c_config, sizeof(reg), &reg, 2, res);
i2c_dev_read(ld->i2c, sizeof(reg), &reg, 2, res);
}
// Read the status register on the ldc1612