diff --git a/CREDITS.txt b/CREDITS.txt index 202b88a8a..04fc2c1c0 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -17,3 +17,4 @@ Karl Szmutny Michal Hlavinka Pat Mackenzie Michael Byrne +Christophe Brision (Ingwie) diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index c45407355..6c9bb27f4 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -1160,6 +1160,7 @@ void addOpenTxLcdOptions(OpenTxFirmware * firmware) { "ST7565R", QObject::tr("ST7565R LCD or compatible") }, { "ERC12864FSF", QObject::tr("ERC12864FSF LCD") }, { "ST7920", QObject::tr("ST7920 LCD") }, + { "KS108", QObject::tr("KS108 LCD") }, { NULL } }; firmware->addOptions(lcd_options); @@ -1433,7 +1434,7 @@ void registerOpenTxFirmwares() firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("sdcard", QObject::tr("Support for SD memory card")); firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker")); -//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); + firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode")); firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode")); firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); diff --git a/doc/Mega2560/MEGA2560.sch b/doc/Mega2560/MEGA2560.sch index 1f54b3989..8d8b5f710 100644 --- a/doc/Mega2560/MEGA2560.sch +++ b/doc/Mega2560/MEGA2560.sch @@ -36,9 +36,9 @@ $Descr A4 11693 8268 encoding utf-8 Sheet 1 1 Title "OpenTX board based on Arduino MEGA2560" -Date "21 oct 2015" +Date "27 feb 2016" Rev "0" -Comp "Copyright 2015 F. Aguerre" +Comp "Copyright F. Aguerre" Comment1 "" Comment2 "" Comment3 "" @@ -106,12 +106,12 @@ $EndComp $Comp L GND #PWR? U 1 1 549993C2 -P 2650 2650 -F 0 "#PWR?" H 2650 2650 30 0001 C CNN -F 1 "GND" H 2650 2580 30 0001 C CNN -F 2 "" H 2650 2650 60 0001 C CNN -F 3 "" H 2650 2650 60 0001 C CNN - 1 2650 2650 +P 2500 2600 +F 0 "#PWR?" H 2500 2600 30 0001 C CNN +F 1 "GND" H 2500 2530 30 0001 C CNN +F 2 "" H 2500 2600 60 0001 C CNN +F 3 "" H 2500 2600 60 0001 C CNN + 1 2500 2600 1 0 0 -1 $EndComp $Comp @@ -342,54 +342,54 @@ F 3 "" H 9100 4650 60 0001 C CNN 1 9100 4650 1 0 0 -1 $EndComp -Text Label 5750 3700 2 42 ~ 0 +Text Label 5850 3700 2 42 ~ 0 U_batt $Comp L R R3 U 1 1 54994034 -P 5350 3950 -F 0 "R3" V 5430 3950 50 0000 C CNN -F 1 "2.7K" V 5350 3950 50 0000 C CNN -F 2 "" H 5350 3950 60 0001 C CNN -F 3 "" H 5350 3950 60 0001 C CNN - 1 5350 3950 +P 5450 3950 +F 0 "R3" V 5530 3950 50 0000 C CNN +F 1 "2.7K" V 5450 3950 50 0000 C CNN +F 2 "" H 5450 3950 60 0001 C CNN +F 3 "" H 5450 3950 60 0001 C CNN + 1 5450 3950 -1 0 0 -1 $EndComp $Comp L R R4 U 1 1 54994033 -P 5100 3700 -F 0 "R4" V 5180 3700 50 0000 C CNN -F 1 "5.1K" V 5100 3700 50 0000 C CNN -F 2 "" H 5100 3700 60 0001 C CNN -F 3 "" H 5100 3700 60 0001 C CNN - 1 5100 3700 +P 5200 3700 +F 0 "R4" V 5280 3700 50 0000 C CNN +F 1 "5.1K" V 5200 3700 50 0000 C CNN +F 2 "" H 5200 3700 60 0001 C CNN +F 3 "" H 5200 3700 60 0001 C CNN + 1 5200 3700 0 1 -1 0 $EndComp $Comp L GND #PWR? U 1 1 54994032 -P 5350 4300 -F 0 "#PWR?" H 5350 4300 30 0001 C CNN -F 1 "GND" H 5350 4230 30 0001 C CNN -F 2 "" H 5350 4300 60 0001 C CNN -F 3 "" H 5350 4300 60 0001 C CNN - 1 5350 4300 +P 5450 4300 +F 0 "#PWR?" H 5450 4300 30 0001 C CNN +F 1 "GND" H 5450 4230 30 0001 C CNN +F 2 "" H 5450 4300 60 0001 C CNN +F 3 "" H 5450 4300 60 0001 C CNN + 1 5450 4300 1 0 0 -1 $EndComp -Text Notes 4700 3350 0 60 ~ 0 +Text Notes 4800 3350 0 60 ~ 0 Battery voltage reading Text Notes 7100 1900 0 60 ~ 0 Rotary encoders (x2) $Comp L R R1 U 1 1 54993DF7 -P 2900 1700 -F 0 "R1" V 2980 1700 50 0000 C CNN -F 1 "200" V 2900 1700 50 0000 C CNN -F 2 "" H 2900 1700 60 0001 C CNN -F 3 "" H 2900 1700 60 0001 C CNN - 1 2900 1700 +P 2750 1650 +F 0 "R1" V 2830 1650 50 0000 C CNN +F 1 "200" V 2750 1650 50 0000 C CNN +F 2 "" H 2750 1650 60 0001 C CNN +F 3 "" H 2750 1650 60 0001 C CNN + 1 2750 1650 0 1 -1 0 $EndComp $Comp @@ -430,91 +430,91 @@ Aurora 9X sticks amplification (x4) $Comp L VCC #PWR? U 1 1 54993A96 -P 5200 1000 -F 0 "#PWR?" H 5200 1100 50 0001 C CNN -F 1 "VCC" H 5200 1100 50 0000 C CNN -F 2 "" H 5200 1000 60 0001 C CNN -F 3 "" H 5200 1000 60 0001 C CNN - 1 5200 1000 +P 5450 950 +F 0 "#PWR?" H 5450 1050 50 0001 C CNN +F 1 "VCC" H 5450 1050 50 0000 C CNN +F 2 "" H 5450 950 60 0001 C CNN +F 3 "" H 5450 950 60 0001 C CNN + 1 5450 950 1 0 0 -1 $EndComp $Comp L R R2 U 1 1 54993A62 -P 5200 2200 -F 0 "R2" V 5280 2200 50 0000 C CNN -F 1 "2.2K" V 5200 2200 50 0000 C CNN -F 2 "" H 5200 2200 60 0001 C CNN -F 3 "" H 5200 2200 60 0001 C CNN - 1 5200 2200 +P 5450 2150 +F 0 "R2" V 5530 2150 50 0000 C CNN +F 1 "2.2K" V 5450 2150 50 0000 C CNN +F 2 "" H 5450 2150 60 0001 C CNN +F 3 "" H 5450 2150 60 0001 C CNN + 1 5450 2150 0 1 -1 0 $EndComp -Text Label 6200 1450 2 42 ~ 0 +Text Label 6450 1400 2 42 ~ 0 Stick_xx $Comp L GND #PWR? U 1 1 54993A41 -P 5200 1950 -F 0 "#PWR?" H 5200 1950 30 0001 C CNN -F 1 "GND" H 5200 1880 30 0001 C CNN -F 2 "" H 5200 1950 60 0001 C CNN -F 3 "" H 5200 1950 60 0001 C CNN - 1 5200 1950 +P 5450 1900 +F 0 "#PWR?" H 5450 1900 30 0001 C CNN +F 1 "GND" H 5450 1830 30 0001 C CNN +F 2 "" H 5450 1900 60 0001 C CNN +F 3 "" H 5450 1900 60 0001 C CNN + 1 5450 1900 1 0 0 -1 $EndComp $Comp L GND #PWR? U 1 1 54993A21 -P 4550 2800 -F 0 "#PWR?" H 4550 2800 30 0001 C CNN -F 1 "GND" H 4550 2730 30 0001 C CNN -F 2 "" H 4550 2800 60 0001 C CNN -F 3 "" H 4550 2800 60 0001 C CNN - 1 4550 2800 +P 4800 2750 +F 0 "#PWR?" H 4800 2750 30 0001 C CNN +F 1 "GND" H 4800 2680 30 0001 C CNN +F 2 "" H 4800 2750 60 0001 C CNN +F 3 "" H 4800 2750 60 0001 C CNN + 1 4800 2750 1 0 0 -1 $EndComp $Comp L VCC 1 U 1 1 54993A07 -P 4550 1650 -F 0 "1" H 4550 1750 30 0001 C CNN -F 1 "VCC" H 4550 1750 50 0000 C CNN -F 2 "" H 4550 1650 60 0001 C CNN -F 3 "" H 4550 1650 60 0001 C CNN - 1 4550 1650 +P 4800 1600 +F 0 "1" H 4800 1700 30 0001 C CNN +F 1 "VCC" H 4800 1700 50 0000 C CNN +F 2 "" H 4800 1600 60 0001 C CNN +F 3 "" H 4800 1600 60 0001 C CNN + 1 4800 1600 1 0 0 -1 $EndComp $Comp L R R6 U 1 1 549939EC -P 4550 2450 -F 0 "R6" V 4630 2450 50 0000 C CNN -F 1 "10K" V 4550 2450 50 0000 C CNN -F 2 "" H 4550 2450 60 0001 C CNN -F 3 "" H 4550 2450 60 0001 C CNN - 1 4550 2450 +P 4800 2400 +F 0 "R6" V 4880 2400 50 0000 C CNN +F 1 "10K" V 4800 2400 50 0000 C CNN +F 2 "" H 4800 2400 60 0001 C CNN +F 3 "" H 4800 2400 60 0001 C CNN + 1 4800 2400 -1 0 0 -1 $EndComp $Comp L R R6 U 1 1 549939E6 -P 4550 1950 -F 0 "R6" V 4630 1950 50 0000 C CNN -F 1 "10K" V 4550 1950 50 0000 C CNN -F 2 "" H 4550 1950 60 0001 C CNN -F 3 "" H 4550 1950 60 0001 C CNN - 1 4550 1950 +P 4800 1900 +F 0 "R6" V 4880 1900 50 0000 C CNN +F 1 "10K" V 4800 1900 50 0000 C CNN +F 2 "" H 4800 1900 60 0001 C CNN +F 3 "" H 4800 1900 60 0001 C CNN + 1 4800 1900 -1 0 0 -1 $EndComp $Comp -L LM2903 U3 +L LM2903 U2 U 1 1 54993860 -P 5300 1450 -F 0 "U3" H 5450 1600 60 0000 C CNN -F 1 "MCP6004" H 5500 1250 50 0000 C CNN -F 2 "" H 5300 1450 60 0001 C CNN -F 3 "" H 5300 1450 60 0001 C CNN - 1 5300 1450 +P 5550 1400 +F 0 "U2" H 5700 1550 60 0000 C CNN +F 1 "MCP6004" H 5750 1200 50 0000 C CNN +F 2 "" H 5550 1400 60 0001 C CNN +F 3 "" H 5550 1400 60 0001 C CNN + 1 5550 1400 1 0 0 -1 $EndComp Text Label 9050 2900 2 42 ~ 0 @@ -526,15 +526,15 @@ Rot_x_A $Comp L DIODESCH D1 U 1 1 5499378E -P 2750 950 -F 0 "D1" H 2750 1050 40 0000 C CNN -F 1 "MBR0520" H 2750 850 40 0000 C CNN -F 2 "" H 2750 950 60 0001 C CNN -F 3 "" H 2750 950 60 0001 C CNN - 1 2750 950 +P 2600 900 +F 0 "D1" H 2600 1000 40 0000 C CNN +F 1 "MBR0520" H 2600 800 40 0000 C CNN +F 2 "" H 2600 900 60 0001 C CNN +F 3 "" H 2600 900 60 0001 C CNN + 1 2600 900 1 0 0 -1 $EndComp -Text Notes 1750 750 0 60 ~ 0 +Text Notes 1600 750 0 60 ~ 0 PPM management Text Notes 9650 1900 0 60 ~ 0 LCD backlight (3.3V) @@ -604,12 +604,12 @@ F 3 "" H 10750 2600 60 0001 C CNN 1 10750 2600 0 1 1 0 $EndComp -Text Notes 9500 750 0 60 ~ 0 -LCD 3.3V input (x13) +Text Notes 9250 750 0 60 ~ 0 +3.3V device (LCD, Somo14/WTV20, ...) Text Notes 6850 750 0 60 ~ 0 Switches, trims & keybs deboucing (x22) Text GLabel 10450 1000 2 42 Output ~ 0 -LCD_xxxx +DEVICE_xxxx $Comp L R R4 U 1 1 54992F2F @@ -751,128 +751,128 @@ $EndComp $Comp L 4066 U1 U 1 1 549891BA -P 1750 2550 -F 0 "U1" H 1950 2401 40 0000 C CNN -F 1 "4066" H 1950 2700 40 0000 C CNN -F 2 "" H 1750 2550 60 0001 C CNN -F 3 "" H 1750 2550 60 0001 C CNN - 1 1750 2550 +P 1600 2500 +F 0 "U1" H 1800 2351 40 0000 C CNN +F 1 "4066" H 1800 2650 40 0000 C CNN +F 2 "" H 1600 2500 60 0001 C CNN +F 3 "" H 1600 2500 60 0001 C CNN + 1 1600 2500 1 0 0 -1 $EndComp $Comp L VCC 1 U 1 1 549891B9 -P 1750 2300 -F 0 "1" H 1750 2400 30 0001 C CNN -F 1 "VCC" H 1750 2400 50 0000 C CNN -F 2 "" H 1750 2300 60 0001 C CNN -F 3 "" H 1750 2300 60 0001 C CNN - 1 1750 2300 +P 1600 2250 +F 0 "1" H 1600 2350 30 0001 C CNN +F 1 "VCC" H 1600 2350 50 0000 C CNN +F 2 "" H 1600 2250 60 0001 C CNN +F 3 "" H 1600 2250 60 0001 C CNN + 1 1600 2250 1 0 0 -1 $EndComp $Comp L GND #PWR? U 1 1 549891B8 -P 1750 2800 -F 0 "#PWR?" H 1750 2800 30 0001 C CNN -F 1 "GND" H 1750 2730 30 0001 C CNN -F 2 "" H 1750 2800 60 0001 C CNN -F 3 "" H 1750 2800 60 0001 C CNN - 1 1750 2800 +P 1600 2750 +F 0 "#PWR?" H 1600 2750 30 0001 C CNN +F 1 "GND" H 1600 2680 30 0001 C CNN +F 2 "" H 1600 2750 60 0001 C CNN +F 3 "" H 1600 2750 60 0001 C CNN + 1 1600 2750 1 0 0 -1 $EndComp $Comp L 4066 U1 U 2 1 549891B7 -P 2200 1300 -F 0 "U1" H 2400 1151 40 0000 C CNN -F 1 "4066" H 2400 1450 40 0000 C CNN -F 2 "" H 2200 1300 60 0001 C CNN -F 3 "" H 2200 1300 60 0001 C CNN - 2 2200 1300 +P 2050 1250 +F 0 "U1" H 2250 1101 40 0000 C CNN +F 1 "4066" H 2250 1400 40 0000 C CNN +F 2 "" H 2050 1250 60 0001 C CNN +F 3 "" H 2050 1250 60 0001 C CNN + 2 2050 1250 1 0 0 -1 $EndComp $Comp L 4066 U1 U 4 1 549891B6 -P 1600 1700 -F 0 "U1" H 1800 1551 40 0000 C CNN -F 1 "4066" H 1800 1850 40 0000 C CNN -F 2 "" H 1600 1700 60 0001 C CNN -F 3 "" H 1600 1700 60 0001 C CNN - 4 1600 1700 +P 1450 1650 +F 0 "U1" H 1650 1501 40 0000 C CNN +F 1 "4066" H 1650 1800 40 0000 C CNN +F 2 "" H 1450 1650 60 0001 C CNN +F 3 "" H 1450 1650 60 0001 C CNN + 4 1450 1650 1 0 0 -1 $EndComp $Comp L 4066 U1 U 3 1 549891B5 -P 2350 2100 -F 0 "U1" H 2550 1951 40 0000 C CNN -F 1 "4066" H 2550 2250 40 0000 C CNN -F 2 "" H 2350 2100 60 0001 C CNN -F 3 "" H 2350 2100 60 0001 C CNN - 3 2350 2100 +P 2200 2050 +F 0 "U1" H 2400 1901 40 0000 C CNN +F 1 "4066" H 2400 2200 40 0000 C CNN +F 2 "" H 2200 2050 60 0001 C CNN +F 3 "" H 2200 2050 60 0001 C CNN + 3 2200 2050 1 0 0 -1 $EndComp $Comp L R R6 U 1 1 549891B4 -P 2150 1700 -F 0 "R6" V 2230 1700 50 0000 C CNN -F 1 "10K" V 2150 1700 50 0000 C CNN -F 2 "" H 2150 1700 60 0001 C CNN -F 3 "" H 2150 1700 60 0001 C CNN - 1 2150 1700 +P 2000 1650 +F 0 "R6" V 2080 1650 50 0000 C CNN +F 1 "10K" V 2000 1650 50 0000 C CNN +F 2 "" H 2000 1650 60 0001 C CNN +F 3 "" H 2000 1650 60 0001 C CNN + 1 2000 1650 0 1 -1 0 $EndComp $Comp L VCC 1 U 1 1 549891B3 -P 2500 1650 -F 0 "1" H 2500 1750 30 0001 C CNN -F 1 "VCC" H 2500 1750 50 0000 C CNN -F 2 "" H 2500 1650 60 0001 C CNN -F 3 "" H 2500 1650 60 0001 C CNN - 1 2500 1650 +P 2350 1600 +F 0 "1" H 2350 1700 30 0001 C CNN +F 1 "VCC" H 2350 1700 50 0000 C CNN +F 2 "" H 2350 1600 60 0001 C CNN +F 3 "" H 2350 1600 60 0001 C CNN + 1 2350 1600 1 0 0 -1 $EndComp -Text Label 750 2700 0 42 ~ 0 +Text Label 600 2650 0 42 ~ 0 Sim_Control $Comp L VCC 1 U 1 1 549891AD -P 1400 2300 -F 0 "1" H 1400 2400 30 0001 C CNN -F 1 "VCC" H 1400 2400 50 0000 C CNN -F 2 "" H 1400 2300 60 0001 C CNN -F 3 "" H 1400 2300 60 0001 C CNN - 1 1400 2300 +P 1250 2250 +F 0 "1" H 1250 2350 30 0001 C CNN +F 1 "VCC" H 1250 2350 50 0000 C CNN +F 2 "" H 1250 2250 60 0001 C CNN +F 3 "" H 1250 2250 60 0001 C CNN + 1 1250 2250 1 0 0 -1 $EndComp $Comp L R R6 U 1 1 549891AC -P 2300 2550 -F 0 "R6" V 2380 2550 50 0000 C CNN -F 1 "10K" V 2300 2550 50 0000 C CNN -F 2 "" H 2300 2550 60 0001 C CNN -F 3 "" H 2300 2550 60 0001 C CNN - 1 2300 2550 +P 2150 2500 +F 0 "R6" V 2230 2500 50 0000 C CNN +F 1 "10K" V 2150 2500 50 0000 C CNN +F 2 "" H 2150 2500 60 0001 C CNN +F 3 "" H 2150 2500 60 0001 C CNN + 1 2150 2500 0 -1 -1 0 $EndComp -Text Label 750 2100 0 42 ~ 0 +Text Label 600 2050 0 42 ~ 0 PPM_IN -Text Label 750 1300 0 42 ~ 0 +Text Label 600 1250 0 42 ~ 0 PPM_OUT $Comp L GND #PWR? U 1 1 549891A9 -P 1000 1850 -F 0 "#PWR?" H 1000 1850 30 0001 C CNN -F 1 "GND" H 1000 1780 30 0001 C CNN -F 2 "" H 1000 1850 60 0001 C CNN -F 3 "" H 1000 1850 60 0001 C CNN - 1 1000 1850 +P 850 1800 +F 0 "#PWR?" H 850 1800 30 0001 C CNN +F 1 "GND" H 850 1730 30 0001 C CNN +F 2 "" H 850 1800 60 0001 C CNN +F 3 "" H 850 1800 60 0001 C CNN + 1 850 1800 1 0 0 -1 $EndComp Text Label 6600 4850 2 42 ~ 0 @@ -886,7 +886,7 @@ Key_► Text Label 6600 6150 2 42 ~ 0 Key_▼ Text Label 2000 3700 3 42 ~ 0 -PPM_IN +Somo_Busy $Comp L R R1 U 1 1 54988260 @@ -1021,10 +1021,10 @@ F 3 "" H 1400 7050 60 0001 C CNN 1 1400 7050 -1 0 0 1 $EndComp -Text GLabel 2950 4600 1 42 Input ~ 0 -port G 5 (1) -Text GLabel 2850 4600 1 42 Input ~ 0 -port E 3 (1) +Text GLabel 2950 4600 1 42 Output ~ 0 +port G 5 (0) +Text GLabel 2850 4600 1 42 Output ~ 0 +port E 3 (0) Text GLabel 4850 5650 2 42 Input ~ 0 port D 7 (1) Text Label 5650 5650 2 42 ~ 0 @@ -1211,8 +1211,8 @@ Text GLabel 4050 4600 1 42 Input ~ 0 port D 2 (1) Text Label 4050 3700 3 42 ~ 0 Rot_2_A -Text GLabel 3750 4600 1 42 Input ~ 0 -port H 1 (1) +Text GLabel 3750 4600 1 42 Output ~ 0 +port H 1 (0) Text GLabel 3850 4600 1 42 Output ~ 0 port H 0 (0) Text Label 3850 3700 3 42 ~ 0 @@ -1278,7 +1278,7 @@ PPM_OUT Text GLabel 2100 4600 1 42 Output ~ 0 port B 6 (0) Text GLabel 2000 4600 1 42 Input ~ 0 -port E 7 (0) +port B 7 (0) Text Label 5650 4850 2 42 ~ 0 LCD_DATA0 Text GLabel 4850 4850 2 42 Output ~ 0 @@ -40877,45 +40877,45 @@ $EndComp $Comp L POT Stick U 1 1 549E7A9D -P 4200 1350 -F 0 "Stick" H 4200 1250 50 0000 C CNN -F 1 "POT" H 4200 1350 50 0000 C CNN -F 2 "~" H 4200 1350 60 0000 C CNN -F 3 "~" H 4200 1350 60 0000 C CNN - 1 4200 1350 +P 4450 1300 +F 0 "Stick" H 4450 1200 50 0000 C CNN +F 1 "POT" H 4450 1300 50 0000 C CNN +F 2 "~" H 4450 1300 60 0000 C CNN +F 3 "~" H 4450 1300 60 0000 C CNN + 1 4450 1300 0 1 1 0 $EndComp $Comp L CONN_1 RF_Module U 1 1 549E7AB4 -P 3150 950 -F 0 "RF_Module" H 3230 950 40 0000 L CNN -F 1 "CONN_1" H 3150 1005 30 0001 C CNN -F 2 "" H 3150 950 60 0000 C CNN -F 3 "" H 3150 950 60 0000 C CNN - 1 3150 950 +P 3000 900 +F 0 "RF_Module" H 3080 900 40 0000 L CNN +F 1 "CONN_1" H 3000 955 30 0001 C CNN +F 2 "" H 3000 900 60 0000 C CNN +F 3 "" H 3000 900 60 0000 C CNN + 1 3000 900 1 0 0 -1 $EndComp $Comp L VCC 5V U 1 1 549E7DD9 -P 4200 1050 -F 0 "5V" H 4200 1150 30 0001 C CNN -F 1 "VCC" H 4200 1150 50 0000 C CNN -F 2 "" H 4200 1050 60 0001 C CNN -F 3 "" H 4200 1050 60 0001 C CNN - 1 4200 1050 +P 4450 1000 +F 0 "5V" H 4450 1100 30 0001 C CNN +F 1 "VCC" H 4450 1100 50 0000 C CNN +F 2 "" H 4450 1000 60 0001 C CNN +F 3 "" H 4450 1000 60 0001 C CNN + 1 4450 1000 1 0 0 -1 $EndComp $Comp L GND #PWR? U 1 1 549E7DE0 -P 4200 1700 -F 0 "#PWR?" H 4200 1700 30 0001 C CNN -F 1 "GND" H 4200 1630 30 0001 C CNN -F 2 "" H 4200 1700 60 0001 C CNN -F 3 "" H 4200 1700 60 0001 C CNN - 1 4200 1700 +P 4450 1650 +F 0 "#PWR?" H 4450 1650 30 0001 C CNN +F 1 "GND" H 4450 1580 30 0001 C CNN +F 2 "" H 4450 1650 60 0001 C CNN +F 3 "" H 4450 1650 60 0001 C CNN + 1 4450 1650 1 0 0 -1 $EndComp $Comp @@ -40932,12 +40932,12 @@ $EndComp $Comp L +BATT U? U 1 1 549E8260 -P 4750 3600 -F 0 "U?" H 4750 3550 60 0001 C CNN -F 1 "+BATT" H 4750 3700 50 0000 C BNN -F 2 "" H 4750 3600 60 0001 C CNN -F 3 "" H 4750 3600 60 0001 C CNN - 1 4750 3600 +P 4850 3600 +F 0 "U?" H 4850 3550 60 0001 C CNN +F 1 "+BATT" H 4850 3700 50 0000 C BNN +F 2 "" H 4850 3600 60 0001 C CNN +F 3 "" H 4850 3600 60 0001 C CNN + 1 4850 3600 1 0 0 -1 $EndComp $Comp @@ -40964,7 +40964,7 @@ F 3 "" H 7300 4500 60 0000 C CNN $EndComp Text Label 7100 4400 0 50 ~ 0 Battery (2S LiPo) -Text Label 3550 1700 2 42 ~ 0 +Text Label 3400 1650 2 42 ~ 0 DSC_PPM $Comp L SW ROT_ENC_x @@ -41010,13 +41010,13 @@ F 3 "" H 10450 3850 60 0001 C CNN 1 10450 3850 -1 0 0 -1 $EndComp -Text Label 2350 7500 2 42 ~ 0 -OpenTX output -Text GLabel 1050 7500 2 42 Output ~ 0 -port pin (initial state) -Text Notes 1250 7400 0 60 ~ 0 +Text Label 2250 3300 2 42 ~ 0 +M2560 output +Text GLabel 1050 3300 2 42 Output ~ 0 +port pin (init. state) +Text Notes 1250 3200 0 60 ~ 0 Pinout caption : -Text Label 5500 2450 2 42 ~ 0 +Text Label 5750 2400 2 42 ~ 0 Gain = 1 + R2/R6 $Bitmap Pos 4600 4650 @@ -41110,7 +41110,7 @@ CA 3B B1 B4 D6 FB 76 3A 4D 11 32 4D 1E A1 3D 78 1C 8B 1E 14 74 10 57 46 8C 97 FB 33 B3 93 2C A5 90 EC 7D 2B A5 BC 7A F5 EA E1 E1 5E 44 C8 BD 2E 90 84 08 60 87 C2 BB D7 FD 40 85 4A 52 6F 3D D0 6D 9E 6E 41 36 CA 77 04 97 99 83 92 6E D1 7C 20 6D 2C 33 D2 7F 5B 16 F2 83 51 39 A0 3F CF F3 A7 9F 7E FA CB 5F FE F5 EB D7 AF 45 64 59 96 6D DB F6 23 3E B3 52 CA B3 1B C5 00 F7 -08 C0 CC FE 1F 15 4F 30 6D 3D C2 80 DE 00 00 00 00 49 45 4E 44 AE 42 60 82 04 $EndBitmap +08 C0 CC FE 1F 15 4F 30 6D 3D C2 80 DE 00 00 00 00 49 45 4E 44 AE 42 60 82 00 $EndBitmap EndData $EndBitmap $Comp @@ -41160,7 +41160,7 @@ Wire Notes Line Wire Wire Line 10100 4650 10850 4650 Wire Wire Line - 4550 2200 4950 2200 + 4800 2150 5200 2150 Wire Wire Line 7250 5800 7800 5800 Wire Wire Line @@ -41168,17 +41168,17 @@ Wire Wire Line Wire Wire Line 8650 1000 8100 1000 Wire Wire Line - 750 1300 1900 1300 + 600 1250 1750 1250 Wire Wire Line - 750 2100 2050 2100 + 600 2050 1900 2050 Wire Wire Line - 750 2700 1450 2700 + 600 2650 1300 2650 Wire Wire Line - 2050 2550 2050 2250 + 1900 2500 1900 2200 Wire Wire Line - 2400 1700 2500 1700 + 2250 1650 2350 1650 Wire Wire Line - 5350 4200 5350 4300 + 5450 4200 5450 4300 Wire Wire Line 9600 2250 9450 2250 Wire Wire Line @@ -41196,13 +41196,13 @@ Wire Wire Line Wire Wire Line 8650 2100 8650 2200 Wire Wire Line - 5800 1450 5800 2200 + 6050 1400 6050 2150 Wire Wire Line - 5200 1000 5200 1050 + 5450 950 5450 1000 Wire Wire Line - 5800 2200 5450 2200 + 6050 2150 5700 2150 Wire Wire Line - 4550 1650 4550 1700 + 4800 1600 4800 1650 Wire Wire Line 10400 2650 10400 2750 Wire Wire Line @@ -41238,9 +41238,9 @@ Wire Wire Line Wire Wire Line 2350 6650 2350 7050 Wire Wire Line - 2650 2100 2650 1300 + 2500 2050 2500 1250 Wire Wire Line - 1650 950 1650 1300 + 1500 900 1500 1250 Wire Wire Line 4250 4150 4250 3700 Wire Wire Line @@ -41426,8 +41426,6 @@ Wire Wire Line 2300 4750 2300 4600 Wire Wire Line 2100 4750 2100 4600 -Wire Wire Line - 2000 4600 2000 5550 Wire Wire Line 4700 4850 4850 4850 Wire Wire Line @@ -41483,17 +41481,17 @@ Wire Wire Line Wire Wire Line 2850 7250 2850 7650 Wire Wire Line - 2650 1300 2500 1300 -Connection ~ 1650 1300 + 2500 1250 2350 1250 +Connection ~ 1500 1250 Wire Wire Line - 1400 2300 1400 2550 + 1250 2250 1250 2500 Wire Wire Line - 1400 2550 1450 2550 -Connection ~ 1200 2700 + 1250 2500 1300 2500 +Connection ~ 1050 2650 Wire Wire Line - 2500 1700 2500 1650 + 2350 1650 2350 1600 Wire Wire Line - 1000 1850 1000 1700 + 850 1800 850 1650 Wire Wire Line 2100 4150 2100 3700 Wire Wire Line @@ -41513,7 +41511,7 @@ Wire Wire Line Wire Wire Line 2500 4150 2500 3700 Wire Wire Line - 1200 2700 1200 1850 + 1050 2650 1050 1800 Wire Wire Line 5750 4850 5800 4850 Wire Wire Line @@ -41543,9 +41541,9 @@ Wire Notes Line Wire Wire Line 9600 2650 9600 2750 Wire Wire Line - 4550 2700 4550 2800 + 4800 2650 4800 2750 Wire Wire Line - 5200 1850 5200 1950 + 5450 1800 5450 1900 Wire Wire Line 8100 2550 8100 2750 Connection ~ 8100 2750 @@ -41577,15 +41575,15 @@ Wire Wire Line Wire Wire Line 10750 3800 10750 4200 Wire Wire Line - 5750 3700 5350 3700 + 5850 3700 5450 3700 Wire Wire Line - 1900 1450 1900 1700 + 1750 1400 1750 1650 Wire Wire Line - 1200 1850 1300 1850 + 1050 1800 1150 1800 Wire Wire Line - 1000 1700 1300 1700 + 850 1650 1150 1650 Wire Wire Line - 2650 2550 2650 2650 + 2500 2500 2500 2600 Wire Wire Line 6900 1000 7000 1000 Wire Wire Line @@ -41597,9 +41595,9 @@ Wire Wire Line Wire Wire Line 8300 6850 7250 6850 Wire Wire Line - 4800 1550 4750 1550 + 5050 1500 5000 1500 Wire Wire Line - 4750 1550 4750 2200 + 5000 1500 5000 2150 Wire Wire Line 9300 5350 10750 5350 Wire Notes Line @@ -41607,33 +41605,33 @@ Wire Notes Line Wire Wire Line 7400 2750 9050 2750 Wire Wire Line - 2950 950 3000 950 + 2800 900 2850 900 Wire Wire Line - 4200 1050 4200 1100 + 4450 1000 4450 1050 Wire Wire Line - 4200 1600 4200 1700 + 4450 1550 4450 1650 Wire Wire Line - 4350 1350 4800 1350 + 4600 1300 5050 1300 Wire Wire Line - 4750 3600 4750 3700 + 4850 3600 4850 3700 Wire Wire Line - 4750 3700 4850 3700 + 4850 3700 4950 3700 Wire Wire Line 7500 4650 8600 4650 Connection ~ 8300 4650 -Connection ~ 4750 2200 +Connection ~ 5000 2150 Wire Wire Line - 1650 950 2550 950 + 1500 900 2400 900 Wire Wire Line - 3150 1700 3550 1700 + 3000 1650 3400 1650 Wire Wire Line - 5800 1450 6200 1450 + 6050 1400 6450 1400 Wire Wire Line 10450 4100 10450 4200 Wire Wire Line - 1850 7500 2350 7500 + 1800 3300 2250 3300 Wire Wire Line - 900 7500 1050 7500 + 950 3300 1050 3300 Wire Wire Line 4450 4300 4450 6450 Wire Wire Line @@ -41697,18 +41695,18 @@ F 3 "" H 1750 7050 60 0000 C CNN 1 1750 7050 -1 0 0 1 $EndComp -Text Notes 4850 6550 0 42 ~ 0 -LCD supported : ST7565P, ST7565R, ERC12864FSF, ST7920\nProtocol = 6800, 8 bits parallel mode\n\nLCD pinout labels (may differ, depending of brand) :\nRD = Read or Enable on ST7920\nWR = WRite or Write(0)/Read(1) on ST7920\nA0 = R/S (register select) or D/I (data/instruction select)\nRST = RES (reset)\nCS = Chip Select (not used on ST7920) -Text Label 2350 7600 2 42 ~ 0 -OpenTX input -Text GLabel 1050 7600 2 42 Input ~ 0 -port pin (initial state) +Text Notes 4850 6650 0 42 ~ 0 +LCD supported : ST7565P, ST7565R, ERC12864FSF, ST7920\nProtocol = 6800, 8 bits parallel mode\n\nLCD pinout labels (may differ, depending of brand) :\nRD = Read or Enable on ST7920\nWR = Write or Write(0)/Read(1) on ST7920\nA0 = R/S (register select) or D/I (data/instruction select)\nRST = RES (reset)\nCS = Chip Select (not used on ST7920) +Text Label 2250 3400 2 42 ~ 0 +M2560 input +Text GLabel 1050 3400 2 42 Input ~ 0 +port pin (init. state) Wire Wire Line - 1850 7600 2350 7600 + 1800 3400 2250 3400 Wire Wire Line - 900 7600 1050 7600 -Text Notes 750 3100 0 60 ~ 0 -NOTA : all features are optional !\nM2560 can properly work without switch deboucing, stick voltage\nprotection, rotary encoder or PPM / power management.\nMinimum requirement is just LCD and navigation keys. Some switches\ncould be usefull, especially for flight conditions, but not fundamental. + 950 3400 1050 3400 +Text Notes 4850 7350 0 42 ~ 0 +NOTA : all features are optional.\nM2560 can properly work without PPM / power management,\nswitch deboucing, stick voltage protection or rotary encoder.\nMinimum requirement is just LCD and navigation keys. Some\nswitches could be usefull, especially for flight conditions, but\nnot fundamental. $Comp L LED . U 1 1 5568D052 @@ -41784,87 +41782,173 @@ Connection ~ 8350 2900 $Comp L POT Pxx U 1 1 55731CC9 -P 6250 3950 -F 0 "Pxx" H 6250 3850 50 0000 C CNN -F 1 "POT" H 6250 3950 50 0000 C CNN -F 2 "~" H 6250 3950 60 0000 C CNN -F 3 "~" H 6250 3950 60 0000 C CNN - 1 6250 3950 +P 6350 3950 +F 0 "Pxx" H 6350 3850 50 0000 C CNN +F 1 "POT" H 6350 3950 50 0000 C CNN +F 2 "~" H 6350 3950 60 0000 C CNN +F 3 "~" H 6350 3950 60 0000 C CNN + 1 6350 3950 0 1 1 0 $EndComp $Comp L VCC U? U 1 1 55731CDB -P 6250 3600 -F 0 "U?" H 6250 3700 60 0001 C CNN -F 1 "VCC" H 6250 3700 50 0000 C CNN -F 2 "" H 6250 3600 60 0001 C CNN -F 3 "" H 6250 3600 60 0001 C CNN - 1 6250 3600 +P 6350 3600 +F 0 "U?" H 6350 3700 60 0001 C CNN +F 1 "VCC" H 6350 3700 50 0000 C CNN +F 2 "" H 6350 3600 60 0001 C CNN +F 3 "" H 6350 3600 60 0001 C CNN + 1 6350 3600 1 0 0 -1 $EndComp $Comp L GND #PWR? U 1 1 55731CE2 -P 6250 4500 -F 0 "#PWR?" H 6250 4500 50 0001 C CNN -F 1 "GND" H 6250 4430 50 0001 C CNN -F 2 "" H 6250 4500 60 0001 C CNN -F 3 "" H 6250 4500 60 0001 C CNN - 1 6250 4500 +P 6350 4500 +F 0 "#PWR?" H 6350 4500 50 0001 C CNN +F 1 "GND" H 6350 4430 50 0001 C CNN +F 2 "" H 6350 4500 60 0001 C CNN +F 3 "" H 6350 4500 60 0001 C CNN + 1 6350 4500 1 0 0 -1 $EndComp Wire Wire Line - 6250 3600 6250 3700 + 6350 3600 6350 3700 Wire Wire Line - 6250 4200 6250 4500 + 6350 4200 6350 4500 $Comp L C C1 U 1 1 55732064 -P 6600 4150 -F 0 "C1" V 6550 4000 50 0000 L CNN -F 1 "100n" V 6650 4000 50 0000 L CNN -F 2 "" H 6600 4150 60 0001 C CNN -F 3 "" H 6600 4150 60 0001 C CNN - 1 6600 4150 +P 6700 4150 +F 0 "C1" V 6650 4000 50 0000 L CNN +F 1 "100n" V 6750 4000 50 0000 L CNN +F 2 "" H 6700 4150 60 0001 C CNN +F 3 "" H 6700 4150 60 0001 C CNN + 1 6700 4150 1 0 0 -1 $EndComp Wire Wire Line - 6600 4350 6250 4350 -Connection ~ 6250 4350 -Text Label 7050 3950 2 42 ~ 0 + 6700 4350 6350 4350 +Connection ~ 6350 4350 +Text Label 7150 3950 2 42 ~ 0 Stick_xx Wire Wire Line - 6400 3950 7050 3950 -Text Notes 6100 3350 0 60 ~ 0 + 6500 3950 7150 3950 +Text Notes 6200 3350 0 60 ~ 0 Stick anti-jitter filter Wire Wire Line 4550 4750 4850 4750 Wire Wire Line 4850 4750 4850 4400 Wire Wire Line - 2650 2550 2550 2550 -Text Label 5200 7500 2 42 ~ 0 + 2500 2500 2400 2500 +Text Label 2300 7500 2 42 ~ 0 M2560 input $Comp L GND #PWR? U 1 1 55831F42 -P 5300 7600 -F 0 "#PWR?" H 5300 7600 30 0001 C CNN -F 1 "GND" H 5300 7530 30 0001 C CNN -F 2 "" H 5300 7600 60 0001 C CNN -F 3 "" H 5300 7600 60 0001 C CNN - 1 5300 7600 +P 2400 7600 +F 0 "#PWR?" H 2400 7600 30 0001 C CNN +F 1 "GND" H 2400 7530 30 0001 C CNN +F 2 "" H 2400 7600 60 0001 C CNN +F 3 "" H 2400 7600 60 0001 C CNN + 1 2400 7600 1 0 0 -1 $EndComp -Text Notes 4600 7400 0 60 ~ 0 +Text Notes 1700 7400 0 60 ~ 0 Unused analog pin Wire Wire Line - 5300 7500 5300 7600 + 2400 7500 2400 7600 Wire Wire Line - 4800 7500 5300 7500 + 1900 7500 2400 7500 Wire Wire Line - 2000 5550 2500 5550 + 1550 5550 2500 5550 Text Notes 2550 5550 0 50 ~ 0 Pin 9, can be soldered\nwith pin 8 (unused) +$Comp +L TLP290 U4 +U 1 1 567E736C +P 3550 3150 +F 0 "U4" H 3337 3328 40 0000 C CNN +F 1 "TLP290 / TLP620" H 3550 2950 40 0000 C CNN +F 2 "." H 3350 3000 29 0000 C CNN +F 3 "" H 3550 3150 60 0000 C CNN + 1 3550 3150 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR? +U 1 1 567E7379 +P 3100 3400 +F 0 "#PWR?" H 3100 3400 30 0001 C CNN +F 1 "GND" H 3100 3330 30 0001 C CNN +F 2 "" H 3100 3400 60 0001 C CNN +F 3 "" H 3100 3400 60 0001 C CNN + 1 3100 3400 + 1 0 0 -1 +$EndComp +$Comp +L R R8 +U 1 1 567E74B7 +P 3100 2750 +F 0 "R8" V 3180 2750 50 0000 C CNN +F 1 "500" V 3100 2750 50 0000 C CNN +F 2 "" H 3100 2750 60 0001 C CNN +F 3 "" H 3100 2750 60 0001 C CNN + 1 3100 2750 + -1 0 0 -1 +$EndComp +$Comp +L +BATT U? +U 1 1 567E787B +P 3100 2500 +F 0 "U?" H 3100 2450 60 0001 C CNN +F 1 "+BATT" H 3100 2600 50 0000 C BNN +F 2 "" H 3100 2500 60 0001 C CNN +F 3 "" H 3100 2500 60 0001 C CNN + 1 3100 2500 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3100 3250 3100 3400 +Text Label 4300 3250 2 42 ~ 0 +Telemetry_TX +Text Label 4300 3050 2 42 ~ 0 +TX module +Wire Wire Line + 3900 3050 4300 3050 +Wire Wire Line + 4300 3250 3900 3250 +Text Notes 3250 2250 0 60 ~ 0 +Flash insulation +Wire Wire Line + 3200 3250 3100 3250 +Wire Wire Line + 3200 3050 3100 3050 +Wire Wire Line + 3100 3050 3100 3000 +Text Label 1550 3700 3 42 ~ 0 +PPM_IN +Wire Wire Line + 1550 4150 1550 3700 +Text GLabel 1550 4600 1 42 Input ~ 0 +port E 7 (0) +Wire Wire Line + 1550 4600 1550 5550 +Wire Wire Line + 2000 4600 2000 4750 +Text Label 2850 3700 3 42 ~ 0 +Somo_Data +Wire Wire Line + 2850 4150 2850 3700 +Text Label 2950 3700 3 42 ~ 0 +Somo_Clock +Wire Wire Line + 2950 4150 2950 3700 +Text Label 3750 3700 3 42 ~ 0 +Somo_Reset +Wire Wire Line + 3750 4150 3750 3700 +Text Notes 10400 1300 0 60 ~ 0 +R6 is optional $EndSCHEMATC diff --git a/doc/Mega2560/MEGA2560_SCH.pdf b/doc/Mega2560/MEGA2560_SCH.pdf index 90f6d4393..d12679e60 100644 Binary files a/doc/Mega2560/MEGA2560_SCH.pdf and b/doc/Mega2560/MEGA2560_SCH.pdf differ diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 144ec8b0d..ac52a0a0a 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -633,7 +633,7 @@ else() option(BATTGRAPH "Battery graph" OFF) option(HAPTIC "Haptic support" OFF) set(TTS "EN" CACHE STRING "TTS language") - set(LCD "DEFAULT" CACHE STRING "LCD type (DEFAULT/ST7565P/ST7565R/ERC12864FSF/ST7920)") + set(LCD "DEFAULT" CACHE STRING "LCD type (DEFAULT/ST7565P/ST7565R/ERC12864FSF/ST7920/KS108)") set(LUA NO) set(PULSES_SRC pulses_avr.cpp) set(SRC ${SRC} main_avr.cpp) diff --git a/radio/src/audio_avr.cpp b/radio/src/audio_avr.cpp index 8321fa135..a6046dfaa 100644 --- a/radio/src/audio_avr.cpp +++ b/radio/src/audio_avr.cpp @@ -266,7 +266,7 @@ void audioTrimPress(int16_t value) { if (g_eeGeneral.beepMode >= e_mode_nokeys) { #if defined(AUDIO) - value = limit(TRIM_MIN, value, TRIM_MAX); + value = limit(TRIM_MIN, value, TRIM_MAX); value >>= 2; value += 60; audio.play(value, 6, 1, PLAY_NOW); @@ -284,12 +284,12 @@ void audioTimerCountdown(uint8_t timer, int value) } #if defined(CPUM2560) - if (g_model.timers[timer].countdownBeep == COUNTDOWN_VOICE) { - if (value >= 0 && value <= g_model.timers[timer].countdownStart) { - playNumber(value, 0, 0, 0); + else if (g_model.timers[timer].countdownBeep == COUNTDOWN_VOICE) { + if (value >= 0 && value <= TIMER_COUNTDOWN_START(timer)) { + playNumber(value, 0, 0); } else if (value == 30 || value == 20) { - playDuration(value, 0, 0); + playDuration(value); } } #endif diff --git a/radio/src/audio_avr.h b/radio/src/audio_avr.h index 77b48e5bb..1194f9de6 100644 --- a/radio/src/audio_avr.h +++ b/radio/src/audio_avr.h @@ -107,6 +107,11 @@ void audioDefevent(uint8_t e); #define VOICE_AUDIO_BUZZER(v, a, b) AUDIO_BUZZER(a, b) #endif +void audioKeyPress(); +void audioKeyError(); +void audioTrimPress(int16_t value); +void audioTimerCountdown(uint8_t timer, int value); + #define AUDIO_KEY_PRESS() audioKeyPress() #define AUDIO_KEY_ERROR() AUDIO_WARNING2() #define AUDIO_WARNING1() AUDIO_BUZZER(audioDefevent(AU_WARNING1), beep(3)) diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 3176a85b9..994db9137 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -452,7 +452,7 @@ PACK(struct TimerData { uint8_t countdownBeep:2; uint8_t minuteBeep:1; uint8_t persistent:2; - uint8_t spare:3; + uint8_t countdownStart:3; uint16_t value; }); #else diff --git a/radio/src/gui/9x/lcd.cpp b/radio/src/gui/9x/lcd.cpp index b7e508f10..96f2974f4 100644 --- a/radio/src/gui/9x/lcd.cpp +++ b/radio/src/gui/9x/lcd.cpp @@ -1371,24 +1371,29 @@ void lcdInvertLine(int8_t y) } } -#if !defined(BOOT) -void lcd_img(coord_t x, coord_t y, const pm_uchar * img, uint8_t idx, LcdFlags att) -{ - const pm_uchar *q = img; - uint8_t w = pgm_read_byte(q++); - uint8_t hb = (pgm_read_byte(q++)+7)/8; - bool inv = (att & INVERS) ? true : (att & BLINK ? BLINK_ON_PHASE : false); - q += idx*w*hb; - for (uint8_t yb = 0; yb < hb; yb++) { - uint8_t *p = &displayBuf[ (y / 8 + yb) * LCD_W + x ]; - for (coord_t i=0; istart = qr.rem + qr.quot*60; break; case 2: - qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2; - if (timer->start >= qr.rem) { + qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62) - 2; + if ((int16_t)timer->start >= qr.rem) { timer->start -= qr.rem ; } - if ((int32_t)timer->start > 3599) timer->start=3599; // 59:59 + if ((int16_t)timer->start > 3599) { + timer->start = 3599; // 59:59 + } break; } } diff --git a/radio/src/gui/9x/splash.cpp b/radio/src/gui/9x/splash.cpp index ecf185f1b..9019a38e0 100644 --- a/radio/src/gui/9x/splash.cpp +++ b/radio/src/gui/9x/splash.cpp @@ -18,20 +18,45 @@ * GNU General Public License for more details. */ -#include "../../opentx.h" +#include "opentx.h" + +#if !defined GET_FAR_ADDRESS +#define GET_FAR_ADDRESS(var) \ +({ \ + uint32_t tmp; \ + \ + __asm__ __volatile__( \ + \ + "ldi %A0, lo8(%1)" "\n\t" \ + "ldi %B0, hi8(%1)" "\n\t" \ + "ldi %C0, hh8(%1)" "\n\t" \ + "clr %D0" "\n\t" \ + : \ + "=d" (tmp) \ + : \ + "p" (&(var)) \ + ); \ + tmp; \ +}) +#endif #if defined(SPLASH) const pm_uchar splashdata[] PROGMEM = { 'S','P','S',0, #include "bitmaps/9x/splash.lbm" 'S','P','E',0 }; + const pm_uchar * const splash_lbm = splashdata+4; void drawSplash() { lcdClear(); - lcd_img(0, 0, splash_lbm, 0, 0); - +#if defined(PCBMEGA2560) && !defined(SIMU) + lcd_imgfar(0, 0, pgm_get_far_address(splash_lbm), 0, 0); // use progmem "far" for splash working with all other options enabled +#else + lcd_img(0, 0, splash_lbm, 0, 0); +#endif + #if MENUS_LOCK == 1 if (readonly == false) { lcdDrawFilledRect((LCD_W-(sizeof(TR_UNLOCKED)-1)*FW)/2 - 9, 50, (sizeof(TR_UNLOCKED)-1)*FW+16, 11, SOLID, ERASE|ROUND); diff --git a/radio/src/main_avr.cpp b/radio/src/main_avr.cpp index 5b3e33a53..70fc6f3f0 100644 --- a/radio/src/main_avr.cpp +++ b/radio/src/main_avr.cpp @@ -113,7 +113,7 @@ void perMain() #endif #if defined(GUI) - const char *warn = warningText; + const char * warn = warningText; bool popupMenuActive = (popupMenuNoItems > 0); if (IS_LCD_REFRESH_ALLOWED()) { // No need to redraw until lcdRefresh_ST7920(0) below completely refreshes the display. diff --git a/radio/src/opentx.h b/radio/src/opentx.h index f36fb2667..e0704e88a 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -1426,7 +1426,11 @@ enum AUDIO_SOUNDS { #endif #if defined(PCBGRUVIN9X) && defined(VOICE) -#include "targets/gruvin9x/somo14d.h" +#include "targets/gruvin9x/voice.h" +#endif + +#if defined(PCBMEGA2560) && defined(VOICE) +#include "targets/mega2560/voice.h" #endif #include "translations.h" diff --git a/radio/src/targets/9x/lcd_default_driver.cpp b/radio/src/targets/9x/lcd_default_driver.cpp new file mode 100644 index 000000000..1ee4cbaf4 --- /dev/null +++ b/radio/src/targets/9x/lcd_default_driver.cpp @@ -0,0 +1,139 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +void lcdSendCtl(uint8_t val) +{ + PORTC_LCD_CTRL &= ~(1<SEG1) + 0xA6, //REV = 0: non-reverse display + 0xA4, //EON = 0: normal display. non-entire + 0xA2, //Select LCD bias + 0xC8, //SHL = 1: reverse direction (COM64->COM1) + 0x2F, //Control power circuit operation VC=VR=VF=1 + 0x25, //Select int resistance ratio R2 R1 R0 =5 + 0x81, //Set reference voltage Mode + 0x22, //24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18 + 0xAF, //DON = 1: display ON + 0x60 //Set the display start line to zero +#elif defined(LCD_ERC12864FSF) + 0xE2, //Initialize the internal functions + 0xAE, //DON = 0: display OFF + 0xA1, //ADC = 1: reverse direction (SEG132->SEG1) + 0xA6, //REV = 0: non-reverse display + 0xA4, //EON = 0: normal display. non-entire + 0xA3, //Select LCD bias + 0xC0, //SHL = 0: normal direction (COM1->COM64) + 0x2F, //Control power circuit operation VC=VR=VF=1 + 0x27, //Select int resistance ratio R2 R1 R0 + 0x81, //Set reference voltage Mode + 0x2D, //24 SV5 SV4 SV3 SV2 SV1 SV0 + 0xAF //DON = 1: display ON +#else //ST7565P (default 9x LCD) + 0xE2, //Initialize the internal functions + 0xAE, //DON = 0: display OFF + 0xA1, //ADC = 1: reverse direction(SEG132->SEG1) + 0xA6, //REV = 0: non-reverse display + 0xA4, //EON = 0: normal display. non-entire + 0xA2, //Select LCD bias=0 + 0xC0, //SHL = 0: normal direction (COM1->COM64) + 0x2F, //Control power circuit operation VC=VR=VF=1 + 0x25, //Select int resistance ratio R2 R1 R0 =5 + 0x81, //Set reference voltage Mode + 0x22, //24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18 + 0xAF //DON = 1: display ON +#endif +}; + +void lcdInit() +{ + LCD_LOCK(); + PORTC_LCD_CTRL &= ~(1<0; --x) { + PORTA_LCD_DAT = *p++; + PORTC_LCD_CTRL |= (1<SEG1) - 0xA6, //REV = 0: non-reverse display - 0xA4, //EON = 0: normal display. non-entire - 0xA2, //Select LCD bias - 0xC8, //SHL = 1: reverse direction (COM64->COM1) - 0x2F, //Control power circuit operation VC=VR=VF=1 - 0x25, //Select int resistance ratio R2 R1 R0 =5 - 0x81, //Set reference voltage Mode - 0x22, //24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18 - 0xAF, //DON = 1: display ON - 0x60 //Set the display start line to zero -#elif defined(LCD_ERC12864FSF) - 0xE2, //Initialize the internal functions - 0xAE, //DON = 0: display OFF - 0xA1, //ADC = 1: reverse direction (SEG132->SEG1) - 0xA6, //REV = 0: non-reverse display - 0xA4, //EON = 0: normal display. non-entire - 0xA3, //Select LCD bias - 0xC0, //SHL = 0: normal direction (COM1->COM64) - 0x2F, //Control power circuit operation VC=VR=VF=1 - 0x27, //Select int resistance ratio R2 R1 R0 - 0x81, //Set reference voltage Mode - 0x2D, //24 SV5 SV4 SV3 SV2 SV1 SV0 - 0xAF //DON = 1: display ON +#if defined(LCD_KS108) +#include "targets/9x/lcd_ks108_driver.cpp" #elif defined(LCD_ST7920) - 0x30, //Set 8-bit interface - 0x36, //Repeat with graphics bit set to ON - 0x0C, //Display ON, cursor and blink OFF - 0x01, //Clear display, reset address - 0x06 //Display ON, no cursor -#else //ST7565P (default 9x LCD) - 0xE2, //Initialize the internal functions - 0xAE, //DON = 0: display OFF - 0xA1, //ADC = 1: reverse direction(SEG132->SEG1) - 0xA6, //REV = 0: non-reverse display - 0xA4, //EON = 0: normal display. non-entire - 0xA2, //Select LCD bias=0 - 0xC0, //SHL = 0: normal direction (COM1->COM64) - 0x2F, //Control power circuit operation VC=VR=VF=1 - 0x25, //Select int resistance ratio R2 R1 R0 =5 - 0x81, //Set reference voltage Mode - 0x22, //24 SV5 SV4 SV3 SV2 SV1 SV0 = 0x18 - 0xAF //DON = 1: display ON -#endif -}; - -void lcdInit() -{ - LCD_LOCK(); - PORTC_LCD_CTRL &= ~(1< 31) { - y_addr = y - 32; //Because there are only 31 addressable lines in the ST7920 - x_addr += 8; //so we overflow x (7 visible bytes per line) to reach the bottom half - } - else { - y_addr = y; - } - lcdSendCtl( 0x80 | y_addr ); //Set Vertical Address - _delay_us(49); - lcdSendCtl( 0x80 | x_addr ); //Set Horizontal Address - _delay_us(49); - PORTC_LCD_CTRL |= (1< 0=0, 1=1..7=7, 8=0, 9=1... - col_offset = 1 << bit_count; //Build a value for a AND operation with the vorrect bitposition - line_offset = ( y / 8 ) * 128; //On the ST7565 there are 8 lines with each 128 bytes width - for (coord_t x=0; x<16; x++) { //Walk through 16 bytes form left to right (128 Pixel) - p=displayBuf + line_offset + ( x * 8 ); //Calculate the position of the first byte im array - // adressing the bytes sequential and set the bits at the correct position merging them with an OR operation to get all bits in one byte - // the position of the LSB is the right-most position of the byte to the ST7920 - result = ((*p++ & col_offset)!=0?0x80:0); - result|= ((*p++ & col_offset)!=0?0x40:0); - result|= ((*p++ & col_offset)!=0?0x20:0); - result|= ((*p++ & col_offset)!=0?0x10:0); - result|= ((*p++ & col_offset)!=0?0x08:0); - result|= ((*p++ & col_offset)!=0?0x04:0); - result|= ((*p++ & col_offset) !=0?0x02:0); - result|= ((*p++ & col_offset)!=0?0x01:0); - PORTA_LCD_DAT = result; - PORTC_LCD_CTRL |= (1<0; --x) { - PORTA_LCD_DAT = *p++; - PORTC_LCD_CTRL |= (1<0; --x) { + PORTA_LCD_DAT = *p++; + lcdPulseEnable(); + } + p += 64; + } + A0_off; +} + +void lcdRefresh() +{ + // Right + CS1_on; + lcdRefreshSide(displayBuf); + CS1_off; + + // Left + CS2_on; + lcdRefreshSide(displayBuf + 64); + CS2_off; +} diff --git a/radio/src/targets/9x/lcd_st7920_driver.cpp b/radio/src/targets/9x/lcd_st7920_driver.cpp new file mode 100644 index 000000000..91fac1d40 --- /dev/null +++ b/radio/src/targets/9x/lcd_st7920_driver.cpp @@ -0,0 +1,154 @@ +/* + * Copyright (C) OpenTX + * + * Based on code named + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +void lcdSendCtl(uint8_t val) +{ + PORTC_LCD_CTRL &= ~(1< 31) { + y_addr = y - 32; //Because there are only 31 addressable lines in the ST7920 + x_addr += 8; //so we overflow x (7 visible bytes per line) to reach the bottom half + } + else { + y_addr = y; + } + lcdSendCtl( 0x80 | y_addr ); //Set Vertical Address + _delay_us(49); + lcdSendCtl( 0x80 | x_addr ); //Set Horizontal Address + _delay_us(49); + PORTC_LCD_CTRL |= (1< 0=0, 1=1..7=7, 8=0, 9=1... + col_offset = 1 << bit_count; //Build a value for a AND operation with the vorrect bitposition + line_offset = ( y / 8 ) * 128; //On the ST7565 there are 8 lines with each 128 bytes width + for (coord_t x=0; x<16; x++) { //Walk through 16 bytes form left to right (128 Pixel) + p = displayBuf + line_offset + ( x * 8 ); //Calculate the position of the first byte im array + // adressing the bytes sequential and set the bits at the correct position merging them with an OR operation to get all bits in one byte + // the position of the LSB is the right-most position of the byte to the ST7920 + result = ((*p++ & col_offset)!=0?0x80:0); + result |= ((*p++ & col_offset)!=0?0x40:0); + result |= ((*p++ & col_offset)!=0?0x20:0); + result |= ((*p++ & col_offset)!=0?0x10:0); + result |= ((*p++ & col_offset)!=0?0x08:0); + result |= ((*p++ & col_offset)!=0?0x04:0); + result |= ((*p++ & col_offset) !=0?0x02:0); + result |= ((*p++ & col_offset)!=0?0x01:0); + PORTA_LCD_DAT = result; + PORTC_LCD_CTRL |= (1< no voice + if (g_eeGeneral.beepMode == e_mode_quiet) return; + + /* Load playlist and activate interrupt */ + WTV20SD_playlist[WTV20SD_InputIndex] = prompt; + ++WTV20SD_InputIndex; + WTV20SD_InputIndex %= QUEUE_LENGTH; + + if (!isPlaying()) { + TIMSK5 |= (1<