20
20
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
21
21
22
22
import board
23
- import digitalio
24
- import displayio
25
23
import adafruit_ili9341
26
- from adafruit_stmpe610 import Adafruit_STMPE610_SPI
27
- import sdcardio
28
- import storage
29
24
from bbq10keyboard import BBQ10Keyboard
30
25
import neopixel
31
26
32
27
33
28
# pylint: disable-msg=too-few-public-methods
34
29
# pylint: disable-msg=too-many-arguments
35
- class KeyboardFeatherwing :
30
+ from adafruit_featherwing .tft_featherwing import TFTFeatherWing
31
+
32
+
33
+ class KeyboardFeatherwing (TFTFeatherWing ):
36
34
"""Class representing a `Keyboard Featherwing`
37
35
<https://www.tindie.com/products/arturo182/keyboard-featherwing-qwerty-keyboard-26-lcd/>`_.
38
36
@@ -48,32 +46,15 @@ def __init__(
48
46
sd_cs = None ,
49
47
neopixel_pin = None ,
50
48
):
51
- displayio .release_displays ()
52
- if spi is None :
53
- spi = board .SPI ()
54
- if cs is None :
55
- cs = board .D9
56
- if dc is None :
57
- dc = board .D10
49
+ super ().__init__ (spi , cs , dc , ts_cs , sd_cs )
50
+
58
51
if i2c is None :
59
52
i2c = board .I2C ()
60
- if ts_cs is None :
61
- ts_cs = board .D6
62
- if sd_cs is None :
63
- sd_cs = board .D5
64
53
if neopixel_pin is None :
65
54
neopixel_pin = board .D11
66
55
67
- self .touchscreen = Adafruit_STMPE610_SPI (spi , digitalio .DigitalInOut (ts_cs ))
68
-
69
- display_bus = displayio .FourWire (spi , command = dc , chip_select = cs )
70
- self .display = adafruit_ili9341 .ILI9341 (display_bus , width = 320 , height = 240 )
56
+ self .display = adafruit_ili9341 .ILI9341 (
57
+ self ._display_bus , width = 320 , height = 240
58
+ )
71
59
self .neopixel = neopixel .NeoPixel (neopixel_pin , 1 )
72
60
self .keyboard = BBQ10Keyboard (i2c )
73
- self ._sdcard = None
74
- try :
75
- self ._sdcard = sdcardio .SDCard (spi , sd_cs )
76
- vfs = storage .VfsFat (self ._sdcard )
77
- storage .mount (vfs , "/sd" )
78
- except OSError as error :
79
- print ("No SD card found:" , error )
0 commit comments