def __init__(self, intside, model): self.model = model gc.collect() self.image = bytearray(BYTES_PER_LINE * LINES_PER_DISPLAY) self.linebuf = bytearray(BYTES_PER_LINE * 2 + BYTES_PER_SCAN) pins = getpins(intside, model) self.Pin_PANEL_ON = pyb.Pin(pins['PANEL_ON'], mode = pyb.Pin.OUT_PP) self.Pin_BORDER = pyb.Pin(pins['BORDER'], mode = pyb.Pin.OUT_PP) self.Pin_DISCHARGE = pyb.Pin(pins['DISCHARGE'], mode = pyb.Pin.OUT_PP) self.Pin_RESET = pyb.Pin(pins['RESET'], mode = pyb.Pin.OUT_PP) self.Pin_BUSY = pyb.Pin(pins['BUSY'], mode = pyb.Pin.IN) self.Pin_EPD_CS = pyb.Pin(pins['EPD_CS'], mode = pyb.Pin.OUT_PP) # cs for e-paper display self.Pin_FLASH_CS = pyb.Pin(pins['FLASH_CS'], mode = pyb.Pin.OUT_PP) # Instantiate flash CS and set high self.Pin_MOSI = pyb.Pin(pins['MOSI'], mode = pyb.Pin.OUT_PP) self.Pin_SCK = pyb.Pin(pins['SCK'], mode = pyb.Pin.OUT_PP) self.Pin_RESET.low() self.Pin_PANEL_ON.low() self.Pin_DISCHARGE.low() self.Pin_BORDER.low() self.Pin_EPD_CS.low() self.Pin_FLASH_CS.high() self.spi_no = pins['SPI_BUS'] if model == EMBEDDED_ARTISTS: self.lm75 = LM75(pins['I2C_BUS']) # early error if not working else: self.adc = pyb.ADC(pins['TEMPERATURE'])
def __init__(self, intside, pwr_controller = None): gc.collect() from panel import getpins self.pwr_controller = pwr_controller self.image = bytearray(BYTES_PER_LINE * LINES_PER_DISPLAY) self.linebuf = bytearray(BYTES_PER_LINE * 2 + BYTES_PER_SCAN) pins = getpins(intside) self.Pin_PANEL_ON = pyb.Pin(pins['PANEL_ON'], mode = pyb.Pin.OUT_PP) self.Pin_BORDER = pyb.Pin(pins['BORDER'], mode = pyb.Pin.OUT_PP) self.Pin_DISCHARGE = pyb.Pin(pins['DISCHARGE'], mode = pyb.Pin.OUT_PP) self.Pin_RESET = pyb.Pin(pins['RESET'], mode = pyb.Pin.OUT_PP) self.Pin_BUSY = pyb.Pin(pins['BUSY'], mode = pyb.Pin.IN) self.Pin_EPD_CS = pyb.Pin(pins['EPD_CS'], mode = pyb.Pin.OUT_PP) # cs for e-paper display self.Pin_FLASH_CS = pyb.Pin(pins['FLASH_CS'], mode = pyb.Pin.OUT_PP) # Instantiate flash CS and set high self.Pin_MOSI = pyb.Pin(pins['MOSI'], mode = pyb.Pin.OUT_PP) self.Pin_SCK = pyb.Pin(pins['SCK'], mode = pyb.Pin.OUT_PP) self.Pin_RESET.low() self.Pin_PANEL_ON.low() self.Pin_DISCHARGE.low() self.Pin_BORDER.low() self.Pin_EPD_CS.low() self.Pin_FLASH_CS.high() self.spi_no = pins['SPI_BUS'] self.i2c_no = pins['I2C_BUS'] if self.pwr_controller is None: # If we're powered up instantiate LM75 to throw self.lm75 = LM75(self.i2c_no) # early error if not working
def __init__(self, intside, model, up_time): self.model = model self.compensate_temp = True if up_time is None else False self.verbose = False gc.collect() self.image_0 = bytearray(BUFFER_SIZE) # 5808. Contents 0. self.image_1 = bytearray(BUFFER_SIZE) # 5808 self.asm_data = array('i', [0, 0, 0, 0]) self.image = self.image_0 self.image_old = self.image_1 self.line_buffer = bytearray(111) # total 11727 bytes! pins = getpins(intside, model) self.Pin_PANEL_ON = pyb.Pin(pins['PANEL_ON'], mode = pyb.Pin.OUT_PP) self.Pin_BORDER = pyb.Pin(pins['BORDER'], mode = pyb.Pin.OUT_PP) self.Pin_DISCHARGE = pyb.Pin(pins['DISCHARGE'], mode = pyb.Pin.OUT_PP) self.Pin_RESET = pyb.Pin(pins['RESET'], mode = pyb.Pin.OUT_PP) self.Pin_BUSY = pyb.Pin(pins['BUSY'], mode = pyb.Pin.IN) self.Pin_EPD_CS = pyb.Pin(pins['EPD_CS'], mode = pyb.Pin.OUT_PP) # cs for e-paper display self.Pin_FLASH_CS = pyb.Pin(pins['FLASH_CS'], mode = pyb.Pin.OUT_PP) # Instantiate flash CS and set high self.Pin_MOSI = pyb.Pin(pins['MOSI'], mode = pyb.Pin.OUT_PP) self.Pin_SCK = pyb.Pin(pins['SCK'], mode = pyb.Pin.OUT_PP) self.base_stage_time = 630 if up_time is None else up_time # ms self.factored_stage_time = self.base_stage_time self.Pin_RESET.low() self.Pin_PANEL_ON.low() self.Pin_DISCHARGE.low() self.Pin_BORDER.low() self.Pin_EPD_CS.low() self.Pin_FLASH_CS.high() self.spi_no = pins['SPI_BUS'] if model == EMBEDDED_ARTISTS: self.lm75 = LM75(pins['I2C_BUS']) # early error if not working else: self.adc = pyb.ADC(pins['TEMPERATURE'])
def __init__(self, intside, model): self.model = model gc.collect() self.image = bytearray(BYTES_PER_LINE * LINES_PER_DISPLAY) self.linebuf = bytearray(BYTES_PER_LINE * 2 + BYTES_PER_SCAN) pins = getpins(intside, model) self.Pin_PANEL_ON = pyb.Pin(pins['PANEL_ON'], mode=pyb.Pin.OUT_PP) self.Pin_BORDER = pyb.Pin(pins['BORDER'], mode=pyb.Pin.OUT_PP) self.Pin_DISCHARGE = pyb.Pin(pins['DISCHARGE'], mode=pyb.Pin.OUT_PP) self.Pin_RESET = pyb.Pin(pins['RESET'], mode=pyb.Pin.OUT_PP) self.Pin_BUSY = pyb.Pin(pins['BUSY'], mode=pyb.Pin.IN) self.Pin_EPD_CS = pyb.Pin( pins['EPD_CS'], mode=pyb.Pin.OUT_PP) # cs for e-paper display self.Pin_FLASH_CS = pyb.Pin( pins['FLASH_CS'], mode=pyb.Pin.OUT_PP) # Instantiate flash CS and set high self.Pin_MOSI = pyb.Pin(pins['MOSI'], mode=pyb.Pin.OUT_PP) self.Pin_SCK = pyb.Pin(pins['SCK'], mode=pyb.Pin.OUT_PP) self.Pin_RESET.low() self.Pin_PANEL_ON.low() self.Pin_DISCHARGE.low() self.Pin_BORDER.low() self.Pin_EPD_CS.low() self.Pin_FLASH_CS.high() self.spi_no = pins['SPI_BUS'] if model == EMBEDDED_ARTISTS: self.lm75 = LM75(pins['I2C_BUS']) # early error if not working else: self.adc = pyb.ADC(pins['TEMPERATURE'])
def __init__(self, intside): from panel import getpins pins = getpins(intside) self.spi_no = pins['SPI_BUS'] self.pinCS = pyb.Pin(pins['FLASH_CS'], mode = pyb.Pin.OUT_PP) self.buff0 = bytearray(FLASH_SECTOR_SIZE) self.buff1 = bytearray(FLASH_SECTOR_SIZE) self.current_sector = None # Current flash sector number for writing self.prev_sector = None self.buffered_sectors = dict() # sector : sector descriptor which is [buffer, dirty] self.mountpoint = '/fc' self.begin()
def __init__(self, intside): from panel import getpins pins = getpins(intside) self.spi_no = pins['SPI_BUS'] self.pinCS = pyb.Pin(pins['FLASH_CS'], mode = pyb.Pin.OUT_PP) self.buff0 = bytearray(FLASH_SECTOR_SIZE) self.buff1 = bytearray(FLASH_SECTOR_SIZE) self.current_sector = None # Current flash sector number for writing self.prev_sector = None self.buffered_sectors = dict() # sector : sector descriptor which is [buffer, dirty] self.mountpoint = '/fc' self.begin()
def __init__(self, intside, model, up_time): self.model = model self.compensate_temp = True if up_time is None else False self.verbose = False gc.collect() self.image_0 = bytearray(BUFFER_SIZE) # 5808. Contents 0. self.image_1 = bytearray(BUFFER_SIZE) # 5808 self.asm_data = array('i', [0, 0, 0, 0]) self.image = self.image_0 self.image_old = self.image_1 self.line_buffer = bytearray(111) # total 11727 bytes! pins = getpins(intside, model) self.Pin_PANEL_ON = pyb.Pin(pins['PANEL_ON'], mode=pyb.Pin.OUT_PP) self.Pin_BORDER = pyb.Pin(pins['BORDER'], mode=pyb.Pin.OUT_PP) self.Pin_DISCHARGE = pyb.Pin(pins['DISCHARGE'], mode=pyb.Pin.OUT_PP) self.Pin_RESET = pyb.Pin(pins['RESET'], mode=pyb.Pin.OUT_PP) self.Pin_BUSY = pyb.Pin(pins['BUSY'], mode=pyb.Pin.IN) self.Pin_EPD_CS = pyb.Pin( pins['EPD_CS'], mode=pyb.Pin.OUT_PP) # cs for e-paper display self.Pin_FLASH_CS = pyb.Pin( pins['FLASH_CS'], mode=pyb.Pin.OUT_PP) # Instantiate flash CS and set high self.Pin_MOSI = pyb.Pin(pins['MOSI'], mode=pyb.Pin.OUT_PP) self.Pin_SCK = pyb.Pin(pins['SCK'], mode=pyb.Pin.OUT_PP) self.base_stage_time = 630 if up_time is None else up_time # ms self.factored_stage_time = self.base_stage_time self.Pin_RESET.low() self.Pin_PANEL_ON.low() self.Pin_DISCHARGE.low() self.Pin_BORDER.low() self.Pin_EPD_CS.low() self.Pin_FLASH_CS.high() self.spi_no = pins['SPI_BUS'] if model == EMBEDDED_ARTISTS: self.lm75 = LM75(pins['I2C_BUS']) # early error if not working else: self.adc = pyb.ADC(pins['TEMPERATURE'])