Compare commits
16 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ad40b1dbe6 | ||
![]() |
36c8a56ade | ||
![]() |
cfcc4a270f | ||
![]() |
50fe2f13bd | ||
![]() |
fcfd4792f9 | ||
![]() |
72b06f49f1 | ||
![]() |
8a8e50dfb9 | ||
![]() |
d1ddb909ff | ||
![]() |
5223cd4e24 | ||
![]() |
4af6656ba7 | ||
![]() |
986751eb5d | ||
![]() |
436b89bb03 | ||
![]() |
ad448f1769 | ||
![]() |
0aeec3e680 | ||
![]() |
66cb742a67 | ||
![]() |
3c44927e0a |
372 changed files with 2462 additions and 14448 deletions
78
.cproject
78
.cproject
|
@ -1,78 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
|
||||||
<cconfiguration id="0.481883884">
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.481883884" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
|
||||||
<externalSettings/>
|
|
||||||
<extensions>
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
</extensions>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<configuration buildProperties="" description="" id="0.481883884" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
|
||||||
<folderInfo id="0.481883884." name="/" resourcePath="">
|
|
||||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1715436414" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
|
||||||
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1715436414.885904395" name=""/>
|
|
||||||
<builder id="org.eclipse.cdt.build.core.settings.default.builder.1224554298" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.736682923" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1273008438" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.937300672" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.772385457" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1269038295" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.2137323592" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1752191090" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
|
||||||
</tool>
|
|
||||||
</toolChain>
|
|
||||||
</folderInfo>
|
|
||||||
</configuration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
</cconfiguration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<project id="Boop.null.506503339" name="Boop"/>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="scannerConfiguration">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
<scannerConfigBuildInfo instanceId="0.481883884">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
|
||||||
<storageModule moduleId="refreshScope"/>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
|
||||||
<buildTargets>
|
|
||||||
<target name="debug" path="boop/trunk" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>debug</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="clean" path="boop/trunk" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>clean</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
<target name="program" path="boop/trunk" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>program</buildTarget>
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
</target>
|
|
||||||
</buildTargets>
|
|
||||||
</storageModule>
|
|
||||||
</cproject>
|
|
1738
FHEM/00_CUL.pm
Normal file
1738
FHEM/00_CUL.pm
Normal file
File diff suppressed because it is too large
Load diff
176
FHEM/10_Betty.pm
Normal file
176
FHEM/10_Betty.pm
Normal file
|
@ -0,0 +1,176 @@
|
||||||
|
##############################################
|
||||||
|
# $Id: $
|
||||||
|
package main;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use SetExtensions;
|
||||||
|
|
||||||
|
my %sets = (
|
||||||
|
"clear:noArg" => "",
|
||||||
|
"time:noArg" => "",
|
||||||
|
"raw" => "",
|
||||||
|
);
|
||||||
|
|
||||||
|
sub
|
||||||
|
Betty_Initialize($)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
|
||||||
|
|
||||||
|
$hash->{Match} = "^y.*";
|
||||||
|
$hash->{SetFn} = "Betty_Set";
|
||||||
|
$hash->{DefFn} = "Betty_Define";
|
||||||
|
$hash->{ParseFn} = "Betty_Parse";
|
||||||
|
$hash->{AttrList} = "IODev ". $readingFnAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
sub
|
||||||
|
Betty_Set($@) {
|
||||||
|
my ($hash, @a) = @_;
|
||||||
|
|
||||||
|
return "set $hash->{NAME} needs at least one parameter" if(@a < 2);
|
||||||
|
|
||||||
|
my $me = shift @a;
|
||||||
|
my $cmd = shift @a;
|
||||||
|
my $arg = shift @a;
|
||||||
|
my $arg2 = shift @a;
|
||||||
|
|
||||||
|
return join(" ", sort keys %sets) if ($cmd eq "?");
|
||||||
|
|
||||||
|
if ($cmd eq "clear") {
|
||||||
|
my @cH = ($hash);
|
||||||
|
delete $_->{READINGS} foreach (@cH);
|
||||||
|
return undef;
|
||||||
|
|
||||||
|
} elsif ($cmd eq "raw") {
|
||||||
|
my $msg = $arg;
|
||||||
|
#IOWrite( $hash, $msg );
|
||||||
|
IOWrite( $hash, "y", $msg );
|
||||||
|
return undef;
|
||||||
|
|
||||||
|
} elsif ($cmd eq "time") {
|
||||||
|
my $address = $hash->{ADDRESS};
|
||||||
|
|
||||||
|
my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime;
|
||||||
|
|
||||||
|
my $m = sprintf("%02d%02d%02d%02d",$mday,$wday,$month+1, $year-100);
|
||||||
|
my $n = sprintf("%02d%02d%02d",$sec, $min, $hour );
|
||||||
|
|
||||||
|
my $msg = "w".$address;
|
||||||
|
IOWrite( $hash, "y", $msg );
|
||||||
|
$msg = "s0a".$address."0003".$m.$n;
|
||||||
|
IOWrite( $hash, "y", $msg );
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return "Unknown argument $cmd, choose one of ". join(" ", sort keys %sets);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#############################
|
||||||
|
sub
|
||||||
|
Betty_Define($$)
|
||||||
|
{
|
||||||
|
my ($hash, $def) = @_;
|
||||||
|
my @a = split("[ \t][ \t]*", $def);
|
||||||
|
|
||||||
|
return "wrong syntax: define <name> Betty <address>"
|
||||||
|
if(int(@a) < 2 || int(@a) > 4);
|
||||||
|
|
||||||
|
my $address = uc($a[2]);
|
||||||
|
$hash->{ADDRESS} = $address;
|
||||||
|
$modules{Betty}{defptr}{$address} = $hash;
|
||||||
|
AssignIoPort($hash);
|
||||||
|
|
||||||
|
readingsSingleUpdate($hash, "state", "Initialized", 1);
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub
|
||||||
|
Betty_Parse($$)
|
||||||
|
{
|
||||||
|
my ($hash,$msg) = @_;
|
||||||
|
|
||||||
|
my ($len,$dest,$src,$service,$data) = unpack 'x1A2A2A2A2A*',$msg;
|
||||||
|
|
||||||
|
my $def = $modules{Betty}{defptr}{$src};
|
||||||
|
|
||||||
|
if(!$def) {
|
||||||
|
DoTrigger("global","UNDEFINED Betty_$src Betty $src");
|
||||||
|
$def = $modules{Betty}{defptr}{$src};
|
||||||
|
if(!$def) {
|
||||||
|
Log3 $hash, 1, "Betty UNDEFINED, address $src";
|
||||||
|
return "UNDEFINED Betty_$src Betty $src";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$hash = $def;
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
|
# packet_RFenc
|
||||||
|
if ($service eq '04') {
|
||||||
|
my ($addr,$key) = unpack 'A2A2',$data;
|
||||||
|
|
||||||
|
if($hash->{helper}{lastkey } ne $key) {
|
||||||
|
$hash->{helper}{lastkey } = $key;
|
||||||
|
$key = sprintf "%02x", hex($key) & 0x7F;
|
||||||
|
readingsSingleUpdate($hash, "key", $addr."_".$key , 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# packet_test
|
||||||
|
} elsif ($service eq '01') {
|
||||||
|
|
||||||
|
$data = latin1ToUtf8(pack("H*",$data));
|
||||||
|
readingsSingleUpdate($hash, "test", $data , 1);
|
||||||
|
|
||||||
|
# packet_time
|
||||||
|
} elsif ($service eq '03') {
|
||||||
|
|
||||||
|
my ($request) = unpack 'A2',$data;
|
||||||
|
|
||||||
|
if($request eq "FF") {
|
||||||
|
my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime;
|
||||||
|
|
||||||
|
my $m = sprintf("%02d%02d%02d%02d",$mday,$wday,$month+1, $year-100);
|
||||||
|
my $n = sprintf("%02d%02d%02d",$sec, $min, $hour );
|
||||||
|
|
||||||
|
$msg = "s0a".$src."0003".$m.$n;
|
||||||
|
IOWrite( $hash, "y", $msg );
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log3 $hash, 4, "Betty UNKNOWN MESSAGE $service: $data";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
=pod
|
||||||
|
=item summary devices communicating with the Betty remote control
|
||||||
|
=item summary_DE Anbindung der Betty Fernbedienung
|
||||||
|
=begin html
|
||||||
|
|
||||||
|
<a name="Betty"></a>
|
||||||
|
<h3>Betty</h3>
|
||||||
|
<ul>
|
||||||
|
Todo
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
=end html
|
||||||
|
|
||||||
|
|
||||||
|
=cut
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
@ -18,14 +18,16 @@
|
||||||
#####
|
#####
|
||||||
###############################################################
|
###############################################################
|
||||||
|
|
||||||
ARMBASE = /opt/toolchains/gcc-arm-none-eabi-4_9-2014q4
|
|
||||||
INCLUDEPATH = $(ARMBASE)/include
|
#ARMBASE = F:/Tools/GNU_Tools_ARM_Embedded/5.4
|
||||||
#LIBGCCPATH = $(ARMBASE)/lib/gcc/arm-none-eabi/4.7.3/thumb/arm7tdmi-s
|
#INCLUDEPATH = $(ARMBASE)/arm-none-eabi/include
|
||||||
#LIBCPATH = $(ARMBASE)/arm-none-eabi/lib/thumb/arm7tdmi-s
|
#LIBPATH = $(ARMBASE)/arm-none-eabi/lib
|
||||||
ARMPATH = $(ARMBASE)/bin
|
#ARMPATH = $(ARMBASE)/bin/
|
||||||
TOOLPREFIX = arm-none-eabi-
|
TOOLPREFIX = arm-none-eabi-
|
||||||
LPCTOOL = lpctool
|
LPCTOOL = lpctool
|
||||||
OPENOCD = openocd -f betty.cfg -f interface/parport.cfg
|
OPENOCDPATH = F:\Tools\OpenOCD_0_10
|
||||||
|
#OPENOCD = $(OPENOCDPATH)\bin\openocd.exe -f $(OPENOCDPATH)\scripts\interface\jlink.cfg -f betty.cfg
|
||||||
|
OPENOCD = $(OPENOCDPATH)\bin\openocd.exe -f $(OPENOCDPATH)\scripts\interface\uniprog.cfg -f betty.cfg
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
#####
|
#####
|
||||||
|
@ -33,20 +35,17 @@ OPENOCD = openocd -f betty.cfg -f interface/parport.cfg
|
||||||
#####
|
#####
|
||||||
###############################################################
|
###############################################################
|
||||||
|
|
||||||
CC = $(ARMPATH)/$(TOOLPREFIX)gcc
|
CC = $(ARMPATH)$(TOOLPREFIX)gcc
|
||||||
AS = $(ARMPATH)/$(TOOLPREFIX)as
|
AS = $(ARMPATH)$(TOOLPREFIX)gcc
|
||||||
#LD = $(ARMPATH)/$(TOOLPREFIX)ld
|
LD = $(ARMPATH)$(TOOLPREFIX)gcc
|
||||||
LD = $(ARMPATH)/$(TOOLPREFIX)gcc
|
OC = $(ARMPATH)$(TOOLPREFIX)objcopy
|
||||||
OC = $(ARMPATH)/$(TOOLPREFIX)objcopy
|
OD = $(ARMPATH)$(TOOLPREFIX)objdump
|
||||||
OD = $(ARMPATH)/$(TOOLPREFIX)objdump
|
SIZE = $(ARMPATH)$(TOOLPREFIX)size
|
||||||
|
|
||||||
CPUFLAGS = -mcpu=arm7tdmi-s
|
CPUFLAGS = -mcpu=arm7tdmi-s
|
||||||
OPTFLAGS = -Os
|
CFLAGS = -Wall -mthumb-interwork -g3 -c
|
||||||
CFLAGS = -Wall -mthumb-interwork -msoft-float
|
INC = -I. -Iinterrupt -Idisplay -Ikeyboard -Iaudio -Iinfrared -Iserial -Iflash -Icc1100 -Igui -Itimer -Igames -Iadc -Irtc -Itools
|
||||||
INC = -I$(INCLUDEPATH) -I. -Iinterrupt -Idisplay -Ikeyboard -Iaudio -Iinfrared -Iserial -Iflash -Icc1100 -Igui -Itimer -Igames -Iadc -Irtc -Itools
|
ASFLAGS = -g -I. -mthumb-interwork
|
||||||
ASFLAGS = -D --gstabs -mthumb-interwork -mfpu=softfpa
|
|
||||||
#LDFLAGS = -Tlpc2220_rom.ld -Map boop.map
|
|
||||||
#LIBS = -lc -lgcc
|
|
||||||
LDFLAGS = -mthumb-interwork -nostartfiles -Xlinker -Map -Xlinker boop.map -Tlpc2220_rom.ld
|
LDFLAGS = -mthumb-interwork -nostartfiles -Xlinker -Map -Xlinker boop.map -Tlpc2220_rom.ld
|
||||||
THUMBFLAGS = -mthumb
|
THUMBFLAGS = -mthumb
|
||||||
|
|
||||||
|
@ -54,6 +53,9 @@ COMPILE = $(CC) $(CPUFLAGS) $(CFLAGS) $(INC)
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),debug)
|
ifeq ($(MAKECMDGOALS),debug)
|
||||||
COMPILE += -D DEBUGMODE
|
COMPILE += -D DEBUGMODE
|
||||||
|
OPTFLAGS = -O0
|
||||||
|
else
|
||||||
|
OPTFLAGS = -Og
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),release)
|
ifeq ($(MAKECMDGOALS),release)
|
||||||
|
@ -91,9 +93,9 @@ $(eval $(call expand_dir,))
|
||||||
|
|
||||||
OBJS := $(patsubst %.s,%.o,$(ALLSRCS:.c=.o)) $(ALLTHUMBSRCS:.c=.thumb.o) $(ALLTHUMBSRCSUNOPT:.c=.thumbunopt.o)
|
OBJS := $(patsubst %.s,%.o,$(ALLSRCS:.c=.o)) $(ALLTHUMBSRCS:.c=.thumb.o) $(ALLTHUMBSRCSUNOPT:.c=.thumbunopt.o)
|
||||||
|
|
||||||
all: version $(DEPS) boop_rom.bin boop_rom.hex
|
all: $(DEPS) boop_rom.bin boop_rom.hex
|
||||||
|
|
||||||
debug: version.h $(DEPS) boop_rom.bin boop_rom.hex
|
debug: $(DEPS) boop_rom.bin boop_rom.hex
|
||||||
|
|
||||||
release: clean version $(DEPS) boop_rom.bin boop_rom.hex
|
release: clean version $(DEPS) boop_rom.bin boop_rom.hex
|
||||||
@echo -n '\n\nRelease erstellt SVN Version ++'
|
@echo -n '\n\nRelease erstellt SVN Version ++'
|
||||||
|
@ -120,9 +122,10 @@ test: boop_rom.elf
|
||||||
|
|
||||||
boop_rom.elf: $(OBJS)
|
boop_rom.elf: $(OBJS)
|
||||||
$(LD) $(LDFLAGS) -L$(LIBGCCPATH) -L$(LIBCPATH) -o $@ $^ $(LIBS)
|
$(LD) $(LDFLAGS) -L$(LIBGCCPATH) -L$(LIBCPATH) -o $@ $^ $(LIBS)
|
||||||
|
arm-none-eabi-size $@
|
||||||
|
|
||||||
%.o: %.s
|
%.o: %.s
|
||||||
$(AS) $(CPUFLAGS) $(ASFLAGS) -o $@ $<
|
$(CC) $(ASFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(COMPILE) $(OPTFLAGS) -c -MMD -MF $(dir $<).deps/$(notdir $@) -o $@ $<
|
$(COMPILE) $(OPTFLAGS) -c -MMD -MF $(dir $<).deps/$(notdir $@) -o $@ $<
|
||||||
|
@ -145,6 +148,10 @@ program: boop_rom.bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -Rf $(DEPS)
|
-rm -Rf $(DEPS)
|
||||||
-rm -f $(OBJS) *.elf *.bin *.hex *~
|
-rm -f $(OBJS) *.elf *.bin *.hex *.map *~
|
||||||
|
|
||||||
|
clean2:
|
||||||
|
-rm -Rf $(DEPS)
|
||||||
|
-rm -f $(OBJS) *.elf *.hex *.map *~
|
||||||
|
|
||||||
-include $(DEPS:=/*)
|
-include $(DEPS:=/*)
|
|
@ -157,7 +157,7 @@ void beep(unsigned char n) {
|
||||||
SIDsetfrq(0,5001);
|
SIDsetfrq(0,5001);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PWMPR = 0;
|
//PWMPR = 0;
|
||||||
switchSound(SOUND_ON);
|
switchSound(SOUND_ON);
|
||||||
SID.flags |= SIDenable;
|
SID.flags |= SIDenable;
|
||||||
SID.reg[REG_Control] |= GATE;
|
SID.reg[REG_Control] |= GATE;
|
|
@ -101,12 +101,12 @@ struct SID_ {
|
||||||
|
|
||||||
struct SID_ SID;
|
struct SID_ SID;
|
||||||
|
|
||||||
unsigned int playtone_cb;
|
extern unsigned int playtone_cb;
|
||||||
unsigned char *playtone[3];
|
extern unsigned char *playtone[3];
|
||||||
unsigned char playstate;
|
extern unsigned char playstate;
|
||||||
unsigned char tonelen[3];
|
extern unsigned char tonelen[3];
|
||||||
unsigned short playcounter;
|
extern unsigned short playcounter;
|
||||||
unsigned short playcountermax;
|
extern unsigned short playcountermax;
|
||||||
|
|
||||||
void SIDsetfrq(unsigned char voice, unsigned short frq);
|
void SIDsetfrq(unsigned char voice, unsigned short frq);
|
||||||
void SIDsetadsr(unsigned char voice,unsigned char attack, unsigned char decay, unsigned char sustain, unsigned char release);
|
void SIDsetadsr(unsigned char voice,unsigned char attack, unsigned char decay, unsigned char sustain, unsigned char release);
|
|
@ -769,6 +769,7 @@ const unsigned char song1[] = {
|
||||||
0xa2,0x25,0x00,0x00,0x21,0x11,0x70,0xd2,0x0f,0x00,0x00,0x21,0x00,0x70,
|
0xa2,0x25,0x00,0x00,0x21,0x11,0x70,0xd2,0x0f,0x00,0x00,0x21,0x00,0x70,
|
||||||
0xa2,0x25,0x00,0x00,0x21,0x11,0x70,0xd2,0x0f,0x00,0x00,0x21,0x00,0x70,
|
0xa2,0x25,0x00,0x00,0x21,0x11,0x70,0xd2,0x0f,0x00,0x00,0x21,0x00,0x70,
|
||||||
0xa2,0x25,0x00,0x00,0x21,0x11,0x70,0xd2,0x0f,0x00,0x00,0x21,0x00,0x70,
|
0xa2,0x25,0x00,0x00,0x21,0x11,0x70,0xd2,0x0f,0x00,0x00,0x21,0x00,0x70,
|
||||||
|
/*
|
||||||
0x1f,0x15,0x00,0x00,0x21,0x11,0x70,0xc3,0x10,0x00,0x00,0x21,0x00,0x70,
|
0x1f,0x15,0x00,0x00,0x21,0x11,0x70,0xc3,0x10,0x00,0x00,0x21,0x00,0x70,
|
||||||
0x1f,0x15,0x00,0x00,0x21,0x11,0x70,0xc3,0x10,0x00,0x00,0x21,0x00,0x70,
|
0x1f,0x15,0x00,0x00,0x21,0x11,0x70,0xc3,0x10,0x00,0x00,0x21,0x00,0x70,
|
||||||
0x1f,0x15,0x00,0x00,0x21,0x11,0x70,0xc3,0x10,0x00,0x00,0x21,0x00,0x70,
|
0x1f,0x15,0x00,0x00,0x21,0x11,0x70,0xc3,0x10,0x00,0x00,0x21,0x00,0x70,
|
||||||
|
@ -1001,4 +1002,5 @@ const unsigned char song1[] = {
|
||||||
0xc1,0x2c,0x00,0x00,0x21,0x11,0x70,0x31,0x1c,0x00,0x00,0x21,0x00,0x70,
|
0xc1,0x2c,0x00,0x00,0x21,0x11,0x70,0x31,0x1c,0x00,0x00,0x21,0x00,0x70,
|
||||||
0xc1,0x2c,0x00,0x00,0x21,0x11,0x70,0x31,0x1c,0x00,0x00,0x21,0x00,0x70,
|
0xc1,0x2c,0x00,0x00,0x21,0x11,0x70,0x31,0x1c,0x00,0x00,0x21,0x00,0x70,
|
||||||
0xc1,0x2c,0x00,0x00,0x21,0x11,0x70,0x31,0x1c,0x00,0x00,0x21,0x00,0x70
|
0xc1,0x2c,0x00,0x00,0x21,0x11,0x70,0x31,0x1c,0x00,0x00,0x21,0x00,0x70
|
||||||
|
*/
|
||||||
};
|
};
|
|
@ -20,6 +20,7 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "soundirq.h"
|
#include "soundirq.h"
|
||||||
#include "lpc2220.h"
|
#include "lpc2220.h"
|
||||||
|
#include "pwm.h"
|
||||||
|
|
||||||
#define AUTO_OFF_TIME 0x4000
|
#define AUTO_OFF_TIME 0x4000
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ unsigned char timeout;
|
||||||
unsigned int auto_timeout;
|
unsigned int auto_timeout;
|
||||||
|
|
||||||
void startSoundIRQ(void)
|
void startSoundIRQ(void)
|
||||||
{
|
{/*
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
auto_timeout = 0;
|
auto_timeout = 0;
|
||||||
out1 = 0;
|
out1 = 0;
|
||||||
|
@ -57,6 +58,7 @@ void startSoundIRQ(void)
|
||||||
//VICVectCntl0 = VIC_SLOT_EN | INT_SRC_PWM;
|
//VICVectCntl0 = VIC_SLOT_EN | INT_SRC_PWM;
|
||||||
VICIntSelect |= INT_PWM;
|
VICIntSelect |= INT_PWM;
|
||||||
VICIntEnable = INT_PWM;
|
VICIntEnable = INT_PWM;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void initSound(void)
|
void initSound(void)
|
||||||
|
@ -67,12 +69,18 @@ void initSound(void)
|
||||||
tval = 0;
|
tval = 0;
|
||||||
last_sample = 0;
|
last_sample = 0;
|
||||||
bl_val = 0x3F;
|
bl_val = 0x3F;
|
||||||
|
timeout = 0;
|
||||||
|
auto_timeout = 0;
|
||||||
|
out1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void switchSound(unsigned char onoff)
|
void switchSound(unsigned char onoff)
|
||||||
{
|
{
|
||||||
if(onoff)
|
if(onoff)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
PWM_set_frequency(30864);
|
||||||
|
|
||||||
sound_shutdown = 0;
|
sound_shutdown = 0;
|
||||||
PINSEL0 &= ~(3 << (2 * SND_PWM)); // IO
|
PINSEL0 &= ~(3 << (2 * SND_PWM)); // IO
|
||||||
PINSEL0 |= (2 << (2 * SND_PWM)); // PWM
|
PINSEL0 |= (2 << (2 * SND_PWM)); // PWM
|
||||||
|
@ -81,6 +89,7 @@ void switchSound(unsigned char onoff)
|
||||||
FIODIR0 |= (1<<SND_ON) | (1<<SND_EN);
|
FIODIR0 |= (1<<SND_ON) | (1<<SND_EN);
|
||||||
FIOSET0 = (1<<SND_EN);
|
FIOSET0 = (1<<SND_EN);
|
||||||
FIOCLR0 = (1<<SND_ON);
|
FIOCLR0 = (1<<SND_ON);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
|
@ -21,6 +21,7 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "sid.h"
|
#include "sid.h"
|
||||||
#include "lpc2220.h"
|
#include "lpc2220.h"
|
||||||
|
#include "pwm.h"
|
||||||
|
|
||||||
#define AUTO_OFF_TIME 0x4000
|
#define AUTO_OFF_TIME 0x4000
|
||||||
|
|
||||||
|
@ -35,13 +36,13 @@ extern volatile char last_sample;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned int tval;
|
unsigned int tval;
|
||||||
unsigned char bl_val, cmp_val; // backlight PWM
|
|
||||||
unsigned int slen;
|
unsigned int slen;
|
||||||
unsigned char *sdata;
|
unsigned char *sdata;
|
||||||
unsigned char sact;
|
unsigned char sact;
|
||||||
unsigned char out1;
|
unsigned char out1;
|
||||||
unsigned char last_sample;
|
unsigned char last_sample;
|
||||||
unsigned char sound_shutdown;
|
unsigned char sound_shutdown;
|
||||||
|
unsigned char tcount;
|
||||||
|
|
||||||
const unsigned char prevvoice[3] = {2,0,1};
|
const unsigned char prevvoice[3] = {2,0,1};
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ void __attribute__ ((section(".text.fastcode"))) soundIRQ (void)
|
||||||
{
|
{
|
||||||
PWMIR = 0x01;
|
PWMIR = 0x01;
|
||||||
|
|
||||||
|
/*
|
||||||
// play sample
|
// play sample
|
||||||
if(sact != 0)
|
if(sact != 0)
|
||||||
{
|
{
|
||||||
|
@ -76,8 +78,9 @@ void __attribute__ ((section(".text.fastcode"))) soundIRQ (void)
|
||||||
PWMLER = 0x04;
|
PWMLER = 0x04;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// synthesize
|
// synthesize
|
||||||
else if(SID.flags & SIDenable)
|
else */if(SID.flags & SIDenable)
|
||||||
{
|
{
|
||||||
unsigned short tempphase;
|
unsigned short tempphase;
|
||||||
unsigned char x;
|
unsigned char x;
|
||||||
|
@ -211,16 +214,4 @@ void __attribute__ ((section(".text.fastcode"))) soundIRQ (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// backlight pwm
|
|
||||||
cmp_val += bl_val;
|
|
||||||
if (cmp_val >= 63)
|
|
||||||
{
|
|
||||||
FIODIR0 |= (1<<4); // sck0/P0.4
|
|
||||||
cmp_val -= 63;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FIODIR0 &= ~(1<<4); // sck0/P0.4
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -20,24 +20,31 @@ if { [info exists CPUTAPID ] } {
|
||||||
}
|
}
|
||||||
|
|
||||||
#coonfigure reset options
|
#coonfigure reset options
|
||||||
jtag_nsrst_delay 50
|
adapter_nsrst_delay 1
|
||||||
jtag_ntrst_delay 50
|
jtag_ntrst_delay 1
|
||||||
|
|
||||||
#use combined on interfaces or targets that can't set TRST/SRST separately
|
#use combined on interfaces or targets that can't set TRST/SRST separately
|
||||||
reset_config trst_and_srst srst_pulls_trst trst_push_pull srst_push_pull
|
reset_config srst_only srst_pulls_trst trst_push_pull srst_push_pull
|
||||||
|
|
||||||
jtag_khz 1000
|
adapter_khz 1000
|
||||||
|
|
||||||
#jtag scan chain
|
#jtag scan chain
|
||||||
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
||||||
|
|
||||||
set _TARGETNAME $_CHIPNAME.cpu
|
set _TARGETNAME $_CHIPNAME.cpu
|
||||||
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi
|
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME
|
||||||
|
|
||||||
# Event handlers
|
# Event handlers
|
||||||
$_TARGETNAME configure -event reset-start {jtag_khz 1000}
|
$_TARGETNAME configure -event reset-start {adapter_khz 1000}
|
||||||
$_TARGETNAME configure -event reset-init {betty_init}
|
$_TARGETNAME configure -event reset-init {betty_init}
|
||||||
|
|
||||||
|
$_TARGETNAME configure -event gdb-attach {
|
||||||
|
halt
|
||||||
|
}
|
||||||
|
$_TARGETNAME configure -event gdb-attach {
|
||||||
|
reset init
|
||||||
|
}
|
||||||
|
|
||||||
arm7_9 dcc_downloads enable
|
arm7_9 dcc_downloads enable
|
||||||
|
|
||||||
$_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-area-backup 0
|
$_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-area-backup 0
|
||||||
|
@ -45,7 +52,7 @@ $_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-
|
||||||
#flash bank <name> <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
|
#flash bank <name> <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
|
||||||
set _FLASHNAME $_CHIPNAME.flash
|
set _FLASHNAME $_CHIPNAME.flash
|
||||||
flash bank $_FLASHNAME cfi 0x80000000 0x00100000 2 2 $_TARGETNAME
|
flash bank $_FLASHNAME cfi 0x80000000 0x00100000 2 2 $_TARGETNAME
|
||||||
flash bank $_FLASHNAME cfi 0x82000000 0x00100000 2 2 $_TARGETNAME
|
#flash bank $_FLASHNAME cfi 0x82000000 0x00100000 2 2 $_TARGETNAME
|
||||||
|
|
||||||
arm7_9 fast_memory_access enable
|
arm7_9 fast_memory_access enable
|
||||||
|
|
||||||
|
@ -58,18 +65,18 @@ proc betty_init { } {
|
||||||
# PLLCFG: 0x42 = psel = 10 (4) = msel= 00010 (3) = 240 mhz Fcco*/
|
# PLLCFG: 0x42 = psel = 10 (4) = msel= 00010 (3) = 240 mhz Fcco*/
|
||||||
mww 0xe01fc084 0x42
|
mww 0xe01fc084 0x42
|
||||||
# Activate PLL settings
|
# Activate PLL settings
|
||||||
#mww 0xe01fc08c 0xaa
|
mww 0xe01fc08c 0xaa
|
||||||
#mww 0xe01fc08c 0x55
|
mww 0xe01fc08c 0x55
|
||||||
#sleep 100
|
#sleep 100
|
||||||
|
|
||||||
# Memory Bank Configuration
|
# Memory Bank Configuration
|
||||||
# BCFG0: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 0 @ 0x80000000
|
# BCFG0: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 0 @ 0x80000000
|
||||||
mww 0xffe00000 0x10000420
|
mww 0xffe00000 0x10001CA0
|
||||||
# BCFG2: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 1 @ 0x82000000
|
# BCFG2: 16bit, rble, 2wst - 30 mhz : Betty: FLASH 1 @ 0x82000000
|
||||||
mww 0xffe00008 0x10000420
|
mww 0xffe00008 0x10001CA0
|
||||||
|
|
||||||
# BCFG1: 8 bit, 3 sram wst, rble, 5 wst 3 idcy : Betty: LCD @ 0x81000000
|
# BCFG1: 8 bit, 3 sram wst, rble, 5 wst 3 idcy : Betty: LCD @ 0x81000000
|
||||||
#mww 0xffe00004 0x00000400
|
mww 0xffe00004 0x00000400
|
||||||
|
|
||||||
# GPIO Pin COnfiguration for Flash access
|
# GPIO Pin COnfiguration for Flash access
|
||||||
# PINSEL0:
|
# PINSEL0:
|
||||||
|
@ -88,14 +95,19 @@ proc betty_init { } {
|
||||||
mww 0xe0028008 0x002018D0
|
mww 0xe0028008 0x002018D0
|
||||||
|
|
||||||
# disable watchdog
|
# disable watchdog
|
||||||
#mww 0xfffffd44 0x00008000
|
mww 0xfffffd44 0x00008000
|
||||||
# enable user reset
|
# enable user reset
|
||||||
#mww 0xfffffd08 0xa5000001
|
mww 0xfffffd08 0xa5000001
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc flash_boop {IMAGE} {
|
proc flash_boop {IMAGE} {
|
||||||
reset init
|
reset init
|
||||||
|
|
||||||
|
flash erase_sector 0 0 0
|
||||||
|
flash erase_check 0
|
||||||
flash erase_sector 0 0 last
|
flash erase_sector 0 0 last
|
||||||
|
flash erase_check 0
|
||||||
flash write_bank 0 $IMAGE 0
|
flash write_bank 0 $IMAGE 0
|
||||||
reset run
|
reset run
|
||||||
}
|
}
|
47
boop/betty.gdbinit
Normal file
47
boop/betty.gdbinit
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
monitor reset 100
|
||||||
|
monitor halt
|
||||||
|
monitor endian little
|
||||||
|
|
||||||
|
# BCFG0: 16bit, rble, 6wst - 60 mhz : Betty: FLASH 0 @ 0x80000000
|
||||||
|
monitor memU32 0xFFE00000 = 0x100004A0
|
||||||
|
|
||||||
|
#BCFG2: 16bit, rble, 6wst - 60 mhz : Betty: FLASH 1 @ 0x82000000
|
||||||
|
monitor memU32 0xFFE00008 = 0x100004A0
|
||||||
|
|
||||||
|
#PINSEL0
|
||||||
|
monitor memU32 0xE002C000 = 0x00008005
|
||||||
|
|
||||||
|
#PINSEL1
|
||||||
|
monitor memU32 0xE002C004 = 0x00000000
|
||||||
|
|
||||||
|
#PINSEL2
|
||||||
|
monitor memU32 0xE002C014 = 0x0de049d4
|
||||||
|
|
||||||
|
#IO2SET
|
||||||
|
monitor memU32 0xE0028024 = 0x1FC0000
|
||||||
|
|
||||||
|
#IO2DIR
|
||||||
|
monitor memU32 0xe0028028 = 0x1FC0000
|
||||||
|
|
||||||
|
#IO0DIR
|
||||||
|
monitor memU32 0xE0028008 = 0x002018D0
|
||||||
|
|
||||||
|
#PLLCON: Enable PLL, connect PLL
|
||||||
|
monitor memU32 0xe01fc080 = 0xe01fc000
|
||||||
|
|
||||||
|
# VBPDIV:
|
||||||
|
monitor memU32 0xe01fc100 = 0x00000000
|
||||||
|
|
||||||
|
#PLLCFG:
|
||||||
|
monitor memU32 0xe01fc084 = 0x00000045
|
||||||
|
|
||||||
|
#Activate PLL settings
|
||||||
|
monitor memU32 0xe01fc08c = 0xaa
|
||||||
|
monitor memU32 0xe01fc08c = 0x55
|
||||||
|
|
||||||
|
|
||||||
|
# Enable Flash Breakpoints and Download
|
||||||
|
monitor WorkRAM = 0x40000000 - 0x2000FBFF
|
||||||
|
monitor flash CFI = 0x80000000 - 0x800FFFFF
|
||||||
|
monitor flash breakpoints = 1
|
||||||
|
monitor flash download = 1
|
BIN
boop/boop_rom.bin
Normal file
BIN
boop/boop_rom.bin
Normal file
Binary file not shown.
|
@ -1 +0,0 @@
|
||||||
In this directory you find mini boop versions running from RAM. See README in each directory.
|
|
|
@ -1 +0,0 @@
|
||||||
<Project name="Boop"><File path="Boop.pnproj"></File><File path="crt.s"></File><File path="externs.h"></File><File path="flash.c"></File><File path="flash.h"></File><File path="fonty.c"></File><File path="fonty.h"></File><File path="irq.c"></File><File path="irq.h"></File><File path="keyboard.c"></File><File path="keyboard.h"></File><File path="lcd.c"></File><File path="lcd.h"></File><File path="lpc2220.h"></File><File path="lpc2220.ld"></File><File path="main.c"></File><File path="Makefile"></File><File path="soundcore.c"></File><File path="soundcore.h"></File><File path="Makefile.local"></File><File path="lpc2220_rom.ld"></File><File path="serial.h"></File><File path="serial.c"></File></Project>
|
|
|
@ -1,4 +0,0 @@
|
||||||
SUBDIRS := adc audio cc1100 display flash games gui infrared interrupt \
|
|
||||||
keyboard rtc serial timer tools
|
|
||||||
|
|
||||||
SRCS := crt.s main.c global.c
|
|
|
@ -1,98 +0,0 @@
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### Makefile for boop - communicate with betty
|
|
||||||
##### Created at 30.8.2007 02:26 am
|
|
||||||
#####
|
|
||||||
##### boop V0.1 by netguy - ck@mamalala.net
|
|
||||||
##### Makefile V0.1 by alterego - alteregon@gmx.net
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### PATHS (default installation)
|
|
||||||
#####
|
|
||||||
##### You can put your path-config into Makefile.local
|
|
||||||
##### to override these defaults
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
|
|
||||||
ARMBASE=/opt/toolchains/gcc-arm-none-eabi-4_9-2014q4
|
|
||||||
INCLUDEPATH=$(ARMBASE)/include
|
|
||||||
ARMPATH=$(ARMBASE)/bin
|
|
||||||
TOOLPREFIX=/arm-none-eabi-
|
|
||||||
BOOTLOADER_DEVICE=/dev/ttyUSB0
|
|
||||||
|
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### Compiler, Linker and Tools
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
CC=$(ARMPATH)$(TOOLPREFIX)gcc
|
|
||||||
AS=$(ARMPATH)$(TOOLPREFIX)as
|
|
||||||
#LD=$(ARMPATH)$(TOOLPREFIX)ld
|
|
||||||
LD=$(CC)
|
|
||||||
OC=$(ARMPATH)$(TOOLPREFIX)objcopy
|
|
||||||
OD=$(ARMPATH)$(TOOLPREFIX)objdump
|
|
||||||
|
|
||||||
CPUFLAGS=-mcpu=arm7tdmi-s
|
|
||||||
OPTFLAGS=-Os
|
|
||||||
CFLAGS=$(CPUFLAGS) -c -Wall -mthumb-interwork -msoft-float -I$(INCLUDEPATH) -ggdb
|
|
||||||
ASFLAGS=$(CPUFLAGS) -D --gstabs -mthumb-interwork -mfpu=softfpa
|
|
||||||
LDFLAGS = -mthumb-interwork -nostartfiles -Xlinker -Map -Xlinker boop.map -Tlpc2220.ld
|
|
||||||
|
|
||||||
THUMBFLAGS=-mthumb
|
|
||||||
|
|
||||||
-include Makefile.local
|
|
||||||
|
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### Do the boop
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
all: boop_rom.bin
|
|
||||||
|
|
||||||
boop_rom.bin: boop_ram.elf
|
|
||||||
$(OC) -O binary boop_ram.elf boop_ram.bin
|
|
||||||
$(OC) -O ihex boop_ram.elf boop_ram.hex
|
|
||||||
|
|
||||||
boop_ram.elf: crt.o lcd.o fonty.o main.o irq.o keyboard.o soundcore.o
|
|
||||||
$(LD) -o boop_ram.elf crt.o lcd.o fonty.o main.o irq.o keyboard.o soundcore.o $(LDFLAGS)
|
|
||||||
|
|
||||||
test: boop_ram.elf
|
|
||||||
$(OD) -h boop_ram.elf
|
|
||||||
|
|
||||||
crt.o: crt.s
|
|
||||||
$(AS) $(ASFLAGS) -o crt.o crt.s
|
|
||||||
|
|
||||||
irq.o: irq.c irq.h
|
|
||||||
$(CC) $(CFLAGS) $(OPTFLAGS) -o irq.o irq.c
|
|
||||||
|
|
||||||
keyboard.o: keyboard.c keyboard.h
|
|
||||||
$(CC) $(CFLAGS) -o keyboard.o keyboard.c
|
|
||||||
|
|
||||||
soundcore.o: soundcore.c soundcore.h
|
|
||||||
$(CC) $(CFLAGS) -o soundcore.o soundcore.c
|
|
||||||
|
|
||||||
lcd.o: lcd.c lcd.h
|
|
||||||
$(CC) $(CFLAGS) $(OPTFLAGS) $(THUMBFLAGS) -o lcd.o lcd.c
|
|
||||||
|
|
||||||
fonty.o: fonty.c fonty.h
|
|
||||||
$(CC) $(CFLAGS) $(OPTFLAGS) $(THUMBFLAGS) -o fonty.o fonty.c
|
|
||||||
|
|
||||||
main.o: main.c
|
|
||||||
$(CC) $(CFLAGS) $(OPTFLAGS) -o main.o main.c
|
|
||||||
|
|
||||||
ramload: boop_ram.bin
|
|
||||||
lpctool -d $(BOOTLOADER_DEVICE) -r boop_ram.bin
|
|
||||||
|
|
||||||
resident: boop_ram.bin
|
|
||||||
lpctool -d $(BOOTLOADER_DEVICE) -i -v -e -a boop_ram.bin
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) -v *.o *.elf *.bin *.hex *~
|
|
||||||
|
|
||||||
### EOF
|
|
|
@ -1,24 +0,0 @@
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### Makefile.local.WinARM for boop
|
|
||||||
##### Created in the early morninghours
|
|
||||||
#####
|
|
||||||
##### Makefile.local.WinARM V1.0 by alterego - alteregon@gmx.net
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### PATHS (default installation)
|
|
||||||
#####
|
|
||||||
##### You can put your path-config into Makefile.local
|
|
||||||
##### to override these defaults
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
ARMBASE=/opt/toolchains/gcc-arm-none-eabi-4_9-2014q4
|
|
||||||
INCLUDEPATH=$(ARMBASE)/include
|
|
||||||
ARMPATH=$(ARMBASE)/bin
|
|
||||||
TOOLPREFIX=/arm-none-eabi-
|
|
||||||
|
|
||||||
######################## EOF ##################################
|
|
|
@ -1,20 +0,0 @@
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### Makefile.local.WinARM for boop
|
|
||||||
##### Created in the early morninghours
|
|
||||||
#####
|
|
||||||
##### Makefile.local.WinARM V1.0 by alterego - alteregon@gmx.net
|
|
||||||
#####
|
|
||||||
##### Copy this file to Makefile.local for your Windows
|
|
||||||
##### installation
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
ARMBASE = c:/WinARM/
|
|
||||||
INCLUDEPATH = $(ARMBASE)/include
|
|
||||||
LIBPATH = $(ARMBASE)/arm-elf/lib/interwork
|
|
||||||
ARMPATH = $(ARMBASE)/bin
|
|
||||||
TOOLPREFIX = arm-elf-
|
|
||||||
LPCTOOL = lpctool.exe
|
|
||||||
|
|
||||||
######################## EOF ##################################
|
|
|
@ -1,25 +0,0 @@
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### Makefile.local.linuxARM for boop
|
|
||||||
##### Created in the early morninghours
|
|
||||||
#####
|
|
||||||
##### Makefile.local.linuxARM
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
###############################################################
|
|
||||||
#####
|
|
||||||
##### PATHS (default installation)
|
|
||||||
#####
|
|
||||||
##### You can put your path-config into Makefile.local
|
|
||||||
##### to override these defaults
|
|
||||||
#####
|
|
||||||
###############################################################
|
|
||||||
|
|
||||||
ARMBASE=/opt/armtool/4.1.1
|
|
||||||
INCLUDEPATH=$(ARMBASE)/include
|
|
||||||
LIBPATH=$(ARMBASE)/arm-elf/lib/interwork
|
|
||||||
ARMPATH=$(ARMBASE)/bin
|
|
||||||
TOOLPREFIX=/arm-elf-
|
|
||||||
|
|
||||||
######################## EOF ##################################
|
|
|
@ -1,25 +0,0 @@
|
||||||
24.7.2009:
|
|
||||||
|
|
||||||
boop for running in RAM. Created by telekatz for testing sound features.
|
|
||||||
Run it with
|
|
||||||
lpctool -r boop_rom.bin -d /dev/ttyUSB2
|
|
||||||
See Thread
|
|
||||||
http://bettyhacks.com/forum/index.php?topic=215.0
|
|
||||||
|
|
||||||
9.11.2007:
|
|
||||||
|
|
||||||
- serial console:
|
|
||||||
115200 baud, 8N1, no handshake
|
|
||||||
|
|
||||||
- serial commands:
|
|
||||||
0 - backlight off
|
|
||||||
1 - dimmed backlight
|
|
||||||
2 - full backlight
|
|
||||||
. - prints "HELO"
|
|
||||||
S - prints RCA_Encode status (hex value)
|
|
||||||
I - prints irIRQ status (hex value)
|
|
||||||
K - prints keyIRQ status (hex value)
|
|
||||||
all other inputs are echoed
|
|
||||||
|
|
||||||
- flash boop_rom.bin:
|
|
||||||
lpctool -i -e -a ./boop_rom.bin -d /dev/<serial_device>
|
|
|
@ -1,24 +0,0 @@
|
||||||
const unsigned char b_w = 128;
|
|
||||||
const unsigned char b_h = 160;
|
|
||||||
const char b_data[] = {
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x80,0xC0,0xE0,0xE0,0xC0,0xE0,0xF0,0xF0,0xE0,0xF0,0xE8,0xF8,0xF0,0xF8,0xE0,0xF8,0x64,0xF8,0x24,0xFC,0x30,0xFC,0x32,0xFC,0x3A,0xFE,0x78,0xFE,0xF8,0xFE,0xF9,0xFE,0xFD,0xFE,0xFD,0xFE,0xFD,0xFE,0xFF,0xFE,0xFF,0xFE,0xFD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x05,0x07,0x0F,0x1F,0x2F,0x7F,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xFF,0x80,0xF8,0x07,0xC1,0x3E,0x07,0xF8,0xFF,0x00,0xFF,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0xFF,0x7F,0xBF,0x3F,0xFF,0xF0,0x08,0xC0,0xE0,0xC0,0xE0,0xE0,0xC0,0xE0,0xF0,0xE0,0xF0,0x80,0x60,0x80,0xC0,0x80,0xC0,0xC0,0x80,0xC0,0x80,0xC0,0x80,0xC0,0x80,0xC0,0x80,0x80,0xC0,0x80,0xD0,0xF0,0xD0,0xF0,0xE0,0xE0,0xD0,0x80,0x40,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x20,0xE0,0x40,0xE0,0x60,0xE0,0xE0,0xE1,0xE2,0xE3,0xFF,0xE7,0xDF,0xE7,0xDB,0xEF,0xF7,0xE7,0x7B,0xE7,0x3B,0xE7,0xBA,0xE3,0xB4,0xE3,0xB0,0xF1,0xE2,0xF1,0xE2,0xF1,0xF8,0xF9,0xF0,0xF8,0xFD,0xFC,0xF9,0xFC,0x7F,0xBE,0x4D,0xFF,0xCA,0xFF,0xFB,0xFF,0xFD,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xE3,0xFF,0xE3,0xFF,0xE3,0xFF,0xE3,0xFF,0xE3,0xFF,0xE3,0xFF,0xE3,0xFF,0xC3,0xFF,0xC3,0xEF,0x97,0xCF,0xB7,0x9F,0x67,0x9F,0x6F,0x3F,0xDE,0x7E,0x9F,0xFE,0x3C,0xFC,0x7C,0xF8,0xFC,0xF8,0xFC,0xFC,0xFA,0xFE,0xFC,0x3C,0xD8,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x14,0x3C,0xD8,0xF8,0xFC,0xFC,0xF8,0xFE,0xC5,0xFF,0xC3,0xFF,0xE1,0xFF,0x71,0x7F,0xF9,0x7F,0xFF,0xFF,0x7F,0xFF,0x7F,0x7F,0xDF,0x5F,0x2F,0x1F,0x2F,0x1F,0x2F,0x1F,0x2F,0x1F,0x3F,0x1F,0x3F,0x3F,0x1F,0x3F,0x7F,0x18,0x67,0x3F,0x5C,0x1F,0x3F,0x1F,0x0F,0x0F,0x1F,0x0F,0x17,0x07,0x0F,0x07,0x0B,0x03,0x0F,0x8B,0x57,0x9F,0xCF,0x9F,0x8F,0x8F,0x17,0x03,0x0D,0x03,0x0D,0x03,0x05,0x03,0x1D,0x33,0x1D,0x7F,0x33,0x7F,0x3F,0x7F,0x3F,0x3F,0x5F,0x1F,0x7F,0x3F,0xDF,0x7F,0xBE,0xFE,0xFD,0xFE,0xF9,0xFF,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xF8,0xF6,0xE0,0xF0,0xE0,0xC0,0xE0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0x80,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x80,0xC0,0x80,0x80,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xC0,0x60,0xCF,0xF3,0xFF,0xFF,0xFF,0xFF,0x3F,0xDF,0x1F,0xAC,0x00,0x1F,0x00,0x01,0x00,0x00,0x00,0x80,0xF0,0x08,0x1C,0x22,0x06,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x01,0x00,0x83,0x40,0x06,0x83,0x0C,0x86,0x08,0xD4,0x10,0x08,0x10,0x80,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x04,0x0E,0x15,0x1C,0x3F,0x1F,0xBC,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x3F,0x5F,0x0F,0x17,0x03,0x05,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x04,0x18,0x3C,0x38,0x30,0x30,0x78,0x70,0x31,0x71,0x60,0x71,0x60,0x71,0x21,0x33,0x61,0x1F,0x23,0x07,0x03,0x0E,0x07,0x0C,0x1E,0x38,0x10,0x60,0xD0,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x03,0x07,0x8A,0x0F,0x96,0xF6,0x19,0xE0,0xF0,0xE0,0xF2,0x83,0x70,0x00,0x7D,0xF0,0x08,0x00,0x1F,0x04,0x0A,0x04,0x08,0x0C,0xD2,0x0E,0xDD,0x5C,0xA8,0x7C,0xFA,0xF0,0x6A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x1C,0xE1,0x83,0x04,0x02,0x01,0x01,0x12,0x03,0x34,0x07,0x73,0x37,0x4A,0x3F,0xDE,0x7C,0x9B,0x00,0x38,0x00,0x00,0x00,0x00,0x0C,0x32,0x3C,0xFE,0x7C,0xBA,0xFC,0x7F,0xFF,0x7E,0xFF,0x7F,0xFF,0x7F,0xFF,0x7F,0xFF,0x71,0x70,0xF0,0x70,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x18,0x38,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0xE3,0x1F,0xE7,0x3F,0xC7,0x5F,0xA3,0x00,0xE7,0x00,0x80,0x00,0x85,0x02,0x05,0x00,0x06,0x0C,0x00,0x00,0x04,0x04,0x09,0x00,0x1F,0x03,0x04,0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x80,0x88,0x48,0xC8,0x98,0x80,0xC0,0x80,0xC0,0x80,0x00,0x80,0x00,0x00,0x80,0x80,0x03,0x81,0x00,0x80,0x07,0x82,0x01,0x00,0x82,0x02,0x85,0x00,0x83,0x01,0x82,0x00,0xC2,0x00,0xC0,0x00,0xC0,0x00,0x60,0x00,0x60,0x00,0x70,0x00,0x3F,0x00,0x1F,0x00,0x17,0x00,0x1F,0x00,0x3F,0x00,0x1F,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x72,0x23,0xE3,0x62,0xC3,0xE7,0xC3,0xC7,0xC7,0x83,0x87,0xC7,0x87,0x8E,0x8E,0x07,0x0E,0x8E,0x0C,0x9E,0x1C,0x08,0x18,0x30,0xE0,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x03,0x00,0x03,0x00,0xFB,0xFC,0xFB,0xFE,0xFD,0xFE,0x7F,0xFE,0x7F,0xFF,0x2E,0xFF,0xFE,0x1F,0xEE,0x0F,0x1F,0x0F,0x07,0x0F,0x06,0x0F,0x1E,0x0F,0x1F,0x0F,0x1F,0x0F,0xDE,0xFF,0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1E,0xFF,0x0E,0xFE,0x8F,0xFE,0xFF,0xFC,0xFE,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x03,0x03,0x01,0x03,0x01,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xF8,0x77,0xFF,0xC7,0xFF,0x81,0xFF,0xFC,0xFF,0xF0,0xFB,0xE4,0xFF,0xE1,0xF0,0xCF,0x80,0x60,0x00,0xF0,0xC0,0x38,0xC0,0xB0,0xE0,0xF0,0xF8,0xF4,0xFF,0xF0,0xF9,0xE6,0xFF,0xF0,0xFF,0xFC,0xFF,0xFF,0xFF,0x0F,0xFF,0x00,0xFF,0xE0,0xFF,0xF8,0xFF,0xFF,0x7F,0xBF,0x0F,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x80,0xC0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0,0xE0,0xC0,0xC0,0x80,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0xF9,0x06,0xFF,0x37,0xFF,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0x7F,0xFF,0xFE,0xFC,0xFB,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x3F,0xFF,0x1F,0xFF,0x8F,0xFF,0xEF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0x1F,0xAF,0x03,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF3,0x25,0xEF,0xF7,0xF9,0xE1,0xF1,0xE0,0xE1,0xE0,0xE1,0xC1,0xC1,0xC1,0xC1,0x83,0xC3,0x83,0x83,0xC7,0x87,0xC3,0x87,0x8E,0x8E,0x9C,0xF8,0xB4,0x00,0x80,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0xB0,0x00,0x98,0x08,0xD6,0x0F,0xDA,0x1F,0xC0,0x1F,0xF8,0x3F,0xDE,0x7F,0xBF,0x7F,0x9F,0x0F,0x35,0x0E,0x15,0x07,0x0A,0x07,0x0F,0x0F,0x97,0x9F,0x33,0x3F,0xF1,0xFF,0x78,0xFF,0xFC,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x7F,0xFF,0x7F,0x0F,0x3F,0x47,0x3F,0x46,0x3C,0x02,0x38,0x04,0x30,0x68,0x60,0x80,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x40,0xC0,0xE1,0xE0,0xE0,0xE0,0xF0,0xF0,0xE1,0xF0,0xE1,0xE1,0xF0,0xE1,0xE1,0xE1,0xC3,0xC3,0xE1,0xC3,0x83,0x83,0x07,0x07,0x03,0x07,0x07,0x07,0x0F,0x07,0x0F,0x0F,0x07,0x0F,0x0F,0x0F,0x1F,0x3F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x04,0x3A,0x08,0xF7,0xCC,0x33,0x28,0x57,0x18,0x27,0x1C,0xE3,0x18,0xE7,0x10,0x29,0x00,0x39,0x10,0x29,0x10,0x29,0x00,0x3D,0x00,0xBF,0x00,0xFC,0x80,0x78,0xE1,0x1A,0x7D,0x82,0x1C,0xEF,0x0E,0xC5,0x07,0xC3,0x03,0xC1,0x01,0x83,0x01,0x80,0x00,0x81,0x00,0x80,0x80,0x00,0x80,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xE0,0x00,0xFF,0xC0,0x3F,0x3F,0xC0,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x11,0x38,0x11,0x70,0x30,0xE0,0x70,0xE0,0xE1,0xE0,0xC1,0xC1,0xE0,0xC1,0xC1,0xC1,0xC1,0xC1,0x83,0xC3,0x83,0xC3,0x87,0xC7,0xCE,0xFC,0x6A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0xFE,0xF0,0x0E,0x00,0x00,0x00,0x07,0x00,0xFE,0x00,0x80,0x00,0xC0,0x00,0xE0,0xC0,0x38,0x38,0x46,0x0C,0x13,0x03,0x04,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x0F,0x0F,0x90,0x0F,0xF7,0x0F,0xF5,0x8F,0x76,0xCF,0xB2,0xFC,0xE3,0xFC,0x33,0x0E,0x31,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0xC0,0xE0,0xE0,0xE0,0xE0,0xF0,0xF0,0xE1,0xF1,0xE1,0xE1,0xF3,0xE3,0xE1,0xE3,0xC3,0xC3,0xE3,0xC3,0x83,0x83,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x00,0x7E,0x01,0x1E,0x00,0x0F,0x01,0x1E,0x00,0xFE,0x00,0x80,0x00,0x1F,0xF8,0x07,0x18,0x67,0x03,0x1C,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x80,0x70,0xC0,0xB8,0xE0,0xDC,0xF0,0xEE,0xF8,0xF7,0xFC,0x7B,0xFE,0xFD,0xFF,0xFE,0x3F,0x5F,0x0F,0x17,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x11,0x38,0x11,0x70,0x30,0xE0,0x70,0xE0,0xE1,0xE0,0xC1,0xC1,0xE0,0xC1,0xC1,0xC1,0xC1,0xC1,0x83,0xC3,0x83,0xC3,0x87,0xC7,0xCE,0xFC,0x6A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x63,0x9C,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x3C,0xC3,0xFC,0x02,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xE6,0x04,0x0B,0x02,0x05,0x00,0x03,0x00,0x01,0x03,0x0C,0x1F,0x0F,0x07,0x0B,0x03,0x05,0x1F,0x27,0x3F,0x0F,0x01,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xA0,0xE0,0xE0,0xE0,0xF0,0xF0,0xE0,0xF0,0xE1,0xE1,0xF1,0xE1,0xE3,0xE3,0xC1,0xC3,0xE3,0xC3,0x83,0x83,0x83,0x03,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x78,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0xF8,0x07,0xF8,0x30,0xCF,0x00,0xF8,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x0D,0x00,0x3C,0x00,0xF0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0xC0,0x00,0xC0,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0x40,0x00,0x80,0x00,0x80,0x00,0xC0,0x00,0x40,0x00,0xC0,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x0C,0x7E,0x7C,0x1E,0x3C,0x1C,0x1E,0x1C,0x3C,0x3C,0x18,0x3C,0x38,0x38,0x7C,0x79,0x3A,0x7B,0x7F,0x78,0xFD,0xF0,0x78,0xF0,0x70,0xE0,0xF0,0xE0,0xE1,0xE0,0xC1,0xC1,0xE1,0xC1,0xC3,0xC3,0x83,0xC7,0x83,0xCE,0x84,0xF8,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x1E,0x00,0xF0,0x00,0x80,0x00,0x0F,0x00,0xFF,0x00,0xF0,0x01,0x0E,0x1C,0xE3,0x60,0x9E,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x2C,0xD2,0xC0,0x26,0x80,0x41,0x80,0x40,0x00,0xFC,0x00,0x3D,0x01,0x02,0x00,0x1F,0x00,0xF6,0x20,0x12,0x70,0xA0,0xC0,0x20,0x00,0x00,0x00,0x00,0x00,0x30,0x10,0x78,0x70,0xC3,0x00,0x46,0x00,0x9C,0x20,0x59,0x20,0x13,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x01,0x01,0x03,0x03,0x01,0x03,0x03,0x03,0x03,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x37,0x00,0xFF,0x03,0xFC,0x80,0x78,0x00,0x1F,0x00,0xFF,0x03,0xFC,0x1C,0xE3,0x00,0xF8,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x7F,0x80,0xC1,0xC3,0x84,0x40,0xAF,0xE0,0x1C,0x80,0x40,0x00,0xC0,0x00,0xF0,0x00,0xE0,0x00,0x20,0x00,0x47,0x4C,0xA0,0x4C,0xE2,0x2C,0xD2,0x00,0xA4,0x00,0x60,0x00,0x40,0x00,0x6F,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x05,0x0E,0x31,0xE0,0x1F,0x00,0x07,0x00,0xFF,0x00,0xD7,0xC0,0xBF,0xFC,0xE3,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0xBF,0x9F,0x60,0x9F,0x6F,0xCF,0x17,0x80,0x07,0x00,0x00,0x01,0x00,0x03,0x0D,0x1F,0x08,0x0E,0x19,0x0E,0x05,0x0E,0x05,0x0E,0x01,0x0E,0x05,0x0F,0x9C,0x1F,0x6C,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x70,0x28,0x78,0x07,0x78,0xE7,0x40,0xA1,0x3F,0xC0,0x3F,0x5F,0xFF,0x3F,0xF0,0x28,0xF0,0x00,0x78,0xF6,0x7F,0x3E,0x1F,0x3F,0x7F,0x3C,0x3F,0x48,0x03,0x2C,0x00,0x3E,0x00,0x38,0x00,0x20,0x00,0x60,0x00,0x40,0x00,0x47,0x02,0x45,0x00,0x67,0x00,0x61,0x00,0x65,0x00,0x76,0x00,0x66,0x20,0x56,0x04,0x60,0x20,0x1C,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
};
|
|
|
@ -1,80 +0,0 @@
|
||||||
/*
|
|
||||||
batt.c -
|
|
||||||
Copyright (C) 2007
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "lpc2220.h"
|
|
||||||
#include "batt.h"
|
|
||||||
#include "lcd.h"
|
|
||||||
|
|
||||||
|
|
||||||
void initADC(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* Setup A/D: 10-bit AIN0 @ 4,2MHz "Non-Burst"-Mode */
|
|
||||||
|
|
||||||
//PINSEL1 |= (1UL<<28); // set function P0.29 as AIN2
|
|
||||||
|
|
||||||
// sample AIN0 only => bit 0 = 1
|
|
||||||
// CLKDIV = 14 (59/14 = 4.21 < 4.5 MHz) => Bits 8ff = 14-1
|
|
||||||
// BURST = 1 => set Bit 16 - wuff: disabled below
|
|
||||||
// PDN = 1 => set Bit 21
|
|
||||||
ADCR = ( 1<<5 | ((14-1)<<8) /*| (1UL<<16)*/ | (1UL<<21) );
|
|
||||||
|
|
||||||
}
|
|
||||||
unsigned int getADCvalue(void)
|
|
||||||
{
|
|
||||||
unsigned int val=0;
|
|
||||||
ADCR = ( 1<<5 | ((14-1)<<8) /*| (1UL<<16)*/ | (1UL<<21) );
|
|
||||||
ADCR |= (1UL<<24); /* Start A/D Conversion (START:0=1) */
|
|
||||||
while ((ADDR & (1UL<<31)) == 0); /* Wait for the conversion to complete (DONE=1)*/
|
|
||||||
val = ((ADDR >> 6) & 0x03FF); /* Extract the A/D result */
|
|
||||||
ADCR &=~(1UL<<21);
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_battery(unsigned char x, unsigned char y)
|
|
||||||
{
|
|
||||||
unsigned int val=0;
|
|
||||||
unsigned char w=0;
|
|
||||||
|
|
||||||
draw_rect(x,y,14,7,1,3,DRAW_PUT);
|
|
||||||
draw_vline(x+14,y+2,3,3,DRAW_PUT);
|
|
||||||
draw_block(x+1,y+1,12,5,2,DRAW_ERASE);
|
|
||||||
|
|
||||||
val=getADCvalue();
|
|
||||||
|
|
||||||
if (val<0x320)
|
|
||||||
val=0x320;
|
|
||||||
if (val>0x380)
|
|
||||||
val=0x380;
|
|
||||||
|
|
||||||
w= (val-0x320)/8;
|
|
||||||
|
|
||||||
draw_block(x+1,y+1,w,5,2,DRAW_PUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_ant(unsigned char x, unsigned char y, unsigned char m) {
|
|
||||||
|
|
||||||
draw_vline(x+3,y,7,3,m);
|
|
||||||
draw_pixel(x,y,3,m);
|
|
||||||
draw_pixel(x+1,y+1,3,m);
|
|
||||||
draw_pixel(x+2,y+2,3,m);
|
|
||||||
draw_pixel(x+6,y,3,m);
|
|
||||||
draw_pixel(x+5,y+1,3,m);
|
|
||||||
draw_pixel(x+4,y+2,3,m);
|
|
||||||
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
<pd><ViewState><e p="Boop" x="true"></e></ViewState></pd>
|
|
|
@ -1 +0,0 @@
|
||||||
<Workspace name="New Project Group"><Project path="Boop.pnproj"></Project><Project path="L:\Betty\Neuer Ordner\trunk\Boop_flash.pnproj"></Project></Workspace>
|
|
|
@ -1,158 +0,0 @@
|
||||||
/*
|
|
||||||
batt.c -
|
|
||||||
Copyright (C) 2007
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "lpc2220.h"
|
|
||||||
#include "cc1100.h"
|
|
||||||
#include "irq.h"
|
|
||||||
|
|
||||||
const unsigned char conf[0x2F] = { 0x29 , 0x2E , 0x07 , 0x00 , 0xD3 , 0x91 , 0x3D , 0x0C ,
|
|
||||||
0x05 , 0x00 , 0x00 , 0x06 , 0x00 , 0x20 , 0x28 , 0xC5 ,
|
|
||||||
0xF5 , 0x75 , 0x83 , 0x22 , 0xE5 , 0x14 , 0x07 , 0x30 ,
|
|
||||||
0x18 , 0x16 , 0x6C , 0x03 , 0x40 , 0x91 , 0x87 , 0x6B ,
|
|
||||||
0xF8 , 0x56 , 0x10 , 0xE9 , 0x2A , 0x00 , 0x1F , 0x41 ,
|
|
||||||
0x00 , 0x59 , 0x7F , 0x3F , 0x81 , 0x35 , 0x09 };
|
|
||||||
|
|
||||||
volatile unsigned char cc1100rx;
|
|
||||||
|
|
||||||
|
|
||||||
void cc1100_init(void) {
|
|
||||||
|
|
||||||
unsigned long xx = 0x200;
|
|
||||||
|
|
||||||
|
|
||||||
PINSEL1 &= ~((1<<3) | (1<<5) | (1<<7));
|
|
||||||
PCONP &= 0xfffffbff;
|
|
||||||
PCONP |= (1<<21);
|
|
||||||
FIOSET0 = SCK1;
|
|
||||||
FIOCLR0 = MOSI1;
|
|
||||||
FIOCLR0 = CS1;
|
|
||||||
while(xx) {
|
|
||||||
asm volatile("nop" : :);
|
|
||||||
xx--;
|
|
||||||
}
|
|
||||||
FIOSET0 = CS1;
|
|
||||||
xx=0x200;
|
|
||||||
while(xx) {
|
|
||||||
asm volatile("nop" : :);
|
|
||||||
xx--;
|
|
||||||
}
|
|
||||||
FIOCLR0 = CS1;
|
|
||||||
FIOCLR0 = SCK1;
|
|
||||||
while (FIOPIN0 & MISO1);
|
|
||||||
|
|
||||||
PINSEL1 |= 0x000002A8; //((1<<3) | (1<<5) | (1<<7));
|
|
||||||
SSPCR0 = 0x0007;
|
|
||||||
SSPCPSR = 0x02;
|
|
||||||
SSPCR1 = 0x02;
|
|
||||||
|
|
||||||
SSPDR = SRES;
|
|
||||||
while (FIOPIN0 & MISO1);
|
|
||||||
while (SSPSR & (1<<4));
|
|
||||||
xx = SSPDR;
|
|
||||||
|
|
||||||
cc1100_write((0x00 | BURST ),conf,0x2f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
unsigned char cc1100_write(unsigned char addr,unsigned char* data, unsigned char lenght) {
|
|
||||||
|
|
||||||
unsigned short i;
|
|
||||||
unsigned char status;
|
|
||||||
unsigned char x;
|
|
||||||
|
|
||||||
FIOCLR0 = CS1;
|
|
||||||
while (FIOPIN0 & MISO1);
|
|
||||||
SSPDR = (addr | WRITE);
|
|
||||||
while ((SSPSR & (1<<4)));
|
|
||||||
status = SSPDR;
|
|
||||||
for (i=0; i < lenght; i++) {
|
|
||||||
SSPDR = data[i];
|
|
||||||
while ((SSPSR & (1<<4)));
|
|
||||||
x=SSPDR;
|
|
||||||
}
|
|
||||||
FIOSET0 = CS1;
|
|
||||||
|
|
||||||
return(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char cc1100_read(unsigned char addr, unsigned char* data, unsigned char lenght) {
|
|
||||||
|
|
||||||
unsigned short i;
|
|
||||||
unsigned char status;
|
|
||||||
|
|
||||||
FIOCLR0 = CS1;
|
|
||||||
while (FIOPIN0 & MISO1);
|
|
||||||
SSPDR = (addr | READ);
|
|
||||||
while ((SSPSR & (1<<4)));
|
|
||||||
status = SSPDR;
|
|
||||||
for (i=0; i < lenght; i++) {
|
|
||||||
SSPDR = 0x00;
|
|
||||||
while ((SSPSR & (1<<4)));
|
|
||||||
data[i]=SSPDR;
|
|
||||||
}
|
|
||||||
FIOSET0 = CS1;
|
|
||||||
|
|
||||||
return(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char cc1100_strobe(unsigned char cmd) {
|
|
||||||
|
|
||||||
unsigned short status;
|
|
||||||
|
|
||||||
FIOCLR0 = CS1;
|
|
||||||
while (FIOPIN0 & MISO1);
|
|
||||||
SSPDR = cmd;
|
|
||||||
while ((SSPSR & (1<<4)));
|
|
||||||
status = SSPDR;
|
|
||||||
FIOSET0 = CS1;
|
|
||||||
|
|
||||||
return(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
void startcc1100IRQ(void) {
|
|
||||||
PINSEL1 |= 1;
|
|
||||||
EXTMODE |= 1;
|
|
||||||
EXTPOLAR |= 1;
|
|
||||||
EXTINT |= 1;
|
|
||||||
|
|
||||||
VICVectAddr1 = (unsigned long)&(cc1100IRQ);
|
|
||||||
VICVectCntl1 = VIC_SLOT_EN | INT_SRC_EINT0;
|
|
||||||
VICIntEnable = INT_EINT0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cc1100_getfifo(unsigned char* b) {
|
|
||||||
|
|
||||||
unsigned char cnt;
|
|
||||||
|
|
||||||
cc1100_read(RX_fifo, &cnt,1);
|
|
||||||
cc1100_read(RX_fifo, b,cnt+2);
|
|
||||||
b[cnt]=0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void __attribute__ ((interrupt("IRQ"))) cc1100IRQ (void) {
|
|
||||||
|
|
||||||
EXTINT = 0x01;
|
|
||||||
cc1100rx =1;
|
|
||||||
|
|
||||||
|
|
||||||
VICVectAddr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
/*
|
|
||||||
batt.h -
|
|
||||||
Copyright (C) 2007
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef cc1100_H
|
|
||||||
#define cc1100_H
|
|
||||||
|
|
||||||
#define MISO1 (1<<18)
|
|
||||||
#define MOSI1 (1<<19)
|
|
||||||
#define SCK1 (1<<17)
|
|
||||||
#define CS1 (1<<23)
|
|
||||||
|
|
||||||
#define WRITE 0x00
|
|
||||||
#define BURST 0x40
|
|
||||||
#define READ 0x80
|
|
||||||
#define TX_fifo 0x7F
|
|
||||||
#define RX_fifo 0xff
|
|
||||||
|
|
||||||
#define SRES 0x30
|
|
||||||
#define SFSTXON 0x31
|
|
||||||
#define SXOFF 0x32
|
|
||||||
#define SCLA 0x33
|
|
||||||
#define SRX 0x34
|
|
||||||
#define STX 0x35
|
|
||||||
#define SIDLE 0x36
|
|
||||||
#define SWOR 0x38
|
|
||||||
#define SPWD 0x39
|
|
||||||
#define SFRX 0x3A
|
|
||||||
#define SFTX 0x3B
|
|
||||||
#define SWORRST 0x3C
|
|
||||||
#define SNOP 0x3D
|
|
||||||
|
|
||||||
|
|
||||||
void cc1100_init(void);
|
|
||||||
unsigned char cc1100_write(unsigned char addr, unsigned char* data, unsigned char lenght);
|
|
||||||
unsigned char cc1100_read(unsigned char addr, unsigned char* data, unsigned char lenght);
|
|
||||||
unsigned char cc1100_strobe(unsigned char cmd);
|
|
||||||
void startcc1100IRQ(void);
|
|
||||||
void __attribute__ ((interrupt("IRQ"))) cc1100IRQ (void);
|
|
||||||
void cc1100_getfifo(unsigned char* b);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,199 +0,0 @@
|
||||||
/*
|
|
||||||
crt.s - startup code
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
.global main
|
|
||||||
|
|
||||||
.global _etext
|
|
||||||
.global _data
|
|
||||||
.global _edata
|
|
||||||
.global __bss_start
|
|
||||||
.global __bss_end__
|
|
||||||
.global _stack
|
|
||||||
|
|
||||||
/* Stack Sizes */
|
|
||||||
.set UND_STACK_SIZE, 0x00000004 /* stack for "undefined instruction" interrupts is 4 bytes */
|
|
||||||
.set ABT_STACK_SIZE, 0x00000004 /* stack for "abort" interrupts is 4 bytes */
|
|
||||||
.set FIQ_STACK_SIZE, 0x00000004 /* stack for "FIQ" interrupts is 4 bytes */
|
|
||||||
.set IRQ_STACK_SIZE, 0X00000100 /* stack for "IRQ" normal interrupts is 4 bytes */
|
|
||||||
.set SVC_STACK_SIZE, 0x00000004 /* stack for "SVC" supervisor mode is 4 bytes */
|
|
||||||
|
|
||||||
/* Standard definitions of Mode bits and Interrupt (I & F) flags in PSRs */
|
|
||||||
.set MODE_USR, 0x10 /* Normal User Mode */
|
|
||||||
.set MODE_FIQ, 0x11 /* FIQ Processing Fast Interrupts Mode */
|
|
||||||
.set MODE_IRQ, 0x12 /* IRQ Processing Standard Interrupts Mode */
|
|
||||||
.set MODE_SVC, 0x13 /* Supervisor Processing Software Interrupts Mode */
|
|
||||||
.set MODE_ABT, 0x17 /* Abort Processing memory Faults Mode */
|
|
||||||
.set MODE_UND, 0x1B /* Undefined Processing Undefined Instructions Mode */
|
|
||||||
.set MODE_SYS, 0x1F /* System Running Priviledged Operating System Tasks Mode */
|
|
||||||
.set I_BIT, 0x80 /* when I bit is set, IRQ is disabled (program status registers) */
|
|
||||||
.set F_BIT, 0x40 /* when F bit is set, FIQ is disabled (program status registers) */
|
|
||||||
|
|
||||||
|
|
||||||
.text
|
|
||||||
.arm
|
|
||||||
|
|
||||||
.global Reset_Handler
|
|
||||||
.global _startup
|
|
||||||
.global _endstartup
|
|
||||||
|
|
||||||
.global ramvectors
|
|
||||||
.func ramvectors
|
|
||||||
|
|
||||||
ramvectors:
|
|
||||||
ldr PC, Ram_Reset_Addr
|
|
||||||
ldr PC, Ram_Undef_Addr
|
|
||||||
ldr PC, Ram_SWI_Addr
|
|
||||||
ldr PC, Ram_PAbt_Addr
|
|
||||||
ldr PC, Ram_DAbt_Addr
|
|
||||||
nop /* Reserved Vector (holds Philips ISP checksum) */
|
|
||||||
ldr PC, [PC,#-0xFF0] /* Route IRQ to VIC */
|
|
||||||
ldr PC, Ram_FIQ_Addr
|
|
||||||
|
|
||||||
Ram_Reset_Addr: .word Reset_Handler /* defined in this module below */
|
|
||||||
Ram_Undef_Addr: .word UNDEF_Routine /* defined in main.c */
|
|
||||||
Ram_SWI_Addr: .word SWI_Routine /* defined in main.c */
|
|
||||||
Ram_PAbt_Addr: .word UNDEF_Routine /* defined in main.c */
|
|
||||||
Ram_DAbt_Addr: .word UNDEF_Routine /* defined in main.c */
|
|
||||||
Ram_IRQ_Addr: .word IRQ_Routine /* defined in main.c */
|
|
||||||
Ram_FIQ_Addr: .word FIQ_Routine /* defined in main.c */
|
|
||||||
.word 0 /* rounds vectors to 64 bytes total */
|
|
||||||
.endfunc
|
|
||||||
|
|
||||||
.section .text
|
|
||||||
|
|
||||||
.func _startup
|
|
||||||
|
|
||||||
_startup:
|
|
||||||
|
|
||||||
# Exception Vectors
|
|
||||||
|
|
||||||
_vectors:
|
|
||||||
ldr PC, Reset_Addr
|
|
||||||
|
|
||||||
Reset_Addr: .word Reset_Handler
|
|
||||||
|
|
||||||
# Reset Handler
|
|
||||||
|
|
||||||
Reset_Handler:
|
|
||||||
|
|
||||||
/* Setup a stack for each mode - note that this only sets up a usable stack
|
|
||||||
for User mode. Also each mode is setup with interrupts initially disabled. */
|
|
||||||
|
|
||||||
ldr r0, =_stack_end
|
|
||||||
msr CPSR_c, #MODE_UND|I_BIT|F_BIT /* Undefined Instruction Mode */
|
|
||||||
mov sp, r0
|
|
||||||
sub r0, r0, #UND_STACK_SIZE
|
|
||||||
msr CPSR_c, #MODE_ABT|I_BIT|F_BIT /* Abort Mode */
|
|
||||||
mov sp, r0
|
|
||||||
sub r0, r0, #ABT_STACK_SIZE
|
|
||||||
msr CPSR_c, #MODE_FIQ|I_BIT|F_BIT /* FIQ Mode */
|
|
||||||
mov sp, r0
|
|
||||||
sub r0, r0, #FIQ_STACK_SIZE
|
|
||||||
msr CPSR_c, #MODE_IRQ|I_BIT|F_BIT /* IRQ Mode */
|
|
||||||
mov sp, r0
|
|
||||||
sub r0, r0, #IRQ_STACK_SIZE
|
|
||||||
msr CPSR_c, #MODE_SVC|I_BIT|F_BIT /* Supervisor Mode */
|
|
||||||
mov sp, r0
|
|
||||||
sub r0, r0, #SVC_STACK_SIZE
|
|
||||||
msr CPSR_c, #MODE_SYS|I_BIT|F_BIT /* User Mode */
|
|
||||||
mov sp, r0
|
|
||||||
|
|
||||||
/* Setup Pins and Memory */
|
|
||||||
ldr r0,=BCFG0
|
|
||||||
ldr r1, =0x10000420
|
|
||||||
str r1,[r0]
|
|
||||||
str r1,[r0,#0x08]
|
|
||||||
|
|
||||||
ldr r0, =BCFG1
|
|
||||||
ldr r1, =0xc42
|
|
||||||
str r1, [r0]
|
|
||||||
|
|
||||||
ldr r0, =PINSEL0
|
|
||||||
ldr r1, =0x00008005
|
|
||||||
str r1, [r0]
|
|
||||||
|
|
||||||
ldr r0, =PINSEL1
|
|
||||||
ldr r1, =0x20000000
|
|
||||||
str r1, [r0]
|
|
||||||
|
|
||||||
ldr r0, =PINSEL2
|
|
||||||
ldr r1, =0x0de049d4
|
|
||||||
str r1, [r0]
|
|
||||||
|
|
||||||
ldr r0, = IO2SET
|
|
||||||
ldr r1, =0x1FC0000
|
|
||||||
str r1, [r0]
|
|
||||||
str r1, [r0,#0x04]
|
|
||||||
|
|
||||||
ldr r0, = IO0DIR
|
|
||||||
ldr r1, =0x002018D0
|
|
||||||
str r1, [r0]
|
|
||||||
|
|
||||||
|
|
||||||
/* Setup PLL */
|
|
||||||
ldr r0, =0xe01fc000
|
|
||||||
ldr r2, =0xaa
|
|
||||||
ldr r3, =0x55
|
|
||||||
ldr r1, =0x03
|
|
||||||
str r1, [r0,#0x80]
|
|
||||||
ldr r1, =0x0
|
|
||||||
str r1, [r0,#0x100]
|
|
||||||
ldr r1, =0x42
|
|
||||||
str r1,[r0,#0x84]
|
|
||||||
str r2, [r0,#0x8c]
|
|
||||||
str r3, [r0,#0x8c]
|
|
||||||
|
|
||||||
_endstartup:
|
|
||||||
/* Copy .fastcode & .data section (Copy from ROM to RAM) */
|
|
||||||
ldr R0, =ramvectors /*_etext*/
|
|
||||||
ldr r3, entry_mask /* this and the next instruction are an workaround */
|
|
||||||
and r0, r0, r3 /* for some ugly bug in winarm to force msb to 0x80 */
|
|
||||||
ldr R1, =0x40000000 /*_data*/
|
|
||||||
ldr R2, =_startup
|
|
||||||
1:
|
|
||||||
cmp r1,r2
|
|
||||||
ldmltia r0!,{r3}
|
|
||||||
stmltia r1!,{r3}
|
|
||||||
blt 1b
|
|
||||||
|
|
||||||
/* Clear .bss section (Zero init) */
|
|
||||||
mov R0, #0
|
|
||||||
ldr R1, =_bss_start
|
|
||||||
ldr R2, =_bss_end
|
|
||||||
2:
|
|
||||||
cmp R1, R2
|
|
||||||
strlo R0, [R1], #4
|
|
||||||
blo 2b
|
|
||||||
|
|
||||||
ldr r0, =MEMMAP
|
|
||||||
ldr r1, =0x02 /* irq vectors in ram */
|
|
||||||
str r1, [r0]
|
|
||||||
|
|
||||||
mov r0,#0
|
|
||||||
mov r1,r0
|
|
||||||
mov r2,r0
|
|
||||||
mov fp,r0
|
|
||||||
mov r7,r0
|
|
||||||
ldr r10,=main
|
|
||||||
mov lr,pc
|
|
||||||
bx r10
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.endfunc
|
|
||||||
entry_mask: .word 0x4FFFFFFF /* defined in this module below */
|
|
||||||
.end
|
|
|
@ -1,7 +0,0 @@
|
||||||
#ifndef EXTERNS_H
|
|
||||||
#define EXTERNS_H
|
|
||||||
|
|
||||||
extern unsigned int keys[2];
|
|
||||||
extern unsigned char autorepeat;
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,174 +0,0 @@
|
||||||
/*
|
|
||||||
flash.c - writing/erasing flash
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "serial.h"
|
|
||||||
#include "lcd.h"
|
|
||||||
|
|
||||||
const unsigned long secaddr[19] =
|
|
||||||
{ 0x00000,
|
|
||||||
0x02000,
|
|
||||||
0x03000,
|
|
||||||
0x04000,
|
|
||||||
0x08000,
|
|
||||||
0x10000,
|
|
||||||
0x18000,
|
|
||||||
0x20000,
|
|
||||||
0x28000,
|
|
||||||
0x30000,
|
|
||||||
0x38000,
|
|
||||||
0x40000,
|
|
||||||
0x48000,
|
|
||||||
0x50000,
|
|
||||||
0x58000,
|
|
||||||
0x60000,
|
|
||||||
0x68000,
|
|
||||||
0x70000,
|
|
||||||
0x78000 };
|
|
||||||
|
|
||||||
unsigned long flash_base;
|
|
||||||
|
|
||||||
int eraseSector(unsigned char chip, unsigned char secnum)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(chip == 0)
|
|
||||||
flash_base = FLASH0_BASE;
|
|
||||||
else
|
|
||||||
flash_base = FLASH1_BASE;
|
|
||||||
|
|
||||||
serial_puts("Erasing Sector: 0x");
|
|
||||||
putHexW(flash_base + (secaddr[secnum]<<1));
|
|
||||||
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xAA;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0x554)) = 0x55;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0x80;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xAA;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0x554)) = 0x55;
|
|
||||||
*((volatile unsigned short *)(flash_base + (secaddr[secnum]<<1))) = 0x30;
|
|
||||||
|
|
||||||
if((*((volatile unsigned short *)(flash_base)) & 0x44) == (*((volatile unsigned short *)(flash_base)) & 0x44))
|
|
||||||
{
|
|
||||||
serial_puts(" -- ERROR\n");
|
|
||||||
*((volatile unsigned short *)(flash_base)) = 0xF0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
while ((*((volatile unsigned short *)(flash_base)) & 0x44) != (*((volatile unsigned short *)(flash_base)) & 0x44))
|
|
||||||
{}
|
|
||||||
serial_puts(" +> OK\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int eraseFlash(unsigned char chip)
|
|
||||||
{
|
|
||||||
if(chip == 0)
|
|
||||||
flash_base = FLASH0_BASE;
|
|
||||||
else
|
|
||||||
flash_base = FLASH1_BASE;
|
|
||||||
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xAA;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0x554)) = 0x55;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0x80;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xAA;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0x554)) = 0x55;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0x10;
|
|
||||||
|
|
||||||
if((*((volatile unsigned short *)(flash_base)) & 0x44) == (*((volatile unsigned short *)(flash_base)) & 0x44))
|
|
||||||
{
|
|
||||||
*((volatile unsigned short *)(flash_base)) = 0xF0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
while ((*((volatile unsigned short *)(flash_base)) & 0x44) != (*((volatile unsigned short *)(flash_base)) & 0x44))
|
|
||||||
{}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int writeWord(unsigned long addr, unsigned short data)
|
|
||||||
{
|
|
||||||
flash_base = addr & 0xFF000000;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xAA;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0x554)) = 0x55;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xA0;
|
|
||||||
*((volatile unsigned short *)(addr)) = data;
|
|
||||||
|
|
||||||
if(*((volatile unsigned short *)(addr)) == *((volatile unsigned short *)(addr)))
|
|
||||||
{
|
|
||||||
serial_puts("NACK");
|
|
||||||
*((volatile unsigned short *)(flash_base)) = 0xF0;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(*((volatile unsigned short *)(addr)) != *((volatile unsigned short *)(addr)))
|
|
||||||
{}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void prepareBulk(unsigned long dst)
|
|
||||||
{
|
|
||||||
flash_base = dst & 0xFF000000;
|
|
||||||
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0xAA;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0x554)) = 0x55;
|
|
||||||
*((volatile unsigned short *)(flash_base | 0xAAA)) = 0x20;
|
|
||||||
}
|
|
||||||
|
|
||||||
void endBulk(unsigned long dst)
|
|
||||||
{
|
|
||||||
flash_base = dst & 0xFF000000;
|
|
||||||
|
|
||||||
*((volatile unsigned short *)(flash_base)) = 0x90;
|
|
||||||
*((volatile unsigned short *)(flash_base)) = 0x00;
|
|
||||||
}
|
|
||||||
|
|
||||||
int writeBulk(unsigned long src, unsigned long dst, unsigned long cnt)
|
|
||||||
{
|
|
||||||
unsigned short check1, check2;
|
|
||||||
while(cnt--)
|
|
||||||
{
|
|
||||||
*((volatile unsigned short *)dst) = 0xA0;
|
|
||||||
*((volatile unsigned short *)dst) = *((volatile unsigned short *)src);
|
|
||||||
|
|
||||||
retry:
|
|
||||||
check1 = *((volatile unsigned short *)dst);
|
|
||||||
check2 = *((volatile unsigned short *)dst);
|
|
||||||
if((check1 & 0x40) == (check2 & 0x40))
|
|
||||||
goto done;
|
|
||||||
if(!(check2 & 0x20))
|
|
||||||
goto retry;
|
|
||||||
check1 = *((volatile unsigned short *)dst);
|
|
||||||
check2 = *((volatile unsigned short *)dst);
|
|
||||||
if((check1 & 0x40) == (check2 & 0x40))
|
|
||||||
goto done;
|
|
||||||
*((volatile unsigned short *)dst) = 0xF0;
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
done:
|
|
||||||
check1 = *((volatile unsigned short *)dst);
|
|
||||||
check2 = *((volatile unsigned short *)dst);
|
|
||||||
if(check1 != check2)
|
|
||||||
goto retry;
|
|
||||||
|
|
||||||
src+=2;
|
|
||||||
dst+=2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
flash.h - writing/erasing flash
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FLASH_H
|
|
||||||
#define FLASH_H
|
|
||||||
|
|
||||||
#define FLASH0_BASE 0x80000000
|
|
||||||
#define FLASH1_BASE 0x82000000
|
|
||||||
|
|
||||||
void prepareBulk(unsigned long dst);
|
|
||||||
void endBulk(unsigned long dst);
|
|
||||||
int eraseSector(unsigned char chip, unsigned char secnum);
|
|
||||||
int eraseFlash(unsigned char chip);
|
|
||||||
int writeWord(unsigned long addr, unsigned short data);
|
|
||||||
int writeBulk(unsigned long src, unsigned long dst, unsigned long cnt);
|
|
||||||
void lcd_set(unsigned char s);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,433 +0,0 @@
|
||||||
/*
|
|
||||||
fonty.c - drawing text & font handling
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "lcd.h"
|
|
||||||
#include "fonty.h"
|
|
||||||
|
|
||||||
#include "fonts/charset.info"
|
|
||||||
#include "fonts/charset.bits"
|
|
||||||
/*
|
|
||||||
#include "fonts/smooth.info"
|
|
||||||
#include "fonts/smooth.bits"
|
|
||||||
*/
|
|
||||||
static unsigned char tx, ty, coff, dbl;
|
|
||||||
unsigned char *font_bits, *font_info, font_dlines;
|
|
||||||
unsigned char *font_bitsUM, *font_bitsUL, *font_bitsMM, *font_bitsML, *font_bitsLM, *font_bitsLL;
|
|
||||||
|
|
||||||
void set_font(unsigned char f)
|
|
||||||
{
|
|
||||||
switch(f)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
case 2:
|
|
||||||
coff = 0;
|
|
||||||
dbl = 16;
|
|
||||||
font_info = (unsigned char*) smooth_info;
|
|
||||||
font_bitsUM = (unsigned char*) smooth_mt_bits;
|
|
||||||
font_bitsUL = (unsigned char*) smooth_lt_bits;
|
|
||||||
font_bitsLM = (unsigned char*) smooth_mb_bits;
|
|
||||||
font_bitsLL = (unsigned char*) smooth_lb_bits;
|
|
||||||
font_dlines = smooth_dlines;
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
case 1:
|
|
||||||
coff = 0;
|
|
||||||
dbl = 1;
|
|
||||||
font_bits = (unsigned char*) charset_bits;
|
|
||||||
font_info = (unsigned char*) charset_info;
|
|
||||||
font_dlines = charset_dlines;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
coff = 0;
|
|
||||||
dbl = 0;
|
|
||||||
font_bits = (unsigned char*) charset_bits;
|
|
||||||
font_info = (unsigned char*) charset_info;
|
|
||||||
font_dlines = charset_dlines;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _draw_char(unsigned int ch, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
unsigned char p,q,r,s,t;
|
|
||||||
unsigned int cpos, cnt;
|
|
||||||
|
|
||||||
cpos = 0;
|
|
||||||
|
|
||||||
for(cnt=0; cnt<ch; cnt++)
|
|
||||||
{
|
|
||||||
if(cnt & 0x01)
|
|
||||||
{
|
|
||||||
cpos += (font_info[cnt>>1] & 0x0F);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cpos += (font_info[cnt>>1] >> 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p = font_info[ch>>1];
|
|
||||||
if(ch & 0x01)
|
|
||||||
{
|
|
||||||
p &= 0x0F;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p >>= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dbl == 1)
|
|
||||||
{
|
|
||||||
if(ty & 0x07)
|
|
||||||
{
|
|
||||||
t = ty & 0x07;
|
|
||||||
p <<= 1;
|
|
||||||
|
|
||||||
for(cnt=0;cnt<p;cnt+=2)
|
|
||||||
{
|
|
||||||
r = p-cnt-1;
|
|
||||||
s = font_bits[cpos+(cnt>>1)];
|
|
||||||
q = 0x00;
|
|
||||||
|
|
||||||
if(s & 0x01)
|
|
||||||
q += 0x03;;
|
|
||||||
if(s & 0x02)
|
|
||||||
q += 0x0C;;
|
|
||||||
if(s & 0x04)
|
|
||||||
q += 0x30;;
|
|
||||||
if(s & 0x08)
|
|
||||||
q += 0xC0;;
|
|
||||||
|
|
||||||
if(c & 0x02)
|
|
||||||
s = q << t;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[0][r] = s;
|
|
||||||
drawbuf[0][r-1] = s;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
s = q << t;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[1][r] = s;
|
|
||||||
drawbuf[1][r-1] = s;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty,p,m);
|
|
||||||
|
|
||||||
for(cnt=0;cnt<p;cnt+=2)
|
|
||||||
{
|
|
||||||
r = p-cnt-1;
|
|
||||||
s = font_bits[cpos+(cnt>>1)];
|
|
||||||
q = 0x00;
|
|
||||||
|
|
||||||
if(s & 0x01)
|
|
||||||
q += 0x03;;
|
|
||||||
if(s & 0x02)
|
|
||||||
q += 0x0C;;
|
|
||||||
if(s & 0x04)
|
|
||||||
q += 0x30;;
|
|
||||||
if(s & 0x08)
|
|
||||||
q += 0xC0;;
|
|
||||||
|
|
||||||
if(c & 0x02)
|
|
||||||
s = q >> (8-t);
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[0][r] = s;
|
|
||||||
drawbuf[0][r-1] = s;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
s = q >> (8-t);
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[1][r] = s;
|
|
||||||
drawbuf[1][r-1] = s;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty+8,p,m);
|
|
||||||
|
|
||||||
for(cnt=0;cnt<p;cnt+=2)
|
|
||||||
{
|
|
||||||
r = p-cnt-1;
|
|
||||||
s = font_bits[cpos+(cnt>>1)];
|
|
||||||
q = 0x00;
|
|
||||||
|
|
||||||
if(s & 0x10)
|
|
||||||
q += 0x03;;
|
|
||||||
if(s & 0x20)
|
|
||||||
q += 0x0C;;
|
|
||||||
if(s & 0x40)
|
|
||||||
q += 0x30;;
|
|
||||||
if(s & 0x80)
|
|
||||||
q += 0xC0;;
|
|
||||||
|
|
||||||
if(c & 0x02)
|
|
||||||
s = q << t;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[0][r] = s;
|
|
||||||
drawbuf[0][r-1] = s;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
s = q << t;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[1][r] = s;
|
|
||||||
drawbuf[1][r-1] = s;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty+8,p,m);
|
|
||||||
|
|
||||||
for(cnt=0;cnt<p;cnt+=2)
|
|
||||||
{
|
|
||||||
r = p-cnt-1;
|
|
||||||
s = font_bits[cpos+(cnt>>1)];
|
|
||||||
q = 0x00;
|
|
||||||
|
|
||||||
if(s & 0x10)
|
|
||||||
q += 0x03;;
|
|
||||||
if(s & 0x20)
|
|
||||||
q += 0x0C;;
|
|
||||||
if(s & 0x40)
|
|
||||||
q += 0x30;;
|
|
||||||
if(s & 0x80)
|
|
||||||
q += 0xC0;;
|
|
||||||
|
|
||||||
if(c & 0x02)
|
|
||||||
s = q >> (8-t);
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[0][r] = s;
|
|
||||||
drawbuf[0][r-1] = s;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
s = q >> (8-t);
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[1][r] = s;
|
|
||||||
drawbuf[1][r-1] = s;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty+16,p,m);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p <<= 1;
|
|
||||||
for(cnt=0;cnt<p;cnt+=2)
|
|
||||||
{
|
|
||||||
r = p-cnt-1;
|
|
||||||
s = font_bits[cpos+(cnt>>1)];
|
|
||||||
q = 0x00;
|
|
||||||
|
|
||||||
if(s & 0x01)
|
|
||||||
q += 0x03;;
|
|
||||||
if(s & 0x02)
|
|
||||||
q += 0x0C;;
|
|
||||||
if(s & 0x04)
|
|
||||||
q += 0x30;;
|
|
||||||
if(s & 0x08)
|
|
||||||
q += 0xC0;;
|
|
||||||
|
|
||||||
if(c & 0x02)
|
|
||||||
s = q;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[0][r] = s;
|
|
||||||
drawbuf[0][r-1] = s;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
s = q;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[1][r] = s;
|
|
||||||
drawbuf[1][r-1] = s;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty,p,m);
|
|
||||||
for(cnt=0;cnt<p;cnt+=2)
|
|
||||||
{
|
|
||||||
r = p-cnt-1;
|
|
||||||
s = font_bits[cpos+(cnt>>1)];
|
|
||||||
q = 0x00;
|
|
||||||
|
|
||||||
if(s & 0x10)
|
|
||||||
q += 0x03;;
|
|
||||||
if(s & 0x20)
|
|
||||||
q += 0x0C;;
|
|
||||||
if(s & 0x40)
|
|
||||||
q += 0x30;;
|
|
||||||
if(s & 0x80)
|
|
||||||
q += 0xC0;;
|
|
||||||
|
|
||||||
if(c & 0x02)
|
|
||||||
s = q;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[0][r] = s;
|
|
||||||
drawbuf[0][r-1] = s;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
s = q;
|
|
||||||
else
|
|
||||||
s = 0x00;
|
|
||||||
drawbuf[1][r] = s;
|
|
||||||
drawbuf[1][r-1] = s;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty+8,p,m);
|
|
||||||
}
|
|
||||||
tx += p+2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
if(ty & 0x07)
|
|
||||||
{
|
|
||||||
s = ty & 0x07;
|
|
||||||
|
|
||||||
for(cnt=0;cnt<p;cnt++)
|
|
||||||
{
|
|
||||||
if(c & 0x02)
|
|
||||||
drawbuf[0][p-cnt-1] = font_bits[cpos+cnt] << s;
|
|
||||||
else
|
|
||||||
drawbuf[0][p-cnt-1] = 0x00;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
drawbuf[1][p-cnt-1] = font_bits[cpos+cnt] << s;
|
|
||||||
else
|
|
||||||
drawbuf[1][p-cnt-1] = 0x00;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty,p,m);
|
|
||||||
|
|
||||||
for(cnt=0;cnt<p;cnt++)
|
|
||||||
{
|
|
||||||
if(c & 0x02)
|
|
||||||
drawbuf[0][p-cnt-1] = font_bits[cpos+cnt] >> (8-s);
|
|
||||||
else
|
|
||||||
drawbuf[0][p-cnt-1] = 0x00;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
drawbuf[1][p-cnt-1] = font_bits[cpos+cnt] >> (8-s);
|
|
||||||
else
|
|
||||||
drawbuf[1][p-cnt-1] = 0x00;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty+8,p,m);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for(cnt=0;cnt<p;cnt++)
|
|
||||||
{
|
|
||||||
if(c & 0x02)
|
|
||||||
drawbuf[0][p-cnt-1] = font_bits[cpos+cnt];
|
|
||||||
else
|
|
||||||
drawbuf[0][p-cnt-1] = 0x00;
|
|
||||||
|
|
||||||
if(c & 0x01)
|
|
||||||
drawbuf[1][p-cnt-1] = font_bits[cpos+cnt];
|
|
||||||
else
|
|
||||||
drawbuf[1][p-cnt-1] = 0x00;
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty,p,m);
|
|
||||||
}
|
|
||||||
tx += (p+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _draw_charB(unsigned int ch, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
unsigned char p;
|
|
||||||
unsigned int cpos, cnt;
|
|
||||||
|
|
||||||
cpos = 0;
|
|
||||||
|
|
||||||
for(cnt=0; cnt<ch; cnt++)
|
|
||||||
{
|
|
||||||
cpos += font_info[cnt];
|
|
||||||
}
|
|
||||||
|
|
||||||
p = font_info[ch];
|
|
||||||
|
|
||||||
if(dbl == 16)
|
|
||||||
{
|
|
||||||
for(cnt=0;cnt<p;cnt++)
|
|
||||||
{
|
|
||||||
drawbuf[0][p-cnt-1] = font_bitsUM[cpos+cnt];
|
|
||||||
drawbuf[1][p-cnt-1] = font_bitsUL[cpos+cnt];
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty,p,m);
|
|
||||||
for(cnt=0;cnt<p;cnt++)
|
|
||||||
{
|
|
||||||
drawbuf[0][p-cnt-1] = font_bitsLM[cpos+cnt];
|
|
||||||
drawbuf[1][p-cnt-1] = font_bitsLL[cpos+cnt];
|
|
||||||
}
|
|
||||||
do_rcu(tx,ty+8,p,m);
|
|
||||||
tx += (p+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_char(unsigned char x, unsigned char y, unsigned char ch, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
tx = x;
|
|
||||||
ty = y;
|
|
||||||
_draw_char(ch+coff, c, m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_string(unsigned char x, unsigned char y, char *st, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
unsigned char cp;
|
|
||||||
tx = x;
|
|
||||||
ty = y;
|
|
||||||
|
|
||||||
cp = 0;
|
|
||||||
if(dbl < 15)
|
|
||||||
{
|
|
||||||
while(st[cp] != 0)
|
|
||||||
{
|
|
||||||
_draw_char(st[cp]+coff, c, m);
|
|
||||||
cp++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while(st[cp] != 0)
|
|
||||||
{
|
|
||||||
_draw_charB(st[cp]+coff, c, m);
|
|
||||||
cp++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern char hval[16];
|
|
||||||
|
|
||||||
void draw_hexC(unsigned char x, unsigned char y, const unsigned char v, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
tx = x;
|
|
||||||
ty = y;
|
|
||||||
_draw_char(hval[v>>4]+coff, c, m);
|
|
||||||
_draw_char(hval[v & 0x0F]+coff, c, m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_hexS(unsigned char x, unsigned char y, const unsigned short v, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
tx = x;
|
|
||||||
ty = y;
|
|
||||||
draw_hexC(x, y, v >> 8, c, m);
|
|
||||||
draw_hexC(tx, ty, v & 0xFF, c, m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_hexW(unsigned char x, unsigned char y, const unsigned long v, unsigned char c, unsigned char m)
|
|
||||||
{
|
|
||||||
draw_hexS(x, y, v >> 16, c, m);
|
|
||||||
draw_hexS(tx, ty, v & 0xFFFF, c, m);
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
fonty.h - drawing text & font handling
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FONTY_H
|
|
||||||
#define FONTY_H
|
|
||||||
|
|
||||||
extern unsigned char drawbuf[2][128];
|
|
||||||
|
|
||||||
void set_font(unsigned char f);
|
|
||||||
void draw_char(unsigned char x, unsigned char y, unsigned char ch, unsigned char c, unsigned char m);
|
|
||||||
void draw_string(unsigned char x, unsigned char y, char *st, unsigned char c, unsigned char m);
|
|
||||||
void draw_hexC(unsigned char x, unsigned char y, const unsigned char v, unsigned char c, unsigned char m);
|
|
||||||
void draw_hexS(unsigned char x, unsigned char y, const unsigned short v, unsigned char c, unsigned char m);
|
|
||||||
void draw_hexW(unsigned char x, unsigned char y, const unsigned long v, unsigned char c, unsigned char m);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
global.c
|
|
||||||
Copyright (C) 2007 Colibri <colibri_dvb@lycos.com>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "lpc2220.h"
|
|
||||||
|
|
||||||
void *memcpy(void *dest,void *src,int count)
|
|
||||||
{
|
|
||||||
char *tmp = (char *) dest, *s = (char *) src;
|
|
||||||
|
|
||||||
while (count--)
|
|
||||||
*tmp++ = *s++;
|
|
||||||
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
|
|
||||||
int memcmp(const void * cs,const void * ct,int count)
|
|
||||||
{
|
|
||||||
const unsigned char *su1, *su2;
|
|
||||||
signed char res = 0;
|
|
||||||
|
|
||||||
for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
|
|
||||||
if ((res = *su1 - *su2) != 0)
|
|
||||||
break;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char GetHWversion(void) {
|
|
||||||
if(((IOPIN2 >> 28) & 3) == 3)
|
|
||||||
return(((((IOPIN0 >> 5) & 1) << 4) | (((IOPIN2 >> 30) & 1) << 3) | (((IOPIN2 >> 16) & 1) << 2) | 3));
|
|
||||||
return(((IOPIN2 >> 27) & 2) + ((IOPIN2 >> 29) & 1) + (((IOPIN1 >> 23) & 7) << 2));
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
/*
|
|
||||||
global.h
|
|
||||||
Copyright (C) 2007 Colibri <colibri_dvb@lycos.com>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GLOBAL_H
|
|
||||||
#define GLOBAL_H
|
|
||||||
|
|
||||||
//Uncomment if you want compile with demo sound
|
|
||||||
//#define WITH_SOUND
|
|
||||||
|
|
||||||
|
|
||||||
typedef unsigned char BOOL;
|
|
||||||
typedef unsigned char BYTE;
|
|
||||||
typedef unsigned short WORD;
|
|
||||||
typedef unsigned long DWORD;
|
|
||||||
|
|
||||||
#define false 0
|
|
||||||
#define true 1
|
|
||||||
|
|
||||||
#define NULL 0
|
|
||||||
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
|
|
||||||
#define SPEED_30 0
|
|
||||||
#define SPEED_60 1
|
|
||||||
|
|
||||||
#define SYS_IR 0x20
|
|
||||||
#define SYS_KEY 0x40
|
|
||||||
#define SYS_TURBO 0x80
|
|
||||||
|
|
||||||
#ifndef __MAIN_C__
|
|
||||||
extern char sysInfo;
|
|
||||||
#endif /* __MAIN_C__ */
|
|
||||||
|
|
||||||
#define PCON_IDLE 0x01
|
|
||||||
#define PCON_PDOWN 0x02
|
|
||||||
|
|
||||||
void *memcpy(void *dest,void *src,int count);
|
|
||||||
int memcmp(const void * cs,const void * ct,int count);
|
|
||||||
unsigned char GetHWversion(void);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,181 +0,0 @@
|
||||||
/*
|
|
||||||
infrared.c - ir carrier generation and encoding core
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "infrared.h"
|
|
||||||
#include "irq.h"
|
|
||||||
#include "lpc2220.h"
|
|
||||||
#include "keyboard.h"
|
|
||||||
|
|
||||||
#include "externs.h"
|
|
||||||
|
|
||||||
static unsigned char c_cnt;
|
|
||||||
static unsigned int b_len;
|
|
||||||
|
|
||||||
unsigned char mod_enable;
|
|
||||||
unsigned char hi_border;
|
|
||||||
unsigned char lo_border;
|
|
||||||
unsigned int cycles;
|
|
||||||
|
|
||||||
ir_fn irEncoder;
|
|
||||||
ir_fn irSend;
|
|
||||||
ir_fn irRepeat;
|
|
||||||
ir_fn irStop;
|
|
||||||
|
|
||||||
const struct irModule defModule = { defIR, defSender, defRepeater, defStopper, 20, 0, 3 };
|
|
||||||
|
|
||||||
unsigned long keyMap[42];
|
|
||||||
|
|
||||||
void initIR(void)
|
|
||||||
{
|
|
||||||
setIR(defModule);
|
|
||||||
}
|
|
||||||
|
|
||||||
void startIrIRQ(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
T1TCR = 0x02;
|
|
||||||
T1TC = 0;
|
|
||||||
T1PC = 0;
|
|
||||||
T1PR = 0x00;
|
|
||||||
T1MCR = 0x03;
|
|
||||||
T1TCR = 0x01;
|
|
||||||
|
|
||||||
VICVectAddr1 = (unsigned long)&(irIRQ);
|
|
||||||
VICVectCntl1 = VIC_SLOT_EN | INT_SRC_TIMER1;
|
|
||||||
VICIntEnable = INT_TIMER1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setIR(struct irModule module)
|
|
||||||
{
|
|
||||||
T1TCR = 0x02;
|
|
||||||
irEncoder = module.encoder;
|
|
||||||
irSend = module.sender;
|
|
||||||
irRepeat = module.repeater;
|
|
||||||
irStop = module.stopper;
|
|
||||||
T1MR0 = module.tval;
|
|
||||||
hi_border = module.hi_border;
|
|
||||||
lo_border = module.lo_border;
|
|
||||||
cycles = 100;
|
|
||||||
T1TCR = 0x01;
|
|
||||||
}
|
|
||||||
/* Stubs for various interrupts (may be replaced later) */
|
|
||||||
/* ---------------------------------------------------- */
|
|
||||||
|
|
||||||
void defIR(void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void defSender(void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void defRepeater(void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
void defStopper(void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __attribute__ ((interrupt("IRQ"))) irIRQ(void)
|
|
||||||
{
|
|
||||||
c_cnt++;
|
|
||||||
if(c_cnt <= hi_border)
|
|
||||||
{
|
|
||||||
FIOSET0 = (mod_enable<<21);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FIOCLR0 = (1<<21);
|
|
||||||
if(c_cnt >= lo_border)
|
|
||||||
{
|
|
||||||
c_cnt = 0;
|
|
||||||
b_len++;
|
|
||||||
if(b_len >= cycles)
|
|
||||||
{
|
|
||||||
irEncoder();
|
|
||||||
b_len = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
T1IR = 1;
|
|
||||||
VICVectAddr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void runIR(void)
|
|
||||||
{
|
|
||||||
T1TCR = 0x01;
|
|
||||||
}
|
|
||||||
|
|
||||||
void stopIR(void)
|
|
||||||
{
|
|
||||||
T1TCR = 0x03;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define doKey( _X, _Y ) if(_X) return keyMap[_Y]; else
|
|
||||||
|
|
||||||
unsigned long getCode(void)
|
|
||||||
{
|
|
||||||
doKey(KEY_A, 0);
|
|
||||||
doKey(KEY_B, 1);
|
|
||||||
doKey(KEY_C, 2);
|
|
||||||
doKey(KEY_D, 3);
|
|
||||||
doKey(KEY_Betty, 4);
|
|
||||||
doKey(KEY_Exit, 5);
|
|
||||||
doKey(KEY_Up, 6);
|
|
||||||
doKey(KEY_Down, 7);
|
|
||||||
doKey(KEY_Left, 8);
|
|
||||||
doKey(KEY_Right, 9);
|
|
||||||
doKey(KEY_OK, 10);
|
|
||||||
doKey(KEY_Vplus, 11);
|
|
||||||
doKey(KEY_Vminus, 12);
|
|
||||||
doKey(KEY_Mute, 13);
|
|
||||||
doKey(KEY_Pplus, 14);
|
|
||||||
doKey(KEY_Pminus, 15);
|
|
||||||
doKey(KEY_1, 16);
|
|
||||||
doKey(KEY_2, 17);
|
|
||||||
doKey(KEY_3, 18);
|
|
||||||
doKey(KEY_4, 19);
|
|
||||||
doKey(KEY_5, 20);
|
|
||||||
doKey(KEY_6, 21);
|
|
||||||
doKey(KEY_7, 22);
|
|
||||||
doKey(KEY_8, 23);
|
|
||||||
doKey(KEY_9, 24);
|
|
||||||
doKey(KEY_0, 25);
|
|
||||||
doKey(KEY_Minus, 26);
|
|
||||||
doKey(KEY_AV, 27);
|
|
||||||
doKey(KEY_Menu, 28);
|
|
||||||
doKey(KEY_PiP, 29);
|
|
||||||
doKey(KEY_AB, 30);
|
|
||||||
doKey(KEY_16_9, 31);
|
|
||||||
doKey(KEY_Info, 32);
|
|
||||||
doKey(KEY_VTX1, 33);
|
|
||||||
doKey(KEY_VTX2, 34);
|
|
||||||
doKey(KEY_VTX3, 35);
|
|
||||||
doKey(KEY_Blue, 36);
|
|
||||||
doKey(KEY_Yellow, 37);
|
|
||||||
doKey(KEY_Green, 38);
|
|
||||||
doKey(KEY_Red, 39);
|
|
||||||
doKey(KEY_TV, 40);
|
|
||||||
doKey(KEY_Power, 41);
|
|
||||||
return 0xFFFFFFFF;
|
|
||||||
}
|
|
|
@ -1,60 +0,0 @@
|
||||||
/*
|
|
||||||
infrared.h - ir carrier generation and encoding core
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INFRARED_H
|
|
||||||
#define INFRARED_H
|
|
||||||
|
|
||||||
typedef void(*ir_fn)(void);
|
|
||||||
|
|
||||||
extern ir_fn irSend;
|
|
||||||
extern ir_fn irRepeat;
|
|
||||||
extern ir_fn irStop;
|
|
||||||
|
|
||||||
typedef struct irModule
|
|
||||||
{
|
|
||||||
ir_fn encoder;
|
|
||||||
ir_fn sender;
|
|
||||||
ir_fn repeater;
|
|
||||||
ir_fn stopper;
|
|
||||||
int tval;
|
|
||||||
unsigned int hi_border;
|
|
||||||
unsigned int lo_border;
|
|
||||||
} irModule;
|
|
||||||
|
|
||||||
extern unsigned char mod_enable;
|
|
||||||
extern unsigned char hi_border;
|
|
||||||
extern unsigned char lo_border;
|
|
||||||
extern unsigned int cycles;
|
|
||||||
extern unsigned long keyMap[42];
|
|
||||||
|
|
||||||
void defIR(void);
|
|
||||||
void defSender(void);
|
|
||||||
void defRepeater(void);
|
|
||||||
void defStopper(void);
|
|
||||||
|
|
||||||
void irIRQ (void) __attribute__ ((interrupt("IRQ"))) ;
|
|
||||||
|
|
||||||
void initIR(void);
|
|
||||||
void startIrIRQ(void);
|
|
||||||
void setIR(struct irModule module);
|
|
||||||
void runIR(void);
|
|
||||||
void stopIR(void);
|
|
||||||
unsigned long getCode(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,228 +0,0 @@
|
||||||
/*
|
|
||||||
ir_itt.c - itt protocoll encoder
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "infrared.h"
|
|
||||||
#include "ir_itt.h"
|
|
||||||
#include "itt_codes.h"
|
|
||||||
|
|
||||||
const struct irModule ITT_Module =
|
|
||||||
{
|
|
||||||
ITT_Encode,
|
|
||||||
ITT_Send,
|
|
||||||
ITT_Repeat,
|
|
||||||
ITT_Stop,
|
|
||||||
43, // carrier
|
|
||||||
2, // carrier-on
|
|
||||||
3 // carrier-off
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct irModule ITT2_Module =
|
|
||||||
{
|
|
||||||
ITT_Encode,
|
|
||||||
ITT_Send,
|
|
||||||
ITT_Repeat,
|
|
||||||
ITT_Stop,
|
|
||||||
46, // carrier
|
|
||||||
1, // carrier-on
|
|
||||||
3 // carrier-off
|
|
||||||
};
|
|
||||||
|
|
||||||
static unsigned short itt_cmd;
|
|
||||||
static unsigned short itt_actcmd;
|
|
||||||
static unsigned char itt_state;
|
|
||||||
static unsigned char itt_bit;
|
|
||||||
static unsigned char itt_numbits;
|
|
||||||
static unsigned char itt_wait;
|
|
||||||
static unsigned char itt_leadtime;
|
|
||||||
static unsigned char itt_bittime0;
|
|
||||||
static unsigned char itt_bittime1;
|
|
||||||
|
|
||||||
#define ITT_IDLE 0x00
|
|
||||||
#define ITT_LEADIN_A 0x01
|
|
||||||
#define ITT_LEADIN_B 0x02
|
|
||||||
#define ITT_START_A 0x03
|
|
||||||
#define ITT_START_B 0x04
|
|
||||||
#define ITT_BIT_A 0x05
|
|
||||||
#define ITT_BIT_B 0x06
|
|
||||||
#define ITT_LEADOUT_A 0x07
|
|
||||||
#define ITT_LEADOUT_B 0x08
|
|
||||||
#define ITT_STOP 0x09
|
|
||||||
#define ITT_WAIT 0x0A
|
|
||||||
|
|
||||||
#define ITT_LEADTIME 13
|
|
||||||
#define ITT_BITTIME_0 4
|
|
||||||
#define ITT_BITTIME_1 8
|
|
||||||
#define ITT_WAITTIME 130
|
|
||||||
|
|
||||||
#define ITT2_LEADTIME 15
|
|
||||||
#define ITT2_BITTIME_0 4
|
|
||||||
#define ITT2_BITTIME_1 9
|
|
||||||
|
|
||||||
void ITT_Encode (void)
|
|
||||||
{
|
|
||||||
switch(itt_state)
|
|
||||||
{
|
|
||||||
case ITT_IDLE:
|
|
||||||
mod_enable = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ITT_LEADIN_A:
|
|
||||||
case ITT_START_A:
|
|
||||||
case ITT_BIT_A:
|
|
||||||
case ITT_LEADOUT_A:
|
|
||||||
case ITT_STOP:
|
|
||||||
cycles = 1;
|
|
||||||
mod_enable = 1;
|
|
||||||
itt_state++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ITT_LEADIN_B:
|
|
||||||
case ITT_LEADOUT_B:
|
|
||||||
mod_enable = 0;
|
|
||||||
cycles = itt_leadtime;
|
|
||||||
itt_state++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ITT_START_B:
|
|
||||||
mod_enable = 0;
|
|
||||||
cycles = itt_bittime0;
|
|
||||||
itt_state++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ITT_BIT_B:
|
|
||||||
mod_enable = 0;
|
|
||||||
if(itt_cmd & 0x01)
|
|
||||||
cycles = itt_bittime1;
|
|
||||||
else
|
|
||||||
cycles = itt_bittime0;
|
|
||||||
itt_cmd >>= 1;
|
|
||||||
itt_bit++;
|
|
||||||
if(itt_bit == itt_numbits)
|
|
||||||
itt_state++;
|
|
||||||
else
|
|
||||||
itt_state--;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ITT_WAIT:
|
|
||||||
mod_enable = 0;
|
|
||||||
cycles = 40;
|
|
||||||
itt_wait++;
|
|
||||||
if(itt_wait >= ITT_WAITTIME)
|
|
||||||
{
|
|
||||||
itt_bit = 0;
|
|
||||||
itt_wait = 0;
|
|
||||||
itt_state = ITT_IDLE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ITT_Init(unsigned char map)
|
|
||||||
{
|
|
||||||
itt_state = ITT_IDLE;
|
|
||||||
itt_cmd = 0x0000;
|
|
||||||
itt_actcmd = 0x0000;
|
|
||||||
itt_bit = 0x00;
|
|
||||||
itt_numbits = 0x0A;
|
|
||||||
itt_wait = 0;
|
|
||||||
ITT_LoadMap(map);
|
|
||||||
cycles = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ITT_Send(void)
|
|
||||||
{
|
|
||||||
itt_actcmd = getCode();
|
|
||||||
ITT_Repeat();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ITT_Repeat(void)
|
|
||||||
{
|
|
||||||
if(itt_actcmd != 0x0000)
|
|
||||||
{
|
|
||||||
if(itt_state == ITT_IDLE)
|
|
||||||
{
|
|
||||||
itt_cmd = itt_actcmd;
|
|
||||||
itt_state++;
|
|
||||||
runIR();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ITT_Stop(void)
|
|
||||||
{
|
|
||||||
waitend1:
|
|
||||||
if(itt_state != ITT_IDLE)
|
|
||||||
goto waitend1;
|
|
||||||
|
|
||||||
itt_state++;
|
|
||||||
|
|
||||||
if(itt_actcmd != 0x00000000)
|
|
||||||
{
|
|
||||||
waitend2:
|
|
||||||
if(itt_state != ITT_IDLE)
|
|
||||||
goto waitend2;
|
|
||||||
}
|
|
||||||
itt_actcmd = 0x0000;
|
|
||||||
stopIR();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ITT_CopyMap(unsigned short *map)
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
for(x=0;x<42;x++)
|
|
||||||
{
|
|
||||||
keyMap[x] = map[x];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ITT_LoadMap(unsigned char map)
|
|
||||||
{
|
|
||||||
switch(map)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
itt_leadtime = ITT_LEADTIME;
|
|
||||||
itt_bittime0 = ITT_BITTIME_0;
|
|
||||||
itt_bittime1 = ITT_BITTIME_1;
|
|
||||||
setIR(ITT_Module);
|
|
||||||
ITT_CopyMap((unsigned short*)ITT_seleco_019);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
itt_leadtime = ITT_LEADTIME;
|
|
||||||
itt_bittime0 = ITT_BITTIME_0;
|
|
||||||
itt_bittime1 = ITT_BITTIME_1;
|
|
||||||
setIR(ITT_Module);
|
|
||||||
ITT_CopyMap((unsigned short*)ITT_seleco_049);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
itt_leadtime = ITT2_LEADTIME;
|
|
||||||
itt_bittime0 = ITT2_BITTIME_0;
|
|
||||||
itt_bittime1 = ITT2_BITTIME_1;
|
|
||||||
setIR(ITT2_Module);
|
|
||||||
ITT_CopyMap((unsigned short*)ITT_seleco_108);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
itt_leadtime = ITT_LEADTIME;
|
|
||||||
itt_bittime0 = ITT_BITTIME_0;
|
|
||||||
itt_bittime1 = ITT_BITTIME_1;
|
|
||||||
setIR(ITT_Module);
|
|
||||||
ITT_CopyMap((unsigned short*)ITT_seleco_131);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
ir_itt.h - itt protocol ir encoder
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IR_ITT_H
|
|
||||||
#define IR_ITT_H
|
|
||||||
|
|
||||||
void ITT_Encode (void) ;
|
|
||||||
|
|
||||||
void ITT_Init(unsigned char map);
|
|
||||||
void ITT_Send(void);
|
|
||||||
void ITT_Repeat(void);
|
|
||||||
void ITT_Stop(void);
|
|
||||||
void ITT_LoadMap(unsigned char map);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,221 +0,0 @@
|
||||||
/*
|
|
||||||
ir_nrc17.c - nokia remote control 17 encoder
|
|
||||||
Copyright (C) 2007 Ch. Klippel <ck@mamalala.net>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "infrared.h"
|
|
||||||
#include "ir_nrc17.h"
|
|
||||||
#include "nrc17_codes.h"
|
|
||||||
|
|
||||||
#define NRC17_IDLE 0x00
|
|
||||||
#define NRC17_PRE_A 0x01
|
|
||||||
#define NRC17_PRE_B 0x02
|
|
||||||
#define NRC17_START_A 0x03
|
|
||||||
#define NRC17_START_B 0x04
|
|
||||||
#define NRC17_BIT_A 0x05
|
|
||||||
#define NRC17_BIT_B 0x06
|
|
||||||
#define NRC17_WAIT 0x07
|
|
||||||
|
|
||||||
#define NRC17_BONTIME 19
|
|
||||||
#define NRC17_BOFFTIME 19
|
|
||||||
#define NRC17_PTIME 95
|
|
||||||
#define NRC17_GTIME 156
|
|
||||||
#define NRC17_WTIME 38
|
|
||||||
|
|
||||||
#define NRC17_STARTSTOP_DBOX2 0xFEFF
|
|
||||||
#define NRC17_STARTSTOP_TP720 0x01FF
|
|
||||||
|
|
||||||
const struct irModule NRC17_Module =
|
|
||||||
{
|
|
||||||
NRC17_Encode,
|
|
||||||
NRC17_Send,
|
|
||||||
NRC17_Repeat,
|
|
||||||
NRC17_Stop,
|
|
||||||
40, // carrier
|
|
||||||
1, // carrier-on
|
|
||||||
4 // carrier-off
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static unsigned short nrc17_cmd;
|
|
||||||
static unsigned short nrc17_actcmd;
|
|
||||||
static unsigned short nrc17_startstop;
|
|
||||||
static unsigned char nrc17_state;
|
|
||||||
static unsigned char nrc17_bit;
|
|
||||||
static unsigned char nrc17_numbits;
|
|
||||||
static unsigned short nrc17_wait;
|
|
||||||
static unsigned short nrc17_pause;
|
|
||||||
|
|
||||||
void NRC17_Encode(void)
|
|
||||||
{
|
|
||||||
switch(nrc17_state)
|
|
||||||
{
|
|
||||||
case NRC17_IDLE:
|
|
||||||
mod_enable = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NRC17_PRE_A:
|
|
||||||
case NRC17_START_A:
|
|
||||||
cycles = NRC17_BONTIME; // 0.5 ms
|
|
||||||
mod_enable = 1;
|
|
||||||
nrc17_state++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NRC17_PRE_B:
|
|
||||||
case NRC17_START_B:
|
|
||||||
if(nrc17_state == NRC17_PRE_B)
|
|
||||||
cycles = NRC17_PTIME; // 2,5 ms
|
|
||||||
else
|
|
||||||
cycles = NRC17_BOFFTIME; // 0.5 ms
|
|
||||||
mod_enable = 0;
|
|
||||||
nrc17_state++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NRC17_BIT_A:
|
|
||||||
if(nrc17_cmd & 0x0001)
|
|
||||||
mod_enable = 1;
|
|
||||||
else
|
|
||||||
mod_enable = 0;
|
|
||||||
nrc17_cmd >>= 1;
|
|
||||||
nrc17_state++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NRC17_BIT_B:
|
|
||||||
if(mod_enable == 1)
|
|
||||||
mod_enable = 0;
|
|
||||||
else
|
|
||||||
mod_enable = 1;
|
|
||||||
nrc17_bit++;
|
|
||||||
if(nrc17_bit == nrc17_numbits)
|
|
||||||
nrc17_state++;
|
|
||||||
else
|
|
||||||
nrc17_state--;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NRC17_WAIT:
|
|
||||||
mod_enable = 0;
|
|
||||||
nrc17_wait++;
|
|
||||||
cycles = NRC17_BONTIME; // 1 ms
|
|
||||||
if(nrc17_wait >= nrc17_pause)
|
|
||||||
{
|
|
||||||
nrc17_bit = 0;
|
|
||||||
nrc17_wait = 0;
|
|
||||||
nrc17_pause = NRC17_PTIME;
|
|
||||||
nrc17_state = NRC17_IDLE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NRC17_CopyMap(unsigned char xtra, unsigned short *map)
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
for(x=0;x<42;x++)
|
|
||||||
{
|
|
||||||
keyMap[x] = map[x];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NRC17_LoadMap(unsigned char map)
|
|
||||||
{
|
|
||||||
switch(map)
|
|
||||||
{
|
|
||||||
case 0: // nokia dbox2, 16 bit data
|
|
||||||
NRC17_CopyMap(0x00, (unsigned short*)NRC17_dbox2);
|
|
||||||
nrc17_startstop = NRC17_STARTSTOP_DBOX2;
|
|
||||||
nrc17_numbits = 16;
|
|
||||||
break;
|
|
||||||
case 1: // tp720 - tv, 9 bit data
|
|
||||||
NRC17_CopyMap(0x00, (unsigned short*)NRC17_grundig_tp720);
|
|
||||||
nrc17_startstop = NRC17_STARTSTOP_TP720;
|
|
||||||
nrc17_numbits = 9;
|
|
||||||
break;
|
|
||||||
case 2 : // tp720 - sat, 9 bit data
|
|
||||||
NRC17_CopyMap(0x40, (unsigned short*)NRC17_grundig_tp720);
|
|
||||||
nrc17_startstop = NRC17_STARTSTOP_TP720;
|
|
||||||
nrc17_numbits = 9;
|
|
||||||
break;
|
|
||||||
default : // tp720 - video, 9 bit data
|
|
||||||
NRC17_CopyMap(0x80, (unsigned short*)NRC17_grundig_tp720);
|
|
||||||
nrc17_startstop = NRC17_STARTSTOP_TP720;
|
|
||||||
nrc17_numbits = 9;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NRC17_Init(unsigned char map)
|
|
||||||
{
|
|
||||||
nrc17_state = NRC17_IDLE;
|
|
||||||
nrc17_cmd = 0x0000;
|
|
||||||
nrc17_actcmd = 0x0000;
|
|
||||||
nrc17_bit = 0x00;
|
|
||||||
nrc17_numbits = 16;
|
|
||||||
nrc17_wait = 0;
|
|
||||||
nrc17_pause = NRC17_BONTIME;
|
|
||||||
NRC17_LoadMap(map);
|
|
||||||
setIR(NRC17_Module);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NRC17_Send(void)
|
|
||||||
{
|
|
||||||
nrc17_actcmd = getCode();
|
|
||||||
if(nrc17_actcmd != 0x0000)
|
|
||||||
{
|
|
||||||
if(nrc17_state == NRC17_IDLE)
|
|
||||||
{
|
|
||||||
nrc17_pause = NRC17_WTIME;
|
|
||||||
nrc17_cmd = nrc17_startstop;
|
|
||||||
nrc17_state++;
|
|
||||||
runIR();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NRC17_Repeat(void)
|
|
||||||
{
|
|
||||||
if(nrc17_actcmd != 0x0000)
|
|
||||||
{
|
|
||||||
if(nrc17_state == NRC17_IDLE)
|
|
||||||
{
|
|
||||||
nrc17_pause = NRC17_GTIME;
|
|
||||||
nrc17_cmd = nrc17_actcmd;
|
|
||||||
nrc17_state++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NRC17_Stop(void)
|
|
||||||
{
|
|
||||||
if(nrc17_actcmd != 0x0000)
|
|
||||||
{
|
|
||||||
retry:
|
|
||||||
if(nrc17_state == NRC17_IDLE)
|
|
||||||
{
|
|
||||||
nrc17_cmd = nrc17_startstop;
|
|
||||||
nrc17_state++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
goto retry;
|
|
||||||
|
|
||||||
waitend:
|
|
||||||
if(nrc17_state != NRC17_IDLE)
|
|
||||||
goto waitend;
|
|
||||||
}
|
|
||||||
nrc17_actcmd = 0x0000;
|
|
||||||
stopIR();
|
|
||||||
}
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue