summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/machine_i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'extmod/machine_i2c.h')
-rw-r--r--extmod/machine_i2c.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h
index 39f4858348..d49ff01e46 100644
--- a/extmod/machine_i2c.h
+++ b/extmod/machine_i2c.h
@@ -40,6 +40,18 @@ typedef struct _mp_machine_i2c_p_t {
int (*writeto)(mp_obj_base_t *obj, uint16_t addr, const uint8_t *src, size_t len, bool stop);
} mp_machine_i2c_p_t;
+typedef struct _mp_machine_soft_i2c_obj_t {
+ mp_obj_base_t base;
+ uint32_t us_delay;
+ uint32_t us_timeout;
+ mp_hal_pin_obj_t scl;
+ mp_hal_pin_obj_t sda;
+} mp_machine_soft_i2c_obj_t;
+
extern const mp_obj_type_t machine_i2c_type;
+extern const mp_obj_dict_t mp_machine_soft_i2c_locals_dict;
+
+int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t *dest, size_t len, bool stop);
+int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uint8_t *src, size_t len, bool stop);
#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H__