add tests for parallel displays
50
inkycal/display/drivers/7_in_8.py
Normal file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
7.8" parallel driver class
|
||||
Copyright by aceisace
|
||||
"""
|
||||
from inkycal.custom import top_level, images
|
||||
from os.path import exists
|
||||
from PIL import Image
|
||||
|
||||
# Display resolution
|
||||
EPD_WIDTH = 1872
|
||||
EPD_HEIGHT = 1404
|
||||
|
||||
# Please insert VCOM of your display. The Minus sign before is not required
|
||||
VCOM = "2.0"
|
||||
|
||||
driver_dir = top_level+'/inkycal/display/drivers/7_in_8_drivers/'
|
||||
|
||||
command = f'sudo {driver_dir}IT8951/IT8951 0 0 {images+"canvas.bmp"}'
|
||||
print(command)
|
||||
|
||||
class EPD:
|
||||
|
||||
def __init__(self):
|
||||
"""7.8" epaper class"""
|
||||
pass
|
||||
|
||||
def init(self):
|
||||
pass
|
||||
|
||||
def display(self, command):
|
||||
"""displays an image"""
|
||||
try:
|
||||
run_command = command.split()
|
||||
run(run_command)
|
||||
except:
|
||||
print("oops, something didn't work right :/")
|
||||
|
||||
def getbuffer(self, image):
|
||||
"""ad-hoc"""
|
||||
image = image.rotate(90, expand=True)
|
||||
image.convert('RGB').save(images+'canvas.bmp', 'BMP')
|
||||
command = f'sudo {driver_dir}IT8951/IT8951 0 {images+"canvas.bmp"}'
|
||||
print(command)
|
||||
return command
|
||||
|
||||
def sleep(self):
|
||||
pass
|
||||
|
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Unzip C++ SPI library and driver files
|
||||
echo "Unzipping files"
|
||||
unzip bcm2835-1.68.zip
|
||||
unzip IT8951.zip
|
||||
rm bcm2835-1.68.zip
|
||||
rm IT8951.zip
|
||||
|
||||
# Install C++ SPI library for Raspberry
|
||||
echo "Installing C++ SPI library"
|
||||
cd bcm2835-1.68
|
||||
chmod +x configure
|
||||
./configure
|
||||
make
|
||||
sudo make check
|
||||
sudo make install
|
||||
|
||||
# Install 9.7" E-Paper drivers
|
||||
echo "Installing 9.7inch E-Paper drivers"
|
||||
cd ..
|
||||
cd IT8951
|
||||
make clean
|
||||
make
|
||||
|
||||
# Show image to check if it works
|
||||
echo "Showing demo image"
|
||||
sudo ./IT8951 0 0 pika.bmp
|
||||
|
||||
echo "If you see a pikachu on the E-Paper, the install"
|
||||
echo "was successfull. If not, please report this issue."
|
@ -223,7 +223,7 @@ UBYTE Display_BMP_Example(UWORD Panel_Width, UWORD Panel_Height, UDOUBLE Init_Ta
|
||||
break;
|
||||
}
|
||||
case BitsPerPixel_4:{
|
||||
Paint_DrawString_EN(10, 10, "4 bits per pixel 16 grayscale", &Font24, 0xF0, 0x00);
|
||||
//Paint_DrawString_EN(10, 10, "4 bits per pixel 16 grayscale", &Font24, 0xF0, 0x00);
|
||||
EPD_IT8951_4bp_Refresh(Refresh_Frame_Buf, 0, 0, WIDTH, HEIGHT, false, Init_Target_Memory_Addr,false);
|
||||
break;
|
||||
}
|
||||
|
@ -61,18 +61,12 @@ int main(int argc, char *argv[])
|
||||
//Exception handling:ctrl + c
|
||||
signal(SIGINT, Handler);
|
||||
|
||||
if (argc < 2){
|
||||
Debug("Please input VCOM value on FPC cable!\r\n");
|
||||
Debug("Example: sudo ./epd -2.51\r\n");
|
||||
if (argc != 4){
|
||||
Debug("Usage: sudo ./epd -2.51 0 bmp_filepath\r\n");
|
||||
Debug("To use the test, please navigate to Inkycal/inkycal/display/drivers/parallel_drivers and then run\r\n");
|
||||
Debug("Test: sudo ./epd -2.51 0 test\r\n");
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 3){
|
||||
Debug("Please input e-Paper display mode!\r\n");
|
||||
Debug("Example: sudo ./epd -2.51 0 or sudo ./epd -2.51 1\r\n");
|
||||
Debug("Now, 10.3 inch glass panle is mode1, else is mode0\r\n");
|
||||
Debug("If you don't know what to type in just type 0 \r\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//Init the BCM2835 Device
|
||||
if(DEV_Module_Init()!=0){
|
||||
@ -121,50 +115,25 @@ int main(int argc, char *argv[])
|
||||
#if(SHOW_BMP)
|
||||
//Show a bmp file
|
||||
//1bp use A2 mode by default, before used it, refresh the screen with WHITE
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_4, "/home/pi/InkycalVenv/inkycal/display/drivers/7_in_8_drivers/pic/1872x1404_2.bmp");
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
#endif
|
||||
|
||||
#if(USE_Normal_Demo)
|
||||
/*
|
||||
//Show 16 grayscale
|
||||
Display_ColorPalette_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
|
||||
//Show some character and pattern
|
||||
Display_CharacterPattern_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_4);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
|
||||
//Show a bmp file
|
||||
//1bp use A2 mode by default, before used it, refresh the screen with WHITE
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_1);
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_2);
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_4);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_4, argv[3]);
|
||||
//EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
|
||||
//Show A2 mode refresh effect
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, A2_Mode);
|
||||
Dynamic_Refresh_Example(Dev_Info,Init_Target_Memory_Addr);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, A2_Mode);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
|
||||
//Show how to display a gif, not works well on 6inch e-Paper HAT, 9.7inch e-Paper HAT, others work well
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, A2_Mode);
|
||||
Dynamic_GIF_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, A2_Mode);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
|
||||
//Show how to test frame rate, test it individually,which is related to refresh area size and refresh mode
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, A2_Mode);
|
||||
Check_FrameRate_Example(800, 600, Init_Target_Memory_Addr, BitsPerPixel_1);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, A2_Mode);
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, GC16_Mode);
|
||||
* */
|
||||
if( strcmp(argv[3], "test") == 0){
|
||||
Debug("----RUNNING DISPLAY TEST----...hold on tight! \r\n");
|
||||
char Path[30];
|
||||
sprintf(Path,"./pic/%dx%d_0.bmp", Panel_Width, Panel_Height);
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_4, Path);
|
||||
}else{
|
||||
Debug("Loading BMP File \r\n");
|
||||
Display_BMP_Example(Panel_Width, Panel_Height, Init_Target_Memory_Addr, BitsPerPixel_4, argv[3]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//We recommended refresh the panel to white color before storing in the warehouse.
|
||||
EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, INIT_Mode);
|
||||
// EPD_IT8951_Clear_Refresh(Dev_Info, Init_Target_Memory_Addr, INIT_Mode);
|
||||
|
||||
//EPD_IT8951_Standby();
|
||||
EPD_IT8951_Sleep();
|
||||
|
Before Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 4.4 MiB |
Before Width: | Height: | Size: 4.4 MiB |
Before Width: | Height: | Size: 4.4 MiB |
Before Width: | Height: | Size: 5.5 MiB |
Before Width: | Height: | Size: 5.5 MiB |
Before Width: | Height: | Size: 5.5 MiB |
Before Width: | Height: | Size: 5.5 MiB |
Before Width: | Height: | Size: 7.5 MiB |
Before Width: | Height: | Size: 7.5 MiB |
Before Width: | Height: | Size: 7.5 MiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 59 KiB |
@ -1,11 +1,30 @@
|
||||
wheel==0.37.1 # wheels
|
||||
pyowm==3.3.0 # weather
|
||||
Pillow>=7.1.1 # imaging
|
||||
icalendar==4.0.9 # iCalendar parsing
|
||||
recurring-ical-events==0.1.17b0 # parse recurring events
|
||||
feedparser==6.0.8 # parse RSS-feeds
|
||||
numpy==1.21.5 # image pre-processing #pre-installed on Raspbian, omitting
|
||||
arrow==1.2.2 # time operations
|
||||
todoist-python==8.1.3 # todoist api
|
||||
yfinance>=0.1.62 # yahoo stocks
|
||||
matplotlib==3.5.1 # plotting
|
||||
arrow==1.2.2
|
||||
certifi==2021.10.8
|
||||
charset-normalizer==2.0.12
|
||||
cycler==0.11.0
|
||||
feedparser==6.0.8
|
||||
fonttools==4.32.0
|
||||
geojson==2.5.0
|
||||
icalendar==4.0.9
|
||||
idna==3.3
|
||||
kiwisolver==1.4.2
|
||||
lxml==4.8.0
|
||||
matplotlib==3.5.1
|
||||
multitasking==0.0.10
|
||||
numpy==1.21.5
|
||||
packaging==21.3
|
||||
pandas==1.3.5
|
||||
Pillow==9.1.0
|
||||
pyowm==3.3.0
|
||||
pyparsing==3.0.7
|
||||
PySocks==1.7.1
|
||||
python-dateutil==2.8.2
|
||||
pytz==2022.1
|
||||
recurring-ical-events==0.1.17b0
|
||||
requests==2.27.1
|
||||
sgmllib3k==1.0.0
|
||||
six==1.16.0
|
||||
todoist-python==8.1.3
|
||||
typing_extensions==4.1.1
|
||||
urllib3==1.26.9
|
||||
yfinance==0.1.70
|
||||
|