Skip to content

Commit

Permalink
Update config.py
Browse files Browse the repository at this point in the history
  • Loading branch information
otter committed Aug 6, 2024
1 parent 73f923c commit fca5451
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/SH1106/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self,spi=None,spi_freq=40000000,rst = 27,dc = 25,bl = 18,bl_freq=10

if(Device_SPI == 1):
self.Device = Device_SPI
self.spi = spi
self.spi = spidev.SpiDev(0, 0)
self.GPIO_DC_PIN = self.gpio_mode(DC_PIN,self.OUTPUT)
else :
self.Device = Device_I2C
Expand Down Expand Up @@ -109,15 +109,15 @@ def module_init(self):
if(self.Device == Device_SPI):
self.spi.max_speed_hz = 1000000
self.spi.mode = 0b11
#self.digital_write(self.GPIO_DC_PIN,False)
# CS_PIN.off()
self.digital_write(self.GPIO_DC_PIN,False)
CS_PIN.off()
return 0

def module_exit(self):
if(self.Device == Device_SPI):
self.spi.close()
self.digital_write(self.GPIO_RST_PIN,False)
#self.digital_write(self.GPIO_DC_PIN,False)
self.digital_write(self.GPIO_DC_PIN,False)
else :
self.bus.close()

Expand Down

0 comments on commit fca5451

Please sign in to comment.