├── README.md ├── docs ├── 30403sw.pdf ├── 6V8C.pdf ├── 7550.pdf ├── SRV05.pdf ├── ST7735.pdf ├── lcd1.jpg ├── lcd2.jpg ├── lcd3.jpg ├── lcd4.jpg └── tl431.pdf ├── firmware 1.34 ├── ADC.c ├── ADS7843.c ├── ADS7843.h ├── CHANGES ├── CHANGES.de ├── Clones ├── ComponentTester.hex ├── EUPL-v1.1.pdf ├── HD44780.c ├── HD44780.h ├── I2C.c ├── ILI9163.c ├── ILI9163.h ├── ILI9341.c ├── ILI9341.h ├── IR.c ├── Makefile ├── OneWire.c ├── OneWire.h ├── PCD8544.c ├── PCD8544.h ├── README ├── README.de ├── SPI.c ├── SSD1306.c ├── SSD1306.h ├── ST7565R.c ├── ST7565R.h ├── ST7735.c ├── ST7735.h ├── ST7920.c ├── ST7920.h ├── VT100.c ├── adjust.c ├── bitmaps │ ├── font_10x16_hf.h │ ├── font_12x16_hf.h │ ├── font_16x26_hf.h │ ├── font_6x8_v_f.h │ ├── font_6x8_vf.h │ ├── font_8x16_cyrillic_hf.h │ ├── font_8x16_vfp.h │ ├── font_8x8_h.h │ ├── font_8x8_hf.h │ ├── font_8x8_vf.h │ ├── font_HD44780_cyr.h │ ├── font_HD44780_int.h │ ├── symbols_24x24_h.h │ ├── symbols_24x24_hf.h │ ├── symbols_24x24_vfp.h │ ├── symbols_24x24_vp_f.h │ ├── symbols_30x32_hf.h │ └── symbols_32x32_hf.h ├── cap.c ├── colors.h ├── commands.c ├── common.h ├── config.h ├── config_328.h ├── config_644.h ├── display.c ├── functions.h ├── inductor.c ├── main.c ├── pause.c ├── probes.c ├── resistor.c ├── semi.c ├── serial.c ├── tools.c ├── user.c ├── var_czech.h ├── var_danish.h ├── var_english.h ├── var_german.h ├── var_italian.h ├── var_polish.h ├── var_russian.h ├── var_russian_2.h ├── var_spanish.h ├── variables.h └── wait.S ├── schematics ├── display.png ├── gm328a.sch └── sch2.png └── tetris ├── game.cpp ├── game.h ├── queue.cpp ├── queue.h ├── sound.cpp ├── sound.h └── tetris.ino /README.md: -------------------------------------------------------------------------------- 1 | # gm328a_rev_eng 2 | Reverse engineering of the gm328a transistor tester 3 | -------------------------------------------------------------------------------- /docs/30403sw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/30403sw.pdf -------------------------------------------------------------------------------- /docs/6V8C.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/6V8C.pdf -------------------------------------------------------------------------------- /docs/7550.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/7550.pdf -------------------------------------------------------------------------------- /docs/SRV05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/SRV05.pdf -------------------------------------------------------------------------------- /docs/ST7735.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/ST7735.pdf -------------------------------------------------------------------------------- /docs/lcd1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/lcd1.jpg -------------------------------------------------------------------------------- /docs/lcd2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/lcd2.jpg -------------------------------------------------------------------------------- /docs/lcd3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/lcd3.jpg -------------------------------------------------------------------------------- /docs/lcd4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/lcd4.jpg -------------------------------------------------------------------------------- /docs/tl431.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/docs/tl431.pdf -------------------------------------------------------------------------------- /firmware 1.34/ADC.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ADC.c -------------------------------------------------------------------------------- /firmware 1.34/ADS7843.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ADS7843.c -------------------------------------------------------------------------------- /firmware 1.34/ADS7843.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * ADS7843 compatible touchscreen controller 4 | * 5 | * (c) 2015-2017 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | 10 | /* ************************************************************************ 11 | * constants 12 | * ************************************************************************ */ 13 | 14 | 15 | /* 16 | * control byte 17 | */ 18 | 19 | #define FLAG_STARTBIT 0b10000000 /* signal control byte */ 20 | 21 | /* channel selection */ 22 | #define FLAG_CHAN_X 0b00010000 /* input: X+ */ 23 | #define FLAG_CHAN_Y 0b01010000 /* input: Y+ */ 24 | #define FLAG_CHAN_IN3 0b00100000 /* input: IN3 */ 25 | #define FLAG_CHAN_IN4 0b01100000 /* input: IN4 */ 26 | 27 | /* conversion mode */ 28 | #define FLAG_12BITS 0b00000000 /* 12 bits */ 29 | #define FLAG_8BITS 0b00001000 /* 8 bits */ 30 | #define FLAG_DFR 0b00000000 /* differential reference */ 31 | #define FLAG_SER 0b00000100 /* single-ended reference */ 32 | 33 | /* power down mode */ 34 | #define FLAG_PWR_DOWN_1 0b00000000 /* power-down between conversions */ 35 | /* and enable PENIRQ */ 36 | #define FLAG_PWR_DOWN_2 0b00000001 /* power-down between conversions */ 37 | /* and disable PENIRQ */ 38 | #define FLAG_PWR_RSRVD 0b00000010 /* reserved for future use */ 39 | #define FLAG_PWR_ALWAYS 0b00000011 /* no power-down between conversions */ 40 | /* and disable PENIRQ */ 41 | 42 | 43 | 44 | /* ************************************************************************ 45 | * EOF 46 | * ************************************************************************ */ 47 | -------------------------------------------------------------------------------- /firmware 1.34/CHANGES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/CHANGES -------------------------------------------------------------------------------- /firmware 1.34/CHANGES.de: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/CHANGES.de -------------------------------------------------------------------------------- /firmware 1.34/Clones: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/Clones -------------------------------------------------------------------------------- /firmware 1.34/EUPL-v1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/EUPL-v1.1.pdf -------------------------------------------------------------------------------- /firmware 1.34/HD44780.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/HD44780.c -------------------------------------------------------------------------------- /firmware 1.34/HD44780.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/HD44780.h -------------------------------------------------------------------------------- /firmware 1.34/I2C.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/I2C.c -------------------------------------------------------------------------------- /firmware 1.34/ILI9163.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ILI9163.c -------------------------------------------------------------------------------- /firmware 1.34/ILI9341.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ILI9341.c -------------------------------------------------------------------------------- /firmware 1.34/IR.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/IR.c -------------------------------------------------------------------------------- /firmware 1.34/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # 4 | # (c) 2012-2018 by Markus Reschke 5 | # based on code from Markus Frejek and Karl-Heinz K�bbeler 6 | # 7 | 8 | PROJECT = ComponentTester 9 | 10 | # 11 | # MCU settings 12 | # - Change to fit your setup! 13 | # 14 | 15 | # avr-gcc: MCU model 16 | # - ATmega 328/328P : atmega328 17 | # - ATmega 324P/324PA : atmega324p 18 | # - ATmega 644/644P/644PA : atmega644 19 | # - ATmega 1284/1284P : atmega1284 20 | MCU = atmega328 21 | 22 | # MCU freqency: 23 | # - 1MHz : 1 24 | # - 8MHz : 8 25 | # - 16MHz : 16 26 | # - 20MHz : 20 27 | FREQ = 8 28 | 29 | # oscillator type 30 | # - internal RC oscillator : RC 31 | # - external full swing crystal : Crystal 32 | # - external low power crystal : LowPower 33 | OSCILLATOR = Crystal 34 | 35 | # oscillator start-up cycles 36 | # - Crystal and LowPower could also be 1024 or 256 based on fuse settings 37 | ifeq (${OSCILLATOR},RC) 38 | OSC_STARTUP = 6 39 | endif 40 | ifeq (${OSCILLATOR},Crystal) 41 | OSC_STARTUP = 16384 42 | endif 43 | ifeq (${OSCILLATOR},LowPower) 44 | OSC_STARTUP = 16384 45 | endif 46 | 47 | 48 | # avrdude: part number of MCU 49 | # - ATmega 328 : m328 50 | # - ATmega 328P : m328p 51 | # - ATmega 324P : m324p 52 | # - ATmega 324PA : m324pa 53 | # - ATmega 644 : m644 54 | # - ATmega 644P : m644p 55 | # - ATmega 644PA : m644p 56 | # - ATmega 1284 : m1284 57 | # - ATmega 1284P : m1284p 58 | PARTNO = m328p 59 | 60 | # avrdude: ISP programmer 61 | #PROGRAMMER = buspirate 62 | PROGRAMMER = USBasp 63 | #PROGRAMMER = avrispmkII 64 | 65 | # avrdude: port of ISP programmer 66 | #PORT = /dev/bus_pirate 67 | PORT = usb 68 | 69 | 70 | # 71 | # global settings 72 | # 73 | 74 | # project name 75 | NAME = ComponentTester 76 | 77 | # name and version based on directory name 78 | DIST = $(notdir ${CURDIR}) 79 | 80 | # compiler flags 81 | CC = avr-gcc 82 | CPP = avr-g++ 83 | CFLAGS = -mmcu=${MCU} -Wall -mcall-prologues -I. -Ibitmaps 84 | CFLAGS += -DF_CPU=${FREQ}000000UL 85 | CFLAGS += -DOSC_STARTUP=${OSC_STARTUP} 86 | CFLAGS += -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums 87 | CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d 88 | #CFLAGS += -flto 89 | 90 | # linker flags 91 | LDFLAGS = -mmcu=${MCU} -Wl,-Map=${NAME}.map 92 | 93 | # hex file flags 94 | HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature 95 | HEX_EEPROM_FLAGS = -j .eeprom 96 | HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" 97 | HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings 98 | 99 | # header files 100 | HEADERS = config.h config_328.h config_644.h colors.h 101 | HEADERS += common.h variables.h $(wildcard var_*.h) functions.h 102 | HEADERS += OneWire.h 103 | HEADERS += HD44780.h ST7565R.h ILI9341.h PCD8544.h ST7735.h ST7920.h 104 | HEADERS += SSD1306.h ILI9163.h ADS7843.h 105 | 106 | # objects 107 | OBJECTS_C = main.o user.o pause.o adjust.o ADC.o probes.o 108 | OBJECTS_C += resistor.o cap.o semi.o inductor.o tools.o IR.o 109 | OBJECTS_C += display.o SPI.o I2C.o serial.o commands.o OneWire.o 110 | OBJECTS_C += HD44780.o ST7565R.o ILI9341.o PCD8544.o ST7735.o ST7920.o 111 | OBJECTS_C += SSD1306.o ILI9163.o VT100.o ADS7843.o 112 | OBJECTS_S = wait.o 113 | OBJECTS = ${OBJECTS_C} ${OBJECTS_S} 114 | 115 | 116 | # 117 | # build 118 | # 119 | 120 | all: ${NAME} ${NAME}.hex ${NAME}.eep ${NAME}.lss size 121 | 122 | 123 | # 124 | # link 125 | # 126 | 127 | # link firmware 128 | $(NAME): ${OBJECTS} 129 | ${CC} ${LDFLAGS} ${OBJECTS} ${LIBDIRS} ${LIBS} -o ${NAME} 130 | 131 | # create hex file of firmware 132 | %.hex: ${NAME} 133 | avr-objcopy -O ihex ${HEX_FLASH_FLAGS} $< $@ 134 | 135 | # create image for EEPROM 136 | %.eep: ${NAME} 137 | -avr-objcopy ${HEX_EEPROM_FLAGS} -O ihex $< $@ || exit 0 138 | 139 | # create dump of firmware 140 | %.lss: ${NAME} 141 | avr-objdump -h -S $< > $@ 142 | 143 | # output size of firmware and stuff 144 | size: ${NAME} 145 | @echo 146 | @avr-size -C --mcu=${MCU} $< 147 | 148 | 149 | # 150 | # compile source files 151 | # 152 | 153 | # rule for all c-files 154 | ${OBJECTS_C}: %.o: %.c ${HEADERS} ${MAKEFILE_LIST} 155 | ${CC} ${CFLAGS} -c ${@:.o=.c} 156 | 157 | # rule for all S-files 158 | ${OBJECTS_S}: %.o: %.S ${HEADERS} ${MAKEFILE_LIST} 159 | ${CC} ${CFLAGS} -c ${@:.o=.S} 160 | 161 | # external dependencies 162 | -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) 163 | 164 | 165 | # 166 | # extras 167 | # 168 | 169 | # upload firmware 170 | upload: ${NAME} ${NAME}.hex ${NAME}.eep ${NAME}.lss size 171 | avrdude -c ${PROGRAMMER} -B 5.0 -p ${PARTNO} -P ${PORT} \ 172 | -U flash:w:./${NAME}.hex:a -U eeprom:w:./$(NAME).eep:a 173 | 174 | # create distribution package 175 | dist: 176 | rm -f *.tgz 177 | cd ..; tar -czf ${DIST}/${DIST}.tgz \ 178 | ${DIST}/*.h ${DIST}/*.c ${DIST}/*.S ${DIST}/bitmaps/ \ 179 | ${DIST}/Makefile ${DIST}/README ${DIST}/CHANGES \ 180 | ${DIST}/README.de ${DIST}/CHANGES.de ${DIST}/Clones \ 181 | ${DIST}/*.pdf 182 | 183 | # clean up 184 | clean: 185 | -rm -rf ${OBJECTS} ${NAME} dep/* *.tgz 186 | -rm -rf ${NAME}.hex ${NAME}.eep ${NAME}.lss ${NAME}.map 187 | 188 | 189 | # 190 | # MCU fuses 191 | # 192 | 193 | # ATmega 328/328P 194 | ifeq (${MCU},atmega328) 195 | FAMILY = atmega328_324 196 | endif 197 | 198 | # ATmega 324P/324PA 199 | ifeq (${MCU},atmega324p) 200 | FAMILY = atmega328_324 201 | endif 202 | 203 | # ATmega 644/644P/644PA 204 | ifeq (${MCU},atmega644) 205 | FAMILY = atmega328_324 206 | endif 207 | 208 | # ATmega 1284/1284P 209 | ifeq (${MCU},atmega1284) 210 | FAMILY = atmega328_324 211 | endif 212 | 213 | # ATmega 328/324/644/1284 214 | ifeq (${FAMILY},atmega328_324) 215 | HFUSE = -U hfuse:w:0xd9:m 216 | EFUSE = -U efuse:w:0xfc:m 217 | ifeq (${FREQ},1) 218 | # internal RC oscillator (8MHz) and /1 clock divider 219 | LFUSE_RC = -U lfuse:w:0x62:m 220 | # external 8MHz full swing crystal and /8 clock divider 221 | LFUSE_CRYSTAL = -U lfuse:w:0x77:m 222 | # external 8MHz low power crystal and /8 clock divider 223 | LFUSE_LOWPOWER = -U lfuse:w:0x7f:m 224 | endif 225 | ifeq (${FREQ},8) 226 | # internal RC oscillator (8MHz) and /1 clock divider 227 | LFUSE_RC = -U lfuse:w:0xe2:m 228 | # external 8MHz full swing crystal and /1 clock divider 229 | LFUSE_CRYSTAL = -U lfuse:w:0xf7:m 230 | # external 8MHz low power crystal and /1 clock divider 231 | LFUSE_LOWPOWER = -U lfuse:w:0xff:m 232 | endif 233 | ifeq (${FREQ},16) 234 | # internal RC oscillator (8MHz) not possible 235 | LFUSE_RC = 236 | # external 16MHz full swing crystal and /1 clock divider 237 | LFUSE_CRYSTAL = -U lfuse:w:0xf7:m 238 | # external 16MHz low power crystal and /1 clock divider 239 | LFUSE_LOWPOWER = -U lfuse:w:0xff:m 240 | endif 241 | ifeq (${FREQ},20) 242 | # internal RC oscillator (8MHz) not possible 243 | LFUSE_RC = 244 | # external 20MHz full swing crystal and /1 clock divider 245 | LFUSE_CRYSTAL = -U lfuse:w:0xf7:m 246 | # external 20MHz low power crystal and /1 clock divider 247 | LFUSE_LOWPOWER = -U lfuse:w:0xff:m 248 | endif 249 | endif 250 | 251 | 252 | # select LFUSE 253 | ifeq (${OSCILLATOR},RC) 254 | LFUSE = ${LFUSE_RC} 255 | endif 256 | ifeq (${OSCILLATOR},Crystal) 257 | LFUSE = ${LFUSE_CRYSTAL} 258 | endif 259 | ifeq (${OSCILLATOR},LowPower) 260 | LFUSE = ${LFUSE_LOWPOWER} 261 | endif 262 | 263 | # check fuses 264 | FUSES = 265 | ifneq ($(strip ${LFUSE}),) 266 | ifneq ($(strip ${HFUSE}),) 267 | FUSES = ${LFUSE} ${HFUSE} ${EFUSE} 268 | endif 269 | endif 270 | 271 | # set fuses 272 | fuses: 273 | ifeq ($(strip ${FUSES}),) 274 | @echo Invalid fuse settings! 275 | else 276 | avrdude -c ${PROGRAMMER} -B 10.0 -p ${PARTNO} -P ${PORT} ${FUSES} 277 | endif 278 | -------------------------------------------------------------------------------- /firmware 1.34/OneWire.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/OneWire.c -------------------------------------------------------------------------------- /firmware 1.34/OneWire.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/OneWire.h -------------------------------------------------------------------------------- /firmware 1.34/PCD8544.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/PCD8544.c -------------------------------------------------------------------------------- /firmware 1.34/PCD8544.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/PCD8544.h -------------------------------------------------------------------------------- /firmware 1.34/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/README -------------------------------------------------------------------------------- /firmware 1.34/README.de: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/README.de -------------------------------------------------------------------------------- /firmware 1.34/SPI.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * SPI (bit-bang & hardware) 4 | * 5 | * (c) 2017-2018 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | /* 10 | * hints: 11 | * - port and pins for bit-bang SPI 12 | * SPI_PORT port data register 13 | * SPI_DDR port data direction register 14 | * SPI_PIN port input pins register 15 | * SPI_SCK pin for SCK 16 | * SPI_MOSI pin for MOSI 17 | * SPI_MISO pin for MISO 18 | * - For hardware SPI the MCU specific pins are used: 19 | * ATmega 328: SCK / MOSI / MISO 20 | * ATmega 644: SCK PB7 / MOSI PB5 / MISO PB6 21 | * - /CS and other control signals have to be managed by the specific 22 | * chip driver 23 | */ 24 | 25 | 26 | /* local includes */ 27 | #include "config.h" /* global configuration */ 28 | 29 | #ifdef HW_SPI 30 | 31 | 32 | /* 33 | * local constants 34 | */ 35 | 36 | /* source management */ 37 | #define SPI_C 38 | 39 | 40 | /* 41 | * include header files 42 | */ 43 | 44 | /* local includes */ 45 | #include "common.h" /* common header file */ 46 | #include "variables.h" /* global variables */ 47 | #include "functions.h" /* external functions */ 48 | 49 | 50 | 51 | /* ************************************************************************ 52 | * functions for bit-bang SPI 53 | * ************************************************************************ */ 54 | 55 | 56 | #ifdef SPI_BITBANG 57 | 58 | /* 59 | * set up SPI bus 60 | * - SCK, MOSI and MISO lines 61 | * - don't care about clock 62 | */ 63 | 64 | void SPI_Setup(void) 65 | { 66 | /* set up bus only once */ 67 | if (Cfg.OP_Mode & OP_SPI) return; 68 | 69 | /* 70 | * set up bitbang SPI: 71 | * - master mode 72 | */ 73 | 74 | #ifdef SPI_MISO 75 | /* set MISO line to input mode */ 76 | SPI_DDR &= ~(1 << SPI_MISO); 77 | #endif 78 | 79 | /* set SCK and MOSI to output mode */ 80 | SPI_DDR |= (1 << SPI_SCK) | (1 << SPI_MOSI); 81 | 82 | /* preset lines to 0 */ 83 | SPI_PORT &= ~((1 << SPI_SCK) | (1 << SPI_MOSI)); 84 | 85 | Cfg.OP_Mode |= OP_SPI; /* bus is set up */ 86 | } 87 | 88 | 89 | 90 | /* 91 | * write a single byte 92 | */ 93 | 94 | void SPI_Write_Byte(uint8_t Byte) 95 | { 96 | uint8_t n = 8; /* counter */ 97 | 98 | /* expected state: SCK low / MOSI undefined */ 99 | 100 | /* 101 | * bitbang 8 bits: 102 | * - SPI mode 0 (CPOL = 0, CPHA = 0) 103 | * - set MOSI before rising SCK 104 | * - MSB first 105 | */ 106 | 107 | while (n > 0) /* for 8 bits */ 108 | { 109 | /* get current MSB and set MOSI */ 110 | if (Byte & 0b10000000) /* 1 */ 111 | { 112 | /* set MOSI high */ 113 | SPI_PORT |= (1 << SPI_MOSI); 114 | } 115 | else /* 0 */ 116 | { 117 | /* set MOSI low */ 118 | SPI_PORT &= ~(1 << SPI_MOSI); 119 | } 120 | 121 | /* end clock cycle (rising edge takes bit) */ 122 | SPI_PORT |= (1 << SPI_SCK); 123 | 124 | /* start next clock cycle (falling edge) */ 125 | SPI_PORT &= ~(1 << SPI_SCK); 126 | 127 | Byte <<= 1; /* shift bits one step left */ 128 | n--; /* next bit */ 129 | } 130 | 131 | /* current state: SCK low / MOSI undefined */ 132 | } 133 | 134 | 135 | 136 | #if SPI_RW 137 | 138 | /* 139 | * write and read a single byte 140 | */ 141 | 142 | uint8_t SPI_WriteRead_Byte(uint8_t Byte) 143 | { 144 | uint8_t Byte2 = 0; /* return value */ 145 | uint8_t n = 8; /* counter */ 146 | uint8_t Temp; /* temporary value */ 147 | 148 | /* expected state: SCK low / MOSI undefined */ 149 | 150 | /* 151 | * bitbang 8 bits: 152 | * - SPI mode 0 (CPOL = 0, CPHA = 0) 153 | * - set MOSI before rising SCK 154 | * - read MISO after rising SCK 155 | * - MSB first 156 | */ 157 | 158 | while (n > 0) /* for 8 bits */ 159 | { 160 | /* get current MSB and set MOSI */ 161 | if (Byte & 0b10000000) /* 1 */ 162 | { 163 | /* set MOSI high */ 164 | SPI_PORT |= (1 << SPI_MOSI); 165 | } 166 | else /* 0 */ 167 | { 168 | /* set MOSI low */ 169 | SPI_PORT &= ~(1 << SPI_MOSI); 170 | } 171 | 172 | /* end clock cycle (rising edge takes bit) */ 173 | SPI_PORT |= (1 << SPI_SCK); 174 | 175 | /* read MISO */ 176 | Temp = SPI_PIN; /* read port */ 177 | Temp &= (1 << SPI_MISO); /* filter MISO */ 178 | Byte2 <<= 1; /* shift bits one step left */ 179 | if (Temp) /* MISO set */ 180 | { 181 | Byte2 |= 0b00000001; /* set bit */ 182 | } 183 | 184 | /* start next clock cycle (falling edge) */ 185 | SPI_PORT &= ~(1 << SPI_SCK); 186 | 187 | Byte <<= 1; /* shift bits one step left */ 188 | n--; /* next bit */ 189 | } 190 | 191 | /* current state: SCK low / MOSI undefined */ 192 | 193 | return Byte2; 194 | } 195 | 196 | #endif 197 | 198 | #endif 199 | 200 | 201 | 202 | /* ************************************************************************ 203 | * functions for hardware SPI 204 | * ************************************************************************ */ 205 | 206 | 207 | #ifdef SPI_HARDWARE 208 | 209 | /* 210 | * set SPI clock rate 211 | * - uses SPI.ClockRate for input 212 | */ 213 | 214 | void SPI_Clock(void) 215 | { 216 | uint8_t Clock; /* clock rate bits */ 217 | uint8_t Bits; /* bits/bitmask */ 218 | 219 | Clock = SPI.ClockRate; /* get clock rate flags */ 220 | 221 | Bits = SPCR; /* get control register */ 222 | Bits &= ~((1 << SPR1) | (1 << SPR0)); /* clear clock rate bits */ 223 | 224 | /* set divider bits */ 225 | if (Clock & SPI_CLOCK_R0) Bits |= (1 << SPR0); 226 | if (Clock & SPI_CLOCK_R1) Bits |= (1 << SPR1); 227 | 228 | SPCR = Bits; /* set new clock rate */ 229 | 230 | 231 | Bits = 0; /* clear "double" bit */ 232 | 233 | /* set bit to double SPI speed */ 234 | if (Clock & SPI_CLOCK_2X) Bits = (1 << SPI2X); 235 | 236 | SPSR = Bits; /* update register */ 237 | } 238 | 239 | 240 | 241 | /* 242 | * set up SPI bus 243 | * - clock and mode 244 | * - lines are set up automatically 245 | */ 246 | 247 | void SPI_Setup(void) 248 | { 249 | uint8_t Bits; /* bits/bitmask */ 250 | 251 | /* set up bus only once */ 252 | if (Cfg.OP_Mode & OP_SPI) return; 253 | 254 | /* set SCK and MOSI to output mode */ 255 | /* using variable Bits to keep compiler happy */ 256 | Bits = SPI_DDR; 257 | Bits |= (1 << SPI_SCK) | (1 << SPI_MOSI); 258 | SPI_DDR = Bits; 259 | 260 | /* MISO is automatically set to input mode by enabling SPI */ 261 | 262 | /* 263 | * set up hardware SPI 264 | * - master mode (MSTR = 1) 265 | * - SPI mode 0 (CPOL = 0, CPHA = 0) 266 | * - MSB first (DORD = 0) 267 | * - polling mode (SPIE = 0) 268 | */ 269 | 270 | /* set mode and enable SPI */ 271 | SPCR = (1 << SPE) | (1 << MSTR); 272 | 273 | /* set clock rate */ 274 | SPI_Clock(); 275 | 276 | /* clear SPI interrupt flag, just in case */ 277 | Bits = SPSR; /* read flag */ 278 | Bits = SPDR; /* clear flag by reading data */ 279 | 280 | Cfg.OP_Mode |= OP_SPI; /* bus is set up */ 281 | } 282 | 283 | 284 | 285 | /* 286 | * write a single byte 287 | */ 288 | 289 | void SPI_Write_Byte(uint8_t Byte) 290 | { 291 | /* send byte */ 292 | SPDR = Byte; /* start transmission */ 293 | while (!(SPSR & (1 << SPIF))); /* wait for flag */ 294 | Byte = SPDR; /* clear flag by reading data */ 295 | } 296 | 297 | 298 | 299 | #if SPI_RW 300 | 301 | /* 302 | * write and read a single byte 303 | */ 304 | 305 | uint8_t SPI_WriteRead_Byte(uint8_t Byte) 306 | { 307 | uint8_t Byte2; /* return value */ 308 | 309 | /* send byte */ 310 | SPDR = Byte; /* start transmission */ 311 | while (!(SPSR & (1 << SPIF))); /* wait for flag */ 312 | 313 | /* get received byte */ 314 | Byte2 = SPDR; /* clear flag by reading data */ 315 | 316 | return Byte2; 317 | } 318 | 319 | #endif 320 | 321 | #endif 322 | 323 | 324 | 325 | /* ************************************************************************ 326 | * clean-up of local constants 327 | * ************************************************************************ */ 328 | 329 | /* source management */ 330 | #undef SPI_C 331 | 332 | #endif 333 | 334 | /* ************************************************************************ 335 | * EOF 336 | * ************************************************************************ */ 337 | -------------------------------------------------------------------------------- /firmware 1.34/SSD1306.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/SSD1306.c -------------------------------------------------------------------------------- /firmware 1.34/SSD1306.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * SSD1306 OLED graphic display controller 4 | * 5 | * (c) 2017 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | 10 | /* ************************************************************************ 11 | * I2C 12 | * ************************************************************************ */ 13 | 14 | 15 | /* 16 | * I2C control byte 17 | */ 18 | 19 | #define LCD_CONTROL_BYTE 0b00000000 /* 0x00 */ 20 | /* continuation flag */ 21 | #define FLAG_CTRL_MULTI 0b00000000 /* stream bytes follows */ 22 | #define FLAG_CTRL_SINGLE 0b10000000 /* only 1 byte follows */ 23 | /* D/C */ 24 | #define FLAG_CTRL_CMD 0b00000000 /* command follows */ 25 | #define FLAG_CTRL_DATA 0b01000000 /* data follows */ 26 | 27 | 28 | 29 | /* ************************************************************************ 30 | * fundamental commands 31 | * ************************************************************************ */ 32 | 33 | 34 | /* 35 | * contrast control 36 | * - 2 byte command 37 | * - valid range: 0 - 255 38 | * default: 127 39 | */ 40 | 41 | /* byte #1: command */ 42 | #define CMD_CONTRAST 0b10000001 /* set contrast */ 43 | 44 | /* byte #2: contrast (0-255) */ 45 | 46 | 47 | /* 48 | * entire display on 49 | */ 50 | 51 | #define CMD_PIXEL_MODE 0b10100100 /* set pixel mode */ 52 | 53 | #define FLAG_PIXEL_RAM 0b00000000 /* based on RAM (default) */ 54 | #define FLAG_PIXEL_ALL 0b00000001 /* all pixels on */ 55 | 56 | 57 | /* 58 | * set normal/inverse display 59 | */ 60 | 61 | #define CMD_DISP_MODE 0b10100110 /* set display mode */ 62 | 63 | #define FLAG_DISP_NORMAL 0b00000000 /* normal display (1 = pixel on, default) */ 64 | #define FLAG_DISP_INVERSE 0b00000001 /* inversed display (0 = pixel on) */ 65 | 66 | 67 | /* 68 | * set display on/off 69 | */ 70 | 71 | #define CMD_DISPLAY 0b10101110 /* enable/disable display */ 72 | 73 | #define FLAG_DISPLAY_OFF 0b00000000 /* disable display (sleep mode, default) */ 74 | #define FLAG_DISPLAY_ON 0b00000001 /* enable display */ 75 | 76 | 77 | 78 | /* ************************************************************************ 79 | * scrolling commands 80 | * ************************************************************************ */ 81 | 82 | 83 | /* 84 | * continious horizontal scroll setup 85 | * - 7 byte command 86 | */ 87 | 88 | /* byte #1: command */ 89 | #define CMD_HOR_SCROLL 0b00100110 /* set horizontal scolling */ 90 | 91 | #define FLAG_SCROLL_RIGHT 0b00000000 /* scroll to right */ 92 | #define FLAG_SCROLL_LEFT 0b00000001 /* scroll to left */ 93 | 94 | /* byte #2: dummy byte */ 95 | #define FLAG_SCROLL_DUMMY1 0b00000000 /* dummy byte 0x00 */ 96 | 97 | /* byte #3: start page (valid range: 0-7) */ 98 | #define FLAG_PAGE_0 0b00000000 /* page #0 */ 99 | #define FLAG_PAGE_1 0b00000001 /* page #1 */ 100 | #define FLAG_PAGE_2 0b00000010 /* page #2 */ 101 | #define FLAG_PAGE_3 0b00000011 /* page #3 */ 102 | #define FLAG_PAGE_4 0b00000100 /* page #4 */ 103 | #define FLAG_PAGE_5 0b00000101 /* page #5 */ 104 | #define FLAG_PAGE_6 0b00000110 /* page #6 */ 105 | #define FLAG_PAGE_7 0b00000111 /* page #7 */ 106 | 107 | /* byte #4: time interval (based on frame fequency) */ 108 | #define FLAG_INTERVAL_5 0b00000000 /* 5 frames */ 109 | #define FLAG_INTERVAL_64 0b00000001 /* 64 frames */ 110 | #define FLAG_INTERVAL_128 0b00000010 /* 128 frames */ 111 | #define FLAG_INTERVAL_256 0b00000011 /* 256 frames */ 112 | #define FLAG_INTERVAL_3 0b00000100 /* 3 frames */ 113 | #define FLAG_INTERVAL_4 0b00000101 /* 4 frames */ 114 | #define FLAG_INTERVAL_25 0b00000110 /* 25 frames */ 115 | #define FLAG_INTERVAL_2 0b00000111 /* 2 frames */ 116 | 117 | /* byte #5: end page (valid range: 0-7) */ 118 | /* see FLAG_PAGE_x above */ 119 | 120 | /* byte #6: dummy byte */ 121 | #define FLAG_SCROLL_DUMMY2 0b00000000 /* dummy byte 0x00 */ 122 | 123 | /* byte #7: dummy byte */ 124 | #define FLAG_SCROLL_DUMMY3 0b11111111 /* dummy byte 0xff */ 125 | 126 | 127 | /* 128 | * continious vertical and horizontal scroll setup 129 | * - 6 byte command 130 | */ 131 | 132 | /* byte #1: command */ 133 | #define CMD_VH_SCROLL 0b00101000 /* set ver & hor scolling */ 134 | 135 | #define FLAG_SCROLL_VRIGHT 0b00000001 /* scroll to right */ 136 | #define FLAG_SCROLL_VLEFT 0b00000010 /* scroll to left */ 137 | 138 | /* byte #2: dummy byte */ 139 | #define FLAG_SCROLL_DUMMY1 0b00000000 /* dummy byte 0x00 */ 140 | 141 | /* byte #3: start page (valid range: 0-7) */ 142 | /* see FLAG_PAGE_x above */ 143 | 144 | /* byte #4: time interval (based on frame fequency) */ 145 | /* see FLAG_INTERVAL_xxx above */ 146 | 147 | /* byte #5: end page (valid range: 0-7) */ 148 | /* see FLAG_PAGE_x above */ 149 | 150 | /* byte #6: vertical scrolling offset (rows) */ 151 | /* valid range: 0 - 63 */ 152 | 153 | 154 | /* 155 | * deactivate scrolling 156 | */ 157 | 158 | #define CMD_SCOLLING_OFF 0b00101110 /* disable scolling */ 159 | 160 | 161 | /* 162 | * activate scrolling 163 | */ 164 | 165 | #define CMD_SCOLLING_ON 0b00101111 /* enable scolling */ 166 | 167 | 168 | /* 169 | * set vertical scroll area 170 | * - 3 byte command 171 | */ 172 | 173 | /* byte #1: command */ 174 | #define CMD_SCROLL_AREA_SET 0b10100011 /* set scroll area */ 175 | 176 | /* byte #2: number of rows in top fixed area */ 177 | /* valid range: 0 - 31 */ 178 | /* default: 0 */ 179 | 180 | /* byte #3: number of rows in scroll area */ 181 | /* valid range: 0 - 63 */ 182 | /* default: 64 */ 183 | 184 | 185 | 186 | /* ************************************************************************ 187 | * address setting commands 188 | * ************************************************************************ */ 189 | 190 | 191 | /* 192 | * set lower nibble of column start address (page adressing mode) 193 | * - valid range: 0 - 63 (both nibbles: 0-127) 194 | * default: 0 195 | */ 196 | 197 | #define CMD_COLUMN_L 0b00000000 /* set lower nibble of start address */ 198 | 199 | 200 | /* 201 | * set upper nibble column start address (page adressing mode) 202 | * - valid range: 0 - 63 (both nibbles: 0-127) 203 | * default: 0 204 | */ 205 | 206 | #define CMD_COLUMN_H 0b00010000 /* set upper nibble of start address */ 207 | 208 | 209 | /* 210 | * set memory addressing mode 211 | * - 2 byte command 212 | */ 213 | 214 | /* byte #1: command */ 215 | #define CMD_MEM_ADDR_MODE 0b00100000 /* set memory address mode */ 216 | 217 | /* byte #2: mode */ 218 | #define FLAG_ADDR_MODE_HOR 0b00000000 /* horizontal */ 219 | #define FLAG_ADDR_MODE_VER 0b00000001 /* vertical */ 220 | #define FLAG_ADDR_MODE_PAGE 0b00000010 /* page (default) */ 221 | #define FLAG_ADDR_MODE_NONE 0b00000011 /* invalid */ 222 | 223 | 224 | /* 225 | * set column address (horizontal or vertical addressing mode) 226 | * - 3 byte command 227 | */ 228 | 229 | /* byte #1: command */ 230 | #define CMD_COLUMN_ADDR 0b00100001 /* set column address */ 231 | 232 | /* byte #2: column start address */ 233 | /* valid range: 0 - 127 */ 234 | /* default: 0 */ 235 | 236 | /* byte #3: column end address */ 237 | /* valid range: 0 - 127 */ 238 | /* default: 127 */ 239 | 240 | 241 | /* 242 | * set page address (horizontal or vertical addressing mode) 243 | * - 3 byte command 244 | */ 245 | 246 | /* byte #1: command */ 247 | #define CMD_PAGE_ADDR 0b00100010 /* set page address */ 248 | 249 | /* byte #2: page start address */ 250 | /* valid range: 0 - 7 */ 251 | /* default: 0 */ 252 | 253 | /* byte #3: page end address */ 254 | /* valid range: 0 - 7 */ 255 | /* default: 7 */ 256 | 257 | 258 | /* 259 | * set page start address (page adressing mode) 260 | * - valid range: 0 - 7 261 | */ 262 | 263 | #define CMD_START_PAGE 0b10110000 /* set start page */ 264 | /* see FLAG_PAGE_x above */ 265 | 266 | 267 | 268 | /* ************************************************************************ 269 | * hardware configuration commands 270 | * ************************************************************************ */ 271 | 272 | 273 | /* 274 | * set charge pump 275 | * - 2 byte command 276 | */ 277 | 278 | /* byte #1: command */ 279 | #define CMD_CHARGE_PUMP 0b10001101 /* set charge pump*/ 280 | 281 | /* byte #2: mode */ 282 | #define FLAG_CHARGEPUMP_OFF 0b00010000 /* disable charge pump */ 283 | #define FLAG_CHARGEPUMP_ON 0b00010100 /* enable charge pump */ 284 | 285 | 286 | /* 287 | * set display start line 288 | * - valid range: 0 - 63 289 | * default: 0 290 | */ 291 | 292 | #define CMD_START_LINE 0b01000000 /* set start line */ 293 | 294 | 295 | /* 296 | * set segment mapping 297 | */ 298 | 299 | #define CMD_SEGMENT_MAP 0b10100000 /* set segment mapping */ 300 | 301 | #define FLAG_SEG_0 0b00000000 /* SEG0 = column #0 (default) */ 302 | #define FLAG_SEG_127 0b00000001 /* SEG0 = column #127 */ 303 | 304 | 305 | /* 306 | * set multiplex ratio (N + 1) 307 | * - 2 byte command 308 | */ 309 | 310 | /* byte #1: command */ 311 | #define CMD_MULTIPLEX_RATIO 0b10101000 /* set multiplex ratio */ 312 | 313 | /* byte #2: ratio */ 314 | /* valid range: 15 - 63 */ 315 | /* default: 63 */ 316 | 317 | 318 | /* 319 | * set COM output scan direction 320 | */ 321 | 322 | #define CMD_COM_SCAN_DIR 0b11000000 /* set COM scan direction */ 323 | 324 | #define FLAG_COM_0 0b00000000 /* from COM0 to COM[N-1] */ 325 | #define FLAG_COM_63 0b00001000 /* from COM[N-1] to COM0 */ 326 | 327 | 328 | /* 329 | * set display offset 330 | * - vertical shift (COM) 331 | * - 2 byte command 332 | */ 333 | 334 | /* byte #1: command */ 335 | #define CMD_DISP_OFFSET 0b11010011 /* set display offset */ 336 | 337 | /* byte #2: offset */ 338 | /* valid range: 0 - 63 */ 339 | /* default: 0*/ 340 | 341 | 342 | /* 343 | * set COM pins hardware configuration 344 | * - 2 byte command 345 | */ 346 | 347 | /* byte #1: command */ 348 | #define CMD_COM_CONFIG_SET 0b11011010 /* set COM pins config */ 349 | 350 | /* byte #2: config */ 351 | #define FLAG_COM_SEQ 0b00000000 /* sequential */ 352 | #define FLAG_COM_ALT 0b00010000 /* alternative (default) */ 353 | #define FLAG_COM_NORM 0b00000000 /* normal mapping (default) */ 354 | #define FLAG_COM_REMAP 0b00100000 /* reversed mapping */ 355 | 356 | 357 | 358 | /* ************************************************************************ 359 | * timing & driving scheme setting commands 360 | * ************************************************************************ */ 361 | 362 | 363 | /* 364 | * set display clock 365 | * - divider ratio and oscillator frequency 366 | * - 2 byte command 367 | */ 368 | 369 | /* byte #1: command */ 370 | #define CMD_DISP_CLOCK 0b11010101 /* set display clock */ 371 | 372 | /* byte #2: divider ratio and oscillator frequency */ 373 | /* divider ratio (n + 1) for DCLK */ 374 | #define FLAG_RATIO_1 0b00000000 /* ratio 1 (default) */ 375 | #define FLAG_RATIO_2 0b00000001 /* ratio 2 */ 376 | #define FLAG_RATIO_3 0b00000010 /* ratio 3 */ 377 | #define FLAG_RATIO_4 0b00000010 /* ratio 4 */ 378 | #define FLAG_RATIO_5 0b00000100 /* ratio 5 */ 379 | #define FLAG_RATIO_6 0b00000101 /* ratio 6 */ 380 | #define FLAG_RATIO_7 0b00000110 /* ratio 7 */ 381 | #define FLAG_RATIO_8 0b00000111 /* ratio 8 */ 382 | #define FLAG_RATIO_9 0b00001000 /* ratio 9 */ 383 | #define FLAG_RATIO_10 0b00001001 /* ratio 10 */ 384 | #define FLAG_RATIO_11 0b00001010 /* ratio 11 */ 385 | #define FLAG_RATIO_12 0b00001011 /* ratio 12 */ 386 | #define FLAG_RATIO_13 0b00001100 /* ratio 13 */ 387 | #define FLAG_RATIO_14 0b00001101 /* ratio 14 */ 388 | #define FLAG_RATIO_15 0b00001110 /* ratio 15 */ 389 | #define FLAG_RATIO_16 0b00001111 /* ratio 16 */ 390 | /* oscillator frequency */ 391 | #define FLAG_FREQ_1 0b00000000 /* frequency 1 */ 392 | #define FLAG_FREQ_2 0b00010000 /* frequency 2 */ 393 | #define FLAG_FREQ_3 0b00100000 /* frequency 3 */ 394 | #define FLAG_FREQ_4 0b00100000 /* frequency 4 */ 395 | #define FLAG_FREQ_5 0b01000000 /* frequency 5 */ 396 | #define FLAG_FREQ_6 0b01010000 /* frequency 6 */ 397 | #define FLAG_FREQ_7 0b01100000 /* frequency 7 */ 398 | #define FLAG_FREQ_8 0b01110000 /* frequency 8 */ 399 | #define FLAG_FREQ_9 0b10000000 /* frequency 9 (default) */ 400 | #define FLAG_FREQ_10 0b10010000 /* frequency 10 */ 401 | #define FLAG_FREQ_11 0b10100000 /* frequency 11 */ 402 | #define FLAG_FREQ_12 0b10110000 /* frequency 12 */ 403 | #define FLAG_FREQ_13 0b11000000 /* frequency 13 */ 404 | #define FLAG_FREQ_14 0b11010000 /* frequency 14 */ 405 | #define FLAG_FREQ_15 0b11100000 /* frequency 15 */ 406 | #define FLAG_FREQ_16 0b11110000 /* frequency 16 */ 407 | 408 | 409 | /* 410 | * set pre-charge period 411 | * - 2 byte command 412 | */ 413 | 414 | /* byte #1: command */ 415 | #define CMD_PRECHARGE 0b11011001 /* set pre-charge period */ 416 | 417 | /* byte #2: phase 1 and 2 periods */ 418 | /* phase 1 period */ 419 | #define FLAG_PHASE1_1 0b00000001 /* 1 DCLK */ 420 | #define FLAG_PHASE1_2 0b00000010 /* 2 DCLK (default) */ 421 | #define FLAG_PHASE1_3 0b00000010 /* 3 DCLK */ 422 | #define FLAG_PHASE1_4 0b00000100 /* 4 DCLK */ 423 | #define FLAG_PHASE1_5 0b00000101 /* 5 DCLK */ 424 | #define FLAG_PHASE1_6 0b00000110 /* 6 DCLK */ 425 | #define FLAG_PHASE1_7 0b00000111 /* 7 DCLK */ 426 | #define FLAG_PHASE1_8 0b00001000 /* 8 DCLK */ 427 | #define FLAG_PHASE1_9 0b00001001 /* 9 DCLK */ 428 | #define FLAG_PHASE1_10 0b00001010 /* 10 DCLK */ 429 | #define FLAG_PHASE1_11 0b00001011 /* 11 DCLK */ 430 | #define FLAG_PHASE1_12 0b00001100 /* 12 DCLK */ 431 | #define FLAG_PHASE1_13 0b00001101 /* 13 DCLK */ 432 | #define FLAG_PHASE1_14 0b00001110 /* 14 DCLK */ 433 | #define FLAG_PHASE1_15 0b00001111 /* 15 DCLK */ 434 | /* phase 2 period */ 435 | #define FLAG_PHASE2_1 0b00010000 /* 1 DCLK */ 436 | #define FLAG_PHASE2_2 0b00100000 /* 2 DCLK (default) */ 437 | #define FLAG_PHASE2_3 0b00100000 /* 3 DCLK */ 438 | #define FLAG_PHASE2_4 0b01000000 /* 4 DCLK */ 439 | #define FLAG_PHASE2_5 0b01010000 /* 5 DCLK */ 440 | #define FLAG_PHASE2_6 0b01100000 /* 6 DCLK */ 441 | #define FLAG_PHASE2_7 0b01110000 /* 7 DCLK */ 442 | #define FLAG_PHASE2_8 0b10000000 /* 8 DCLK */ 443 | #define FLAG_PHASE2_9 0b10010000 /* 9 DCLK */ 444 | #define FLAG_PHASE2_10 0b10100000 /* 10 DCLK */ 445 | #define FLAG_PHASE2_11 0b10110000 /* 11 DCLK */ 446 | #define FLAG_PHASE2_12 0b11000000 /* 12 DCLK */ 447 | #define FLAG_PHASE2_13 0b11010000 /* 13 DCLK */ 448 | #define FLAG_PHASE2_14 0b11100000 /* 14 DCLK */ 449 | #define FLAG_PHASE2_15 0b11110000 /* 15 DCLK */ 450 | 451 | 452 | /* 453 | * set V_COM_H deselect level 454 | * - 2 byte command 455 | */ 456 | 457 | /* byte #1: command */ 458 | #define CMD_DESELECT_LEVEL 0b11011011 /* set V_COM_H deselect level */ 459 | 460 | /* byte #2: level */ 461 | #define FLAG_LEVEL_65 0b00000000 /* 0.65 * Vcc */ 462 | #define FLAG_LEVEL_77 0b00100000 /* 0.77 * Vcc (default) */ 463 | #define FLAG_LEVEL_83 0b00110000 /* 0.83 * Vcc */ 464 | 465 | 466 | 467 | /* ************************************************************************ 468 | * advanced graphic commands 469 | * ************************************************************************ */ 470 | 471 | 472 | /* 473 | * set fade-out and blinking 474 | * - 2 byte command 475 | */ 476 | 477 | /* byte #1: command */ 478 | #define CMD_FADE_BLINK 0b00100011 /* set fade-out/blinking */ 479 | 480 | /* byte #2: modes */ 481 | #define FLAG_FADE_BLINK_OFF 0b00000000 /* disable fade-out/blinking */ 482 | #define FLAG_FADE_ON 0b00100000 /* enable fade-out */ 483 | #define FLAG_BLINK_ON 0b00110000 /* enable blinking */ 484 | /* time interval for fade-out steps */ 485 | #define FLAG_FADE_8 0b00000000 /* 8 frames */ 486 | #define FLAG_FADE_16 0b00000001 /* 16 frames */ 487 | #define FLAG_FADE_24 0b00000010 /* 24 frames */ 488 | #define FLAG_FADE_32 0b00000011 /* 32 frames */ 489 | #define FLAG_FADE_40 0b00000100 /* 40 frames */ 490 | #define FLAG_FADE_48 0b00000101 /* 48 frames */ 491 | #define FLAG_FADE_56 0b00000110 /* 56 frames */ 492 | #define FLAG_FADE_64 0b00000111 /* 64 frames */ 493 | #define FLAG_FADE_72 0b00001000 /* 72 frames */ 494 | #define FLAG_FADE_80 0b00001001 /* 80 frames */ 495 | #define FLAG_FADE_88 0b00001010 /* 88 frames */ 496 | #define FLAG_FADE_96 0b00001011 /* 96 frames */ 497 | #define FLAG_FADE_104 0b00001100 /* 104 frames */ 498 | #define FLAG_FADE_112 0b00001101 /* 112 frames */ 499 | #define FLAG_FADE_120 0b00001110 /* 120 frames */ 500 | #define FLAG_FADE_128 0b00001111 /* 128 frames */ 501 | 502 | 503 | /* 504 | * set zoom-in 505 | * - 2 byte command 506 | */ 507 | 508 | /* byte #1: command */ 509 | #define CMD_ZOOM 0b11010110 /* set zoom-in */ 510 | 511 | /* byte #2: mode */ 512 | #define FLAG_ZOOM_OFF 0b00000000 /* disable zoom-in */ 513 | #define FLAG_ZOOM_ON 0b00000001 /* enable zoom-in */ 514 | 515 | 516 | /* 517 | * no operation 518 | */ 519 | 520 | #define CMD_NOP 0b11100011 /* no operation */ 521 | 522 | 523 | 524 | /* ************************************************************************ 525 | * EOF 526 | * ************************************************************************ */ 527 | -------------------------------------------------------------------------------- /firmware 1.34/ST7565R.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ST7565R.c -------------------------------------------------------------------------------- /firmware 1.34/ST7565R.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * ST7565R graphic display controller 4 | * 5 | * (c) 2015-2017 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | 10 | /* ************************************************************************ 11 | * LCD commands 12 | * ************************************************************************ */ 13 | 14 | 15 | /* 16 | * switch display on/off 17 | */ 18 | 19 | #define CMD_DISPLAY 0b10101110 /* switch display on/off */ 20 | 21 | #define FLAG_DISPLAY_OFF 0b00000000 /* display off */ 22 | #define FLAG_DISPLAY_ON 0b00000001 /* display on */ 23 | 24 | 25 | /* 26 | * set start line 27 | * - valid range: 0 - 63 28 | */ 29 | 30 | #define CMD_START_LINE 0b01000000 /* set start line */ 31 | 32 | 33 | /* 34 | * set page 35 | * - valid range: 0 - 8 36 | */ 37 | 38 | #define CMD_PAGE 0b10110000 /* set page */ 39 | 40 | 41 | /* 42 | * set column MSB 43 | * - valid range: 0 - 131 44 | */ 45 | 46 | #define CMD_COLUMN_H 0b00010000 /* set MSB (upper nibble) of column */ 47 | 48 | 49 | /* 50 | * set column LSB 51 | * - valid range: 0 - 131 52 | */ 53 | 54 | #define CMD_COLUMN_L 0b00000000 /* set LSB (lower nibble) of column */ 55 | 56 | 57 | /* 58 | * segment driver direction (horizontal direction) 59 | */ 60 | 61 | #define CMD_SEGMENT_DIR 0b10100000 /* set segment driver direction (horizontal direction) */ 62 | 63 | #define FLAG_ADC_NORMAL 0b00000000 /* normal */ 64 | #define FLAG_ADC_REVERSE 0b00000001 /* reversed/flipped */ 65 | 66 | 67 | /* 68 | * display image mode 69 | */ 70 | 71 | #define CMD_IMAGE_MODE 0b10100110 /* set display image mode */ 72 | 73 | #define FLAG_IMAGE_NORMAL 0b00000000 /* normal / positive */ 74 | #define FLAG_IMAGE_REVERSE 0b00000001 /* reverse / negative */ 75 | 76 | 77 | /* 78 | * all points mode 79 | */ 80 | 81 | #define CMD_ALL_POINTS 0b10100100 /* set "all points" mode */ 82 | 83 | #define FLAG_POINTS_OFF 0b00000000 /* normal mode */ 84 | #define FLAG_POINTS_ON 0b00000001 /* display all points */ 85 | 86 | 87 | /* 88 | * bias ratio of LCD drive voltage 89 | */ 90 | 91 | #define CMD_LCD_BIAS 0b10100010 /* set bias ratio of LCD drive voltage */ 92 | 93 | #define FLAG_BIAS_19 0b00000000 /* 1/9 */ 94 | #define FLAG_BIAS_17 0b00000001 /* 1/7 */ 95 | 96 | 97 | /* 98 | * enter read-modify-write mode 99 | */ 100 | 101 | #define CMC_R_M_W 0b11100000 /* enter read-modify-write mode */ 102 | 103 | 104 | /* 105 | * end read-modify-write mode 106 | */ 107 | 108 | #define CMD_END 0b11101110 /* end read-modify-write mode */ 109 | 110 | 111 | /* 112 | * internal reset 113 | */ 114 | 115 | #define CMD_RESET 0b11100010 /* perform internal reset */ 116 | 117 | 118 | /* 119 | * common driver direction (vertical direction) 120 | */ 121 | 122 | #define CMD_COMMON_DIR 0b11000000 /* set common driver direction (vertical direction) */ 123 | 124 | #define FLAG_COM_NORMAL 0b00000000 /* normal */ 125 | #define FLAG_COM_REVERSE 0b00001000 /* reversed/flipped */ 126 | 127 | 128 | /* 129 | * power supply operation mode 130 | */ 131 | 132 | #define CMD_POWER_MODE 0b00101000 /* select power supply operation mode */ 133 | 134 | #define FLAG_FOLOWER_OFF 0b00000000 /* voltage folower circuit off */ 135 | #define FLAG_FOLOWER_ON 0b00000001 /* voltage folower circuit on */ 136 | #define FLAG_REGULATOR_OFF 0b00000000 /* voltage regulator off */ 137 | #define FLAG_REGULATOR_ON 0b00000010 /* voltage regulator on */ 138 | #define FLAG_BOOSTER_OFF 0b00000000 /* booster circuit off */ 139 | #define FLAG_BOOSTER_ON 0b00000100 /* booster circuit on */ 140 | 141 | 142 | /* 143 | * V0 regulator resistor ratio (1 + Rb/Ra) 144 | */ 145 | 146 | #define CMD_V0_RATIO 0b00100000 /* select resistor ratio for V0/contrast voltage regulator */ 147 | 148 | #define FLAG_RATIO_30 0b00000000 /* ratio 3.0 */ 149 | #define FLAG_RATIO_35 0b00000001 /* ratio 3.5 */ 150 | #define FLAG_RATIO_40 0b00000010 /* ratio 4.0 */ 151 | #define FLAG_RATIO_45 0b00000011 /* ratio 4.5 */ 152 | #define FLAG_RATIO_50 0b00000100 /* ratio 5.0 */ 153 | #define FLAG_RATIO_55 0b00000101 /* ratio 5.5 */ 154 | #define FLAG_RATIO_60 0b00000110 /* ratio 6.0 */ 155 | #define FLAG_RATIO_65 0b00000111 /* ratio 6.5 */ 156 | 157 | 158 | /* 159 | * set contrast 160 | * - 2 byte command 161 | * - valid range: 63 - 0 162 | */ 163 | 164 | /* byte #1: command */ 165 | #define CMD_V0_MODE 0b10000001 /* enable V0/contrast value set mode */ 166 | 167 | /* byte #2: V0/contrast value */ 168 | /* valid range: 63 (00000) - 0 (11111) */ 169 | 170 | 171 | /* 172 | * indicator state 173 | * - 2 byte command when enabling 174 | */ 175 | 176 | /* byte #1: command */ 177 | #define CMD_INDICATOR_MODE 0b10101100 /* enable/disable indicator */ 178 | 179 | /* byte #2: indicator state */ 180 | #define FLAG_INDICATOR_OFF 0b00000000 /* off */ 181 | #define FLAG_INDICATOR_1HZ 0b00000001 /* blinking at 1Hz */ 182 | #define FLAG_INDICATOR_05HZ 0b00000010 /* blinking at 0.5Hz */ 183 | #define FLAG_INDICATOR_ON 0b00000011 /* on (permanently) */ 184 | 185 | 186 | /* 187 | * booster ratio 188 | * - 2 byte command 189 | */ 190 | 191 | /* byte #1: command */ 192 | #define CMD_BOOSTER_MODE 0b11111000 /* enable booster ratio set mode */ 193 | 194 | /* byte #2: booster ratio */ 195 | #define FLAG_BOOSTER_234 0b00000000 /* 2x, 3x, 4x */ 196 | #define FLAG_BOOSTER_5 0b00000001 /* 5x */ 197 | #define FLAG_BOOSTER_6 0b00000010 /* 6x */ 198 | 199 | 200 | /* 201 | * no operation 202 | */ 203 | 204 | #define CMD_NOP 0b11100011 /* no operation */ 205 | 206 | 207 | /* 208 | * test 209 | */ 210 | 211 | #define CMD_TEST 0b11111100 /* test chip (don't use this cmd!) */ 212 | 213 | 214 | 215 | /* ************************************************************************ 216 | * EOF 217 | * ************************************************************************ */ 218 | -------------------------------------------------------------------------------- /firmware 1.34/ST7735.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ST7735.c -------------------------------------------------------------------------------- /firmware 1.34/ST7735.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ST7735.h -------------------------------------------------------------------------------- /firmware 1.34/ST7920.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ST7920.c -------------------------------------------------------------------------------- /firmware 1.34/ST7920.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/ST7920.h -------------------------------------------------------------------------------- /firmware 1.34/VT100.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * virtual LCD display for VT100 serial terminal 4 | * 5 | * (c) 2018 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | 10 | /* local includes */ 11 | #include "config.h" /* global configuration */ 12 | 13 | #ifdef LCD_VT100 14 | 15 | 16 | /* 17 | * local constants 18 | */ 19 | 20 | /* source management */ 21 | #define LCD_DRIVER_C 22 | 23 | 24 | /* 25 | * include header files 26 | */ 27 | 28 | /* local includes */ 29 | #include "common.h" /* common header file */ 30 | #include "variables.h" /* global variables */ 31 | #include "functions.h" /* external functions */ 32 | 33 | 34 | /* 35 | * local constants 36 | */ 37 | 38 | /* escape */ 39 | #define VT100_ESCAPE 0x1b /* escape character */ 40 | 41 | 42 | /* 43 | * local variables 44 | */ 45 | 46 | #ifdef LCD_COLOR 47 | /* color management */ 48 | uint8_t Color = 0; /* foreground color ID */ 49 | #endif 50 | 51 | 52 | 53 | /* ************************************************************************ 54 | * low level functions 55 | * ************************************************************************ */ 56 | 57 | 58 | /* 59 | * set up interface bus 60 | * - should be called at firmware startup 61 | */ 62 | 63 | void LCD_BusSetup(void) 64 | { 65 | /* 66 | * TTL serial is set up in main(). So we don't have to do 67 | * anything here. 68 | */ 69 | } 70 | 71 | 72 | 73 | /* ************************************************************************ 74 | * support functions 75 | * ************************************************************************ */ 76 | 77 | 78 | /* 79 | * send number as ASCII digits 80 | * 81 | * requires: 82 | * - number (0-255) 83 | */ 84 | 85 | void LCD_SendNumber(uint8_t Number) 86 | { 87 | uint8_t Run = 1; /* loop control */ 88 | uint8_t Digit; /* decimal digit */ 89 | 90 | while (Run) 91 | { 92 | if (Number >= 100) /* 3 digits */ 93 | { 94 | Digit = Number / 100; /* get first digit */ 95 | Number -= Digit * 100; /* update value */ 96 | } 97 | else if (Number >= 10) /* 2 digits */ 98 | { 99 | Digit = Number / 10; /* get first digit */ 100 | Number -= Digit * 10; /* update value */ 101 | } 102 | else /* one digit */ 103 | { 104 | Digit = Number; /* take this digit */ 105 | Run = 0; /* end loop */ 106 | } 107 | 108 | Serial_Char('0' + Digit); /* send digit */ 109 | } 110 | } 111 | 112 | 113 | 114 | /* 115 | * set color 116 | * - foreground, background and special features 117 | * 118 | * requires: 119 | * - color ID 120 | */ 121 | 122 | void LCD_SetColor(uint8_t ID) 123 | { 124 | /* set color: Esc[m */ 125 | Serial_Char(VT100_ESCAPE); /* send: escape */ 126 | Serial_Char('['); /* send: [ */ 127 | LCD_SendNumber(ID); /* send color ID */ 128 | Serial_Char('m'); /* send: m */ 129 | } 130 | 131 | 132 | 133 | /* ************************************************************************ 134 | * high level functions 135 | * ************************************************************************ */ 136 | 137 | 138 | /* 139 | * set LCD character position 140 | * - top left: 1/1 141 | * 142 | * requires: 143 | * - x: horizontal position (1-) 144 | * - y: vertical position (1-) 145 | */ 146 | 147 | void LCD_CharPos(uint8_t x, uint8_t y) 148 | { 149 | /* update UI */ 150 | UI.CharPos_X = x; 151 | UI.CharPos_Y = y; 152 | 153 | /* move cursor to screen location x,y: Esc[;H */ 154 | Serial_Char(VT100_ESCAPE); /* send: escape */ 155 | Serial_Char('['); /* send: [ */ 156 | LCD_SendNumber(y); /* send y pos */ 157 | Serial_Char(';'); /* send: ; */ 158 | LCD_SendNumber(x); /* send x pos */ 159 | Serial_Char('H'); /* send: H */ 160 | } 161 | 162 | 163 | 164 | /* 165 | * clear one single character line 166 | * 167 | * requires: 168 | * - Line: line number (1-) 169 | * special case line 0: clear remaining space in current line 170 | */ 171 | 172 | void LCD_ClearLine(uint8_t Line) 173 | { 174 | uint8_t X = 1; /* x position */ 175 | 176 | if (Line == 0) /* special case: rest of current line */ 177 | { 178 | Line = UI.CharPos_Y; /* get current line */ 179 | X = UI.CharPos_X; /* get current character position */ 180 | } 181 | 182 | LCD_CharPos(X, Line); /* set char position */ 183 | 184 | /* 185 | * clear entire line: Esc[2K 186 | * clear line from cursor right: Esc[K 187 | */ 188 | 189 | Serial_Char(VT100_ESCAPE); /* send: escape */ 190 | Serial_Char('['); /* send: [ */ 191 | 192 | if (X == 1) /* complete line */ 193 | { 194 | Serial_Char('2'); /* send: 2 */ 195 | } 196 | 197 | Serial_Char('K'); /* send: K */ 198 | } 199 | 200 | 201 | 202 | /* 203 | * clear the display 204 | */ 205 | 206 | void LCD_Clear(void) 207 | { 208 | /* clear entire screen: Esc[2J */ 209 | Serial_Char(VT100_ESCAPE); /* send: escape */ 210 | Serial_Char('['); /* send: [ */ 211 | Serial_Char('2'); /* send: 2 */ 212 | Serial_Char('J'); /* send: J */ 213 | 214 | LCD_CharPos(1, 1); /* reset character position */ 215 | } 216 | 217 | 218 | 219 | /* 220 | * initialize LCD 221 | */ 222 | 223 | void LCD_Init(void) 224 | { 225 | /* update maximums */ 226 | UI.CharMax_X = LCD_CHAR_X; /* characters per line */ 227 | UI.CharMax_Y = LCD_CHAR_Y; /* lines */ 228 | 229 | /* make cusor invisible: Esc[?25l */ 230 | Serial_Char(VT100_ESCAPE); /* send: escape */ 231 | Serial_Char('['); /* send: [ */ 232 | Serial_Char('?'); /* send: ? */ 233 | Serial_Char('2'); /* send: 2 */ 234 | Serial_Char('5'); /* send: 5 */ 235 | Serial_Char('l'); /* send: l */ 236 | 237 | #ifdef LCD_COLOR 238 | /* set backgound color ID (= foreground color ID + 10) */ 239 | LCD_SetColor(COLOR_BACKGROUND + 10); 240 | #endif 241 | 242 | LCD_Clear(); /* clear display */ 243 | } 244 | 245 | 246 | /* 247 | * display a single character 248 | * 249 | * requires: 250 | * - Char: character to display 251 | */ 252 | 253 | void LCD_Char(unsigned char Char) 254 | { 255 | /* prevent x overflow */ 256 | if (UI.CharPos_X > LCD_CHAR_X) return; 257 | 258 | #ifdef LCD_COLOR 259 | /* only set color after a change */ 260 | if (UI.PenColor != Color) /* color has changed */ 261 | { 262 | Color = UI.PenColor; /* update color ID */ 263 | LCD_SetColor(Color); /* and set new color */ 264 | } 265 | #endif 266 | 267 | Serial_Char(Char); /* send character */ 268 | 269 | /* update character position */ 270 | UI.CharPos_X++; /* next character in current line */ 271 | } 272 | 273 | 274 | 275 | /* 276 | * set cursor 277 | * 278 | * required: 279 | * - Mode: cursor mode 280 | * 0: cursor on 281 | * 1: cursor off 282 | */ 283 | 284 | void LCD_Cursor(uint8_t Mode) 285 | { 286 | LCD_CharPos(LCD_CHAR_X, LCD_CHAR_Y); /* move to bottom right */ 287 | 288 | if (Mode) /* cursor on */ 289 | { 290 | LCD_Char('>'); 291 | } 292 | else /* cursor off */ 293 | { 294 | LCD_Char(' '); 295 | } 296 | } 297 | 298 | 299 | 300 | /* ************************************************************************ 301 | * clean-up of local constants 302 | * ************************************************************************ */ 303 | 304 | 305 | /* source management */ 306 | #undef LCD_DRIVER_C 307 | 308 | #endif 309 | 310 | /* ************************************************************************ 311 | * EOF 312 | * ************************************************************************ */ 313 | -------------------------------------------------------------------------------- /firmware 1.34/adjust.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/adjust.c -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_10x16_hf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_10x16_hf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_12x16_hf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_12x16_hf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_16x26_hf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_16x26_hf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_6x8_v_f.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_6x8_v_f.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_6x8_vf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_6x8_vf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_8x16_cyrillic_hf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_8x16_cyrillic_hf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_8x16_vfp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_8x16_vfp.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_8x8_h.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_8x8_h.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_8x8_hf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_8x8_hf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_8x8_vf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_8x8_vf.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_HD44780_cyr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_HD44780_cyr.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/font_HD44780_int.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/bitmaps/font_HD44780_int.h -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/symbols_24x24_h.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * 24x24 component symbols 4 | * horizontally aligned 5 | * 6 | * (c) 2015-2017 by Markus Reschke 7 | * 8 | * ************************************************************************ */ 9 | 10 | 11 | /* ************************************************************************ 12 | * symbol data 13 | * ************************************************************************ */ 14 | 15 | #ifdef SYMBOLS_24X24_H 16 | 17 | 18 | /* symbol size */ 19 | #define SYMBOL_SIZE_X 24 /* width: 24 dots */ 20 | #define SYMBOL_SIZE_Y 24 /* heigth: 24 dots */ 21 | 22 | /* symbol data format */ 23 | #define SYMBOL_BYTES_N 72 /* 72 bytes per symbol */ 24 | #define SYMBOL_BYTES_X 3 /* 3 bytes in x direction */ 25 | #define SYMBOL_BYTES_Y 24 /* 24 bytes in y direction */ 26 | 27 | 28 | /* 29 | * symbol bitmaps 30 | * - format: 31 | * - 72 bytes per symbol 32 | * - first three bytes: first horizontal line (top to down) 33 | * first byte: left part 34 | * - bit #0: right / bit #7: left 35 | */ 36 | /* todo: this is vertically aligned and needs conversion */ 37 | const uint8_t SymbolData[] PROGMEM = { 38 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 39 | 0x00,0x90,0x04,0x61,0x10,0x08,0x62,0x08,0x08,0x64,0x08,0x10,0x68,0x04,0x10,0x70, 40 | 0x04,0xFF,0xE0,0x04,0x10,0x70,0x04,0x10,0x68,0x04,0x08,0x65,0x08,0x08,0x63,0x08, 41 | 0x04,0x67,0x10,0x04,0x00,0x90,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 42 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* BJT npn */ 43 | 44 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 45 | 0x00,0x90,0x04,0x65,0x10,0x08,0x66,0x08,0x08,0x67,0x08,0x10,0x68,0x04,0x10,0x70, 46 | 0x04,0xFF,0xE0,0x04,0x10,0x70,0x04,0x10,0x68,0x04,0x08,0x64,0x08,0x08,0x62,0x08, 47 | 0x04,0x61,0x10,0x04,0x00,0x90,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 48 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* BJT pnp */ 49 | 50 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 51 | 0x20,0x50,0x04,0xBF,0xD0,0x08,0xA0,0x08,0x08,0x80,0x08,0x10,0x82,0x04,0x10,0xA6, 52 | 0x04,0x10,0xBF,0xC4,0x10,0xA6,0x44,0x10,0x82,0x44,0x08,0x80,0x48,0x08,0xA0,0x48, 53 | 0xFF,0xBF,0xD0,0x04,0x20,0x50,0x03,0x00,0x60,0x00,0xC1,0xE0,0x00,0x3E,0x40,0x00, 54 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* MOSFET enh n-ch */ 55 | 56 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 57 | 0x20,0x50,0xFF,0xBF,0xD0,0x08,0xA0,0x08,0x08,0x80,0x08,0x10,0x84,0x04,0x10,0xA6, 58 | 0x04,0x10,0xBF,0xC4,0x10,0xA6,0x44,0x10,0x84,0x44,0x08,0x80,0x48,0x08,0xA0,0x48, 59 | 0x04,0xBF,0xD0,0x04,0x20,0x50,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 60 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* MOSFET enh p-ch */ 61 | 62 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 63 | 0x20,0x50,0x04,0xBF,0xD0,0x08,0xA0,0x08,0x08,0xA0,0x08,0x10,0xA2,0x04,0x10,0xA6, 64 | 0x04,0x10,0xBF,0xC4,0x10,0xA6,0x44,0x10,0xA2,0x44,0x08,0xA0,0x48,0x08,0xA0,0x48, 65 | 0xFF,0xBF,0xD0,0x04,0x20,0x50,0x03,0x00,0x60,0x00,0xC1,0xE0,0x00,0x3E,0x40,0x00, 66 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* MOSFET dep n-ch */ 67 | 68 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 69 | 0x20,0x50,0xFF,0xBF,0xD0,0x08,0xA0,0x08,0x08,0xA0,0x08,0x10,0xA4,0x04,0x10,0xA6, 70 | 0x04,0x10,0xBF,0xC4,0x10,0xA6,0x44,0x10,0xA4,0x44,0x08,0xA0,0x48,0x08,0xA0,0x48, 71 | 0x04,0xBF,0xD0,0x04,0x20,0x50,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 72 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* MOSFET dep p-ch */ 73 | 74 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 75 | 0x10,0x50,0x04,0x10,0x50,0x08,0x1F,0xC8,0x08,0x10,0x08,0x10,0x10,0x04,0x10,0x10, 76 | 0x04,0x10,0x10,0x04,0x10,0x10,0x04,0x10,0x90,0x04,0x08,0xD0,0x08,0xFF,0xFF,0xC8, 77 | 0x04,0xD0,0x50,0x04,0x90,0x50,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 78 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* JFET n-ch */ 79 | 80 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 81 | 0x50,0x50,0x04,0xD0,0x50,0xFF,0xFF,0xC8,0x08,0xD0,0x08,0x10,0x50,0x04,0x10,0x10, 82 | 0x04,0x10,0x10,0x04,0x10,0x10,0x04,0x10,0x10,0x04,0x08,0x10,0x08,0x08,0x1F,0xC8, 83 | 0x04,0x10,0x50,0x04,0x10,0x50,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 84 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* JFET p-ch */ 85 | 86 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 87 | 0x00,0x90,0x04,0x21,0x10,0x08,0xA2,0x08,0x08,0xA4,0x08,0x10,0xA8,0x04,0x10,0xB0, 88 | 0x04,0xFF,0xA0,0x04,0x10,0xB0,0x04,0x10,0xA8,0x04,0x08,0xA5,0x08,0x08,0xA3,0x08, 89 | 0x04,0x27,0x10,0x04,0x00,0x90,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 90 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* IGBT enh n-ch */ 91 | 92 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 93 | 0x00,0x90,0x04,0x25,0x10,0x08,0xA6,0x08,0x08,0xA7,0x08,0x10,0xA8,0x04,0x10,0xB0, 94 | 0x04,0xFF,0xA0,0x04,0x10,0xB0,0x04,0x10,0xA8,0x04,0x08,0xA4,0x08,0x08,0xA2,0x08, 95 | 0x04,0x21,0x10,0x04,0x00,0x90,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 96 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00, /* IGBT enh p-ch */ 97 | 98 | 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x01, 99 | 0xFF,0xC0,0x00,0xFF,0x80,0x00,0xFF,0x80,0x00,0x7F,0x00,0x00,0x7F,0x00,0x00,0x3E, 100 | 0x00,0x00,0x3E,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x08,0x00,0x01,0xFF,0xC0, 101 | 0x00,0x18,0x00,0x00,0x28,0x00,0x00,0x48,0x00,0x7F,0x88,0x00,0x00,0x08,0x00,0x00, 102 | 0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00, /* SCR */ 103 | 104 | 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00, 105 | 0x08,0x00,0x00,0x08,0x00,0x1F,0xFF,0xFC,0x01,0x07,0xFC,0x03,0x83,0xF8,0x03,0x83, 106 | 0xF8,0x07,0xC1,0xF0,0x07,0xC1,0xF0,0x0F,0xE0,0xE0,0x0F,0xE0,0xE0,0x1F,0xF0,0x40, 107 | 0x1F,0xFF,0xFC,0x01,0x08,0x00,0x02,0x08,0x00,0x04,0x08,0x00,0xF8,0x08,0x00,0x00, 108 | 0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00, /* Triac */ 109 | 110 | 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x7F,0x88,0x00,0x00, 111 | 0x48,0x00,0x00,0x28,0x00,0x00,0x18,0x00,0x01,0xFF,0xC0,0x00,0xFF,0x80,0x00,0xFF, 112 | 0x80,0x00,0x7F,0x00,0x00,0x7F,0x00,0x00,0x3E,0x00,0x00,0x3E,0x00,0x00,0x1C,0x00, 113 | 0x00,0x1C,0x00,0x00,0x08,0x00,0x01,0xFF,0xC0,0x00,0x08,0x00,0x00,0x08,0x00,0x00, 114 | 0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00 /* PUT */ 115 | 116 | #ifdef SW_UJT 117 | , 118 | 0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x3E,0x40,0x00,0xC1,0xC0,0x03,0x00,0x60,0x04, 119 | 0x10,0x50,0xFC,0x10,0x50,0x0A,0x1F,0xC8,0x09,0x50,0x08,0x10,0xD0,0x04,0x11,0xD0, 120 | 0x04,0x10,0x30,0x04,0x10,0x10,0x04,0x10,0x10,0x04,0x08,0x10,0x08,0x08,0x1F,0xC8, 121 | 0x04,0x10,0x50,0x04,0x10,0x50,0x03,0x00,0x60,0x00,0xC1,0xC0,0x00,0x3E,0x40,0x00, 122 | 0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00 /* UJT */ 123 | #endif 124 | }; 125 | 126 | 127 | 128 | /* 129 | * pin position lookup table 130 | * - one byte per pin and 3 bytes (pins) for each symbol 131 | * - cross reference for the Semi structure's pins: 132 | * 133 | * BJT FET SCR Triac IGBT 134 | * ------------------------------------------------------------------ 135 | * A Base Gate Gate Gate Gate 136 | * B Collector Drain Anode MT2 Collector 137 | * C Emitter Source Cathode MT1 Emitter 138 | * 139 | * PUT UJT 140 | * ------------------------------------------------------------------ 141 | * A Gate Emitter 142 | * B Anode B2 143 | * C Cathode B1 144 | */ 145 | 146 | const uint8_t PinTable[] PROGMEM = { 147 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* BJT npn */ 148 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* BJT pnp */ 149 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET enh n-ch */ 150 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET enh p-ch */ 151 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET dep n-ch */ 152 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET dep p-ch */ 153 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* JFET n-ch */ 154 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* JFET p-ch */ 155 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* IGBT enh n-ch */ 156 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* IGBT enh p-ch */ 157 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* SCR */ 158 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* Triac */ 159 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* PUT */ 160 | #ifdef SW_UJT 161 | , 162 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* UJT */ 163 | #endif 164 | }; 165 | 166 | 167 | 168 | #endif 169 | 170 | /* ************************************************************************ 171 | * EOF 172 | * ************************************************************************ */ 173 | -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/symbols_24x24_hf.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * 24x24 component symbols 4 | * horizontally aligned, horizontal bit order flipped 5 | * 6 | * (c) 2015-2017 by Markus Reschke 7 | * 8 | * ************************************************************************ */ 9 | 10 | 11 | /* ************************************************************************ 12 | * symbol data 13 | * ************************************************************************ */ 14 | 15 | #ifdef SYMBOLS_24X24_HF 16 | 17 | 18 | /* symbol size */ 19 | #define SYMBOL_SIZE_X 24 /* width: 24 dots */ 20 | #define SYMBOL_SIZE_Y 24 /* heigth: 24 dots */ 21 | 22 | /* symbol data format */ 23 | #define SYMBOL_BYTES_N 72 /* 72 bytes per symbol */ 24 | #define SYMBOL_BYTES_X 3 /* 3 bytes in x direction */ 25 | #define SYMBOL_BYTES_Y 24 /* 24 bytes in y direction */ 26 | 27 | 28 | /* 29 | * symbol bitmaps 30 | * - format: 31 | * - 72 bytes per symbol 32 | * - first three bytes: first horizontal line (top to down) 33 | * first byte: left part 34 | * - bit #0: left / bit #7: right (horizontally flipped) 35 | */ 36 | /* todo: this is vertically aligned and needs conversion */ 37 | const uint8_t SymbolData[] PROGMEM = { 38 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 39 | 0x00,0x09,0x20,0x86,0x08,0x10,0x46,0x10,0x10,0x26,0x10,0x08,0x16,0x20,0x08,0x0E, 40 | 0x20,0xFF,0x07,0x20,0x08,0x0E,0x20,0x08,0x16,0x20,0x10,0xA6,0x10,0x10,0xC6,0x10, 41 | 0x20,0xE6,0x08,0x20,0x00,0x09,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 42 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* BJT npn */ 43 | 44 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 45 | 0x00,0x09,0x20,0xA6,0x08,0x10,0x66,0x10,0x10,0xE6,0x10,0x08,0x16,0x20,0x08,0x0E, 46 | 0x20,0xFF,0x07,0x20,0x08,0x0E,0x20,0x08,0x16,0x20,0x10,0x26,0x10,0x10,0x46,0x10, 47 | 0x20,0x86,0x08,0x20,0x00,0x09,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 48 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* BJT pnp */ 49 | 50 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 51 | 0x04,0x0A,0x20,0xFD,0x0B,0x10,0x05,0x10,0x10,0x01,0x10,0x08,0x41,0x20,0x08,0x65, 52 | 0x20,0x08,0xFD,0x23,0x08,0x65,0x22,0x08,0x41,0x22,0x10,0x01,0x12,0x10,0x05,0x12, 53 | 0xFF,0xFD,0x0B,0x20,0x04,0x0A,0xC0,0x00,0x06,0x00,0x83,0x07,0x00,0x7C,0x02,0x00, 54 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* MOSFET enh n-ch */ 55 | 56 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 57 | 0x04,0x0A,0xFF,0xFD,0x0B,0x10,0x05,0x10,0x10,0x01,0x10,0x08,0x21,0x20,0x08,0x65, 58 | 0x20,0x08,0xFD,0x23,0x08,0x65,0x22,0x08,0x21,0x22,0x10,0x01,0x12,0x10,0x05,0x12, 59 | 0x20,0xFD,0x0B,0x20,0x04,0x0A,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 60 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* MOSFET enh p-ch */ 61 | 62 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 63 | 0x04,0x0A,0x20,0xFD,0x0B,0x10,0x05,0x10,0x10,0x05,0x10,0x08,0x45,0x20,0x08,0x65, 64 | 0x20,0x08,0xFD,0x23,0x08,0x65,0x22,0x08,0x45,0x22,0x10,0x05,0x12,0x10,0x05,0x12, 65 | 0xFF,0xFD,0x0B,0x20,0x04,0x0A,0xC0,0x00,0x06,0x00,0x83,0x07,0x00,0x7C,0x02,0x00, 66 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* MOSFET dep n-ch */ 67 | 68 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 69 | 0x04,0x0A,0xFF,0xFD,0x0B,0x10,0x05,0x10,0x10,0x05,0x10,0x08,0x25,0x20,0x08,0x65, 70 | 0x20,0x08,0xFD,0x23,0x08,0x65,0x22,0x08,0x25,0x22,0x10,0x05,0x12,0x10,0x05,0x12, 71 | 0x20,0xFD,0x0B,0x20,0x04,0x0A,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 72 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* MOSFET dep p-ch */ 73 | 74 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 75 | 0x08,0x0A,0x20,0x08,0x0A,0x10,0xF8,0x13,0x10,0x08,0x10,0x08,0x08,0x20,0x08,0x08, 76 | 0x20,0x08,0x08,0x20,0x08,0x08,0x20,0x08,0x09,0x20,0x10,0x0B,0x10,0xFF,0xFF,0x13, 77 | 0x20,0x0B,0x0A,0x20,0x09,0x0A,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 78 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* JFET n-ch */ 79 | 80 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 81 | 0x0A,0x0A,0x20,0x0B,0x0A,0xFF,0xFF,0x13,0x10,0x0B,0x10,0x08,0x0A,0x20,0x08,0x08, 82 | 0x20,0x08,0x08,0x20,0x08,0x08,0x20,0x08,0x08,0x20,0x10,0x08,0x10,0x10,0xF8,0x13, 83 | 0x20,0x08,0x0A,0x20,0x08,0x0A,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 84 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* JFET p-ch */ 85 | 86 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 87 | 0x00,0x09,0x20,0x84,0x08,0x10,0x45,0x10,0x10,0x25,0x10,0x08,0x15,0x20,0x08,0x0D, 88 | 0x20,0xFF,0x05,0x20,0x08,0x0D,0x20,0x08,0x15,0x20,0x10,0xA5,0x10,0x10,0xC5,0x10, 89 | 0x20,0xE4,0x08,0x20,0x00,0x09,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 90 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* IGBT enh n-ch */ 91 | 92 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 93 | 0x00,0x09,0x20,0xA4,0x08,0x10,0x65,0x10,0x10,0xE5,0x10,0x08,0x15,0x20,0x08,0x0D, 94 | 0x20,0xFF,0x05,0x20,0x08,0x0D,0x20,0x08,0x15,0x20,0x10,0x25,0x10,0x10,0x45,0x10, 95 | 0x20,0x84,0x08,0x20,0x00,0x09,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 96 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00, /* IGBT enh p-ch */ 97 | 98 | 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x80, 99 | 0xFF,0x03,0x00,0xFF,0x01,0x00,0xFF,0x01,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x7C, 100 | 0x00,0x00,0x7C,0x00,0x00,0x38,0x00,0x00,0x38,0x00,0x00,0x10,0x00,0x80,0xFF,0x03, 101 | 0x00,0x18,0x00,0x00,0x14,0x00,0x00,0x12,0x00,0xFE,0x11,0x00,0x00,0x10,0x00,0x00, 102 | 0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x00, /* SCR */ 103 | 104 | 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00, 105 | 0x10,0x00,0x00,0x10,0x00,0xF8,0xFF,0x3F,0x80,0xE0,0x3F,0xC0,0xC1,0x1F,0xC0,0xC1, 106 | 0x1F,0xE0,0x83,0x0F,0xE0,0x83,0x0F,0xF0,0x07,0x07,0xF0,0x07,0x07,0xF8,0x0F,0x02, 107 | 0xF8,0xFF,0x3F,0x80,0x10,0x00,0x40,0x10,0x00,0x20,0x10,0x00,0x1F,0x10,0x00,0x00, 108 | 0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00, /* Triac */ 109 | 110 | 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0xFE,0x11,0x00,0x00, 111 | 0x12,0x00,0x00,0x14,0x00,0x00,0x18,0x00,0x80,0xFF,0x03,0x00,0xFF,0x01,0x00,0xFF, 112 | 0x01,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00,0x38,0x00, 113 | 0x00,0x38,0x00,0x00,0x10,0x00,0x80,0xFF,0x03,0x00,0x10,0x00,0x00,0x10,0x00,0x00, 114 | 0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x00 /* PUT */ 115 | 116 | #ifdef SW_UJT 117 | , 118 | 0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x7C,0x02,0x00,0x83,0x03,0xC0,0x00,0x06,0x20, 119 | 0x08,0x0A,0x3F,0x08,0x0A,0x50,0xF8,0x13,0x90,0x0A,0x10,0x08,0x0B,0x20,0x88,0x0B, 120 | 0x20,0x08,0x0C,0x20,0x08,0x08,0x20,0x08,0x08,0x20,0x10,0x08,0x10,0x10,0xF8,0x13, 121 | 0x20,0x08,0x0A,0x20,0x08,0x0A,0xC0,0x00,0x06,0x00,0x83,0x03,0x00,0x7C,0x02,0x00, 122 | 0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00 /* UJT */ 123 | #endif 124 | }; 125 | 126 | 127 | 128 | /* 129 | * pin position lookup table 130 | * - one byte per pin and 3 bytes (pins) for each symbol 131 | * - cross reference for the Semi structure's pins: 132 | * 133 | * BJT FET SCR Triac IGBT 134 | * ------------------------------------------------------------------ 135 | * A Base Gate Gate Gate Gate 136 | * B Collector Drain Anode MT2 Collector 137 | * C Emitter Source Cathode MT1 Emitter 138 | * 139 | * PUT UJT 140 | * ------------------------------------------------------------------ 141 | * A Gate Emitter 142 | * B Anode B2 143 | * C Cathode B1 144 | */ 145 | 146 | const uint8_t PinTable[] PROGMEM = { 147 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* BJT npn */ 148 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* BJT pnp */ 149 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET enh n-ch */ 150 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET enh p-ch */ 151 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET dep n-ch */ 152 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET dep p-ch */ 153 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* JFET n-ch */ 154 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* JFET p-ch */ 155 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* IGBT enh n-ch */ 156 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* IGBT enh p-ch */ 157 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* SCR */ 158 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* Triac */ 159 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* PUT */ 160 | #ifdef SW_UJT 161 | , 162 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* UJT */ 163 | #endif 164 | }; 165 | 166 | 167 | 168 | #endif 169 | 170 | /* ************************************************************************ 171 | * EOF 172 | * ************************************************************************ */ 173 | -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/symbols_24x24_vfp.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * 24x24 component symbols 4 | * vertically aligned, vertical bit order flipped 5 | * with bank/page-wise grouping 6 | * 7 | * (c) 2015-2017 by Markus Reschke 8 | * 9 | * ************************************************************************ */ 10 | 11 | 12 | /* ************************************************************************ 13 | * symbol data 14 | * ************************************************************************ */ 15 | 16 | #ifdef SYMBOLS_24X24_VFP 17 | 18 | 19 | /* symbol size */ 20 | #define SYMBOL_SIZE_X 24 /* width: 24 dots */ 21 | #define SYMBOL_SIZE_Y 24 /* heigth: 24 dots */ 22 | 23 | /* symbol data format */ 24 | #define SYMBOL_BYTES_N 72 /* 72 bytes per symbol */ 25 | #define SYMBOL_BYTES_X 24 /* 24 bytes in x direction */ 26 | #define SYMBOL_BYTES_Y 3 /* 3 bytes in y direction */ 27 | 28 | 29 | /* 30 | * symbol bitmaps 31 | * - format: 32 | * - 72 bytes per symbol 33 | * - first byte: first vertical line of top 8 rows (left to right) 34 | * - first 24 bytes: all vertical lines of top 8 rows 35 | * next 24 bytes: all vertical lines of next 8 rows 36 | * last 24 bytes: all vertical lines of last 8 rows 37 | * - bit #0: top / bit #7: bottom (vertically flipped) 38 | */ 39 | 40 | const uint8_t SymbolData[] PROGMEM = { 41 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0x08,0xC8,0xC4,0x04,0x04,0x04,0x84,0x48, 42 | 0x28,0x1F,0x10,0x60,0x80,0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0xC9,0x08,0x08,0x08, 43 | 0x08,0xFF,0xFF,0x14,0x22,0x41,0x80,0xC0,0x00,0x00,0x00,0x00,0xC1,0x3E,0x00,0x00, 44 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x08,0x09,0x11,0x10,0x10,0x11,0x11,0x09, 45 | 0x0A,0x7C,0x04,0x03,0x00,0x00,0x00,0x00, /* BJT npn */ 46 | 47 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0x08,0xC8,0xC4,0x04,0x04,0xC4,0x84,0x48, 48 | 0x28,0x1F,0x10,0x60,0x80,0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0xC9,0x08,0x08,0x08, 49 | 0x08,0xFF,0xFF,0x14,0x22,0x41,0x81,0x01,0x00,0x00,0x00,0x00,0xC1,0x3E,0x00,0x00, 50 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x08,0x09,0x11,0x10,0x10,0x10,0x10,0x09, 51 | 0x0A,0x7C,0x04,0x03,0x00,0x00,0x00,0x00, /* BJT pnp */ 52 | 53 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0xC8,0x08,0xE4,0x44,0x44,0x44,0x44,0x48, 54 | 0x48,0x7F,0x10,0x60,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xC1,0x00,0x00,0x00, 55 | 0xFF,0x00,0x9C,0x08,0x08,0x1C,0x3E,0x08,0x08,0xF8,0x00,0x00,0xC1,0x3E,0x00,0x00, 56 | 0x01,0x01,0x01,0x01,0x01,0x03,0x05,0x05,0x09,0x08,0x13,0x11,0x11,0x11,0x11,0x09, 57 | 0x09,0x7F,0x0C,0x03,0x00,0x00,0x00,0x00, /* MOSFET enh n-ch */ 58 | 59 | 0x40,0x40,0x40,0x40,0xC0,0x60,0x50,0x50,0xC8,0x08,0xE4,0x44,0x44,0x44,0x44,0x48, 60 | 0x48,0x7F,0x10,0x60,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xC1,0x00,0x00,0x00, 61 | 0xFF,0x00,0x9C,0x08,0x08,0x3E,0x1C,0x08,0x08,0xF8,0x00,0x00,0xC1,0x3E,0x00,0x00, 62 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x09,0x08,0x13,0x11,0x11,0x11,0x11,0x09, 63 | 0x09,0x7F,0x04,0x03,0x00,0x00,0x00,0x00, /* MOSFET enh p-ch */ 64 | 65 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0xC8,0x08,0xE4,0x44,0x44,0x44,0x44,0x48, 66 | 0x48,0x7F,0x10,0x60,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xC1,0x00,0x00,0x00, 67 | 0xFF,0x00,0xFF,0x08,0x08,0x1C,0x3E,0x08,0x08,0xF8,0x00,0x00,0xC1,0x3E,0x00,0x00, 68 | 0x01,0x01,0x01,0x01,0x01,0x03,0x05,0x05,0x09,0x08,0x13,0x11,0x11,0x11,0x11,0x09, 69 | 0x09,0x7F,0x0C,0x03,0x00,0x00,0x00,0x00, /* MOSFET dep n-ch */ 70 | 71 | 0x40,0x40,0x40,0x40,0xC0,0x60,0x50,0x50,0xC8,0x08,0xE4,0x44,0x44,0x44,0x44,0x48, 72 | 0x48,0x7F,0x10,0x60,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xC1,0x00,0x00,0x00, 73 | 0xFF,0x00,0xFF,0x08,0x08,0x3E,0x1C,0x08,0x08,0xF8,0x00,0x00,0xC1,0x3E,0x00,0x00, 74 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x09,0x08,0x13,0x11,0x11,0x11,0x11,0x09, 75 | 0x09,0x7F,0x04,0x03,0x00,0x00,0x00,0x00, /* MOSFET dep p-ch */ 76 | 77 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0x08,0x08,0x04,0xE4,0x84,0x84,0x84,0x88, 78 | 0x88,0xFF,0x10,0x60,0x80,0x00,0x00,0x00,0x80,0x80,0x80,0xBE,0xC1,0x80,0x80,0x80, 79 | 0xE0,0xC0,0x80,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0xC1,0x3E,0x00,0x00, 80 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x0B,0x09,0x10,0x13,0x10,0x10,0x10,0x08, 81 | 0x08,0x7F,0x04,0x03,0x00,0x00,0x00,0x00, /* JFET n-ch */ 82 | 83 | 0x80,0x80,0x80,0x80,0x80,0xE0,0x90,0x90,0xC8,0xE8,0x84,0xE4,0x84,0x84,0x84,0x88, 84 | 0x88,0xFF,0x10,0x60,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xC1,0x00,0x00,0x00, 85 | 0x01,0x03,0x00,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0xC1,0x3E,0x00,0x00, 86 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x08,0x08,0x10,0x13,0x10,0x10,0x10,0x08, 87 | 0x08,0x7F,0x04,0x03,0x00,0x00,0x00,0x00, /* JFET p-ch */ 88 | 89 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0x88,0x08,0xC4,0x04,0x04,0x04,0x84,0x48, 90 | 0x28,0x1F,0x10,0x60,0x80,0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0xC9,0x08,0x08,0x08, 91 | 0xFF,0x00,0xFF,0x14,0x22,0x41,0x80,0xC0,0x00,0x00,0x00,0x00,0xC1,0x3E,0x00,0x00, 92 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x08,0x08,0x11,0x10,0x10,0x11,0x11,0x09, 93 | 0x0A,0x7C,0x04,0x03,0x00,0x00,0x00,0x00, /* IGBT enh n-ch */ 94 | 95 | 0x00,0x00,0x00,0x00,0x80,0x60,0x10,0x10,0x88,0x08,0xC4,0x04,0x04,0xC4,0x84,0x48, 96 | 0x28,0x1F,0x10,0x60,0x80,0x00,0x00,0x00,0x08,0x08,0x08,0x3E,0xC9,0x08,0x08,0x08, 97 | 0xFF,0x00,0xFF,0x14,0x22,0x41,0x81,0x01,0x00,0x00,0x00,0x00,0xC1,0x3E,0x00,0x00, 98 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x08,0x08,0x11,0x10,0x10,0x10,0x10,0x09, 99 | 0x0A,0x7C,0x04,0x03,0x00,0x00,0x00,0x00, /* IGBT enh p-ch */ 100 | 101 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xE0,0xE0,0xE0,0xE0,0xFE,0xE0,0xE0,0xE0, 102 | 0xE0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 103 | 0x80,0x83,0x8F,0xBF,0xFF,0xBF,0x8F,0x83,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00, 104 | 0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x04,0x02,0x01,0x7F,0x00,0x00,0x00, 105 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* SCR */ 106 | 107 | 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFE,0x80,0x80,0x80, 108 | 0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xFF, 109 | 0xFE,0xF8,0xE0,0x80,0x00,0x01,0x07,0x1F,0x7F,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00, 110 | 0x10,0x10,0x10,0x11,0x11,0x09,0x05,0x03,0x01,0x01,0x01,0x01,0xFF,0x01,0x01,0x01, 111 | 0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00, /* Triac */ 112 | 113 | 0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x40,0x80,0xFE,0x00,0x00,0x00, 114 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 115 | 0x07,0x1F,0x7F,0xFF,0xFF,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 116 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x05,0x7F,0x05,0x04,0x04, 117 | 0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00 /* PUT */ 118 | 119 | #ifdef SW_UJT 120 | , 121 | 0x40,0x40,0x40,0x40,0xC0,0x60,0x90,0x10,0x08,0x08,0x04,0xE4,0x84,0x84,0x84,0x88, 122 | 0x88,0xFF,0x10,0x60,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0xC1,0x00,0x00,0x05, 123 | 0x06,0x07,0x08,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0xC1,0x3E,0x00,0x00, 124 | 0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x08,0x08,0x10,0x13,0x10,0x10,0x10,0x08, 125 | 0x08,0x7F,0x04,0x03,0x00,0x00,0x00,0x00 /* UJT */ 126 | #endif 127 | }; 128 | 129 | 130 | 131 | /* 132 | * pin position lookup table 133 | * - one byte per pin and 3 bytes (pins) for each symbol 134 | * - cross reference for the Semi structure's pins: 135 | * 136 | * BJT FET SCR Triac IGBT 137 | * ------------------------------------------------------------------ 138 | * A Base Gate Gate Gate Gate 139 | * B Collector Drain Anode MT2 Collector 140 | * C Emitter Source Cathode MT1 Emitter 141 | * 142 | * PUT UJT 143 | * ------------------------------------------------------------------ 144 | * A Gate Emitter 145 | * B Anode B2 146 | * C Cathode B1 147 | */ 148 | 149 | const uint8_t PinTable[] PROGMEM = { 150 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* BJT npn */ 151 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* BJT pnp */ 152 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET enh n-ch */ 153 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET enh p-ch */ 154 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET dep n-ch */ 155 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET dep p-ch */ 156 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* JFET n-ch */ 157 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* JFET p-ch */ 158 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* IGBT enh n-ch */ 159 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* IGBT enh p-ch */ 160 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* SCR */ 161 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* Triac */ 162 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* PUT */ 163 | #ifdef SW_UJT 164 | , 165 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* UJT */ 166 | #endif 167 | }; 168 | 169 | 170 | 171 | #endif 172 | 173 | /* ************************************************************************ 174 | * EOF 175 | * ************************************************************************ */ 176 | -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/symbols_24x24_vp_f.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * 24x24 component symbols 4 | * vertically aligned, horizontal bit order flipped 5 | * with bank/page-wise grouping 6 | * 7 | * (c) 2018 by Markus Reschke 8 | * 9 | * ************************************************************************ */ 10 | 11 | 12 | /* ************************************************************************ 13 | * symbol data 14 | * ************************************************************************ */ 15 | 16 | #ifdef SYMBOLS_24X24_VP_F 17 | 18 | 19 | /* symbol size */ 20 | #define SYMBOL_SIZE_X 24 /* width: 24 dots */ 21 | #define SYMBOL_SIZE_Y 24 /* heigth: 24 dots */ 22 | 23 | /* symbol data format */ 24 | #define SYMBOL_BYTES_N 72 /* 72 bytes per symbol */ 25 | #define SYMBOL_BYTES_X 24 /* 24 bytes in x direction */ 26 | #define SYMBOL_BYTES_Y 3 /* 3 bytes in y direction */ 27 | 28 | /* 29 | * symbol bitmaps 30 | * - format: 31 | * - 72 bytes per symbol 32 | * - first byte: last vertical line of top 8 rows (right to left) 33 | * - first 24 bytes: all vertical lines of top 8 rows 34 | * next 24 bytes: all vertical lines of next 8 rows 35 | * last 24 bytes: all vertical lines of last 8 rows 36 | * - bit #0: bottom / bit #7: top 37 | */ 38 | 39 | const uint8_t SymbolData[] PROGMEM = { 40 | 0x00,0x00,0x00,0x01,0x06,0x08,0xF8,0x14,0x12,0x21,0x20,0x20,0x20,0x23,0x13,0x10,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x00,0x00,0x03,0x01,0x82,0x44,0x28,0xFF,0xFF,0x10,0x10,0x10,0x10,0x93,0x7C,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0xC0,0x20,0x3E,0x50,0x90,0x88,0x88,0x08,0x08,0x88,0x90,0x10,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* BJT npn */ 41 | 42 | 0x00,0x00,0x00,0x01,0x06,0x08,0xF8,0x14,0x12,0x21,0x23,0x20,0x20,0x23,0x13,0x10,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x00,0x00,0x80,0x81,0x82,0x44,0x28,0xFF,0xFF,0x10,0x10,0x10,0x10,0x93,0x7C,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0xC0,0x20,0x3E,0x50,0x90,0x08,0x08,0x08,0x08,0x88,0x90,0x10,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* BJT pnp */ 43 | 44 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFE,0x12,0x12,0x22,0x22,0x22,0x22,0x27,0x10,0x13,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x1F,0x10,0x10,0x7C,0x38,0x10,0x10,0x39,0x00,0xFF,0x00,0x00,0x00,0x83,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x30,0xFE,0x90,0x90,0x88,0x88,0x88,0x88,0xC8,0x10,0x90,0xA0,0xA0,0xC0,0x80,0x80,0x80,0x80,0x80, /* MOSFET enh n-ch */ 45 | 46 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFE,0x12,0x12,0x22,0x22,0x22,0x22,0x27,0x10,0x13,0x0A,0x0A,0x06,0x03,0x02,0x02,0x02,0x02,0x00,0x00,0x7C,0x83,0x00,0x00,0x1F,0x10,0x10,0x38,0x7C,0x10,0x10,0x39,0x00,0xFF,0x00,0x00,0x00,0x83,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0xFE,0x90,0x90,0x88,0x88,0x88,0x88,0xC8,0x10,0x90,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* MOSFET enh p-ch */ 47 | 48 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFE,0x12,0x12,0x22,0x22,0x22,0x22,0x27,0x10,0x13,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x1F,0x10,0x10,0x7C,0x38,0x10,0x10,0xFF,0x00,0xFF,0x00,0x00,0x00,0x83,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x30,0xFE,0x90,0x90,0x88,0x88,0x88,0x88,0xC8,0x10,0x90,0xA0,0xA0,0xC0,0x80,0x80,0x80,0x80,0x80, /* MOSFET dep n-ch */ 49 | 50 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFE,0x12,0x12,0x22,0x22,0x22,0x22,0x27,0x10,0x13,0x0A,0x0A,0x06,0x03,0x02,0x02,0x02,0x02,0x00,0x00,0x7C,0x83,0x00,0x00,0x1F,0x10,0x10,0x38,0x7C,0x10,0x10,0xFF,0x00,0xFF,0x00,0x00,0x00,0x83,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0xFE,0x90,0x90,0x88,0x88,0x88,0x88,0xC8,0x10,0x90,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* MOSFET dep p-ch */ 51 | 52 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFF,0x11,0x11,0x21,0x21,0x21,0x27,0x20,0x10,0x10,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0x01,0x03,0x07,0x01,0x01,0x01,0x83,0x7D,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0xC0,0x20,0xFE,0x10,0x10,0x08,0x08,0x08,0xC8,0x08,0x90,0xD0,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* JFET n-ch */ 53 | 54 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFF,0x11,0x11,0x21,0x21,0x21,0x27,0x21,0x17,0x13,0x09,0x09,0x07,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x7C,0x83,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0x00,0xC0,0x80,0x00,0x00,0x00,0x83,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0xFE,0x10,0x10,0x08,0x08,0x08,0xC8,0x08,0x10,0x10,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* JFET p-ch */ 55 | 56 | 0x00,0x00,0x00,0x01,0x06,0x08,0xF8,0x14,0x12,0x21,0x20,0x20,0x20,0x23,0x10,0x11,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x00,0x00,0x03,0x01,0x82,0x44,0x28,0xFF,0x00,0xFF,0x10,0x10,0x10,0x93,0x7C,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0xC0,0x20,0x3E,0x50,0x90,0x88,0x88,0x08,0x08,0x88,0x10,0x10,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* IGBT enh n-ch */ 57 | 58 | 0x00,0x00,0x00,0x01,0x06,0x08,0xF8,0x14,0x12,0x21,0x23,0x20,0x20,0x23,0x10,0x11,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x83,0x00,0x00,0x00,0x00,0x80,0x81,0x82,0x44,0x28,0xFF,0x00,0xFF,0x10,0x10,0x10,0x93,0x7C,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0xC0,0x20,0x3E,0x50,0x90,0x08,0x08,0x08,0x08,0x88,0x10,0x10,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, /* IGBT enh p-ch */ 59 | 60 | 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x07,0x07,0x07,0x07,0x7F,0x07,0x07,0x07,0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0xC1,0xF1,0xFD,0xFF,0xFD,0xF1,0xC1,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x80,0x40,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, /* SCR */ 61 | 62 | 0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x7F,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xFF,0xFE,0xF8,0xE0,0x80,0x00,0x01,0x07,0x1F,0x7F,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0x80,0x80,0x80,0x80,0xC0,0xA0,0x90,0x88,0x88,0x08,0x08,0x08, /* Triac */ 63 | 64 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x04,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xFF,0xFF,0xFF,0xFE,0xF8,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0xA0,0xFE,0xA0,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* PUT */ 65 | 66 | #ifdef SW_UJT 67 | , 68 | 0x00,0x00,0x00,0x01,0x06,0x08,0xFF,0x11,0x11,0x21,0x21,0x21,0x27,0x20,0x10,0x10,0x08,0x09,0x06,0x03,0x02,0x02,0x02,0x02,0x00,0x00,0x7C,0x83,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0x10,0xE0,0x60,0xA0,0x00,0x00,0x83,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0xFE,0x10,0x10,0x08,0x08,0x08,0xC8,0x08,0x10,0x10,0x20,0x20,0xC0,0x00,0x00,0x00,0x00,0x00 /* UJT */ 69 | #endif 70 | }; 71 | 72 | 73 | 74 | /* 75 | * pin position lookup table 76 | * - one byte per pin and 3 bytes (pins) for each symbol 77 | * - cross reference for the Semi structure's pins: 78 | * 79 | * BJT FET SCR Triac IGBT 80 | * ------------------------------------------------------------------ 81 | * A Base Gate Gate Gate Gate 82 | * B Collector Drain Anode MT2 Collector 83 | * C Emitter Source Cathode MT1 Emitter 84 | * 85 | * PUT UJT 86 | * ------------------------------------------------------------------ 87 | * A Gate Emitter 88 | * B Anode B2 89 | * C Cathode B1 90 | */ 91 | 92 | const uint8_t PinTable[] PROGMEM = { 93 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* BJT npn */ 94 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* BJT pnp */ 95 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET enh n-ch */ 96 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET enh p-ch */ 97 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET dep n-ch */ 98 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET dep p-ch */ 99 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* JFET n-ch */ 100 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* JFET p-ch */ 101 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* IGBT enh n-ch */ 102 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* IGBT enh p-ch */ 103 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* SCR */ 104 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* Triac */ 105 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* PUT */ 106 | #ifdef SW_UJT 107 | , 108 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* UJT */ 109 | #endif 110 | }; 111 | 112 | 113 | 114 | #endif 115 | 116 | /* ************************************************************************ 117 | * EOF 118 | * ************************************************************************ */ 119 | -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/symbols_30x32_hf.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * 30x32 component symbols 4 | * horizontally aligned, horizontal bit order flipped 5 | * 6 | * (c) 2015-2017 by Markus Reschke 7 | * 8 | * ************************************************************************ */ 9 | 10 | 11 | /* ************************************************************************ 12 | * symbol data 13 | * ************************************************************************ */ 14 | 15 | #ifdef SYMBOLS_30X32_HF 16 | 17 | 18 | /* symbol size */ 19 | #define SYMBOL_SIZE_X 30 /* width: 30 dots */ 20 | #define SYMBOL_SIZE_Y 32 /* heigth: 32 dots */ 21 | 22 | /* symbol data format */ 23 | #define SYMBOL_BYTES_N 128 /* 128 bytes per symbol */ 24 | #define SYMBOL_BYTES_X 4 /* 4 bytes in x direction */ 25 | #define SYMBOL_BYTES_Y 32 /* 32 bytes in y direction */ 26 | 27 | 28 | /* 29 | * symbol bitmaps 30 | * - format: 31 | * - 128 bytes per symbol 32 | * - first four bytes: first horizontal line (top to down) 33 | * first byte: left part 34 | * - bit #0: left / bit #7: right (horizontally flipped) 35 | */ 36 | 37 | const uint8_t SymbolData[] PROGMEM = { 38 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 39 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x0C,0x08,0x02, 40 | 0x10,0x0C,0x04,0x04,0x10,0x0C,0x02,0x04,0x08,0x0C,0x01,0x08,0x08,0x8C,0x00,0x08, 41 | 0x08,0x4C,0x00,0x08,0x04,0x2C,0x00,0x10,0x04,0x1C,0x00,0x10,0xFF,0x0F,0x00,0x10, 42 | 0x04,0x1C,0x00,0x10,0x04,0x2C,0x00,0x10,0x08,0x4C,0x00,0x08,0x08,0x8C,0x04,0x08, 43 | 0x08,0x0C,0x07,0x08,0x10,0x0C,0x07,0x04,0x10,0x8C,0x07,0x04,0x20,0x0C,0x08,0x02, 44 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 45 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* BJT npn */ 46 | 47 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 48 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x00,0x08,0x02, 49 | 0x10,0x8C,0x04,0x04,0x10,0x8C,0x03,0x04,0x08,0x8C,0x03,0x08,0x08,0x8C,0x07,0x08, 50 | 0x08,0x4C,0x00,0x08,0x04,0x2C,0x00,0x10,0x04,0x1C,0x00,0x10,0xFF,0x0F,0x00,0x10, 51 | 0x04,0x1C,0x00,0x10,0x04,0x2C,0x00,0x10,0x08,0x4C,0x00,0x08,0x08,0x8C,0x00,0x08, 52 | 0x08,0x0C,0x01,0x08,0x10,0x0C,0x02,0x04,0x10,0x0C,0x04,0x04,0x20,0x00,0x08,0x02, 53 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 54 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* BJT pnp */ 55 | 56 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 57 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x10,0x10,0x01,0x20,0x10,0x10,0x02, 58 | 0x10,0xF4,0x1F,0x04,0x10,0x14,0x00,0x04,0x08,0x14,0x00,0x08,0x08,0x04,0x00,0x08, 59 | 0x08,0x04,0x00,0x08,0x04,0x14,0x02,0x10,0x04,0x14,0x03,0x10,0x04,0xF4,0x1F,0x10, 60 | 0x04,0x14,0x13,0x10,0x04,0x14,0x12,0x10,0x08,0x04,0x10,0x08,0x08,0x04,0x10,0x08, 61 | 0x08,0x14,0x10,0x08,0x10,0x14,0x10,0x04,0xFF,0xF7,0x1F,0x04,0x20,0x10,0x10,0x02, 62 | 0x40,0x10,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 63 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* MOSFET enh n-ch */ 64 | 65 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 66 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x10,0x10,0x01,0x20,0x10,0x10,0x02, 67 | 0xFF,0xF7,0x1F,0x04,0x10,0x14,0x10,0x04,0x08,0x14,0x10,0x08,0x08,0x04,0x10,0x08, 68 | 0x08,0x04,0x10,0x08,0x04,0x14,0x11,0x10,0x04,0x14,0x13,0x10,0x04,0xF4,0x1F,0x10, 69 | 0x04,0x14,0x03,0x10,0x04,0x14,0x01,0x10,0x08,0x04,0x00,0x08,0x08,0x04,0x00,0x08, 70 | 0x08,0x14,0x00,0x08,0x10,0x14,0x00,0x04,0x10,0xF4,0x1F,0x04,0x20,0x10,0x10,0x02, 71 | 0x40,0x10,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 72 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* MOSFET enh p-ch */ 73 | 74 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 75 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x10,0x10,0x01,0x20,0x10,0x10,0x02, 76 | 0x10,0xF4,0x1F,0x04,0x10,0x14,0x00,0x04,0x08,0x14,0x00,0x08,0x08,0x14,0x00,0x08, 77 | 0x08,0x14,0x00,0x08,0x04,0x14,0x02,0x10,0x04,0x14,0x03,0x10,0x04,0xF4,0x1F,0x10, 78 | 0x04,0x14,0x13,0x10,0x04,0x14,0x12,0x10,0x08,0x14,0x10,0x08,0x08,0x14,0x10,0x08, 79 | 0x08,0x14,0x10,0x08,0x10,0x14,0x10,0x04,0xFF,0xF7,0x1F,0x04,0x20,0x10,0x10,0x02, 80 | 0x40,0x10,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 81 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* MOSFET dep n-ch */ 82 | 83 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 84 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x10,0x10,0x01,0x20,0x10,0x10,0x02, 85 | 0xFF,0xF7,0x1F,0x04,0x10,0x14,0x10,0x04,0x08,0x14,0x10,0x08,0x08,0x14,0x10,0x08, 86 | 0x08,0x14,0x10,0x08,0x04,0x14,0x11,0x10,0x04,0x14,0x13,0x10,0x04,0xF4,0x1F,0x10, 87 | 0x04,0x14,0x03,0x10,0x04,0x14,0x01,0x10,0x08,0x14,0x00,0x08,0x08,0x14,0x00,0x08, 88 | 0x08,0x14,0x00,0x08,0x10,0x14,0x00,0x04,0x10,0xF4,0x1F,0x04,0x20,0x10,0x10,0x02, 89 | 0x40,0x10,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 90 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* MOSFET dep p-ch */ 91 | 92 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 93 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x10,0x10,0x02, 94 | 0x10,0x10,0x10,0x04,0x10,0xF0,0x1F,0x04,0x08,0x10,0x00,0x08,0x08,0x10,0x00,0x08, 95 | 0x08,0x10,0x00,0x08,0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10, 96 | 0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10,0x08,0x10,0x00,0x08,0x08,0x12,0x00,0x08, 97 | 0x08,0x16,0x00,0x08,0xFF,0xFF,0x1F,0x04,0x10,0x16,0x10,0x04,0x20,0x12,0x10,0x02, 98 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 99 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* JFET n-ch */ 100 | 101 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 102 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x12,0x10,0x02, 103 | 0x10,0x13,0x10,0x04,0xFF,0xFF,0x1F,0x04,0x08,0x13,0x00,0x08,0x08,0x12,0x00,0x08, 104 | 0x08,0x10,0x00,0x08,0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10, 105 | 0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10,0x08,0x10,0x00,0x08,0x08,0x10,0x00,0x08, 106 | 0x08,0x10,0x00,0x08,0x10,0xF0,0x1F,0x04,0x10,0x10,0x10,0x04,0x20,0x10,0x10,0x02, 107 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 108 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* JFET p-ch */ 109 | 110 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 111 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x08,0x08,0x02, 112 | 0x10,0x0A,0x04,0x04,0x10,0x0A,0x02,0x04,0x08,0x0A,0x01,0x08,0x08,0x8A,0x00,0x08, 113 | 0x08,0x4A,0x00,0x08,0x04,0x2A,0x00,0x10,0x04,0x1A,0x00,0x10,0xFF,0x0B,0x00,0x10, 114 | 0x04,0x1A,0x00,0x10,0x04,0x2A,0x00,0x10,0x08,0x4A,0x00,0x08,0x08,0x8A,0x04,0x08, 115 | 0x08,0x0A,0x07,0x08,0x10,0x0A,0x07,0x04,0x10,0x8A,0x07,0x04,0x20,0x08,0x08,0x02, 116 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 117 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* IGBT enh n-ch */ 118 | 119 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 120 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x00,0x08,0x02, 121 | 0x10,0x88,0x04,0x04,0x10,0x8A,0x03,0x04,0x08,0x8A,0x03,0x08,0x08,0x8A,0x07,0x08, 122 | 0x08,0x4A,0x00,0x08,0x04,0x2A,0x00,0x10,0x04,0x1A,0x00,0x10,0xFF,0x0B,0x00,0x10, 123 | 0x04,0x1A,0x00,0x10,0x04,0x2A,0x00,0x10,0x08,0x4A,0x00,0x08,0x08,0x8A,0x00,0x08, 124 | 0x08,0x0A,0x01,0x08,0x10,0x0A,0x02,0x04,0x10,0x08,0x04,0x04,0x20,0x00,0x08,0x02, 125 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 126 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* IGBT enh p-ch */ 127 | 128 | 0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 129 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 130 | 0x00,0x80,0x00,0x00,0xC0,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0x00,0x00,0xFF,0x7F,0x00, 131 | 0x00,0xFE,0x3F,0x00,0x00,0xFC,0x1F,0x00,0x00,0xF8,0x0F,0x00,0x00,0xF0,0x07,0x00, 132 | 0x00,0xE0,0x03,0x00,0x00,0xC0,0x01,0x00,0x00,0x80,0x00,0x00,0xC0,0xFF,0xFF,0x01, 133 | 0x00,0xC0,0x00,0x00,0x00,0xA0,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x88,0x00,0x00, 134 | 0x00,0x84,0x00,0x00,0x00,0x82,0x00,0x00,0xFF,0x81,0x00,0x00,0x00,0x80,0x00,0x00, 135 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00, /* SCR */ 136 | 137 | 0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 138 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 139 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0xE0,0xFF,0xFF,0x03,0x00,0x04,0xFF,0x01, 140 | 0x00,0x0E,0xFF,0x01,0x00,0x0E,0xFE,0x00,0x00,0x1F,0xFE,0x00,0x00,0x1F,0x7C,0x00, 141 | 0x80,0x3F,0x7C,0x00,0x80,0x3F,0x38,0x00,0xC0,0x7F,0x38,0x00,0xC0,0x7F,0x10,0x00, 142 | 0xE0,0xFF,0xFF,0x03,0x00,0x84,0x00,0x00,0x00,0x82,0x00,0x00,0x00,0x81,0x00,0x00, 143 | 0x80,0x80,0x00,0x00,0x7F,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 144 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00, /* Triac */ 145 | 146 | 0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 147 | 0x00,0x80,0x00,0x00,0xFF,0x81,0x00,0x00,0x00,0x82,0x00,0x00,0x00,0x84,0x00,0x00, 148 | 0x00,0x88,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0xA0,0x00,0x00,0x00,0xC0,0x00,0x00, 149 | 0xC0,0xFF,0xFF,0x01,0x80,0xFF,0xFF,0x00,0x00,0xFF,0x7F,0x00,0x00,0xFE,0x3F,0x00, 150 | 0x00,0xFC,0x1F,0x00,0x00,0xF8,0x0F,0x00,0x00,0xF0,0x07,0x00,0x00,0xE0,0x03,0x00, 151 | 0x00,0xC0,0x01,0x00,0x00,0x80,0x00,0x00,0xC0,0xFF,0xFF,0x01,0x00,0x80,0x00,0x00, 152 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00, 153 | 0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00 /* PUT */ 154 | 155 | #ifdef SW_UJT 156 | , 157 | 0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0xE0,0x13,0x00,0x00,0x1C,0x1C,0x00, 158 | 0x00,0x03,0x70,0x00,0x80,0x00,0x90,0x00,0x40,0x00,0x10,0x01,0x20,0x10,0x10,0x02, 159 | 0x3F,0x10,0x10,0x04,0x50,0xF0,0x1F,0x04,0x88,0x12,0x00,0x08,0x08,0x13,0x00,0x08, 160 | 0x88,0x13,0x00,0x08,0x04,0x14,0x00,0x10,0x04,0x18,0x00,0x10,0x04,0x10,0x00,0x10, 161 | 0x04,0x10,0x00,0x10,0x04,0x10,0x00,0x10,0x08,0x10,0x00,0x08,0x08,0x10,0x00,0x08, 162 | 0x08,0x10,0x00,0x08,0x10,0xF0,0x1F,0x04,0x10,0x10,0x10,0x04,0x20,0x10,0x10,0x02, 163 | 0x40,0x00,0x10,0x01,0x80,0x00,0x90,0x00,0x00,0x03,0x70,0x00,0x00,0x1C,0x1C,0x00, 164 | 0x00,0xE0,0x13,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00 /* UJT */ 165 | #endif 166 | }; 167 | 168 | 169 | 170 | /* 171 | * pin position lookup table 172 | * - one byte per pin and 3 bytes (pins) for each symbol 173 | * - cross reference for the Semi structure's pins: 174 | * 175 | * BJT FET SCR Triac IGBT 176 | * ------------------------------------------------------------------ 177 | * A Base Gate Gate Gate Gate 178 | * B Collector Drain Anode MT2 Collector 179 | * C Emitter Source Cathode MT1 Emitter 180 | * 181 | * PUT UJT 182 | * ------------------------------------------------------------------ 183 | * A Gate Emitter 184 | * B Anode B2 185 | * C Cathode B1 186 | */ 187 | 188 | const uint8_t PinTable[] PROGMEM = { 189 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* BJT npn */ 190 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* BJT pnp */ 191 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET enh n-ch */ 192 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET enh p-ch */ 193 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET dep n-ch */ 194 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET dep p-ch */ 195 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* JFET n-ch */ 196 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* JFET p-ch */ 197 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* IGBT enh n-ch */ 198 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* IGBT enh p-ch */ 199 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* SCR */ 200 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* Triac */ 201 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* PUT */ 202 | #ifdef SW_UJT 203 | , 204 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* UJT */ 205 | #endif 206 | }; 207 | 208 | 209 | 210 | #endif 211 | 212 | /* ************************************************************************ 213 | * EOF 214 | * ************************************************************************ */ 215 | -------------------------------------------------------------------------------- /firmware 1.34/bitmaps/symbols_32x32_hf.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * 32x32 component symbols 4 | * horizontally aligned, horizontal bit order flipped 5 | * 6 | * (c) 2015-2017 by Markus Reschke 7 | * 8 | * ************************************************************************ */ 9 | 10 | 11 | /* ************************************************************************ 12 | * symbol data 13 | * ************************************************************************ */ 14 | 15 | #ifdef SYMBOLS_32X32_HF 16 | 17 | 18 | /* symbol size */ 19 | #define SYMBOL_SIZE_X 32 /* width: 32 dots */ 20 | #define SYMBOL_SIZE_Y 32 /* heigth: 32 dots */ 21 | 22 | /* symbol data format */ 23 | #define SYMBOL_BYTES_N 128 /* 128 bytes per symbol */ 24 | #define SYMBOL_BYTES_X 4 /* 4 bytes in x direction */ 25 | #define SYMBOL_BYTES_Y 32 /* 32 bytes in y direction */ 26 | 27 | 28 | /* 29 | * symbol bitmaps 30 | * - format: 31 | * - 128 bytes per symbol 32 | * - first four bytes: first horizontal line (top to down) 33 | * first byte: left part 34 | * - bit #0: left / bit #7: right (horizontally flipped) 35 | */ 36 | 37 | const uint8_t SymbolData[] PROGMEM = { 38 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 39 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x18,0x10,0x04, 40 | 0x20,0x18,0x08,0x08,0x20,0x18,0x04,0x08,0x10,0x18,0x02,0x10,0x10,0x18,0x01,0x10, 41 | 0x10,0x98,0x00,0x10,0x08,0x58,0x00,0x20,0x08,0x38,0x00,0x20,0xFF,0x1F,0x00,0x20, 42 | 0x08,0x38,0x00,0x20,0x08,0x58,0x00,0x20,0x10,0x98,0x00,0x10,0x10,0x18,0x09,0x10, 43 | 0x10,0x18,0x0E,0x10,0x20,0x18,0x0E,0x08,0x20,0x18,0x0F,0x08,0x40,0x18,0x10,0x04, 44 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 45 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* BJT npn */ 46 | 47 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 48 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x00,0x10,0x04, 49 | 0x20,0x18,0x09,0x08,0x20,0x18,0x07,0x08,0x10,0x18,0x07,0x10,0x10,0x18,0x0F,0x10, 50 | 0x10,0x98,0x00,0x10,0x08,0x58,0x00,0x20,0x08,0x38,0x00,0x20,0xFF,0x1F,0x00,0x20, 51 | 0x08,0x38,0x00,0x20,0x08,0x58,0x00,0x20,0x10,0x98,0x00,0x10,0x10,0x18,0x01,0x10, 52 | 0x10,0x18,0x02,0x10,0x20,0x18,0x04,0x08,0x20,0x18,0x08,0x08,0x40,0x00,0x10,0x04, 53 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 54 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* BJT pnp */ 55 | 56 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 57 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x20,0x20,0x02,0x40,0x20,0x20,0x04, 58 | 0x20,0xE8,0x3F,0x08,0x20,0x28,0x00,0x08,0x10,0x28,0x00,0x10,0x10,0x08,0x00,0x10, 59 | 0x10,0x08,0x00,0x10,0x08,0x28,0x04,0x20,0x08,0x28,0x06,0x20,0x08,0xE8,0x3F,0x20, 60 | 0x08,0x28,0x26,0x20,0x08,0x28,0x24,0x20,0x10,0x08,0x20,0x10,0x10,0x08,0x20,0x10, 61 | 0x10,0x28,0x20,0x10,0x20,0x28,0x20,0x08,0xFF,0xEF,0x3F,0x08,0x40,0x20,0x20,0x04, 62 | 0x80,0x20,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 63 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* MOSFET enh n-ch */ 64 | 65 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 66 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x20,0x20,0x02,0x40,0x20,0x20,0x04, 67 | 0xFF,0xEF,0x3F,0x08,0x20,0x28,0x20,0x08,0x10,0x28,0x20,0x10,0x10,0x08,0x20,0x10, 68 | 0x10,0x08,0x20,0x10,0x08,0x28,0x22,0x20,0x08,0x28,0x26,0x20,0x08,0xE8,0x3F,0x20, 69 | 0x08,0x28,0x06,0x20,0x08,0x28,0x02,0x20,0x10,0x08,0x00,0x10,0x10,0x08,0x00,0x10, 70 | 0x10,0x28,0x00,0x10,0x20,0x28,0x00,0x08,0x20,0xE8,0x3F,0x08,0x40,0x20,0x20,0x04, 71 | 0x80,0x20,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 72 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* MOSFET enh p-ch */ 73 | 74 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 75 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x20,0x20,0x02,0x40,0x20,0x20,0x04, 76 | 0x20,0xE8,0x3F,0x08,0x20,0x28,0x00,0x08,0x10,0x28,0x00,0x10,0x10,0x28,0x00,0x10, 77 | 0x10,0x28,0x00,0x10,0x08,0x28,0x04,0x20,0x08,0x28,0x06,0x20,0x08,0xE8,0x3F,0x20, 78 | 0x08,0x28,0x26,0x20,0x08,0x28,0x24,0x20,0x10,0x28,0x20,0x10,0x10,0x28,0x20,0x10, 79 | 0x10,0x28,0x20,0x10,0x20,0x28,0x20,0x08,0xFF,0xEF,0x3F,0x08,0x40,0x20,0x20,0x04, 80 | 0x80,0x20,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 81 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* MOSFET dep n-ch */ 82 | 83 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 84 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x20,0x20,0x02,0x40,0x20,0x20,0x04, 85 | 0xFF,0xEF,0x3F,0x08,0x20,0x28,0x20,0x08,0x10,0x28,0x20,0x10,0x10,0x28,0x20,0x10, 86 | 0x10,0x28,0x20,0x10,0x08,0x28,0x22,0x20,0x08,0x28,0x26,0x20,0x08,0xE8,0x3F,0x20, 87 | 0x08,0x28,0x06,0x20,0x08,0x28,0x02,0x20,0x10,0x28,0x00,0x10,0x10,0x28,0x00,0x10, 88 | 0x10,0x28,0x00,0x10,0x20,0x28,0x00,0x08,0x20,0xE8,0x3F,0x08,0x40,0x20,0x20,0x04, 89 | 0x80,0x20,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 90 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* MOSFET dep p-ch */ 91 | 92 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 93 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x20,0x20,0x04, 94 | 0x20,0x20,0x20,0x08,0x20,0xE0,0x3F,0x08,0x10,0x20,0x00,0x10,0x10,0x20,0x00,0x10, 95 | 0x10,0x20,0x00,0x10,0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20, 96 | 0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20,0x10,0x20,0x00,0x10,0x10,0x24,0x00,0x10, 97 | 0x10,0x2C,0x00,0x10,0xFF,0xFF,0x3F,0x08,0x20,0x2C,0x20,0x08,0x40,0x24,0x20,0x04, 98 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 99 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* JFET n-ch */ 100 | 101 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 102 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x24,0x20,0x04, 103 | 0x20,0x26,0x20,0x08,0xFF,0xFF,0x3F,0x08,0x10,0x26,0x00,0x10,0x10,0x24,0x00,0x10, 104 | 0x10,0x20,0x00,0x10,0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20, 105 | 0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20,0x10,0x20,0x00,0x10,0x10,0x20,0x00,0x10, 106 | 0x10,0x20,0x00,0x10,0x20,0xE0,0x3F,0x08,0x20,0x20,0x20,0x08,0x40,0x20,0x20,0x04, 107 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 108 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* JFET p-ch */ 109 | 110 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 111 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x10,0x10,0x04, 112 | 0x20,0x14,0x08,0x08,0x20,0x14,0x04,0x08,0x10,0x14,0x02,0x10,0x10,0x14,0x01,0x10, 113 | 0x10,0x94,0x00,0x10,0x08,0x54,0x00,0x20,0x08,0x34,0x00,0x20,0xFF,0x17,0x00,0x20, 114 | 0x08,0x34,0x00,0x20,0x08,0x54,0x00,0x20,0x10,0x94,0x00,0x10,0x10,0x14,0x09,0x10, 115 | 0x10,0x14,0x0E,0x10,0x20,0x14,0x0E,0x08,0x20,0x14,0x0F,0x08,0x40,0x10,0x10,0x04, 116 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 117 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* IGBT enh n-ch */ 118 | 119 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 120 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x00,0x10,0x04, 121 | 0x20,0x10,0x09,0x08,0x20,0x14,0x07,0x08,0x10,0x14,0x07,0x10,0x10,0x14,0x0F,0x10, 122 | 0x10,0x94,0x00,0x10,0x08,0x54,0x00,0x20,0x08,0x34,0x00,0x20,0xFF,0x17,0x00,0x20, 123 | 0x08,0x34,0x00,0x20,0x08,0x54,0x00,0x20,0x10,0x94,0x00,0x10,0x10,0x14,0x01,0x10, 124 | 0x10,0x14,0x02,0x10,0x20,0x14,0x04,0x08,0x20,0x10,0x08,0x08,0x40,0x00,0x10,0x04, 125 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 126 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* IGBT enh p-ch */ 127 | 128 | 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 129 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 130 | 0x00,0x00,0x01,0x00,0x80,0xFF,0xFF,0x03,0x00,0xFF,0xFF,0x01,0x00,0xFE,0xFF,0x00, 131 | 0x00,0xFC,0x7F,0x00,0x00,0xF8,0x3F,0x00,0x00,0xF0,0x1F,0x00,0x00,0xE0,0x0F,0x00, 132 | 0x00,0xC0,0x07,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0x01,0x00,0x80,0xFF,0xFF,0x03, 133 | 0x00,0x80,0x01,0x00,0x00,0x40,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x10,0x01,0x00, 134 | 0x00,0x08,0x01,0x00,0x00,0x04,0x01,0x00,0xFE,0x03,0x01,0x00,0x00,0x00,0x01,0x00, 135 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* SCR */ 136 | 137 | 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 138 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 139 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0xC0,0xFF,0xFF,0x07,0x00,0x08,0xFE,0x03, 140 | 0x00,0x1C,0xFE,0x03,0x00,0x1C,0xFC,0x01,0x00,0x3E,0xFC,0x01,0x00,0x3E,0xF8,0x00, 141 | 0x00,0x7F,0xF8,0x00,0x00,0x7F,0x70,0x00,0x80,0xFF,0x70,0x00,0x80,0xFF,0x20,0x00, 142 | 0xC0,0xFF,0xFF,0x07,0x00,0x08,0x01,0x00,0x00,0x04,0x01,0x00,0x00,0x02,0x01,0x00, 143 | 0x00,0x01,0x01,0x00,0xFE,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 144 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* Triac */ 145 | 146 | 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 147 | 0x00,0x00,0x01,0x00,0xFE,0x03,0x01,0x00,0x00,0x04,0x01,0x00,0x00,0x08,0x01,0x00, 148 | 0x00,0x10,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x40,0x01,0x00,0x00,0x80,0x01,0x00, 149 | 0x80,0xFF,0xFF,0x03,0x00,0xFF,0xFF,0x01,0x00,0xFE,0xFF,0x00,0x00,0xFC,0x7F,0x00, 150 | 0x00,0xF8,0x3F,0x00,0x00,0xF0,0x1F,0x00,0x00,0xE0,0x0F,0x00,0x00,0xC0,0x07,0x00, 151 | 0x00,0x80,0x03,0x00,0x00,0x00,0x01,0x00,0x80,0xFF,0xFF,0x03,0x00,0x00,0x01,0x00, 152 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, 153 | 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00 /* PUT */ 154 | 155 | #ifdef SW_UJT 156 | , 157 | 0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0xC0,0x27,0x00,0x00,0x38,0x38,0x00, 158 | 0x00,0x06,0xE0,0x00,0x00,0x01,0x20,0x01,0x80,0x00,0x20,0x02,0x40,0x20,0x20,0x04, 159 | 0x7F,0x20,0x20,0x08,0xA0,0xE0,0x3F,0x08,0x10,0x25,0x00,0x10,0x10,0x26,0x00,0x10, 160 | 0x10,0x27,0x00,0x10,0x08,0x28,0x00,0x20,0x08,0x30,0x00,0x20,0x08,0x20,0x00,0x20, 161 | 0x08,0x20,0x00,0x20,0x08,0x20,0x00,0x20,0x10,0x20,0x00,0x10,0x10,0x20,0x00,0x10, 162 | 0x10,0x20,0x00,0x10,0x20,0xE0,0x3F,0x08,0x20,0x20,0x20,0x08,0x40,0x20,0x20,0x04, 163 | 0x80,0x00,0x20,0x02,0x00,0x01,0x20,0x01,0x00,0x06,0xE0,0x00,0x00,0x38,0x38,0x00, 164 | 0x00,0xC0,0x27,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00 /* UJT */ 165 | #endif 166 | }; 167 | 168 | 169 | 170 | /* 171 | * pin position lookup table 172 | * - one byte per pin and 3 bytes (pins) for each symbol 173 | * - cross reference for the Semi structure's pins: 174 | * 175 | * BJT FET SCR Triac IGBT 176 | * ------------------------------------------------------------------ 177 | * A Base Gate Gate Gate Gate 178 | * B Collector Drain Anode MT2 Collector 179 | * C Emitter Source Cathode MT1 Emitter 180 | * 181 | * PUT UJT 182 | * ------------------------------------------------------------------ 183 | * A Gate Emitter 184 | * B Anode B2 185 | * C Cathode B1 186 | */ 187 | 188 | const uint8_t PinTable[] PROGMEM = { 189 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* BJT npn */ 190 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* BJT pnp */ 191 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET enh n-ch */ 192 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET enh p-ch */ 193 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* MOSFET dep n-ch */ 194 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* MOSFET dep p-ch */ 195 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* JFET n-ch */ 196 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* JFET p-ch */ 197 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* IGBT enh n-ch */ 198 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, /* IGBT enh p-ch */ 199 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* SCR */ 200 | PIN_LEFT | PIN_BOTTOM, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM, /* Triac */ 201 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* PUT */ 202 | #ifdef SW_UJT 203 | , 204 | PIN_LEFT | PIN_TOP, PIN_RIGHT | PIN_TOP, PIN_RIGHT | PIN_BOTTOM /* UJT */ 205 | #endif 206 | }; 207 | 208 | 209 | 210 | #endif 211 | 212 | /* ************************************************************************ 213 | * EOF 214 | * ************************************************************************ */ 215 | -------------------------------------------------------------------------------- /firmware 1.34/cap.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/cap.c -------------------------------------------------------------------------------- /firmware 1.34/colors.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * color definitions for LCD modules 4 | * 5 | * (c) 2015-2017 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | 10 | /* source management */ 11 | #define COLORS_H 12 | 13 | 14 | #ifdef LCD_COLOR 15 | 16 | /* ************************************************************************ 17 | * LCD specific color values 18 | * ************************************************************************ */ 19 | 20 | 21 | /* 22 | * ILI9341/ILI9342 23 | * - 6 bit coded RGB 24 | */ 25 | 26 | #ifdef LCD_ILI9341 27 | #define COLOR_BLACK 0x0000 28 | #define COLOR_BLUE 0x001f 29 | #define COLOR_GREEN 0x07e0 30 | #define COLOR_CYAN 0x07ff 31 | #define COLOR_RED 0xf800 32 | #define COLOR_MAGENTA 0xf81f 33 | #define COLOR_YELLOW 0xffe0 34 | #define COLOR_ORANGE 0xfd20 35 | #define COLOR_GREY 0xc618 36 | #define COLOR_WHITE 0xffff 37 | #endif 38 | 39 | 40 | /* 41 | * ST7735 42 | * - 6 bit coded RGB 43 | */ 44 | 45 | #ifdef LCD_ST7735 46 | #define COLOR_BLACK 0x0000 47 | #define COLOR_BLUE 0x001f 48 | #define COLOR_GREEN 0x07e0 49 | #define COLOR_CYAN 0x07ff 50 | #define COLOR_RED 0xf800 51 | #define COLOR_MAGENTA 0xf81f 52 | #define COLOR_YELLOW 0xffe0 53 | #define COLOR_ORANGE 0xfd20 54 | #define COLOR_GREY 0xc618 55 | #define COLOR_WHITE 0xffff 56 | #endif 57 | 58 | 59 | /* 60 | * ILI9163 61 | * - 6 bit coded RGB 62 | */ 63 | 64 | #ifdef LCD_ILI9163 65 | #define COLOR_BLACK 0x0000 66 | #define COLOR_BLUE 0x001f 67 | #define COLOR_GREEN 0x07e0 68 | #define COLOR_CYAN 0x07ff 69 | #define COLOR_RED 0xf800 70 | #define COLOR_MAGENTA 0xf81f 71 | #define COLOR_YELLOW 0xffe0 72 | #define COLOR_ORANGE 0xfd20 73 | #define COLOR_GREY 0xc618 74 | #define COLOR_WHITE 0xffff 75 | #endif 76 | 77 | 78 | /* 79 | * VT100 serial terminal 80 | * - 8 fixed foreground and background colors 81 | * - foreground colors: 30-37 82 | * - background colors: 30-47 83 | */ 84 | 85 | #ifdef LCD_VT100 86 | /* foreground */ 87 | #define COLOR_BLACK 30 88 | #define COLOR_RED 31 89 | #define COLOR_GREEN 32 90 | #define COLOR_YELLOW 33 91 | #define COLOR_BLUE 34 92 | #define COLOR_MAGENTA 35 93 | #define COLOR_CYAN 36 94 | #define COLOR_WHITE 37 95 | #endif 96 | 97 | 98 | 99 | /* ************************************************************************ 100 | * default colors 101 | * ************************************************************************ */ 102 | 103 | 104 | /* background color */ 105 | #define COLOR_BACKGROUND COLOR_BLACK 106 | 107 | /* standard pen color */ 108 | #define COLOR_PEN COLOR_GREEN 109 | 110 | /* title color */ 111 | #define COLOR_TITLE COLOR_CYAN 112 | 113 | /* marker (selected item) color */ 114 | #define COLOR_MARKER COLOR_YELLOW 115 | 116 | /* symbol color */ 117 | #define COLOR_SYMBOL COLOR_YELLOW 118 | 119 | /* color codes for probe pins */ 120 | #define COLOR_PROBE_1 COLOR_YELLOW 121 | #define COLOR_PROBE_2 COLOR_GREEN 122 | #define COLOR_PROBE_3 COLOR_RED 123 | 124 | #endif 125 | 126 | 127 | 128 | /* ************************************************************************ 129 | * EOF 130 | * ************************************************************************ */ 131 | -------------------------------------------------------------------------------- /firmware 1.34/common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/common.h -------------------------------------------------------------------------------- /firmware 1.34/config.h: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * global configuration, setup and settings 4 | * 5 | * (c) 2012-2018 by Markus Reschke 6 | * based on code from Markus Frejek and Karl-Heinz K�bbeler 7 | * 8 | * ************************************************************************ */ 9 | 10 | 11 | /* source management */ 12 | #define CONFIG_H 13 | 14 | 15 | /* 16 | * For MCU specific settings (port and pin assignments) and LCD display 17 | * settings please edit: 18 | * - ATmega328: config_328.h 19 | * - ATmega324/644/1284: config_644.h 20 | */ 21 | 22 | 23 | 24 | /* ************************************************************************ 25 | * Hardware options 26 | * ************************************************************************ */ 27 | 28 | 29 | /* 30 | * rotary encoder for user interface 31 | * - default pins: PD2 & PD3 (ATmega 328) 32 | * - could be in parallel with LCD module 33 | * - see ENCODER_PORT for port pins (config-.h) 34 | * - uncomment to enable and also set ENCODER_PULSES & ENCODER_STEPS below 35 | * to match your rotary encoder 36 | */ 37 | 38 | #define HW_ENCODER 39 | 40 | 41 | /* 42 | * Number of Gray code pulses per step or detent for the rotary encoder 43 | * - typical values: 2 or 4, rarely 1 44 | * - a rotary encoder's pulse is the complete sequence of 4 Gray code pulses 45 | * - adjust value to match your rotary encoder 46 | */ 47 | 48 | #define ENCODER_PULSES 4 49 | 50 | 51 | /* 52 | * Number of detents or steps 53 | * - this is used by the detection of the rotary encoder's turning velocity 54 | * - it doesn't have to match exactly and also allows you to finetune the 55 | * the feedback (higher: slow down, lower: speed up) 56 | * - typical values: 20, 24 or 30 57 | * - adjust value to match your rotary encoder 58 | */ 59 | 60 | #define ENCODER_STEPS 30 61 | 62 | 63 | /* 64 | * increase/decrease push buttons for user interface 65 | * - alternative for rotary encoder 66 | * - see KEY_PORT for port pins (config-.h) 67 | * - uncomment to enable 68 | */ 69 | 70 | //#define HW_INCDEC_KEYS 71 | 72 | 73 | /* 74 | * 2.5V voltage reference for Vcc check 75 | * - default pin: PC4 (ATmega 328) 76 | * - should be at least 10 times more precise than the voltage regulator 77 | * - see TP_REF for port pin (config-.h) 78 | * - uncomment to enable and also adjust UREF_25 below for your voltage 79 | * reference 80 | */ 81 | 82 | //#define HW_REF25 83 | 84 | 85 | /* 86 | * Typical voltage of 2.5V voltage reference (in mV) 87 | * - see datasheet of the voltage reference 88 | * - or use >= 5.5 digit DMM to measure the voltage 89 | */ 90 | 91 | #define UREF_25 2495 92 | 93 | 94 | /* 95 | * Probe protection relay for discharging caps 96 | * - default pin: PC4 (ATmega 328) 97 | * - low signal: short circuit probe pins 98 | * high signal via external reference: remove short circuit 99 | * - uncomment to enable 100 | */ 101 | 102 | //#define HW_DISCHARGE_RELAY 103 | 104 | 105 | /* 106 | * voltage measurement up to 50V DC 107 | * - default pin: PC3 (ATmega 328) 108 | * - 10:1 voltage divider 109 | * - for Zener diodes 110 | * - DC-DC boost converter controled by test push button 111 | * - see TP_BAT for port pin 112 | * - uncomment to enable 113 | */ 114 | 115 | //#define HW_ZENER 116 | 117 | 118 | /* 119 | * fixed signal output 120 | * - in case MCU's OC1B pin is wired as dedicated signal output 121 | * instead of driving Rl probe resistor for test pin #2 122 | * - uncomment to enable 123 | */ 124 | 125 | //#define HW_FIXED_SIGNAL_OUTPUT 126 | 127 | 128 | /* 129 | * basic frequency counter 130 | * - default pin: T0 (PD4 ATmega 328) 131 | * - uses T0 directly as frequency input 132 | * - counts up to 1/4 of MCU clock rate 133 | * - might be in parallel with LCD module 134 | * - uncomment to enable 135 | */ 136 | 137 | #define HW_FREQ_COUNTER_BASIC 138 | 139 | 140 | /* 141 | * extended frequency counter 142 | * - low and high frequency crystal oscillators 143 | * and buffered frequency input 144 | * - prescalers 1:1 and 16:1 (32:1) 145 | * - see COUNTER_PORT for port pins (config-.h) 146 | * - requires a display with more than 2 text lines 147 | * - uncomment to enable (not supported yet) 148 | * - select the circuit's prescaler setting: either 16:1 or 32:1 149 | */ 150 | 151 | //#define HW_FREQ_COUNTER_EXT 152 | #define FREQ_COUNTER_PRESCALER 16 /* 16:1 */ 153 | //#define FREQ_COUNTER_PRESCALER 32 /* 32:1 */ 154 | 155 | 156 | /* 157 | * IR remote control detection/decoder (via dedicated MCU pin) 158 | * - requires IR receiver module, e.g. TSOP series 159 | * - module is connected to fixed I/O pin 160 | * - see IR_PORT for port pin (config-.h) 161 | * - uncomment to enable 162 | */ 163 | 164 | //#define HW_IR_RECEIVER 165 | 166 | 167 | /* 168 | * fixed cap for self-adjustment 169 | * - see TP_CAP and ADJUST_PORT for port pins (config-.h) 170 | * - uncomment to enable 171 | */ 172 | 173 | //#define HW_ADJUST_CAP 174 | 175 | 176 | /* 177 | * relay for parallel cap (sampling ADC) 178 | * - uncomment to enable (not implemented yet) 179 | */ 180 | 181 | //#define HW_CAP_RELAY 182 | 183 | 184 | 185 | /* ************************************************************************ 186 | * software options 187 | * ************************************************************************ */ 188 | 189 | 190 | /* 191 | * PWM generator with simple user interface 192 | * - uncomment to enable 193 | */ 194 | 195 | #define SW_PWM_SIMPLE 196 | 197 | 198 | /* 199 | * PWM generator with fancy user interface 200 | * - requires additional keys and display with more than 2 text lines 201 | * - uncomment to enable 202 | */ 203 | 204 | //#define SW_PWM_PLUS 205 | 206 | 207 | /* 208 | * Inductance measurement 209 | * - uncomment to enable 210 | */ 211 | 212 | #define SW_INDUCTOR 213 | 214 | 215 | /* 216 | * ESR measurement and in-circuit ESR measurement 217 | * - requires MCU clock >= 8 MHz 218 | * - choose SW_OLD_ESR for old method starting at 180nF 219 | * - uncomment to enable 220 | */ 221 | 222 | #define SW_ESR 223 | //#define SW_OLD_ESR 224 | 225 | 226 | /* 227 | * check for rotary encoders 228 | * - uncomment to enable 229 | */ 230 | 231 | //#define SW_ENCODER 232 | 233 | 234 | /* 235 | * squarewave signal generator 236 | * - requires additional keys 237 | * - uncomment to enable 238 | */ 239 | 240 | //#define SW_SQUAREWAVE 241 | 242 | 243 | /* 244 | * IR remote control detection/decoder (via probes) 245 | * - requires IR receiver module, e.g. TSOP series 246 | * - module will be connected to probe leads 247 | * - uncomment to enable 248 | */ 249 | 250 | #define SW_IR_RECEIVER 251 | 252 | 253 | /* 254 | * current limiting resistor for IR receiver module 255 | * - for 5V only modules 256 | * - Warning: any short circuit may destroy your MCU 257 | * - uncomment to disable resistor 258 | */ 259 | 260 | //#define SW_IR_DISABLE_RESISTOR 261 | 262 | 263 | /* 264 | * IR remote control sender 265 | * - requires additional keys and display with more than 4 text lines 266 | * - also requires an IR LED with a simple driver 267 | * - uncomment to enable 268 | */ 269 | 270 | //#define SW_IR_TRANSMITTER 271 | 272 | 273 | /* 274 | * additional protocols for IR remote control detection/decoder 275 | * and sender 276 | * - uncommon protocols which increase flash memory usage ;) 277 | * - uncomment to enable 278 | */ 279 | 280 | //#define SW_IR_EXTRA 281 | 282 | 283 | /* 284 | * check for opto couplers 285 | * - uncomment to enable 286 | */ 287 | 288 | //#define SW_OPTO_COUPLER 289 | 290 | 291 | /* 292 | * check for Unijunction Transistors 293 | * - uncomment to enable 294 | */ 295 | 296 | //#define SW_UJT 297 | 298 | 299 | /* 300 | * color coding for probes 301 | * - requires color graphics LCD 302 | * - uncomment to enable 303 | * - edit colors.h to select correct probe colors 304 | */ 305 | 306 | //#define SW_PROBE_COLORS 307 | 308 | 309 | /* 310 | * Servo Check 311 | * - requires additional keys and display with more than 2 text lines 312 | * - uncomment to enable 313 | */ 314 | 315 | //#define SW_SERVO 316 | 317 | 318 | /* 319 | * DS18B20 320 | * - uncomment to enable 321 | * - also enable ONEWIRE_PROBES or ONEWIRE_IO_PIN (see section 'Busses') 322 | */ 323 | 324 | //#define SW_DS18B20 325 | 326 | 327 | /* 328 | * capacitor leakage check 329 | * - requires display with more than two lines 330 | * - uncomment to enable 331 | */ 332 | 333 | #define SW_CAP_LEAKAGE 334 | 335 | 336 | 337 | /* ************************************************************************ 338 | * Makefile workaround for some IDEs 339 | * ************************************************************************ */ 340 | 341 | 342 | /* 343 | * Oscillator startup cycles (after wakeup from power-safe mode): 344 | * - typical values 345 | * - internal RC: 6 346 | * - full swing crystal: 16384 (also 256 or 1024 based on fuse settings) 347 | * - low power crystal: 16384 (also 256 or 1024 based on fuse settings) 348 | * - Please change value if it doesn't match your tester! 349 | */ 350 | 351 | #ifndef OSC_STARTUP 352 | #define OSC_STARTUP 16384 353 | #endif 354 | 355 | 356 | 357 | /* ************************************************************************ 358 | * misc settings 359 | * ************************************************************************ */ 360 | 361 | 362 | /* 363 | * Languange of user interface. Available languages: 364 | * - English (default) 365 | * - Czech 366 | * - Danish 367 | * - German 368 | * - Polish 369 | * - Spanish 370 | * - Russian (only 8x16 font horizontally aligned) 371 | */ 372 | 373 | #define UI_ENGLISH 374 | //#define UI_CZECH 375 | //#define UI_DANISH 376 | //#define UI_GERMAN 377 | //#define UI_ITALIAN 378 | //#define UI_POLISH 379 | //#define UI_SPANISH 380 | //#define UI_RUSSIAN 381 | 382 | 383 | /* 384 | * Use comma instead of dot to indicate a decimal fraction. 385 | * - uncomment to enable 386 | */ 387 | 388 | //#define UI_COMMA 389 | 390 | 391 | /* 392 | * Display temperatures in Fahrenheit instead of Celsius. 393 | * - uncomment to enable 394 | */ 395 | 396 | //#define UI_FAHRENHEIT 397 | 398 | 399 | /* 400 | * Set the default operation mode to auto-hold. 401 | * - instead of continous mode 402 | * - uncomment to enable 403 | */ 404 | 405 | #define UI_AUTOHOLD 406 | 407 | 408 | /* 409 | * Trigger the menu also by a short circuit of all three probes. 410 | * - former default behaviour 411 | * - uncomment to enable 412 | */ 413 | 414 | //#define UI_SHORT_CIRCUIT_MENU 415 | 416 | 417 | /* 418 | * Output components found also via TTL serial interface. 419 | * - uncomment to enable 420 | * - also enable SERIAL_BITBANG or SERIAL_HARDWARE (see section 'Busses') 421 | */ 422 | 423 | //#define UI_SERIAL_COPY 424 | 425 | 426 | /* 427 | * Control tester via TTL serial interface. 428 | * - uncomment to enable 429 | * - also enable SERIAL_BITBANG or SERIAL_HARDWARE, plus SERIAL_RW 430 | * (see section 'Busses') 431 | */ 432 | 433 | //#define UI_SERIAL_COMMANDS 434 | 435 | 436 | /* 437 | * Maximum time to wait after probing in continous mode (in ms). 438 | * - Time between printing the result and starting a new probing cycle. 439 | */ 440 | 441 | #define CYCLE_DELAY 10000 442 | 443 | 444 | /* 445 | * Maximum number of tests without any component found in a row. 446 | * - If this number is reached the tester powers off. 447 | */ 448 | 449 | #define CYCLE_MAX 5 450 | 451 | 452 | /* 453 | * Battery monitoring mode 454 | * - BAT_NONE disable battery monitoring completely 455 | * - BAT_DIRECT direct measurement of battary voltage (< 5V) 456 | * - BAT_DIVIDER measurement via voltage divider 457 | * - uncomment one of the modes 458 | */ 459 | 460 | //#define BAT_NONE 461 | //#define BAT_DIRECT 462 | #define BAT_DIVIDER 463 | 464 | 465 | /* 466 | * Unmonitored optional external power supply 467 | * - Some circuits supporting an additional external power supply are designed 468 | * in a way that prevents the battery monitoring to measure the voltage of 469 | * the external power supply. This would trigger the low battery shut-down. 470 | * The switch below will prevent the shut-down when the measured voltage is 471 | * below 0.9V (caused by the diode's leakage current). 472 | * - uncomment to enable 473 | */ 474 | 475 | //#define BAT_EXT_UNMONITORED 476 | 477 | 478 | /* 479 | * Voltage divider for battery monitoring 480 | * - BAT_R1: top resistor in Ohms 481 | * - BAT_R2: bottom resistor in Ohms 482 | */ 483 | 484 | #define BAT_R1 10000 485 | #define BAT_R2 3300 486 | 487 | 488 | /* 489 | * Voltage drop by reverse voltage protection diode and power management 490 | * transistor (in mV): 491 | * - Schottky diode about 200mV / PNP BJT about 100mV. 492 | * - Get your DMM and measure the voltage drop! 493 | */ 494 | 495 | #define BAT_OFFSET 290 496 | 497 | 498 | /* 499 | * Battery weak voltage (in mV). 500 | * - Tester warns if BAT_WEAK is reached. 501 | * - Voltage drop (BAT_OUT) is considered in calculation. 502 | */ 503 | 504 | #define BAT_WEAK 7400 505 | 506 | 507 | /* 508 | * Battery low voltage (in mV). 509 | * - Tester powers off if BAT_LOW is reached. 510 | * - Voltage drop (BAT_OFFSET) is considered in calculation. 511 | */ 512 | 513 | #define BAT_LOW 6400 514 | 515 | 516 | /* 517 | * Enter sleep mode when idle to save power. 518 | * - uncomment to enable 519 | */ 520 | 521 | #define SAVE_POWER 522 | 523 | 524 | 525 | /* ************************************************************************ 526 | * measurement settings and offsets 527 | * ************************************************************************ */ 528 | 529 | 530 | /* 531 | * ADC voltage reference based on Vcc (in mV). 532 | */ 533 | 534 | #define UREF_VCC 5001 535 | 536 | 537 | /* 538 | * Offset for the internal bandgap voltage reference (in mV): -100 up to 100 539 | * - To compensate any difference between real value and measured value. 540 | * - The ADC has a resolution of about 4.88mV for V_ref = 5V (Vcc) and 541 | * 1.07mV for V_ref = 1.1V (bandgap). 542 | * - Will be added to measured voltage of bandgap reference. 543 | */ 544 | 545 | #define UREF_OFFSET 0 546 | 547 | 548 | /* 549 | * Exact values of probe resistors. 550 | * - Standard value for Rl is 680 Ohms. 551 | * - Standard value for Rh is 470k Ohms. 552 | */ 553 | 554 | /* Rl in Ohms */ 555 | #define R_LOW 680 556 | 557 | /* Rh in Ohms */ 558 | #define R_HIGH 470000 559 | 560 | 561 | /* 562 | * Offset for systematic error of resistor measurement with Rh (470k) 563 | * in Ohms. 564 | * - if resistors >20k measure too high or low adjust the offset accordingly 565 | * - standard offset is 350 Ohms 566 | */ 567 | 568 | #define RH_OFFSET 350 569 | 570 | 571 | 572 | /* 573 | * Resistance of probe leads (in 0.01 Ohms). 574 | * - Resistance of two probe leads in series. 575 | * - Assuming all probe leads got same/similar resistance. 576 | */ 577 | 578 | #define R_ZERO 20 579 | 580 | 581 | 582 | /* 583 | * Capacitance of the wires between PCB and terminals (in pF). 584 | * Examples: 585 | * - 2pF for wires 10cm long 586 | */ 587 | 588 | #define CAP_WIRES 2 589 | 590 | 591 | /* 592 | * Capacitance of the probe leads connected to the tester (in pF). 593 | * Examples: 594 | * capacity length of probe leads 595 | * ------------------------------- 596 | * 3pF about 10cm 597 | * 9pF about 30cm 598 | * 15pF about 50cm 599 | */ 600 | 601 | #define CAP_PROBELEADS 9 602 | 603 | 604 | /* 605 | * Maximum voltage at which we consider a capacitor being 606 | * discharged (in mV) 607 | */ 608 | 609 | #define CAP_DISCHARGED 2 610 | 611 | 612 | /* 613 | * Correction factors for capacitors (in 0.1%) 614 | * - positive factor increases capacitance value 615 | * negative factor decreases capacitance value 616 | * - CAP_FACTOR_SMALL for caps < 4.7�F 617 | * - CAP_FACTOR_MID for caps 4.7 - 47�F 618 | * - CAP_FACTOR_LARGE for caps > 47�F 619 | */ 620 | 621 | #define CAP_FACTOR_SMALL 0 /* no correction */ 622 | #define CAP_FACTOR_MID -40 /* -4.0% */ 623 | #define CAP_FACTOR_LARGE -90 /* -9.0% */ 624 | 625 | 626 | /* 627 | * Number of ADC samples to perform for each mesurement. 628 | * - Valid values are in the range of 1 - 255. 629 | */ 630 | 631 | #define ADC_SAMPLES 25 632 | 633 | 634 | 635 | /* ************************************************************************ 636 | * MCU specific setup to support different AVRs 637 | * ************************************************************************ */ 638 | 639 | 640 | /* MCU clock */ 641 | #define CPU_FREQ F_CPU 642 | 643 | 644 | /* 645 | * ATmega 328/328P 646 | */ 647 | 648 | #if defined(__AVR_ATmega328__) 649 | 650 | #include "config_328.h" 651 | 652 | 653 | /* 654 | * ATmega 324P/324PA/644/644P/644PA/1284/1284P 655 | */ 656 | 657 | #elif defined(__AVR_ATmega324P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega1284__) 658 | 659 | #include "config_644.h" 660 | 661 | 662 | /* 663 | * missing or unsupported MCU 664 | */ 665 | 666 | #else 667 | #error <<< No or wrong MCU type selected! >>> 668 | #endif 669 | 670 | 671 | 672 | /* ************************************************************************ 673 | * Busses 674 | * ************************************************************************ */ 675 | 676 | 677 | /* 678 | * I2C bus 679 | * - might be required by some hardware 680 | * - could already be enabled in display section (config_.h) 681 | * - for bit-bang I2C port and pins see I2C_PORT (config_.h) 682 | * - hardware I2C (TWI) uses automatically the proper MCU pins 683 | * - uncomment either I2C_BITBANG or I2C_HARDWARE to enable 684 | * - uncomment one of the bus speed modes 685 | */ 686 | 687 | //#define I2C_BITBANG /* bit-bang I2C */ 688 | //#define I2C_HARDWARE /* MCU's hardware TWI */ 689 | //#define I2C_STANDARD_MODE /* 100kHz bus speed */ 690 | //#define I2C_FAST_MODE /* 400kHz bus speed */ 691 | //#define I2C_RW /* enable I2C read support (untested) */ 692 | 693 | 694 | /* 695 | * SPI bus 696 | * - might be required by some hardware 697 | * - could already be enabled in display section (config_.h) 698 | * - for bit-bang SPI port and pins see SPI_PORT (config_.h) 699 | * - hardware SPI uses automatically the proper MCU pins 700 | * - uncomment either SPI_BITBANG or SPI_HARDWARE to enable 701 | */ 702 | 703 | //#define SPI_BITBANG /* bit-bang SPI */ 704 | //#define SPI_HARDWARE /* hardware SPI */ 705 | //#define SPI_RW /* enable SPI read support */ 706 | 707 | 708 | /* 709 | * TTL serial interface 710 | * - could already be enabled in display section (config_.h) 711 | * - for bit-bang serial port and pins see SERIAL_PORT (config_.h) 712 | * - hardware serial uses automatically the proper MCU pins 713 | * - uncomment either SERIAL_BITBANG or SERIAL_HARDWARE to enable 714 | */ 715 | 716 | //#define SERIAL_BITBANG /* bit-bang serial */ 717 | //#define SERIAL_HARDWARE /* hardware serial */ 718 | //#define SERIAL_RW /* enable serial read support */ 719 | 720 | 721 | /* 722 | * OneWire bus 723 | * - for dedicated I/O pin please see ONEWIRE_PORT (config_.h) 724 | * - uncomment either ONEWIRE_PROBES or ONEWIRE_ to enable 725 | */ 726 | 727 | //#define ONEWIRE_PROBES /* via probes */ 728 | //#define ONEWIRE_IO_PIN /* via dedicated I/O pin */ 729 | 730 | 731 | 732 | /* ************************************************************************ 733 | * ADC clock 734 | * ************************************************************************ */ 735 | 736 | 737 | /* 738 | * ADC clock 739 | * - The ADC clock is 125000Hz by default. 740 | * - You could also set 250000Hz, but that exceeds the max. ADC clock 741 | * of 200kHz for 10 bit resolution! 742 | * - Special case for 20MHz MCU clock: 156250Hz 743 | */ 744 | 745 | #if CPU_FREQ == 20000000 746 | /* 20MHz MCU clock */ 747 | #define ADC_FREQ 156250 748 | #else 749 | /* all other MCU clocks */ 750 | #define ADC_FREQ 125000 751 | #endif 752 | 753 | 754 | /* 755 | * define clock divider 756 | * - supports 1MHz, 2MHz, 4MHz, 8MHz and 16MHz MCU clocks 757 | * - we got only 7 fixed prescalers from 2 up to 128 758 | */ 759 | 760 | /* 1MHz/250kHz */ 761 | #if CPU_FREQ / ADC_FREQ == 4 762 | #define ADC_CLOCK_DIV (1 << ADPS1) 763 | #endif 764 | 765 | /* 1MHz/125kHz 2MHz/250kHz */ 766 | #if CPU_FREQ / ADC_FREQ == 8 767 | #define ADC_CLOCK_DIV (1 << ADPS1) | (1 << ADPS0) 768 | #endif 769 | 770 | /* 2MHz/125kHz 4MHz/250kHz */ 771 | #if CPU_FREQ / ADC_FREQ == 16 772 | #define ADC_CLOCK_DIV (1 << ADPS2) 773 | #endif 774 | 775 | /* 4MHz/125kHz 8MHz/250kHz */ 776 | #if CPU_FREQ / ADC_FREQ == 32 777 | #define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS0) 778 | #endif 779 | 780 | /* 8MHz/125kHz 16MHz/250kHz */ 781 | #if CPU_FREQ / ADC_FREQ == 64 782 | #define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS1) 783 | #endif 784 | 785 | /* 16MHz/125kHz 20MHz/156.25kHz */ 786 | #if CPU_FREQ / ADC_FREQ == 128 787 | #define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0) 788 | #endif 789 | 790 | 791 | 792 | /* ************************************************************************ 793 | * derived values 794 | * ************************************************************************ */ 795 | 796 | 797 | /* 798 | * total default capacitance (in pF) 799 | * - max. 255 800 | */ 801 | 802 | #define C_ZERO CAP_PCB + CAP_WIRES + CAP_PROBELEADS 803 | 804 | 805 | /* 806 | * number of MCU cycles per �s 807 | * - min. 1 (for 1MHz) 808 | * - max. 20 (for 20MHz) 809 | */ 810 | 811 | #define MCU_CYCLES_PER_US (CPU_FREQ / 1000000) 812 | 813 | 814 | /* 815 | * number of MCU cycles per ADC cycle 816 | * - min. 4 817 | * - max. 128 818 | */ 819 | 820 | #define MCU_CYCLES_PER_ADC (CPU_FREQ / ADC_FREQ) 821 | 822 | 823 | /* 824 | * time of a MCU cycle (in 0.1 ns) 825 | */ 826 | 827 | #define MCU_CYCLE_TIME (10000 / (CPU_FREQ / 1000000)) 828 | 829 | 830 | 831 | /* ************************************************************************ 832 | * options management 833 | * ************************************************************************ */ 834 | 835 | 836 | /* 837 | * hardware/software options 838 | */ 839 | 840 | 841 | /* additional keys */ 842 | /* rotary encoder, increase/decrease push buttons or touch screen */ 843 | #if defined (HW_ENCODER) || defined (HW_INCDEC_KEYS) | defined (HW_TOUCH) 844 | #define HW_KEYS 845 | #endif 846 | 847 | /* options which require additional keys */ 848 | #ifndef HW_KEYS 849 | 850 | /* PWM+ */ 851 | #ifdef SW_PWM_PLUS 852 | #undef SW_PWM_PLUS 853 | #define SW_PWM_SIMPLE 854 | #endif 855 | 856 | /* squarewave generator */ 857 | #ifdef SW_SQUAREWAVE 858 | #undef SW_SQUAREWAVE 859 | #endif 860 | 861 | /* Servo Check */ 862 | #ifdef SW_SERVO 863 | #undef SW_SERVO 864 | #endif 865 | 866 | #endif 867 | 868 | 869 | /* options which require a MCU clock >= 8MHz */ 870 | #if CPU_FREQ < 8000000 871 | 872 | /* ESR measurement */ 873 | #ifdef SW_ESR 874 | #undef SW_ESR 875 | #endif 876 | 877 | /* old ESR measurement */ 878 | #ifdef SW_OLD_ESR 879 | #undef SW_OLD_ESR 880 | #endif 881 | 882 | #endif 883 | 884 | 885 | /* SPI */ 886 | #if defined (SPI_BITBANG) || defined (SPI_HARDWARE) 887 | #define HW_SPI 888 | #endif 889 | 890 | 891 | /* I2C */ 892 | #if defined (I2C_BITBANG) || defined (I2C_HARDWARE) 893 | #define HW_I2C 894 | #endif 895 | 896 | 897 | /* TTL serial */ 898 | #if defined (SERIAL_BITBANG) || defined (SERIAL_HARDWARE) 899 | #define HW_SERIAL 900 | #endif 901 | 902 | /* VT100 display driver disables other options for serial interface */ 903 | #ifdef LCD_VT100 904 | #ifdef UI_SERIAL_COPY 905 | #undef UI_SERIAL_COPY 906 | #endif 907 | #ifdef UI_SERIAL_COMMANDS 908 | #undef UI_SERIAL_COMMANDS 909 | #endif 910 | #endif 911 | 912 | /* options which require TTL serial */ 913 | #ifndef HW_SERIAL 914 | #ifdef LCD_VT100 915 | #undef LCD_VT100 916 | #endif 917 | #ifdef UI_SERIAL_COPY 918 | #undef UI_SERIAL_COPY 919 | #endif 920 | #ifdef UI_SERIAL_COMMANDS 921 | #undef UI_SERIAL_COMMANDS 922 | #endif 923 | #endif 924 | 925 | /* options which require TTL serial RW */ 926 | #ifndef SERIAL_RW 927 | #ifdef UI_SERIAL_COMMANDS 928 | #undef UI_SERIAL_COMMANDS 929 | #endif 930 | #endif 931 | 932 | 933 | /* OneWire: probe leads prevail */ 934 | #ifdef ONEWIRE_PROBES 935 | #undef ONEWIRE_IO_PIN 936 | #endif 937 | #ifdef ONEWIRE_IO_PIN 938 | #undef ONEWIRE_PROBES 939 | #endif 940 | 941 | /* options which require OneWire */ 942 | #if ! defined (ONEWIRE_PROBES) && ! defined (ONEWIRE_IO_PIN) 943 | #ifdef SW_DS18B20 944 | #undef SW_DS18B20 945 | #endif 946 | #endif 947 | 948 | 949 | /* touchscreen */ 950 | #ifdef TOUCH_PORT 951 | #define HW_TOUCH 952 | #endif 953 | 954 | 955 | /* LCD module */ 956 | #ifdef LCD_CONTRAST 957 | #define SW_CONTRAST 958 | #else 959 | #define LCD_CONTRAST 0 960 | #endif 961 | 962 | 963 | /* color coding for probes requires a color graphics display */ 964 | #ifdef SW_PROBE_COLORS 965 | #ifndef LCD_COLOR 966 | #undef SW_PROBE_COLORS 967 | #endif 968 | #endif 969 | 970 | 971 | /* component symbols for fancy pinout */ 972 | #if defined (SYMBOLS_24X24_H) 973 | #define SW_SYMBOLS 974 | #endif 975 | #if defined (SYMBOLS_24X24_HF) || defined (SYMBOLS_30X32_HF) || defined (SYMBOLS_32X32_HF) 976 | #define SW_SYMBOLS 977 | #endif 978 | #if defined (SYMBOLS_24X24_VFP) 979 | #define SW_SYMBOLS 980 | #endif 981 | #if defined (SYMBOLS_24X24_VP_F) 982 | #define SW_SYMBOLS 983 | #endif 984 | 985 | /* symbols require graphic display */ 986 | #ifdef SW_SYMBOLS 987 | #ifndef LCD_GRAPHIC 988 | #undef SW_SYMBOLS 989 | #endif 990 | #endif 991 | 992 | 993 | /* frequency counter */ 994 | #if defined (HW_FREQ_COUNTER_BASIC) || defined (HW_FREQ_COUNTER_EXT) 995 | #define HW_FREQ_COUNTER 996 | #endif 997 | 998 | 999 | /* IR detector/decoder: probe lead based decoder prevails */ 1000 | #ifdef SW_IR_RECEIVER 1001 | #undef HW_IR_RECEIVER 1002 | #endif 1003 | #ifdef HW_IR_RECEIVER 1004 | #undef SW_IR_RECEIVER 1005 | #endif 1006 | 1007 | 1008 | 1009 | /* ************************************************************************ 1010 | * EOF 1011 | * ************************************************************************ */ 1012 | -------------------------------------------------------------------------------- /firmware 1.34/config_644.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/config_644.h -------------------------------------------------------------------------------- /firmware 1.34/display.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************ 2 | * 3 | * common display functions and common functions for LCD modules 4 | * 5 | * (c) 2015-2018 by Markus Reschke 6 | * 7 | * ************************************************************************ */ 8 | 9 | 10 | /* 11 | * local constants 12 | */ 13 | 14 | /* source management */ 15 | #define DISPLAY_C 16 | 17 | 18 | /* 19 | * include header files 20 | */ 21 | 22 | /* local includes */ 23 | #include "config.h" /* global configuration */ 24 | #include "common.h" /* common header file */ 25 | #include "variables.h" /* global variables */ 26 | #include "functions.h" /* external functions */ 27 | 28 | 29 | 30 | /* ************************************************************************ 31 | * display of characters and strings 32 | * ************************************************************************ */ 33 | 34 | 35 | /* 36 | * next line automation 37 | * - move to next line 38 | * - clear display if no lines are left 39 | * - controlled by global variable UI.LineMode 40 | * 41 | * Flags: 42 | * - LINE_STD move to next line, 43 | * clear display when last line is exceeded 44 | * - LINE_KEY same as LINE_STD, 45 | * but also wait for test key/timeout 46 | * - LINE_KEEP keep first line when clearing the display 47 | */ 48 | 49 | void Display_NextLine(void) 50 | { 51 | uint8_t Mode; /* line mode */ 52 | uint8_t Line; /* line number */ 53 | 54 | /* 55 | * LCD/OLED display module 56 | */ 57 | 58 | #ifdef UI_SERIAL_COMMANDS 59 | if (Cfg.OP_Control & OP_OUT_LCD) /* copy to LCD enabled */ 60 | { 61 | #endif 62 | 63 | Mode = UI.LineMode; /* get current mode */ 64 | Line = UI.CharPos_Y; /* get current line number */ 65 | 66 | /* check if we reached the last line */ 67 | if (Line == UI.CharMax_Y) 68 | { 69 | if (Mode & LINE_KEY) WaitKey(); /* wait for key press */ 70 | 71 | /* clear screen */ 72 | if (Mode & LINE_KEEP) /* keep first line */ 73 | { 74 | Line = UI.CharMax_Y; /* start at the last line */ 75 | while (Line > 1) 76 | { 77 | LCD_ClearLine(Line); /* clear line */ 78 | Line--; /* next line */ 79 | } 80 | 81 | LCD_CharPos(1, 2); /* move to second line */ 82 | } 83 | else /* clear complete screen */ 84 | { 85 | LCD_Clear(); /* clear screen */ 86 | } 87 | } 88 | else 89 | { 90 | /* simply move to the next line */ 91 | Line++; /* add one line */ 92 | LCD_CharPos(1, Line); /* move to new line */ 93 | } 94 | 95 | #ifdef UI_SERIAL_COMMANDS 96 | } 97 | #endif 98 | 99 | 100 | /* 101 | * TTL serial 102 | */ 103 | 104 | #ifdef UI_SERIAL_COPY 105 | if (Cfg.OP_Control & OP_OUT_SER) /* copy to serial enabled */ 106 | { 107 | Serial_NewLine(); /* serial: new line */ 108 | } 109 | #endif 110 | } 111 | 112 | 113 | 114 | /* 115 | * display a single character 116 | * - wrapper for outputting a character to different channels 117 | * - if we have only the LCD display we simply create an alias for 118 | * LCD_Char() in functions.h to save a few bytes 119 | * 120 | * requires: 121 | * - character 122 | */ 123 | 124 | #if defined (UI_SERIAL_COPY) || defined (UI_SERIAL_COMMANDS) 125 | 126 | void Display_Char(unsigned char Char) 127 | { 128 | /* 129 | * LCD/OLED display module 130 | */ 131 | 132 | #ifdef UI_SERIAL_COMMANDS 133 | if (Cfg.OP_Control & OP_OUT_LCD) /* copy to LCD enabled */ 134 | { 135 | #endif 136 | 137 | LCD_Char(Char); /* send char to display */ 138 | 139 | #ifdef UI_SERIAL_COMMANDS 140 | } 141 | #endif 142 | 143 | 144 | /* 145 | * TTL serial 146 | */ 147 | 148 | if (Cfg.OP_Control & OP_OUT_SER) /* copy to serial enabled */ 149 | { 150 | Serial_Char(Char); /* send char to serial */ 151 | } 152 | } 153 | 154 | #endif 155 | 156 | 157 | 158 | /* 159 | * display a fixed string stored in EEPROM 160 | * 161 | * requires: 162 | * - pointer to fixed string 163 | */ 164 | 165 | void Display_EEString(const unsigned char *String) 166 | { 167 | unsigned char Char; 168 | 169 | /* read characters until we get the terminating 0 */ 170 | while ((Char = eeprom_read_byte(String))) 171 | { 172 | Display_Char(Char); /* send character */ 173 | String++; /* next one */ 174 | } 175 | } 176 | 177 | 178 | 179 | /* ************************************************************************ 180 | * convenience functions to save some bytes of flash memory 181 | * ************************************************************************ */ 182 | 183 | 184 | /* 185 | * display probe number 186 | * - probe-1 -> '1' 187 | * - probe-2 -> '2' 188 | * - probe-3 -> '3' 189 | * 190 | * requires: 191 | * - probe/testpin ID (0-2) 192 | */ 193 | 194 | void Display_ProbeNumber(uint8_t Probe) 195 | { 196 | #ifdef SW_PROBE_COLORS 197 | uint16_t Color; /* color value */ 198 | 199 | Color = UI.PenColor; /* save current color */ 200 | UI.PenColor = ProbeColors[Probe]; /* set probe color */ 201 | #endif 202 | 203 | /* since probe-1 is 0 we simply add the value to ASCII '1' */ 204 | Display_Char('1' + Probe); /* send char */ 205 | 206 | #ifdef SW_PROBE_COLORS 207 | UI.PenColor = Color; /* restore old color */ 208 | #endif 209 | } 210 | 211 | 212 | 213 | /* 214 | * display a space 215 | */ 216 | 217 | void Display_Space(void) 218 | { 219 | Display_Char(' '); /* print a space */ 220 | } 221 | 222 | 223 | 224 | /* 225 | * display a fixed string stored in EEPROM followed by a space 226 | * 227 | * requires: 228 | * - pointer to fixed string 229 | */ 230 | 231 | void Display_EEString_Space(const unsigned char *String) 232 | { 233 | Display_EEString(String); /* display string */ 234 | Display_Space(); /* print space */ 235 | } 236 | 237 | 238 | 239 | /* 240 | * move to the next line and 241 | * display a fixed string stored in EEPROM 242 | * 243 | * requires: 244 | * - pointer to fixed string 245 | */ 246 | 247 | void Display_NL_EEString(const unsigned char *String) 248 | { 249 | Display_NextLine(); 250 | Display_EEString(String); /* display string */ 251 | } 252 | 253 | 254 | 255 | /* 256 | * move to the next line and 257 | * display a fixed string stored in EEPROM followed by a space 258 | * 259 | * requires: 260 | * - pointer to fixed string 261 | */ 262 | 263 | void Display_NL_EEString_Space(const unsigned char *String) 264 | { 265 | Display_NextLine(); 266 | Display_EEString(String); /* display string */ 267 | Display_Space(); /* print space */ 268 | } 269 | 270 | 271 | 272 | /* 273 | * clear line #2 of display 274 | * - cursor is set to first char of line 275 | */ 276 | 277 | void LCD_ClearLine2(void) 278 | { 279 | LCD_ClearLine(2); /* clear line #2 */ 280 | LCD_CharPos(1, 2); /* move to beginning of line #2 */ 281 | } 282 | 283 | 284 | 285 | #ifdef UI_SERIAL_COPY 286 | 287 | /* 288 | * send newline and enable output to serial 289 | */ 290 | 291 | void SerialCopy_On(void) 292 | { 293 | Serial_NewLine(); /* serial: new line */ 294 | Cfg.OP_Control |= OP_OUT_SER; /* enable output to serial */ 295 | } 296 | 297 | 298 | 299 | /* 300 | * disable output to serial and send newline 301 | */ 302 | 303 | void SerialCopy_Off(void) 304 | { 305 | Cfg.OP_Control &= ~OP_OUT_SER; /* disable output to serial */ 306 | Serial_NewLine(); /* serial: new line */ 307 | } 308 | 309 | #endif 310 | 311 | 312 | 313 | #ifdef UI_SERIAL_COMMANDS 314 | 315 | /* 316 | * switch output from LCD to TTL serial 317 | */ 318 | 319 | void Display_LCD2Serial(void) 320 | { 321 | Cfg.OP_Control &= ~OP_OUT_LCD; /* disable LCD output */ 322 | Cfg.OP_Control |= OP_OUT_SER; /* enable serial output */ 323 | } 324 | 325 | 326 | 327 | /* 328 | * switch output from TTL serial to LCD 329 | */ 330 | 331 | void Display_Serial2LCD(void) 332 | { 333 | Cfg.OP_Control &= ~OP_OUT_SER; /* disable serial output */ 334 | Cfg.OP_Control |= OP_OUT_LCD; /* enable LCD output */ 335 | } 336 | 337 | 338 | 339 | /* 340 | * display a fixed string stored in EEPROM 341 | * and move to next line 342 | * 343 | * requires: 344 | * - pointer to fixed string 345 | */ 346 | 347 | void Display_EEString_NL(const unsigned char *String) 348 | { 349 | Display_EEString(String); /* display string */ 350 | Display_NextLine(); /* new line */ 351 | } 352 | 353 | #endif 354 | 355 | 356 | 357 | /* ************************************************************************ 358 | * display of values and units 359 | * ************************************************************************ */ 360 | 361 | 362 | #if defined (SW_IR_RECEIVER) || defined (HW_IR_RECEIVER) || defined (SW_IR_TRANSMITTER) 363 | 364 | /* 365 | * display single hexadecimal digit 366 | * 367 | * requires: 368 | * - value to display (0-15) 369 | */ 370 | 371 | void Display_HexDigit(uint8_t Digit) 372 | { 373 | /* 374 | * convert value into hex digit: 375 | * - 0-9: ascii 48-57 376 | * - A-F: ascii 65-70 377 | */ 378 | 379 | if (Digit < 10) Digit += 48; /* 0-9 */ 380 | else Digit += (65 - 10); /* A-F */ 381 | Display_Char(Digit); 382 | } 383 | 384 | #endif 385 | 386 | 387 | 388 | #if defined (SW_IR_RECEIVER) || defined (HW_IR_RECEIVER) 389 | 390 | /* 391 | * display byte as hexadecimal number 392 | * 393 | * requires: 394 | * - value to display (0-255) 395 | */ 396 | 397 | void Display_HexByte(uint8_t Value) 398 | { 399 | uint8_t Digit; 400 | 401 | /* first digit */ 402 | Digit = Value / 16; 403 | Display_HexDigit(Digit); 404 | 405 | /* second digit */ 406 | Digit = Value % 16; 407 | Display_HexDigit(Digit); 408 | } 409 | 410 | #endif 411 | 412 | 413 | 414 | #ifdef SW_IR_TRANSMITTER 415 | 416 | /* 417 | * display value as hexadecimal number 418 | * 419 | * requires: 420 | * - Value: value to display 421 | * - Bits: max. bit depth of value (1-16) 422 | */ 423 | 424 | void Display_HexValue(uint16_t Value, uint8_t Bits) 425 | { 426 | uint8_t Nibble[4]; /* nibbles */ 427 | uint8_t n; /* counter */ 428 | 429 | /* calculate number of nibbles/digits */ 430 | Bits += 3; /* for a partial nibble */ 431 | Bits /= 4; /* number of nibbles */ 432 | 433 | /* get nibbles (from LSB to MSB) */ 434 | n = 0; 435 | while (n < Bits) 436 | { 437 | Nibble[n] = Value & 0x000F; /* get LSB nibble */ 438 | Value >>= 4; /* shift one nibble */ 439 | n++; /* next nibble */ 440 | } 441 | 442 | /* output nibbles (from MSB to LSB) */ 443 | n = Bits; 444 | while (n > 0) 445 | { 446 | Display_HexDigit(Nibble[n - 1]); 447 | n--; /* next nibble */ 448 | } 449 | } 450 | 451 | #endif 452 | 453 | 454 | 455 | #if defined (SW_SQUAREWAVE) || defined (SW_PWM_PLUS) || defined (HW_FREQ_COUNTER_EXT) || defined (SW_SERVO) || defined (SW_DS18B20) 456 | 457 | /* 458 | * display unsigned value plus unit 459 | * - outputs all digits 460 | * 461 | * requires: 462 | * - Value: unsigned value 463 | * - DecPlaces: decimal places (0 = none) 464 | * - Unit: character for unit (0 = none) 465 | */ 466 | 467 | void Display_FullValue(uint32_t Value, uint8_t DecPlaces, unsigned char Unit) 468 | { 469 | uint8_t n; /* counter */ 470 | uint8_t Length; /* string length */ 471 | uint8_t Pos = 0; /* position of dot */ 472 | 473 | /* convert value into string */ 474 | ultoa(Value, OutBuffer, 10); /* radix 10: max. 10 chars + /0 */ 475 | Length = strlen(OutBuffer); /* get string length */ 476 | 477 | /* determine position of dot */ 478 | if (DecPlaces == 0) /* no dot requested */ 479 | { 480 | Pos = 100; /* disable dot */ 481 | } 482 | else if (Length >= DecPlaces) /* position within string */ 483 | { 484 | Pos = Length - DecPlaces; /* position of dot */ 485 | DecPlaces = 0; /* no additional zeros needed */ 486 | } 487 | else /* position outside string */ 488 | { 489 | DecPlaces = DecPlaces - Length; /* number of zeros after dot */ 490 | } 491 | 492 | /* leading zero (followed by dot) */ 493 | if (Pos == 0) Display_Char('0'); /* display: 0 */ 494 | 495 | /* display digits */ 496 | n = 0; 497 | while (n < Length) /* process string */ 498 | { 499 | if (n == Pos) /* at position of dot */ 500 | { 501 | #ifdef UI_COMMA 502 | Display_Char(','); /* display: , */ 503 | #else 504 | Display_Char('.'); /* display: . */ 505 | #endif 506 | while (DecPlaces > 0) /* fill in more zeros if needed */ 507 | { 508 | Display_Char('0'); /* display: 0 */ 509 | DecPlaces--; 510 | } 511 | } 512 | 513 | Display_Char(OutBuffer[n]); /* display digit */ 514 | n++; /* next digit */ 515 | } 516 | 517 | /* display unit */ 518 | if (Unit) Display_Char(Unit); 519 | } 520 | 521 | #endif 522 | 523 | 524 | 525 | #ifdef SW_DS18B20 526 | 527 | /* 528 | * display signed value plus unit 529 | * - outputs all digits 530 | * 531 | * requires: 532 | * - Value: signed value 533 | * - DecPlaces: decimal places (0 = none) 534 | * - Unit: character for unit (0 = none) 535 | */ 536 | 537 | void Display_SignedFullValue(int32_t Value, uint8_t DecPlaces, unsigned char Unit) 538 | { 539 | /* take care about sign */ 540 | if (Value < 0) /* negative value */ 541 | { 542 | Display_Char('-'); /* display: "-" */ 543 | Value = -Value; /* make value positive */ 544 | } 545 | 546 | /* and display unsigned value */ 547 | Display_FullValue((uint32_t)Value, DecPlaces, Unit); 548 | } 549 | 550 | #endif 551 | 552 | 553 | 554 | /* 555 | * display unsigned value plus unit 556 | * - scales value to max. 4 digits excluding "." and unit 557 | * 558 | * requires: 559 | * - unsigned value 560 | * - exponent of factor related to base unit (value * 10^x) 561 | * e.g: p = 10^-12 -> -12 562 | * - unit character (0 = none) 563 | */ 564 | 565 | void Display_Value(uint32_t Value, int8_t Exponent, unsigned char Unit) 566 | { 567 | unsigned char Prefix = 0; /* prefix character */ 568 | uint8_t Offset = 0; /* exponent offset to next 10^3 step */ 569 | uint8_t Index; /* index ID */ 570 | uint8_t Length; /* string length */ 571 | 572 | /* scale value down to 4 digits */ 573 | while (Value >= 10000) 574 | { 575 | Value += 5; /* for automagic rounding */ 576 | Value = Value / 10; /* scale down by 10^1 */ 577 | Exponent++; /* increase exponent by 1 */ 578 | } 579 | 580 | 581 | /* 582 | * determine prefix and offset (= number of digits right of dot) 583 | */ 584 | 585 | if (Exponent >= -12) /* prevent index underflow */ 586 | { 587 | Exponent += 12; /* shift exponent to be >= 0 */ 588 | Index = Exponent / 3; /* number of 10^3 steps */ 589 | Offset = Exponent % 3; /* offset to lower 10^3 step */ 590 | 591 | if (Offset > 0) /* dot required */ 592 | { 593 | Index++; /* upscale prefix */ 594 | Offset = 3 - Offset; /* reverse value (1 or 2) */ 595 | } 596 | 597 | /* look up prefix in table */ 598 | if (Index < NUM_PREFIXES) /* prevent array overflow */ 599 | { 600 | Prefix = eeprom_read_byte(&Prefix_table[Index]); 601 | } 602 | } 603 | 604 | 605 | /* 606 | * display value 607 | */ 608 | 609 | /* convert value into string */ 610 | utoa((uint16_t)Value, OutBuffer, 10); /* radix 10: max. 5 chars + /0 */ 611 | Length = strlen(OutBuffer); /* get string length */ 612 | 613 | /* we misuse Exponent for the dot position */ 614 | Exponent = Length - Offset; /* calculate position */ 615 | 616 | if (Exponent <= 0) /* we have to prepend "0." */ 617 | { 618 | /* 0: factor 10 / -1: factor 100 */ 619 | Display_Char('0'); /* display: 0 */ 620 | #ifdef UI_COMMA 621 | Display_Char(','); /* display: , */ 622 | #else 623 | Display_Char('.'); /* display: . */ 624 | #endif 625 | if (Exponent < 0) Display_Char('0'); /* extra 0 for factor 100 */ 626 | } 627 | 628 | if (Offset == 0) Exponent = -1; /* disable dot if not needed */ 629 | 630 | /* adjust position to match array or disable dot if set to 0 */ 631 | Exponent--; 632 | 633 | /* display value and add dot if requested */ 634 | Index = 0; 635 | while (Index < Length) /* loop through string */ 636 | { 637 | Display_Char(OutBuffer[Index]); /* display char/digit */ 638 | if (Index == Exponent) /* starting point of decimal fraction */ 639 | { 640 | #ifdef UI_COMMA 641 | Display_Char(','); /* display: , */ 642 | #else 643 | Display_Char('.'); /* display: . */ 644 | #endif 645 | } 646 | 647 | Index++; /* next one */ 648 | } 649 | 650 | /* display prefix and unit */ 651 | if (Prefix) Display_Char(Prefix); 652 | if (Unit) Display_Char(Unit); 653 | } 654 | 655 | 656 | 657 | /* 658 | * display signed value and unit 659 | * - max. 4 digits excluding sign, "." and unit 660 | * 661 | * requires: 662 | * - signed value 663 | * - exponent of factor related to base unit (value * 10^x) 664 | * e.g: p = 10^-12 -> -12 665 | * - unit character (0 = none) 666 | */ 667 | 668 | void Display_SignedValue(int32_t Value, int8_t Exponent, unsigned char Unit) 669 | { 670 | /* take care about sign */ 671 | if (Value < 0) /* negative value */ 672 | { 673 | Display_Char('-'); /* display: "-" */ 674 | Value = -Value; /* make value positive */ 675 | } 676 | 677 | /* and display unsigned value */ 678 | Display_Value((uint32_t)Value, Exponent, Unit); 679 | } 680 | 681 | 682 | 683 | /* ************************************************************************ 684 | * fancy display functions for LCD/OLED 685 | * ************************************************************************ */ 686 | 687 | 688 | #ifdef SW_SYMBOLS 689 | 690 | /* 691 | * external variables 692 | */ 693 | 694 | /* pin position lookup table from symbol_xy.h */ 695 | extern const uint8_t PinTable[]; 696 | 697 | 698 | 699 | /* 700 | * display fancy probe number 701 | * - display pin numbers left and right of symbol 702 | * 703 | * requires: 704 | * - Probe: probe number 705 | * - Index: pin index (0-2) 706 | */ 707 | 708 | void LCD_FancyProbeNumber(uint8_t Probe, uint8_t Index) 709 | { 710 | uint8_t *Table; /* pointer to pin table */ 711 | uint8_t Data; /* pinout data */ 712 | uint8_t x; /* x position */ 713 | uint8_t y; /* y position */ 714 | 715 | /* calculate start address of pinout details */ 716 | Table = (uint8_t *)&PinTable; /* start address of pin table */ 717 | x = Check.Symbol * 3; /* offset for symbol's pin details */ 718 | Table += x; /* start address of symbol's pin details */ 719 | Table += Index; /* address of specific pin's details */ 720 | 721 | Data = pgm_read_byte(Table); /* read pinout details */ 722 | 723 | if (Data != PIN_NONE) /* show pin */ 724 | { 725 | /* determine position based on pinout data */ 726 | /* set default position (top left) */ 727 | x = UI.SymbolPos_X - 1; /* left of symbol */ 728 | y = UI.SymbolPos_Y; /* top line of symbol */ 729 | if (Data & PIN_RIGHT) /* right */ 730 | { 731 | x += UI.SymbolSize_X + 1; /* right of symbol */ 732 | } 733 | if (Data & PIN_BOTTOM) /* bottom */ 734 | { 735 | y += UI.SymbolSize_Y - 1; /* bottom line of symbol */ 736 | } 737 | 738 | /* show probe number */ 739 | LCD_CharPos(x, y); /* set position */ 740 | Display_ProbeNumber(Probe); /* display probe number */ 741 | } 742 | } 743 | 744 | 745 | 746 | /* 747 | * show fancy pinout for semiconductors 748 | * - display a nice component symbol 749 | * standard case: aligned to right side 750 | * - display pin numbers left and right of symbol 751 | * - symbol ID (0-) in Check.Symbol 752 | * 753 | * requires: 754 | * - Line: starting line of symbol (top, 1-) 755 | */ 756 | 757 | void LCD_FancySemiPinout(uint8_t Line) 758 | { 759 | uint8_t Pos; /* position of symbol */ 760 | uint8_t MaxLine; /* maximum line number */ 761 | #ifdef LCD_COLOR 762 | uint16_t Color; /* pen color */ 763 | #endif 764 | 765 | Pos = UI.SymbolSize_Y; /* get symbol height */ 766 | MaxLine = UI.CharMax_Y; /* get screen heigth */ 767 | 768 | /* check for sufficient screen size */ 769 | if (MaxLine > Pos) /* sanity check for size */ 770 | { 771 | /* 772 | * check if we got enough lines left on the screen 773 | * - standard case: last line is reserved for cursor 774 | */ 775 | 776 | Pos += Line; /* line below symbol */ 777 | 778 | /* check for narrow displays */ 779 | if (UI.CharMax_X < 16) /* less than 16 chars per line */ 780 | { 781 | Pos = MaxLine; /* trigger output on new screen */ 782 | } 783 | 784 | if (Pos >= MaxLine) /* doesn't fit on current screen */ 785 | { 786 | /* output on a new screen */ 787 | UI.CharPos_Y = MaxLine; /* simulate last line */ 788 | Display_NextLine(); /* trigger test key & clear screen */ 789 | Line = 2; /* simply line #2 */ 790 | Pos = 3; /* align to left side with tiny offset */ 791 | } 792 | else /* fit's on current screen */ 793 | { 794 | /* default x position */ 795 | Pos = UI.CharMax_X - UI.SymbolSize_X; /* align to right side */ 796 | } 797 | 798 | /* 799 | * display symbol with pinout 800 | */ 801 | 802 | /* determine start position (top left of symbol) */ 803 | UI.SymbolPos_X = Pos; /* x position */ 804 | UI.SymbolPos_Y = Line; /* y position */ 805 | 806 | /* display probe numbers */ 807 | LCD_FancyProbeNumber(Semi.A, 0); /* A pin */ 808 | LCD_FancyProbeNumber(Semi.B, 1); /* B pin */ 809 | LCD_FancyProbeNumber(Semi.C, 2); /* C pin */ 810 | 811 | /* display symbol */ 812 | #ifdef LCD_COLOR 813 | Color = UI.PenColor; /* save color */ 814 | UI.PenColor = COLOR_SYMBOL; /* set pen color */ 815 | #endif 816 | 817 | LCD_CharPos(UI.SymbolPos_X, UI.SymbolPos_Y); /* set position */ 818 | LCD_Symbol(Check.Symbol); /* display symbol */ 819 | 820 | #ifdef LCD_COLOR 821 | UI.PenColor = Color; /* restore pen color */ 822 | #endif 823 | 824 | /* hint: we don't restore the old char position */ 825 | } 826 | } 827 | 828 | #endif 829 | 830 | 831 | 832 | /* ************************************************************************ 833 | * clean-up of local constants 834 | * ************************************************************************ */ 835 | 836 | /* source management */ 837 | #undef DISPLAY_C 838 | 839 | 840 | 841 | /* ************************************************************************ 842 | * EOF 843 | * ************************************************************************ */ 844 | -------------------------------------------------------------------------------- /firmware 1.34/functions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/functions.h -------------------------------------------------------------------------------- /firmware 1.34/inductor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/inductor.c -------------------------------------------------------------------------------- /firmware 1.34/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/main.c -------------------------------------------------------------------------------- /firmware 1.34/pause.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/pause.c -------------------------------------------------------------------------------- /firmware 1.34/probes.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/probes.c -------------------------------------------------------------------------------- /firmware 1.34/resistor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/resistor.c -------------------------------------------------------------------------------- /firmware 1.34/semi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/semi.c -------------------------------------------------------------------------------- /firmware 1.34/serial.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/serial.c -------------------------------------------------------------------------------- /firmware 1.34/tools.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/tools.c -------------------------------------------------------------------------------- /firmware 1.34/user.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/user.c -------------------------------------------------------------------------------- /firmware 1.34/var_czech.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_czech.h -------------------------------------------------------------------------------- /firmware 1.34/var_danish.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_danish.h -------------------------------------------------------------------------------- /firmware 1.34/var_english.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_english.h -------------------------------------------------------------------------------- /firmware 1.34/var_german.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_german.h -------------------------------------------------------------------------------- /firmware 1.34/var_italian.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_italian.h -------------------------------------------------------------------------------- /firmware 1.34/var_polish.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_polish.h -------------------------------------------------------------------------------- /firmware 1.34/var_russian.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_russian.h -------------------------------------------------------------------------------- /firmware 1.34/var_russian_2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_russian_2.h -------------------------------------------------------------------------------- /firmware 1.34/var_spanish.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/var_spanish.h -------------------------------------------------------------------------------- /firmware 1.34/variables.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/variables.h -------------------------------------------------------------------------------- /firmware 1.34/wait.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/firmware 1.34/wait.S -------------------------------------------------------------------------------- /schematics/display.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/schematics/display.png -------------------------------------------------------------------------------- /schematics/sch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robsoncouto/gm328a_rev_eng/9b950f8beffdf87611bea410eeb2021dd35d39cf/schematics/sch2.png -------------------------------------------------------------------------------- /tetris/game.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define C_BLACK ST77XX_BLACK 4 | #define C_WHITE ST77XX_WHITE 5 | #define C_RED ST77XX_RED 6 | #define C_GREEN ST77XX_GREEN 7 | #define C_BLUE ST77XX_BLUE 8 | #define C_CYAN ST77XX_CYAN 9 | #define C_MAGENTA ST77XX_MAGENTA 10 | #define C_YELLOW ST77XX_YELLOW 11 | #define C_ORANGE ST77XX_ORANGE 12 | 13 | #define S_RIGHT 1 14 | #define S_LEFT -1 15 | #define S_DOWN 10 16 | 17 | 18 | #define X0 20 19 | #define X1 X0+60 20 | #define Y0 4 21 | #define Y1 Y0+120 22 | #define BLOCK_SIZE 6 23 | 24 | #define SCORE_X0 90 25 | #define SCORE_Y0 2 26 | 27 | 28 | int getEncoderPos(void); 29 | void enableEncoder(void); 30 | void disableEncoder(void); 31 | 32 | 33 | class Tetromino { 34 | unsigned char active,type,frame_counter,dropped; 35 | unsigned char block[4]; 36 | unsigned int color; 37 | public: 38 | // No constructor, I can't kill the objects anyways, 39 | // and there is only one tretromino active so I may just as well reset it 40 | void update(void); 41 | void move(int side); 42 | char canMove(int side); 43 | void rotate(void); 44 | void reset(); 45 | }; 46 | 47 | void gameInit(void); 48 | void gameTick(void); 49 | void drawBuffer(void); 50 | void waitInterrupt(void); 51 | unsigned char buttonWasPressed(void); 52 | 53 | void checkBuffer(void); 54 | void drawWholeBuffer(void); 55 | 56 | void updateScore(int, int); 57 | void updateSpeed(void); 58 | 59 | void showNewGameScreen(void); 60 | void drawNewPiece(void); 61 | -------------------------------------------------------------------------------- /tetris/queue.cpp: -------------------------------------------------------------------------------- 1 | #include "queue.h" 2 | #define Q_MAX 20 3 | 4 | // Source https://www.tutorialspoint.com/data_structures_algorithms/queue_program_in_c.htm 5 | 6 | int Array[Q_MAX]; 7 | int front = 0; 8 | int rear = -1; 9 | int itemCount = 0; 10 | 11 | int queuePeek(void) { 12 | return Array[front]; 13 | } 14 | 15 | unsigned char queueIsEmpty(void) { 16 | if(itemCount == 0){ 17 | return 1; 18 | }else{ 19 | return 0; 20 | } 21 | } 22 | 23 | unsigned char queueIsFull(void) { 24 | if(itemCount == Q_MAX){ 25 | return 1; 26 | }else{ 27 | return 0; 28 | } 29 | } 30 | 31 | int queueSize(void) { 32 | return itemCount; 33 | } 34 | 35 | void queueInsert(int data) { 36 | if(!queueIsFull()) { 37 | 38 | if(rear == Q_MAX-1) { 39 | rear = -1; 40 | } 41 | 42 | Array[++rear] = data; 43 | itemCount++; 44 | } 45 | } 46 | 47 | int queueRemoveData() { 48 | int data = Array[front++]; 49 | 50 | if(front == Q_MAX) { 51 | front = 0; 52 | } 53 | 54 | itemCount--; 55 | return data; 56 | } 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /tetris/queue.h: -------------------------------------------------------------------------------- 1 | int queuePeek(void); 2 | unsigned char queueIsEmpty(void); 3 | unsigned char queueIsFull(void); 4 | int queueSize(void); 5 | void queueInsert(int data); 6 | int queueRemoveData(void); 7 | -------------------------------------------------------------------------------- /tetris/sound.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Tetris theme - (Korobeiniki) 3 | More songs available at https://github.com/robsoncouto/arduino-songs 4 | 5 | Robson Couto, 2019 6 | */ 7 | #include "sound.h" 8 | #include 9 | 10 | // change this to make the song slower or faster 11 | int tempo = 144; 12 | 13 | // change this to whichever pin you want to use 14 | int buzzer = A1; 15 | 16 | // notes of the moledy followed by the duration. 17 | // a 4 means a quarter note, 8 an eighteenth , 16 sixteenth, so on 18 | // !!negative numbers are used to represent dotted notes, 19 | // so -4 means a dotted quarter note, that is, a quarter plus an eighteenth!! 20 | int melody[] = { 21 | 22 | //Based on the arrangement at https://www.flutetunes.com/tunes.php?id=192 23 | 24 | NOTE_E5, 4, NOTE_B4,8, NOTE_C5,8, NOTE_D5,4, NOTE_C5,8, NOTE_B4,8, 25 | NOTE_A4, 4, NOTE_A4,8, NOTE_C5,8, NOTE_E5,4, NOTE_D5,8, NOTE_C5,8, 26 | NOTE_B4, -4, NOTE_C5,8, NOTE_D5,4, NOTE_E5,4, 27 | NOTE_C5, 4, NOTE_A4,4, NOTE_A4,8, NOTE_A4,4, NOTE_B4,8, NOTE_C5,8, 28 | 29 | NOTE_D5, -4, NOTE_F5,8, NOTE_A5,4, NOTE_G5,8, NOTE_F5,8, 30 | NOTE_E5, -4, NOTE_C5,8, NOTE_E5,4, NOTE_D5,8, NOTE_C5,8, 31 | NOTE_B4, 4, NOTE_B4,8, NOTE_C5,8, NOTE_D5,4, NOTE_E5,4, 32 | NOTE_C5, 4, NOTE_A4,4, NOTE_A4,4, REST, 4, 33 | 34 | NOTE_E5, 4, NOTE_B4,8, NOTE_C5,8, NOTE_D5,4, NOTE_C5,8, NOTE_B4,8, 35 | NOTE_A4, 4, NOTE_A4,8, NOTE_C5,8, NOTE_E5,4, NOTE_D5,8, NOTE_C5,8, 36 | NOTE_B4, -4, NOTE_C5,8, NOTE_D5,4, NOTE_E5,4, 37 | NOTE_C5, 4, NOTE_A4,4, NOTE_A4,8, NOTE_A4,4, NOTE_B4,8, NOTE_C5,8, 38 | 39 | NOTE_D5, -4, NOTE_F5,8, NOTE_A5,4, NOTE_G5,8, NOTE_F5,8, 40 | NOTE_E5, -4, NOTE_C5,8, NOTE_E5,4, NOTE_D5,8, NOTE_C5,8, 41 | NOTE_B4, 4, NOTE_B4,8, NOTE_C5,8, NOTE_D5,4, NOTE_E5,4, 42 | NOTE_C5, 4, NOTE_A4,4, NOTE_A4,4, REST, 4, 43 | 44 | 45 | NOTE_E5,2, NOTE_C5,2, 46 | NOTE_D5,2, NOTE_B4,2, 47 | NOTE_C5,2, NOTE_A4,2, 48 | NOTE_GS4,2, NOTE_B4,4, REST,8, 49 | NOTE_E5,2, NOTE_C5,2, 50 | NOTE_D5,2, NOTE_B4,2, 51 | NOTE_C5,4, NOTE_E5,4, NOTE_A5,2, 52 | NOTE_GS5,2 53 | 54 | }; 55 | 56 | // sizeof gives the number of bytes, each int value is composed of two bytes (16 bits) 57 | // there are two values per note (pitch and duration), so for each note there are four bytes 58 | int notes = sizeof(melody) / sizeof(melody[0]) / 2; 59 | 60 | // this calculates the duration of a whole note in ms (60s/tempo)*4 beats 61 | int wholenote = (60000 * 4) / tempo; 62 | 63 | int divider = 0, noteDuration = 0; 64 | bool active=false; 65 | unsigned int index = 0; 66 | unsigned long next=0; 67 | 68 | void soundPlay(void){ 69 | active=true; 70 | } 71 | void soundPause(void){ 72 | active=false; 73 | } 74 | 75 | void soundTick(void) { 76 | if(active==false)return; 77 | if (millis() > next) { 78 | if (index < notes * 2) { 79 | // stop the waveform generation before the next note. 80 | noTone(buzzer); 81 | 82 | // calculates the duration of the note 83 | divider = melody[index + 1]; 84 | 85 | if (divider > 0) { 86 | // regular note, just proceed 87 | noteDuration = (wholenote) / divider; 88 | } else if (divider < 0) { 89 | // dotted notes are represented with negative durations!! 90 | noteDuration = (wholenote) / abs(divider); 91 | noteDuration *= 1.5; // increases the duration in half for dotted notes 92 | } 93 | next = millis() + noteDuration; 94 | 95 | // we only play the note for 90% of the duration, leaving 10% as a pause 96 | tone(buzzer, melody[index], noteDuration * 0.9); 97 | index += 2; 98 | } else { 99 | index = 0; 100 | next = millis(); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /tetris/sound.h: -------------------------------------------------------------------------------- 1 | 2 | #define NOTE_B0 31 3 | #define NOTE_C1 33 4 | #define NOTE_CS1 35 5 | #define NOTE_D1 37 6 | #define NOTE_DS1 39 7 | #define NOTE_E1 41 8 | #define NOTE_F1 44 9 | #define NOTE_FS1 46 10 | #define NOTE_G1 49 11 | #define NOTE_GS1 52 12 | #define NOTE_A1 55 13 | #define NOTE_AS1 58 14 | #define NOTE_B1 62 15 | #define NOTE_C2 65 16 | #define NOTE_CS2 69 17 | #define NOTE_D2 73 18 | #define NOTE_DS2 78 19 | #define NOTE_E2 82 20 | #define NOTE_F2 87 21 | #define NOTE_FS2 93 22 | #define NOTE_G2 98 23 | #define NOTE_GS2 104 24 | #define NOTE_A2 110 25 | #define NOTE_AS2 117 26 | #define NOTE_B2 123 27 | #define NOTE_C3 131 28 | #define NOTE_CS3 139 29 | #define NOTE_D3 147 30 | #define NOTE_DS3 156 31 | #define NOTE_E3 165 32 | #define NOTE_F3 175 33 | #define NOTE_FS3 185 34 | #define NOTE_G3 196 35 | #define NOTE_GS3 208 36 | #define NOTE_A3 220 37 | #define NOTE_AS3 233 38 | #define NOTE_B3 247 39 | #define NOTE_C4 262 40 | #define NOTE_CS4 277 41 | #define NOTE_D4 294 42 | #define NOTE_DS4 311 43 | #define NOTE_E4 330 44 | #define NOTE_F4 349 45 | #define NOTE_FS4 370 46 | #define NOTE_G4 392 47 | #define NOTE_GS4 415 48 | #define NOTE_A4 440 49 | #define NOTE_AS4 466 50 | #define NOTE_B4 494 51 | #define NOTE_C5 523 52 | #define NOTE_CS5 554 53 | #define NOTE_D5 587 54 | #define NOTE_DS5 622 55 | #define NOTE_E5 659 56 | #define NOTE_F5 698 57 | #define NOTE_FS5 740 58 | #define NOTE_G5 784 59 | #define NOTE_GS5 831 60 | #define NOTE_A5 880 61 | #define NOTE_AS5 932 62 | #define NOTE_B5 988 63 | #define NOTE_C6 1047 64 | #define NOTE_CS6 1109 65 | #define NOTE_D6 1175 66 | #define NOTE_DS6 1245 67 | #define NOTE_E6 1319 68 | #define NOTE_F6 1397 69 | #define NOTE_FS6 1480 70 | #define NOTE_G6 1568 71 | #define NOTE_GS6 1661 72 | #define NOTE_A6 1760 73 | #define NOTE_AS6 1865 74 | #define NOTE_B6 1976 75 | #define NOTE_C7 2093 76 | #define NOTE_CS7 2217 77 | #define NOTE_D7 2349 78 | #define NOTE_DS7 2489 79 | #define NOTE_E7 2637 80 | #define NOTE_F7 2794 81 | #define NOTE_FS7 2960 82 | #define NOTE_G7 3136 83 | #define NOTE_GS7 3322 84 | #define NOTE_A7 3520 85 | #define NOTE_AS7 3729 86 | #define NOTE_B7 3951 87 | #define NOTE_C8 4186 88 | #define NOTE_CS8 4435 89 | #define NOTE_D8 4699 90 | #define NOTE_DS8 4978 91 | #define REST 0 92 | 93 | void soundTick(void); 94 | void soundPlay(void); 95 | void soundPause(void); 96 | -------------------------------------------------------------------------------- /tetris/tetris.ino: -------------------------------------------------------------------------------- 1 | #include "game.h" 2 | #include "sound.h" 3 | 4 | void setup(void) { 5 | gameInit(); 6 | } 7 | 8 | void loop() { 9 | gameTick(); 10 | drawBuffer(); 11 | waitInterrupt(); 12 | } 13 | --------------------------------------------------------------------------------