35
35
#include "shared-bindings/busio/I2C.h"
36
36
37
37
//| class IS31FL3741:
38
- //| """Driver for a IS31FL3741 device."""
38
+ //| """Driver for an IS31FL3741 device."""
39
39
//|
40
-
41
40
//| def __init__(self, *, width: int) -> None:
42
41
//| """Create a IS31FL3741 object with the given attributes.
43
42
//|
@@ -79,20 +78,34 @@ STATIC mp_obj_t is31fl3741_IS31FL3741_deinit(mp_obj_t self_in) {
79
78
}
80
79
STATIC MP_DEFINE_CONST_FUN_OBJ_1 (is31fl3741_IS31FL3741_deinit_obj , is31fl3741_IS31FL3741_deinit );
81
80
81
+ //| def reset(self) -> None:
82
+ //| """Resets the IS31FL3741 chip."""
83
+ //| ...
84
+ //|
82
85
STATIC mp_obj_t is31fl3741_IS31FL3741_reset (mp_obj_t self_in ) {
83
86
is31fl3741_IS31FL3741_obj_t * self = MP_OBJ_TO_PTR (self_in );
84
87
common_hal_is31fl3741_send_reset (self );
85
88
return mp_const_none ;
86
89
}
87
90
MP_DEFINE_CONST_FUN_OBJ_1 (is31fl3741_IS31FL3741_reset_obj , is31fl3741_IS31FL3741_reset );
88
91
92
+ //| def enable(self) -> None:
93
+ //| """Enables the IS31FL3741 chip."""
94
+ //| ...
95
+ //|
89
96
STATIC mp_obj_t is31fl3741_IS31FL3741_enable (mp_obj_t self_in ) {
90
97
is31fl3741_IS31FL3741_obj_t * self = MP_OBJ_TO_PTR (self_in );
91
98
common_hal_is31fl3741_send_enable (self );
92
99
return mp_const_none ;
93
100
}
94
101
MP_DEFINE_CONST_FUN_OBJ_1 (is31fl3741_IS31FL3741_enable_obj , is31fl3741_IS31FL3741_enable );
95
102
103
+ //| def set_global_current(self, current: int) -> None:
104
+ //| """Sets the global current of the IS31FL3741 chip.
105
+ //|
106
+ //| :param int current: global current value 0x00 to 0xFF"""
107
+ //| ...
108
+ //|
96
109
STATIC mp_obj_t is31fl3741_IS31FL3741_set_global_current (mp_obj_t self_in , mp_obj_t value ) {
97
110
is31fl3741_IS31FL3741_obj_t * self = MP_OBJ_TO_PTR (self_in );
98
111
mp_int_t current = mp_obj_get_int (value );
@@ -101,6 +114,16 @@ STATIC mp_obj_t is31fl3741_IS31FL3741_set_global_current(mp_obj_t self_in, mp_ob
101
114
}
102
115
MP_DEFINE_CONST_FUN_OBJ_2 (is31fl3741_IS31FL3741_set_global_current_obj , is31fl3741_IS31FL3741_set_global_current );
103
116
117
+ //| def set_led(self, led: int, value: int, page: int) -> None:
118
+ //| """Resets the IS31FL3741 chip."""
119
+ //|
120
+ //| :param int led: which LED to set
121
+ //| :param int value: value to set the LED to 0x00 to 0xFF
122
+ //| :param int page: page to write to 0 or 2. If the LED is a >= 180
123
+ //| the routine will automatically write to page 1 or 3 (instead
124
+ //| of 0 ot 2)"""
125
+ //| ...
126
+ //|
104
127
STATIC mp_obj_t is31fl3741_IS31FL3741_set_led (size_t n_args , const mp_obj_t * args ) {
105
128
is31fl3741_IS31FL3741_obj_t * self = MP_OBJ_TO_PTR (args [0 ]);
106
129
mp_int_t led = mp_obj_get_int (args [1 ]);
@@ -111,7 +134,7 @@ STATIC mp_obj_t is31fl3741_IS31FL3741_set_led(size_t n_args, const mp_obj_t *arg
111
134
}
112
135
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (is31fl3741_IS31FL3741_set_led_obj , 4 , 4 , is31fl3741_IS31FL3741_set_led );
113
136
114
- //| def is31fl3741_write (mapping: Tuple[int, ...], buf: ReadableBuffer) -> None:
137
+ //| def write (mapping: Tuple[int, ...], buf: ReadableBuffer) -> None:
115
138
//| """Write buf out on the I2C bus to the IS31FL3741.
116
139
//|
117
140
//| :param ~Tuple[int, ...] mapping: map the pixels in the buffer to the order addressed by the driver chip
0 commit comments