|
35 | 35 | #include "shared-bindings/busio/I2C.h"
|
36 | 36 | #include "shared-bindings/is31fl3741/IS31FL3741.h"
|
37 | 37 |
|
38 |
| - |
39 |
| -//| """Low-level is31fl3741 implementation |
40 |
| -//| |
41 |
| -//| The `is31fl3741_write` module contains a helper method to write out bytes in |
42 |
| -//| over the I2C bus.""" |
43 |
| -//| |
44 | 38 | //| def is31fl3741_write(i2c: busio.I2C, addr: int, mapping: Tuple[int, ...], buf: ReadableBuffer) -> None:
|
45 | 39 | //| """Write buf out on the given I2C bus.
|
46 | 40 | //|
|
@@ -79,33 +73,9 @@ STATIC mp_obj_t is31fl3741_is31fl3741_write(size_t n_args, const mp_obj_t *pos_a
|
79 | 73 | }
|
80 | 74 | MP_DEFINE_CONST_FUN_OBJ_KW(is31fl3741_is31fl3741_write_obj, 0, is31fl3741_is31fl3741_write);
|
81 | 75 |
|
82 |
| -//| def is31fl3741_init(i2c: busio.I2c, addr: int) -> None: |
83 |
| -//| """Initialize the IS31FL3741 device. |
84 |
| -//| |
85 |
| -//| :param ~busio.I2C i2c: the I2C bus to output with |
86 |
| -//| :param ~int addr: the I2C address of the IS31FL3741 device""" |
87 |
| -//| ... |
88 |
| -STATIC mp_obj_t is31fl3741_is31fl3741_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { |
89 |
| - enum { ARG_i2c, ARG_addr }; |
90 |
| - static const mp_arg_t allowed_args[] = { |
91 |
| - { MP_QSTR_i2c, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, |
92 |
| - { MP_QSTR_addr, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0x30 } }, |
93 |
| - }; |
94 |
| - |
95 |
| - mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; |
96 |
| - mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); |
97 |
| - |
98 |
| - mp_obj_t i2c = mp_arg_validate_type(args[ARG_i2c].u_obj, &busio_i2c_type, MP_QSTR_i2c_bus); |
99 |
| - |
100 |
| - common_hal_is31fl3741_init(i2c, args[ARG_addr].u_int); |
101 |
| - return mp_const_none; |
102 |
| -} |
103 |
| -MP_DEFINE_CONST_FUN_OBJ_KW(is31fl3741_is31fl3741_init_obj, 0, is31fl3741_is31fl3741_init); |
104 |
| - |
105 | 76 | STATIC const mp_rom_map_elem_t is31fl3741_module_globals_table[] = {
|
106 | 77 | { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_is31fl3741) },
|
107 | 78 | { MP_ROM_QSTR(MP_QSTR_IS31FL3741), MP_ROM_PTR(&is31fl3741_IS31FL3741_type) },
|
108 |
| - { MP_OBJ_NEW_QSTR(MP_QSTR_is31fl3741_init), (mp_obj_t)&is31fl3741_is31fl3741_init_obj }, |
109 | 79 | { MP_OBJ_NEW_QSTR(MP_QSTR_is31fl3741_write), (mp_obj_t)&is31fl3741_is31fl3741_write_obj },
|
110 | 80 | };
|
111 | 81 |
|
|
0 commit comments