Skip to content

Commit d063bf2

Browse files
committed
Initial commit for IS31
1 parent 932131b commit d063bf2

File tree

15 files changed

+976
-0
lines changed

15 files changed

+976
-0
lines changed

ports/nrf/mpconfigport.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ CIRCUITPY_BLEIO ?= 1
3232
# No I2CPeripheral implementation
3333
CIRCUITPY_I2CPERIPHERAL = 0
3434

35+
CIRCUITPY_IS31FL3741 = 1
36+
3537
CIRCUITPY_RTC ?= 1
3638

3739
# frequencyio not yet implemented

py/circuitpy_defns.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ endif
209209
ifeq ($(CIRCUITPY_IPADDRESS),1)
210210
SRC_PATTERNS += ipaddress/%
211211
endif
212+
ifeq ($(CIRCUITPY_IS31FL3741),1)
213+
SRC_PATTERNS += is31fl3741/%
214+
endif
212215
ifeq ($(CIRCUITPY_KEYPAD),1)
213216
SRC_PATTERNS += keypad/%
214217
endif
@@ -548,6 +551,8 @@ SRC_SHARED_MODULE_ALL = \
548551
imagecapture/ParallelImageCapture.c \
549552
ipaddress/IPv4Address.c \
550553
ipaddress/__init__.c \
554+
is31fl3741/is31fl3741.c \
555+
is31fl3741/__init__.c \
551556
keypad/__init__.c \
552557
keypad/Event.c \
553558
keypad/EventQueue.c \

py/circuitpy_mpconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ extern const struct _mp_obj_module_t nvm_module;
392392
// CIRCUITPY_I2CPERIPHERAL
393393
// CIRCUITPY_IMAGECAPTURE
394394
// CIRCUITPY_IPADDRESS
395+
// CIRCUITPY_IS31FL3741
395396
// CIRCUITPY_KEYPAD
396397
// CIRCUITPY_MATH
397398
// CIRCUITPY_MEMORYMONITOR

py/circuitpy_mpconfig.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ CFLAGS += -DCIRCUITPY_IMAGECAPTURE=$(CIRCUITPY_IMAGECAPTURE)
247247
CIRCUITPY_IPADDRESS ?= $(CIRCUITPY_WIFI)
248248
CFLAGS += -DCIRCUITPY_IPADDRESS=$(CIRCUITPY_IPADDRESS)
249249

250+
CIRCUITPY_IS31FL3741 ?= 0
251+
CFLAGS += -DCIRCUITPY_IS31FL3741=$(CIRCUITPY_IS31FL3741)
252+
250253
CIRCUITPY_JSON ?= $(CIRCUITPY_FULL_BUILD)
251254
CFLAGS += -DCIRCUITPY_JSON=$(CIRCUITPY_JSON)
252255

shared-bindings/is31fl3741/__init__.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2020 Jeff Epler for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include <stdint.h>
28+
29+
#include "py/obj.h"
30+
#include "py/runtime.h"
31+
32+
#include "shared-bindings/is31fl3741/is31fl3741.h"
33+
34+
//| """Low-level routines for bitbanged LED matrices"""
35+
//|
36+
37+
STATIC const mp_rom_map_elem_t is31fl3741_module_globals_table[] = {
38+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_is31fl3741) },
39+
{ MP_ROM_QSTR(MP_QSTR_is31fl3741), MP_ROM_PTR(&is31fl3741_is31fl3741_type) },
40+
};
41+
42+
STATIC MP_DEFINE_CONST_DICT(is31fl3741_module_globals, is31fl3741_module_globals_table);
43+
44+
const mp_obj_module_t is31fl3741_module = {
45+
.base = { &mp_type_module },
46+
.globals = (mp_obj_dict_t *)&is31fl3741_module_globals,
47+
};
48+
49+
MP_REGISTER_MODULE(MP_QSTR_is31fl3741, is31fl3741_module, CIRCUITPY_IS31FL3741);

0 commit comments

Comments
 (0)