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

Image display capability #26

Open
wants to merge 4 commits into
base: master
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Memory Map
| 0x10000000 | 0x1fffffff | 0x0fffffff | Memory-mapped SPI chip |
| ?????????? | ?????????? | ?????????? | ??????????????????????????????????? |
| 0x70000000 | 0x7000cfff | 0xcfff | On-chip SRAM (maybe cache?) |
| 0x70008000 | 0x7000A400 | 0x00002400 | SRAM CODE area |
| 0x7000A400 | 0x7000B000 | 0x00000C00 | SRAM DATA area |
| ?????????? | ?????????? | ?????????? | ??????????????????????????????????? |
| 0x80000000 | 0x80000008 | 0x08 | Config block (chip version, etc.) |
| 0x82000000 | 0x82d00000 | ?????????? | Modem system stuff |
Expand Down
43 changes: 43 additions & 0 deletions pnm2bin.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/perl

print "pnm2bin.pl picture.pnm picture.bin\n";
print "converts a picture in the format 240x320 PNM to the RGB-565 format necessary for Fernvale\n";

my $infile=$ARGV[0] || "picture.pnm";
my $outfile=$ARGV[1] || "picture.bin";

open IN,"<$infile";
my $header=<IN>; $header=~s/\s*$//;
if($header=~m/^P[36]/)
{
print "$header PNM Format detected. Good. Converting ...\n";
my $size=<IN>;
while($size=~m/^#/)
{
$size=<IN>;
}
if($size=~m/^(\d+) (\d+)/)
{
my $xsize=$1; my $ysize=$2;
print "Format: $1x$2\n";
my $value=<IN>;
open OUT,">$outfile";

foreach(0 .. ($ysize-1))
{
foreach(0 .. ($xsize-1))
{
my $r=($header eq "P6")?unpack("C",getc(IN)):<IN>; $r>>=3;
my $g=($header eq "P6")?unpack("C",getc(IN)):<IN>; $g>>=2;
my $b=($header eq "P6")?unpack("C",getc(IN)):<IN>; $b>>=3;

my $p1=(($g&7)<<5) | ($b);
my $p2=($r<<3) | ($g>>3);
print OUT pack("C",$p1);
print OUT pack("C",$p2);
}
}
close OUT;
}
}
close IN;
14 changes: 14 additions & 0 deletions splashscreen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

echo "splashscreen.sh <imagefile>"
echo Converting any 240x320 image to PNM
convert $1 picture.pnm
echo Converting from PNM to Fernvale Framebuffer format
perl ./pnm2bin.pl picture.pnm picture.bin
echo Telling fernvale to load the image
echo "load 0x40000 153600" >/dev/fernvale
echo Loading the image
cat picture.bin >/dev/fernvale
echo Displaying image
echo "lcd run" >/dev/fernvale
echo Done