Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive settings from provided display dimensions in epd7in5b_V2.py #329

Open
wants to merge 3 commits into
base: Development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd1in02.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ def getbuffer(self, image):
def display(self, image):
if (image == None):
return
# Width = (self.width % 8 == 0)? (self.width / 8 ): (self.width / 8 + 1)
# Width = (self.width % 8 == 0)? (self.width // 8 ): (self.width // 8 + 1)
if(self.width % 8 == 0):
Width = self.width / 8
Width = self.width // 8
else:
Width = self.width / 8 + 1
Width = self.width // 8 + 1

self.send_command(0x10)
for j in range(0, self.height):
Expand All @@ -281,11 +281,11 @@ def display(self, image):
self.TurnOnDisplay()

def Clear(self):
# Width = (self.width % 8 == 0)? (self.width / 8 ): (self.width / 8 + 1)
# Width = (self.width % 8 == 0)? (self.width // 8 ): (self.width // 8 + 1)
if(self.width % 8 == 0):
Width = self.width / 8
Width = self.width // 8
else:
Width = self.width / 8 + 1
Width = self.width // 8 + 1

Height = self.height

Expand All @@ -312,11 +312,11 @@ def DisplayPartial(self, old_Image, Image):
self.send_data(127) #y-end
self.send_data(0x00)

# Width = (self.width % 8 == 0)? (self.width / 8 ): (self.width / 8 + 1)
# Width = (self.width % 8 == 0)? (self.width // 8 ): (self.width // 8 + 1)
if(self.width % 8 == 0):
Width = self.width / 8
Width = self.width // 8
else:
Width = self.width / 8 + 1
Width = self.width // 8 + 1

Height = self.height
# send data
Expand Down
4 changes: 2 additions & 2 deletions RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13g.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def ReadBusy(self):
def SetWindow(self):
self.send_command(0x61) # SET_RAM_X_ADDRESS_START_END_POSITION
# x point must be the multiple of 8 or the last 3 bits will be ignored
self.send_data(self.Source_BITS/256)
self.send_data(int(self.Source_BITS/256))
self.send_data(self.Source_BITS%256)
self.send_data(self.Gate_BITS/256)
self.send_data(int(self.Gate_BITS/256))
self.send_data(self.Gate_BITS%256)

def TurnOnDisplay(self):
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def init_Fast(self):

self.send_command(0x01) #Driver output control
self.send_data((self.height-1)%256)
self.send_data((self.height-1)/256)
self.send_data((self.height-1)//256)
self.send_data(0x00)

self.send_command(0x11) #data entry mode
Expand Down
84 changes: 42 additions & 42 deletions RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd7in5_HD.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,46 +86,46 @@ def init(self):
# EPD hardware init start
self.reset()

self.ReadBusy();
self.send_command(0x12); #SWRESET
self.ReadBusy();

self.send_command(0x46); # Auto Write Red RAM
self.send_data(0xf7);
self.ReadBusy();
self.send_command(0x47); # Auto Write B/W RAM
self.send_data(0xf7);
self.ReadBusy();

self.send_command(0x0C); # Soft start setting
self.ReadBusy()
self.send_command(0x12) #SWRESET
self.ReadBusy()

self.send_command(0x46) # Auto Write Red RAM
self.send_data(0xf7)
self.ReadBusy()
self.send_command(0x47) # Auto Write B/W RAM
self.send_data(0xf7)
self.ReadBusy()

self.send_command(0x0C) # Soft start setting
self.send_data2([0xAE, 0xC7, 0xC3, 0xC0, 0x40])

self.send_command(0x01); # Set MUX as 527
self.send_command(0x01) # Set MUX as 527
self.send_data2([0xAF, 0x02, 0x01])

self.send_command(0x11); # Data entry mode
self.send_data(0x01);
self.send_command(0x11) # Data entry mode
self.send_data(0x01)

self.send_command(0x44);
self.send_command(0x44)
self.send_data2([0x00, 0x00, 0x6F, 0x03]) # RAM x address start at 0
self.send_command(0x45);
self.send_command(0x45)
self.send_data2([0xAF, 0x02, 0x00, 0x00])

self.send_command(0x3C); # VBD
self.send_data(0x05); # LUT1, for white
self.send_command(0x3C) # VBD
self.send_data(0x05) # LUT1, for white

self.send_command(0x18);
self.send_data(0X80);
self.send_command(0x18)
self.send_data(0X80)


self.send_command(0x22);
self.send_data(0XB1); #Load Temperature and waveform setting.
self.send_command(0x20);
self.ReadBusy();
self.send_command(0x22)
self.send_data(0XB1) #Load Temperature and waveform setting.
self.send_command(0x20)
self.ReadBusy()

self.send_command(0x4E); # set RAM x address count to 0;
self.send_command(0x4E) # set RAM x address count to 0
self.send_data2([0x00, 0x00])
self.send_command(0x4F);
self.send_command(0x4F)
self.send_data2([0x00, 0x00])
# EPD hardware init end
return 0
Expand All @@ -146,35 +146,35 @@ def getbuffer(self, image):
return buf

def display(self, image):
self.send_command(0x4F);
self.send_command(0x4F)
self.send_data2([0x00, 0x00])
self.send_command(0x24);
self.send_command(0x24)
self.send_data2(image)
self.send_command(0x22);
self.send_data(0xF7);#Load LUT from MCU(0x32)
self.send_command(0x20);
epdconfig.delay_ms(10);
self.ReadBusy();
self.send_command(0x22)
self.send_data(0xF7)#Load LUT from MCU(0x32)
self.send_command(0x20)
epdconfig.delay_ms(10)
self.ReadBusy()

def Clear(self):
buf = [0xff] * int(self.width * self.height / 8)
self.send_command(0x4F);
self.send_command(0x4F)
self.send_data2([0x00, 0x00])
self.send_command(0x24)
self.send_data2(buf)

self.send_command(0x26)
self.send_data2(buf)

self.send_command(0x22);
self.send_data(0xF7);#Load LUT from MCU(0x32)
self.send_command(0x20);
epdconfig.delay_ms(10);
self.ReadBusy();
self.send_command(0x22)
self.send_data(0xF7)#Load LUT from MCU(0x32)
self.send_command(0x20)
epdconfig.delay_ms(10)
self.ReadBusy()

def sleep(self):
self.send_command(0x10);
self.send_data(0x01);
self.send_command(0x10)
self.send_data(0x01)

epdconfig.delay_ms(2000)
epdconfig.module_exit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def display_Partial(self, Image, Xstart, Ystart, Xend, Yend):
else:
Xend = Xend // 8 * 8 + 1

Width = (Xend - Xstart) / 8
Width = (Xend - Xstart) // 8
Height = Yend - Ystart

self.send_command(0x50)
Expand Down
Binary file not shown.
Loading