mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-02-09 18:40:46 -07:00
bus: allow mark i2c as write only
If the bus is write only, with new i2c_transfer code it is possible to at least provide some feedback on error Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
parent
8965958a8b
commit
0c2c1dd13b
4 changed files with 40 additions and 18 deletions
|
|
@ -78,16 +78,6 @@ int i2c_dev_write(struct i2cdev_s *i2c, uint8_t write_len, uint8_t *data)
|
|||
return i2c_write(i2c->i2c_hw, write_len, data);
|
||||
}
|
||||
|
||||
void command_i2c_write(uint32_t *args)
|
||||
{
|
||||
uint8_t oid = args[0];
|
||||
struct i2cdev_s *i2c = oid_lookup(oid, command_config_i2c);
|
||||
uint8_t data_len = args[1];
|
||||
uint8_t *data = command_decode_ptr(args[2]);
|
||||
i2c_dev_write(i2c, data_len, data);
|
||||
}
|
||||
DECL_COMMAND(command_i2c_write, "i2c_write oid=%c data=%*s");
|
||||
|
||||
int i2c_dev_read(struct i2cdev_s *i2c, uint8_t reg_len, uint8_t *reg
|
||||
, uint8_t read_len, uint8_t *read)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue