uc1701: Update bus import to "from .. import bus"

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-06-12 13:38:12 -04:00
parent f931da1b87
commit 0e9aa76066
1 changed files with 8 additions and 9 deletions

View File

@ -5,7 +5,7 @@
# #
# This file may be distributed under the terms of the GNU GPLv3 license. # This file may be distributed under the terms of the GNU GPLv3 license.
import logging import logging
import extras.bus from .. import bus
from . import font8x14 from . import font8x14
BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000 BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000
@ -113,11 +113,10 @@ class DisplayBase:
# IO wrapper for "4 wire" spi bus (spi bus with an extra data/control line) # IO wrapper for "4 wire" spi bus (spi bus with an extra data/control line)
class SPI4wire: class SPI4wire:
def __init__(self, config, data_pin_name): def __init__(self, config, data_pin_name):
self.spi = extras.bus.MCU_SPI_from_config(config, 0, self.spi = bus.MCU_SPI_from_config(config, 0, default_speed=10000000)
default_speed=10000000)
dc_pin = config.get(data_pin_name) dc_pin = config.get(data_pin_name)
self.mcu_dc = extras.bus.MCU_bus_digital_out( self.mcu_dc = bus.MCU_bus_digital_out(self.spi.get_mcu(), dc_pin,
self.spi.get_mcu(), dc_pin, self.spi.get_command_queue()) self.spi.get_command_queue())
def send(self, cmds, is_data=False): def send(self, cmds, is_data=False):
self.mcu_dc.update_digital_out(is_data, self.mcu_dc.update_digital_out(is_data,
reqclock=BACKGROUND_PRIORITY_CLOCK) reqclock=BACKGROUND_PRIORITY_CLOCK)
@ -126,8 +125,8 @@ class SPI4wire:
# IO wrapper for i2c bus # IO wrapper for i2c bus
class I2C: class I2C:
def __init__(self, config, default_addr): def __init__(self, config, default_addr):
self.i2c = extras.bus.MCU_I2C_from_config( self.i2c = bus.MCU_I2C_from_config(config, default_addr=default_addr,
config, default_addr=default_addr, default_speed=400000) default_speed=400000)
def send(self, cmds, is_data=False): def send(self, cmds, is_data=False):
if is_data: if is_data:
hdr = 0x40 hdr = 0x40
@ -143,8 +142,8 @@ class ResetHelper:
self.mcu_reset = None self.mcu_reset = None
if pin_desc is None: if pin_desc is None:
return return
self.mcu_reset = extras.bus.MCU_bus_digital_out( self.mcu_reset = bus.MCU_bus_digital_out(io_bus.get_mcu(), pin_desc,
io_bus.get_mcu(), pin_desc, io_bus.get_command_queue()) io_bus.get_command_queue())
def init(self): def init(self):
if self.mcu_reset is None: if self.mcu_reset is None:
return return