├── iclicker ├── README ├── isniffer │ ├── types.h │ ├── bits.h │ ├── pm.h │ ├── keys.h │ ├── Makefile │ ├── display.h │ ├── isniffer.h │ ├── pm.c │ ├── keys.c │ ├── 5x7.h │ ├── display.c │ ├── isniffer.c │ └── COPYING └── iclickertx │ ├── types.h │ ├── dma.h │ ├── Makefile │ └── iclickertx.c ├── specan ├── src │ ├── types.h │ ├── bits.h │ ├── pm.h │ ├── keys.h │ ├── Makefile │ ├── display.h │ ├── pm.c │ ├── keys.c │ ├── 5x7.h │ ├── display.c │ ├── specan.h │ ├── specan.c │ └── COPYING ├── README └── specan.hex ├── garage ├── opensesame │ ├── types.h │ ├── bits.h │ ├── dma.h │ ├── Makefile │ ├── keys.h │ ├── helpers.h │ ├── display.h │ ├── keys.c │ ├── 5x7.h │ ├── display.c │ └── opensesame.c ├── README ├── garage-decode.py └── garage.grc ├── README └── COPYING /iclicker/README: -------------------------------------------------------------------------------- 1 | some basic code for experimenting with the iClicker (www.iclicker.com) 2 | -------------------------------------------------------------------------------- /specan/src/types.h: -------------------------------------------------------------------------------- 1 | #define u8 unsigned char 2 | #define u16 unsigned int 3 | #define u32 unsigned long int 4 | -------------------------------------------------------------------------------- /garage/opensesame/types.h: -------------------------------------------------------------------------------- 1 | #define u8 unsigned char 2 | #define u16 unsigned int 3 | #define u32 unsigned long int 4 | -------------------------------------------------------------------------------- /iclicker/isniffer/types.h: -------------------------------------------------------------------------------- 1 | #define u8 unsigned char 2 | #define u16 unsigned int 3 | #define u32 unsigned long int 4 | -------------------------------------------------------------------------------- /iclicker/iclickertx/types.h: -------------------------------------------------------------------------------- 1 | #define u8 unsigned char 2 | #define u16 unsigned int 3 | #define u32 unsigned long int 4 | -------------------------------------------------------------------------------- /specan/src/bits.h: -------------------------------------------------------------------------------- 1 | #define BIT0 0x01 2 | #define BIT1 0x02 3 | #define BIT2 0x04 4 | #define BIT3 0x08 5 | #define BIT4 0x10 6 | #define BIT5 0x20 7 | #define BIT6 0x40 8 | #define BIT7 0x80 9 | -------------------------------------------------------------------------------- /garage/opensesame/bits.h: -------------------------------------------------------------------------------- 1 | #define BIT0 0x01 2 | #define BIT1 0x02 3 | #define BIT2 0x04 4 | #define BIT3 0x08 5 | #define BIT4 0x10 6 | #define BIT5 0x20 7 | #define BIT6 0x40 8 | #define BIT7 0x80 9 | -------------------------------------------------------------------------------- /iclicker/isniffer/bits.h: -------------------------------------------------------------------------------- 1 | #define BIT0 0x01 2 | #define BIT1 0x02 3 | #define BIT2 0x04 4 | #define BIT3 0x08 5 | #define BIT4 0x10 6 | #define BIT5 0x20 7 | #define BIT6 0x40 8 | #define BIT7 0x80 9 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This repository contains software for the Girl Tech IM-Me. 2 | 3 | To start with, the specan directory contains the source code for the pocket 4 | spectrum analyzer application first described here: 5 | 6 | http://ossmann.blogspot.com/2010/03/16-pocket-spectrum-analyzer.html 7 | 8 | 9 | So cool! So connected! 10 | -------------------------------------------------------------------------------- /garage/opensesame/dma.h: -------------------------------------------------------------------------------- 1 | /* note sdcc wants reverse bit order from datasheet */ 2 | typedef struct { 3 | u8 SRCADDRH; 4 | u8 SRCADDRL; 5 | u8 DESTADDRH; 6 | u8 DESTADDRL; 7 | u8 LENH : 5; 8 | u8 VLEN : 3; 9 | 10 | u8 LENL : 8; 11 | 12 | u8 TRIG : 5; 13 | u8 TMODE : 2; 14 | u8 WORDSIZE : 1; 15 | 16 | u8 PRIORITY : 2; 17 | u8 M8 : 1; 18 | u8 IRQMASK : 1; 19 | u8 DESTINC : 2; 20 | u8 SRCINC : 2; 21 | } DMA_DESC; 22 | -------------------------------------------------------------------------------- /iclicker/iclickertx/dma.h: -------------------------------------------------------------------------------- 1 | /* note sdcc wants reverse bit order from datasheet */ 2 | typedef struct { 3 | u8 SRCADDRH; 4 | u8 SRCADDRL; 5 | u8 DESTADDRH; 6 | u8 DESTADDRL; 7 | u8 LENH : 5; 8 | u8 VLEN : 3; 9 | 10 | u8 LENL : 8; 11 | 12 | u8 TRIG : 5; 13 | u8 TMODE : 2; 14 | u8 WORDSIZE : 1; 15 | 16 | u8 PRIORITY : 2; 17 | u8 M8 : 1; 18 | u8 IRQMASK : 1; 19 | u8 DESTINC : 2; 20 | u8 SRCINC : 2; 21 | } DMA_DESC; 22 | -------------------------------------------------------------------------------- /iclicker/iclickertx/Makefile: -------------------------------------------------------------------------------- 1 | #libs = rnd_rssi.rel 2 | CC=sdcc 3 | CFLAGS=--no-pack-iram 4 | LFLAGS = --xram-loc 0xF000 5 | 6 | all: iclickertx.hex 7 | 8 | %.rel : %.c 9 | $(CC) $(CFLAGS) -c $< 10 | 11 | iclickertx.hex: iclickertx.rel $(libs) 12 | sdcc $(LFLAGS) iclickertx.rel $(libs) 13 | packihx iclickertx.hex 14 | 15 | install: iclickertx.hex 16 | goodfet.cc erase 17 | goodfet.cc flash iclickertx.hex 18 | verify: iclickertx.hex 19 | goodfet.cc verify iclickertx.hex 20 | clean: 21 | rm -f *.hex *.ihx *.rel *.map *.lnk *.lst *.mem *.sym *.rst *.asm 22 | -------------------------------------------------------------------------------- /garage/opensesame/Makefile: -------------------------------------------------------------------------------- 1 | libs = display.rel keys.rel 2 | CC=sdcc 3 | CFLAGS=--no-pack-iram 4 | LFLAGS = --xram-loc 0xF000 5 | 6 | all: opensesame.hex 7 | 8 | %.rel : %.c 9 | $(CC) $(CFLAGS) -c $< 10 | 11 | opensesame.hex: opensesame.rel $(libs) 12 | sdcc $(LFLAGS) opensesame.rel $(libs) 13 | packihx opensesame.hex 14 | 15 | install: opensesame.hex 16 | goodfet.cc erase 17 | goodfet.cc flash opensesame.hex 18 | verify: opensesame.hex 19 | goodfet.cc verify opensesame.hex 20 | clean: 21 | rm -f *.hex *.ihx *.rel *.map *.lnk *.lst *.mem *.sym *.rst *.asm 22 | -------------------------------------------------------------------------------- /garage/README: -------------------------------------------------------------------------------- 1 | This rudimentary code has been used to demonstrate opening of a garage door 2 | with an IM-Me. It may be useful as sample code for the transmission of Remote 3 | Keyless Entry (RKE) signals or other On-Off Keying (OOK) signals. 4 | 5 | The opensesame firmware implements the transmission of a fixed (hard coded) 6 | code to the garage door opener. Modern garage door openers use a rolling code. 7 | This software does not implement rolling codes. However, a fixed code can be 8 | used once in a replay attack. If an attacker can record a single code 9 | transmitted by the remote (out of range of the garage), then the code can be 10 | replayed to open the garage door. 11 | 12 | For my demonstration, I used a USRP and GNU Radio to acquire the signal to be 13 | replayed. I used garage.grc (with GNU Radio Companion) and garage-decode.py to 14 | decode the signal. The input data was acquired at 390 MHz with a sample rate 15 | of 500 ksps. 16 | -------------------------------------------------------------------------------- /specan/src/pm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | void setup_pm_interrupt(); 21 | void port1_isr() __interrupt (P1INT_VECTOR); 22 | void sleep(); 23 | -------------------------------------------------------------------------------- /iclicker/isniffer/pm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | void setup_pm_interrupt(); 21 | void port1_isr() __interrupt (P1INT_VECTOR); 22 | void sleep(); 23 | -------------------------------------------------------------------------------- /specan/src/keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Travis Goodspeed, Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "types.h" 21 | 22 | u8 keyscan(); 23 | u8 getkey(); 24 | 25 | //Special keys. 26 | #define KPWR 0x01 27 | #define KMNU 0x03 28 | #define KCAP 0x82 29 | #define KSPK 0x83 30 | #define KALT 0x84 31 | #define KONL 0x85 32 | #define KBACK 0x86 33 | #define KDWN 0x87 34 | #define KBYE 0x02 35 | -------------------------------------------------------------------------------- /garage/opensesame/keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Travis Goodspeed, Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "types.h" 21 | 22 | u8 keyscan(); 23 | u8 getkey(); 24 | 25 | //Special keys. 26 | #define KPWR 0x01 27 | #define KMNU 0x03 28 | #define KCAP 0x82 29 | #define KSPK 0x83 30 | #define KALT 0x84 31 | #define KONL 0x85 32 | #define KBACK 0x86 33 | #define KDWN 0x87 34 | #define KBYE 0x02 35 | -------------------------------------------------------------------------------- /iclicker/isniffer/keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Travis Goodspeed, Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include "types.h" 21 | 22 | u8 keyscan(); 23 | u8 getkey(); 24 | 25 | //Special keys. 26 | #define KPWR 0x01 27 | #define KMNU 0x03 28 | #define KCAP 0x82 29 | #define KSPK 0x83 30 | #define KALT 0x84 31 | #define KONL 0x85 32 | #define KBACK 0x86 33 | #define KDWN 0x87 34 | #define KBYE 0x02 35 | -------------------------------------------------------------------------------- /garage/opensesame/helpers.h: -------------------------------------------------------------------------------- 1 | // helper functions for cc111x 2 | // -samy kamkar 3 | 4 | #include 5 | 6 | #ifdef CC1110 7 | #define MHZ 26 8 | #elif CC1111 9 | #define MHZ 48 10 | #else 11 | #error Please define CC1110 or CC1111 so clock can be determined. 12 | #endif 13 | 14 | // set FREQ registers in cc111x from a float 15 | void setFreq(float freq, char *FREQ2, char *FREQ1, char *FREQ0) 16 | { 17 | float freqMult = (0x10000 / 1000000.0) / MHZ; 18 | u32 num = freq * freqMult; 19 | 20 | *FREQ2 = num >> 16; 21 | *FREQ1 = (num >> 8) & 0xFF; 22 | *FREQ0 = num & 0xFF; 23 | } 24 | 25 | // set baudrate registers from a float 26 | void setBaud(float drate, char *MDMCFG4, char *MDMCFG3) 27 | { 28 | u8 drate_e = 0; 29 | u8 drate_m = 0; 30 | u8 e; 31 | float m = 0; 32 | 33 | for (e = 0; e < 16; e++) 34 | { 35 | 36 | m = (drate * powf(2,28) / (powf(2,e)* (MHZ*1000000.0))-256) + .5; 37 | if (m < 256) 38 | { 39 | drate_e = e; 40 | drate_m = m; 41 | break; 42 | } 43 | } 44 | 45 | drate = 1000000.0 * MHZ * (256+drate_m) * powf(2,drate_e) / powf(2,28); 46 | 47 | *MDMCFG3 = drate_m; 48 | #ifndef MDMCFG4_DRATE_E 49 | #define MDMCFG4_DRATE_E 0x0F 50 | #endif 51 | *MDMCFG4 &= ~MDMCFG4_DRATE_E; 52 | *MDMCFG4 |= drate_e; 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /specan/src/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Travis Goodspeed, Michael Ossmann 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2, or (at your option) 6 | # any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; see the file COPYING. If not, write to 15 | # the Free Software Foundation, Inc., 51 Franklin Street, 16 | # Boston, MA 02110-1301, USA. 17 | 18 | libs = display.rel keys.rel pm.rel 19 | CC = sdcc 20 | CFLAGS = --no-pack-iram 21 | LFLAGS = --xram-loc 0xF000 22 | 23 | all: specan.hex 24 | 25 | %.rel : %.c 26 | $(CC) $(CFLAGS) -c $< 27 | 28 | specan.hex: specan.rel $(libs) 29 | sdcc $(LFLAGS) specan.rel $(libs) 30 | packihx specan.hex 31 | 32 | install: specan.hex 33 | goodfet.cc erase 34 | goodfet.cc flash specan.hex 35 | verify: specan.hex 36 | goodfet.cc verify specan.hex 37 | clean: 38 | rm -f *.hex *.ihx *.rel *.asm *.lst *.rst *.sym *.lnk *.map *.mem 39 | -------------------------------------------------------------------------------- /iclicker/isniffer/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Travis Goodspeed, Michael Ossmann 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2, or (at your option) 6 | # any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; see the file COPYING. If not, write to 15 | # the Free Software Foundation, Inc., 51 Franklin Street, 16 | # Boston, MA 02110-1301, USA. 17 | 18 | libs = display.rel keys.rel pm.rel 19 | CC = sdcc 20 | CFLAGS = --no-pack-iram 21 | LFLAGS = --xram-loc 0xF000 22 | 23 | all: isniffer.hex 24 | 25 | %.rel : %.c 26 | $(CC) $(CFLAGS) -c $< 27 | 28 | isniffer.hex: isniffer.rel $(libs) 29 | sdcc $(LFLAGS) isniffer.rel $(libs) 30 | packihx isniffer.hex 31 | 32 | install: isniffer.hex 33 | goodfet.cc erase 34 | goodfet.cc flash isniffer.hex 35 | verify: isniffer.hex 36 | goodfet.cc verify isniffer.hex 37 | clean: 38 | rm -f *.hex *.ihx *.rel *.asm *.lst *.rst *.sym *.lnk *.map *.mem 39 | -------------------------------------------------------------------------------- /garage/garage-decode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # decodes 66 bit remote keyless entry signal 4 | # pulse width modulation 5 | # to be used with grc/usrp demodulator 6 | 7 | import struct 8 | 9 | data = open('/tmp/garage.out').read() 10 | symbols = struct.unpack('B1'*len(data), data) 11 | 12 | # one bit is encoded in a triple (three adjacent symbols) 13 | def pwm_decode(triple): 14 | # strip any extra bits added by correlator 15 | stripped = (triple[0]&1, triple[1]&1, triple[2]&1) 16 | 17 | # short pulse 18 | if stripped == (1,0,0): 19 | return 0 20 | # long pulse 21 | if stripped == (1,1,0): 22 | return 1 23 | else: 24 | print "pwm decoding error" 25 | raise 26 | 27 | # extract an integer value from bitstream 28 | def extract(start, len, bits): 29 | val = 0 30 | for i in range(start, start + len): 31 | val <<= 1 32 | val += bits[i] 33 | return val 34 | 35 | # decode 66 bit garage door opener code 36 | def decode_frame(start): 37 | print 38 | print "decoding frame" 39 | bits = [] 40 | for i in range(66): 41 | j = (i * 3) + start 42 | try: 43 | bit = pwm_decode(symbols[j:j+3]) 44 | except: 45 | return 46 | bits.append(bit) 47 | 48 | print bits 49 | print "pwm hex: %017x" % extract(0, 66, bits) 50 | # preamble 51 | frame = 0xaaaaaa00 52 | frame <<= 1 53 | for sym in symbols[start:start+198]: 54 | frame <<= 1 55 | frame |= (sym & 1) 56 | frame <<= 1 57 | print "raw ook hex: %058x" % frame 58 | 59 | # look for correlations flagged by gr_correlate_access_code_bb 60 | for i in range(len(symbols) - 198): 61 | if symbols[i] & 2: 62 | decode_frame(i) 63 | -------------------------------------------------------------------------------- /specan/src/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IM-Me display functions 3 | * 4 | * Copyright 2010 Dave 5 | * http://daveshacks.blogspot.com/2010/01/im-me-lcd-interface-hacked.html 6 | * 7 | * Copyright 2010 Michael Ossmann 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, 22 | * Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | #define LOW 0 26 | #define HIGH 1 27 | 28 | #define WIDTH 132 29 | #define HEIGHT 65 30 | 31 | #define DISPLAY_ON 0xaf 32 | #define DISPLAY_OFF 0xae 33 | 34 | #define SET_ROW 0xb0 35 | #define SET_COL_LO 0x00 36 | #define SET_COL_HI 0x10 37 | #define SET_START_LINE 0x40 38 | 39 | #define ADC_NORMAL 0xa0 40 | #define ADC_REVERSE 0xa1 41 | #define DISPLAY_NORMAL 0xa6 42 | #define DISPLAY_REVERSE 0xa7 43 | #define ALL_POINTS_NORMAL 0xa4 44 | #define ALL_POINTS_ON 0xa5 45 | #define BIAS_RATIO_9 0xa2 46 | #define BIAS_RATIO_7 0xa3 47 | #define READ_MODIFY_WRITE 0xe0 48 | #define END_RMW 0xee 49 | #define RESET 0xe2 50 | //missing common output mode select 51 | #define POWER_SUPPLY_OFF 0x28 52 | #define POWER_SUPPLY_ON 0x2f 53 | #define SET_REG_RESISTOR 0x24 54 | #define VOLUME_MODE_SET 0x81 55 | #define STATIC_INDIC_OFF 0xac 56 | #define STATIC_INDIC_ON 0xad 57 | //missing booster ratio select 58 | #define NOP 0xe3 59 | #define OUTPUT_STATUS_SEL 0xc0 60 | #define TEST_RESET 0xf0 61 | #define OSC_FREQ_314 0xe4 62 | #define OSC_FREQ_263 0xe5 63 | #define NORMAL_DISPLAY 0x82 64 | #define PARTIAL_DISPLAY 0x83 65 | #define DC_DC_CLOCK_SET 0xe6 66 | 67 | void sleepMillis(int ms); 68 | 69 | void xtalClock(); 70 | 71 | // IO Port Definitions: 72 | #define A0 P0_2 73 | #define SSN P0_4 74 | #define LCDRst P1_1 75 | #define LED_RED P2_3 76 | #define LED_GREEN P2_4 77 | // plus SPI ports driven from USART0 are: 78 | // MOSI P0_3 79 | // SCK P0_5 80 | 81 | void setIOPorts(); 82 | 83 | void configureSPI(); 84 | 85 | void tx(unsigned char ch); 86 | 87 | void txData(unsigned char ch); 88 | 89 | void txCtl(unsigned char ch); 90 | 91 | void LCDReset(void); 92 | 93 | void LCDPowerSave(); 94 | 95 | void setCursor(unsigned char row, unsigned char col); 96 | 97 | void setDisplayStart(unsigned char start); 98 | 99 | void setNormalReverse(unsigned char normal); 100 | 101 | void clear(); 102 | 103 | void putchar(char c); 104 | -------------------------------------------------------------------------------- /garage/opensesame/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IM-Me display functions 3 | * 4 | * Copyright 2010 Dave 5 | * http://daveshacks.blogspot.com/2010/01/im-me-lcd-interface-hacked.html 6 | * 7 | * Copyright 2010 Michael Ossmann 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, 22 | * Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | #define LOW 0 26 | #define HIGH 1 27 | 28 | #define WIDTH 132 29 | #define HEIGHT 65 30 | 31 | #define DISPLAY_ON 0xaf 32 | #define DISPLAY_OFF 0xae 33 | 34 | #define SET_ROW 0xb0 35 | #define SET_COL_LO 0x00 36 | #define SET_COL_HI 0x10 37 | #define SET_START_LINE 0x40 38 | 39 | #define ADC_NORMAL 0xa0 40 | #define ADC_REVERSE 0xa1 41 | #define DISPLAY_NORMAL 0xa6 42 | #define DISPLAY_REVERSE 0xa7 43 | #define ALL_POINTS_NORMAL 0xa4 44 | #define ALL_POINTS_ON 0xa5 45 | #define BIAS_RATIO_9 0xa2 46 | #define BIAS_RATIO_7 0xa3 47 | #define READ_MODIFY_WRITE 0xe0 48 | #define END_RMW 0xee 49 | #define RESET 0xe2 50 | //missing common output mode select 51 | #define POWER_SUPPLY_OFF 0x28 52 | #define POWER_SUPPLY_ON 0x2f 53 | #define SET_REG_RESISTOR 0x24 54 | #define VOLUME_MODE_SET 0x81 55 | #define STATIC_INDIC_OFF 0xac 56 | #define STATIC_INDIC_ON 0xad 57 | //missing booster ratio select 58 | #define NOP 0xe3 59 | #define OUTPUT_STATUS_SEL 0xc0 60 | #define TEST_RESET 0xf0 61 | #define OSC_FREQ_314 0xe4 62 | #define OSC_FREQ_263 0xe5 63 | #define NORMAL_DISPLAY 0x82 64 | #define PARTIAL_DISPLAY 0x83 65 | #define DC_DC_CLOCK_SET 0xe6 66 | 67 | void sleepMillis(int ms); 68 | 69 | void xtalClock(); 70 | 71 | // IO Port Definitions: 72 | #define A0 P0_2 73 | #define SSN P0_4 74 | #define LCDRst P1_1 75 | #define LED_RED P2_3 76 | #define LED_GREEN P2_4 77 | // plus SPI ports driven from USART0 are: 78 | // MOSI P0_3 79 | // SCK P0_5 80 | 81 | void setIOPorts(); 82 | 83 | void configureSPI(); 84 | 85 | void tx(unsigned char ch); 86 | 87 | void txData(unsigned char ch); 88 | 89 | void txCtl(unsigned char ch); 90 | 91 | void LCDReset(void); 92 | 93 | void LCDPowerSave(); 94 | 95 | void setCursor(unsigned char row, unsigned char col); 96 | 97 | void setDisplayStart(unsigned char start); 98 | 99 | void setNormalReverse(unsigned char normal); 100 | 101 | void clear(); 102 | 103 | void putchar(char c); 104 | -------------------------------------------------------------------------------- /iclicker/isniffer/display.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IM-Me display functions 3 | * 4 | * Copyright 2010 Dave 5 | * http://daveshacks.blogspot.com/2010/01/im-me-lcd-interface-hacked.html 6 | * 7 | * Copyright 2010 Michael Ossmann 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, 22 | * Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | #define LOW 0 26 | #define HIGH 1 27 | 28 | #define WIDTH 132 29 | #define HEIGHT 65 30 | 31 | #define DISPLAY_ON 0xaf 32 | #define DISPLAY_OFF 0xae 33 | 34 | #define SET_ROW 0xb0 35 | #define SET_COL_LO 0x00 36 | #define SET_COL_HI 0x10 37 | #define SET_START_LINE 0x40 38 | 39 | #define ADC_NORMAL 0xa0 40 | #define ADC_REVERSE 0xa1 41 | #define DISPLAY_NORMAL 0xa6 42 | #define DISPLAY_REVERSE 0xa7 43 | #define ALL_POINTS_NORMAL 0xa4 44 | #define ALL_POINTS_ON 0xa5 45 | #define BIAS_RATIO_9 0xa2 46 | #define BIAS_RATIO_7 0xa3 47 | #define READ_MODIFY_WRITE 0xe0 48 | #define END_RMW 0xee 49 | #define RESET 0xe2 50 | //missing common output mode select 51 | #define POWER_SUPPLY_OFF 0x28 52 | #define POWER_SUPPLY_ON 0x2f 53 | #define SET_REG_RESISTOR 0x24 54 | #define VOLUME_MODE_SET 0x81 55 | #define STATIC_INDIC_OFF 0xac 56 | #define STATIC_INDIC_ON 0xad 57 | //missing booster ratio select 58 | #define NOP 0xe3 59 | #define OUTPUT_STATUS_SEL 0xc0 60 | #define TEST_RESET 0xf0 61 | #define OSC_FREQ_314 0xe4 62 | #define OSC_FREQ_263 0xe5 63 | #define NORMAL_DISPLAY 0x82 64 | #define PARTIAL_DISPLAY 0x83 65 | #define DC_DC_CLOCK_SET 0xe6 66 | 67 | void sleepMillis(int ms); 68 | 69 | void xtalClock(); 70 | 71 | // IO Port Definitions: 72 | #define A0 P0_2 73 | #define SSN P0_4 74 | #define LCDRst P1_1 75 | #define LED_RED P2_3 76 | #define LED_GREEN P2_4 77 | // plus SPI ports driven from USART0 are: 78 | // MOSI P0_3 79 | // SCK P0_5 80 | 81 | void setIOPorts(); 82 | 83 | void configureSPI(); 84 | 85 | void tx(unsigned char ch); 86 | 87 | void txData(unsigned char ch); 88 | 89 | void txCtl(unsigned char ch); 90 | 91 | void LCDReset(void); 92 | 93 | void LCDPowerSave(); 94 | 95 | void setCursor(unsigned char row, unsigned char col); 96 | 97 | void setDisplayStart(unsigned char start); 98 | 99 | void setNormalReverse(unsigned char normal); 100 | 101 | void clear(); 102 | 103 | void putchar(char c); 104 | -------------------------------------------------------------------------------- /iclicker/isniffer/isniffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /* power button debouncing for wake from sleep */ 21 | #define DEBOUNCE_COUNT 4 22 | #define DEBOUNCE_PERIOD 50 23 | 24 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 25 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 26 | 27 | #define HIBYTE(a) (u8) ((u16)(a) >> 8 ) 28 | #define LOBYTE(a) (u8) (u16)(a) 29 | 30 | #define SET_WORD(regH, regL, word) \ 31 | do { \ 32 | (regH) = HIBYTE( word ); \ 33 | (regL) = LOBYTE( word ); \ 34 | } while (0) 35 | 36 | /* codes transmitted by iclicker */ 37 | #define BUTTON_A 0x1 38 | #define BUTTON_B 0x5 39 | #define BUTTON_C 0xD 40 | #define BUTTON_D 0xE 41 | #define BUTTON_E 0xA 42 | #define JOIN_CHAN 0x2 43 | 44 | typedef struct { 45 | u32 id; 46 | u8 button; 47 | } clicker; 48 | 49 | /* note sdcc wants reverse bit order from datasheet */ 50 | typedef struct { 51 | u8 SRCADDRH; 52 | u8 SRCADDRL; 53 | u8 DESTADDRH; 54 | u8 DESTADDRL; 55 | u8 LENH : 5; 56 | u8 VLEN : 3; 57 | 58 | u8 LENL : 8; 59 | 60 | u8 TRIG : 5; 61 | u8 TMODE : 2; 62 | u8 WORDSIZE : 1; 63 | 64 | u8 PRIORITY : 2; 65 | u8 M8 : 1; 66 | u8 IRQMASK : 1; 67 | u8 DESTINC : 2; 68 | u8 SRCINC : 2; 69 | } DMA_DESC; 70 | 71 | /* 72 | * Channels are designated by the user by entering a two letter button code. 73 | * This maps the code to a channel number (905.5 MHz + (250 kHz * n)). 74 | * 75 | * 'DA' 905.5 MHz, channel 0 76 | * 'CC' 907.0 MHz, channel 6 77 | * 'CD' 908.0 MHz, channel 10 78 | * 'DB' 909.0 MHz, channel 14 79 | * 'DD' 910.0 MHz, channel 18 80 | * 'DC' 911.0 MHz, channel 22 81 | * 'AB' 913.0 MHz, channel 30 82 | * 'AC' 914.0 MHz, channel 34 83 | * 'AD' 915.0 MHz, channel 38 84 | * 'BA' 916.0 MHz, channel 42 85 | * 'AA' 917.0 MHz, channel 46 86 | * 'BB' 919.0 MHz, channel 54 87 | * 'BC' 920.0 MHz, channel 58 88 | * 'BD' 921.0 MHz, channel 62 89 | * 'CA' 922.0 MHz, channel 66 90 | * 'CB' 923.0 MHz, channel 70 91 | */ 92 | static const u8 channel_table[4][4] = { {46, 30, 34, 38}, 93 | {42, 54, 58, 62}, 94 | {66, 70, 6, 10}, 95 | {0, 14, 22, 18} }; 96 | 97 | void radio_setup(); 98 | //void tune(); 99 | void poll_keyboard(); 100 | void main(void); 101 | -------------------------------------------------------------------------------- /specan/README: -------------------------------------------------------------------------------- 1 | Pocket Spectrum Analyzer 2 | 3 | This is alternative firmware for the Girl Tech IM-Me 4 | (http://www.girltech.com/electronics-imMe.aspx) that implements a basic 5 | spectrum analyzer. 6 | 7 | WARNING! You could destroy your device if you try to use this software. You 8 | certainly would have a hard time getting your device to work as originally 9 | intended ever again. There is no known way to recover the original firmware. 10 | 11 | 12 | installation: 13 | 14 | For more complete instructions, see: 15 | 16 | http://travisgoodspeed.blogspot.com/2010/03/im-me-goodfet-wiring-tutorial.html 17 | 18 | Abbreviated instructions follow: 19 | 20 | 1. Acquire or build a GoodFET (http://goodfet.sourceforge.net/). There are 21 | other ways to program the IM-Me, but you're on your own. 22 | 23 | 2. Wire your IM-Me to the GoodFET according to 24 | http://www.flickr.com/photos/travisgoodspeed/4322361457/ 25 | 26 | 3. goodfet.cc flash specan.hex 27 | 28 | Alternatively you may compile from source with sdcc and install with "make 29 | install". 30 | 31 | 32 | usage: 33 | 34 | The LCD shows the relative power levels received across a range of frequencies 35 | indicated in MHz along the bottom. 36 | 37 | bandwidth settings: 38 | 39 | There are three bandwidth modes: wide (default), narrow, and ultrawide. Wide 40 | mode displays 26.4 MHz of bandwidth in 200 kHz increments. Narrow mode 41 | displays 6.6 MHz of bandwidth in 50 kHz increments. Ultrawide mode displays 88 42 | MHz of bandwidth in 667 kHz increments. You can cycle through the modes with 43 | the "Menu" button or select a mode with the "W", "N", or "U" buttons. 44 | 45 | frequency selection: 46 | 47 | Set the frequency by scrolling with the left or right arrow buttons. The 48 | supported ranges are 281 - 361, 378 - 481, and 749 - 962 MHz. 49 | 50 | power level resolution: 51 | 52 | There are two power level resolution modes: short (default) and tall. Short 53 | mode displays six bits of power level information. Tall mode displays eight 54 | bits of power level information. You can toggle between the two modes with the 55 | "Bye!" button or select a mode with the "S" or "T" buttons. 56 | 57 | power level scrolling: 58 | 59 | Scroll up and down with the smile wheel or the "Q" and "A" buttons. Scrolling 60 | is often necessary when using tall mode. Tip: You can scroll faster in short 61 | mode and then switch back to tall mode. 62 | 63 | max hold: 64 | 65 | Press the "M" button to active or deactivate max hold. The maximum power level 66 | received during the current activation of max hold is displayed as a dot above 67 | the normal bar graph display. Max hold is automatically deactivated whenever 68 | the frequency or bandwidth settings change. 69 | 70 | 71 | thanks: 72 | 73 | Thanks to Dave for an incredible job of reverse engineering the IM-Me and 74 | sharing his code: 75 | 76 | http://daveshacks.blogspot.com/ 77 | 78 | Thanks to Travis Goodspeed for developing the GoodFET, introducing me to the 79 | IM-Me, and sharing his code: 80 | 81 | http://travisgoodspeed.blogspot.com/ 82 | 83 | 84 | home: 85 | 86 | You can find the most recent version of this software at: 87 | 88 | http://www.ossmann.com/sa/ 89 | 90 | 91 | author: 92 | 93 | Michael Ossmann 94 | -------------------------------------------------------------------------------- /specan/src/pm.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "ioCCxx10_bitdef.h" 22 | #include "types.h" 23 | #include "bits.h" 24 | 25 | /* prepare an interrupt for the power button so it will wake us up */ 26 | void setup_pm_interrupt() { 27 | /* clear the interrupt flags */ 28 | P1IFG &= ~BIT6; 29 | P1IF = 0; 30 | 31 | /* enable interrupt on power button */ 32 | P1IEN = BIT6; 33 | 34 | /* enable interrupts on the port */ 35 | IEN2 |= IEN2_P1IE; 36 | 37 | /* produce interrupts on falling edge */ 38 | PICTL |= PICTL_P1ICON; 39 | 40 | /* enable interrupts globally */ 41 | EA = 1; 42 | } 43 | 44 | /* power button interrupt service routine */ 45 | void port1_isr() __interrupt (P1INT_VECTOR) { 46 | /* clear the interrupt flags */ 47 | P1IFG &= ~BIT6; 48 | P1IF = 0; 49 | 50 | /* clear sleep mode bits */ 51 | SLEEP &= ~SLEEP_MODE; 52 | } 53 | 54 | /* 55 | * All this DMA and clock nonsense is based on the Errata Note (swrz022b) which 56 | * describes a workaround for "Part May Hang in Power Mode." Timing is 57 | * critical here. Do not edit this function without reading the Errata Note. 58 | */ 59 | 60 | void sleep() { 61 | volatile u8 desc_high = DMA0CFGH; 62 | volatile u8 desc_low = DMA0CFGL; 63 | xdata u8 dma_buf[7] = {0x07,0x07,0x07,0x07,0x07,0x07,0x04}; 64 | xdata u8 dma_desc[8] = {0x00,0x00,0xDF,0xBE,0x00,0x07,0x20,0x42}; 65 | 66 | /* switch to HS RCOSC */ 67 | SLEEP &= ~SLEEP_OSC_PD; 68 | while (!(SLEEP & SLEEP_HFRC_S)); 69 | CLKCON = (CLKCON & ~CLKCON_CLKSPD) | CLKCON_OSC | CLKSPD_DIV_2; 70 | while (!(CLKCON & CLKCON_OSC)); 71 | SLEEP |= SLEEP_OSC_PD; 72 | 73 | setup_pm_interrupt(); 74 | 75 | /* store descriptors and abort any transfers */ 76 | desc_high = DMA0CFGH; 77 | desc_low = DMA0CFGL; 78 | DMAARM |= (DMAARM_ABORT | DMAARM0); 79 | 80 | /* DMA prep */ 81 | dma_desc[0] = (u16)&dma_buf >> 8; 82 | dma_desc[1] = (u16)&dma_buf; 83 | DMA0CFGH = (u16)&dma_desc >> 8; 84 | DMA0CFGL = (u16)&dma_desc; 85 | DMAARM = DMAARM0; 86 | 87 | /* 88 | * Any interrupts not intended to wake from sleep should be 89 | * disabled by this point. 90 | */ 91 | 92 | /* disable flash cache */ 93 | MEMCTR |= MEMCTR_CACHD; 94 | 95 | /* select sleep mode PM3 and power down XOSC */ 96 | SLEEP |= (SLEEP_MODE_PM3 | SLEEP_OSC_PD); 97 | 98 | __asm 99 | nop 100 | nop 101 | nop 102 | __endasm; 103 | 104 | if (SLEEP & SLEEP_MODE_PM3) { 105 | __asm 106 | mov 0xD7,#0x01 /* DMAREQ */ 107 | nop 108 | orl 0x87,#0x01 /* last instruction before sleep */ 109 | nop /* first instruction after wake */ 110 | __endasm; 111 | } 112 | 113 | /* enable flash cache */ 114 | MEMCTR &= ~MEMCTR_CACHD; 115 | 116 | /* restore DMA */ 117 | DMA0CFGH = desc_high; 118 | DMA0CFGL = desc_low; 119 | DMAARM = DMAARM0; 120 | 121 | /* make sure HS RCOSC is stable */ 122 | while (!(SLEEP & SLEEP_HFRC_S)); 123 | } 124 | -------------------------------------------------------------------------------- /iclicker/isniffer/pm.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "ioCCxx10_bitdef.h" 22 | #include "types.h" 23 | #include "bits.h" 24 | 25 | /* prepare an interrupt for the power button so it will wake us up */ 26 | void setup_pm_interrupt() { 27 | /* clear the interrupt flags */ 28 | P1IFG &= ~BIT6; 29 | P1IF = 0; 30 | 31 | /* enable interrupt on power button */ 32 | P1IEN = BIT6; 33 | 34 | /* enable interrupts on the port */ 35 | IEN2 |= IEN2_P1IE; 36 | 37 | /* produce interrupts on falling edge */ 38 | PICTL |= PICTL_P1ICON; 39 | 40 | /* enable interrupts globally */ 41 | EA = 1; 42 | } 43 | 44 | /* power button interrupt service routine */ 45 | void port1_isr() __interrupt (P1INT_VECTOR) { 46 | /* clear the interrupt flags */ 47 | P1IFG &= ~BIT6; 48 | P1IF = 0; 49 | 50 | /* clear sleep mode bits */ 51 | SLEEP &= ~SLEEP_MODE; 52 | } 53 | 54 | /* 55 | * All this DMA and clock nonsense is based on the Errata Note (swrz022b) which 56 | * describes a workaround for "Part May Hang in Power Mode." Timing is 57 | * critical here. Do not edit this function without reading the Errata Note. 58 | */ 59 | 60 | void sleep() { 61 | volatile u8 desc_high = DMA0CFGH; 62 | volatile u8 desc_low = DMA0CFGL; 63 | xdata u8 dma_buf[7] = {0x07,0x07,0x07,0x07,0x07,0x07,0x04}; 64 | xdata u8 dma_desc[8] = {0x00,0x00,0xDF,0xBE,0x00,0x07,0x20,0x42}; 65 | 66 | /* switch to HS RCOSC */ 67 | SLEEP &= ~SLEEP_OSC_PD; 68 | while (!(SLEEP & SLEEP_HFRC_S)); 69 | CLKCON = (CLKCON & ~CLKCON_CLKSPD) | CLKCON_OSC | CLKSPD_DIV_2; 70 | while (!(CLKCON & CLKCON_OSC)); 71 | SLEEP |= SLEEP_OSC_PD; 72 | 73 | setup_pm_interrupt(); 74 | 75 | /* store descriptors and abort any transfers */ 76 | desc_high = DMA0CFGH; 77 | desc_low = DMA0CFGL; 78 | DMAARM |= (DMAARM_ABORT | DMAARM0); 79 | 80 | /* DMA prep */ 81 | dma_desc[0] = (u16)&dma_buf >> 8; 82 | dma_desc[1] = (u16)&dma_buf; 83 | DMA0CFGH = (u16)&dma_desc >> 8; 84 | DMA0CFGL = (u16)&dma_desc; 85 | DMAARM = DMAARM0; 86 | 87 | /* 88 | * Any interrupts not intended to wake from sleep should be 89 | * disabled by this point. 90 | */ 91 | 92 | /* disable flash cache */ 93 | MEMCTR |= MEMCTR_CACHD; 94 | 95 | /* select sleep mode PM3 and power down XOSC */ 96 | SLEEP |= (SLEEP_MODE_PM3 | SLEEP_OSC_PD); 97 | 98 | __asm 99 | nop 100 | nop 101 | nop 102 | __endasm; 103 | 104 | if (SLEEP & SLEEP_MODE_PM3) { 105 | __asm 106 | mov 0xD7,#0x01 /* DMAREQ */ 107 | nop 108 | orl 0x87,#0x01 /* last instruction before sleep */ 109 | nop /* first instruction after wake */ 110 | __endasm; 111 | } 112 | 113 | /* enable flash cache */ 114 | MEMCTR &= ~MEMCTR_CACHD; 115 | 116 | /* restore DMA */ 117 | DMA0CFGH = desc_high; 118 | DMA0CFGL = desc_low; 119 | DMAARM = DMAARM0; 120 | 121 | /* make sure HS RCOSC is stable */ 122 | while (!(SLEEP & SLEEP_HFRC_S)); 123 | } 124 | -------------------------------------------------------------------------------- /specan/src/keys.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Travis Goodspeed, Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "keys.h" 22 | #include "types.h" 23 | #include "bits.h" 24 | 25 | static u8 active_key; 26 | 27 | //8 rows, 10 columns 28 | const u8 keychars[]={ 29 | //gnd 0_1 1_2 1_3 1_4 1_5 1_6 1_7 0_6 0_7 30 | 31 | //row 0, gnd 32 | 0x00, 0x00, 'O', 'K', 'N', 'M', KPWR, 'P', 0x00, 0x00, 33 | //row 1 34 | 0x00, 0x00, 'Y', 'G', 'C', ' ', '<', ',', KMNU, '>', 35 | //row 2 36 | 0x00, 0x00, 0x00, 'Q', 'W', 'E', 'R', 'T', 'U', 'I', 37 | //row 3 38 | 0x00, 0x00, 0x00, 0x00, 'A', 'S', 'D', 'F', 'H', 'J', 39 | //row 4 40 | 0x00, 0x00, 0x00, 0x00, 0x00, KCAP, 'Z', 'X', 'V', 'B', 41 | //row 5 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, KSPK, KALT, KONL, KBACK, 43 | //row 6 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, KBYE, KDWN, '^', 45 | //row 7 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, '\n', 'L' 47 | }; 48 | 49 | #define KEY(row,col) keychars[row*10+col] 50 | 51 | u8 realkeyscan(){ 52 | u8 row, col; 53 | 54 | //All input 55 | P0DIR &= ~(BIT1+BIT6+BIT7); 56 | P1DIR &= ~(BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); 57 | P0 |= BIT1+BIT6+BIT7; 58 | P1 |= BIT2+BIT3+BIT4+BIT5+BIT6+BIT7; 59 | 60 | for(row=0;row<8;row++){ 61 | col=row;//nothing 62 | switch(row){ 63 | case 0://ground 64 | default: 65 | break; 66 | case 1: //P0_1 67 | P0DIR|=BIT1; 68 | P0&=~BIT1; 69 | break; 70 | case 2: //P1_2 71 | P1DIR|=BIT2; 72 | P1&=~BIT2; 73 | break; 74 | case 3: //P1_3 75 | P1DIR|=BIT3; 76 | P1&=~BIT3; 77 | break; 78 | case 4: //p1_4 79 | P1DIR|=BIT4; 80 | P1&=~BIT4; 81 | break; 82 | case 5: //p1_5 83 | P1DIR|=BIT5; 84 | P1&=~BIT5; 85 | break; 86 | case 6: //P1_6 87 | P1DIR|=BIT6; 88 | P1&=~BIT6; 89 | break; 90 | case 7: //P1_7 91 | P1DIR|=BIT7; 92 | P1&=~BIT7; 93 | break; 94 | } 95 | 96 | if(~P0&BIT1) col=1; 97 | if(~P1&BIT2) col=2; 98 | if(~P1&BIT3) col=3; 99 | if(~P1&BIT4) col=4; 100 | if(~P1&BIT5) col=5; 101 | if(~P1&BIT6) col=6; 102 | if(~P1&BIT7) col=7; 103 | if(~P0&BIT6) col=8; 104 | if(~P0&BIT7) col=9; 105 | 106 | if(col!=row) return KEY(row,col); 107 | } 108 | 109 | return '\0'; 110 | } 111 | 112 | //! Returns the debounced character press. 113 | u8 keyscan(){ 114 | u8 key=realkeyscan(); 115 | //debounce 116 | while(key!=realkeyscan()) 117 | key=realkeyscan(); 118 | 119 | //All input 120 | P0DIR &= ~(BIT1+BIT6+BIT7); 121 | P1DIR &= ~(BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); 122 | P0 |= BIT1+BIT6+BIT7; 123 | P1 |= BIT2+BIT3+BIT4+BIT5+BIT6+BIT7; 124 | 125 | return key; 126 | } 127 | 128 | /* non-blocking check for a keypress */ 129 | u8 getkey() { 130 | u8 key = keyscan(); 131 | 132 | /* keep track of key currently pressed to avoid rapid repeating */ 133 | if (key != active_key) 134 | active_key = key; 135 | else 136 | key = 0x00; 137 | 138 | return key; 139 | } 140 | -------------------------------------------------------------------------------- /garage/opensesame/keys.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Travis Goodspeed, Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "keys.h" 22 | #include "types.h" 23 | #include "bits.h" 24 | 25 | static u8 active_key; 26 | 27 | //8 rows, 10 columns 28 | const u8 keychars[]={ 29 | //gnd 0_1 1_2 1_3 1_4 1_5 1_6 1_7 0_6 0_7 30 | 31 | //row 0, gnd 32 | 0x00, 0x00, 'O', 'K', 'N', 'M', KPWR, 'P', 0x00, 0x00, 33 | //row 1 34 | 0x00, 0x00, 'Y', 'G', 'C', ' ', '<', ',', KMNU, '>', 35 | //row 2 36 | 0x00, 0x00, 0x00, 'Q', 'W', 'E', 'R', 'T', 'U', 'I', 37 | //row 3 38 | 0x00, 0x00, 0x00, 0x00, 'A', 'S', 'D', 'F', 'H', 'J', 39 | //row 4 40 | 0x00, 0x00, 0x00, 0x00, 0x00, KCAP, 'Z', 'X', 'V', 'B', 41 | //row 5 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, KSPK, KALT, KONL, KBACK, 43 | //row 6 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, KBYE, KDWN, '^', 45 | //row 7 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, '\n', 'L' 47 | }; 48 | 49 | #define KEY(row,col) keychars[row*10+col] 50 | 51 | u8 realkeyscan(){ 52 | u8 row, col; 53 | 54 | //All input 55 | P0DIR &= ~(BIT1+BIT6+BIT7); 56 | P1DIR &= ~(BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); 57 | P0 |= BIT1+BIT6+BIT7; 58 | P1 |= BIT2+BIT3+BIT4+BIT5+BIT6+BIT7; 59 | 60 | for(row=0;row<8;row++){ 61 | col=row;//nothing 62 | switch(row){ 63 | case 0://ground 64 | default: 65 | break; 66 | case 1: //P0_1 67 | P0DIR|=BIT1; 68 | P0&=~BIT1; 69 | break; 70 | case 2: //P1_2 71 | P1DIR|=BIT2; 72 | P1&=~BIT2; 73 | break; 74 | case 3: //P1_3 75 | P1DIR|=BIT3; 76 | P1&=~BIT3; 77 | break; 78 | case 4: //p1_4 79 | P1DIR|=BIT4; 80 | P1&=~BIT4; 81 | break; 82 | case 5: //p1_5 83 | P1DIR|=BIT5; 84 | P1&=~BIT5; 85 | break; 86 | case 6: //P1_6 87 | P1DIR|=BIT6; 88 | P1&=~BIT6; 89 | break; 90 | case 7: //P1_7 91 | P1DIR|=BIT7; 92 | P1&=~BIT7; 93 | break; 94 | } 95 | 96 | if(~P0&BIT1) col=1; 97 | if(~P1&BIT2) col=2; 98 | if(~P1&BIT3) col=3; 99 | if(~P1&BIT4) col=4; 100 | if(~P1&BIT5) col=5; 101 | if(~P1&BIT6) col=6; 102 | if(~P1&BIT7) col=7; 103 | if(~P0&BIT6) col=8; 104 | if(~P0&BIT7) col=9; 105 | 106 | if(col!=row) return KEY(row,col); 107 | } 108 | 109 | return '\0'; 110 | } 111 | 112 | //! Returns the debounced character press. 113 | u8 keyscan(){ 114 | u8 key=realkeyscan(); 115 | //debounce 116 | while(key!=realkeyscan()) 117 | key=realkeyscan(); 118 | 119 | //All input 120 | P0DIR &= ~(BIT1+BIT6+BIT7); 121 | P1DIR &= ~(BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); 122 | P0 |= BIT1+BIT6+BIT7; 123 | P1 |= BIT2+BIT3+BIT4+BIT5+BIT6+BIT7; 124 | 125 | return key; 126 | } 127 | 128 | /* non-blocking check for a keypress */ 129 | u8 getkey() { 130 | u8 key = keyscan(); 131 | 132 | /* keep track of key currently pressed to avoid rapid repeating */ 133 | if (key != active_key) 134 | active_key = key; 135 | else 136 | key = 0x00; 137 | 138 | return key; 139 | } 140 | -------------------------------------------------------------------------------- /iclicker/isniffer/keys.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Travis Goodspeed, Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "keys.h" 22 | #include "types.h" 23 | #include "bits.h" 24 | 25 | static u8 active_key; 26 | 27 | //8 rows, 10 columns 28 | const u8 keychars[]={ 29 | //gnd 0_1 1_2 1_3 1_4 1_5 1_6 1_7 0_6 0_7 30 | 31 | //row 0, gnd 32 | 0x00, 0x00, 'O', 'K', 'N', 'M', KPWR, 'P', 0x00, 0x00, 33 | //row 1 34 | 0x00, 0x00, 'Y', 'G', 'C', ' ', '<', ',', KMNU, '>', 35 | //row 2 36 | 0x00, 0x00, 0x00, 'Q', 'W', 'E', 'R', 'T', 'U', 'I', 37 | //row 3 38 | 0x00, 0x00, 0x00, 0x00, 'A', 'S', 'D', 'F', 'H', 'J', 39 | //row 4 40 | 0x00, 0x00, 0x00, 0x00, 0x00, KCAP, 'Z', 'X', 'V', 'B', 41 | //row 5 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, KSPK, KALT, KONL, KBACK, 43 | //row 6 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, KBYE, KDWN, '^', 45 | //row 7 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, '\n', 'L' 47 | }; 48 | 49 | #define KEY(row,col) keychars[row*10+col] 50 | 51 | u8 realkeyscan(){ 52 | u8 row, col; 53 | 54 | //All input 55 | P0DIR &= ~(BIT1+BIT6+BIT7); 56 | P1DIR &= ~(BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); 57 | P0 |= BIT1+BIT6+BIT7; 58 | P1 |= BIT2+BIT3+BIT4+BIT5+BIT6+BIT7; 59 | 60 | for(row=0;row<8;row++){ 61 | col=row;//nothing 62 | switch(row){ 63 | case 0://ground 64 | default: 65 | break; 66 | case 1: //P0_1 67 | P0DIR|=BIT1; 68 | P0&=~BIT1; 69 | break; 70 | case 2: //P1_2 71 | P1DIR|=BIT2; 72 | P1&=~BIT2; 73 | break; 74 | case 3: //P1_3 75 | P1DIR|=BIT3; 76 | P1&=~BIT3; 77 | break; 78 | case 4: //p1_4 79 | P1DIR|=BIT4; 80 | P1&=~BIT4; 81 | break; 82 | case 5: //p1_5 83 | P1DIR|=BIT5; 84 | P1&=~BIT5; 85 | break; 86 | case 6: //P1_6 87 | P1DIR|=BIT6; 88 | P1&=~BIT6; 89 | break; 90 | case 7: //P1_7 91 | P1DIR|=BIT7; 92 | P1&=~BIT7; 93 | break; 94 | } 95 | 96 | if(~P0&BIT1) col=1; 97 | if(~P1&BIT2) col=2; 98 | if(~P1&BIT3) col=3; 99 | if(~P1&BIT4) col=4; 100 | if(~P1&BIT5) col=5; 101 | if(~P1&BIT6) col=6; 102 | if(~P1&BIT7) col=7; 103 | if(~P0&BIT6) col=8; 104 | if(~P0&BIT7) col=9; 105 | 106 | if(col!=row) return KEY(row,col); 107 | } 108 | 109 | return '\0'; 110 | } 111 | 112 | //! Returns the debounced character press. 113 | u8 keyscan(){ 114 | u8 key=realkeyscan(); 115 | //debounce 116 | while(key!=realkeyscan()) 117 | key=realkeyscan(); 118 | 119 | //All input 120 | P0DIR &= ~(BIT1+BIT6+BIT7); 121 | P1DIR &= ~(BIT2+BIT3+BIT4+BIT5+BIT6+BIT7); 122 | P0 |= BIT1+BIT6+BIT7; 123 | P1 |= BIT2+BIT3+BIT4+BIT5+BIT6+BIT7; 124 | 125 | return key; 126 | } 127 | 128 | /* non-blocking check for a keypress */ 129 | u8 getkey() { 130 | u8 key = keyscan(); 131 | 132 | /* keep track of key currently pressed to avoid rapid repeating */ 133 | if (key != active_key) 134 | active_key = key; 135 | else 136 | key = 0x00; 137 | 138 | return key; 139 | } 140 | -------------------------------------------------------------------------------- /specan/src/5x7.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 5x7 fixed font taken from http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html 3 | * "Public domain font. Share and enjoy." 4 | */ 5 | 6 | #define FONT_WIDTH 5 7 | #define FONT_HEIGHT 7 8 | #define FONT_OFFSET 32 9 | #define FONT_MAX 127 10 | 11 | const unsigned char font[][FONT_WIDTH] = { 12 | {0x00, 0x00, 0x00, 0x00, 0x00}, /* space */ 13 | {0x00, 0x00, 0x5e, 0x00, 0x00}, /* exclam */ 14 | {0x00, 0x0e, 0x00, 0x0e, 0x00}, /* quotedbl */ 15 | {0x28, 0x7c, 0x28, 0x7c, 0x28}, /* numbersign */ 16 | {0x08, 0x54, 0x7c, 0x54, 0x20}, /* dollar */ 17 | {0x26, 0x10, 0x08, 0x64, 0x00}, /* percent */ 18 | {0x28, 0x54, 0x28, 0x40, 0x00}, /* ampersand */ 19 | {0x00, 0x00, 0x0e, 0x00, 0x00}, /* quotesingle */ 20 | {0x00, 0x3c, 0x42, 0x00, 0x00}, /* parenleft */ 21 | {0x00, 0x42, 0x3c, 0x00, 0x00}, /* parenright */ 22 | {0x00, 0x54, 0x38, 0x54, 0x00}, /* asterisk */ 23 | {0x10, 0x10, 0x7c, 0x10, 0x10}, /* plus */ 24 | {0x00, 0x80, 0x60, 0x20, 0x00}, /* comma */ 25 | {0x10, 0x10, 0x10, 0x10, 0x00}, /* hyphen */ 26 | {0x00, 0x60, 0x60, 0x00, 0x00}, /* period */ 27 | {0x20, 0x10, 0x08, 0x04, 0x00}, /* slash */ 28 | {0x00, 0x3c, 0x42, 0x3c, 0x00}, /* zero */ 29 | {0x00, 0x44, 0x7e, 0x40, 0x00}, /* one */ 30 | {0x44, 0x62, 0x52, 0x4c, 0x00}, /* two */ 31 | {0x22, 0x4a, 0x4a, 0x36, 0x00}, /* three */ 32 | {0x18, 0x14, 0x7e, 0x10, 0x00}, /* four */ 33 | {0x2e, 0x4a, 0x4a, 0x32, 0x00}, /* five */ 34 | {0x3c, 0x4a, 0x4a, 0x30, 0x00}, /* six */ 35 | {0x02, 0x62, 0x1a, 0x06, 0x00}, /* seven */ 36 | {0x34, 0x4a, 0x4a, 0x34, 0x00}, /* eight */ 37 | {0x0c, 0x52, 0x52, 0x3c, 0x00}, /* nine */ 38 | {0x00, 0x6c, 0x6c, 0x00, 0x00}, /* colon */ 39 | {0x80, 0x6c, 0x2c, 0x00, 0x00}, /* semicolon */ 40 | {0x00, 0x10, 0x28, 0x44, 0x00}, /* less */ 41 | {0x28, 0x28, 0x28, 0x28, 0x00}, /* equal */ 42 | {0x00, 0x44, 0x28, 0x10, 0x00}, /* greater */ 43 | {0x00, 0x04, 0x52, 0x0c, 0x00}, /* question */ 44 | {0x3c, 0x42, 0x5a, 0x1c, 0x00}, /* at */ 45 | {0x7c, 0x12, 0x12, 0x7c, 0x00}, /* A */ 46 | {0x7e, 0x4a, 0x4a, 0x34, 0x00}, /* B */ 47 | {0x3c, 0x42, 0x42, 0x24, 0x00}, /* C */ 48 | {0x7e, 0x42, 0x42, 0x3c, 0x00}, /* D */ 49 | {0x7e, 0x4a, 0x4a, 0x42, 0x00}, /* E */ 50 | {0x7e, 0x0a, 0x0a, 0x02, 0x00}, /* F */ 51 | {0x3c, 0x42, 0x52, 0x74, 0x00}, /* G */ 52 | {0x7e, 0x08, 0x08, 0x7e, 0x00}, /* H */ 53 | {0x00, 0x42, 0x7e, 0x42, 0x00}, /* I */ 54 | {0x20, 0x40, 0x40, 0x3e, 0x00}, /* J */ 55 | {0x7e, 0x18, 0x24, 0x42, 0x00}, /* K */ 56 | {0x7e, 0x40, 0x40, 0x40, 0x00}, /* L */ 57 | {0x7e, 0x0c, 0x0c, 0x7e, 0x00}, /* M */ 58 | {0x7e, 0x0c, 0x30, 0x7e, 0x00}, /* N */ 59 | {0x3c, 0x42, 0x42, 0x3c, 0x00}, /* O */ 60 | {0x7e, 0x12, 0x12, 0x0c, 0x00}, /* P */ 61 | {0x3c, 0x62, 0x42, 0xbc, 0x00}, /* Q */ 62 | {0x7e, 0x12, 0x32, 0x4c, 0x00}, /* R */ 63 | {0x24, 0x4a, 0x52, 0x24, 0x00}, /* S */ 64 | {0x00, 0x02, 0x7e, 0x02, 0x00}, /* T */ 65 | {0x3e, 0x40, 0x40, 0x3e, 0x00}, /* U */ 66 | {0x1e, 0x60, 0x60, 0x1e, 0x00}, /* V */ 67 | {0x7e, 0x30, 0x30, 0x7e, 0x00}, /* W */ 68 | {0x66, 0x18, 0x18, 0x66, 0x00}, /* X */ 69 | {0x00, 0x0e, 0x70, 0x0e, 0x00}, /* Y */ 70 | {0x62, 0x52, 0x4a, 0x46, 0x00}, /* Z */ 71 | {0x00, 0x7e, 0x42, 0x42, 0x00}, /* bracketleft */ 72 | {0x04, 0x08, 0x10, 0x20, 0x00}, /* backslash */ 73 | {0x00, 0x42, 0x42, 0x7e, 0x00}, /* bracketright */ 74 | {0x00, 0x04, 0x02, 0x04, 0x00}, /* asciicircum */ 75 | {0x40, 0x40, 0x40, 0x40, 0x00}, /* underscore */ 76 | {0x00, 0x02, 0x04, 0x00, 0x00}, /* grave */ 77 | {0x30, 0x48, 0x28, 0x78, 0x00}, /* a */ 78 | {0x7e, 0x48, 0x48, 0x30, 0x00}, /* b */ 79 | {0x30, 0x48, 0x48, 0x00, 0x00}, /* c */ 80 | {0x30, 0x48, 0x48, 0x7e, 0x00}, /* d */ 81 | {0x30, 0x68, 0x58, 0x10, 0x00}, /* e */ 82 | {0x10, 0x7c, 0x12, 0x04, 0x00}, /* f */ 83 | {0x50, 0xa8, 0xa8, 0x98, 0x00}, /* g */ 84 | {0x7e, 0x08, 0x08, 0x70, 0x00}, /* h */ 85 | {0x00, 0x48, 0x7a, 0x40, 0x00}, /* i */ 86 | {0x00, 0x40, 0x80, 0x7a, 0x00}, /* j */ 87 | {0x7e, 0x10, 0x28, 0x40, 0x00}, /* k */ 88 | {0x00, 0x42, 0x7e, 0x40, 0x00}, /* l */ 89 | {0x78, 0x10, 0x18, 0x70, 0x00}, /* m */ 90 | {0x78, 0x08, 0x08, 0x70, 0x00}, /* n */ 91 | {0x30, 0x48, 0x48, 0x30, 0x00}, /* o */ 92 | {0xf8, 0x48, 0x48, 0x30, 0x00}, /* p */ 93 | {0x30, 0x48, 0x48, 0xf8, 0x00}, /* q */ 94 | {0x78, 0x08, 0x08, 0x10, 0x00}, /* r */ 95 | {0x50, 0x58, 0x68, 0x28, 0x00}, /* s */ 96 | {0x08, 0x3e, 0x48, 0x40, 0x00}, /* t */ 97 | {0x38, 0x40, 0x40, 0x78, 0x00}, /* u */ 98 | {0x00, 0x38, 0x40, 0x38, 0x00}, /* v */ 99 | {0x78, 0x60, 0x60, 0x78, 0x00}, /* w */ 100 | {0x48, 0x30, 0x30, 0x48, 0x00}, /* x */ 101 | {0x18, 0xa0, 0x40, 0x38, 0x00}, /* y */ 102 | {0x48, 0x68, 0x58, 0x48, 0x00}, /* z */ 103 | {0x00, 0x08, 0x3c, 0x42, 0x00}, /* braceleft */ 104 | {0x00, 0x00, 0x7e, 0x00, 0x00}, /* bar */ 105 | {0x00, 0x42, 0x3c, 0x08, 0x00}, /* braceright */ 106 | }; 107 | -------------------------------------------------------------------------------- /garage/opensesame/5x7.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 5x7 fixed font taken from http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html 3 | * "Public domain font. Share and enjoy." 4 | */ 5 | 6 | #define FONT_WIDTH 5 7 | #define FONT_HEIGHT 7 8 | #define FONT_OFFSET 32 9 | #define FONT_MAX 127 10 | 11 | const unsigned char font[][FONT_WIDTH] = { 12 | {0x00, 0x00, 0x00, 0x00, 0x00}, /* space */ 13 | {0x00, 0x00, 0x5e, 0x00, 0x00}, /* exclam */ 14 | {0x00, 0x0e, 0x00, 0x0e, 0x00}, /* quotedbl */ 15 | {0x28, 0x7c, 0x28, 0x7c, 0x28}, /* numbersign */ 16 | {0x08, 0x54, 0x7c, 0x54, 0x20}, /* dollar */ 17 | {0x26, 0x10, 0x08, 0x64, 0x00}, /* percent */ 18 | {0x28, 0x54, 0x28, 0x40, 0x00}, /* ampersand */ 19 | {0x00, 0x00, 0x0e, 0x00, 0x00}, /* quotesingle */ 20 | {0x00, 0x3c, 0x42, 0x00, 0x00}, /* parenleft */ 21 | {0x00, 0x42, 0x3c, 0x00, 0x00}, /* parenright */ 22 | {0x00, 0x54, 0x38, 0x54, 0x00}, /* asterisk */ 23 | {0x10, 0x10, 0x7c, 0x10, 0x10}, /* plus */ 24 | {0x00, 0x80, 0x60, 0x20, 0x00}, /* comma */ 25 | {0x10, 0x10, 0x10, 0x10, 0x00}, /* hyphen */ 26 | {0x00, 0x60, 0x60, 0x00, 0x00}, /* period */ 27 | {0x20, 0x10, 0x08, 0x04, 0x00}, /* slash */ 28 | {0x00, 0x3c, 0x42, 0x3c, 0x00}, /* zero */ 29 | {0x00, 0x44, 0x7e, 0x40, 0x00}, /* one */ 30 | {0x44, 0x62, 0x52, 0x4c, 0x00}, /* two */ 31 | {0x22, 0x4a, 0x4a, 0x36, 0x00}, /* three */ 32 | {0x18, 0x14, 0x7e, 0x10, 0x00}, /* four */ 33 | {0x2e, 0x4a, 0x4a, 0x32, 0x00}, /* five */ 34 | {0x3c, 0x4a, 0x4a, 0x30, 0x00}, /* six */ 35 | {0x02, 0x62, 0x1a, 0x06, 0x00}, /* seven */ 36 | {0x34, 0x4a, 0x4a, 0x34, 0x00}, /* eight */ 37 | {0x0c, 0x52, 0x52, 0x3c, 0x00}, /* nine */ 38 | {0x00, 0x6c, 0x6c, 0x00, 0x00}, /* colon */ 39 | {0x80, 0x6c, 0x2c, 0x00, 0x00}, /* semicolon */ 40 | {0x00, 0x10, 0x28, 0x44, 0x00}, /* less */ 41 | {0x28, 0x28, 0x28, 0x28, 0x00}, /* equal */ 42 | {0x00, 0x44, 0x28, 0x10, 0x00}, /* greater */ 43 | {0x00, 0x04, 0x52, 0x0c, 0x00}, /* question */ 44 | {0x3c, 0x42, 0x5a, 0x1c, 0x00}, /* at */ 45 | {0x7c, 0x12, 0x12, 0x7c, 0x00}, /* A */ 46 | {0x7e, 0x4a, 0x4a, 0x34, 0x00}, /* B */ 47 | {0x3c, 0x42, 0x42, 0x24, 0x00}, /* C */ 48 | {0x7e, 0x42, 0x42, 0x3c, 0x00}, /* D */ 49 | {0x7e, 0x4a, 0x4a, 0x42, 0x00}, /* E */ 50 | {0x7e, 0x0a, 0x0a, 0x02, 0x00}, /* F */ 51 | {0x3c, 0x42, 0x52, 0x74, 0x00}, /* G */ 52 | {0x7e, 0x08, 0x08, 0x7e, 0x00}, /* H */ 53 | {0x00, 0x42, 0x7e, 0x42, 0x00}, /* I */ 54 | {0x20, 0x40, 0x40, 0x3e, 0x00}, /* J */ 55 | {0x7e, 0x18, 0x24, 0x42, 0x00}, /* K */ 56 | {0x7e, 0x40, 0x40, 0x40, 0x00}, /* L */ 57 | {0x7e, 0x0c, 0x0c, 0x7e, 0x00}, /* M */ 58 | {0x7e, 0x0c, 0x30, 0x7e, 0x00}, /* N */ 59 | {0x3c, 0x42, 0x42, 0x3c, 0x00}, /* O */ 60 | {0x7e, 0x12, 0x12, 0x0c, 0x00}, /* P */ 61 | {0x3c, 0x62, 0x42, 0xbc, 0x00}, /* Q */ 62 | {0x7e, 0x12, 0x32, 0x4c, 0x00}, /* R */ 63 | {0x24, 0x4a, 0x52, 0x24, 0x00}, /* S */ 64 | {0x00, 0x02, 0x7e, 0x02, 0x00}, /* T */ 65 | {0x3e, 0x40, 0x40, 0x3e, 0x00}, /* U */ 66 | {0x1e, 0x60, 0x60, 0x1e, 0x00}, /* V */ 67 | {0x7e, 0x30, 0x30, 0x7e, 0x00}, /* W */ 68 | {0x66, 0x18, 0x18, 0x66, 0x00}, /* X */ 69 | {0x00, 0x0e, 0x70, 0x0e, 0x00}, /* Y */ 70 | {0x62, 0x52, 0x4a, 0x46, 0x00}, /* Z */ 71 | {0x00, 0x7e, 0x42, 0x42, 0x00}, /* bracketleft */ 72 | {0x04, 0x08, 0x10, 0x20, 0x00}, /* backslash */ 73 | {0x00, 0x42, 0x42, 0x7e, 0x00}, /* bracketright */ 74 | {0x00, 0x04, 0x02, 0x04, 0x00}, /* asciicircum */ 75 | {0x40, 0x40, 0x40, 0x40, 0x00}, /* underscore */ 76 | {0x00, 0x02, 0x04, 0x00, 0x00}, /* grave */ 77 | {0x30, 0x48, 0x28, 0x78, 0x00}, /* a */ 78 | {0x7e, 0x48, 0x48, 0x30, 0x00}, /* b */ 79 | {0x30, 0x48, 0x48, 0x00, 0x00}, /* c */ 80 | {0x30, 0x48, 0x48, 0x7e, 0x00}, /* d */ 81 | {0x30, 0x68, 0x58, 0x10, 0x00}, /* e */ 82 | {0x10, 0x7c, 0x12, 0x04, 0x00}, /* f */ 83 | {0x50, 0xa8, 0xa8, 0x98, 0x00}, /* g */ 84 | {0x7e, 0x08, 0x08, 0x70, 0x00}, /* h */ 85 | {0x00, 0x48, 0x7a, 0x40, 0x00}, /* i */ 86 | {0x00, 0x40, 0x80, 0x7a, 0x00}, /* j */ 87 | {0x7e, 0x10, 0x28, 0x40, 0x00}, /* k */ 88 | {0x00, 0x42, 0x7e, 0x40, 0x00}, /* l */ 89 | {0x78, 0x10, 0x18, 0x70, 0x00}, /* m */ 90 | {0x78, 0x08, 0x08, 0x70, 0x00}, /* n */ 91 | {0x30, 0x48, 0x48, 0x30, 0x00}, /* o */ 92 | {0xf8, 0x48, 0x48, 0x30, 0x00}, /* p */ 93 | {0x30, 0x48, 0x48, 0xf8, 0x00}, /* q */ 94 | {0x78, 0x08, 0x08, 0x10, 0x00}, /* r */ 95 | {0x50, 0x58, 0x68, 0x28, 0x00}, /* s */ 96 | {0x08, 0x3e, 0x48, 0x40, 0x00}, /* t */ 97 | {0x38, 0x40, 0x40, 0x78, 0x00}, /* u */ 98 | {0x00, 0x38, 0x40, 0x38, 0x00}, /* v */ 99 | {0x78, 0x60, 0x60, 0x78, 0x00}, /* w */ 100 | {0x48, 0x30, 0x30, 0x48, 0x00}, /* x */ 101 | {0x18, 0xa0, 0x40, 0x38, 0x00}, /* y */ 102 | {0x48, 0x68, 0x58, 0x48, 0x00}, /* z */ 103 | {0x00, 0x08, 0x3c, 0x42, 0x00}, /* braceleft */ 104 | {0x00, 0x00, 0x7e, 0x00, 0x00}, /* bar */ 105 | {0x00, 0x42, 0x3c, 0x08, 0x00}, /* braceright */ 106 | }; 107 | -------------------------------------------------------------------------------- /iclicker/isniffer/5x7.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 5x7 fixed font taken from http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html 3 | * "Public domain font. Share and enjoy." 4 | */ 5 | 6 | #define FONT_WIDTH 5 7 | #define FONT_HEIGHT 7 8 | #define FONT_OFFSET 32 9 | #define FONT_MAX 127 10 | 11 | const unsigned char font[][FONT_WIDTH] = { 12 | {0x00, 0x00, 0x00, 0x00, 0x00}, /* space */ 13 | {0x00, 0x00, 0x5e, 0x00, 0x00}, /* exclam */ 14 | {0x00, 0x0e, 0x00, 0x0e, 0x00}, /* quotedbl */ 15 | {0x28, 0x7c, 0x28, 0x7c, 0x28}, /* numbersign */ 16 | {0x08, 0x54, 0x7c, 0x54, 0x20}, /* dollar */ 17 | {0x26, 0x10, 0x08, 0x64, 0x00}, /* percent */ 18 | {0x28, 0x54, 0x28, 0x40, 0x00}, /* ampersand */ 19 | {0x00, 0x00, 0x0e, 0x00, 0x00}, /* quotesingle */ 20 | {0x00, 0x3c, 0x42, 0x00, 0x00}, /* parenleft */ 21 | {0x00, 0x42, 0x3c, 0x00, 0x00}, /* parenright */ 22 | {0x00, 0x54, 0x38, 0x54, 0x00}, /* asterisk */ 23 | {0x10, 0x10, 0x7c, 0x10, 0x10}, /* plus */ 24 | {0x00, 0x80, 0x60, 0x20, 0x00}, /* comma */ 25 | {0x10, 0x10, 0x10, 0x10, 0x00}, /* hyphen */ 26 | {0x00, 0x60, 0x60, 0x00, 0x00}, /* period */ 27 | {0x20, 0x10, 0x08, 0x04, 0x00}, /* slash */ 28 | {0x00, 0x3c, 0x42, 0x3c, 0x00}, /* zero */ 29 | {0x00, 0x44, 0x7e, 0x40, 0x00}, /* one */ 30 | {0x44, 0x62, 0x52, 0x4c, 0x00}, /* two */ 31 | {0x22, 0x4a, 0x4a, 0x36, 0x00}, /* three */ 32 | {0x18, 0x14, 0x7e, 0x10, 0x00}, /* four */ 33 | {0x2e, 0x4a, 0x4a, 0x32, 0x00}, /* five */ 34 | {0x3c, 0x4a, 0x4a, 0x30, 0x00}, /* six */ 35 | {0x02, 0x62, 0x1a, 0x06, 0x00}, /* seven */ 36 | {0x34, 0x4a, 0x4a, 0x34, 0x00}, /* eight */ 37 | {0x0c, 0x52, 0x52, 0x3c, 0x00}, /* nine */ 38 | {0x00, 0x6c, 0x6c, 0x00, 0x00}, /* colon */ 39 | {0x80, 0x6c, 0x2c, 0x00, 0x00}, /* semicolon */ 40 | {0x00, 0x10, 0x28, 0x44, 0x00}, /* less */ 41 | {0x28, 0x28, 0x28, 0x28, 0x00}, /* equal */ 42 | {0x00, 0x44, 0x28, 0x10, 0x00}, /* greater */ 43 | {0x00, 0x04, 0x52, 0x0c, 0x00}, /* question */ 44 | {0x3c, 0x42, 0x5a, 0x1c, 0x00}, /* at */ 45 | {0x7c, 0x12, 0x12, 0x7c, 0x00}, /* A */ 46 | {0x7e, 0x4a, 0x4a, 0x34, 0x00}, /* B */ 47 | {0x3c, 0x42, 0x42, 0x24, 0x00}, /* C */ 48 | {0x7e, 0x42, 0x42, 0x3c, 0x00}, /* D */ 49 | {0x7e, 0x4a, 0x4a, 0x42, 0x00}, /* E */ 50 | {0x7e, 0x0a, 0x0a, 0x02, 0x00}, /* F */ 51 | {0x3c, 0x42, 0x52, 0x74, 0x00}, /* G */ 52 | {0x7e, 0x08, 0x08, 0x7e, 0x00}, /* H */ 53 | {0x00, 0x42, 0x7e, 0x42, 0x00}, /* I */ 54 | {0x20, 0x40, 0x40, 0x3e, 0x00}, /* J */ 55 | {0x7e, 0x18, 0x24, 0x42, 0x00}, /* K */ 56 | {0x7e, 0x40, 0x40, 0x40, 0x00}, /* L */ 57 | {0x7e, 0x0c, 0x0c, 0x7e, 0x00}, /* M */ 58 | {0x7e, 0x0c, 0x30, 0x7e, 0x00}, /* N */ 59 | {0x3c, 0x42, 0x42, 0x3c, 0x00}, /* O */ 60 | {0x7e, 0x12, 0x12, 0x0c, 0x00}, /* P */ 61 | {0x3c, 0x62, 0x42, 0xbc, 0x00}, /* Q */ 62 | {0x7e, 0x12, 0x32, 0x4c, 0x00}, /* R */ 63 | {0x24, 0x4a, 0x52, 0x24, 0x00}, /* S */ 64 | {0x00, 0x02, 0x7e, 0x02, 0x00}, /* T */ 65 | {0x3e, 0x40, 0x40, 0x3e, 0x00}, /* U */ 66 | {0x1e, 0x60, 0x60, 0x1e, 0x00}, /* V */ 67 | {0x7e, 0x30, 0x30, 0x7e, 0x00}, /* W */ 68 | {0x66, 0x18, 0x18, 0x66, 0x00}, /* X */ 69 | {0x00, 0x0e, 0x70, 0x0e, 0x00}, /* Y */ 70 | {0x62, 0x52, 0x4a, 0x46, 0x00}, /* Z */ 71 | {0x00, 0x7e, 0x42, 0x42, 0x00}, /* bracketleft */ 72 | {0x04, 0x08, 0x10, 0x20, 0x00}, /* backslash */ 73 | {0x00, 0x42, 0x42, 0x7e, 0x00}, /* bracketright */ 74 | {0x00, 0x04, 0x02, 0x04, 0x00}, /* asciicircum */ 75 | {0x40, 0x40, 0x40, 0x40, 0x00}, /* underscore */ 76 | {0x00, 0x02, 0x04, 0x00, 0x00}, /* grave */ 77 | {0x30, 0x48, 0x28, 0x78, 0x00}, /* a */ 78 | {0x7e, 0x48, 0x48, 0x30, 0x00}, /* b */ 79 | {0x30, 0x48, 0x48, 0x00, 0x00}, /* c */ 80 | {0x30, 0x48, 0x48, 0x7e, 0x00}, /* d */ 81 | {0x30, 0x68, 0x58, 0x10, 0x00}, /* e */ 82 | {0x10, 0x7c, 0x12, 0x04, 0x00}, /* f */ 83 | {0x50, 0xa8, 0xa8, 0x98, 0x00}, /* g */ 84 | {0x7e, 0x08, 0x08, 0x70, 0x00}, /* h */ 85 | {0x00, 0x48, 0x7a, 0x40, 0x00}, /* i */ 86 | {0x00, 0x40, 0x80, 0x7a, 0x00}, /* j */ 87 | {0x7e, 0x10, 0x28, 0x40, 0x00}, /* k */ 88 | {0x00, 0x42, 0x7e, 0x40, 0x00}, /* l */ 89 | {0x78, 0x10, 0x18, 0x70, 0x00}, /* m */ 90 | {0x78, 0x08, 0x08, 0x70, 0x00}, /* n */ 91 | {0x30, 0x48, 0x48, 0x30, 0x00}, /* o */ 92 | {0xf8, 0x48, 0x48, 0x30, 0x00}, /* p */ 93 | {0x30, 0x48, 0x48, 0xf8, 0x00}, /* q */ 94 | {0x78, 0x08, 0x08, 0x10, 0x00}, /* r */ 95 | {0x50, 0x58, 0x68, 0x28, 0x00}, /* s */ 96 | {0x08, 0x3e, 0x48, 0x40, 0x00}, /* t */ 97 | {0x38, 0x40, 0x40, 0x78, 0x00}, /* u */ 98 | {0x00, 0x38, 0x40, 0x38, 0x00}, /* v */ 99 | {0x78, 0x60, 0x60, 0x78, 0x00}, /* w */ 100 | {0x48, 0x30, 0x30, 0x48, 0x00}, /* x */ 101 | {0x18, 0xa0, 0x40, 0x38, 0x00}, /* y */ 102 | {0x48, 0x68, 0x58, 0x48, 0x00}, /* z */ 103 | {0x00, 0x08, 0x3c, 0x42, 0x00}, /* braceleft */ 104 | {0x00, 0x00, 0x7e, 0x00, 0x00}, /* bar */ 105 | {0x00, 0x42, 0x3c, 0x08, 0x00}, /* braceright */ 106 | }; 107 | -------------------------------------------------------------------------------- /specan/src/display.c: -------------------------------------------------------------------------------- 1 | /* 2 | * IM-Me display functions 3 | * 4 | * Copyright 2010 Dave 5 | * http://daveshacks.blogspot.com/2010/01/im-me-lcd-interface-hacked.html 6 | * 7 | * Copyright 2010 Michael Ossmann 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, 22 | * Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | #include 26 | #include "ioCCxx10_bitdef.h" 27 | #include "display.h" 28 | #include "bits.h" 29 | #include "types.h" 30 | #include "5x7.h" 31 | 32 | void sleepMillis(int ms) { 33 | int j; 34 | while (--ms > 0) { 35 | for (j=0; j<1200;j++); // about 1 millisecond 36 | }; 37 | } 38 | 39 | void xtalClock() { // Set system clock source to 26 Mhz 40 | SLEEP &= ~SLEEP_OSC_PD; // Turn both high speed oscillators on 41 | while( !(SLEEP & SLEEP_XOSC_S) ); // Wait until xtal oscillator is stable 42 | CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz 43 | while (CLKCON & CLKCON_OSC); // Wait for change to take effect 44 | SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc) 45 | } 46 | 47 | void setIOPorts() { 48 | //No need to set PERCFG or P2DIR as default values on reset are fine 49 | P0SEL |= (BIT5 | BIT3 ); // set SCK and MOSI as peripheral outputs 50 | P0DIR |= BIT4 | BIT2; // set SSN and A0 as outputs 51 | P1DIR |= BIT1; // set LCDRst as output 52 | P2DIR = BIT3 | BIT4; // set LEDs as outputs 53 | //LED_GREEN = LOW; // Turn the Green LED on (LEDs driven by reverse logic: 0 is ON) 54 | } 55 | 56 | // Set a clock rate of approx. 2.5 Mbps for 26 MHz Xtal clock 57 | #define SPI_BAUD_M 170 58 | #define SPI_BAUD_E 16 59 | 60 | void configureSPI() { 61 | U0CSR = 0; //Set SPI Master operation 62 | U0BAUD = SPI_BAUD_M; // set Mantissa 63 | U0GCR = U0GCR_ORDER | SPI_BAUD_E; // set clock on 1st edge, -ve clock polarity, MSB first, and exponent 64 | } 65 | void tx(unsigned char ch) { 66 | U0DBUF = ch; 67 | while(!(U0CSR & U0CSR_TX_BYTE)); // wait for byte to be transmitted 68 | U0CSR &= ~U0CSR_TX_BYTE; // Clear transmit byte status 69 | } 70 | 71 | void txData(unsigned char ch) { 72 | A0 = HIGH; 73 | tx(ch); 74 | } 75 | 76 | void txCtl(unsigned char ch){ 77 | A0 = LOW; 78 | tx(ch); 79 | } 80 | 81 | void LCDReset(void) { 82 | LCDRst = LOW; // hold down the RESET line to reset the display 83 | sleepMillis(1); 84 | LCDRst = HIGH; 85 | SSN = LOW; 86 | /* initialization sequence from sniffing factory firmware */ 87 | txCtl(RESET); 88 | txCtl(SET_REG_RESISTOR); 89 | txCtl(VOLUME_MODE_SET); 90 | txCtl(0x60); /* contrast */ 91 | txCtl(DC_DC_CLOCK_SET); 92 | txCtl(0x00); /* fOSC (no division) */ 93 | txCtl(POWER_SUPPLY_ON); 94 | txCtl(ADC_REVERSE); 95 | txCtl(DISPLAY_ON); 96 | txCtl(ALL_POINTS_NORMAL); 97 | SSN = HIGH; 98 | } 99 | 100 | /* initiate sleep mode */ 101 | void LCDPowerSave() { 102 | txCtl(STATIC_INDIC_OFF); 103 | txCtl(DISPLAY_OFF); 104 | txCtl(ALL_POINTS_ON); // Display all Points on cmd = Power Save when following LCD off 105 | } 106 | 107 | void setCursor(unsigned char row, unsigned char col) { 108 | txCtl(SET_ROW | (row & 0x0f)); 109 | txCtl(SET_COL_LO | (col & 0x0f)); 110 | txCtl(SET_COL_HI | ( (col>>4) & 0x0f)); 111 | } 112 | 113 | void setDisplayStart(unsigned char start) { 114 | txCtl(0x40 | (start & 0x3f)); // set Display start address 115 | } 116 | 117 | void setNormalReverse(unsigned char normal) { // 0 = Normal, 1 = Reverse 118 | txCtl(DISPLAY_NORMAL | (normal & 0x01) ); 119 | } 120 | 121 | /* clear all LCD pixels */ 122 | void clear() { 123 | u8 row; 124 | u8 col; 125 | 126 | SSN = LOW; 127 | setDisplayStart(0); 128 | 129 | /* normal display mode (not inverted) */ 130 | setNormalReverse(0); 131 | 132 | for (row = 0; row <= 9; row++) { 133 | setCursor(row, 0); 134 | for (col = 0; col < WIDTH; col++) 135 | txData(0x00); 136 | } 137 | 138 | SSN = HIGH; 139 | } 140 | 141 | /* sdcc provides printf if we provide this */ 142 | void putchar(char c) { 143 | u8 i; 144 | 145 | c &= 0x7f; 146 | 147 | if (c >= FONT_OFFSET) { 148 | for (i = 0; i < FONT_WIDTH; i++) 149 | txData(font[c - FONT_OFFSET][i]); 150 | txData(0x00); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /garage/opensesame/display.c: -------------------------------------------------------------------------------- 1 | /* 2 | * IM-Me display functions 3 | * 4 | * Copyright 2010 Dave 5 | * http://daveshacks.blogspot.com/2010/01/im-me-lcd-interface-hacked.html 6 | * 7 | * Copyright 2010 Michael Ossmann 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, 22 | * Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | #include 26 | #include "ioCCxx10_bitdef.h" 27 | #include "display.h" 28 | #include "bits.h" 29 | #include "types.h" 30 | #include "5x7.h" 31 | 32 | void sleepMillis(int ms) { 33 | int j; 34 | while (--ms > 0) { 35 | for (j=0; j<1200;j++); // about 1 millisecond 36 | }; 37 | } 38 | 39 | void xtalClock() { // Set system clock source to 26 Mhz 40 | SLEEP &= ~SLEEP_OSC_PD; // Turn both high speed oscillators on 41 | while( !(SLEEP & SLEEP_XOSC_S) ); // Wait until xtal oscillator is stable 42 | CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz 43 | while (CLKCON & CLKCON_OSC); // Wait for change to take effect 44 | SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc) 45 | } 46 | 47 | void setIOPorts() { 48 | //No need to set PERCFG or P2DIR as default values on reset are fine 49 | P0SEL |= (BIT5 | BIT3 ); // set SCK and MOSI as peripheral outputs 50 | P0DIR |= BIT4 | BIT2; // set SSN and A0 as outputs 51 | P1DIR |= BIT1; // set LCDRst as output 52 | P2DIR = BIT3 | BIT4; // set LEDs as outputs 53 | //LED_GREEN = LOW; // Turn the Green LED on (LEDs driven by reverse logic: 0 is ON) 54 | } 55 | 56 | // Set a clock rate of approx. 2.5 Mbps for 26 MHz Xtal clock 57 | #define SPI_BAUD_M 170 58 | #define SPI_BAUD_E 16 59 | 60 | void configureSPI() { 61 | U0CSR = 0; //Set SPI Master operation 62 | U0BAUD = SPI_BAUD_M; // set Mantissa 63 | U0GCR = U0GCR_ORDER | SPI_BAUD_E; // set clock on 1st edge, -ve clock polarity, MSB first, and exponent 64 | } 65 | void tx(unsigned char ch) { 66 | U0DBUF = ch; 67 | while(!(U0CSR & U0CSR_TX_BYTE)); // wait for byte to be transmitted 68 | U0CSR &= ~U0CSR_TX_BYTE; // Clear transmit byte status 69 | } 70 | 71 | void txData(unsigned char ch) { 72 | A0 = HIGH; 73 | tx(ch); 74 | } 75 | 76 | void txCtl(unsigned char ch){ 77 | A0 = LOW; 78 | tx(ch); 79 | } 80 | 81 | void LCDReset(void) { 82 | LCDRst = LOW; // hold down the RESET line to reset the display 83 | sleepMillis(1); 84 | LCDRst = HIGH; 85 | SSN = LOW; 86 | /* initialization sequence from sniffing factory firmware */ 87 | txCtl(RESET); 88 | txCtl(SET_REG_RESISTOR); 89 | txCtl(VOLUME_MODE_SET); 90 | txCtl(0x60); /* contrast */ 91 | txCtl(DC_DC_CLOCK_SET); 92 | txCtl(0x00); /* fOSC (no division) */ 93 | txCtl(POWER_SUPPLY_ON); 94 | txCtl(ADC_REVERSE); 95 | txCtl(DISPLAY_ON); 96 | txCtl(ALL_POINTS_NORMAL); 97 | SSN = HIGH; 98 | } 99 | 100 | /* initiate sleep mode */ 101 | void LCDPowerSave() { 102 | txCtl(STATIC_INDIC_OFF); 103 | txCtl(DISPLAY_OFF); 104 | txCtl(ALL_POINTS_ON); // Display all Points on cmd = Power Save when following LCD off 105 | } 106 | 107 | void setCursor(unsigned char row, unsigned char col) { 108 | txCtl(SET_ROW | (row & 0x0f)); 109 | txCtl(SET_COL_LO | (col & 0x0f)); 110 | txCtl(SET_COL_HI | ( (col>>4) & 0x0f)); 111 | } 112 | 113 | void setDisplayStart(unsigned char start) { 114 | txCtl(0x40 | (start & 0x3f)); // set Display start address 115 | } 116 | 117 | void setNormalReverse(unsigned char normal) { // 0 = Normal, 1 = Reverse 118 | txCtl(DISPLAY_NORMAL | (normal & 0x01) ); 119 | } 120 | 121 | /* clear all LCD pixels */ 122 | void clear() { 123 | u8 row; 124 | u8 col; 125 | 126 | SSN = LOW; 127 | setDisplayStart(0); 128 | 129 | /* normal display mode (not inverted) */ 130 | setNormalReverse(0); 131 | 132 | for (row = 0; row <= 9; row++) { 133 | setCursor(row, 0); 134 | for (col = 0; col < WIDTH; col++) 135 | txData(0x00); 136 | } 137 | 138 | SSN = HIGH; 139 | } 140 | 141 | /* sdcc provides printf if we provide this */ 142 | void putchar(char c) { 143 | u8 i; 144 | 145 | c &= 0x7f; 146 | 147 | if (c >= FONT_OFFSET) { 148 | for (i = 0; i < FONT_WIDTH; i++) 149 | txData(font[c - FONT_OFFSET][i]); 150 | txData(0x00); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /iclicker/isniffer/display.c: -------------------------------------------------------------------------------- 1 | /* 2 | * IM-Me display functions 3 | * 4 | * Copyright 2010 Dave 5 | * http://daveshacks.blogspot.com/2010/01/im-me-lcd-interface-hacked.html 6 | * 7 | * Copyright 2010 Michael Ossmann 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2, or (at your option) 12 | * any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, 22 | * Boston, MA 02110-1301, USA. 23 | */ 24 | 25 | #include 26 | #include "ioCCxx10_bitdef.h" 27 | #include "display.h" 28 | #include "bits.h" 29 | #include "types.h" 30 | #include "5x7.h" 31 | 32 | void sleepMillis(int ms) { 33 | int j; 34 | while (--ms > 0) { 35 | for (j=0; j<1200;j++); // about 1 millisecond 36 | }; 37 | } 38 | 39 | void xtalClock() { // Set system clock source to 26 Mhz 40 | SLEEP &= ~SLEEP_OSC_PD; // Turn both high speed oscillators on 41 | while( !(SLEEP & SLEEP_XOSC_S) ); // Wait until xtal oscillator is stable 42 | CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; // Select xtal osc, 26 MHz 43 | while (CLKCON & CLKCON_OSC); // Wait for change to take effect 44 | SLEEP |= SLEEP_OSC_PD; // Turn off the other high speed oscillator (the RC osc) 45 | } 46 | 47 | void setIOPorts() { 48 | //No need to set PERCFG or P2DIR as default values on reset are fine 49 | P0SEL |= (BIT5 | BIT3 ); // set SCK and MOSI as peripheral outputs 50 | P0DIR |= BIT4 | BIT2; // set SSN and A0 as outputs 51 | P1DIR |= BIT1; // set LCDRst as output 52 | P2DIR = BIT3 | BIT4; // set LEDs as outputs 53 | //LED_GREEN = LOW; // Turn the Green LED on (LEDs driven by reverse logic: 0 is ON) 54 | } 55 | 56 | // Set a clock rate of approx. 2.5 Mbps for 26 MHz Xtal clock 57 | #define SPI_BAUD_M 170 58 | #define SPI_BAUD_E 16 59 | 60 | void configureSPI() { 61 | U0CSR = 0; //Set SPI Master operation 62 | U0BAUD = SPI_BAUD_M; // set Mantissa 63 | U0GCR = U0GCR_ORDER | SPI_BAUD_E; // set clock on 1st edge, -ve clock polarity, MSB first, and exponent 64 | } 65 | void tx(unsigned char ch) { 66 | U0DBUF = ch; 67 | while(!(U0CSR & U0CSR_TX_BYTE)); // wait for byte to be transmitted 68 | U0CSR &= ~U0CSR_TX_BYTE; // Clear transmit byte status 69 | } 70 | 71 | void txData(unsigned char ch) { 72 | A0 = HIGH; 73 | tx(ch); 74 | } 75 | 76 | void txCtl(unsigned char ch){ 77 | A0 = LOW; 78 | tx(ch); 79 | } 80 | 81 | void LCDReset(void) { 82 | LCDRst = LOW; // hold down the RESET line to reset the display 83 | sleepMillis(1); 84 | LCDRst = HIGH; 85 | SSN = LOW; 86 | /* initialization sequence from sniffing factory firmware */ 87 | txCtl(RESET); 88 | txCtl(SET_REG_RESISTOR); 89 | txCtl(VOLUME_MODE_SET); 90 | txCtl(0x60); /* contrast */ 91 | txCtl(DC_DC_CLOCK_SET); 92 | txCtl(0x00); /* fOSC (no division) */ 93 | txCtl(POWER_SUPPLY_ON); 94 | txCtl(ADC_REVERSE); 95 | txCtl(DISPLAY_ON); 96 | txCtl(ALL_POINTS_NORMAL); 97 | SSN = HIGH; 98 | } 99 | 100 | /* initiate sleep mode */ 101 | void LCDPowerSave() { 102 | txCtl(STATIC_INDIC_OFF); 103 | txCtl(DISPLAY_OFF); 104 | txCtl(ALL_POINTS_ON); // Display all Points on cmd = Power Save when following LCD off 105 | } 106 | 107 | void setCursor(unsigned char row, unsigned char col) { 108 | txCtl(SET_ROW | (row & 0x0f)); 109 | txCtl(SET_COL_LO | (col & 0x0f)); 110 | txCtl(SET_COL_HI | ( (col>>4) & 0x0f)); 111 | } 112 | 113 | void setDisplayStart(unsigned char start) { 114 | txCtl(0x40 | (start & 0x3f)); // set Display start address 115 | } 116 | 117 | void setNormalReverse(unsigned char normal) { // 0 = Normal, 1 = Reverse 118 | txCtl(DISPLAY_NORMAL | (normal & 0x01) ); 119 | } 120 | 121 | /* clear all LCD pixels */ 122 | void clear() { 123 | u8 row; 124 | u8 col; 125 | 126 | SSN = LOW; 127 | setDisplayStart(0); 128 | 129 | /* normal display mode (not inverted) */ 130 | setNormalReverse(0); 131 | 132 | for (row = 0; row <= 9; row++) { 133 | setCursor(row, 0); 134 | for (col = 0; col < WIDTH; col++) 135 | txData(0x00); 136 | } 137 | 138 | SSN = HIGH; 139 | } 140 | 141 | /* sdcc provides printf if we provide this */ 142 | void putchar(char c) { 143 | u8 i; 144 | 145 | c &= 0x7f; 146 | 147 | if (c >= FONT_OFFSET) { 148 | for (i = 0; i < FONT_WIDTH; i++) 149 | txData(font[c - FONT_OFFSET][i]); 150 | txData(0x00); 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /garage/opensesame/opensesame.c: -------------------------------------------------------------------------------- 1 | #define BAUDRATE 5000 2 | #define FREQ 390000000 // frequency in Hz (390MHz) 3 | #define CC1110 4 | 5 | #include 6 | #include "ioCCxx10_bitdef.h" 7 | #include "display.h" 8 | #include "keys.h" 9 | #include "stdio.h" 10 | #include "helpers.h" 11 | 12 | #define HIBYTE(a) (u8) ((u16)(a) >> 8 ) 13 | #define LOBYTE(a) (u8) (u16)(a) 14 | 15 | #define SET_WORD(regH, regL, word) \ 16 | do { \ 17 | (regH) = HIBYTE( word ); \ 18 | (regL) = LOBYTE( word ); \ 19 | } while (0) 20 | 21 | /* note sdcc wants reverse bit order from datasheet */ 22 | typedef struct { 23 | u8 SRCADDRH; 24 | u8 SRCADDRL; 25 | u8 DESTADDRH; 26 | u8 DESTADDRL; 27 | u8 LENH : 5; 28 | u8 VLEN : 3; 29 | 30 | u8 LENL : 8; 31 | 32 | u8 TRIG : 5; 33 | u8 TMODE : 2; 34 | u8 WORDSIZE : 1; 35 | 36 | u8 PRIORITY : 2; 37 | u8 M8 : 1; 38 | u8 IRQMASK : 1; 39 | u8 DESTINC : 2; 40 | u8 SRCINC : 2; 41 | } DMA_DESC; 42 | 43 | static volatile u8 txdone = 0; 44 | 45 | __xdata DMA_DESC dmaConfig; 46 | 47 | /* raw ook code captured from garage door opener */ 48 | #define LEN 29 49 | __xdata u8 buf[] = { 50 | 0xaa, 0xaa, 0xaa, 0x00, 0x4d, 0x34, 0xd3, 51 | 0x49, 0x36, 0xd2, 0x49, 0xb6, 0xda, 0x6d, 52 | 0x34, 0xdb, 0x69, 0xb4, 0x92, 0x69, 0x36, 53 | 0xda, 0x49, 0x24, 0x92, 0x6d, 0xb6, 0xdb, 0x68 54 | }; 55 | 56 | void setup_dma_tx() 57 | { 58 | //forum guy used high priority and repeated single mode (TMODE = 2) 59 | dmaConfig.PRIORITY = 2; // high priority 60 | dmaConfig.M8 = 0; // not applicable 61 | dmaConfig.IRQMASK = 0; // disable interrupts 62 | dmaConfig.TRIG = 19; // radio 63 | //dmaConfig.TMODE = 0; // single byte mode 64 | dmaConfig.TMODE = 2; // single byte mode 65 | dmaConfig.WORDSIZE = 0; // one byte words; 66 | dmaConfig.VLEN = 0; // use LEN 67 | SET_WORD(dmaConfig.LENH, dmaConfig.LENL, LEN); 68 | 69 | SET_WORD(dmaConfig.SRCADDRH, dmaConfig.SRCADDRL, buf); 70 | SET_WORD(dmaConfig.DESTADDRH, dmaConfig.DESTADDRL, &X_RFD); 71 | dmaConfig.SRCINC = 1; // increment by one 72 | dmaConfig.DESTINC = 0; // do not increment 73 | 74 | SET_WORD(DMA0CFGH, DMA0CFGL, &dmaConfig); 75 | 76 | return; 77 | } 78 | 79 | int main(void) 80 | { 81 | xtalClock(); 82 | setIOPorts(); 83 | configureSPI(); 84 | LCDReset(); 85 | 86 | /* IF setting */ 87 | FSCTRL1 = 0x06; 88 | FSCTRL0 = 0x00; 89 | 90 | /* 390 MHz */ 91 | setFreq(FREQ, &FREQ2, &FREQ1, &FREQ0); 92 | CHANNR = 0x00; 93 | 94 | /* maximum channel bandwidth, 5000 baud */ 95 | setBaud(BAUDRATE, &MDMCFG4, &MDMCFG3); 96 | 97 | /* DC blocking enabled, OOK/ASK */ 98 | MDMCFG2 = 0x30; // no preamble/sync 99 | 100 | /* no FEC, 4 byte preamble, default channel spacing */ 101 | MDMCFG1 = 0x22; 102 | MDMCFG0 = 0xF8; 103 | 104 | FREND1 = 0x56; // Front end RX configuration. 105 | FREND0 = 0x11; // Front end RX configuration. 106 | 107 | /* automatic frequency calibration */ 108 | MCSM0 = 0x14; 109 | //MCSM2 ? 110 | MCSM1 = 0x30; // TXOFF_MODE = IDLE 111 | 112 | FSCAL3 = 0xE9; // Frequency synthesizer calibration. 113 | FSCAL2 = 0x2A; // Frequency synthesizer calibration. 114 | FSCAL1 = 0x00; // Frequency synthesizer calibration. 115 | FSCAL0 = 0x1F; // Frequency synthesizer calibration. 116 | TEST2 = 0x88; // Various test settings. 117 | TEST1 = 0x31; // Various test settings. 118 | TEST0 = 0x0B; // low VCO (we're in the lower 400 band) 119 | 120 | /* no preamble quality check, no address check */ 121 | PKTCTRL1 = 0x04; 122 | 123 | /* no whitening, no CRC, fixed packet length */ 124 | PKTCTRL0 = 0x00; 125 | 126 | /* device address */ 127 | ADDR = 0x11; 128 | 129 | /* packet length in bytes */ 130 | PKTLEN = LEN; 131 | 132 | //PA_TABLE0 = 0x12; 133 | PA_TABLE0 = 0x00; 134 | PA_TABLE1 = 0xC0; 135 | 136 | setup_dma_tx(); 137 | 138 | while (1) { 139 | 140 | clear(); 141 | SSN = LOW; 142 | setCursor(0, 0); 143 | printf("open sesame"); 144 | SSN = HIGH; 145 | 146 | while (getkey() != ' ') 147 | sleepMillis(200); 148 | 149 | SSN = LOW; 150 | setCursor(3, 0); 151 | printf("open!"); 152 | SSN = HIGH; 153 | 154 | EA = 1; // enable interrupts globally 155 | IEN2 |= IEN2_RFIE; // enable RF interrupt 156 | RFIM = RFIM_IM_DONE; // mask IRQ_DONE only 157 | DMAARM |= DMAARM0; // Arm DMA channel 0 158 | RFST = RFST_STX;; 159 | 160 | while (!txdone); 161 | 162 | RFST = RFST_SIDLE; 163 | 164 | sleepMillis(500); 165 | txdone = 0; 166 | } 167 | } 168 | 169 | /* IRQ_DONE interrupt service routine */ 170 | void rf_isr() __interrupt (RF_VECTOR) { 171 | /* clear the interrupt flags */ 172 | RFIF &= ~RFIF_IRQ_DONE; 173 | S1CON &= ~0x03; // Clear the general RFIF interrupt registers 174 | 175 | txdone = 1; 176 | } 177 | -------------------------------------------------------------------------------- /iclicker/iclickertx/iclickertx.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "cc1110-ext.h" 3 | #include "types.h" 4 | 5 | #define HIBYTE(a) (u8) ((u16)(a) >> 8 ) 6 | #define LOBYTE(a) (u8) (u16)(a) 7 | 8 | #define SET_WORD(regH, regL, word) \ 9 | do { \ 10 | (regH) = HIBYTE( word ); \ 11 | (regL) = LOBYTE( word ); \ 12 | } while (0) 13 | 14 | /* note sdcc wants reverse bit order from datasheet */ 15 | typedef struct { 16 | u8 SRCADDRH; 17 | u8 SRCADDRL; 18 | u8 DESTADDRH; 19 | u8 DESTADDRL; 20 | u8 LENH : 5; 21 | u8 VLEN : 3; 22 | 23 | u8 LENL : 8; 24 | 25 | u8 TRIG : 5; 26 | u8 TMODE : 2; 27 | u8 WORDSIZE : 1; 28 | 29 | u8 PRIORITY : 2; 30 | u8 M8 : 1; 31 | u8 IRQMASK : 1; 32 | u8 DESTINC : 2; 33 | u8 SRCINC : 2; 34 | } DMA_DESC; 35 | 36 | /* 37 | * Channels are designated by the user by entering a two letter button code. 38 | * This maps the code to a channel number (905.5 MHz + (250 kHz * n)). 39 | * 40 | * 'DA' 905.5 MHz, channel 0 41 | * 'CC' 907.0 MHz, channel 6 42 | * 'CD' 908.0 MHz, channel 10 43 | * 'DB' 909.0 MHz, channel 14 44 | * 'DD' 910.0 MHz, channel 18 45 | * 'DC' 911.0 MHz, channel 22 46 | * 'AB' 913.0 MHz, channel 30 47 | * 'AC' 914.0 MHz, channel 34 48 | * 'AD' 915.0 MHz, channel 38 49 | * 'BA' 916.0 MHz, channel 42 50 | * 'AA' 917.0 MHz, channel 46 51 | * 'BB' 919.0 MHz, channel 54 52 | * 'BC' 920.0 MHz, channel 58 53 | * 'BD' 921.0 MHz, channel 62 54 | * 'CA' 922.0 MHz, channel 66 55 | * 'CB' 923.0 MHz, channel 70 56 | */ 57 | static const u8 channel_table[4][4] = { {46, 30, 34, 38}, 58 | {42, 54, 58, 62}, 59 | {66, 70, 6, 10}, 60 | {0, 14, 22, 18} }; 61 | 62 | static volatile u8 txdone = 0; 63 | 64 | xdata DMA_DESC dmaConfig; 65 | 66 | /* code captured from iclicker */ 67 | #define LEN 7 68 | xdata u8 buf[] = { 69 | 0xb0, // really a third byte of sync, but cc1110 only allows 2 or 4 70 | 0xaf, 0xa2, 0xbf, 0x5a, 0x2b, 0xa0 //last 5 bits are extraneous 71 | }; 72 | 73 | void setup_dma_tx() 74 | { 75 | dmaConfig.PRIORITY = 2; // high priority 76 | dmaConfig.M8 = 0; // not applicable 77 | dmaConfig.IRQMASK = 0; // disable interrupts 78 | dmaConfig.TRIG = 19; // radio 79 | dmaConfig.TMODE = 0; // single byte mode 80 | dmaConfig.WORDSIZE = 0; // one byte words; 81 | dmaConfig.VLEN = 0; // use LEN 82 | SET_WORD(dmaConfig.LENH, dmaConfig.LENL, LEN); 83 | 84 | SET_WORD(dmaConfig.SRCADDRH, dmaConfig.SRCADDRL, buf); 85 | SET_WORD(dmaConfig.DESTADDRH, dmaConfig.DESTADDRL, &X_RFD); 86 | dmaConfig.SRCINC = 1; // increment by one 87 | dmaConfig.DESTINC = 0; // do not increment 88 | 89 | SET_WORD(DMA0CFGH, DMA0CFGL, &dmaConfig); 90 | 91 | return; 92 | } 93 | 94 | int main(void) 95 | { 96 | SLEEP &= ~SLEEP_OSC_PD; 97 | while( !(SLEEP & SLEEP_XOSC_S) ); 98 | CLKCON = (CLKCON & ~(CLKCON_CLKSPD | CLKCON_OSC)) | CLKSPD_DIV_1; 99 | while (CLKCON & CLKCON_OSC); 100 | SLEEP |= SLEEP_OSC_PD; 101 | 102 | /* IF setting */ 103 | FSCTRL1 = 0x06; 104 | FSCTRL0 = 0x00; 105 | 106 | /* 905.5 MHz */ 107 | FREQ2 = 0x22; 108 | FREQ1 = 0xD3; 109 | FREQ0 = 0xAC; 110 | CHANNR = 0x00; 111 | 112 | /* maximum channel bandwidth (812.5 kHz), 152.34 kbaud */ 113 | MDMCFG4 = 0x1C; 114 | MDMCFG3 = 0x80; 115 | 116 | /* DC blocking enabled, 2-FSK */ 117 | MDMCFG2 = 0x02; // 16/16 bit sync 118 | 119 | /* no FEC, 2 byte preamble, 250 kHz channel spacing */ 120 | MDMCFG1 = 0x03; 121 | MDMCFG0 = 0x3B; 122 | 123 | /* 203 kHz frequency deviation */ 124 | DEVIATN = 0x70; 125 | 126 | FREND1 = 0x56; // Front end RX configuration. 127 | FREND0 = 0x10; // Front end RX configuration. 128 | 129 | /* automatic frequency calibration */ 130 | MCSM0 = 0x14; 131 | MCSM1 = 0x30; // TXOFF_MODE = IDLE 132 | 133 | FSCAL3 = 0xE9; // Frequency synthesizer calibration. 134 | FSCAL2 = 0x2A; // Frequency synthesizer calibration. 135 | FSCAL1 = 0x00; // Frequency synthesizer calibration. 136 | FSCAL0 = 0x1F; // Frequency synthesizer calibration. 137 | TEST2 = 0x88; // Various test settings. 138 | TEST1 = 0x31; // Various test settings. 139 | TEST0 = 0x09; // high VCO (we're in the upper 800/900 band) 140 | PA_TABLE0 = 0xC0; // PA output power setting. 141 | 142 | /* no preamble quality check, no address check */ 143 | PKTCTRL1 = 0x04; 144 | 145 | /* no whitening, no CRC, fixed packet length */ 146 | PKTCTRL0 = 0x00; 147 | 148 | /* packet length in bytes */ 149 | PKTLEN = LEN; 150 | 151 | SYNC1 = 0xB0; 152 | SYNC0 = 0xB0; 153 | 154 | setup_dma_tx(); 155 | 156 | EA = 1; // enable interrupts globally 157 | IEN2 |= IEN2_RFIE; // enable RF interrupt 158 | RFIM = RFIM_IM_DONE; // mask IRQ_DONE only 159 | DMAARM |= DMAARM0; // Arm DMA channel 0 160 | RFST = RFST_STX;; 161 | 162 | while (!txdone); 163 | 164 | RFST = RFST_SIDLE; 165 | while (1); 166 | } 167 | 168 | /* IRQ_DONE interrupt service routine */ 169 | void rf_isr() __interrupt (RF_VECTOR) { 170 | /* clear the interrupt flags */ 171 | RFIF &= ~RFIF_IRQ_DONE; 172 | S1CON &= ~0x03; // Clear the general RFIF interrupt registers 173 | 174 | txdone = 1; 175 | } 176 | -------------------------------------------------------------------------------- /specan/src/specan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | /* 21 | * There is one channel per column of the display. The radio is tuned to one 22 | * channel at a time and RSSI is displayed for that channel. 23 | */ 24 | #define NUM_CHANNELS 132 25 | 26 | /* 27 | * wide mode (default): 44 MHz on screen, 333 kHz per channel 28 | * narrow mode: 6.6 MHz on screen, 50 kHz per channel 29 | */ 30 | #define WIDE 0 31 | #define NARROW 1 32 | #define ULTRAWIDE 2 33 | 34 | /* 35 | * short mode (default): displays RSSI >> 2 36 | * tall mode: displays RSSI 37 | */ 38 | #define SHORT 0 39 | #define TALL 1 40 | 41 | /* vertical scrolling */ 42 | #define SHORT_STEP 16 43 | #define TALL_STEP 4 44 | #define MAX_VSCROLL 208 45 | #define MIN_VSCROLL 0 46 | 47 | /* frequencies in MHz */ 48 | #define DEFAULT_FREQ 915 49 | #define WIDE_STEP 5 50 | #define NARROW_STEP 1 51 | #define ULTRAWIDE_STEP 20 52 | #define WIDE_MARGIN 13 53 | #define NARROW_MARGIN 3 54 | #define ULTRAWIDE_MARGIN 42 55 | 56 | /* frequency bands supported by device */ 57 | #define BAND_300 0 58 | #define BAND_400 1 59 | #define BAND_900 2 60 | 61 | /* band limits in MHz */ 62 | #define MIN_300 281 63 | #define MAX_300 361 64 | #define MIN_400 378 65 | #define MAX_400 481 66 | #define MIN_900 749 67 | #define MAX_900 962 68 | 69 | /* band transition points in MHz */ 70 | #define EDGE_400 369 71 | #define EDGE_900 615 72 | 73 | /* VCO transition points in Hz */ 74 | #define MID_300 318000000 75 | #define MID_400 424000000 76 | #define MID_900 848000000 77 | 78 | /* channel spacing in Hz */ 79 | #define WIDE_SPACING 199952 80 | #define NARROW_SPACING 49988 81 | #define ULTRAWIDE_SPACING 666504 82 | 83 | /* display peaks long enough to be seen (don't set higher than 20) */ 84 | #define PERSIST 16 85 | 86 | /* power button debouncing for wake from sleep */ 87 | #define DEBOUNCE_COUNT 4 88 | #define DEBOUNCE_PERIOD 50 89 | 90 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 91 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 92 | 93 | /* bitmaps */ 94 | static const u8 narrow_ruler[] = { 95 | 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 96 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 97 | 0x3E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 98 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 99 | 0x3E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 100 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 101 | 0x3E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 102 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 103 | 0x3E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 104 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 105 | 0x3E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 106 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 107 | 0x3E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 0x0E, 0x02, 108 | 0xFE, 0x02, 0x0E, 0x02, 0x0E, 0x02 109 | }; 110 | 111 | static const u8 wide_ruler[] = { 112 | 0x02, 113 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 114 | 0x0E, 0x02, 0x02, 0x02, 0x02, 115 | 0xFE, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 116 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 117 | 0x0E, 0x02, 0x02, 0x02, 0x02, 118 | 0x3E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 119 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 120 | 0x0E, 0x02, 0x02, 0x02, 0x02, 121 | 0xFE, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 122 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 123 | 0x0E, 0x02, 0x02, 0x02, 0x02, 124 | 0x3E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 125 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 126 | 0x0E, 0x02, 0x02, 0x02, 0x02, 127 | 0xFE, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 128 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E, 129 | /* extra to accommodate offset starting point */ 130 | 0x02, 0x02, 0x02, 0x02, 131 | 0x0E, 0x02, 0x02, 0x02, 0x02, 132 | 0x3E, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x02, 0x02, 133 | 0x0E, 0x02, 0x02, 0x02, 0x02, 0x0E 134 | }; 135 | 136 | static const u8 ultrawide_ruler[] = { 137 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 138 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 139 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 140 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 141 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 142 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 143 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 144 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 145 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 146 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 147 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 148 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 149 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 150 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 151 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 152 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 153 | 0x0E, 0x02, 0x02, 0x0E, 0x02, 0x02, 154 | 0xFE, 0x02, 0x02, 0x0E, 0x02, 0x02 155 | }; 156 | 157 | /* Keeping track of all this for each channel allows us to tune faster. */ 158 | typedef struct { 159 | /* frequency setting */ 160 | u8 freq2; 161 | u8 freq1; 162 | u8 freq0; 163 | 164 | /* frequency calibration */ 165 | u8 fscal3; 166 | u8 fscal2; 167 | u8 fscal1; 168 | 169 | /* signal strength */ 170 | u8 ss[PERSIST]; 171 | u8 max; 172 | } channel_info; 173 | 174 | void clear(); 175 | void plot(u8 col); 176 | void putchar(char c); 177 | u8 getkey(); 178 | void draw_ruler(); 179 | void draw_freq(); 180 | void radio_setup(); 181 | void set_filter(); 182 | void set_radio_freq(u32 freq); 183 | void calibrate_freq(u32 freq, u8 ch); 184 | u16 set_center_freq(u16 freq); 185 | void tune(u8 ch); 186 | void set_width(u8 w); 187 | void poll_keyboard(); 188 | void main(void); 189 | -------------------------------------------------------------------------------- /iclicker/isniffer/isniffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "ioCCxx10_bitdef.h" 22 | #include "display.h" 23 | #include "keys.h" 24 | #include "5x7.h" 25 | #include "stdio.h" 26 | #include "isniffer.h" 27 | #include "pm.h" 28 | 29 | /* globals */ 30 | bit sleepy; 31 | static volatile u8 rxdone = 0; 32 | xdata DMA_DESC dmaConfig; 33 | u16 pktcount = 0; 34 | 35 | //#define NUM_CLICKERS 100 36 | //xdata clicker clicker_table[NUM_CLICKERS]; 37 | 38 | #define LEN 9 39 | xdata u8 rxbuf[LEN]; 40 | 41 | void setup_dma_rx() 42 | { 43 | dmaConfig.PRIORITY = 2; // high priority 44 | dmaConfig.M8 = 0; // not applicable 45 | dmaConfig.IRQMASK = 0; // disable interrupts 46 | dmaConfig.TRIG = 19; // radio 47 | dmaConfig.TMODE = 0; // single byte mode 48 | dmaConfig.WORDSIZE = 0; // one byte words; 49 | dmaConfig.VLEN = 0; // use LEN 50 | SET_WORD(dmaConfig.LENH, dmaConfig.LENL, LEN); 51 | 52 | SET_WORD(dmaConfig.SRCADDRH, dmaConfig.SRCADDRL, &X_RFD); 53 | SET_WORD(dmaConfig.DESTADDRH, dmaConfig.DESTADDRL, rxbuf); 54 | dmaConfig.SRCINC = 0; // do not increment 55 | dmaConfig.DESTINC = 1; // increment by one 56 | 57 | SET_WORD(DMA0CFGH, DMA0CFGL, &dmaConfig); 58 | 59 | return; 60 | } 61 | 62 | void radio_setup() { 63 | /* IF setting */ 64 | FSCTRL1 = 0x06; 65 | FSCTRL0 = 0x00; 66 | 67 | /* 905.5 MHz */ 68 | FREQ2 = 0x22; 69 | FREQ1 = 0xD3; 70 | FREQ0 = 0xAC; 71 | CHANNR = 0x00; 72 | 73 | /* maximum channel bandwidth (812.5 kHz), 152.34 kbaud */ 74 | MDMCFG4 = 0x1C; 75 | MDMCFG3 = 0x80; 76 | 77 | /* DC blocking enabled, 2-FSK */ 78 | //MDMCFG2 = 0x0l; // 15/16 bit sync 79 | MDMCFG2 = 0x02; // 16/16 bit sync 80 | 81 | /* no FEC, 2 byte preamble, 250 kHz channel spacing */ 82 | MDMCFG1 = 0x03; 83 | MDMCFG0 = 0x3B; 84 | 85 | /* 228.5 kHz frequency deviation */ 86 | //DEVIATN = 0x71; 87 | /* 253.9 kHz frequency deviation */ 88 | DEVIATN = 0x72; 89 | 90 | FREND1 = 0x56; // Front end RX configuration. 91 | FREND0 = 0x10; // Front end RX configuration. 92 | 93 | /* automatic frequency calibration */ 94 | MCSM0 = 0x14; 95 | MCSM1 = 0x30; // TXOFF_MODE = IDLE 96 | 97 | FSCAL3 = 0xE9; // Frequency synthesizer calibration. 98 | FSCAL2 = 0x2A; // Frequency synthesizer calibration. 99 | FSCAL1 = 0x00; // Frequency synthesizer calibration. 100 | FSCAL0 = 0x1F; // Frequency synthesizer calibration. 101 | TEST2 = 0x88; // Various test settings. 102 | TEST1 = 0x31; // Various test settings. 103 | TEST0 = 0x09; // high VCO (we're in the upper 800/900 band) 104 | PA_TABLE0 = 0xC0; // PA output power setting. 105 | 106 | /* no preamble quality check, no address check, no append status */ 107 | //PKTCTRL1 = 0x00; 108 | //PKTCTRL1 = 0x84; 109 | /* preamble quality check 2*4=6, address check, append status */ 110 | PKTCTRL1 = 0x45; 111 | 112 | /* no whitening, no CRC, fixed packet length */ 113 | PKTCTRL0 = 0x00; 114 | 115 | /* packet length in bytes */ 116 | PKTLEN = LEN; 117 | 118 | SYNC1 = 0xB0; 119 | SYNC0 = 0xB0; 120 | ADDR = 0xB0; 121 | } 122 | 123 | /* tune the radio to a particular channel */ 124 | void tune(char *channame) { 125 | //FIXME bounds checking 126 | CHANNR = channel_table[channame[0] - 'A'][channame[1] - 'A']; 127 | } 128 | 129 | void poll_keyboard() { 130 | switch (getkey()) { 131 | case ' ': 132 | /* pause */ 133 | while (getkey() == ' '); 134 | while (getkey() != ' ') 135 | sleepMillis(200); 136 | break; 137 | case KPWR: 138 | sleepy = 1; 139 | break; 140 | default: 141 | break; 142 | } 143 | } 144 | 145 | void main(void) { 146 | u16 i; 147 | u8 button; 148 | u32 id; 149 | // just counting all packets for now 150 | u16 count_a = 0; 151 | u16 count_b = 0; 152 | u16 count_c = 0; 153 | u16 count_d = 0; 154 | u16 count_e = 0; 155 | 156 | reset: 157 | sleepy = 0; 158 | 159 | xtalClock(); 160 | setIOPorts(); 161 | configureSPI(); 162 | LCDReset(); 163 | radio_setup(); 164 | tune("AA"); 165 | setup_dma_rx(); 166 | clear(); 167 | 168 | SSN = LOW; 169 | setCursor(0, 0); 170 | printf("isniffer"); 171 | SSN = HIGH; 172 | 173 | while (1) { 174 | EA = 1; // enable interrupts globally 175 | IEN2 |= IEN2_RFIE; // enable RF interrupt 176 | RFIM = RFIM_IM_DONE; // mask IRQ_DONE only 177 | DMAARM |= DMAARM0; // Arm DMA channel 0 178 | RFST = RFST_SRX;; 179 | 180 | while (!rxdone); 181 | rxdone = 0; 182 | pktcount++; 183 | RFST = RFST_SIDLE; 184 | 185 | button = ((rxbuf[4] & 1) << 3) | (rxbuf[5] >> 5); 186 | /* 187 | if ((button != BUTTON_A) 188 | && (button != BUTTON_B) 189 | && (button != BUTTON_C) 190 | && (button != BUTTON_D) 191 | && (button != BUTTON_E)) 192 | continue; 193 | */ 194 | 195 | /* 196 | * What I'm calling an "id" is the entire portion of the packet that is 197 | * common to every packet transmitted by a particular iclicker. It is 198 | * probably the hexadecimal ID printed on the back of the unit encoded 199 | * somehow. 200 | * 201 | * hmmm, one off from byte boundaries - probably wrong 202 | */ 203 | //id = ((u32)rxbuf[1] << 23) | ((u32)rxbuf[2] << 15) 204 | //| ((u32)rxbuf[3] << 7) | ((u32)rxbuf[4] >> 1); 205 | 206 | /* 207 | * we should be only counting one answer for each id, but for now we 208 | * just count every packet 209 | */ 210 | 211 | switch (button) { 212 | case BUTTON_A: 213 | count_a++; 214 | break; 215 | case BUTTON_B: 216 | count_b++; 217 | break; 218 | case BUTTON_C: 219 | count_c++; 220 | break; 221 | case BUTTON_D: 222 | count_d++; 223 | break; 224 | case BUTTON_E: 225 | count_e++; 226 | break; 227 | default: 228 | break; 229 | } 230 | 231 | SSN = LOW; 232 | setCursor(2, 0); 233 | printf("A: %d", count_a); 234 | setCursor(3, 0); 235 | printf("B: %d", count_b); 236 | setCursor(4, 0); 237 | printf("C: %d", count_c); 238 | setCursor(5, 0); 239 | printf("D: %d", count_d); 240 | setCursor(6, 0); 241 | printf("E: %d", count_e); 242 | setCursor(7, 0); 243 | printf("total packets: %d", pktcount); 244 | SSN = HIGH; 245 | } 246 | 247 | while (1) { 248 | poll_keyboard(); 249 | 250 | /* go to sleep (more or less a shutdown) if power button pressed */ 251 | if (sleepy) { 252 | clear(); 253 | sleepMillis(1000); 254 | SSN = LOW; 255 | LCDPowerSave(); 256 | SSN = HIGH; 257 | 258 | while (1) { 259 | sleep(); 260 | 261 | /* power button depressed long enough to wake? */ 262 | sleepy = 0; 263 | for (i = 0; i < DEBOUNCE_COUNT; i++) { 264 | sleepMillis(DEBOUNCE_PERIOD); 265 | if (keyscan() != KPWR) sleepy = 1; 266 | } 267 | if (!sleepy) break; 268 | } 269 | 270 | /* reset on wake */ 271 | goto reset; 272 | } 273 | } 274 | } 275 | 276 | /* IRQ_DONE interrupt service routine */ 277 | void rf_isr() __interrupt (RF_VECTOR) { 278 | /* clear the interrupt flags */ 279 | RFIF &= ~RFIF_IRQ_DONE; 280 | S1CON &= ~0x03; // Clear the general RFIF interrupt registers 281 | 282 | rxdone = 1; 283 | } 284 | -------------------------------------------------------------------------------- /specan/src/specan.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Michael Ossmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2, or (at your option) 7 | * any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #include 21 | #include "ioCCxx10_bitdef.h" 22 | #include "display.h" 23 | #include "keys.h" 24 | #include "stdio.h" 25 | #include "specan.h" 26 | #include "pm.h" 27 | 28 | /* globals */ 29 | xdata channel_info chan_table[NUM_CHANNELS]; 30 | u16 center_freq; 31 | u16 user_freq; 32 | u8 band; 33 | u8 width; 34 | bit max_hold; 35 | bit height; 36 | bit sleepy; 37 | u8 vscroll; 38 | u8 min_chan; 39 | u8 max_chan; 40 | u8 sweep; 41 | u8 persistence; 42 | 43 | /* plot one value of bar chart */ 44 | void plot(u8 col) { 45 | u8 section; 46 | u8 row; 47 | u8 pixels; 48 | u8 s, m; 49 | u8 i; 50 | u8 ss = 0; 51 | 52 | for (i = 0; i < persistence; i++) 53 | ss = MAX(chan_table[col].ss[i], ss); 54 | 55 | SSN = LOW; 56 | setDisplayStart(0); 57 | 58 | if (height == TALL) { 59 | s = MAX((ss - vscroll), 0); 60 | m = MAX((chan_table[col].max - vscroll), 0); 61 | } else { 62 | s = MAX((ss - vscroll) >> 2, 0); 63 | m = MAX((chan_table[col].max - vscroll) >> 2, 0); 64 | } 65 | 66 | for (row = 0; row < 6; row++) { 67 | setCursor(5 - row, col); 68 | section = s - (8 * row); 69 | if (s >= (8 * (row + 1))) 70 | section = 8; 71 | pixels = 0xff << (8 - section); 72 | if (m <= (8 * (row + 1))) 73 | pixels |= (0x01 << ((8 * (row + 1)) - m)); 74 | txData(pixels); 75 | } 76 | 77 | SSN = HIGH; 78 | } 79 | 80 | void draw_ruler() { 81 | u8 col; 82 | u8 offset = 0; 83 | 84 | SSN = LOW; 85 | 86 | switch (width) { 87 | case NARROW: 88 | setCursor(6, 0); 89 | for (col = 0; col < NUM_CHANNELS; col++) 90 | txData(narrow_ruler[col]); 91 | break; 92 | case ULTRAWIDE: 93 | setCursor(6, 0); 94 | for (col = 0; col < NUM_CHANNELS; col++) 95 | txData(ultrawide_ruler[col]); 96 | break; 97 | default: 98 | if (center_freq % 10) 99 | offset = 25; 100 | 101 | setCursor(6, 0); 102 | for (col = 0; col < NUM_CHANNELS; col++) 103 | txData(wide_ruler[col + offset]); 104 | break; 105 | } 106 | 107 | SSN = HIGH; 108 | } 109 | 110 | void draw_freq() { 111 | SSN = LOW; 112 | 113 | switch (width) { 114 | case NARROW: 115 | setCursor(7, 18); 116 | printf("%d", center_freq - 2); 117 | 118 | setCursor(7, 58); 119 | printf("%d", center_freq); 120 | 121 | setCursor(7, 98); 122 | printf("%d", center_freq + 2); 123 | break; 124 | case ULTRAWIDE: 125 | setCursor(7, 13); 126 | printf("%d %d %d %d", 127 | center_freq - 30, 128 | center_freq - 10, 129 | center_freq + 10, 130 | center_freq + 30); 131 | break; 132 | default: 133 | setCursor(7, 8); 134 | printf("%d", center_freq - 10); 135 | 136 | setCursor(7, 58); 137 | printf("%d", center_freq); 138 | 139 | setCursor(7, 108); 140 | printf("%d", center_freq + 10); 141 | break; 142 | } 143 | 144 | if (persistence > 1) { 145 | setCursor(7, 126); 146 | printf("P"); 147 | } 148 | 149 | SSN = HIGH; 150 | } 151 | 152 | void radio_setup() { 153 | /* IF of 457.031 kHz */ 154 | FSCTRL1 = 0x12; 155 | FSCTRL0 = 0x00; 156 | 157 | /* disable 3 highest DVGA settings */ 158 | AGCCTRL2 |= AGCCTRL2_MAX_DVGA_GAIN; 159 | 160 | /* frequency synthesizer calibration */ 161 | FSCAL3 = 0xEA; 162 | FSCAL2 = 0x2A; 163 | FSCAL1 = 0x00; 164 | FSCAL0 = 0x1F; 165 | 166 | /* "various test settings" */ 167 | TEST2 = 0x88; 168 | TEST1 = 0x31; 169 | TEST0 = 0x09; 170 | 171 | /* no automatic frequency calibration */ 172 | MCSM0 = 0; 173 | } 174 | 175 | /* set the channel bandwidth */ 176 | void set_filter() { 177 | /* channel spacing should fit within 80% of channel filter bandwidth */ 178 | switch (width) { 179 | case NARROW: 180 | MDMCFG4 = 0xEC; /* 67.708333 kHz */ 181 | break; 182 | case ULTRAWIDE: 183 | MDMCFG4 = 0x0C; /* 812.5 kHz */ 184 | break; 185 | default: 186 | MDMCFG4 = 0x6C; /* 270.833333 kHz */ 187 | break; 188 | } 189 | } 190 | 191 | /* set the radio frequency in Hz */ 192 | void set_radio_freq(u32 freq) { 193 | /* the frequency setting is in units of 396.728515625 Hz */ 194 | u32 setting = (u32) (freq * .0025206154); 195 | FREQ2 = (setting >> 16) & 0xff; 196 | FREQ1 = (setting >> 8) & 0xff; 197 | FREQ0 = setting & 0xff; 198 | 199 | if ((band == BAND_300 && freq < MID_300) || 200 | (band == BAND_400 && freq < MID_400) || 201 | (band == BAND_900 && freq < MID_900)) 202 | /* select low VCO */ 203 | FSCAL2 = 0x0A; 204 | else 205 | /* select high VCO */ 206 | FSCAL2 = 0x2A; 207 | } 208 | 209 | /* freq in Hz */ 210 | void calibrate_freq(u32 freq, u8 ch) { 211 | set_radio_freq(freq); 212 | 213 | RFST = RFST_SCAL; 214 | RFST = RFST_SRX; 215 | 216 | /* wait for calibration */ 217 | sleepMillis(2); 218 | 219 | /* store frequency/calibration settings */ 220 | chan_table[ch].freq2 = FREQ2; 221 | chan_table[ch].freq1 = FREQ1; 222 | chan_table[ch].freq0 = FREQ0; 223 | chan_table[ch].fscal3 = FSCAL3; 224 | chan_table[ch].fscal2 = FSCAL2; 225 | chan_table[ch].fscal1 = FSCAL1; 226 | 227 | /* get initial RSSI measurement */ 228 | chan_table[ch].ss[sweep] = (RSSI ^ 0x80); 229 | chan_table[ch].max = 0; 230 | 231 | RFST = RFST_SIDLE; 232 | } 233 | 234 | #define UPPER(a, b, c) ((((a) - (b) + ((c) / 2)) / (c)) * (c)) 235 | #define LOWER(a, b, c) ((((a) + (b)) / (c)) * (c)) 236 | 237 | /* set the center frequency in MHz */ 238 | u16 set_center_freq(u16 freq) { 239 | u8 new_band; 240 | u32 spacing; 241 | u32 hz; 242 | u32 min_hz; 243 | u32 max_hz; 244 | u8 margin; 245 | u8 step; 246 | u16 upper_limit; 247 | u16 lower_limit; 248 | u16 next_up; 249 | u16 next_down; 250 | u8 next_band_up; 251 | u8 next_band_down; 252 | u8 i; 253 | 254 | switch (width) { 255 | case NARROW: 256 | margin = NARROW_MARGIN; 257 | step = NARROW_STEP; 258 | spacing = NARROW_SPACING; 259 | break; 260 | case ULTRAWIDE: 261 | margin = ULTRAWIDE_MARGIN; 262 | step = ULTRAWIDE_STEP; 263 | spacing = ULTRAWIDE_SPACING; 264 | 265 | /* nearest 20 MHz step */ 266 | freq = ((freq + 10) / 20) * 20; 267 | break; 268 | default: 269 | margin = WIDE_MARGIN; 270 | step = WIDE_STEP; 271 | spacing = WIDE_SPACING; 272 | 273 | /* nearest 5 MHz step */ 274 | freq = ((freq + 2) / 5) * 5; 275 | break; 276 | } 277 | 278 | /* handle cases near edges of bands */ 279 | if (freq > EDGE_900) { 280 | new_band = BAND_900; 281 | upper_limit = UPPER(MAX_900, margin, step); 282 | lower_limit = LOWER(MIN_900, margin, step); 283 | next_up = LOWER(MIN_300, margin, step); 284 | next_down = UPPER(MAX_400, margin, step); 285 | next_band_up = BAND_300; 286 | next_band_down = BAND_400; 287 | } else if (freq > EDGE_400) { 288 | new_band = BAND_400; 289 | upper_limit = UPPER(MAX_400, margin, step); 290 | lower_limit = LOWER(MIN_400, margin, step); 291 | next_up = LOWER(MIN_900, margin, step); 292 | next_down = UPPER(MAX_300, margin, step); 293 | next_band_up = BAND_900; 294 | next_band_down = BAND_300; 295 | } else { 296 | new_band = BAND_300; 297 | upper_limit = UPPER(MAX_300, margin, step); 298 | lower_limit = LOWER(MIN_300, margin, step); 299 | next_up = LOWER(MIN_400, margin, step); 300 | next_down = UPPER(MAX_900, margin, step); 301 | next_band_up = BAND_400; 302 | next_band_down = BAND_900; 303 | } 304 | 305 | if (freq > upper_limit) { 306 | freq = upper_limit; 307 | if (new_band == band) { 308 | new_band = next_band_up; 309 | freq = next_up; 310 | } 311 | } else if (freq < lower_limit) { 312 | freq = lower_limit; 313 | if (new_band == band) { 314 | new_band = next_band_down; 315 | freq = next_down; 316 | } 317 | } 318 | 319 | band = new_band; 320 | 321 | /* doing everything in Hz from here on */ 322 | switch (band) { 323 | case BAND_400: 324 | min_hz = MIN_400 * 1000000; 325 | max_hz = MAX_400 * 1000000; 326 | break; 327 | case BAND_300: 328 | min_hz = MIN_300 * 1000000; 329 | max_hz = MAX_300 * 1000000; 330 | break; 331 | default: 332 | min_hz = MIN_900 * 1000000; 333 | max_hz = MAX_900 * 1000000; 334 | break; 335 | } 336 | 337 | /* calibrate upper channels */ 338 | hz = freq * 1000000; 339 | max_chan = NUM_CHANNELS / 2; 340 | while (hz <= max_hz && max_chan < NUM_CHANNELS) { 341 | calibrate_freq(hz, max_chan); 342 | hz += spacing; 343 | for (i = 0; i < persistence; i++) 344 | chan_table[max_chan].ss[i] = 0; 345 | max_chan++; 346 | } 347 | 348 | /* calibrate lower channels */ 349 | hz = freq * 1000000 - spacing; 350 | min_chan = NUM_CHANNELS / 2; 351 | while (hz >= min_hz && min_chan > 0) { 352 | min_chan--; 353 | calibrate_freq(hz, min_chan); 354 | for (i = 0; i < persistence; i++) 355 | chan_table[min_chan].ss[i] = 0; 356 | hz -= spacing; 357 | } 358 | 359 | center_freq = freq; 360 | clear(); 361 | draw_ruler(); 362 | draw_freq(); 363 | max_hold = 0; 364 | 365 | return freq; 366 | } 367 | 368 | /* tune the radio using stored calibration */ 369 | void tune(u8 ch) { 370 | FREQ2 = chan_table[ch].freq2; 371 | FREQ1 = chan_table[ch].freq1; 372 | FREQ0 = chan_table[ch].freq0; 373 | 374 | FSCAL3 = chan_table[ch].fscal3; 375 | FSCAL2 = chan_table[ch].fscal2; 376 | FSCAL1 = chan_table[ch].fscal1; 377 | } 378 | 379 | void set_width(u8 w) { 380 | width = w; 381 | set_filter(); 382 | set_center_freq(center_freq); 383 | } 384 | 385 | void poll_keyboard() { 386 | u8 vstep; 387 | u8 hstep; 388 | 389 | vstep = (height == TALL) ? TALL_STEP : SHORT_STEP; 390 | 391 | switch (width) { 392 | case NARROW: 393 | hstep = NARROW_STEP; 394 | break; 395 | case ULTRAWIDE: 396 | hstep = ULTRAWIDE_STEP; 397 | break; 398 | default: 399 | hstep = WIDE_STEP; 400 | break; 401 | } 402 | 403 | switch (getkey()) { 404 | case 'W': 405 | set_width(WIDE); 406 | break; 407 | case 'N': 408 | set_width(NARROW); 409 | break; 410 | case 'U': 411 | set_width(ULTRAWIDE); 412 | break; 413 | case KMNU: 414 | switch (width) { 415 | case WIDE: 416 | set_width(NARROW); 417 | break; 418 | case NARROW: 419 | set_width(ULTRAWIDE); 420 | break; 421 | default: 422 | set_width(WIDE); 423 | break; 424 | } 425 | break; 426 | case 'T': 427 | height = TALL; 428 | break; 429 | case 'S': 430 | height = SHORT; 431 | break; 432 | case KBYE: 433 | height = !height; 434 | break; 435 | case '>': 436 | user_freq += hstep; 437 | break; 438 | case '<': 439 | user_freq -= hstep; 440 | break; 441 | case '^': 442 | case 'Q': 443 | vscroll = MIN(vscroll + vstep, MAX_VSCROLL); 444 | break; 445 | case KDWN: 446 | case 'A': 447 | vscroll = MAX(vscroll - vstep, MIN_VSCROLL); 448 | break; 449 | case 'M': 450 | max_hold = !max_hold; 451 | break; 452 | case ' ': 453 | /* pause */ 454 | while (getkey() == ' '); 455 | while (getkey() != ' ') 456 | sleepMillis(200); 457 | break; 458 | case 'P': 459 | if (persistence == 1) 460 | persistence = PERSIST; 461 | else 462 | persistence = 1; 463 | set_center_freq(center_freq); 464 | sweep %= persistence; 465 | break; 466 | case KPWR: 467 | sleepy = 1; 468 | break; 469 | default: 470 | break; 471 | } 472 | } 473 | 474 | void main(void) { 475 | u8 ch; 476 | u16 i; 477 | 478 | reset: 479 | center_freq = DEFAULT_FREQ; 480 | user_freq = DEFAULT_FREQ; 481 | band = BAND_900; 482 | width = WIDE; 483 | max_hold = 0; 484 | height = 0; 485 | sleepy = 0; 486 | vscroll = 0; 487 | min_chan = 0; 488 | max_chan = NUM_CHANNELS - 1; 489 | sweep = 0; 490 | persistence = 1; 491 | 492 | xtalClock(); 493 | setIOPorts(); 494 | configureSPI(); 495 | LCDReset(); 496 | radio_setup(); 497 | set_width(WIDE); 498 | 499 | while (1) { 500 | poll_keyboard(); 501 | 502 | if (user_freq != center_freq) 503 | user_freq = set_center_freq(user_freq); 504 | 505 | /* go to sleep (more or less a shutdown) if power button pressed */ 506 | if (sleepy) { 507 | clear(); 508 | sleepMillis(1000); 509 | SSN = LOW; 510 | LCDPowerSave(); 511 | SSN = HIGH; 512 | 513 | while (1) { 514 | sleep(); 515 | 516 | /* power button depressed long enough to wake? */ 517 | sleepy = 0; 518 | for (i = 0; i < DEBOUNCE_COUNT; i++) { 519 | sleepMillis(DEBOUNCE_PERIOD); 520 | if (keyscan() != KPWR) sleepy = 1; 521 | } 522 | if (!sleepy) break; 523 | } 524 | 525 | /* reset on wake */ 526 | goto reset; 527 | } 528 | 529 | for (ch = min_chan; ch < max_chan; ch++) { 530 | /* tune radio and start RX */ 531 | tune(ch); 532 | RFST = RFST_SRX; 533 | 534 | /* plot previous measurement while waiting for RSSI measurement */ 535 | plot(ch); 536 | 537 | /* measurement needs a bit more time in narrow mode */ 538 | if (width == NARROW) 539 | for (i = 350; i-- ;); 540 | 541 | /* read RSSI */ 542 | chan_table[ch].ss[sweep] = (RSSI ^ 0x80); 543 | if (max_hold) 544 | chan_table[ch].max = MAX(chan_table[ch].ss[sweep], 545 | chan_table[ch].max); 546 | else 547 | chan_table[ch].max = 0; 548 | 549 | /* end RX */ 550 | RFST = RFST_SIDLE; 551 | } 552 | 553 | ++sweep; 554 | sweep %= persistence; 555 | } 556 | } 557 | -------------------------------------------------------------------------------- /garage/garage.grc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Tue Oct 19 13:20:02 2010 4 | 5 | options 6 | 7 | id 8 | top_block 9 | 10 | 11 | _enabled 12 | True 13 | 14 | 15 | title 16 | 17 | 18 | 19 | author 20 | 21 | 22 | 23 | description 24 | 25 | 26 | 27 | window_size 28 | 1280, 1024 29 | 30 | 31 | generate_options 32 | wx_gui 33 | 34 | 35 | category 36 | Custom 37 | 38 | 39 | run_options 40 | prompt 41 | 42 | 43 | run 44 | True 45 | 46 | 47 | realtime_scheduling 48 | 49 | 50 | 51 | _coordinate 52 | (10, 10) 53 | 54 | 55 | _rotation 56 | 0 57 | 58 | 59 | 60 | wxgui_scopesink2 61 | 62 | id 63 | wxgui_scopesink2_0 64 | 65 | 66 | _enabled 67 | False 68 | 69 | 70 | type 71 | complex 72 | 73 | 74 | title 75 | Scope Plot 76 | 77 | 78 | samp_rate 79 | samp_rate 80 | 81 | 82 | v_scale 83 | 0 84 | 85 | 86 | v_offset 87 | 0 88 | 89 | 90 | t_scale 91 | 0 92 | 93 | 94 | ac_couple 95 | False 96 | 97 | 98 | xy_mode 99 | False 100 | 101 | 102 | num_inputs 103 | 1 104 | 105 | 106 | win_size 107 | 108 | 109 | 110 | grid_pos 111 | 112 | 113 | 114 | notebook 115 | 116 | 117 | 118 | _coordinate 119 | (777, 13) 120 | 121 | 122 | _rotation 123 | 0 124 | 125 | 126 | 127 | variable 128 | 129 | id 130 | samp_rate 131 | 132 | 133 | _enabled 134 | True 135 | 136 | 137 | value 138 | 500000 139 | 140 | 141 | _coordinate 142 | (10, 170) 143 | 144 | 145 | _rotation 146 | 0 147 | 148 | 149 | 150 | gr_throttle 151 | 152 | id 153 | gr_throttle_0 154 | 155 | 156 | _enabled 157 | True 158 | 159 | 160 | type 161 | complex 162 | 163 | 164 | samples_per_second 165 | samp_rate 166 | 167 | 168 | vlen 169 | 1 170 | 171 | 172 | _coordinate 173 | (555, 47) 174 | 175 | 176 | _rotation 177 | 0 178 | 179 | 180 | 181 | wxgui_scopesink2 182 | 183 | id 184 | wxgui_scopesink2_1 185 | 186 | 187 | _enabled 188 | True 189 | 190 | 191 | type 192 | float 193 | 194 | 195 | title 196 | Scope Plot 197 | 198 | 199 | samp_rate 200 | samp_rate/25 201 | 202 | 203 | v_scale 204 | 0 205 | 206 | 207 | v_offset 208 | 0 209 | 210 | 211 | t_scale 212 | 0 213 | 214 | 215 | ac_couple 216 | False 217 | 218 | 219 | xy_mode 220 | False 221 | 222 | 223 | num_inputs 224 | 1 225 | 226 | 227 | win_size 228 | 229 | 230 | 231 | grid_pos 232 | 233 | 234 | 235 | notebook 236 | 237 | 238 | 239 | _coordinate 240 | (836, 159) 241 | 242 | 243 | _rotation 244 | 0 245 | 246 | 247 | 248 | gr_complex_to_mag 249 | 250 | id 251 | gr_complex_to_mag_0 252 | 253 | 254 | _enabled 255 | True 256 | 257 | 258 | vlen 259 | 1 260 | 261 | 262 | _coordinate 263 | (174, 146) 264 | 265 | 266 | _rotation 267 | 0 268 | 269 | 270 | 271 | wxgui_scopesink2 272 | 273 | id 274 | wxgui_scopesink2_1_0 275 | 276 | 277 | _enabled 278 | True 279 | 280 | 281 | type 282 | float 283 | 284 | 285 | title 286 | Scope Plot 287 | 288 | 289 | samp_rate 290 | 4800 291 | 292 | 293 | v_scale 294 | 0 295 | 296 | 297 | v_offset 298 | 0 299 | 300 | 301 | t_scale 302 | 0 303 | 304 | 305 | ac_couple 306 | False 307 | 308 | 309 | xy_mode 310 | False 311 | 312 | 313 | num_inputs 314 | 1 315 | 316 | 317 | win_size 318 | 319 | 320 | 321 | grid_pos 322 | 323 | 324 | 325 | notebook 326 | 327 | 328 | 329 | _coordinate 330 | (429, 322) 331 | 332 | 333 | _rotation 334 | 0 335 | 336 | 337 | 338 | gr_correlate_access_code_bb 339 | 340 | id 341 | gr_correlate_access_code_bb_0 342 | 343 | 344 | _enabled 345 | True 346 | 347 | 348 | access_code 349 | 101010101010101010101010000000000 350 | 351 | 352 | threshold 353 | 0 354 | 355 | 356 | _coordinate 357 | (618, 348) 358 | 359 | 360 | _rotation 361 | 0 362 | 363 | 364 | 365 | gr_binary_slicer_fb 366 | 367 | id 368 | gr_binary_slicer_fb_0 369 | 370 | 371 | _enabled 372 | True 373 | 374 | 375 | _coordinate 376 | (429, 417) 377 | 378 | 379 | _rotation 380 | 0 381 | 382 | 383 | 384 | gr_file_sink 385 | 386 | id 387 | gr_file_sink_0 388 | 389 | 390 | _enabled 391 | True 392 | 393 | 394 | file 395 | /tmp/garage.out 396 | 397 | 398 | type 399 | byte 400 | 401 | 402 | vlen 403 | 1 404 | 405 | 406 | _coordinate 407 | (834, 445) 408 | 409 | 410 | _rotation 411 | 0 412 | 413 | 414 | 415 | gr_clock_recovery_mm_xx 416 | 417 | id 418 | gr_clock_recovery_mm_xx_0 419 | 420 | 421 | _enabled 422 | True 423 | 424 | 425 | type 426 | float 427 | 428 | 429 | omega 430 | 4 431 | 432 | 433 | gain_omega 434 | .00765625 435 | 436 | 437 | mu 438 | .32 439 | 440 | 441 | gain_mu 442 | .175 443 | 444 | 445 | omega_relative_limit 446 | .005 447 | 448 | 449 | _coordinate 450 | (176, 342) 451 | 452 | 453 | _rotation 454 | 0 455 | 456 | 457 | 458 | low_pass_filter 459 | 460 | id 461 | low_pass_filter_0 462 | 463 | 464 | _enabled 465 | True 466 | 467 | 468 | type 469 | fir_filter_fff 470 | 471 | 472 | decim 473 | 25 474 | 475 | 476 | interp 477 | 1 478 | 479 | 480 | gain 481 | 1 482 | 483 | 484 | samp_rate 485 | samp_rate 486 | 487 | 488 | cutoff_freq 489 | 4800 490 | 491 | 492 | width 493 | 4800 494 | 495 | 496 | win 497 | firdes.WIN_HAMMING 498 | 499 | 500 | beta 501 | 6.76 502 | 503 | 504 | _coordinate 505 | (348, 150) 506 | 507 | 508 | _rotation 509 | 0 510 | 511 | 512 | 513 | gr_add_const_vxx 514 | 515 | id 516 | gr_add_const_vxx_0 517 | 518 | 519 | _enabled 520 | True 521 | 522 | 523 | type 524 | float 525 | 526 | 527 | const 528 | -10 529 | 530 | 531 | vlen 532 | 1 533 | 534 | 535 | _coordinate 536 | (544, 133) 537 | 538 | 539 | _rotation 540 | 0 541 | 542 | 543 | 544 | gr_multiply_const_vxx 545 | 546 | id 547 | gr_multiply_const_vxx_0 548 | 549 | 550 | _enabled 551 | True 552 | 553 | 554 | type 555 | float 556 | 557 | 558 | const 559 | .1 560 | 561 | 562 | vlen 563 | 1 564 | 565 | 566 | _coordinate 567 | (640, 201) 568 | 569 | 570 | _rotation 571 | 0 572 | 573 | 574 | 575 | gr_pwr_squelch_xx 576 | 577 | id 578 | gr_pwr_squelch_xx_0 579 | 580 | 581 | _enabled 582 | True 583 | 584 | 585 | type 586 | complex 587 | 588 | 589 | threshold 590 | 10 591 | 592 | 593 | alpha 594 | .001 595 | 596 | 597 | ramp 598 | 0 599 | 600 | 601 | gate 602 | True 603 | 604 | 605 | _coordinate 606 | (358, 0) 607 | 608 | 609 | _rotation 610 | 0 611 | 612 | 613 | 614 | gr_file_source 615 | 616 | id 617 | gr_file_source_0 618 | 619 | 620 | _enabled 621 | True 622 | 623 | 624 | file 625 | /tmp/garage.cfile 626 | 627 | 628 | type 629 | complex 630 | 631 | 632 | repeat 633 | True 634 | 635 | 636 | vlen 637 | 1 638 | 639 | 640 | _coordinate 641 | (118, 37) 642 | 643 | 644 | _rotation 645 | 0 646 | 647 | 648 | 649 | gr_file_source_0 650 | gr_pwr_squelch_xx_0 651 | 0 652 | 0 653 | 654 | 655 | gr_pwr_squelch_xx_0 656 | gr_throttle_0 657 | 0 658 | 0 659 | 660 | 661 | gr_throttle_0 662 | wxgui_scopesink2_0 663 | 0 664 | 0 665 | 666 | 667 | gr_complex_to_mag_0 668 | low_pass_filter_0 669 | 0 670 | 0 671 | 672 | 673 | low_pass_filter_0 674 | gr_add_const_vxx_0 675 | 0 676 | 0 677 | 678 | 679 | gr_clock_recovery_mm_xx_0 680 | wxgui_scopesink2_1_0 681 | 0 682 | 0 683 | 684 | 685 | gr_add_const_vxx_0 686 | gr_multiply_const_vxx_0 687 | 0 688 | 0 689 | 690 | 691 | gr_multiply_const_vxx_0 692 | gr_clock_recovery_mm_xx_0 693 | 0 694 | 0 695 | 696 | 697 | gr_multiply_const_vxx_0 698 | wxgui_scopesink2_1 699 | 0 700 | 0 701 | 702 | 703 | gr_clock_recovery_mm_xx_0 704 | gr_binary_slicer_fb_0 705 | 0 706 | 0 707 | 708 | 709 | gr_correlate_access_code_bb_0 710 | gr_file_sink_0 711 | 0 712 | 0 713 | 714 | 715 | gr_binary_slicer_fb_0 716 | gr_correlate_access_code_bb_0 717 | 0 718 | 0 719 | 720 | 721 | gr_throttle_0 722 | gr_complex_to_mag_0 723 | 0 724 | 0 725 | 726 | 727 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin Street, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) 19yy name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /specan/src/COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin Street, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) 19yy name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /iclicker/isniffer/COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 51 Franklin Street, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) 19yy name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /specan/specan.hex: -------------------------------------------------------------------------------- 1 | :040000000200833245 2 | :01000B0032C2 3 | :0100130032BA 4 | :01001B0032B2 5 | :0100230032AA 6 | :01002B0032A2 7 | :01003300329A 8 | :01003B003292 9 | :01004300328A 10 | :01004B003282 11 | :01005300327A 12 | :01005B003272 13 | :01006300326A 14 | :01006B003262 15 | :01007300325A 16 | :03007B00021292DC 17 | :0300DC0002007EA1 18 | :05007E00120E1080FECF 19 | :1000DF0085822D7B00E52D75F017A4FCADF0240073 20 | :1000EF00FEED34F0FF74062EFEE43FFF7800C3E808 21 | :1000FF00952C5016E82EF582E43FF583E0F9C3EB1B 22 | :10010F009940028B0189030880E4C284758200C084 23 | :10011F0003C004C005121067D005D004D00330010E 24 | :10012F005E8B067F00A8287900EEC398FEEF99FF3B 25 | :10013F00C3E49E74808FF063F08095F05007EBC39B 26 | :10014F009528FE80027E008E2EEC2400FFED34F009 27 | :10015F00FA74162FF582E43AF583E0FAFF7E00C3B6 28 | :10016F0098F8EE99F9C3E498748089F063F080955C 29 | :10017F00F05007EAC39528FA80027A0002022BC0DA 30 | :10018F0004C0057E00AF287800EBC39FF9EE98A25C 31 | :10019F00E713C913C9A2E713C913C9FCC3E49974C0 32 | :1001AF00808CF063F08095F0D005D0045015EBC330 33 | :1001BF009FFBEE98A2E713CB13CBA2E713CB13CB86 34 | :1001CF00FE80047B007E008B2EEC2400FCED34F0CF 35 | :1001DF00FD74162CF582E43DF583E0FB7C00C39F94 36 | :1001EF00FDEC98A2E713CD13CDA2E713CD13CDFEEF 37 | :1001FF00C3E49D74808EF063F08095F05018EBC3CC 38 | :10020F009FFFEC98F88F03A2E713CB13CBA2E71352 39 | :10021F00CB13CBFC80047B007C008B027B00BB06E6 40 | :10022F000040030202EA7405C39BF582852D08C0C6 41 | :10023F0002C00312103AD003D002EBC40354F8FCEF 42 | :10024F00E52EC39CFC8B057E000DBD00010EEEC498 43 | :10025F000354F8CDC403CD6DCD54F8CD6DFEAF2E44 44 | :10026F007800C3EF9DE864808EF063F08095F040D6 45 | :10027F00027C087408C39CF5F005F074FF8002251A 46 | :10028F00E0D5F0FBFC8B057E000DBD00010EEEC42A 47 | :10029F000354F8CDC403CD6DCD54F8CD6DFE8A0750 48 | :1002AF007800C3ED9FEE648088F063F08095F04096 49 | :1002BF0019EB04C40354F8FDC39AF5F005F074016B 50 | :1002CF00800225E0D5F0FBFD42048C82C002C00302 51 | :1002DF00120FD3D003D0020B02022DD284227A0048 52 | :1002EF00C2847401B5270280077402B527478024A2 53 | :1002FF0075080075820612103A7B00BB840040031C 54 | :10030F0002038CEB901C8A93F582C003120FD3D09B 55 | :10031F00030B80E775080075820612103A7B00BB4D 56 | :10032F0084005059EB901DAB93F582C003120FD38D 57 | :10033F00D0030B80EA750E0AE4F50F852282852320 58 | :10034F0083C002121569E5828583F0D00245F06003 59 | :10035F00027A19750800758206C00212103AD0028F 60 | :10036F007B00BB84005016EA2B901D0E93F582C0C4 61 | :10037F0002C003120FD3D003D0020B80E5D2842228 62 | :10038F00C2847401B52702800B7402B527030204DF 63 | :10039F001F02047575081275820712103AE52224A0 64 | :1003AF00FEFAE52334FFFBC002C003742FC0E074D4 65 | :1003BF001EC0E07480C0E0121629E58124FBF58190 66 | :1003CF0075083A75820712103AC022C023742FC0E5 67 | :1003DF00E0741EC0E07480C0E0121629E58124FB92 68 | :1003EF00F58175086275820712103A74022522FA98 69 | :1003FF00E43523FBC002C003742FC0E0741EC0E0BD 70 | :10040F007480C0E0121629E58124FBF5810204EE09 71 | :10041F0075080D75820712103A741E2522FAE435FD 72 | :10042F0023FB740A2522FCE43523FDE52224F6FE86 73 | :10043F00E52334FFFFE52224E2F8E52334FFF9C07A 74 | :10044F0002C003C004C005C006C007C000C00174CD 75 | :10045F0032C0E0741EC0E07480C0E0121629E5813E 76 | :10046F0024F5F581807975080875820712103AE531 77 | :10047F002224F6FAE52334FFFBC002C003742FC019 78 | :10048F00E0741EC0E07480C0E0121629E58124FBE1 79 | :10049F00F58175083A75820712103AC022C023748D 80 | :1004AF002FC0E0741EC0E07480C0E0121629E581F1 81 | :1004BF0024FBF58175086C75820712103A740A25B2 82 | :1004CF0022FAE43523FBC002C003742FC0E0741E70 83 | :1004DF00C0E07480C0E0121629E58124FBF581E5A8 84 | :1004EF002C24FE501E75087E75820712103A744137 85 | :1004FF00C0E0741EC0E07480C0E01216291581158B 86 | :10050F00811581D2842290DF077412F090DF08E406 87 | :10051F00F090DF17E044C0F090DF1C74EAF090DF3A 88 | :10052F001D742AF090DF1EE4F090DF1F741FF0900F 89 | :10053F00DF237488F090DF247431F090DF25740985 90 | :10054F00F090DF14E4F0227401B5270280077402E3 91 | :10055F00B52710800790DF0C74ECF02290DF0C743D 92 | :10056F000CF02290DF0C746CF022AA82AB83ACF0FB 93 | :10057F00FDC002C003C004C005121492AE82AF8347 94 | :10058F00A8F0F9C006C007C000C0019030E975F0AF 95 | :10059F0025743B121398AE82AF83A8F0F9E581243E 96 | :1005AF00FCF5818E828F8388F0E91214A5AE82AF9D 97 | :1005BF0083A8F0D005D004D003D00290DF09E8F073 98 | :1005CF0090DF0AEFF07F007800790090DF0BEEF0FC 99 | :1005DF00E526700FC3EA9480EB944BEC94F4ED9402 100 | :1005EF001240227401B5260CC3EB94BAEC9445ED7E 101 | :1005FF00941940117402B52613C3EB9474EC948BC9 102 | :10060F00ED9432500790DF1D740AF02290DF1D74B5 103 | :10061F002AF02212057975E10175E10290000212AC 104 | :10062F000F75E52F75F017A4FAABF0EA2400FCEB79 105 | :10063F0034F0FD90DF09E08C828D83F0EA2400FA1C 106 | :10064F00EB34F0FB74012AFCE43BFD90DF0AE08CF5 107 | :10065F00828D83F074022AFCE43BFD90DF0BE08C6B 108 | :10066F00828D83F074032AFCE43BFD90DF1CE08C49 109 | :10067F00828D83F074042AFCE43BFD90DF1DE08C37 110 | :10068F00828D83F074052AFCE43BFD90DF1EE08C25 111 | :10069F00828D83F074062AFCE43BFDE52B2CFCE4F1 112 | :1006AF003DFD90DF3AE0FE6306808C828D83EEF095 113 | :1006BF0074162AF582E43BF583E4F075E104228594 114 | :1006CF0082308583317401B5270280077402B52704 115 | :1006DF005080147543037544017533447534C375E5 116 | :1006EF003500753600806F75432A7544147533884D 117 | :1006FF0075342B75350A753600740A2530F582E48A 118 | :10070F003531F583750E14E4F50F12136F85820ED4 119 | :10071F0085830F9000141214DE858230858331801B 120 | :10072F003575430D75440575331075340D753503E7 121 | :10073F00753600853082853183A3A3750E05E4F5E8 122 | :10074F000F12136F85820E85830F9000051214DE32 123 | :10075F00858230858331C37467953074029531403B 124 | :10076F00030208B5753202AC437D0074C2C39CFE10 125 | :10077F0074039DFFE544C313F879002EF582E93F1A 126 | :10078F00F583AE447F008E0E8F0FC004C005C006E8 127 | :10079F00C007C000C001121C0BAA82AB83D001D0CE 128 | :1007AF0000D007D0068E0E8F0F8A828B83C006C0B3 129 | :1007BF0007C000C0011214DE858245858346D00133 130 | :1007CF00D000D007D006D005D00474ED2CF582747C 131 | :1007DF00023DF5838E0E8F0FC004C005C006C00703 132 | :1007EF00C000C001121C0BAA82AB83D001D000D075 133 | :1007FF0007D0068E0E8F0F8A828B83C006C007C06C 134 | :10080F0000C0011214DE858247858348D001D000D5 135 | :10081F00D007D006D005D00474192CF58274013D91 136 | :10082F00F5838E0E8F0FC004C005C006C007C00031 137 | :10083F00C001121C0BAA82AB83D001D000D007D00D 138 | :10084F00068E0E8F0F8A828B83C006C007C000C032 139 | :10085F00011214DEAA82AB83D001D000D007D006DC 140 | :10086F00D005D00474E1C39CFC74019DFDE82CF508 141 | :10087F0082E93DF5838E0E8F0FC002C003C006C004 142 | :10088F0007121C0BAC82AD83D007D0068E0E8F0FD4 143 | :10089F008C828D831214DEAC82AD83D003D0027EA6 144 | :1008AF00007F01020A54C374719530740195314071 145 | :1008BF000302098D753201854349754A0074E1C3FE 146 | :1008CF009549F54B7401954AF54CE544C313F888E7 147 | :1008DF004D754E00E54D254BF582E54E354CF583B4 148 | :1008EF0085444B754C00854B0E854C0F121C0B85A8 149 | :1008FF004B0E854C0F1214DE858245858346747A24 150 | :10090F002549F5827401354AF583854B0E854C0FC9 151 | :10091F00121C0B854B0E854C0F1214DE85824785FA 152 | :10092F00834874ED2549F5827402354AF583854B6A 153 | :10093F000E854C0F121C0B854B0E854C0F1214DEBF 154 | :10094F00AA82AB837469C39549F87401954AF9E596 155 | :10095F004D28F582E54E39F583854B0E854C0FC03A 156 | :10096F0002C003121C0B854B0E854C0F1214DEAC0C 157 | :10097F0082AD83D003D0027E027F00020A5475320B 158 | :10098F000085434D754E007469C3954DF54B740149 159 | :10099F00954EF54CE544C313F88849754A00E5496F 160 | :1009AF00254BF582E54A354CF58385444B754C0054 161 | :1009BF00854B0E854C0F121C0B854B0E854C0F1261 162 | :1009CF0014DE8582458583467419254DF5827401A1 163 | :1009DF00354EF583854B0E854C0F121C0B854B0E38 164 | :1009EF00854C0F1214DE858247858348747A254D16 165 | :1009FF00F5827401354EF583854B0E854C0F121C15 166 | :100A0F000B854B0E854C0F1214DEAA82AB8374C27A 167 | :100A1F00C3954DF87403954EF9E54928F582E54ADB 168 | :100A2F0039F583854B0E854C0FC002C003121C0B8A 169 | :100A3F00854B0E854C0F1214DEAC82AD83D003D0E4 170 | :100A4F00027E017F02C3E5459530E546953150138F 171 | :100A5F00854530854631E526B532248E328A308B76 172 | :100A6F0031801CC3E5309547E531954850118547D6 173 | :100A7F0030854831E526B532068F328C308D318581 174 | :100A8F003226E4B52602801F7401B52634753B80EB 175 | :100A9F00753CD2753D87753E16753F4075407A752A 176 | :100AAF0041AB75421C8032753B40753CB8753DBFFC 177 | :100ABF00753E10753F4075406C75418475421580C9 178 | :100ACF0018753B40753CD5753DA4753E2C753F8020 179 | :100ADF007540F475415675423985300E85310F7565 180 | :100AEF00100075110090424075F00FE41214FBAE28 181 | :100AFF0082AF83A8F0F98E378F388839893A752AF3 182 | :100B0F0042C3E53F9537E5409538E5419539E542D4 183 | :100B1F00953A406E747C252A4068852A2F85378246 184 | :100B2F008538838539F0E53AC006C007C000C0019B 185 | :100B3F00120622D001D000D007D006E5332537F5B5 186 | :100B4F0037E5343538F538E5353539F539E53635A6 187 | :100B5F003AF53A7A00C3EA952C5022E52A75F01738 188 | :100B6F00A42400FB74F035F0FC74062BFBE43CFC72 189 | :100B7F00EA2BF582E43CF583E4F00A80D8052A02DB 190 | :100B8F000B10EEC39533F537EF9534F538E89535FF 191 | :100B9F00F539E99536F53A752942C3E537953BE5C1 192 | :100BAF0038953CE539953DE53A953E405CE5296041 193 | :100BBF0058152985292F8537828538838539F0E5A2 194 | :100BCF003A1206227A00C3EA952C5022E52975F0D5 195 | :100BDF0017A42400FB74F035F0FC74062BFBE43CE7 196 | :100BEF00FCEA2BF582E43CF583E4F00A80D8E53784 197 | :100BFF00C39533F537E5389534F538E5399535F53F 198 | :100C0F0039E53A9536F53A809185302285312312B0 199 | :100C1F0010871202ED12038FC20085308285318357 200 | :100C2F0022E58275F017A4FAABF0EA2400F582EB07 201 | :100C3F0034F0F583E090DF09F0EA2400FAEB34F0AA 202 | :100C4F00FB8A828B83A3E090DF0AF08A828B83A3D7 203 | :100C5F00A3E090DF0BF08A828B83A3A3A3E090DF46 204 | :100C6F001CF08A828B83A3A3A3A3E090DF1DF08ADD 205 | :100C7F00828B83A3A3A3A3A3E090DF1EF022858220 206 | :100C8F00271205568522828523830206CE30010462 207 | :100C9F007A0480027A107401B5270280077402B5B6 208 | :100CAF00270A80047B0180067B1480027B05C0022B 209 | :100CBF00C00312126DAC82D003D002BC0103020E2E 210 | :100CCF000DBC0203020D62BC03028062BC20030252 211 | :100CDF000DD2BC3C03020D74BC3E03020D65BC413A 212 | :100CEF0003020DA6BC4D03020DCFBC4E028033BCD8 213 | :100CFF005003020DEDBC5103020D82BC5302805014 214 | :100D0F00BC54028048BC5502801EBC5702800DBCEB 215 | :100D1F005E03020D82BC8703020DA62275820002BC 216 | :100D2F000C8D758201020C8D758202020C8DE4B55B 217 | :100D3F00270280077401B5270E8006758201020C09 218 | :100D4F008D758202020C8D758200020C8DD20122EC 219 | :100D5F00C20122B201228B047D00EC2524F524ED83 220 | :100D6F003525F525227C00E524C39BF524E5259C3C 221 | :100D7F00F52522AB287C008A057E00ED2BFBEE3C8F 222 | :100D8F00FCC3EB94D0EC648094805006EA2528FBDA 223 | :100D9F0080027BD08B2822AB287C008A057E00EB5B 224 | :100DAF00C39DFBEC9EFCC3E49B74808CF063F080CE 225 | :100DBF0095F05007E528C39AFA80027A008A282214 226 | :100DCF00B2002212126DAA82BA200280F612126DA0 227 | :100DDF00AA82BA2001229000C8120F7580EF740109 228 | :100DEF00B52C05752C108003752C01852282852367 229 | :100DFF00831206CE852CF0E52B8485F02B22D202B0 230 | :100E0F002275229375230375249375250375260286 231 | :100E1F00752700C200C201C202752800752900752E 232 | :100E2F002A83752B00752C01120F9C120FB0120F15 233 | :100E3F00BD120FDD120515758200120C8D120C9C60 234 | :100E4F00E522B52407E523B52502800F8524828589 235 | :100E5F0025831206CE858224858325300242121007 236 | :100E6F00879003E8120F75C284121028D2841212D1 237 | :100E7F009BC2027A047B00900032C002C003120FA3 238 | :100E8F0075121243AC82D003D002BC01028002D291 239 | :100E9F00021ABAFF011BEA4B70DD2002D1020E10BD 240 | :100EAF00AA29C3EA952A4003020F678A82C0021259 241 | :100EBF000C30D00275E1028A82C0021200DFD0022C 242 | :100ECF007401B527117B5E7C018B058C061BBBFF64 243 | :100EDF00011CED4E70F3EA75F017A42400FB74F0BB 244 | :100EEF0035F0FC74062BFDE43CFEE52B2DFDE43EB6 245 | :100EFF00FE90DF3AE0FF6307808D828E83EFF03044 246 | :100F0F00004474162BFDE43CFE74062BFFE43CF802 247 | :100F1F00E52B2FFFE438F88D828E83E0F98F8288DE 248 | :100F2F0083E0FFC3E99F501474062BFFE43CF8E500 249 | :100F3F002B2FF582E438F583E0FF800289078D823D 250 | :100F4F008E83EFF0800B74162BF582E43CF583E46F 251 | :100F5F00F075E1040A020EB1052B852CF0E52B8408 252 | :060F6F0085F02B020E4C80 253 | :101C8A000E020E020E02FE020E020E020E020E02DA 254 | :101C9A003E020E020E020E020E02FE020E020E029A 255 | :101CAA000E020E023E020E020E020E020E02FE028A 256 | :101CBA000E020E020E020E023E020E020E020E026A 257 | :101CCA000E02FE020E020E020E020E023E020E026A 258 | :101CDA000E020E020E02FE020E020E020E020E028A 259 | :101CEA003E020E020E020E020E02FE020E020E024A 260 | :101CFA000E020E023E020E020E020E020E02FE023A 261 | :101D0A000E020E02020E020202020E020202020E6D 262 | :101D1A0002020202FE020202020E020202020E0285 263 | :101D2A000202020E020202020E020202023E020235 264 | :101D3A0002020E020202020E020202020E02020255 265 | :101D4A00020E02020202FE020202020E0202020255 266 | :101D5A000E020202020E020202020E020202023EF9 267 | :101D6A00020202020E020202020E020202020E0225 268 | :101D7A000202020E02020202FE020202020E020225 269 | :101D8A0002020E020202020E020202020E02020205 270 | :101D9A00023E020202020E020202020E02020202C5 271 | :101DAA000E0E02020E0202FE02020E02020E0202D1 272 | :101DBA000E02020E0202FE02020E02020E02020EC1 273 | :101DCA0002020E0202FE02020E02020E02020E02BD 274 | :101DDA00020E0202FE02020E02020E02020E0202AD 275 | :101DEA000E0202FE02020E02020E02020E02020E91 276 | :101DFA000202FE02020E02020E02020E02020E028D 277 | :101E0A0002FE02020E02020E02020E02020E02027C 278 | :101E1A00FE02020E02020E02020E02020E0202FE70 279 | :101E2A0002020E0202256400256420202564202077 280 | :091E3A00256420202564005000FD 281 | :100F7500AA82AB831ABAFF011BC3E49A74808BF073 282 | :100F850063F08095F0500F7CB07D041CBCFF011D03 283 | :100F9500EC4D70F780DE2253BEFBE5BE30E6FB5319 284 | :100FA500C6B8E5C620E6FB43BE042243F32843FD4D 285 | :100FB5001443FE0275FF182275860075C2AA75C511 286 | :100FC50030228582C1E58630E1FB5386FD22D2823F 287 | :100FD500020FC7C282020FC7C291900001120F759E 288 | :100FE500D291C2847582E2120FD8758224120FD86D 289 | :100FF500758281120FD8758260120FD87582E6123C 290 | :101005000FD8758200120FD875822F120FD87582EE 291 | :10101500A1120FD87582AF120FD87582A4120FD8FE 292 | :10102500D284227582AC120FD87582AE120FD87594 293 | :1010350082A5020FD8AA82740F5AF5F074B045F054 294 | :10104500F582120FD8740F5508F582120FD8E508EE 295 | :10105500C4540FFA740F5AF5F0741045F0F5820276 296 | :101065000FD8AA82743F5AF5F0744045F0F5820214 297 | :101075000FD8AA8274015AF5F074A645F0F58202DC 298 | :101085000FD8C2847582001210677582001210771E 299 | :101095007A00EA24F640217508008A82C0021210FF 300 | :1010A5003AD0027B84758200C002C003120FD3D0F0 301 | :1010B50003D002DBF00A80DAD28422AA8253027FAF 302 | :1010C500C3EA648094A04053EA24E0C2D575F005D4 303 | :1010D50030E704B2D5F404A430D50AF42401C5F0F0 304 | :1010E500F43400C5F0FAABF07C00BC05005026EAEC 305 | :1010F5002443FDEB341EFEEC2DF582E43EF583E43E 306 | :1011050093F582C002C003C004120FD3D004D003EC 307 | :0C111500D0020C80D5758200020FD3229E 308 | :101E4300000000000000005E0000000E000E0028ED 309 | :101E53007C287C2808547C542026100864002854CD 310 | :101E630028400000000E0000003C42000000423CFD 311 | :101E73000000005438540010107C101000806020C3 312 | :101E83000010101010000060600000201008040013 313 | :101E9300003C423C0000447E40004462524C00221D 314 | :101EA3004A4A360018147E10002E4A4A32003C4A31 315 | :101EB3004A300002621A0600344A4A34000C525275 316 | :101EC3003C00006C6C0000806C2C00000010284467 317 | :101ED30000282828280000442810000004520C0081 318 | :101EE3003C425A1C007C12127C007E4A4A34003C5D 319 | :101EF300424224007E42423C007E4A4A42007E0A1D 320 | :101F03000A02003C425274007E08087E0000427EB2 321 | :101F130042002040403E007E182442007E40404064 322 | :101F2300007E0C0C7E007E0C307E003C42423C0066 323 | :101F33007E12120C003C6242BC007E12324C002422 324 | :101F43004A52240000027E02003E40403E001E60D2 325 | :101F5300601E007E30307E006618186600000E702A 326 | :101F63000E0062524A4600007E42420004081020DE 327 | :101F7300000042427E000004020400404040400052 328 | :101F8300000204000030482878007E4848300030C2 329 | :101F9300484800003048487E003068581000107CE4 330 | :101FA30012040050A8A898007E0808700000487A20 331 | :101FB30040000040807A007E1028400000427E40AE 332 | :101FC3000078101870007808087000304848300016 333 | :101FD300F848483000304848F800780808100050A6 334 | :101FE30058682800083E48400038404078000038D0 335 | :101FF3004038007860607800483030480018A040CE 336 | :102003003800486858480000083C420000007E0041 337 | :062013000000423C080041 338 | :1011210053FD3D53FE034380C24390FC7A007B0094 339 | :10113100BB0800400302123FEBFC24F84057EB2BA5 340 | :101141002B9011467302115E0211600211680211A7 341 | :1011510070021178021180021188021190803643C9 342 | :10116100FD025380FD802E43FE045390FB802643F5 343 | :10117100FE085390F7801E43FE105390EF801643F4 344 | :10118100FE205390DF800E43FE405390BF80064304 345 | :10119100FE8053907FAD807E00EDF4FDEEF4FEED18 346 | :1011A10030E1027C01AD907E00EDF4FDEEF4FEED48 347 | :1011B10030E2027C02AD907E00EDF4FDEEF4FEED36 348 | :1011C10030E3027C03AD907E00EDF4FDEEF4FEED24 349 | :1011D10030E4027C04AD907E00EDF4FDEEF4FEED12 350 | :1011E10030E5027C05AD907E00EDF4FDEEF4FEED00 351 | :1011F10030E6027C06AD907E00EDF4FDEEF4FEEDEE 352 | :1012010030E7027C07AD807E00EDF4FDEEF4FEEDEB 353 | :1012110030E6027C08AD807E00EDF4FDEEF4FEEDDB 354 | :1012210030E7027C09ECB50302800DEA75F00AA4EF 355 | :101231002C90201993F582220B8B020211317582B9 356 | :101241000022121121AA82C002121121AB82D00206 357 | :10125100EAB503028007121121AA8280EA53FD3DFB 358 | :1012610053FE034380C24390FC8A8222121243E55B 359 | :1012710082FAB5090280048A0980027A008A8222F0 360 | :1020190000004F4B4E4D015000000000594743202E 361 | :102029003C2C033E000000515745525455490000CD 362 | :10203900000041534446484A0000000000825A58B3 363 | :1020490056420000000000008384858600000000DD 364 | :1020590000000002875E00000000000000000A4C3A 365 | :10128100538ABFC2EB758D40439A10438C02D2AF93 366 | :1012910022538ABFC2EB53BEFC3285D50A85D40BDB 367 | :1012A10090FBDC7407F090FBDD7407F090FBDE74BB 368 | :1012B10007F090FBDF7407F090FBE07407F090FB00 369 | :1012C100E17407F090FBE27404F090FBE3E4F0902A 370 | :1012D100FBE4F090FBE574DFF090FBE674BEF09068 371 | :1012E100FBE7E4F090FBE87407F090FBE97420F071 372 | :1012F10090FBEA7442F053BEFBE5BE30E5FBAAC6A3 373 | :1013010074F85AF5F0744145F0F5C6E5C630E6FBD0 374 | :1013110043BE0412128185D50A85D40B43D6817A46 375 | :10132100DC7BFB8B0290FBE3EAF07ADC7BFB90FB3E 376 | :10133100E4EAF07AE37BFB8BD57AE37BFB8AD47515 377 | :10134100D60143C70243BE07000000E5BE54037047 378 | :101351000302135D75D701004387010053C7FD8563 379 | :101361000AD5850BD475D601E5BE30E5FB227A108E 380 | :10137100E4FBFCE58225E0F582E58333F583EB337D 381 | :10138100FBEC33FCEB950EF5F0EC950F4006FCAB56 382 | :10139100F0438201DADD2212143BBC00030215D7AF 383 | :1013A100EF60FA30D502B2D1E583B4FF030215ED47 384 | :1013B100E582B4FF030215ED258340072482400B2B 385 | :1013C1000215D724831450030215EDF582EA8DF03E 386 | :1013D100A4A8F0EA8EF0A428F8E435F0F9EB8DF03A 387 | :1013E100A428E935F0F9E433CA8FF0A429F9EA35E4 388 | :1013F100F0FAEBF88EF0A429F9EA35F0FAE433FBC0 389 | :10140100EC8DF0A429F9EA35F0FAE43BFBE88FF022 390 | :10141100A42AFAEB35F0FBE433CCFD8EF0A42AFAD2 391 | :10142100EB35F0FBE43CFCED8FF0A42BFBEC35F04D 392 | :10143100FC20E7031214690215B6AA82AB83A2F756 393 | :101441003392D16002D2F7F582ACF0E58124F9F84C 394 | :10145100E6FD08E6FE0886F008E6A2F73392D560BD 395 | :0814610002D2F7F583AFF0227F 396 | :0600B200E478FFF6D8FD22 397 | :101469007804EC700DC9CACBFCE58224F8F582D862 398 | :10147900F122782020E7111582C3E933F9EA33FA1A 399 | :09148900EB33FBEC33FCD8EC2240 400 | :100090007900E94400601B7A0090207478EB759336 401 | :1000A000FBE493F2A308B800020593D9F4DAF275E1 402 | :0200B00093FFBC 403 | :10149200FCABF0AA83A982749EC2D1F582121469B0 404 | :1014A2000215B67F9E1214CC30D1030215D7C3EFBA 405 | :1014B2009582500974FFF5F0F583F58222790012C6 406 | :1014C2001C4389828A838BF0EC22AA82AB83A2F727 407 | :1014D2003392D16002D2F7F582ACF022E582850E1A 408 | :1014E200F0A4C582C0F0850FF0A4D0F025F0C5832A 409 | :1014F200850EF0A42583F58322AAF0FBE582850EF2 410 | :10150200F0A4FCADF0E583850EF0A42DFDE435F0EA 411 | :10151200FEE582850FF0A42DFDE5F03EFEE433FFEB 412 | :10152200EA850EF0A42EFEE5F03FFFE583850FF07D 413 | :10153200A42EFEE5F03FFFE5828510F0A42EFEE525 414 | :10154200F03FFFEB850EF0A42FFFEA850FF0A42FEA 415 | :10155200FFE5838510F0A42FFFE5828511F0A42F0B 416 | :101562008EF08D838C8222E50E450F60467A01E56E 417 | :101572000E25E0F50EE50F334012F50FE582950ECC 418 | :10158200E583950F40030A80E6C3E50F13F50FE5E7 419 | :101592000E13F50EC3E582950EF5F0E583950F4027 420 | :1015A20005F58385F082C3E50F13F50FE50E13F5FC 421 | :0415B2000EDAE1224A 422 | :1000B8007800E84400600A79007593F0E4F309D801 423 | :1000C800FC78EBE8440B600C790C90F000E4F0A3AA 424 | :0400D800D8FCD9FA7D 425 | :1015B600B98003EA13B34010EA2401FAE43BFBE4E2 426 | :1015C6003CFC50047C800582BC000EBB000BBA00BC 427 | :1015D60008E4F5F0F583F58222A2D1E582138CF0BA 428 | :1015E60092F78B838A8222E4F583F58275F080F484 429 | :1015F600A2D11322E4F583F58275F0C0747F22C070 430 | :101606000D85810D1210C0D00D2285825E85835F07 431 | :1016160085F060E4F55BF55CF55D850C619016057B 432 | :101626000216E9C00D85810DE50D24FBF561E4F593 433 | :101636005BF55CF55DE50D24FBF8865E08865F08C4 434 | :1016460086609016051216E9D00D22AA82C051C0F6 435 | :1016560052C0537468C0E07416C0E0C04FC0508AD0 436 | :1016660082221581158115810559E4B55902055A5D 437 | :1016760022AA8274302AFA24C6500A74072AFA303B 438 | :1016860003034302208A82021651E582FAC4540FEC 439 | :10169600F582C002121677D002740F5AF58202162E 440 | :1016A6007785820EAB54AC55AD56AE57AF58750F15 441 | :1016B60020EF2FFFEE235401FA4207EB2BFBEC330E 442 | :1016C600FCED33FDEE33FEC3EF950E4008EFC395F8 443 | :1016D6000EFF430301D50FD98B548C558D568E576B 444 | :1016E6008F582285824F858350855B51855C528554 445 | :1016F6005D53E4F559F55AAA5EAB5FAC608A828BFE 446 | :10170600838CF0121BEFFD74012AF55EE43BF55F56 447 | :101716008C60EDFA7003021BD0BA25028003021B0F 448 | :10172600C8C204C205C206C207C208C209C20AC2AA 449 | :101736000B7562007563007DFFAE5EAF5FAB608EBA 450 | :10174600828F838BF0121BEFFAA3AE82AF838E5E7D 451 | :101756008F5F8B60BA25078A8212165180998A0498 452 | :10176600BC3000402A8A04EC24C64023BDFF13E5A2 453 | :101776006375F00AA4FCEA24D02CF56370C1D20587 454 | :1017860080BDED75F00AA4FCEA24D02CFD80B0BA29 455 | :101796002E07BDFFAA7D0080A68A04BC6100400E0C 456 | :1017A6008A04EC248540075302DFD2038002C20379 457 | :1017B600BA20028055BA2B02804BBA2D028041BA5C 458 | :1017C6004202804BBA43028050BA440302197ABAE5 459 | :1017D6004603021990BA490302197ABA4C028034B8 460 | :1017E600BA4F03021981BA5003021911BA53028083 461 | :1017F6004CBA5503021986BA580302198B0219947A 462 | :10180600D204021745D206021745D207021745D25F 463 | :1018160009021745D20A02174530090AE56114F88C 464 | :1018260088618602800FE56124FEF88861860308D8 465 | :101836008604188B028A8212165102199DE56124CC 466 | :10184600FDF88861860308860408860618188B54F6 467 | :101856008C558E568554828555838556F0C0051263 468 | :101866001BD7AB82AC83D005BDFF028B0520042CB1 469 | :10187600C3EB95635026E563C39BF563AC638C06A7 470 | :101886001C8C63EE6014758220C003C004C0051270 471 | :101896001651D005D004D00380E48C638D048554A2 472 | :1018A600828555838556F0121BEFFDFA602F8C0555 473 | :1018B6001CC374808DF063F08095F050208A82C03E 474 | :1018C60003C004121651D004D003AD54AE55AF5622 475 | :1018D6000DBD00010E8D548E558F5680C120040318 476 | :1018E60002199DC3EB9563400302199DE563C39BF3 477 | :1018F600F563AC638C051C8C63ED700302199B7554 478 | :101906008220C004121651D00480E9E56124FDF856 479 | :101916008861860508860608860718188D548E5530 480 | :101926008F56AD56BD800040047A438014BD6000DA 481 | :1019360040047A50800BBD400040047A4980027A08 482 | :10194600588A82C00212165175823A121651758251 483 | :1019560030121651758278121651D002BA49028099 484 | :101966000BBA500280068555821216908554821253 485 | :1019760016908023D20875620A801C75620880174B 486 | :1019860075620A8012756210800DD20B80098A82F8 487 | :1019960012165180028C63300B5AE56124FCF888DC 488 | :1019A6006186040886050886060886071818188CB6 489 | :1019B600548D558E568F57755469755520755680BA 490 | :1019C60085546585556685566774012565FFE4353A 491 | :1019D60066FCAD678F548C558D568565828566830A 492 | :1019E6008567F0121BEFFCFA70030216FD8A82125D 493 | :1019F600165180CCE56270030216FD756417300936 494 | :101A06002BE56114F88861E6FD3395E0FEFFFC8D59 495 | :101A1600548E558F568C5720085EAC547D007E0040 496 | :101A26007F008C548D558E568F57804C300A1FE59B 497 | :101A36006124FCF8886186040886050886060886FF 498 | :101A4600071818188C548D558E568F57802AE561C5 499 | :101A560024FEF88861860408860518ED3395E0FEB5 500 | :101A6600FF8C548D558E568F5720080CAC54AD55AF 501 | :101A76007E007F008E568F57300822E55730E71BD1 502 | :101A8600C3E49554FCE49555FDE49556FEE495575C 503 | :101A9600FF8C548D558E568F578002C208D20CA8E3 504 | :101AA600647C00755800856282C004C0001216A7C7 505 | :101AB600D000D004200C0DE558C4FDE6FE4DF61806 506 | :101AC60088648002A6580C8C03B20CE55445554533 507 | :101AD60056455770CE88648C03E5637003756301C1 508 | :101AE600200524200421EB04FCAD63C3EC9D5015B6 509 | :101AF600758220C003C004C005121651D005D0045B 510 | :101B0600D0031D80E68D6330080E75822DC003124A 511 | :101B16001651D00315638023EB602030060E7582C4 512 | :101B26002BC003121651D0031563800F30070C75B6 513 | :101B36008220C003121651D0031563200424AC631F 514 | :101B46008C051C8C63C3EB9D502B3005047D3080C7 515 | :101B5600027D208D82C003C004121651D004D0032A 516 | :101B660080DEC3EB95635008E563C39BF56380078E 517 | :101B760075630080028C63A8648B041BEC6026B23C 518 | :101B86000C200C0A08E6C4540FFC8C588007860407 519 | :101B9600740F5CF558855882C003C000121677D0C2 520 | :101BA60000D00380D42004030216FDAB638B041B14 521 | :101BB600EC70030216FD758220C003121651D00385 522 | :101BC60080EB8A821216510216FD855982855A8348 523 | :011BD60022EC 524 | :0B2069003C4E4F20464C4F41543E00BF 525 | :101BD700AA82AB83121BEF6003A380F8C3E5829A46 526 | :081BE700F582E5839BF58322E2 527 | :0D008300758167121C86E582600302007E15 528 | :101BEF0020F71430F6148883A88220F507E6A8831F 529 | :101BFF0075830022E280F7E49322E022C2D5E583C9 530 | :101C0F0030E70DD2D5E4C39582F582E49583F58351 531 | :101C1F00E50F30E70DB2D5E4C3950EF50EE4950F41 532 | :101C2F00F50F12136F30D50BE4C39582F582E4954F 533 | :101C3F0083F583226040F82582500274FFF582E815 534 | :101C4F0024F8501ECCCBCAF9E4CC24F85014CBCADC 535 | :101C5F00F9E4CB24F8500BCAF9E4CA24F8500379FD 536 | :101C6F00002224086010F8C3EC13FCEB13FBEA13FB 537 | :0B1C7F00FAE913F9D8F1227582002267 538 | :00000001FF 539 | --------------------------------------------------------------------------------