From 0b26e669af6d16fbdc5988558a702efdb35c116a Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 30 Sep 2016 00:27:55 +1000 Subject: [PATCH] Merge Dev into mainline (#1) * Removing USB Need to refine the drive to the iron tip * Update README.md * * Rewrite all code from scratch * Only kept settings * New font * New PID * New Menus * Use Hardware I2C * Faster System * Better Heating Time * No USB * Full Menu System --- .gitignore | 7 +- Flash Backup.hex | 2113 +++++++++++++++++ README.md | 32 +- SystemDesign.md | 4 +- TS100/TS100.ioc | 15 +- workspace/ts100/.cproject | 33 +- workspace/ts100/.gitignore | 1 + .../ts100/.settings/language.settings.xml | 27 - workspace/ts100/LinkerScript.ld | 6 +- .../STM32_USB-FS-Device_Driver/inc/usb_core.h | 259 -- .../STM32_USB-FS-Device_Driver/inc/usb_def.h | 92 - .../STM32_USB-FS-Device_Driver/inc/usb_init.h | 62 - .../STM32_USB-FS-Device_Driver/inc/usb_int.h | 45 - .../STM32_USB-FS-Device_Driver/inc/usb_lib.h | 51 - .../STM32_USB-FS-Device_Driver/inc/usb_mem.h | 45 - .../STM32_USB-FS-Device_Driver/inc/usb_mem1.h | 32 - .../STM32_USB-FS-Device_Driver/inc/usb_regs.h | 685 ------ .../STM32_USB-FS-Device_Driver/inc/usb_sil.h | 47 - .../STM32_USB-FS-Device_Driver/inc/usb_type.h | 54 - .../STM32_USB-FS-Device_Driver/src/usb_core.c | 1033 -------- .../STM32_USB-FS-Device_Driver/src/usb_init.c | 76 - .../STM32_USB-FS-Device_Driver/src/usb_int.c | 195 -- .../STM32_USB-FS-Device_Driver/src/usb_mem.c | 87 - .../STM32_USB-FS-Device_Driver/src/usb_regs.c | 760 ------ .../STM32_USB-FS-Device_Driver/src/usb_sil.c | 103 - workspace/ts100/inc/APP_Version.h | 43 - workspace/ts100/inc/Analog.h | 20 + workspace/ts100/inc/Bios.h | 71 +- workspace/ts100/inc/CTRL.h | 70 - workspace/ts100/inc/Disk.h | 95 - workspace/ts100/inc/Ext_Flash.h | 53 - workspace/ts100/inc/FAT12.h | 29 - workspace/ts100/inc/Flash.h | 29 - workspace/ts100/inc/Font.h | 95 + workspace/ts100/inc/Hardware.h | 49 - workspace/ts100/inc/I2C.h | 23 +- workspace/ts100/inc/Interrupt.h | 152 +- workspace/ts100/inc/MMA8652FC.h | 110 +- workspace/ts100/inc/Modes.h | 36 + workspace/ts100/inc/Oled.h | 40 +- workspace/ts100/inc/PID.h | 21 + workspace/ts100/inc/S100V0_1.h | 68 +- workspace/ts100/inc/Settings.h | 28 + workspace/ts100/inc/UI.h | 46 - workspace/ts100/inc/WordLib.h | 404 ---- workspace/ts100/inc/stm32f10x_conf.h | 85 - workspace/ts100/inc/usb_bot.h | 73 - workspace/ts100/inc/usb_conf.h | 73 - workspace/ts100/inc/usb_desc.h | 35 - workspace/ts100/inc/usb_istr.h | 64 - workspace/ts100/inc/usb_prop.h | 51 - workspace/ts100/inc/usb_pwr.h | 42 - workspace/ts100/inc/usb_scsi.h | 125 - workspace/ts100/src/2FAT12.c | 284 --- workspace/ts100/src/Analog.c | 123 + workspace/ts100/src/Bios.c | 330 +-- workspace/ts100/src/CTRL.c | 450 ---- workspace/ts100/src/Disk.c | 773 ------ workspace/ts100/src/Ext_Flash.c | 198 -- workspace/ts100/src/Flash.c | 33 - workspace/ts100/src/Hardware.c | 384 --- workspace/ts100/src/I2C.c | 351 ++- workspace/ts100/src/Interrupt.c | 199 +- workspace/ts100/src/MMA8652FC.c | 265 +-- workspace/ts100/src/Main.c | 88 +- workspace/ts100/src/Modes.c | 282 +++ workspace/ts100/src/Oled.c | 152 +- workspace/ts100/src/PID.c | 41 + workspace/ts100/src/Settings.c | 52 + workspace/ts100/src/UI.c | 1036 -------- workspace/ts100/src/usb_bot.c | 269 --- workspace/ts100/src/usb_desc.c | 109 - workspace/ts100/src/usb_istr.c | 138 -- workspace/ts100/src/usb_prop.c | 262 -- workspace/ts100/src/usb_pwr.c | 152 -- workspace/ts100/src/usb_scsi.c | 230 -- workspace/ts100/ts100.cfg | 4 +- 77 files changed, 3669 insertions(+), 10430 deletions(-) create mode 100644 Flash Backup.hex create mode 100644 workspace/ts100/.gitignore delete mode 100644 workspace/ts100/.settings/language.settings.xml delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_core.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_def.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_init.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_int.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_lib.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem1.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_regs.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_sil.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_type.h delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_core.c delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_init.c delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_int.c delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_mem.c delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_regs.c delete mode 100644 workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_sil.c delete mode 100644 workspace/ts100/inc/APP_Version.h create mode 100644 workspace/ts100/inc/Analog.h delete mode 100644 workspace/ts100/inc/CTRL.h delete mode 100644 workspace/ts100/inc/Disk.h delete mode 100644 workspace/ts100/inc/Ext_Flash.h delete mode 100644 workspace/ts100/inc/FAT12.h delete mode 100644 workspace/ts100/inc/Flash.h create mode 100644 workspace/ts100/inc/Font.h delete mode 100644 workspace/ts100/inc/Hardware.h create mode 100644 workspace/ts100/inc/Modes.h create mode 100644 workspace/ts100/inc/PID.h create mode 100644 workspace/ts100/inc/Settings.h delete mode 100644 workspace/ts100/inc/UI.h delete mode 100644 workspace/ts100/inc/WordLib.h delete mode 100644 workspace/ts100/inc/stm32f10x_conf.h delete mode 100644 workspace/ts100/inc/usb_bot.h delete mode 100644 workspace/ts100/inc/usb_conf.h delete mode 100644 workspace/ts100/inc/usb_desc.h delete mode 100644 workspace/ts100/inc/usb_istr.h delete mode 100644 workspace/ts100/inc/usb_prop.h delete mode 100644 workspace/ts100/inc/usb_pwr.h delete mode 100644 workspace/ts100/inc/usb_scsi.h delete mode 100644 workspace/ts100/src/2FAT12.c create mode 100644 workspace/ts100/src/Analog.c delete mode 100644 workspace/ts100/src/CTRL.c delete mode 100644 workspace/ts100/src/Disk.c delete mode 100644 workspace/ts100/src/Ext_Flash.c delete mode 100644 workspace/ts100/src/Flash.c delete mode 100644 workspace/ts100/src/Hardware.c create mode 100644 workspace/ts100/src/Modes.c create mode 100644 workspace/ts100/src/PID.c create mode 100644 workspace/ts100/src/Settings.c delete mode 100644 workspace/ts100/src/UI.c delete mode 100644 workspace/ts100/src/usb_bot.c delete mode 100644 workspace/ts100/src/usb_desc.c delete mode 100644 workspace/ts100/src/usb_istr.c delete mode 100644 workspace/ts100/src/usb_prop.c delete mode 100644 workspace/ts100/src/usb_pwr.c delete mode 100644 workspace/ts100/src/usb_scsi.c diff --git a/.gitignore b/.gitignore index c1a6737c..d3860c43 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ *.obj *.elf *.d - +*.DS_Store # Precompiled Headers *.gch *.pch @@ -27,10 +27,13 @@ *.app *.i*86 *.x86_64 -*.hex +workspace/*.hex # Debug files *.dSYM/ *.su workspace/ts100/Debug/* workspace/.metadata/* + +workspace/ts100/.settings/language.settings.xml +workspace/ts100/.cproject diff --git a/Flash Backup.hex b/Flash Backup.hex new file mode 100644 index 00000000..6d09c53e --- /dev/null +++ b/Flash Backup.hex @@ -0,0 +1,2113 @@ +:020000040800F2 +:2000000028310020613300087D3300088133000885330008893300088D330008000000000B +:20002000000000000000000000000000913300089533000800000000993300089D33000878 +:2000400000F09ABF00F026B800F024B800F022B800F020B800F01EB800F01CB800F01AB8DF +:2000600000F018B800F016B800F014B800F012B800F010B800F0F2BF00F0D8BF00F083BF7A +:2000800000F091BF01F014B801F01CB8A1330008A5330008DFF800F000000000F8B500F07E +:2000A0006BFFDFF85C4A04F50A750146284600F03FFDDFF8506A4FF400520021304600F053 +:2000C000E7FF06F200474FF4B0720FF6AC41384600F0E8FF0B222946384600F0E3FF0FF262 +:2000E000600518222946304600F0DCFF1822294606F5007000F0D6FFDFF80C0AC6F8160413 +:20010000A022DFF8081A06F5C06000F0CBFF50220FF2FC1106F5006000F0C4FF40220FF25E +:20012000402106F5206000F0BDFFA0680021C171017241716068C1604161C1618161F1BD7A +:20014000F8FFFFFFFFFFFF6F0007800009A0000BC000FFFFFFFF0F0070B50D46B5F5805F37 +:2001600008D14FF400720146DFF89809BDE8704000F098BFB5F5205F08D14FF40072014698 +:20018000DFF88C09BDE8704000F08CBFB5F5804F08D14FF400720146DFF87809BDE8704068 +:2001A00000F080BFB5F51A4F3CD3DFF858694FF40072014606F5C06000F074FFDFF840497C +:2001C0004FF40072314604F1280000F06BFFA068017A002926D1C07900280FD1B5F52A4F75 +:2001E00004D300F04FFAA168087270BD2088002818D000F047FAA168087270BD012811D19B +:200200002088002807D0B5F51C4F04D300F093FBA168087270BDB5F52C4F03D300F08BFBAC +:20022000A168087270BD10B50446002907D14FF400720FF64411BDE8104000F033BFB1F572 +:20024000805F07D14FF40072DFF8B818BDE8104000F028BFB1F5205F07D14FF40072DFF836 +:20026000B018BDE8104000F01DBFB1F5804F07D14FF40072DFF89C18BDE8104000F012BFB2 +:20028000B1F5004F0CD14FF40072002100F000FFA0220FF644412046BDE8104000F002BF6F +:2002A000B1F5024F0CD14FF40072002100F0F0FE50220FF25C012046BDE8104000F0F2BEEB +:2002C0006FF40240401841F2FF7290420DD24FF400720021204600F0DBFE40220FF28001E3 +:2002E0002046BDE8104000F0DDBEB1F51A4F4FF4007206D3DFF820182046BDE8104000F021 +:20030000D1BE00212046BDE8104000F0C1BE00007B00380031004200320031003700330070 +:2003200033002D0036003800440039002D0034003000350039002D00410035003700330066 +:200340002D004500410030004400320033003200450039003300320031007D00000000004E +:200360002E202020202020202020203200478A5A7945794500008A5A794504000000000090 +:200380002E2E2020202020202020201000478A5A7945794500008A5A794500000000000088 +:2003A0002DE9F84F2024DFF85C672AE0522805D1697A442902D1A97A592921D0552805D19C +:2003C000697A532902D1A97A452919D0452805D1697A522902D1A97A522911D04E2805D132 +:2003E000687A4F2802D1A87A542809D04520287252206872A872DFF8080780680321017290 +:020000040800F2 +:200400002034B4F5007F80F21381A01900F20045002028732878E528F2D00028F0D0E87AF6 +:200420002028EDD1287A482836D1697A452933D1A97A582930D1DFF8C876A87EE97E00EB16 +:2004400001200005000D38804FF47A7000F03AFEB8680021C171017A002904D002290FD067 +:20046000042907D012E052212972442169725921A9720BE04521297252216972A97205E069 +:200480004E2129724F2169725421A972E97D491CE97503210172B3E741287BD1697A442918 +:2004A00078D1A97A522975D1DFF85476A87EE97E00EB01200005000D38804FF47A7000F0EE +:2004C00001FED7F80880002088F8070088F80800D7F80490C9F800004FF0020A07E098F8B1 +:2004E000080040F0040088F808000AF1010ABAF10A0F27DA96F800063028F0D196F801062B +:200500007828ECD10AEB060090F80016A1F13002D2B20A2A08D3A1F14102D2B2062A03D32F +:200520006139C9B20629DAD2D9F800100901C9F800108B4690F8000600F024FA5844C9F845 +:200540000000D2E798F8080000281AD1D9F80000DFF8C815884203D300F025FD002806D101 +:200560004E2028724F2068725420A8720EE0B8680121C17153202872452068725420A87260 +:2005800004E04520287252206872A872B8680321017235E7422830D1697A49292DD1A97A5E +:2005A0004E292AD1DFF85875A87EE97E00EB01200005000D38804FF47A7000F083FDB86805 +:2005C000C179002906D14E2129724F2169725421A97205E052212972442169725921A97234 +:2005E000C179022901D10021C171C179012901D10221C1710321017202E753287FF4D6AEF4 +:20060000697A45297FF4D2AEA97A54297FF4CEAEDFF8EC74B868C17900297FF4F1AE5521C5 +:200620002972532169724521A97203210172E7E6BDE8F18F10B5DFF8C844A068007A032871 +:200640001ED100F04AFE0028FBD1002000F047FD4FF4C87000F036FD012000F040FD00F04F +:2006600049FEA068002101724171616800224A61CA6011462180C179022901D11146C1716D +:2006800010BD00002DE9F843DFF8744460680021016106E0A0680021417160680169491C0A +:2006A000016166683069B0F5007F80F04181A56869790E29F1D8DFE801F0091221313E5376 +:2006C00060768299A7C5D3E0EA00E6E7DFF83414401890F800063A2840F02881D3E0DFF889 +:2006E0002414401890F8000600F04CF90001A870002070616879401C6871CEE7AE78DFF8D5 +:200700000414401890F8000600F03CF98019A870A878E8706879401C6871BEE7DFF8E41304 +:20072000401890F8000600F02DF9000170606879401C6871B1E77768DFF8C813401890F8CD +:20074000000600F01FF9C0197060E87871680818E8707068000270606879401C68719CE7EE +:20076000DFF8A013401890F8000600F00BF9000128716879401C68718FE72F79DFF88413D9 +:20078000401890F8000600F0FDF8C01928717068297908187060E87829790818E870687957 +:2007A000401C687179E7D749401890F8000600F0E9F8000168706879401C68716DE76E78A4 +:2007C000D049401890F8000600F0DCF880196870E87869780818E8706879401C6871A978F5 +:2007E00000297FF45AAF801C687156E7C549401890F8000600F0C6F800017169E2688854FF +:020000040800F2 +:200800006879401C687148E77769D4F80C8017F80890BC49401890F8000600F0B3F84844A2 +:2008200007F80800E878716911F808100818E8707069401C7061A978884224D26879401EB8 +:2008400068712AE7EE78AF49401890F8000600F099F806EB0010E8706879401C68711CE777 +:20086000EE78A849401890F8000600F08BF88019E870E878002859D105E0A249401890F875 +:2008800000060D2852D16879401C687105E79D49401890F800060A2848D10020E871687888 +:2008A000042809D1D4F80C8098F8000098F80110090401EB0060B0606878012838D0002807 +:2008C0007FF4E8AE7068B168081870609349884201D202202DE00020706103E06068416940 +:2008E000891C416160684169A26892789142BFF4D1AE4068081800F01EFD60684169E26897 +:200900008B5C406808184D1CA668B678B54204D143F47F4100F0FEFC06E08918497803EBA0 +:20092000012189B200F0F6FC0428D7D0042000E00020BDE8F28338B50024714D00E0A41CF8 +:20094000B4F5007F1CD268680168C068401800F0F2FC68686B49611891F8002691F801169E +:2009600002EB012189B20268C068801800F0D2FC6968CA68921CCA600428E0D0042032BD7B +:20098000002032BD10B585B0044600A80FF2D411112200F0F5FCA4F16100C0B21A2800D2E6 +:2009A000203C002000E0401CC0B2102805D200A9415CE4B2A142F6D100E0002005B010BDF6 +:2009C00038B54F4CA2681378002B05D1400260614802A061012010701078012833D12569C7 +:2009E0006068806900280FD161692846FFF71BFC40229821284600F0EEFC60684FF4E0713A +:200A000081614020E0610CE040229821E069401900F0E1FC6068816940398161E069403017 +:200A2000E0614021012000F09FFD3021012000F00BFD606940306061A0694038A061384801 +:200A4000816840398160A06900280BD16068002181610846E0616061324803210170A06814 +:200A60000021017031BD70B5254C6268D3694033A5682E78002E05D1400220624802606260 +:200A8000012028702878012827D1002007E02569254E865D4E55401CD169491CD161D169E7 +:200AA0009942F4D3214D2888216A41182162636A181A6062C00506D10020D061A1F500715A +:200AC0002069FFF749FB164881682A88891A81604FF44051022000F0CBFC606A002803D064 +:200AE00010480078042809D160680021C1610121002000F0B7FEA0680021017070BD000067 +:200B0000000000201C040020188DDD40D80E00081C0600201C0800201C0A002000400008B1 +:200B2000EC2C0020B82C0020582C0020BA2C002010B41C2203E0303300F8013B121F1346C9 +:200B40005BB2002B0AD421FA02F303F00F031C460A2CF0DB373300F8013BEFE70021017001 +:200B600010BC70473031323334353637383941424344454600000000EB3C904D53444F5313 +:200B8000352E3000020108000200020010F80C00010001000000000000000000000029A2D2 +:200BA00098E46C4E4F204E414D4520202020464154313220202033C98ED1BCF07B8ED9B8B0 +:200BC00000208EC0FCBD007C384E247D248BC199E83C01721C83EB3A66A11C7C26663B077A +:200BE000268A57FC750680CA0288560280C31073EB33C98A461098F7661603461C13561EC7 +:020000040800F2 +:200C000003460E13D18B7611608946FC8956FEB82000F7E68B5E0B03C348F7F30146FC118A +:200C20004EFE61BF0000E8E600723926382D741760B10BBEA17DF3A66174324E740983C70C +:200C4000203BFB72E6EBDCA0FB7DB47D8BF0AC9840740C487413B40EBB0700CD10EBEFA0AD +:200C6000FD7DEBE6A0FC7DEBE1CD16CD19268B551A52B001BB0000E83B0072E85B8A5624C1 +:200C8000BE0B7C8BFCC746F03D7DC746F4297D8CD9894EF2894EF6C606967DCBEA03000098 +:200CA000200FB6C8668B46F86603461C668BD066C1EA10EB5E0FB6C84A4A8A460D32E4F757 +:200CC000E20346FC1356FEEB4A525006536A016A10918B4618969233D2F7F691F7F6428796 +:200CE000CAF7761A8AF28AE8C0CC020ACCB80102807E020E7504B4428BF48A5624CD136155 +:200D000061720B40750142035E0B497506F8C341BB000060666A00EBB04E544C4452202087 +:200D2000202020200D0A52656D6F7665206469736B73206F72206F74686572206D6564696E +:200D4000612EFF0D0A4469736B206572726F72FF0D0A507265737320616E79206B65792005 +:200D6000746F20726573746172740D0A00000000000000ACCBD855AA4446552056335F34EB +:200D8000325F4408000000000000000000008A5A794500000000000042200049006E006655 +:200DA000006F000F007272006D006100740069006F0000006E000000015300790073007495 +:200DC0000065000F00726D00200056006F006C00750000006D00650053595354454D7E3194 +:200DE00020202016005E63705D455D45000064705D45020000000000412E005F002E005440 +:200E00000072000F007F6100730068006500730000000000FFFFFFFF7E3120202020202053 +:200E200054524122004A8A5A7945794500008A5A7945050000100000E552415348457E3141 +:200E400045464D1200478A5A7945794500008A5A7945040000000000412E005400720061C5 +:200E60000073000F00256800650073000000FFFFFFFF0000FFFFFFFF5452415348457E311D +:200E80002020201200478A5A7945794500008A5A7945040000000000412E006600730065E6 +:200EA0000076000F00DA65006E0074007300640000000000FFFFFFFF46534556454E7E3143 +:200EC00020202012004D8A5A7945794500008A5A79450D00000000002E2020202020202036 +:200EE00020202010005E63705D455D45000064705D450200000000002E2E20202020202079 +:200F000020202010005E63705D455D45000064705D450000000000004247007500690064AB +:200F20000000000F00FFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFF0149006E0064006532 +:200F40000078000F00FF6500720056006F006C00750000006D006500494E444558457E3150 +:200F600020202020007263705D455D45000064705D4503004C00000041480168426851189E +:200F800080684018704710B50446FFF7F5FF0A233C4A01463C4800F017F8844201D101202B +:200FA00010BD002010BD10B5FFF7E6FF37490C680A23344A0146344800F006F8844201D1EF +:200FC000012010BD002010BDF0B403F11506C3F14304C3F151050A330FE0C0EB40104FEA1E +:200FE000670C07EB9C7C4FEAAC0CA7EB8C07FF0021FA07F7FFB238185B1C1BB21F46B742A3 +:020000040800F2 +:20100000EBDB0DE0C0EB40104B1001EB93739B10A1EB8301C90022FA01F1C9B20818641C28 +:2010200024B22146A942EDDBF0BC704770B504460D461646FFF7B7FF002801D1002070BD4C +:20104000FFF79AFF0023324601462046FFF7BCFF854201D1012070BD002070BD70B5044665 +:201060000D461646FFF79FFF002801D1002070BD0023324629462046BDE87040A4E7000096 +:20108000E8F7FF1F011020D502DEC0DEFC3F000810B5044610460A460146204600F03EFC00 +:2010A000204610BD10B5044600F05AF9204610BD0FF27C11082802D201EB0010704701F141 +:2010C0008000704700214FF6FF7302E04F4A1360491C40F2DC5242439142F7D370474C49E0 +:2010E0004FF400620A614FF480520A61002808680BD120F4404040F440500860086820F4A8 +:20110000402040F440300860704720F4804040F430400860086820F4802040F430200860BC +:201120007047000080F308887047704710B500F029FC4FF4803000F03DFC00F055FC102020 +:2011400000F0BCFC022000F0AFFC324C6068324908436060206840F080702060012000F025 +:201160005CFC012000F05CFC392000F076FC0028FAD0022000F057FC00F05CFC0828FBD158 +:201180001420606140F60D20A0614FF42000E0610120BDE8104000F052BC80B501464FF083 +:2011A000006000F05DFD4FF4C06000F013FD14208DF8000001208DF801008DF802008DF8B6 +:2011C000030000A800F00BFD13208DF8000001208DF8010000208DF8020001208DF80300BD +:2011E00000A800F0FCFC01BD0C484FF6FF71C1600B4901600B4941600B484FF6FE71C160A5 +:201200000A4901604FF08831416070470C10014004080140001002400A846800000801408F +:201220008888880883B8BB8B000C014003888344312E33300000000000000000000000002C +:2012400053544D3332463130335438000000000056474D393631360000000000000000000F +:201260004D4355277320414443000000000000004E6F6E6500000000000000000000000077 +:2012800056332E3432410000000000000000000030000000000000000000000000000000C0 +:2012A0005669727475616C204D534400000000002D2D2D2D2D2D0000000000000000000035 +:2012C0000A48012101600021016041604FF4E051074A1180016000207047044801210160B9 +:2012E000002141600321016000207047405C0040222D00200448C0610221017203490162D3 +:20130000034A426208680047C42C00200C0300206403002038B504460D46104800F03AFC57 +:20132000052802D0342000F014FC29462046BDE8344000F0F5BB10B50446A0050CD10748EC +:2013400000F028FC052802D0342000F002FC2046BDE8104000F0C5BB10BD0000A086010079 +:2013600062B38B0708D0521E11F8013B00F8013B00F024808B07F6D1830740F0208000BFFF +:20138000103A07D330B4B1E83810103AA0E83810F9D230BC530724BFB1E80810A0E8081005 +:2013A00044BF51F8043B40F8043BD20724BF31F8022B20F8022B44BF0B7803707047083AE2 +:2013C00007D3B1E80810083A40F8043B40F804CBF7D25307E4E710B4490001F1804101F51E +:2013E000C041521C521009E010F8013B10F8014B43EA042321F8023B891C521EF4D110BC4B +:020000040800F2 +:201400007047490001F1804101F5C041521C521004E051F8043B20F8023B521EF9D17047A0 +:201420004FF6F8710840DFF8A4110860704710B4DFF89C2152F8203048F68F142340194379 +:2014400042F8201010BC704710B4DFF8842152F8203048F6BF742340CC0601D583F01003C3 +:20146000890601D583F0200342F8203010BC704710B4DFF85C2152F820304BF68F7423400B +:20148000CC0401D583F48053890401D583F4005342F8203010BC7047DFF8341151F820207D +:2014A0004BF68F731A4082F4405241F820207047DFF81C1151F8202048F68F631A4041F807 +:2014C00020207047DFF8081151F82020520409D551F8202092B248F68F731A4042F4804209 +:2014E00041F820207047DFF8E81051F82020520609D551F8202092B248F68F731A4042F095 +:20150000400241F820207047DFF8C020126892B202EBC000DFF8BC204908490042F8101090 +:201520007047DFF8A820126892B202EBC000DFF8A8204908490042F810107047DFF88C102D +:20154000096889B201EBC000DFF8881051F8100080B270471D49096889B201EBC0001E495D +:2015600051F8100080B27047184A126892B202EBC0001A4A42F810107047144A126892B2CB +:2015800002EBC000164A02EB40003F290AD34A091F23194200D1521E92B2910241F400414E +:2015A000016070474A08C90700D5521C92B29102016070470549096889B201EBC0000849C8 +:2015C00051F810008005800D70470000505C0040005C004000600040086000400460004075 +:2015E0000C6000400146C9B2090241EA1020704780B5AC4890F8201002290FD022D3042953 +:2016000002D014D305291DD1002180F820104FF440510220BDE80440FFF72ABFC17B2829E1 +:2016200010D1816A406ABDE8044000F073BB0121002000F017F94FF440510220BDE804400C +:20164000FFF716BF01BD38B5964CE57B0220FFF7B1FF60840246D8219348FFF7D2FE94F8B8 +:201660002000002802D0012803D016E0BDE831401FE02A2D05D1A16A606ABDE8344000F03E +:2016800078BB012000F01AF92421052000F03AFB00210220BDE83440E4E0022000F00EF92B +:2016A0002421052000F02EFB00210220BDE83440D8E010B500207B4C03E07B49415C01554D +:2016C000401C618C8842F8D3784862684260A26882601F290DD0022000F0F0F80020206055 +:2016E0001A21052000F00EFB00210120BDE81040B8E0E07B282801D02A280FD1617CA27C19 +:20170000120442EA0161E27C41EA0221227D11436162A17DE27D42EA0121A1622168644ABE +:2017200091427AD163490968627B914204D3A17B491EC9B210290BD3022000F0BFF82421C4 +:20174000052000F0DFFA00210120BDE8104089E000284AD003282CD008285AD00A2858D0DE +:2017600012282AD0152854D01A282ED01B2828D01D284ED01E2824D023282ED0252830D026 +:20178000282836D02A283AD02F283ED0552840D05A281ED088283CD08A283AD08F2838D0FE +:2017A0009E2836D0A82834D0AA2832D0AF2830D033E0BDE8104000F09DBABDE8104000F0AA +:2017C00063BABDE8104000F0A1BABDE8104000F089BABDE8104000F089BABDE8104000F077 +:2017E00062BABDE8104000F06DBABDE8104000F008BBA16A606ABDE8104000F08BBAA16A0F +:020000040800F2 +:20180000606ABDE8104000F0B4BABDE8104000F0DDBABDE8104000F0F8BA022000F04EF840 +:201820002021052000F06EFA00210120BDE8104018E010B50C4622469821FFF7CCFD21465D +:201840000120FFF791FE30210120FFF7FDFD1548032180F8201015488168091B81600021EB +:20186000017310BD10B50C46104B1349196018730D2298211846FFF7AEFD0D210120FFF729 +:2018800073FE0848052180F82010002C08D0042180F8201030210120BDE81040FFF7D4BDFA +:2018A00010BD0000982C0020582C0020EC2C002055534243102D00205553425380B5002877 +:2018C00003D002280ED006D301BD10210120BDE80440FFF7B9BD4FF480510220BDE80440D0 +:2018E000FFF7C6BD10210120FFF7AEFD4FF480510220BDE80440FFF7BBBD50F8041B61B176 +:2019000050F8042BD30744BFA9F101039A18002342F8043B091FFAD1EFE7704762F30F2281 +:2019200062F31F42401810F0030308D0C91A1FD3DB0748BF00F8012D28BF20F8022D130096 +:2019400030B414461546103928BF20E93C00FAD8490728BF20E90C0048BF40F8042D890062 +:2019600028BF20F8022D48BF00F8012D30BC7047C91818BF00F8012DCB0728BF00F8012DAC +:20198000704700004048016841F00101016041683E4A1140416001683D4A114001600168DD +:2019A00021F480210160416821F4FE01416000218160704734490A6822F480320A600A6866 +:2019C00022F480220A60B0F5803F03D0B0F5802F05D07047086840F48030086070470868EB +:2019E00040F4A0200860704710B582B0002000900446312000F031F80099491C00910028C2 +:201A000003D10098B0F5A06FF3D1312000F025F8002800D00124204616BD1E4908607047A8 +:201A20001E49086070471C490A68920850EA8200086070471848006800F00C0070471849F8 +:201A400008607047174A0029116802D008431060704721EA000010607047002142090A4B2D +:201A6000012A01D11A6804E0022A01D11A6A00E05A6A012300F01F0003FA00F0024200D0A9 +:201A80001946084670470000001002400000FFF8FFFFF6FE000042420410024060004242E9 +:201AA000D800424218100240DFF8D0100A6802F038020A600A68104308607047DFF8BC101A +:201AC0000A6822F010020A600A68104308607047DFF8AC00DFF8AC100160DFF8AC100160B7 +:201AE000704770B5054640F6FF76304600F052F8042814D1DFF89440206840F0020020606E +:201B00006560206840F040002060304600F042F8012804D0216841F6FD721140216070BDBD +:201B200070B504460D460F2000F034F804280FD1164E306840F00100306025800F2000F00B +:201B400029F8012804D0316841F6FE721140316070BD0F490860704704200D490A68D207DC +:201B600001D5012070470A68520701D5022070470968C90600D503207047000000200240EC +:201B80000420024023016745AB89EFCD102002400C20024010B50446FFF7DEFF04E000F089 +:201BA0000BF8FFF7D9FF641E012801D1002CF6D1002C00D1052010BD81B000200090FF20F5 +:201BC000009002E00098401E009000980028F9D101B07047274908432749086070472DE9BB +:201BE000F04105782B460121C278002A2FD0224A126802F4E062C2F5E062120A23F00303F5 +:020000040800F2 +:201C00001B4C1F5905F00305ED00FF26AE40B74390F801C0C2F1040E0CFA0EFC90F802E066 +:201C20004FF00F0828FA02F202EA0E0242EA0C021201AA4032403A431A51007842110F4B86 +:201C400000F01F0001FA00F043F8220006E05811064A05F01F03994042F82010BDE8F0811E +:201C6000074A1140084307490860704780E100E000E400E00000FA050CED00E000E100E06A +:201C800080FFFF1F08ED00E08749087CC00702D58648052105E00FF23020C97C252900D350 +:201CA0002421FFF7C6BD824800218180022181710021C1714172022181720021C1720C21C8 +:201CC000FFF7B7BD7B48002101800F218170FF21C17000218180022181710021C171082110 +:201CE000FFF7A7BD04217448FFF7A3BD08217348FFF79FBD6C48C17C132900D31221704832 +:201D0000FFF797BD6E4A90701173704701210020FFF7A8BD70B504460D466A4E307800289F +:201D20001FD12A462146282000F08CF800281FD05D48007B000607D5022030702946204670 +:201D4000BDE87040FEF73CBE0220FFF7B7FD24210520FFF7D7FF01210846BDE87040FFF782 +:201D600081BD022804D12046BDE87040FEF728BE70BD10B5534C2278002A20D10A460146B3 +:201D80002A2000F05FF800281FD04748007B000608D4012020704FF440510220BDE8104013 +:201DA000FFF766BB0020FFF789FD24210520FFF7A9FF00210120BDE81040FFF753BD012A00 +:201DC00003D1BDE81040FEF74EBE10BD80B536488168002908D1007C400705D401210020F0 +:201DE000BDE80440FFF73EBD0220FFF767FD24210520FFF787FF00210120BDE80440FFF786 +:201E000031BD01210020FFF72DBD80B526488168002903D10020FFF751FD09E0007B00065B +:201E200003D50020FFF74AFD02E00220FFF746FD20210520FFF766FF00210120BDE8044044 +:201E4000FFF710BD80B55118B1F5805F11D92A2802D10220FFF732FD0020FFF72FFD2121C2 +:201E60000520FFF74FFF00210120FFF7FBFC002002BD0D498968B1EB422F12D02A2803D18F +:201E80000220FFF71BFD02E00020FFF717FD24210520FFF737FF00210120FFF7E3FC002039 +:201EA00002BD012002BD0000982C0020FC2C0020F0030020042D0020180400200C04002087 +:201EC000DC030020B82C002000800202200000005669727475616C20444655204469736BCA +:201EE00000000000000000000000000010B5DFF8C047002804D1206801210182002010BD28 +:201F0000DFF8B00700680068804720680A3010BD80B5DFF89C070068C178DFF89C27527859 +:201F20008A420DD38278002A0AD18288002A07D18172DFF88007006840688047002002BDE3 +:201F4000022002BD10B5DFF86847002804D1206801210182002010BDDFF8580700688068B8 +:201F6000804720680C3010BD10B5DFF844472068C1784079DFF84427126892699047216851 +:201F80008A7A002A14D0002812D1087900280FD1887800280CD1DFF81C070068C068804745 +:201FA00020684179C1722068C1780173002010BD022010BD10B5DFF8F8160968002803D184 +:201FC00002200882002010BDDFF8F4460020208008787F22104218D1487A0146890603D5CB +:201FE000002141F0020121702178400609D541F001002070DFF8BC060068006980472046E5 +:020000040800F2 +:2020000010BD01F0FE002070F4E700F07F02012A01D1204610BD00F07F0002281BD14879B2 +:2020200000F00F01DFF89C26000652F8210008D500F030001028DDD1002040F001002070D2 +:20204000D8E700F44050B0F5805FD3D1002040F001002070CEE7002010BD70B5DFF8500640 +:202060000068017811F07F0105D1417A01F0DF014172002070BD022954D14188002951D138 +:20208000017900294ED1417921F08005DFF834460A0654F8252002D502F0300201E002F46A +:2020A0004052DFF814361B789D423BD2002A39D0807A002836D0080654F825000BD500F044 +:2020C0003000102827D12846FFF70DFA30212846FFF7BAF91FE000F44050B0F5805F1AD1DB +:2020E0004BF68F76002D0CD1DFF8DC0590F82C100020FFF742FA2068304080F44050206046 +:2021000009E02846FFF7DEF954F82500304080F4405044F82500DFF89C0500684069804705 +:20212000002070BD022070BD38B5DFF884050268537923F08000DFF88C151C0651F82040AA +:2021400002D504F0300401E004F44054DFF868552D78A84207D25588002D04D1002C02D03A +:20216000927A002A01D1022032BD1A0651F8202007D548F6BF731A4082F0100241F82020FA +:2021800006E04BF68F731A4082F4805241F82020DFF82005006880698047002032BD80B5A3 +:2021A000DFF80C050068417A41F020014172DFF804050068C0698047002002BDDFF8F0240D +:2021C0001268538A002804D18888C01A108200207047086818187047F8B5DFF8D4442068DD +:2021E00000F110052E88A968080016D0002E14D0A888864200D906463046884707462888B3 +:20220000801B28806888301868800020FFF7A2F9324601463846FFF7F4F8288800280CD0D7 +:20222000DFF8A8044FF44051018000210846FFF79BF9DFF89C04302101802888A9888842D9 +:2022400003D3206803210172F1BD002803D0206805210172F1BD0FD1206806210172DFF838 +:202260007404006880B2DFF87014002241F81020DFF85C0430210180F1BD2DE9F041DFF891 +:202280003044206800F110052F88002F08D1007A042805D10726DFF838041021018027E008 +:2022A000A888B84201D3042600E00226874200D907463846A968884780460020FFF73EF98E +:2022C0003A4601464046FFF786F839460020FFF74BF92888C01B2880688838186880DFF832 +:2022E000F00330210180DFF8E4034FF44051018020680672BDE8F08138B50220DFF8B04317 +:2023000021684D780A787F231A4230D1092D02D1FFF7FEFD3FE0052D0FD1C878802808D201 +:202320008878002805D18888002802D1887A002801D008204AE000202DE0032D0BD1CA78CC +:20234000012A28D18A88002A25D1497A890622D5FFF725FF1FE0012D1DD1CA78012A1AD151 +:202360008A88002A17D1497A89060DD413E002F07F01012904D10B2D0DD1FFF7F5FD0AE0BA +:20238000022908D1012D02D1FFF767FE03E0032D01D1FFF7C9FE002809D02846DFF81C13C6 +:2023A000096849698847032801D109200EE0002801D008200AE00620C649096889B2C64A1B +:2023C000002342F81130C24930220A802168087231BD38B5B64C206841780025062916D11C +:2023E00001787F22114279D18078012803D1B3480068C56972E0022803D1B0480068056A81 +:020000040800F2 +:202400006CE003286AD1AD480068456A66E0002940D14288002A3DD1C288022A3AD1027980 +:20242000002A37D101787F22114204D18288002A01D1AA4D52E001F07F02012A0DD129460F +:2024400040799E4A126892699047002846D12068807A002842D0A14D40E001F07F010229EA +:202460003CD1407900F00F0100F07002954B000653F8210002D500F0300001E000F4405086 +:202480008D4B1B78994229D2002A27D1002825D0924D23E0082905D100787F2108421DD183 +:2024A0008F4D1BE00A2919D1017801F07F01012914D1817A002911D0418800290ED10179DF +:2024C00000290BD1C188012908D1294640797B4A126892699047002800D1824D20682900F9 +:2024E00007D000214182206885610846A847002006E040787149096809698847032805D04C +:2025000021680A8A4FF6FF739A4203D120680921017231BD022801D0002A02D1082008728A +:2025200031BD087800060CD5C888904200D2088220686249096891F82C108182BDE8314046 +:202540009BE60320087261484FF44051018031BD38B56048006880B2634931F8100040001D +:2025600000F1804505F5C045514C2068017A092917D015F8011B0170206815F8011B4170F1 +:20258000AD1C35F8020BFFF72DF821684880AD1C35F8020BFFF726F82168888020686988AB +:2025A000C1802068012101722068C088002802D1FFF7A2FE01E0FFF70CFFBDE8314042E042 +:2025C00010B53B4C2068017A022901D0042904D1FFF753FE2068007A16E0062913D14178A3 +:2025E00005290AD101787F22114206D1C07800F044F830480068006A804730480068806851 +:202600008047082000E0082021680872BDE8104019E010B5264C2068007A032801D0052870 +:2026200004D1FFF7D9FD2068007A08E0072805D122480068C0688047082000E00820216890 +:202640000872BDE8104080B51F4890F82C100020FEF793FF16480068017A082906D11B4957 +:202660004FF480520A801A4910220A80007A092801D1012002BD002002BD70B40E49097864 +:202680000022104C48F68F7609E01346DBB254F82350ADB235401D4344F82350521C8A42CE +:2026A000F3D340F080001149086070BC70470000E02C0020E82C002014040020E42C002037 +:2026C000182D0020005C00400C0300201C2D00201E2D0020505C004004600040B51F00088A +:2026E000ED1E0008451F0008086000404C5C004070470000F8B58478303CE4B20A2C00D261 +:202700002246C478303CE4B20A2C00D2234600783038C0B20A2800D20146002413E02018B6 +:202720000FF2C415182606FB01477F5D80F8607006FB02477F5D80F8907006FB0346755D5A +:2027400080F8A850641C5548182CE8DB002409E00C220146204600EB40039800C0B200F0D5 +:2027600004F8641C082CF3DBF1BD70B50C46154600F1200600213046C0B200F054F86D1C76 +:2027800021462846C0B200F03DF8044601213046C0B200F048F821462846C0B2BDE87040AD +:2027A00030E04049086040483C2202700968C9B23B4800F0D1B910B58CB000A80FF2F0013C +:2027C0003022FEF7DDFD0020354903E000AA825C4254401C2E28F9DB344C4FF48071204699 +:2027E00000F02BFA0220FEF76DFC4FF48071204600F021FA0220FEF765FC2E20FFF7D1FF13 +:020000040800F2 +:202800000CB010BD10B50C46254940220A70012203E014F8013B5354521C8242F9DBFFF7DD +:20282000C0FF204610BD30B583B000AA0FF2B00330CB30C28DF80500012902D1B1208DF866 +:2028400001000020164903E000AA825C4254401C0828F9DB0820FFF7A4FF37BD10B50021FC +:202860002020FFF7E0FF0E4C402020707F220021601CFEF70DFC8020FFF793FF0121202033 +:20288000FFF7D1FF402020707F220021601CFEF7FFFB8020BDE8104083E700003402002000 +:2028A0001C2400200C2D0020242D00200008014080AE80D5805280A8800F80C080D3800086 +:2028C000804080A0808D801480DA8002808180E080D980F180DB803080A480A680AF0000EC +:2028E00080B080218020807F00E010080810E00000000000000F102020100F0000000000FA +:20290000001010F800000000000000000020203F2020000000000000007008080888700060 +:20292000000000000030282422213000000000000030088888483000000000000018202090 +:2029400020110E00000000000000C02010F800000000000000070424243F2400000000009A +:2029600000F8088888080800000000000019212020110E000000000000E010888818000086 +:2029800000000000000F112020110E000000000000380808C8380800000000000000003F29 +:2029A0000000000000000000007088080888700000000000001C222121221C000000000059 +:2029C00000E010080810E000000000000000312222110F0000000000000000000000000072 +:2029E00000000000003030000000000000000000022000E0401EFDD1704738B504460D4608 +:202A0000012D03D12146534800F015F9002D05D121465048BDE8344000F00FB931BD80B5BE +:202A200001210820FFF70EF8C020ADF8000014208DF8030003208DF8020000A9454800F03F +:202A4000A3F800214020FFF7D8FF01218020FFF7D4FF01214020FFF7D0FF0520FFF7C8FFD9 +:202A600000218020FFF7C9FF0520FFF7C1FF00214020FFF7C2FF01BD80B500214020FFF75A +:202A8000BCFF00218020FFF7B8FF0520FFF7B0FF01214020FFF7B1FF0520FFF7A9FF012136 +:202AA0008020FFF7AAFF0520FFF7A2FF00214020FFF7A3FF0520BDE8024099E738B504463F +:202AC00008250EE000218020FFF797FF0520FFF78FFF01214020FFF790FF0520FFF788FF3C +:202AE00064002846451EC0B200280AD000214020FFF783FF2006E5D501218020FFF77DFF20 +:202B0000E4E700214020FFF778FF01218020FFF774FFFF2400E0641EE4B2002C18D005207D +:202B2000FFF766FF80210B4800F07EF80028F2D101214020FFF761FF0520FFF759FF002189 +:202B40004020FFF75AFF0520FFF752FF012032BD002032BD000C014070B504460D461646D0 +:202B6000FFF75DFF7000C0B2FFF7A8FF03E014F8010BFFF7A3FF2846451EC0B20028F6D1BF +:202B8000BDE8704078E70000F0B40023CC7804F00F02E40601D58C7822430C88E4B2002CF2 +:202BA0001CD0046803E0482D00D106615B1C082B13D2012505FA03F635460F882F40AF420E +:202BC000F4D19D000F27AF40BC4302FA05F52C43CD78282DE7D14661E8E704600B88B3F5A3 +:202BE000807F1FD34468002319E0012503F1080605FA06F635460F882F40AF420ED19D000B +:020000040800F2 +:202C00000F27AF40BC4302FA05F52C43CD78282D00D14661CD78482D00D106615B1C082B7D +:202C2000E3D34460F0BC704700228068084200D00122104670470161704741617047000011 +:202C400080B500F007F99348006800218172FEF737FB9148002141604FF404418F4A118044 +:202C600001608F480021016001BD10B58D4800218172884800688C49C97941720020FEF717 +:202C8000CFFB4FF400710020FEF7D1FB20210020FEF7DAFB18210020FEF743FC834C94F8C2 +:202CA0002C100020FEF769FC58210020FEF72CFC0020FEF7FDFB0020FEF7EEFB002101205B +:202CC000FEF7B5FB98210120FEF71EFC20210120FEF7BAFB00210120FEF7CAFB002102201B +:202CE000FEF7A5FBD8210220FEF71BFC94F82C100220FEF742FC4FF440510220FEF7B8FB5D +:202D000000210220FEF7A0FB94F82C100020FEF734FC0020FEF7C0FB0020FFF7AEFC60489B +:202D20000121016062486349016063480021017010BD58480068807A002800D1704780B568 +:202D40005748052101600120FEF7CDFB0220FEF7B9FB59480021017001BD55480068554910 +:202D6000884202D00220FEF7A9BD70474C480421016070477047704780B546490A68137883 +:202D800003F07F03212B10D1FE280ED1508800280BD19088002808D1D088012805D10FF23F +:202DA000A100030003D1022002BD022002BD9061086800214182084600F042F8002002BD3D +:202DC00080B5344909680A7802F07F02212A18D1FF2816D14888002813D18888002810D1A4 +:202DE000C88800280DD10120FEF77DFB0220FEF769FB2F482F4901602F48002101700846CD +:202E000002BD022002BD002901D002207047002801D002207047002070472849FFF7CEB9A8 +:202E20002749FFF7CBB91B490968C978062901DB00207047234A02EBC101FFF7BFB9000026 +:202E4000002805D11348006801210182002070471D4870471D48016842688068002900D1BF +:202E6000704710B41A4B99700C0A1C710C0C9C71090E19729A72110A1973110C9973110E04 +:202E800019749874010A1975010C9975000E187610BC7047E02C0020405C0040222D00204F +:202EA000142D0020C42C0020703100080C030020982C002055534243B82C0020FC03002095 +:202EC000040400203C030020102D0020E8F7FF1F880300202DE9F0416F4C48F6BF764BF6B0 +:202EE0008F7721E05FEA084006D5206840F68F7108402060FFF78DFB206838402988CA04DC +:202F000001D580F48050890401D580F400502060206830406988CA0601D580F01000890652 +:202F200001D580F020002060616C5C480180090478D547F6FF716164018811F00F01584DAE +:202F4000297046D1574D216801F440512980216801F0300169802168394081F40051216088 +:202F60002168314081F0200121600088C00616D4206880B248F60F7108402060FFF720FBBB +:202F8000D4F800801FFA88F818F4084FB4D0206840F68F7108402060FFF7DAFAACE7D4F8B6 +:202FA00000801FFA88F85FEA086007D5206880B248F60F7108402060FFF702FB5FEA085097 +:202FC00090D5206840F68F7108402060FFF7C0FA92E754F821801FFA88F85FEA08400DD5E4 +:202FE00054F8210040F68F72104044F8210028782D4901EB800050F8040C80475FEA08602E +:020000040800F2 +:2030000092D5287854F8201089B248F60F72114044F820102878254901EB800050F8040CA4 +:20302000804781E7BDE8F08170B51D4C1A4D2BE047F6FF720260088800F00F00207055F8CF +:203040002060B6B231040DD555F8201040F68F72114045F820102078134901EB800050F857 +:20306000040C804730060FD5207855F8201089B248F60F72114045F8201020780B4901EBBA +:20308000800050F8040C80470948026803490A801204CDD470BD0000005C0040202D002013 +:2030A000252D00201C2D0020C0030020A4030020445C00402DE9F04500F10801026801EB10 +:2030C0008202406800F001034008400002EB80000025AA460024A0460126374602E000270F +:2030E000F44511D1824201D1BDE8F08552F804CB03B1CC4452F804EBE644F1E70D686D18F3 +:20310000091D51F804ABAA445545F7D066B115F9014B0026012705E00D686D18091D51F835 +:2031200004ABAA445545F7D0002C12D50FB115F8018BF445D3D00CF8018B641CF9D40AE082 +:20314000F44518BF5545CBD015F8018B0CF8018B641E002CF4D50126C2E7000012010002A5 +:203160000000004083042057000201020301000009022000010100C03209040000020806CC +:2031800050040705810240000007050202400000040309042603530054004D0069006300BF +:2031A00072006F0065006C0065006300740072006F006E0069006300730000002603530017 +:2031C00054004D003300320020004D006100730073002000530074006F00720061006700A5 +:2031E0006500000010035300540020004D00610073007300FDF79AFFFDF7F6FF1A480068BC +:2032000080050ED5FDF7CFFE18480168184A1140B1F1005F04D144680068FDF783FFA047C2 +:20322000FEE70A20FDF74EFF0020FDF758FFC820FDF748FF0120FDF752FF0020FDF7ADFF8A +:20324000FEF758F8FCF72AFFFFF7B5FAFFF706FB0FF22000FFF74EFAFEF73AFCFDF7A0F85B +:20326000FDF7E8F9F8E7000008080140004000080000FF2F332E34330000000070B50D4C8D +:203280000D4D286820800D4E208831880840400505D50B48406880474FF6FF30286020881B +:2032A00031880840000403D5BDE87040FFF712BE70BD0000202D0020445C0040222D00202D +:2032C0000C030020FEF794B9FEF7BDB910B5074979441831064C7C44163404E0081D0A6820 +:2032E000511888470146A142F8D110BD080000003000000007E6FFFF0C2900001C0400203E +:2033000000000000B1FDFFFF02000000020000009800000096010000000000201C0400008E +:2033200000F009F8002801D0FFF7D0FF0020FFF761FF00F002F80120704700F001B80000FD +:203340000746384600F002F8FBE70000C046C046024A11001820ABBEFBE700BF2600020003 +:2033600001488047014800472D11000871330008C046C046C046C046FFF7D2FFFFF7FEBF29 +:20338000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF95 +:2033A000FFF742BEFFF76ABFFC000F1C2C00203C2C0020452C00201C2A0020810081008183 +:2033C000008100DC000104FCFC04070C0810E00000407FFC40076020180F000004FCFB845C +:2033E00007E40C100000407F40FC000003FC000204FC04FB000604FC0400001F20FB400146 +:020000040800F2 +:20340000201FFA00016060F600016060F9000078FB04018878FC0007605048444241407018 +:20342000F000016060F60002E01808FD04020818E0FD00020F3020FD400220300FFB0002E7 +:203440000808FCF7000240407FFD40E50027412C00086B2C0008752D0008772D0008792D0F +:203460000008C12D0008072E00081B2E0008212E0008272E0008FC000040FD00049031000E +:203480000804FD00049431000826FD0004BC31000826FD0004880300201AFD0004E4310034 +:2034A0000810FD0032F1260008332D0008F1260008F1260008F12600085B2D0008F126003A +:2034C00008F12600086D2D00081A03530054004D0033003200310030F30038C5320008F131 +:2034E000260008F1260008F1260008F1260008F1260008F1260008F1260008C9320008F1F0 +:20350000260008F1260008F1260008F1260008F126000870FA00000AF1000008FC00000296 +:20352000FD00045C31000812FD00047031000820FC000006FA00040301000003FD00000015 +:20354000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:20356000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B +:20358000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B +:2035A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2B +:2035C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B +:2035E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB +:20360000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:20362000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:20364000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:20366000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:20368000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:2036A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A +:2036C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A +:2036E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA +:20370000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9 +:20372000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9 +:20374000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:20376000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:20378000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:2037A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:2037C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09 +:2037E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9 +:020000040800F2 +:20380000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8 +:20382000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA8 +:20384000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF88 +:20386000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:20388000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:2038A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:2038C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:2038E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:20390000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:20392000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:20394000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87 +:20396000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67 +:20398000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF47 +:2039A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:2039C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:2039E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:203A0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:203A2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:203A4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:203A6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:203A8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46 +:203AA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF26 +:203AC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:203AE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:203B0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:203B2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:203B4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:203B6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF65 +:203B8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:203BA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF25 +:203BC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF05 +:203BE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:020000040800F2 +:203C0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC4 +:203C2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:203C4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:203C6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:203C8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:203CA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 +:203CC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF04 +:203CE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE4 +:203D0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC3 +:203D2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3 +:203D4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:203D6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:203D8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:203DA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:203DC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:203DE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3 +:203E0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:203E2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2 +:203E4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:203E6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF62 +:203E8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42 +:203EA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:203EC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:203EE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:203F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:203F2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:203F4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:203F6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF61 +:203F8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:203FA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:203FC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:203FE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:020000040800F2 +:2040000098350020E1BA000881BA000883BA000885BA000887BA000889BA000800000000AD +:204020000000000000000000000000008BBA00088DBA0008000000008FBA000891BA000840 +:2040400021BB000825BB000829BB00082DBB000831BB000835BB000839BB00083DBB0008D0 +:2040600041BB000845BB000849BB00084DBB000851BB000855BB000859BB00085DBB0008B0 +:2040800061BB000865BB000869BB00086DBB000893BA000875BB000879BB00087DBB00086F +:2040A00081BB000885BB000889BB00088DBB000897BA00089BBA000899BB00089DBB000866 +:2040C000A1BB0008A5BB0008A9BB0008ADBB0008B1BB0008B5BB0008B9BB0008BDBB000850 +:2040E000C1BB0008C5BB0008C9BB0008CDBB0008D1BB0008D5BB0008D9BB0008DDBB000830 +:20410000E1BB0008E5BB0008E9BB0008EDBB0008F1BB0008F5BB0008F9BB0008FDBB00080F +:2041200001BC000805BC000809BC00080DBC0008DFF8240B40697047DFF81C1B486170477F +:20414000DFF8141B08707047DFF80C0B0078704738B901EBC100052190FBF1F000F5A070D8 +:2041600006E001EB8100A0F5C860092190FBF1F000B2704710B5DFF8E44A00206060A06185 +:2041800001F0BFFE08B9082005E0042807DB012001F0B1FE0620BDE8104002F02BB80120C3 +:2041A00002F028F8DFF87C0EC069606110BD30B583B004460D46062100A802F025FA2A46D0 +:2041C0003FA100A802F034FA05F1090100A8DFF8882A12786AB9642D07DA0A2D03DA002DA6 +:2041E00005D5002901D443210CE0432113E043210EE0642D09DA0A2D03DA002D07D5002934 +:2042000003D445218170202105E0452103E04521417020218170C17000A9204601F0AFF9DF +:20422000DFF8380A1421016037BD70B582B0DFF8F84D60780FF28C0120B9009110236022E3 +:2042400000210BE0012802D16068009002E0022808D10091102360220021002002F04EFA58 +:20426000606025E0032823D10025542616E01C200FF2F01100FB051060600E21F01D02F089 +:2042800064FA6068009010230E220021F0B202F035FA6060F61F0A2002F0E8FB20788642ED +:2042A000E5DA0E3020706D1C062DDEDB002020706078401CC0B2042808BF0020607073BD93 +:2042C000256400000000000000000000000000000000000000000000000000000000000055 +:2042E000000000000000000000000000000000000000008898BFBF98880000000080808080 +:2043000080808000000000000000000000000000000000000000000000000000000000001D +:204320000000000000206060606060609090909090909090909090909090909090909090DD +:204340009090909090606060606060606070F8888482828383838383838282828283838372 +:204360008383838282828282868484848484848484848484848484848484828282828282D4 +:204380008282FE00000000000000000000000000000000000000000000000000000000001B +:2043A0000000000000000000000000000000000000000090B0FEFEB0900000000080808001 +:2043C00080808000000000000000000000000000000000000000000000000000000000005D +:2043E00000000000002060606060606090909090909090909090909090909090909090901D +:020000040800F2 +:204400009090909090606060606060606070F88884828283838383838382828282838383B1 +:20442000838383828282828286848484848484848484848484848484848482828282828213 +:204440008282FE0000F0F00000F0F0F00000FCF8F0E0C080000F0F00000F0F0F00003F1FFD +:204460000F0703010000000000000000000000000000000000000000000000000000000022 +:204480000001FFFF01010101010181C67E380080FFFF818101010101000000000020202036 +:2044A000E0E0008040402060C04000808080FFFF81808080000000000000008040402020FD +:2044C00020404080000000003F7F448484848484844727000000008040402020204040C094 +:2044E0000000000020C3828684848C8C887830000000008040402020204040C000000000E1 +:2045000020C3828684848C8C88783000000000000000008080C0602010180C86E0E0E0ECDA +:20452000FCF2F3F1F0F8ECE4E4E2E30100000000000000000080C0402030180CC0C0C0D83B +:20454000F8E4E6E3E1F1D8C8C8C4C603FCFCFC00000000C0382625010101010101010102AE +:204560007F7F7F0609090909090939484848483010080804FCFC00000000C0382625010198 +:2045800001010101010102027F7F0609090909090939484848483010080804040000000026 +:2045A000000000008080C06030180C8600E0E0ECF4F6F6FBF5E8E8E4E2E2E100000000002C +:2045C00000000000000080C06030180C00C0C0D8E8ECECF6EBD1D1C8C4C4C201FEFEFE80BF +:2045E0004040605854020202020202843F3F3F00010101010107050506020100FEFE804007 +:204600004060585402020202020284843F3F0001010101010705050602010000F8B50C469E +:204620008578303DEDB20A2D38BF2A46C578303DEDB20A2D38BF2B4600783038C0B20A2867 +:2046400038BF01460026DFF8D45C18200FF2780700FB016C1CF807C006EB050E8EF860C04A +:2046600000FB026C1CF807C08EF890C000FB036C1CF807C08EF8A8C0761C182EE8DB10271B +:2046800044B902230C220821284600F0ABFD05F1D80000E028460026009010230C22002147 +:2046A0000C2000F095F8761C082EF5DB7F1EE7D14CB94FF47A7002F0D9F902F08DF8BDE852 +:2046C000F14001F08ABDF1BD00E010080810E00000000000000F102020100F000000000055 +:2046E000001010F800000000000000000020203F2020000000000000007008080888700063 +:20470000000000000030282422213000000000000030088888483000000000000018202092 +:2047200020110E00000000000000C02010F800000000000000070424243F2400000000009C +:2047400000F8088888080800000000000019212020110E000000000000E010888818000088 +:2047600000000000000F112020110E000000000000380808C8380800000000000000003F2B +:204780000000000000000000007088080888700000000000001C222121221C00000000005B +:2047A00000E010080810E000000000000000312222110F0000000000000000000000000074 +:2047C000000000000030300000000000000000007043C0B201F092BF10B582B00FF210000A +:2047E000002400F0F5F9641C062CFAD313BD0000000000C0F038080404040408081C00003C +:020000040800F2 +:204800000000000F1F3060404040402030080000000000C0F0180C0404040C18F0C00000CE +:20482000000000071F306040404060301F07000000000004FC1C38E0C0000004FC04000054 +:20484000000000407F40000001071E387F00000000000004FCFC84848484E4040C1000006C +:20486000000000407F7F400000000300000000000000000000040404FCFC040404000000A7 +:2048800000000000004040407F7F404040000000000000C0F03808040404040C1C00000072 +:2048A000000000071F3860404042423E3E0202002DE9F04184B004468846062101A801F062 +:2048C000A3FEE4A62246314601A801F0B1FEDFF85C7701AD387828B9642CA8BF432008DA60 +:2048E000432004E0642CA8BF452002DA4520A8702020E87001A9012000F06AFEB878411C74 +:20490000B9700FF2540100F0F3FD292001F0F6FEB878032804BF0020B870062101A801F0E3 +:2049200073FE4246314601A801F082FE387828B9642CA8BF432008DA432004E0642CA8BFE2 +:20494000452002DA4520A8702020E87001A9382000F03EFEBDE8FF8100003060C0800000DE +:2049600000000000000000000000180C06030100000000000000000000003060C0803060A9 +:20498000C0800000000000000000180C0603190C060301000000000000003060C08030601B +:2049A000C0803060C08000000000180C0603190C0603190C060301000000183060C0800075 +:2049C000000000000000000000000C060301000000000000000000000000183060C0983091 +:2049E00060C080000000000000000C0603010C0603010000000000000000183060C09830BB +:204A000060C0983060C0800000000C0603010C0603010C060301000010B582B0012808BFE5 +:204A20000FF22C0103D0022808BF0FF2E401009100F03EFA012400F0CBF8641C062CFAD38E +:204A40004FF47A7002F012F8BDE8134001F0C5BBE01864E282010101010182E26418E0003F +:204A6000030C1021274E5850584E2721100C0300F00C0201010101020F00000000000000B9 +:204A8000030C081010101008060000000000000000601010909090E00000000000000000A1 +:204AA000000E11111010081F101800000000000000010101FF000000000000000000000055 +:204AC000001010101F10101000000000000000000000000000000000000000000000000057 +:204AE0008080808080808080808000000000000001077980008079070100000000000000B4 +:204B0000000000071C0700000000000000000000E018040212214181814122120418E00086 +:204B2000030C10202844424141422428100C0300F00C0201010101020F0000000000000046 +:204B4000030C081010101008060000000000000000601010909090E00000000000000000E0 +:204B6000000E11111010081F101800000000000000010101FF000000000000000000000094 +:204B8000001010101F10101000000000000000000000000000000000000000000000000096 +:204BA0008080808080808080808000000000000000010719E0B00D03010000000000000033 +:204BC0000010181700011618100000000000000000901023102200212001C0B201F08EBD72 +:204BE00070B582B00FF2780501F088F9022808D00ED304280AD006D3052808BF0FF20C1497 +:020000040800F2 +:204C000006E02C4604E00FF2901401E00FF2142405F18C00009000F04BF9DFF8EC5B287895 +:204C200080B90226142000FB06402838009010230A2200210A20FFF7CBFD761C092EF1DBB1 +:204C4000012004E05021102001F07FFD0020287073BD00002564000028030020D83000205D +:204C600001FF00E11FE000FF010000011E0100011E010000006010109090E0000000000E86 +:204C8000111110081F1800001010F04020101030000010101F1010000000000010F0201054 +:204CA000101010E00000101F10000000101F100000001013F30000000000000010101F1001 +:204CC0001000000010F02010101010E00000101F10000000101F100000E010101010F010E6 +:204CE0000000007D8A8A8A8A9170000000000080E0F8FE0707FEF8E080000000101C1F1FEA +:204D00001F1F1F12121F1F1F1F1F1C1001FF0100000000000000101F1010101010180400AF +:204D200000C0201010101020C0000007081010101008070010F00010F01000F01000000302 +:204D40001C0300031C03000000202020202020202000000000000000000000000107798011 +:204D6000008079070100000000071C070000000000C0201010101020C000000708101010C9 +:204D80001008070000001010FE1010100000000000000F1010080000001C222141414182CB +:204DA0000700001E081010101008070000C0A090909090A0C000000708101010100804001C +:204DC00010F02010101010E00000101F10000000101F100000202020202020202000000015 +:204DE000000000000000000001FF21212121F9030400101F1010101010180400001010F084 +:204E00004020101030000010101F101000000000001010F04020101030000010101F101064 +:204E20000000000001FF4140404041FF0100101F10000000101F100000001013F30000009C +:204E40000000000010101F10100000000000E010101010F0100000609D8A8A8A8A917000AD +:204E600001FF2010101010E00000101F10000000101F100000202020202020202000000074 +:204E8000000000000000000001077980008079070100000000071C070000000000001010C6 +:204EA000FE1010100000000000000F1010080000102310220021084601F020BC38B50FF2FE +:204EC000701451EA000213D100250CE0012D05D1009400F048F801F011FC04466D1C022D54 +:204EE0003FDA002DF2D1009400F005FB0846F2E7C8B1002935D101280AD104F120000090AD +:204F000010231022502001F0F9FB04F1400015E0022826D1009410231022002001F0EEFB99 +:204F200004F1600019E0E1B101290DD104F1200000F018F801F0E2FB04F18000009010236E +:204F40001A46002108460AE002290AD1009400F0D2FA01F0D3FB04F1A00000F003F801F012 +:204F6000CDFB31BD00901023102200215020704770B582B0044650250E01F6B20EE0102152 +:204F800005F1100001F0E1FB009400F0B4FAE8B201F0B4FB103D192001F068FDB542EEDA37 +:204FA00073BD2DE9F0411F48B0F91280DFF8180B0078012803D1414600F053FB80460FF2DD +:204FC000700400212046FFF7D3FF4FF47A7798FBF7F6F6B20FF62835012105EB4610FFF7F2 +:204FE000C7FF07FB1688642798FBF7F6F6B2022105EB4610FFF7BCFF032107FB16800A2296 +:020000040800F2 +:2050000090FBF2F0C0B205EB4010FFF7B1FF042105F5D070FFF7ACFF052104F12000BDE8EB +:20502000F041A5E7800200206031002028030020808040402020101008080404FE0000001F +:205040000000010102020404080810103F0000000000FE04040808101020204040808000DD +:2050600000003F10100808040402020101000000008080C0C06060303018180C0CFE0000CD +:20508000000101030306060C0C181830307F00000000FE0C0C181830306060C0C0808000EF +:2050A00000007F303018180C0C060603030101008080C0C0E0E0F0F0F8F8FCFCFE000000AF +:2050C00000000101030307070F0F1F1F3F0000000000FEFCFCF8F8F0F0E0E0C0C080800019 +:2050E00000003F1F1F0F0F0707030301010000002DE9F0411318DFF82482DFF8D4198D7847 +:205100005DB90125CD7000250D7108254D7100250D704D7001258D7028E0CD7825BB0E7952 +:205120004F7906EB000EAE449EF833E005EB080484F8D8E002EB050EC644F4182C1994F8F6 +:2051400033408EF8D8406D1CEDB2AF42E9D27D1C4D71761E0E71EDB20B2D05D10A20487170 +:2051600000200871012025E00D7925BB0125CE784F7911E006EB050EC6442C1894F8334094 +:205180008EF8D84006EB020EAE44C644EC1894F833408EF8D8406D1CEDB2BD42EAD3781E59 +:2051A0004871721CCA70C0B228B901204871092008710020C870BDE8F08110B50021002229 +:2051C0000123934003405400042AB9BFC4F10704A340E41FE3405918C9B2521C082AEFDB7C +:2051E000084610BD2DE9F44F82B082465FEA0308DFF8DC580AD1287828B900260027012018 +:2052000028706E700CE0AE686F6910E0B8F1010F0BD1687830B90026002728700120687012 +:20522000AE7004E0EE68AF6901E02E69EF6900249DF80800484340000090DFF8E09008E0E3 +:2052400014F80A00FFF7B9FF04EB090181F8D800641C00988442F3D300229DF80800DFF806 +:20526000741803E09DF8083002EB4302009B9A422FD200240AE021F81EA031F81EE04FEA03 +:205280001E2A83F8D8A08CF8D8E0641C8442E9D21318E31803EB090C02EB040E0EEB090369 +:2052A00093F8D8A09CF8D8B04BEA0A2A21F81EA0B8F1010F06D1002E14BF2AFA06FA0AFAD6 +:2052C00007FAD8E7002F0CBF0AFA06FA2AFA07FAD1E7002408E004EB090A9AF8D800FFF7C5 +:2052E0006CFF8AF8D800641C00988442F3D31FB9102E08D1002610277F1EB8F1000F04D1CF +:20530000AE606F6108E0761CF7E7B8F1010F07BFEE60AF612E61EF61BDE8F78F0000002050 +:205320002DE9FD4E81B08946DFF8AC07B0F91210DFF894572878012802D100F092F9014697 +:205340000A2091FBF0F109B2642291FBF2F6F6B202FB161393FBF0FA5FFA8AFA02FB1611BA +:2053600000FB1A10C0B200906878012803D1E8610020286206E0022805D10020E8611020B7 +:205380002862002068700020A8610FF2747405E0FFF713FF8BF83801781CA861AF69DFF844 +:2053A0003CB7B7EB490F1FDABB4404EB4610385CFFF703FF8BF8D80004EB4A10385CFFF709 +:2053C000FCFE8BF8F800009804EB4010385CFFF7F4FE8BF818013819297801290CBF90F8FA +:2053E000E00190F8A001D3E79DF80400C0F1030009FB00F04300E869296ADFF8D82601E0CB +:020000040800F2 +:2054000003EB4903062606FB09F6B3422BDA002609E022F81E4032F81E703C0A8AF8D8400D +:205420008CF8D870761C4E45EADA03EB090AB2440AEB0B0C03EB060E0EEB0B0A9AF8D840FA +:205440009CF8D87047EA042422F81E409DF8087027B9002914BFCC408440DAE700280CBF32 +:205460008C40C440D5E700201AE006EB0B0494F8D800FFF7A2FE84F8D80094F8F800FFF7BE +:205480009CFE84F8F80094F81801FFF796FE84F8180194F83801FFF790FE84F83801701CB0 +:2054A000A861AE69B6EB490FDFDB0BF1D8000121A96100F01FF8A8690007000E01F01EF9E4 +:2054C000A969491CA9610529F3DBE869296A50EA010202D019B9102804D1002005E0481E12 +:2054E000286201E0401CE861012004B0BDE8F08E01EB401000901023102200217047F8B5EE +:2055000004460D46DFF8D8651421304601F07CF80FF6240724B900230A220121384606E0E8 +:20552000012C07D101230A22012107F12000FFF759FE06E0022C04D10A2201213846FFF7E4 +:20554000D7FD009610230A220021562001F0D6F80FF2CC7400F04AFE042803D104F10C00B2 +:20556000009005E0002D06BF07F1140000900094102306220021502001F0C0F8F1BD38B564 +:205580000C46451EEDB2082D0BD3002509E03638C0B20FF26C51FFF7ABFF2801FFF719F927 +:2055A0006D1C207898B114F8010B202808BF0A20EFD02D2808BF0C20EBD0A0F130010A2979 +:2055C00038BF3038E4D3A0F141010629DFD331BDF8B504460D4600260FF604070DE0142171 +:2055E00001FB0070009010230A220021F6B20A2000FB0640FFF7EDF8761C287888B115F8C9 +:20560000010B432808BF0B20E9D0452808BF0C20E5D0A0F130010A293ABF3038C0B20A2061 +:20562000DDE7F1BD38B50446DFF8AC04B0F91450B0F91210DFF89004007801280BD100F08A +:2056400010F8002C0CBF2918411B09B20120BDE83440FEF77DBD0CB9681832BD481B32BD04 +:2056600029460020FEF774BD70B504460D46DFF86804B0F91200DFF850140978012902D1FC +:205680000146FFF7EEFF4FF47A7190FBF1F2642390FBF3F6B6B24DB9201890FBF3F390FBA7 +:2056A000F1F080B292B2904209D10AE0001B90FBF3F390FBF1F080B292B2904201D00320C9 +:2056C00070BD9BB2B34201D0022070BD012070BDF8B5DFF8F443DFF80054B5F914000A2813 +:2056E00004BF0120A081DFF8FC63F068002800F08980606938B10020606100F0FCFB01F08B +:205700006BF8FFF74EFC00F0F0FB40282DD0B0F5807F58D16089B5F9121088421EDA01203D +:2057200060700121A88AFFF79FFF074600F06EF80028FBD10120FFF775FF68826089B5F90E +:2057400012108142B8BF68820220607000F05EF80028FBD100210120FFF7B0FBB5F9120034 +:20576000618988422FD101212AE0B5F91200218988421FDA012060700021A88AFFF774FF6F +:205780000746002200F043F80028FAD1FFF74AFF68822089B5F912108842B8BF688202208D +:2057A0006070002200F033F80028FAD100210220FFF784FBB5F912002189884203D1022106 +:2057C0000020FFF77BFB40F2051700F08EFB80B1A08940B1F168B94205D3322141430A31ED +:2057E000A982401CA0814FF49670F060002000F07FFBA08930B1F068B84203D20A20A88259 +:020000040800F2 +:205800000120A081F1BD00009031002001221021384685E52DE9F0474FF00A09B14EAA4CE7 +:20582000AD4F00F0E3FC401E072869D8DFE810F00800C5004400F700910094004901E700AA +:205840006069012801D100F057F9207940B900F0DAFF00213846FEF7E1FE0120207107E0DD +:20586000B06928B9706918B1FEF7DFFC3220B061706978B9608A401C608280B2322805D1C5 +:20588000208A411E2182C0B200F0ECFE208A08B900F0FCFE01F017FB012803D000F025FBAC +:2058A00000282DD0F86970613320208200F0DAFEBDE8F04700F0E4BE606928B901206061DA +:2058C00000F019FB00F088FF00F098FC8046E078B8F1010F06D008B100F07EFF0020E08175 +:2058E000E07023E0E1894B2908BF002804D100F073FF0120E07000E0C0B1B06908B1306825 +:20590000DFE000F07FFC0546B7F912A02078012806D1FFF7A5FE05465146FFF7A2FE82463F +:2059200051462846FEF7C4FF3220B0613068002804BFE0780028E3D100F064FC0546B7F945 +:205940001200A842B4BF291A411B122900DA0546A6E0BDE8F047BBE66069012801D100F022 +:20596000CBF800F0C2FA48F24001401A07D0C03802D0403806D007E0012060710BE002200E +:2059800060710DE0607101E0607910B9FEF724FF0AE0012802D100F036FF05E0022803D1EF +:2059A00001213846FEF73AFE6079032804D0002000F09EFA0320607183E0606910B9012090 +:2059C00000F09BF8484F387828B1FFF725F80020387000F001FFB069002872D100F088FB62 +:2059E00005462078012802D1FFF73AFE054600F07DF836A10620FFF7C2FD14200DE060694E +:205A000010B9012000F079F86069012804BFB069002856D1FFF7E4F83220B06151E000F0C8 +:205A2000F1FB0546B7F91000A842B4BF291A411B1329B8BF054600F0E1FB8046E078B8F1E2 +:205A4000010F06D008B100F0C7FE0020E081E07020E0E189322908BF002804D100F0BCFEEE +:205A60000120E07000E0A8B1B06900287FF447AFB7F910A02078012806D1FFF7F1FD0546AB +:205A80005146FFF7EEFD824651462846FEF710FF3220B0613068002804BFE078002810D176 +:205AA0002078012802D1FFF7DBFD054600F01EF801F006FA01464046FFF721FDE089401C9C +:205AC000E081BDE8F0870000280300204600000070030020A02E0020800200200000002075 +:205AE000D8000020D83000202804002095FBF9F109B20120FEF75BBB0020606100F06CBEDE +:205B0000000000F8FE0301010103FEFCF00000000000003F7FE0808080C07F3F07000000F9 +:205B200000000008040406FFFF0000000000000000000000808080FFFF8080800000000053 +:205B4000000000060701010181C37F3E00000000000000E0F0D8CCC6C3C0C0E000000000D7 +:205B60000000000607818181C1633F1E00000000000000E0C080808181C37F3E00000000F2 +:205B800000000000C060380CFFFF0000000000000000060705040484FFFFC48406000000B9 +:205BA000000000FFFF8383838383830300000000000000E0C080808080C17F3F08000000AB +:205BC000000000E0F89C8EC2C3C18181000000000000003F7FC080808080C17F3F0000007E +:205BE0000000000F0303030383E33B0F030000000000000080E0781E0701000000000000D9 +:020000040800F2 +:205C00000000187E7EC381818181677E3C00000000001C7EFFC180808081E37F3C0000008F +:205C2000000078FEC603010101039EFCF000000000000001018383C361713F0F01000000A9 +:205C4000000000000000000000000000000000000000000000000000000000000000000044 +:205C60000000000000000000F00000000000000000000101010101011F0101010101010009 +:205C80000000000000000000000000000000000000010101010101010101010101010100F6 +:205CA0000E11110EE0F80C060301010101021E00000000000F3F70C0808080808040200037 +:205CC000000000000000C0C0C0C00000000000000000000000003030303000000000000004 +:205CE00008142214080202FE06020202C202061E00000000008080FF81810101030000004E +:205D0000C03008040402FAAAFA0204040830C0000718204058A4DBDEDBA458402018070057 +:205D200000F0FEFFF000007F7F7F7F00FF0FE1E00FFFFF80BFBF80FF10188CC66363C68C9F +:205D40001810426331180C0C1831634200F01E1FF00000FF8080FF0042C68C183030188C5C +:205D6000C64208183163C6C6633118088C8CC6C68C8CC6C68C8C3131181831311818313141 +:205D8000008C8C8C8C8C8C8C8C8C8C8C8C8C8C0000313131313131313131313131313100AD +:205DA00080C0603098CC66333366CC983060C08088CC6633190C060303060C193366CC8813 +:205DC000113366CC983060C0C0603098CC6633110103060C193366CCCC6633190C060301DF +:205DE00000E0180404040418E000000F3040404040300F0000000808FC0000000000000019 +:205E000040407F4040000000007804040404048870000060504844424140700000380404D0 +:205E20008484C830000000384040404040211E00000080601008FE0000000007040444441E +:205E40007F4444000000FC0484848404040000384141404040211E0000C0308884848404E6 +:205E60001800000F3140404040211E00001C04048444340C04000000007E010000000000DC +:205E800000708804040404887000001C2241414141221C0000F0080404040418E000003052 +:205EA000414242422219070000000000000000000000000000000000000000001C1CC03071 +:205EC000080404040830000007182040404020101C120C0202FE8282E20200000000407F64 +:205EE00040000300AA4800787047AA4840687047A84948607047A74908707047A4484078DA +:205F0000704770B5044600250A26A34801F02CF94519761EF9D10A20B5FBF0F19C4A40F672 +:205F20006373994203D304205070002070BD48439021B0FBF1F100200FF2A82333F8105069 +:205F4000A942D56808D2401C042805D20228F5D1002CF3D0A942F6D3401C70BD00208F49CC +:205F60000A68D243920548BF4FF480700968C943490648BF40F0400090B186490A78012AC9 +:205F800004BFCA68824207D18A68521C8A60162A06D340F4004002E000228A60C8604860DB +:205FA000704770B57E494A68D3089CB2C5000E781EB94D600120087009E0844234BF041B3A +:205FC000241AA4B23D2C3CBF8018C51A4D60E80870BD38B5002000F03CFD72481021016006 +:205FE000192000F047FD704D0A2021E0002000F02BFD69684118AA68824238BF0246AA60CB +:020000040800F2 +:20600000EA68904288BF1046E860288801280CD1A868081AE968401AC008FFF7C2FF04461B +:20602000002141F28830E860A96069602888401E288028880028D9D1204632BD5B490A7887 +:2060400022B9C000486001220A7007E04A688018931002EB5372A0EBE2004860811000EB49 +:206060005170C010704738B500254F4C0A2026E0012000F0E9FC216941186269824238BF9C +:2060800002466261A269904288BF1046A0612088012811D16069081AA169401AC008FFF7BA +:2060A000CDFF40F6E4414843000BA0F5FA75002141F28830A061616121612088401E208028 +:2060C00020880028D4D1284632BD10B5FFF781FF0446FFF7C8FF2E49B4F5C87F05D2B0F5C9 +:2060E000967F02DA8C60012000E00220087010BD70B50446FFF76DFF0546FFF7B4FF244929 +:206100004A8840F6FF739D4202D18B885B1C07E00023A5F6D966B6F5937F34BF521C0022A5 +:206120004A808B808A884B883C2A02D353B9032207E01AB90A2B28BF022202D20A2B01D263 +:2061400001224A70A4F57A7296235A4340F6B83392FBF3F250328968B4F57A7F08BF0A3AD4 +:2061600000D01CB18B18AB42B8BFAD1AB0F5C87FC8BF4FF4C87040F22632691A4FF47A7389 +:20618000504303FB010090FBF2F000B270BD0000280400201C3100200028014008080140AE +:2061A00050310020140C0140900300205831002010B5044645F2555000F0E4FF032000F0B0 +:2061C000E4FF0A2060434003000C00F0E1FF00F0E2FF00F0E5FF012010BD80B500F0DBFF5E +:2061E000012002BD2C0196005A002800DFF8B00300787047DFF8A81308707047DFF8A00386 +:20620000808B7047DFF89803B0F91E00704720220FF2D431DFF88C0300F0CEBFDFF8800347 +:2062200000218180C180018141818161C1600F2101820221418201218182704730B5002238 +:20624000DFF85C13C880B1F904300446181B08818D6900B2B0F5FA7FBCBF01224519A34225 +:2062600005DAE31A1BB2152BA4BF002500228D611F28B4BF002301230C8A4D8A6A438D698C +:206280006A4300FB04228C8AB1F90A50451B6C4303FB04224881012AB8BF002205DB41F243 +:2062A00071708242A8BF41F27072CA6090B230BDBB4A9180884204DA091A122904DB002148 +:2062C00005E0411A132901DA022100E001219183B4E770B5B44CB24D287801280ED002289E +:2062E00000F0FC80032849D0042800F09880052800F0E380082800F0208170BDFFF7F5FD64 +:20630000402811D0B0F5807F18D16878012817D000F05DF9042811DA0320287000202884D3 +:206320002060A061606109E06878012808D0022028700020A0610120FFF7DDFD687820B1D4 +:20634000E06910B96870FFF7D3FD00F040F940B9FDF7EEFE012804BF0020FDF7EDFE082078 +:206360002870A878042818BF012806D0286C60610020FFF7BDFD0120A87070BDFFF7B5FD30 +:2063800048F24001401A04D0C03802D040380AD00FE000F016F905202870002060604FF46A +:2063A000FA70E06005E000F054FB00F00DF900F011F900F00CF9042805DB00F002F900F043 +:2063C00003F900F007F9B5F93660606848B93046FFF78EFE00F0F0F800B200F03AFB1E20DF +:2063E000606000F03AFB00B9606000F06CFD98B9288C18B901202884E86BA060A0680028C0 +:020000040800F2 +:206400004DD1A883A06100F024FB0020FFF770FD286C6061042041E0002028843FE0B5F96D +:206420003460B5F93610B142B8BF0E46606848B93046FFF75DFE00F0BFF800B200F009FB39 +:206440001E20606000F0C3F804280DDB00F0B9F800F0BAF801202870286C60610420A870F2 +:20646000012068703220E061606958B900F0F1FA00F0AAF801206870C820E0610420A870EB +:206480000120287000F01FFD012802D0FFF72DFD28B10020A0616061288403202870FFF704 +:2064A0002DFD02287BD3FDF743FE012804BF0020FDF742FE0820287070BDE06800286ED129 +:2064C0003A4E0120307001F044F801F095F800203070032028700020206070BDE06920B166 +:2064E0000020BDE87040FFF703BDFFF7FEFC48F24001401A12D0C03810D040380BD1FFF7A8 +:20650000E4FDFFF7EFFC012803D101F022F801F073F8C820E061E878002840D00020E8701C +:2065200000F097FA012028700220A8700120687000F04AF83220E06170BDFFF7DFFC801E8D +:20654000012803D9801E01280FD921E0B5F93600FFF7CEFDE883FFF7D1FC012818D103207E +:2065600028700020FDF7E8FD12E000F030F801280EDB00F02CF804280ADA00F022F800F050 +:2065800023F8012068700220A061A87001202870074820B100F015F806481021016070BDC9 +:2065A0005C02002080020020D8300020280400205B6A0008140C0140E8833146B5F91E006B +:2065C00076E6002000F045BA0020FFF794BC0120FFF797BC012028700320A8700120687093 +:2065E0003220E06170470000322E3132000000000000000000000000D007B80B6400000090 +:2066000050460000A08C0000002201F0BDBD50F8041B61B150F8042BD30744BFA9F10103C0 +:206620009A18002342F8043B091FFAD1EFE770470CB41CB5044604A80190009401AB0A46E4 +:2066400000A907487844183001F0B8FD009900220A7000285CBF0098001B16BC5DF80CFB3F +:20666000CF0B000080B500A90FF2F42213680B608DF803003C22042100A802F0F3FC01BD13 +:2066800000B583B000A80FF2DC2104E000B583B000A80FF2D8210CC90CC03C22062100A830 +:2066A00002F0E0FC07BD10B5A0B00C4640218DF80010411CC9B2012000AA03E014F8013B1D +:2066C0008354401C8842F9DB3C2200A802F0CAFC204620B010BD30B583B000AA0FF29423AE +:2066E00030CB30C220308DF8050000A84278891841703C22082102F0B5FC37BD2DE9F041BA +:20670000044690465818C0B2CE080722114218BF761C811000EB5171CA10B0EBC2011ABF6D +:20672000501CC5B2D5B2069F09E031462046FFF7D2FF39464046FFF7B6FF0746761CF6B286 +:20674000AE42F2DB3846BDE8F08130B5A1B004460D4601A8FFF758FF00F051F82A46002155 +:20676000E0B2FFF7CBFF00F04AF82A460821E0B2FFF7C4FF21B030BD80B54FF48070ADF8E6 +:20678000000003208DF8020010208DF8030000A90E4802F0A3FC01BD10B50D4C4FF48071F7 +:2067A000204602F002FD022000F060F94FF48071204602F0F8FC022000F058F93C222E2187 +:2067C0000448BDE8104002F04DBC0000000C014000080140A002002000B5A1B0802101A8D5 +:2067E000FFF712FF00F00BF8802200F0B5F800F006F88022194600F0B0F821B000BD01A8A2 +:020000040800F2 +:206800000090082370472DE9F041A2B00125002201A90FF2681000F0BCFE040000F07F8065 +:206820002078422804BF60784D2840F0878094F83600FF2804BF94F83700FF2804D194F818 +:206840003800FF2808BF002500F081F801260F27002000210C2202FB0712121992F83E208F +:2068600080234FF0080C03EA020E1DB1BEF1000F0CD102E0BEF1000F08D00DF1080E864466 +:206880009EF8018046EA08088EF8018000F059F8E9D1491C0C29DDD37606360E7F1E082FC1 +:2068A000D6DA02A800900823602200F055F8FFF794FC00F04CF801260027002000216FF05C +:2068C0000B0202FB0712121992F8922080234FF0080C03EA020E1DB1BEF1000F0CD102E0F0 +:2068E000BEF1000F08D00DF1080E86449EF8018046EA08088EF8018000F023F8E9D1491C9C +:206900000C29DCD37606360E7F1C082FD5DB02A8009008236022082100F01FF808E00FF251 +:20692000680000901023602200210020FFF7E6FE4FF47A7000F09AF8FFF74FFC22B0BDE828 +:20694000F081401CC0B25B08BCF1010C70477F210DF1090002F056BC00210020CEE6000084 +:2069600080818000808D801480AF0000808D801080AE000080B080218020807F4C4F474F5A +:20698000494E2020424D500000000000000000000000000000000000000000000000000041 +:2069A00080C0E0F0F8FCFEFEFCF8F0E0C080C0E0F0F8FCFEFEFEFC783080C0C000189CCE2F +:2069C000E6F0F8FCFEFEFCF8F0E0C0E0F0F87C000000000000000000000000000000000029 +:2069E000000000000000000000000000000000000000000000000000000000000000001F78 +:206A00000F07030103070F1F3F7F7F3F1F0F07030103070703191C0E6773391C0E070301D0 +:206A200003070F1F3F7F7F3F1F0F0703010000000000000000000000000000000000000069 +:206A40000000000000000000DFF8281431F810007047DFF82414C8607047DFF81C04C06826 +:206A600070472021DFF8140402F0CCBBDFF80814142202E0DFF800140A2250438860886829 +:206A80000028FCD17047DFF8F8134FF400620A614FF480520A61002808680AD120F44040D1 +:206AA00040F440500860086820F4402040F4403009E020F4804040F430400860086820F4D5 +:206AC000802040F430200860704780B502F09EFB102002F05FFC012002F056FCDFF8A40353 +:206AE0004168DFF8A42311434160016841F080710160012002F0A3FB012002F0A3FB3920B3 +:206B000002F011FC0028FAD0022002F09EFB02F0A3FB0828FBD10121172002F0E0FB012103 +:206B200040F20C6002F0E4FB0121032002F0E9FB0120BDE8024002F094BB80B501464FF0C7 +:206B4000006002F0DAFC4FF4A06002F0A5FC14208DF8000002208DF8010000208DF802002F +:206B600001208DF8030000A802F09BFC01BD38B5C64C4FF6FF70E060C5492160C54961602C +:206B8000C54DE860C54828604FF0883068608020ADF80000002000F01FF84FF4807000F0B8 +:206BA00021F80121BE4802F002FB102000F01AF80120ADF80000002000F01AF80220ADF8C4 +:206BC0000000002000F014F84FF41070ADF80000482000F001F831BD8DF8030000A920465B +:206BE00002F07CBAADF8000003208DF8020010208DF8030000A9284602F070BA2DE9F041EC +:020000040800F2 +:206C000090B04FF420442546A64E304602F08AFCA5480590974806900020079002200890D8 +:206C20000020099080200A904FF480700B904FF480600C9020200D904FF400500E900020A6 +:206C40000F9005A9304602F0BAFC0121304602F0D1FC964E304600F0DBF900F05FF84FF4CA +:206C6000602702970020039002208DF8100000A9304600F0F6F9DFF83882404600F0C8F9C4 +:206C800000F04CF802970020039001208DF8100000A9404600F0E5F90723022207213046D5 +:206CA00000F023FA072301220821304600F01DFA052301220921404600F017FA0121304640 +:206CC00000F0F6F90121304600F0E9F90121404600F0E5F9304600F0F4F9304600F0F6F94D +:206CE00020B12846451E0028F7D114E0404600F0E8F92546404600F0E9F920B12846451E52 +:206D00000028F7D107E00121304600F0E5F90121404600F0E1F910B0BDE8F081002000903E +:206D200001208DF804008DF80500704700B585B04FF4E06002F0B0FB2F20ADF8040042F232 +:206D40000F70ADF808000020ADF80A00ADF8060001A94FF0804002F073FC00F061F802F048 +:206D6000C5FC012200F05CF802F0B8FC00F058F802F0AAFC1C2000F02AF805B000BD1FB5D9 +:206D80004FF4E06002F088FB2F20ADF804003120ADF808004FF48070ADF80A000020ADF85E +:206DA0000600444C01A9204602F04AFC0121204602F09CFC01220121204602F08FFC012199 +:206DC000204602F081FC1D2000F001F81FBD8DF8000000208DF8010001208DF802008DF884 +:206DE000030000A802F05DBB80B500F019F802F087FC0020304901EB8002536813B15368F2 +:206E00005B1E5360401C0828F5DB0878401C08700321084204BFBDE80140FFF79FB801BD74 +:206E200001214FF08040704780B50121214802F067FC1148416811B14168491E4160816807 +:206E400011B18168491E8160C16802781B4B49B1C168491EC160002A19BF1021596010216E +:206E60001960D243C16811B9102159600022027001BD0000783100200C310020D830002007 +:206E800004080140001002400A846800000801408888880883B8BB8B000C01400088834457 +:206EA00000013000080002404C240140002401400028014000040040D4300020100C014013 +:206EC0005148C089704751480088704700B585B08DF800008DF801101D22022100A802F040 +:206EE000C1F80DE000B585B08DF8000003461D22012100A802F0CBF843489DF800100173D2 +:206F0000012005B000BD80B500212A20FFF7DEFF02210E20FFF7DAFF03212A20FFF7D6FF12 +:206F200000212B20FFF7D2FF01212A20BDE80440CCE770B51C460023002500F11006964268 +:206F4000A6BFA0F11006B242012301F11006A642A6BFA1F11006B442012300F12006964207 +:206F6000A6BF20388242012501F12000A042A6BFA1F120008442012524480580184670BDF7 +:206F800021480178407802E01F480179407940EA01200009802903D3C043401C0005000D97 +:206FA000704730B583B0184C06212046FFF72CFB0020FFF797FFE8B1207B00071AD50120FD +:206FC000FFF790FFB0B1207B8DF80000207000A8417861709DF8021021719DF80310617136 +:206FE0000179217240796072FFF7CAFF0546FFF7CBFF00E0258A00232A460021208AFFF74C +:020000040800F2 +:2070000098FFE081258237BDF83000200A31002080B55749884208D101214FF4007002F0FB +:2070200079F900214FF4007016E05249884208D101214FF4806002F06DF900214FF48060F5 +:207040000AE04D4988420BD101214FF4004002F061F900214FF40040BDE8044002F05AB987 +:2070600001BD4268454B1A400B681A430B7942EA032242608268424B1A40CB681A438B6823 +:207080001A434B7942EA43028260C26A22F47002097C491EC9B242EA0151C16270470029E0 +:2070A000816812BF41F0010149084900816070470029816814BF41F4807121F480718160BF +:2070C0007047816841F00801816070478068C008FFE700F0010070470029816814BF41F4E6 +:2070E000A00121F4A0018160704770B507240A290BD3A1F10A0505EB4505C668AC4026EA3B +:207100000404AB402343C36008E001EB41050669AC4026EA0404AB40234303611F23072A3E +:207120000AD2521E02EB8202446B934024EA030391401943416370BD0D2A0AD2D21F02EB0D +:207140008202046B934024EA030391401943016370BD0D3A02EB8202C46A934024EA0303CA +:2071600091401943C16270BDC06C80B2704700000024014000280140003C0140FFFEF0FF46 +:20718000FDF7F1FF09490860704709490860704708490860704705484AF6AA210160704749 +:2071A00002484CF6CC4101607047000000300040043000400830004062B38B0708D0521ED3 +:2071C00011F8013B00F8013B00F024808B07F6D1830740F0208000BF103A07D330B4B1E88F +:2071E0003810103AA0E83810F9D230BC530724BFB1E80810A0E8081044BF51F8043B40F825 +:20720000043BD20724BF31F8022B20F8022B44BF0B7803707047083A07D3B1E80810083A19 +:2072200040F8043B40F804CBF7D25307E4E70268531C03601170704770470000F8B5642482 +:20724000DFF8742C0A23072911D8DFE801F0041123588090C5CC017845785D4304FB015161 +:207260008078401841F2D041401A58431082F1BDDFF8481C09780029F9D1017845785D43C0 +:2072800004FB01518078401841F2D041401A58435082F1BDC17846788578A1F1300C5FFA79 +:2072A0008CFCBCF10A0F0CD200784FF47A77664307FB006003FB0500081800F53C57B03759 +:2072C00018E0A5F13001C9B20A2909D2007803FB06F104FB0010281841F2D041471A09E01C +:2072E000A6F13001C9B20A2904D2007803FB0060A0F504773FB204FB07F09061F1BDC1789D +:207300008578A1F13006F6B20A2E0DD206784FF47A774078604307FB060003FB05000818B1 +:2073200000F53C57B0370DE0A5F13001C9B20A2908D201784078584304FB0100281841F263 +:20734000D041471A3FB204FB07F0D061F1BD46780778A6F13000C0B20A283ABF03FB0760EF +:20736000A0F50477303F03FB07F09082F1BDC178467807788578A1F13000C0B20A280CD222 +:207380004FF47A7004FB06F200FB072003FB0500081800F53C57B03717E0A5F13000C0B2E6 +:2073A0000A2808D203FB06F004FB0700281841F2D041471A09E0A6F13000C0B20A283ABF95 +:2073C00003FB0760A0F50477303F3FB203FB07F0DFF8EC1A0860F1BD00783038C0B2BDE8F9 +:2073E000F240FCF7ADBE467807788578A5F13000C0B20A2808D203FB06F004FB0700281845 +:020000040800F2 +:2074000041F2D041471A09E0A6F13000C0B20A283ABF03FB0760A0F50477303FDFF89C0A19 +:20742000007818B9DFF89C0A3FB20760F1BD000030B507291DD8DFE801F004041E324151D4 +:2074400060658378A3F13001C9B20A293FBF4478A4F13001C9B20A2979D20178A1F1310044 +:20746000C0B2042873D2342903D1302C08BF302B6DD1012030BDC1783039C9B20A2921BFFE +:2074800081783039C9B20A29F3D341783039C9B20A295CD200783638C0B2042828E0C17853 +:2074A0003039C9B20A29E4D381783039C9B20A294DD200783338C0B2072819E00178407821 +:2074C0003038C0B2062804D2A1F13000C0B203280EE03529CDD2312939D1CAE7017840783E +:2074E0003038C0B2032805D2A1F13000C0B20A28BFD32CE03929BCD229E001783129B8D058 +:207500003029E9E74478017883780A20A3F13005EDB20A2D08D26425604305FB0100181812 +:2075200041F2D041401A0AE0A4F13003DBB20A2B3ABF00FB0140A0F50470A1F13000012A0E +:2075400097D180B2DFF87C190968884291D0002030BD10B54FF41852DFF86C19DFF86C0962 +:20756000FFF73AFEDFF86809002100220B460C461EC010BD10B5002208E0135CA3F16104CD +:20758000E4B21A2C3CBF203B1354521C8A42F4DB10BD2DE9FF4180460E46DFF8304904F2C6 +:2075A000004710250B22394601A8FFF705FE0B2101A8FFF7DFFF0B22414601A802F0B8F859 +:2075C00098B907F11C00017831704178717007F11A0000A902780A7042784A70BDF80000BA +:2075E00004EB402000F5007003E020376D1ED9D1002004B0BDE8F0812DE9F04FADF5097D01 +:207600000024ADF8004000260FF6E80700AA0DF102013846FFF7BDFF0190DFF8B09809F2C1 +:2076200000400290DFF8A8A80198002800F001814FF48C7143A8FEF7E7FFDFF898784FF4EE +:20764000007201993846FFF7B7FDA0460025232043A900FB081B05E0232D3CBF05F80B0066 +:207660006D1C761C384602F095F8864206D2F05D0D2802BFF11949780A29EDD105F80B400B +:20768000B61C08F10108B8F1080FDFD30027DFF828880AEB87056E69304602F07BF823217F +:2076A00043AA01FB072B02463146584602F040F800286CD1686902F06DF8064604E0202823 +:2076C00018BF3D285DD1761C00F0C3FA864258D216F80B00A0F13001C9B20A29EFD230286D +:2076E00001D1062F4DD15E440022F9B23046FFF79FFE002845D0F9B23046FFF79FFD2FB915 +:20770000B8F9100000F097FA43A837E0012F05D1B8F9120000F089FA4BA81DE0022F06D1F1 +:20772000D8F8180000F075FA0DF5A97026E0032F05D1D8F81C0000F066FA5DA81DE0042F68 +:2077400005D1B8F9140000F06AFA66A816E0052F04D100F076FA6EA8C01C0FE0062F07D1DF +:20776000FCF7F2FC02460FF2F0710DF5EF7005E0072F16D100F042FA80A8401CFEF758FF1F +:207780000FE000F066FA0146584601F03BFD6C6B204601F0FFFF024621465846FFF70CFD24 +:2077A00001247F1C082FFFF474AF002C02BFDFF80C07007800283BD0FE2103A8FEF724FF58 +:2077C0000027232043A900FB071103A801F0FDFF0AEB8700416D03A801F0F7FF7F1C082F1A +:2077E000EFD303A801F0D6FF0246BDF8000009EB4010FF2A80F81C2400F21C4094BF002172 +:020000040800F2 +:20780000110A417001980299401A00F50070411200EB91508012012100F80A1003A801F028 +:20782000B9FF024603A90198FFF7C6FC00F058FA5DE00FF2407500AA0DF102012846FFF707 +:20784000A8FE09F21644DFF89086D0B1FE22014603A8FFF7B1FC00F05CF809F584600ECD09 +:207860000EC0FE2203A909F50060FFF7B5FC6675C4F82080032089F83A04FE2089F83C0471 +:2078800001E000F046F802980ECF0EC00FF6F007062239464846FFF79FFC0622394609F52D +:2078A0000070FFF799FC00270AEB8705D5F834B000F0CFF900F032F8686B01F06BFF8619D5 +:2078C000D5F854B000F0C5F900F028F8686D01F061FF86197F1C082FE6D3002089F80B0419 +:2078E000C9F8168402202071A67100F022FA42F60C0000EB09010022CA760A774A7640F843 +:207900000920002088600861C8600DF5097DBDE8F08F4FF418514846FEF776BE02465946AF +:2079200006EB090000F5C060FFF746BC2DE9F04FADF50B7D06460F46DFF89455DFF88C9568 +:20794000B7F5805F0BD14FF40072494601F0F0FE002815D04FF40072314648460CE0B7F53E +:20796000205F0ED109F5007400F076F9002807D04FF4007231462046FFF71EFC012028707E +:2079800036E1B7F5804F22D109F2004400F064F90028F5D04FF4007231462046FFF70CFC59 +:2079A0000120687010240FF24C570C22314600A8FFF702FC0B22394600A801F0B9FE10B9F0 +:2079C000B07E288214E12036641EEED110E1A7F50044B4F5005FF9D807EB0900A0F5F448CD +:2079E0004FF400724146304601F0A2FE08B100F038F9A7F5FC4005EB902A600A801C298A2F +:207A0000884240F0EF8000244FF48C7145A8FEF7FBFDDFF8C08400F024F900260027232007 +:207A200045A900FB061B05E0232F3CBF07F80B007F1C641C404601F0ADFE844208D214F817 +:207A400008000D2802BF04EB080149780A29EBD1002007F80B00A41C761C082EDED30026F7 +:207A6000DFF8547405EB8604D4F814B000F0F1F80246232045A900FB06185946404601F0DC +:207A800057FE002840F09780606901F083FE044604E0202818BF3D2810D1641C404601F05D +:207AA00079FE844280F0A68014F80800A0F13001C9B20A29EDD2302802D1062E40F09A8007 +:207AC00044440122F1B22046FFF7B2FC00287BD0F1B22046FFF7B2FB404601F05BFE014618 +:207AE000404601F08FFB2EB9B7F9100000F0A3F845A835E0012E05D1B7F9120000F095F80D +:207B00004DA81BE0022E05D1B86900F082F80DF5AD7025E0032E04D1F86900F074F85FA8F6 +:207B20001DE0042E05D1B7F9140000F078F868A816E0052E04D100F084F870A8C01C0FE0BF +:207B4000062E07D1FCF700FB02460FF20C410DF5F37005E0072E05D100F050F882A8401C82 +:207B6000FEF766FD761C082EFFF47CAFFE2105A8FEF74AFD0026232045A900FB061105A8A9 +:207B800001F023FE05EB8600416D05A801F01DFE761C082EEFD305A801F0FCFD0446288AD9 +:207BA00009EB4010FF2C80F8DC4300F5777094BF0021210A09E0646B204601F0EBFD024605 +:207BC00021464046FFF7F8FA14E041704FF4007205A909F5C060FFF7FFFA012068708AF840 +:207BE000010005E0012068708AF8010000F078F800F076F80DF50B7DBDE8F08FB148026854 +:020000040800F2 +:207C00000FF2643170476421B0FBF1F20FF21C3170476421B0FBF1F20FF2003170470A21D8 +:207C200090FBF1F20FF2143170470A2190FBF1F20FF2DC2170470A2190FBF1F20FF2C02110 +:207C400070479F4800680A21B0FBF1F20FF2F8217047584601F09EBD4FF40072214601F09D +:207C600067BD4FF4007231464046FFF7A5BA38B504460D46FFF7E0FA25B94FF400720FF2EB +:207C8000003121E09149B5F5805F08BF4FF400721AD0B5F5205F04D14FF4007201F50071CF +:207CA00012E0B5F5804F04D14FF4007201F580610AE0A5F50040B0F5005F0AD84FF4007299 +:207CC00005F1006101F58C412046BDE83840FFF773BA4FF400712046BDE8344001F092BA74 +:207CE000F8B501F061FB00207949425CD2B1002242548402744D281901F087FD73482618D9 +:207D0000002736F8021B3819281801F06DFD042803D001F053FB0420F2BDBF1CB7F5806F7E +:207D2000EFD302E0401C1028DFD301F047FB0020F2BD70B5654C01F037FB0025624E06EB98 +:207D4000852001F062FD6D1C092DF8DB002534F8021B701901F048FD042801D0042070BD21 +:207D6000AD1CB5F5185FF2DB01F028FB002070BD2DE9F04142F61804544D6619574F327ADE +:207D80002AB9400238604802786001203072307A012831D1605978B905F5185839684046F1 +:207DA000FFF765FF40229821404601F043FD4FF4E070605140200CE040229821B868401973 +:207DC00000F5185001F036FD605940386051B8684030B8604021012001F0D7FD30210120DF +:207DE00001F05DFD3868403038607868403878603B48816840398160786838B96051B86000 +:207E0000386038480321017000203072BDE8F0812DE9F04142F61C042C4D62594032661919 +:207E2000314F33792BB9400238604802786001203071307901282FD100202C490AE05B19AF +:207E400003F5185310F801C083F800C0401C63595B1C635163599342F1D3DFF89480B8F888 +:207E600000003968411839607A68101A7860C00507D100206051A1F5007105F51850FFF7BE +:207E800055FD17488168B8F80020891A81604FF44051022001F014FD786800281EBF1148BE +:207EA0000078042806D100206051012101F0D4FE00203071BDE8F0818002002028040020CC +:207EC000340400203004002000C0000864040020E8010020A02C0020188DDD403C31002062 +:207EE0002C310020A03000204831002040300020A2300020434F4E46494720205458540004 +:207F0000545F5374616E6462793D256400000000545F576F726B3D25640000005761697462 +:207F20005F54696D653D25640000000049646C655F54696D653D256400000000545F5374E1 +:207F400065703D25640000005475726E5F4F66665F763D256400000054656D7053686F7791 +:207F6000466C61673D2564005A65726F505F41643D2564004C4F474F494E2020424D500020 +:207F8000EB3C904D53444F53352E3000020108000200025000F80C000100010000000000AC +:207FA00000000000000029A298E46C4E4F204E414D4520202020464154313220202033C916 +:207FC0008ED1BCF07B8ED9B800208EC0FCBD007C384E247D248BC199E83C01721C83EB3ACE +:207FE00066A11C7C26663B07268A57FC750680CA0288560280C31073EB33C98A461098F74E +:020000040800F2 +:20800000661603461C13561E03460E13D18B7611608946FC8956FEB82000F7E68B5E0B03F7 +:20802000C348F7F30146FC114EFE61BF0000E8E600723926382D741760B10BBEA17DF3A66B +:208040006174324E740983C7203BFB72E6EBDCA0FB7DB47D8BF0AC9840740C487413B40E36 +:20806000BB0700CD10EBEFA0FD7DEBE6A0FC7DEBE1CD16CD19268B551A52B001BB0000E828 +:208080003B0072E85B8A5624BE0B7C8BFCC746F03D7DC746F4297D8CD9894EF2894EF6C601 +:2080A00006967DCBEA030000200FB6C8668B46F86603461C668BD066C1EA10EB5E0FB6C890 +:2080C0004A4A8A460D32E4F7E20346FC1356FEEB4A525006536A016A10918B4618969233AA +:2080E000D2F7F691F7F64287CAF7761A8AF28AE8C0CC020ACCB80102807E020E7504B4429F +:208100008BF48A5624CD136161720B40750142035E0B497506F8C341BB000060666A00EBC3 +:20812000B04E544C44522020202020200D0A52656D6F7665206469736B73206F72206F7484 +:20814000686572206D656469612EFF0D0A4469736B206572726F72FF0D0A50726573732064 +:20816000616E79206B657920746F20726573746172740D0A00000000000000ACCBD855AAC1 +:20818000F8FFFFFFFFFF000000B500BF130096469446103928BFA0E80C50FAD85FEA417CC3 +:2081A00028BF0CC048BF40F8042BC90728BF20F8022B48BF00F8012B00BD00002DE9F04F65 +:2081C000A1B0804617461D46029102AE0020706211AC6FF000490AE017F8011B0298C04778 +:2081E0000290002800F06A82706A401C7062387808B9706A64E22528EED10020F060306143 +:208200007061B061F061306201E040F0010017F8011F2029F9D023290DD02B2904D02D299F +:2082200006D030290AD00CE040F0020080B2EEE740F00400FAE740F00800F7E740F01000A5 +:20824000F4E72A290DD129680A1D2A600968F162002904D54942F16240F0040080B27F1C2B +:2082600012E00021F16209E0F16A494505D001EB810302EB43013039F1627F1C3A78A2F1B4 +:208280003001C9B20A29EFD339782E2903D04FF0FF31B1621DE017F8011F2A2906D12968F9 +:2082A0000A1D2A600968B1627F1C12E00021B16209E0B16A494505D001EB810302EB4301C0 +:2082C0003039B1627F1C3A78A2F13001C9B20A29EFD3308639780FF6983001F0FFFC08B1C8 +:2082E00017F8010B8DF83A009DF83A00682804D1387868280AD1622005E06C2804BF3878E7 +:208300006C2803D171208DF83A007F1C11A8B0603978B1F1250023D01C3871D0001F0228F8 +:208320006ED9133800F09680093869D0801E00F02781401E00F0D180401E022860D9001F76 +:2083400000F0CB80401F30D0401E00F08380401E20D0C01E09D0801E7CD0C01E7AD017E123 +:20836000F068411CF16025211BE12868011D296000687060B26A002A02D501F00BFA07E04C +:20838000002101F0B7FC00281ABF7168401AB06A306107E12868011D296000680021CDE9DB +:2083A000000111A870607821E6E09DF83A00622818D0682806D06A280BD06C2819D07128AA +:2083C00007D016E02868011D2960716A00680180E8E02A68101D2860706AC1171268C2E9EF +:2083E0000001DFE02868011D2960716A00680170D8E02868011D2960716A00680160D1E08E +:020000040800F2 +:208400002868C01D20F00700286000F108022A60D0E90023CDE90023002B04D5F068421C5C +:20842000F2602D220DE0308E820704D5F068421CF2602B2205E0C00704D5F068421CF260AC +:2084400020220255F06811AA8018706000A800F0C5F9A7E09DF83A006C2808BF2A6811D08E +:20846000712808BF2A6802D06A282A680AD1D21D22F007022A6094460CF108022A60DCE975 +:20848000002303E0131D2B6012680023CDE90023682808BF92B207D0622808BFD2B203D08B +:2084A000742818BF7A2802D10023CDE9002396F8300000075CD5DDE90023002B08BF002ADD +:2084C00056D041F02000782852D1F06830220255401C421CF26001554AE09DF83A0062287C +:2084E0000CD0682810D06A281AD06C2823D0712816D074281FD07A280CD01CE02868021DFA +:208500002A6090F900201AE02868021D2A60B0F9002014E02868021D2A60026800230FE083 +:208520002868C01D20F00700286000F108022A60D0E9002304E02868021D2A600268D3175D +:20854000CDE90023002B04DAF068421CF2602D220DE0308E820704D5F068421CF2602B2280 +:2085600005E0C00704D5F068421CF26020220255F06811AA8018706000A800F0A4F811E035 +:20858000F068411CF16029680A1D2A60096808E0F068421CF2602522025519B1F068421C14 +:2085A000F26001557F1CF06AF168401AB169401A3169401AF169401A7169401A316AA0EBF5 +:2085C000010A96F83000400711D420208DF84000BAF1010F0BDBD346012310AA00A94046DA +:2085E00000F02FFC002869D1BBF1010BF4D1F36811AA00A9404600F024FC00285ED1302085 +:208600008DF84000D6F818B0BBF1010F0ADB012310AA00A9404600F014FC00284ED1BBF15E +:20862000010BF4D13369726800A9404600F009FC002843D130208DF84000D6F81CB0BBF138 +:20864000010F09DB012310AA00A9404600F0F9FBA0BBBBF1010BF5D17369306971684218B4 +:2086600000A9404600F0EDFB40BB30208DF84000D6F820B0BBF1010F09DB012310AA00A91E +:20868000404600F0DEFBC8B9BBF1010BF5D196F8300040077FF5ABAD20208DF84000BAF10B +:2086A000010FFFF6A4AD012310AA00A9404600F0C8FB18B9BAF1010AF5D198E54FF0FF306C +:2086C00021B0BDE8F08F2DE9FA4782B0064635696F2908BF082705D041F02000782814BF0B +:2086E0000A2710273C24D6E90001804689469DF80820642A18BF692A05D1002903DAD8F103 +:20870000000869EB4909B9F1000F08BFB8F1000F0CD1306B50B9082F3BD196F838000007E2 +:2087200037D53B24302085F83B0032E0A4F1010A5446FB17404649463A4601F007FBCDE92A +:208740000089B846A8FB0023DDE90089A8EB02023032D2B23A2A03D39DF80830513B9A18BB +:208760000AF8052080465FEA010908BFB8F1000F03D0F06861198842D8D3082F09D196F881 +:208780003800000705D5605D302802D0641E30206055C4F13C00B0616119F160316B88421F +:2087A00007DA081A3062308F4FF6EF710840308710E000290ED596F8381001F014011029B0 +:2087C00008D1716B7269891A326A891A081A0128A8BF306204B0BDE8F08700002DE9F24FBC +:2087E0008EB0044604AED4E90001CDE902019DF8380040F020008DF8000061280BD0206B37 +:020000040800F2 +:20880000002848BF062005D404BF9DF80000672801D1012020636168C1F30A5040F2FF7352 +:2088200098421ED1080304BF206800280AD10320A0619DF838006138C0B21A2838D30FF2CC +:20884000446109E00320A0619DF838006138C0B21A282AD30FF224610322E068FEF7ACFCBF +:20886000B9E1012817DA204601F0E7FA012812DB002700209DF80010612920D1E1683022F4 +:2088800001F8012B4A1CE2609DF83820612A0CBF782258220FE040F2FE31626861F31E52D6 +:2088A0006260471A4FF0FF30E4E70FF2CC51D3E70FF2CC51D0E70A706169891C616110B93B +:2088C000002500277EE19DF80000612840F09780206B00284CBF2125451C2DB26E1CD4E9FD +:2088E0000089DDE902010022002301F0C7FA3ABF89F00040CDE90280CDE902893F1F8DF821 +:2089000010200DF11108012E35DBDDE902010022002301F0CBFA2ED21C2102A801F0DEFA5D +:20892000DDE9020101F060FB8146F61F012E09DB01F086FB02460B46DDE9020101F098FBDB +:20894000CDE9020108F20700072105E009F00F0200F8012D4FEA2919B9F1010F01DB491EA8 +:20896000F4D5491E5CBF002200F8012DF9D500F20708012EC9DA0DF11100A8EB00010DF122 +:208980001106A942B8BF0D462DB2002D30D42846884206DA04A941184978082928BF0F21D4 +:2089A00000D2002104AA821800E06D1E401E12F801398B42F9D00F2904D104A941184A7804 +:2089C000521C4A70002802D504AE6D1C3F1D2DB2681E0DD481190A783032D2B23A2A03D357 +:2089E0009DF838303A3B9A1801F80129401EF2D5206B002840F1E680681E2063E2E0DDE930 +:208A000002010022002301F039FA3CBF81F00041CDE902013FB247F297507843474990FB9D +:208A2000F1F73FB2C7F107069246DFF814B1012E19DBDDE90289F00707D552465B4640461E +:208A4000494601F0D5FB8046894676105046594652465B4601F0CCFB82468B46002EEAD103 +:208A6000CDE9028921E076429046DFF8D89012E0F00707D552465B464046494601F0B8FB30 +:208A80008046894676105046594652465B4601F0AFFB82468B46002EEAD1DDE902014246DF +:208AA0004B4601F077FCCDE902019DF8000066280CBF07F10A000620216B4518142DA8BF61 +:208AC000132530208DF810000DF11106DFF87890012D3BDBDDE9020101F09CFA06F10801F1 +:208AE00004220A26B0FBF6F303EB830EA0EB4E00303001F8010DB3FBF6F000EB8006A3EB3A +:208B00004603303301F8013D521EEAD101F10806083D012DDCDBDDE9020101F07BFA01F0FD +:208B200099FA02460B46DDE9020101F0A1FA00224B4601F05DFBCDE90201CBE7A086010026 +:208B4000000024400000F03F84D797410DF11100301A0DF1110602E0401E7F1E761C3178C9 +:208B60003029F9D09DF80010662902D13FB2791C03E065290CBF01210021226B8D182DB2B6 +:208B8000A842B8BF05462DB2002D1BD42946814204DA885D352828BF392000D230208A19D7 +:208BA000521E00E06D1E491E12F801398342F9D0392802D1885D401C8855002902D5761EBB +:208BC0006D1C7F1C3FB200972BB232469DF83810204600F003F80FB0BDE8F08F2DE9F0433A +:208BE00085B00546894617461E46D5F83080012E02DA01260FF2902749F02000BDF930407F +:020000040800F2 +:208C0000662808BF641C18D0672840F082806FF003008442C0F28380444580F28080641C7E +:208C200095F83800000702D44645B8BFB04624B2B8EB040848BF4FF00008E868A96924B28F +:208C4000012C25DA4A1C30230B54B8F1010F03DA95F83810090702D52E211154521CAA6151 +:208C600018EB040FB8BFC8F1000424B261426962A044B045B8BF464636B2EE61324639465C +:208C8000AB691818FEF798FAA8EB0600A862C1E00818A64218DA32463946FEF78DFAA96946 +:208CA0007118A961A01B6862B8F1010F03DA95F83800000705D5E8682E220A54E869401CB5 +:208CC000E861C5F82880A5E022463946FEF774FAA8692018361BB8F1010F03DA95F8381012 +:208CE000090703D5E9682E224254401CA86136B2B045B8BF464636B23246E119EB68C0188B +:208D0000FEF75AFAA8693018A861A8EB0600686280E0B9F1610F16D14FF0700918E04645A9 +:208D200004DA95F83810090758BFB046B8F1010848BF4FF00008B9F1670F14BF4FF04509E3 +:208D40004FF0650904E0B9F1410F08BF4FF05009A9694A1CE86817F8013B0B54B8F1010FFE +:208D600005DA95F83810090758BFAA6117D52E211154531CAB61B8F1010F10DB761E36B2D2 +:208D8000B045B8BF464636B2324639461818FEF713FAA8693018A861A8EB06006862A869F4 +:208DA000E968471807F8019B002C03D42B2007F8010B03E02D2007F8010B644200260DF10A +:208DC000080809E00A22214600A801F006FC019808F8010B009C761C24B2012CF2DA022E9A +:208DE00006DA49F02000652804BF302007F8010B4EB9302007F8010B07E0761E02A8305C7C +:208E0000303007F8010B012EF7DAA869E9684018381AE86195F8380000F0140010280DD1B3 +:208E20006869A9690818696A0818E9690818A96A0818696B8842BCBF081A286205B0BDE878 +:208E4000F083F8B504460D4616461F46002077B116F8011BA868A047A86030B1E86A401C94 +:208E6000E86200207F1EF3D1F2BD4FF0FF30F2BD686A6C747A4C00006E616E004E414E00C9 +:208E8000696E6600494E460030000000002800E0401EFDD1704710B586B0FDF76DFCC02065 +:208EA000ADF8000003208DF802001C208DF8030000F04CF80020ADF808004BF6FF70ADF849 +:208EC0000A003C20ADF80C004FF48060ADF80E004FF48040ADF810005F4801905F4C01A960 +:208EE000204601F081FB0121204601F0DDFB06B010BD5B4A012903D10146104600F053B98F +:208F000019B90146104600F050B9704780B50121082000F0EDF9C020ADF8000014208DF89F +:208F2000030003208DF8020000F010F800F012F800F05BF800F05CF800F055F8002100F0BD +:208F400055F800F050F800F005F801BD00A9444800F0C4B800214020CBE780B5FFF7FAFFE9 +:208F6000002100F043F800F03EF800F041F800F03AF800F03AF800F036F8FFF7EBFF0220F2 +:208F8000BDE8024082E738B50446082508E000F02DF800F028F800F02BF800F024F864008D +:208FA0002846451EC0B230B1FFF7D4FF20064CBF01210021EBE7FFF7CDFF00F016F8FF249B +:208FC00000F011F800F043F848B900F011F800F00AF8FFF7BFFF00F006F8012032BD641E4D +:208FE000EED1002032BD022050E70121802080E7012140207DE770B5044608250026FFF783 +:020000040800F2 +:20900000F4FF0DE0FFF7A6FFFFF7EDFFFFF7F0FFFFF7E9FF760000F01AF808B146F00106C2 +:209020002846451EC0B20028ECD1FFF793FF002C0CBF01210021FFF7D9FFFFF7D4FFFFF7B9 +:20904000D7FFFFF7D0FFFFF785FFF0B270BD8021034800F0A1B80000A0860100005400403C +:20906000000C014070B504460D461646FFF74EFF7000C0B201E014F8010BFFF784FF284680 +:20908000451EC0B20028F6D1BDE8704065E7F8B504460D4616461F46FFF738FF7600F0B21B +:2090A000FFF771FF3846FFF76EFFFFF72FFF46F00100C0B2FFF767FF03E0FFF79CFF04F8D0 +:2090C000010B2846451E28B1EDB2002D0CBF00200120F2E7BDE8F1403FE700002DE9F041E6 +:2090E0000022CC7804F00F03E40644BF8C7823430C8801250F26E7B217B3D0F800C005FAD4 +:2091000002F7BE460EEA0408F04514D14FEA820E06FA0EF82CEA080C03FA0EFE4EEA0C0CE2 +:2091200091F803E0BEF1280F08BF476103D0BEF1480F08BF0761521C082AE0D3C0F800C09B +:20914000B4F5807F26D3D0F804C0002202F1080705FA07F7BE460EEA0408F04515D14FEA65 +:20916000820E06FA0EF82CEA080C03FA0EFE4EEA0C0C91F803E0BEF1280F08BF476191F88C +:2091800003E0BEF1480F08BF0761521C082ADDD3C0F804C0BDE8F08100228068084218BFAA +:2091A000012210467047016170474161704770B5134A00284CBF94691468C0F3034583B2AF +:2091C000460D3601B34000F44016B6F5401F06D124F07064156825F07065156008E0C60273 +:2091E00043BF032606FA05F5AC439C4344F0706401B11C43002801D5946170BD146070BDA2 +:2092000004000140002201F059BA00005048016841F00101016041684E4A114041600168B2 +:209220004D4A11400160016821F480210160416821F4FE0141604FF41F018160704747497C +:209240000860704747490860704745490A68920850EA8200086070474148006800F00C00DE +:20926000704741490860704730B53D490A683F4B02F00C02082A0ED10A680C68C2F38342B6 +:20928000921C3B4D5543E40302D50C68A40301D52B4600E0534303600B68364A0468C3F3F2 +:2092A00003139B5C24FA03F343600B684468C3F302239B5C24FA03F383600B684468C3F32D +:2092C000C2239B5C24FA03F3C3600968C368C1F381318918097CB3FBF1F1016130BD264A04 +:2092E0000029116814BF084321EA000010607047224A0029116814BF084321EA00001060D5 +:2093000070471F4A0029116814BF084321EA0000106070471B4A0029116814BF084321EA0B +:2093200000001060704700214209094B012A08BF1A6803D0022A0CBF1A6A5A6A012300F0AC +:209340001F0003FA00F0024218BF012108467047001002400000FFF8FFFFF6FE0000424200 +:209360000410024060004242D800424200127A0000093D001404002014100240181002407D +:209380001C1002400C100240DFF8D4100A6802F0380206E0DFF8C8100A6822F010020A6013 +:2093A0000A68104308607047FFE7DFF8B800DFF8B8100160DFF8B41001607047FFE7DFF8E4 +:2093C000B000016841F080010160704738B5054600F015F804280DD1DFF89440206840F008 +:2093E00002002060656000F006F8216841F6FD721140216032BD206840F0400020604FF48D +:020000040800F2 +:20940000302039E070B504460D4600F011F804280CD1174E306840F001003060258000F0CC +:2094200007F8316841F6FE721140316070BD08804FF4005020E00F490860704704200D49D2 +:209440000A68D20701D5012070470A68520701D5022070470968C90648BF03207047000078 +:20946000002002400420024023016745AB89EFCD102002400C20024010B5FFE70446FFF799 +:20948000DDFF03E02CB1FFF7D9FF641E0128F9D004B9052010BD00001B4908431B490860C4 +:2094A000704770B503781A460121C478ECB1174B1B6803F4E063C3F5E0631B0A4478C3F14B +:2094C0000405AC4085780F2626FA03F32B4023431B010F4C1355007842110E4B00F01F006C +:2094E00001FA00F043F8220070BD50110A4A03F01F03994042F8201070BD084A11400843CF +:2095000007490860704700000000FA050CED00E000E400E000E100E080E100E080FFFF1FA1 +:2095200008ED00E001684FF6FE72114001600021016041608160C1603349344A90421DD0A8 +:20954000334A904221D0334A904225D0324A904229D0324A90422DD0314A904203D1086864 +:2095600040F4700029E02F4A904203D1086840F0706022E02C492D4A904203D1086840F07B +:209580000F001AE02A4A904203D1086840F0F00013E0284A904203D1086840F470600CE0AD +:2095A000254A904203D1086840F4704005E0234A904203D1086840F470200860704702688D +:2095C0006FF30E128B681A430B6A1A430B691A434B691A438B691A43CB691A434B6A1A4311 +:2095E0008B6A1A430260CA6842600A6882604968C16070470029016812BF41F001014FF62B +:20960000FE7211400160704704000240080002401C000240300002404400024058000240F1 +:209620006C0002408000024004040240080402401C04024030040240440402405804024022 +:2096400030B50488DFF8D820DFF8BC30984218BF90420ED0B0F1804F1CBFDFF8B050A8429A +:2096600007D0DFF8AC50A8421CBFDFF8A850A84204D14FF68F752C404D882C43DFF8985035 +:20968000A8421CBFDFF89450A84204D04FF6FF452C40CD882C4304808C8884850C88048515 +:2096A000984218BF90420AD0DFF8782090421FBFDFF874209042DFF87420904201D1097A5F +:2096C00001860121818230BD0029018812BF41F001014FF6FE72114001807047002A8289C8 +:2096E00014BF114322EA0101818170470029018812BF41F080014FF67F7211400180704788 +:2097000000BFC94301827047002C01400004004000080040000C004000100040001400405B +:20972000003401400040014000440140004801400300002013F0030F09D0521E22BF13F8B8 +:20974000010B11F801CBB0EB0C00F3D07047121F22BF53F8040B51F804CB6045F7D0121DE8 +:209760000AD200BA9CFA8CFCB0EB0C0038BF6FF0000088BF01207047521E22BF13F8010BB1 +:2097800011F801CBB0EB0C00F6D0521C08BF10467047000000F10103810704D010F8011BD0 +:2097A00089B18107FAD10268B2F10131914311F0803F04BF50F8042FF6E710F8011B11B148 +:2097C00010F8011BFBE7C01A7047024600E0521C1378002BFBD111F8013B137012F8013BCC +:2097E000002BF8D17047000038B504460D461048FFF742FE05281CBF3420FFF71CFE2946CB +:020000040800F2 +:209800002046BDE83440FFF7FDBD10B50446A0050CD10748FFF730FE05281CBF3420FFF7C3 +:209820000AFE2046BDE81040FFF7D0BD10BD0000A086010010B5490001F1804101F5C04196 +:20984000521C521009E010F8013B10F8014B43EA042321F8023B891C521EF4D110BD49001D +:2098600001F1804101F5C041521C521004E051F8043B20F8023B521EF9D170474FF6F8710E +:209880000840DFF890110860704710B5DFF8882152F8203048F68F142340194324E010B5A1 +:2098A000DFF8742152F8203048F6BF742340CC0648BF83F01003890648BF83F020030FE054 +:2098C00010B5DFF8542152F820304BF68F742340CC0448BF83F48053890448BF83F40053B7 +:2098E00043F4004141F0800142F8201010BDDFF8281151F820204BF68F731A4082F44052C9 +:2099000042F4004209E0DFF8101151F8202048F68F631A4042F40042FFE742F0800241F890 +:2099200020207047DFF8F01051F8202052040AD551F8202048F68F731A4042F4404242F08E +:20994000800241F820207047334951F8202052060AD551F8202048F68F731A4042F400427E +:2099600042F0C00241F82020704738E0294A126892B202EBC000294A37E03BE02549096849 +:2099800089B201EBC00025493AE0224A126892B202EBC000224A2AE01E4A126892B202EBF8 +:2099A000C000204A02EB40003F2909D34A091F23194208BF521E1204910941F4004105E0DA +:2099C0004A08C90748BF521C12049109016070471049096889B201EBC000124914E00D4AD1 +:2099E000126892B202EBC0000F4A4908490042F8101070470749096889B201EBC0000A49FD +:209A000051F8100080B2704751F810008005800D70470000505C0040005C004008600040B2 +:209A2000046000400C600040006000400106090C41EA10207047000080B5964890F820103D +:209A4000022909D018D3042902D00ED3052913D1002180F820100CE0C17B28290CD1816A1B +:209A6000406ABDE8044000F09CBE0121002000F0F3F84FF440512BE101BD38B5854CE57B30 +:209A80000220FFF7A5FF60840246D8218248FFF7E6FE94F8200010B1012803D00AE0BDE849 +:209AA000314013E02A2D06D1A16A606ABDE8344000F0A1BE022000F0F9F82421052000F07A +:209AC0006BFE00210220BDE83440C5E010B5714C628C1AB170492046FDF77EFB6F486168D5 +:209AE0004160A1688160608C1F2806D0022000F0DDF8002020601A218DE0E27B282A18BF1D +:209B00002A2A0FD1607CA17C090441EA0060E17C40EA0120217D08436062A07DE17D41EA87 +:209B20000020A06220685E49884270D15D480068617B884204D3A07B401EC0B2102804D345 +:209B4000022000F0B3F8242165E0606AA16A002A49D0032A2BD0082A18BF0A2A53D0122AE2 +:209B600029D0152A4FD01A2A2DD01B2A27D01D2A49D01E2A23D0232A2DD0252A2FD0282A8C +:209B800035D02A2A37D02F2A39D0552A3BD05A2A1DD0882A18BF8A2A35D08F2A18BF9E2A6E +:209BA00031D0A82A1CBFAA2AAF2A2CD02FE0BDE8104000F0E9BDBDE8104000F0AFBDBDE8BE +:209BC000104000F0EDBDBDE8104000F0D5BDBDE8104000F0D5BDBDE8104000F0AEBDBDE8B8 +:209BE000104000F0B9BDBDE8104000F043BEBDE8104000F0D6BDBDE8104000F0FCBDBDE80E +:020000040800F2 +:209C0000104000F021BEBDE8104000F038BE022000F04CF82021052000F0BEFD00210120A1 +:209C2000BDE8104018E010B50C4622469821FFF701FE21460120FFF7A8FE30210120FFF77E +:209C40002EFE1448032180F8201014488168091B81600021017310BD10B50C460F4B124938 +:209C6000196018730D2298211846FFF7E3FD0D210120FFF78AFE0748052180F8201044B1E5 +:209C8000042180F8201030210120BDE81040FFF706BE10BD80300020403000202C3100202C +:209CA000555342437C3100205553425380B518B1022807D00AD301BD10210120BDE8044098 +:209CC000FFF7EDBD10210120FFF7E9FD4FF480510220BDE80440FFF7F3BD00000278C9B2FC +:209CE0008A421AB11CBF10F8012FF9E718BF002070470000C9B2830706D0521E22D310F8E4 +:209D0000013B9942F7D11FE0083A13D302F1040241EA012141EA014150F8043B121F21BFF2 +:209D20004B40A3F1013C2CEA030C1CF0803FF3D0C9B2001F083210F8013B521E28BF91EA2A +:209D4000030FF8D818BF0120401E70471B4213D1094236D12AB18446B0FBF2F002FB10C280 +:209D6000704700F0E7BDFCD30022002370470B000200002100207047904271EB030CF6D3C2 +:209D800070B5B1FA81F4B3FA83F52C1BA340C4F1200532FA05F63343A2405FF00046E6401B +:209DA00002E05B085FEA3202841A71EB030524BF204629467641F4D302000B00300000214B +:209DC00070BD012ACFD970B5140C20D0B1FA81F4B2FA82F5C4F120046419B4F12006D6D341 +:209DE000B2405FF00044F440002502E052085FEA3303C61A71EB020E24BF304671466441C9 +:209E00006D41F3D302000B002000290070BD0C46B1FBF2F102FB11452D0445EA1045B5FBB2 +:209E2000F2F402FB145580B240EA0545B5FBF2F002FB105240EA044070BD30B4436803F022 +:209E4000004201211B031B0B436004BF0368002B08D10DE00368DD0F45EA440444605B00CB +:209E60000360491E4468E302F4D523031B0B436043681A434260084630BC70474FF4001CD5 +:209E80001CEB410F94BF1CEB430F09E041EA030C50EA4C0C52EA0C0C03D2994208BF90426D +:209EA000704714BF8B428242704700004FF4001C1CEB410F94BF1CEB430F09E041EA030C4B +:209EC00050EA4C0C52EA0C0C03D28B4208BF8242704714BF994290427047000070B5044612 +:209EE0000D466068C0F30A5040F2FF72904207D16068000304BF2068002817D0022070BD79 +:209F000020B92046FFF799FF012867DA012D0FDB40F2FF71091A8D420AD36068002847BF8B +:209F200000202F4900202F49C4E90001012070BD4142A942616806DA6FF31E51401941EA89 +:209F40000050606041E001F000410122636862F31F536360401E451905F13500352803D30C +:209F600061600020206070BD002215F11F0F04DA20352268236000206060684213D0521EE0 +:209F80009241D243C0F1200325689D4055EAD2722568C540666806FA03F32B432360636806 +:209FA00023FA00F06060606808436060B2F1004F03D80DD12078C0070AD52068401C2060B4 +:209FC000206828B96068401C60604FF0FF3070BD6068884204BF20680028F6D1002070BD80 +:209FE0000000F0FF0000F07FF446400D40EAC120490006D200F014F8004248BF6FF000406C +:020000040800F2 +:20A00000604700F00DF84FF0004188428CBF084640426047400D40EAC120490080F00D80FA +:20A0200040F00040490DA1F58061491C05D4D1F11F0154BFC840C01770474FF00000704724 +:20A04000010040F10980F446404200F005F851F000416047010000BF09D0B0FA80F18840F7 +:20A06000C91CC1F58461090501EBD0214005704770B44FF0004591EA030F44BF6B4000F0A6 +:20A080005BBC00BF841A71EB030604D26E40001BB141121973414FF4001C1CEB410F34BFCE +:20A0A0007CEB430684E00C0DA4EB1356362E7DDC012E43DC45EAC32343EA525312BFD202E4 +:20A0C00092025B08240545EAC12141EA5051D2EBC020994125D407D1B0FA80F610FA06F11A +:20A0E00064D00020203608E0B1FA81F6B140C6F1200220FA02F21143B0404FEAF474B4EB50 +:20A10000465434F001064FEA74040AD8D6F50016760D04F00044F04061FA06F25040F14007 +:20A120004840C00A40EA415021F0004128BF5FEA500550F1000044EBD12137E045EAC323AD +:20A14000DB0A45EAC121C90AB6F120050EDD42EA0242120CC5F1200603FA06F6EB4042EAC5 +:20A1600006056D42984161F100010DE062FA06F5F240554063FA06FC82EA0C02F3405A4048 +:20A180006D42904161EB030111F4801F05D1641E620502D06D004041494121F48011430851 +:20A1A00075F1004350F1000041EB045170BC70471CEB410F15D223F0004352EA43060BD05D +:20A1C0004FEA4C0CBCEB410F04D80C0D661E342EB7DDEBE7801A994150EA410608BF0021D9 +:20A1E000E4E708BF1CEB430F28BF6FF00001DDE7B0B581EA030C0CF0004C40F2FF7515EA9D +:20A2000011541DBF15EA1357AC42AF4239E0E41923EA455343F48013C90241F0004141EAC8 +:20A22000505EC7021100A7FB020200284FF00000EEFB01204FF00001E3FB072118BF42F030 +:20A240000102401800214941E3FB0E01A4F580640F0302D252004041494154F101046CDDB8 +:20A26000470872F1004250F1000051EB0451A1F580115CBF41EA0C01B0BD4CEA0551002085 +:20A28000B0BD05EA1357AC4214BFAF4241E050EA410E1CBF52EA430E02E061460020B0BD1E +:20A2A00024423C441BD15FEA070EF6D0090302BF01460020AEF1140EB1FA81F7AEEB0704EC +:20A2C00001FA07FE0C37C7F1200100FA07F7C8404EEA000E23EA455343F48013A2E733F001 +:20A2E0000043B3FA83F704BFB2FA82FE77440B3FE41BB7F1200E2FBF02FA0EF3BB40C7F18D +:20A30000200E22FA0EFE38BF43EA0E03BA40641C82E750EA410E14BF52EA430E6FF0000186 +:20A320004FF4001717EB430F8ABF194617EB410FB5E74CEA05510020B0BDD4F10104B4F151 +:20A3400020070FDAC4F12007520828BF42F0010210FA07F501FA07F7E1BF2A43E0403843F4 +:20A36000E1400FE0352C98DCC7F1200452EA400220FA07F218BF42F0010231FA07F0A1407C +:20A380000A43002172F1004250F1000051EB0C01B0BD0000F0B540F2FF7581EA030C0CF0F2 +:20A3A000004C15EA11541DBF15EA1357AC42AF42E5E0BC41C1F31301C3F31303801A9941FF +:20A3C00043F4801304D2641E4000494180185941C90241EA5051B1FBF3F603FB1611A2FB71 +:20A3E0000675D7EBC020A94102D2761E80185941C90241EA5051B1FBF3FE03FB1E11A2FBBE +:020000040800F2 +:20A400000E75D7EBC020A94103D2AEF1010E80185941890241EA9051760546EA8E2EB1FBCE +:20A42000F3F603FB1611A2FB0675D7EB8020A94102D2761E80185941C90241EA50514EEA41 +:20A44000060EB1FBF3F603FB1611A2FB0675D7EBC020A94102D2761E80185941C90241EAFA +:20A460005051B1FBF3F703FB1711A2FB0735D3EBC020A94167F100070CBF004247F0010773 +:20A4800066F3D5274FEA1E31B80814F5806412DDBD0775F1004250EB0E5051EB045111F5A7 +:20A4A000801F5CBF41EA0C01F0BD4CF07F6141F0E0410020F0BDBD076D0840EA0E5041F4CC +:20A4C0008011D4F10104B4F120060ADAC4F120060200E04001FA06F3E1401843B2401543BB +:20A4E0000EE0342C13DCC6F1200445EA40056D0820FA06F2154321FA06F0A1400D4300218E +:20A5000075F1004250F1000051EB0C01F0BD00205FEA0C01F0BDCFB992185B41B3FA83F744 +:20A5200004BFB2FA82F6BF190B3FB7F120062FBF02FA06F3BB40C7F1200622FA06F638BF79 +:20A540003343BA401CB1E419641E33E77F4231F00041B1FA81F404BFB0FA80F6A4190B3CFB +:20A56000B4F120062FBF00FA06F1A140C4F1200620FA06F638BF3143A0403C1B1AE7AC42CE +:20A580001ABF05EA1357AF4212E050EA41061CBF52EA4306BFE750EA4107304661461CBFA5 +:20A5A00041EA0551F0BD52EA430C08BFC143F0BD00204FF4001616EB410F98BF16EB430FF6 +:20A5C00008BF16EB410F24BFC14305E016EB430F0CBF61464CEA0551F0BD91FBF2F303FB2A +:20A5E0001211C0E90031704770B586B004460D46A68800A8FEF738FE02992948B1FBF0F016 +:20A600004FF6C07232400243A28022884FF6FE731A4022802A68234B9A4208D25200B1FBDA +:20A62000F2F18AB2042A38BF042189B220E0EB884BF6FF76B34204D102EB4202B1FBF2F1C3 +:20A6400006E019235A43B1FBF2F141F4804189B20A0504BF41F0010189B241F4004189B28A +:20A6600080B24FF4967250434FF47A7290FBF2F0401C2084A183208840F0010020802088E9 +:20A680004FF6F5310840A9880843698908432080A88929890843208106B070BD00000000FC +:20A6A00040420F00A18601000029018812BF41F001014FF6FE72114001807047401810F095 +:20A6C000030308D0C91A1FD3DB0748BF00F8012D28BF20F8022D130030B414461546103995 +:20A6E00028BF20E93C00FAD8490728BF20E90C0048BF40F8042D890028BF20F8022D48BFE2 +:20A7000000F8012D30BC7047C91818BF00F8012DCB0728BF00F8012D704700007449087CBB +:20A72000C00702D57348052105E00FF2E410C97C252928BF2421FFF776BA6F480021818002 +:20A74000022181710021C1714172022181720021C1720C21FFF767BA6848002101800F21AE +:20A760008170FF21C17000218180022181710021C1710821FFF757BA04216148FFF753BA0C +:20A7800008216048FFF74FBA5948C17C132928BF12215D48FFF747BA5B4A90701173704739 +:20A7A00069E070B504460D46584E3078C0B92A462146282000F076F8C8B14D48007B0006BB +:20A7C00003D50220307029460CE00220FFF76EFA00F00EF801210120BDE87040FFF73CBA8A +:20A7E000022804D12046BDE87040FDF7C1BA70BD24210520D0E710B5444C2278EAB90A4600 +:020000040800F2 +:20A8000001462A2000F04EF8E8B13948007B000608D4012020704FF440510220BDE810405E +:20A82000FFF74EB80020FFF741FAFFF7E1FF00210120BDE81040FFF70FBA012A04BFBDE86C +:20A840001040FDF7E5BA10BD80B52948816829B9007C400702D40121002006E00220FFF7FE +:20A8600025FAFFF7C5FF00210120FFE7BDE80440FFF7F2B900BF01210020FFF7EDB980B57B +:20A880001B48816809B9002004E0007B00064CBF00200220FFF70AFA2021FFF7AAFF0021DD +:20A8A0000120E3E780B55118B1F5805F09D92A2804BF0220FFF7FAF90020FFF7F7F9212140 +:20A8C0000BE00B498968B1EB422F0ED02A280CBF02200020FFF7EAF92421FFF78AFF002140 +:20A8E0000120FFF7B9F9002002BD012002BD0000803000206831002038040020703100202A +:20A90000600400205404002000040020A030002000800202200000004D696E692044534FF0 +:20A920004469736B2020202020202020202020202020202070470000841A71EB030603D2FD +:20A94000001BB141121973414FF4001C1CEB410F34BF7CEB430443E00C0DA4EB1356352E1D +:20A9600050DC45EAC323DB0A45EAC121C912B6F120050DDD63FA05F6EB4086EA03051242C0 +:20A9800018BF45F00105C01851F100010CD213E062FA06F5F2405540F3415A40B340F340A7 +:20A9A0005A408018594107D349085FEA30005FEA350528BF45F0010501F58011420875F14B +:20A9C000004250F1000041EB045170BC4FF4001C1CEB410F38BF70470020090D09057047E8 +:20A9E0001CEB410F10D252EA43060BD0BCEB410F05D80C0DAB43661E342EB5DD02E0AB439B +:20AA00008018594170BC704770BC704710B5DFF8884700B92BE000F096F8006880472068DA +:20AA20000A3010BD80B5DFF870070068C178DFF86C2752788A420CD38278002A04BF82881B +:20AA4000002A06D1817200F07EF840688047002002BD022002BD10B5DFF83C4700B906E0AF +:20AA600000F071F88068804720680C3010BD206801210182002010BD10B5DFF81C4720689C +:20AA8000C1784079DFF8182712689269904721688A7A92B1002804BF087900280DD1887820 +:20AAA00058B900F050F8C068804720684179C1722068C1780173002010BD022010BD1CB507 +:20AAC000DFF8D416096810B90220088239E0DFF8D44600202080087800227F23184215D181 +:20AAE000487A81064CBF42F0020102F0FD0121702178400654BF01F0FE0041F001002070A9 +:20AB000000F021F800698047204616BD00F07F03012BF9D000F07F00022812D1487900F02F +:20AB20000F0142F0010200F088FA05D500F030001028E5D12270E3E700F44050B0F5805F12 +:20AB4000F7E7002016BDDFF8600600687047F8B5DFF844060068017811F07F0104D1417A08 +:20AB600001F0DF0141724FE0022901BF41880029017900294AD1417921F08005DFF82C46EE +:20AB80000A0654F825204CBF02F0300202F44052DFF808361B789D4238D2002A1CBF807ACD +:20ABA000002833D0080654F825000BD500F03000102825D12846FEF7C7FE30212846FEF7E1 +:20ABC0006EFE1DE000F44050B0F5805F18D148F280064BF68F7745B900F0BDFA206838406F +:20ABE00080F44050304320600AE02846FEF79AFE54F82500384080F44050304344F82500B8 +:020000040800F2 +:20AC0000FFF7A1FF406980470020F2BD0220F2BD38B5DFF884050268537923F08000DFF8A1 +:20AC20008C151C0651F820404CBF04F0300404F44054DFF868552D78A84206D2558825B933 +:20AC4000002C1CBF927A002A01D1022032BD48F280021B0651F8203005D548F6BF742340B0 +:20AC600083F0100304E04BF68F74234083F480531A4341F82020FFF766FF80698047002078 +:20AC800032BD80B5DFF810050068417A41F020014172FFF758FFC0698047002002BDDFF889 +:20ACA000F8241268538A20B98888C01A108200207047086818187047F8B5DFF8DC5428685A +:20ACC00000F110042688A168080018BF002E14D0A088864288BF064630468847074620880A +:20ACE000801B20806088301860800020FEF746FE324601463846FEF7B2FDDFF8B464208838 +:20AD000050B1DFF8B0044FF44051018000210020FEF73BFE3020308028682188A2889142AD +:20AD200028BF032101D211B105210172F1BD06210172DFF88404006880B2DFF8801400220C +:20AD400041F8102030203080F1BD2DE9F843DFF84844206800F110063188DFF85454002938 +:20AD600004BF007A042816D1DFF85404017801290DD1DFF84414096889B2DFF8402400239A +:20AD800042F8113030212980042703702CE007271020288028E0B6F80480884505D3042784 +:20ADA000414588BF4146884600E002274046B168884781460020FEF7E0FD424601464846E4 +:20ADC000FEF738FD41460020FEF7DFFD3088A0EB0800308070884044708030202880DFF89B +:20ADE000D4034FF44051018020680772BDE8F18338B5DFF8A4432068457801787F221142B0 +:20AE000038D1092D02D1FFF70DFE47E0052D1BD1C17880294FD28178002901BF81880029C3 +:20AE2000807A002847D10620DFF88C13096889B2DFF88823002342F81130DFF874133022C0 +:20AE40000A802168087231BD032D08D1C178012904BF8088002823D1FFF713FF1EE0012DF0 +:20AE600004BFC17801291BD18188C9B9407A80060DD415E001F07F00012804D10B2D0FD199 +:20AE8000FFF7FAFD0AE002280AD1012D02D1FFF75EFE03E0032D03D1FFF7BAFE0028C2D034 +:20AEA0002846BF49096849698847032808BF0920C7D00028B7D00820C3E738B5B64D286877 +:20AEC0004178B74C062913D101787F2211422AD18078012802D12068C16968E0022802D150 +:20AEE0002068016A63E003281DD12068416A5EE000293DD14188002904BFC188022912D14F +:20AF0000017981B901787F22114204BF8288002A2CD001F07F02012A10D100F089F810B965 +:20AF20002868807A10BB28684078216809698847032845D128680921017231BD01F07F01DD +:20AF40000229F0D1407900F00F0100F0700200F074F84CBF00F0300000F440508F4B1B7872 +:20AF60009942E0D2002ADED10028DCD095491EE0082905D100787F210842D4D1924916E0DC +:20AF80000A2902BF017801F07F010129CBD1817A0029C8D04188002901BF01790029C188B3 +:20AFA0000129C0D100F044F80028BCD187490800B9D028680022428281610020884700202D +:20AFC00029680A8A4FF6FF739A4208BF092004D0022818BF002A02D10820087231BD0878E7 +:20AFE00000061ED5C88800902368009C944202D2009808820FE082420DD293F82C00704C80 +:020000040800F2 +:20B00000824238BF002005D392FBF0F500FB152008B90120207093F82C008882BDE8314092 +:20B0200093E60320087263484FF44051018031BD002140792268926910475C4B000653F85E +:20B040002100704738B55C48006880B2604931F81000400000F1804000F5C0404E4C216802 +:20B060000A7A092A14D010F8012B0A70216810F8012B4A70851C35F8040BFEF7D7FC2168E2 +:20B0800048802888FEF7D2FC21688880A888C8802068012101722068C08810B9FFF7A8FE1A +:20B0A00001E0FFF70AFFBDE831403EE010B53A4C2068017A022918BF042904D1FFF745FEF1 +:20B0C0002068007A14E0062911D14178052902BF01787F22114206D1C07800F042F8FFF725 +:20B0E00032FD006A80472E48006880688047082017E010B5284C2068007A022818BF0428DC +:20B100000ED0032818BF052804D1FFF7D5FD2068007A06E0072803D121480068C0688047DA +:20B12000082021680872BDE8104080B500F013F819480068017A082906D11E494FF48052F7 +:20B140000A801B4910220A80007A092801D1012002BD002002BD1F4890F82C100020FEF7C9 +:20B160001BBC70B50D4909780022104B48F68F760BE0D4B253F824503540254345F40045B1 +:20B1800045F0800543F82450521C8A42F1D340F080001149086070BDC83000205C04002011 +:20B1A000CC30002084310020D0300020005C00408A31002088310020505C0040046000409E +:20B1C00091310020BFAA00080DAA000857AA000808600040D00200204C5C0040704700001B +:20B1E00080B500F0F8F88B4800680021817200F031F98948002141604FF40441874A118054 +:20B20000016087480021016001BD10B5854800218172804800688449C97941720020FEF711 +:20B220002DFB4FF400710020FEF72FFB20210020FEF735FB18210020FEF798FB7B4C00F0D5 +:20B2400042F858210020FEF790FB0020FEF75BFB0020FEF74CFB00210120FEF716FB9821D3 +:20B260000120FEF782FB20210120FEF718FB00210120FEF725FB00210220FEF706FBD82148 +:20B280000220FEF773FB94F82C100220FEF784FB4FF440510220FEF713FB00210220FEF79A +:20B2A000FEFA00F010F80020FEF721FB0020FFF758FF5B48012101605D485E4901605E4887 +:20B2C0000021017010BD94F82C100020FEF764BB50480068807A00B9704780B550480521B6 +:20B2E00001600120FEF730FB0220FEF71BFB52480021017001BD4E4800684E4988421CBF5B +:20B300000220FEF7D3BC704745480421016070477047704780B53F4909680A7802F07F0275 +:20B32000212A08BFFE280BD14888002801BF88880028C888012803D10FF28900020001D15E +:20B34000022002BD88610020488200F03BF8002002BD80B52F4909680A7802F07F02212AD9 +:20B3600008BFFF2815D14888002804BF888800280FD1C88868B90120FEF7E6FA0220FEF7A8 +:20B38000D1FA2B482B4901602B4800210170002002BD022002BD00290CBF002802207047E0 +:20B3A0002649FFF77CBC2649FFF779BC19490968C978062901DB00207047224A02EBC10145 +:20B3C000FFF76DBC28B91348006801210182002070471D4870471D4801684268806801B9F8 +:20B3E000704710B51A4B99700C0A1C710C0C9C71090E19729A72110A1973110C9973110EFE +:020000040800F2 +:20B4000019749874010A1975010C9975000E187610BD0000C8300020405C00408E310020A3 +:20B4200080310020AC300020A0B80008D00200208030002055534243A03000204404002098 +:20B440004C040020000300207C310020E8F7FF1FAC030020064801210160002101604160CC +:20B460004FF4E051034A1180FFE7016000207047405C00408E310020545F5374616E646292 +:20B4800079000000545F576F726B0000576169745F54696D6500000049646C655F54696D53 +:20B4A00065000000545F5374657000005475726E5F4F66665F76000054656D7053686F77A9 +:20B4C000466C6167000000005A65726F505F416400000000545F5374616E6462793D3230D7 +:20B4E00030000000545F576F726B3D3330300000576169745F54696D653D3138300000009D +:20B5000049646C655F54696D653D333630000000545F537465703D31300000005475726E53 +:20B520005F4F66665F763D313000000054656D7053686F77466C61673D3000005A65726F60 +:20B54000505F41643D3233390000000020202023283130307E343030290D0A0020202020AE +:20B56000202023283130307E343030290D0A0000202020232836307E39393939290D0A00AA +:20B5800020202023283330307E39393939290D0A00000000202020202020202328357E32BB +:20B5A00035290D0A000000002020202328397E3132290D0A0000000020202328302C3129D0 +:20B5C0000D0A00002020202023526561644F6E6C790D0A002DE9F84F0020ADF8000040F624 +:20B5E0008F7848F60F7B48F28006444F444CDFF81491DFF814A14BF6BF7525E054F820109B +:20B60000ADF80010BDF8001009040BD554F8201008EA010144F820103C4901EB800050F8AE +:20B62000040C8047BDF8000000060DD599F8000054F820100BEA010144F82010344901EBBD +:20B64000800050F8040C8047606CAAF80000000452D5BAF8000010F00F0089F80000CDD1D2 +:20B6600020683880388800F030007880388800F4405038802068284080F4005080F0200072 +:20B6800030432060BAF80000C006206805D40BEA00002060FFF70AFD16E0ADF80000BDF81C +:20B6A0000000000506D5206808EA00002060FFF7C9FC09E0BDF800000004C5D5206808EA3F +:20B6C00000002060FFF715FD206828403988C90448BF80F480503988890448BF80F4005000 +:20B6E0007988C90648BF80F010007988890648BF80F0200030432060BDE8F18F88310020DB +:20B70000005C0040923100208C310020E4030020C80300202E48016841F0010101604168BF +:20B720002C4A1140416001682B4A11400160016821F480210160416821F4FE0141604FF4F0 +:20B740001F0181600021026842F4803202600268491C920302D4B1F5A06FF8D10168890366 +:20B7600030D51E490A6842F010020A600A68920892000A600A6842F002020A6041684160D9 +:20B7800041684160416841F480614160416821F47C114160416841F4E8114160016841F001 +:20B7A0008071016001688901FCD54168890889004160416841F002014160416801F00C01EA +:20B7C0000829FAD106484FF00061016070470000001002400000FFF8FFFFF6FE00200240CA +:20B7E00008ED00E02DE9F04500F10801026801EB8202406800F001034008400002EB8000C4 +:020000040800F2 +:20B800000025AA460024A0460126374602E00027F44511D1824201D1BDE8F08552F804CB78 +:20B8200003B1CC4452F804EBE644F1E70D686D18091D51F804ABAA445545F7D066B115F97D +:20B84000014B0026012705E00D686D18091D51F804ABAA445545F7D0002C12D50FB115F822 +:20B86000018BF445D3D00CF8018B641CF9D40AE0F44518BF5545CBD015F8018B0CF8018B2B +:20B88000641E002CF4D50126C2E70000120100020000004083042057000201020301000005 +:20B8A00009022000010100C0320904000002080650040705810240000007050202400000D9 +:20B8C000040309042603530054004D006900630072006F0065006C0065006300740072000B +:20B8E0006F006E0069006300730000002603530054004D003300320020004D006100730069 +:20B9000073002000530074006F007200610067006500000010035300540020004D00610037 +:20B9200073007300FBF7D1F84FF48040FBF705F9FBF7FCF9FBF723FAFBF719F90020FBF767 +:20B94000A2F8C820FBF792F80120FBF79CF800F035F8FDF7A0FAFBF751F9FAF747FC0628F9 +:20B9600018BFFBF7D0FAFAF752FCFAF715FFFAF733FFFBF776F8F8F7FDFBFBF7EAFDFBF7BB +:20B980003BFEFAF74BFC0020FAF7B2FA40F6B830FAF70EFC084CFAF720FCFAF727FC0628BD +:20B9A00005D0206918B9FBF7FCFA32202061F9F731FFFAF78EFCEEE7D83000200448C06198 +:20B9C0000221017203490162034A426208680047AC300020D00200204C03002070B50D4C9F +:20B9E0000D4D286820800D4E208831880840400505D50B48406880474FF6FF302860208834 +:20BA000031880840000444BFBDE87040FFF7E2BD70BD00008C310020445C00408E3100206B +:20BA2000D0020020FEF708B8FEF727B810B5074979441831064C7C44163404E0081D0A6899 +:20BA4000511888470146A142F8D110BD0800000030000000BBABFFFF302D0000640400206D +:20BA60000000000081FDFFFF0200000002000000A0010000570200000000002064040000C4 +:20BA80007047FEE7FEE7FEE7FEE77047704770477047FFF7A3BFFBF7A7B9FBF7C5B9000065 +:20BAA00000F009F8002801D0FFF7C0FF0020FFF739FF00F002F80120704700F001B800002E +:20BAC0000746384600F002F8FBE70000C046C046024A11001820ABBEFBE700BF26000200FC +:20BAE000014880470148004715B70008F1BA0008C046C046C046C046FFF7D2FFFFF7C0BFCB +:20BB0000FFF7BFBFFFF7BEBFFFF7BDBFFFF7BCBFFFF7BBBFFFF7BABFFFF7B9BFFFF7B8BFA1 +:20BB2000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF6D +:20BB4000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF4D +:20BB6000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF78FBFFFF7FEBFFFF7FEBFFFF7FEBF9C +:20BB8000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF781BFFFF781BFFFF7FEBFFFF7FEBF07 +:20BBA000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFED +:20BBC000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFCD +:20BBE000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFAD +:020000040800F2 +:20BC0000FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF03040C7480FD000380740C04FC0004034A +:20BC20001C601C03FA000080FC400080FB00011F22FC42012213FC00044040C00080FD4085 +:20BC400000C0FD000540407F414040F700016060F600016060F9000078FB04018878FC0086 +:20BC6000076050484442414070F000016060F60002E01808FD04020818E0FD00020F302044 +:20BC8000FD400220300FFB00020808FCF7000240407FFD4081008100BF006278B4000884ED +:20BCA000B400088CB4000898B40008A4B40008ACB40008B8B40008C8B40008D4B40008E4F8 +:20BCC000B40008F0B4000800B5000810B500081CB500082CB500083CB500084CB500085C52 +:20BCE000B5000870B5000880B5000894B50008A8B50008B8B50008C4B50008010001E5008A +:20BD000000FADB005780AE80D5805280A8800F80C080D38000804080A0808D801480DA807D +:20BD2000028081803380D980F180DB803080A480A680AF0000E1B100080BB2000811B300DC +:20BD40000813B3000815B3000853B3000897B30008A1B30008A7B30008ADB30008FC0000BB +:20BD600040FD0004C0B8000804FD0004C4B8000826FD0004ECB8000826FD0004AC030020B0 +:20BD80001AFD000414B9000810F50003A00FE803FC000033F1000010FD0023DDB10008D15A +:20BDA000B20008DDB10008DDB10008DDB10008F7B20008DDB10008DDB1000809B30008FD69 +:20BDC000000201000AEA000010F100018813F60012881300001A03530054004D00330032B6 +:20BDE00000310030F3003825BA0008DDB10008DDB10008DDB10008DDB10008DDB10008DD05 +:20BE0000B10008DDB1000829BA0008DDB10008DDB10008DDB10008DDB10008DDB10008708A +:20BE2000FA00000AF00011010203040102030406070809020406080001FA0000EFFD0000D0 +:20BE400064FA000008FC000002FD00048CB8000812FD0004A0B8000820FC000006FA00049E +:20BE60000301000003FD0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:20BE8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:20BEA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2 +:20BEC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:20BEE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF62 +:20BF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:20BF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:20BF4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:20BF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:20BF8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:20BFA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:20BFC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:20BFE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF61 +:020000040800F2 +:20C00000F8FFFFFFFFFF00000000000000000000000000000000000000000000000000002D +:20C02000000000000000000000000000000000000000000000000000000000000000000000 +:20C040000000000000000000000000000000000000000000000000000000000000000000E0 +:20C060000000000000000000000000000000000000000000000000000000000000000000C0 +:20C080000000000000000000000000000000000000000000000000000000000000000000A0 +:20C0A000000000000000000000000000000000000000000000000000000000000000000080 +:20C0C000000000000000000000000000000000000000000000000000000000000000000060 +:20C0E000000000000000000000000000000000000000000000000000000000000000000040 +:20C1000000000000000000000000000000000000000000000000000000000000000000001F +:20C120000000000000000000000000000000000000000000000000000000000000000000FF +:20C140000000000000000000000000000000000000000000000000000000000000000000DF +:20C160000000000000000000000000000000000000000000000000000000000000000000BF +:20C1800000000000000000000000000000000000000000000000000000000000000000009F +:20C1A00000000000000000000000000000000000000000000000000000000000000000007F +:20C1C00000000000000000000000000000000000000000000000000000000000000000005F +:20C1E00000000000000000000000000000000000000000000000000000000000000000003F +:20C20000F8FFFFFFFFFF00000000000000000000000000000000000000000000000000002B +:20C220000000000000000000000000000000000000000000000000000000000000000000FE +:20C240000000000000000000000000000000000000000000000000000000000000000000DE +:20C260000000000000000000000000000000000000000000000000000000000000000000BE +:20C2800000000000000000000000000000000000000000000000000000000000000000009E +:20C2A00000000000000000000000000000000000000000000000000000000000000000007E +:20C2C00000000000000000000000000000000000000000000000000000000000000000005E +:20C2E00000000000000000000000000000000000000000000000000000000000000000003E +:20C3000000000000000000000000000000000000000000000000000000000000000000001D +:20C320000000000000000000000000000000000000000000000000000000000000000000FD +:20C340000000000000000000000000000000000000000000000000000000000000000000DD +:20C360000000000000000000000000000000000000000000000000000000000000000000BD +:20C3800000000000000000000000000000000000000000000000000000000000000000009D +:20C3A00000000000000000000000000000000000000000000000000000000000000000007D +:20C3C00000000000000000000000000000000000000000000000000000000000000000005D +:20C3E00000000000000000000000000000000000000000000000000000000000000000003D +:020000040800F2 +:20C40000434F4E46494720205458540000000000000000000000188DDD400200D60000008C +:20C420000000000000000000000000000000000000000000000000000000000000000000FC +:20C440000000000000000000000000000000000000000000000000000000000000000000DC +:20C460000000000000000000000000000000000000000000000000000000000000000000BC +:20C4800000000000000000000000000000000000000000000000000000000000000000009C +:20C4A00000000000000000000000000000000000000000000000000000000000000000007C +:20C4C00000000000000000000000000000000000000000000000000000000000000000005C +:20C4E00000000000000000000000000000000000000000000000000000000000000000003C +:20C5000000000000000000000000000000000000000000000000000000000000000000001B +:20C520000000000000000000000000000000000000000000000000000000000000000000FB +:20C540000000000000000000000000000000000000000000000000000000000000000000DB +:20C560000000000000000000000000000000000000000000000000000000000000000000BB +:20C5800000000000000000000000000000000000000000000000000000000000000000009B +:20C5A00000000000000000000000000000000000000000000000000000000000000000007B +:20C5C00000000000000000000000000000000000000000000000000000000000000000005B +:20C5E00000000000000000000000000000000000000000000000000000000000000000003B +:20C60000545F5374616E6462793D32303020202023283130307E343030290D0A545F576FBC +:20C62000726B3D33303020202020202023283130307E343030290D0A576169745F54696D41 +:20C64000653D313830202020232836307E39393939290D0A49646C655F54696D653D3336DA +:20C660003020202023283330307E39393939290D0A545F537465703D3130202020202020FD +:20C68000202328357E3235290D0A5475726E5F4F66665F763D31302020202328397E31327A +:20C6A000290D0A54656D7053686F77466C61673D3020202328302C31290D0A5A65726F50D4 +:20C6C0005F41643D3233392020202023526561644F6E6C790D0A00000000000000000000A3 +:20C6E00000000000000000000000000000000000000000000000000000000000000000003A +:20C70000000000000000000000000000000000000000000000000000000000000000000019 +:20C720000000000000000000000000000000000000000000000000000000000000000000F9 +:20C740000000000000000000000000000000000000000000000000000000000000000000D9 +:20C760000000000000000000000000000000000000000000000000000000000000000000B9 +:20C78000000000000000000000000000000000000000000000000000000000000000000099 +:20C7A000000000000000000000000000000000000000000000000000000000000000000079 +:20C7C000000000000000000000000000000000000000000000000000000000000000000059 +:20C7E000000000000000000000000000000000000000000000000000000000000000000039 +:020000040800F2 +:20C80000000000000000000000000000000000000000000000000000000000000000000018 +:20C820000000000000000000000000000000000000000000000000000000000000000000F8 +:20C840000000000000000000000000000000000000000000000000000000000000000000D8 +:20C860000000000000000000000000000000000000000000000000000000000000000000B8 +:20C88000000000000000000000000000000000000000000000000000000000000000000098 +:20C8A000000000000000000000000000000000000000000000000000000000000000000078 +:20C8C000000000000000000000000000000000000000000000000000000000000000000058 +:20C8E000000000000000000000000000000000000000000000000000000000000000000038 +:20C90000000000000000000000000000000000000000000000000000000000000000000017 +:20C920000000000000000000000000000000000000000000000000000000000000000000F7 +:20C940000000000000000000000000000000000000000000000000000000000000000000D7 +:20C960000000000000000000000000000000000000000000000000000000000000000000B7 +:20C98000000000000000000000000000000000000000000000000000000000000000000097 +:20C9A000000000000000000000000000000000000000000000000000000000000000000077 +:20C9C000000000000000000000000000000000000000000000000000000000000000000057 +:20C9E000000000000000000000000000000000000000000000000000000000000000000037 +:20CA0000000000000000000000000000000000000000000000000000000000000000000016 +:20CA20000000000000000000000000000000000000000000000000000000000000000000F6 +:20CA40000000000000000000000000000000000000000000000000000000000000000000D6 +:20CA60000000000000000000000000000000000000000000000000000000000000000000B6 +:20CA8000000000000000000000000000000000000000000000000000000000000000000096 +:20CAA000000000000000000000000000000000000000000000000000000000000000000076 +:20CAC000000000000000000000000000000000000000000000000000000000000000000056 +:20CAE000000000000000000000000000000000000000000000000000000000000000000036 +:20CB0000000000000000000000000000000000000000000000000000000000000000000015 +:20CB20000000000000000000000000000000000000000000000000000000000000000000F5 +:20CB40000000000000000000000000000000000000000000000000000000000000000000D5 +:20CB60000000000000000000000000000000000000000000000000000000000000000000B5 +:20CB8000000000000000000000000000000000000000000000000000000000000000000095 +:20CBA000000000000000000000000000000000000000000000000000000000000000000075 +:20CBC000000000000000000000000000000000000000000000000000000000000000000055 +:20CBE000000000000000000000000000000000000000000000000000000000000000000035 +:020000040800F2 +:20CC0000000000000000000000000000000000000000000000000000000000000000000014 +:20CC20000000000000000000000000000000000000000000000000000000000000000000F4 +:20CC40000000000000000000000000000000000000000000000000000000000000000000D4 +:20CC60000000000000000000000000000000000000000000000000000000000000000000B4 +:20CC8000000000000000000000000000000000000000000000000000000000000000000094 +:20CCA000000000000000000000000000000000000000000000000000000000000000000074 +:20CCC000000000000000000000000000000000000000000000000000000000000000000054 +:20CCE000000000000000000000000000000000000000000000000000000000000000000034 +:20CD0000000000000000000000000000000000000000000000000000000000000000000013 +:20CD20000000000000000000000000000000000000000000000000000000000000000000F3 +:20CD40000000000000000000000000000000000000000000000000000000000000000000D3 +:20CD60000000000000000000000000000000000000000000000000000000000000000000B3 +:20CD8000000000000000000000000000000000000000000000000000000000000000000093 +:20CDA000000000000000000000000000000000000000000000000000000000000000000073 +:20CDC000000000000000000000000000000000000000000000000000000000000000000053 +:20CDE000000000000000000000000000000000000000000000000000000000000000000033 +:20CE0000000000000000000000000000000000000000000000000000000000000000000012 +:20CE20000000000000000000000000000000000000000000000000000000000000000000F2 +:20CE40000000000000000000000000000000000000000000000000000000000000000000D2 +:20CE60000000000000000000000000000000000000000000000000000000000000000000B2 +:20CE8000000000000000000000000000000000000000000000000000000000000000000092 +:20CEA000000000000000000000000000000000000000000000000000000000000000000072 +:20CEC000000000000000000000000000000000000000000000000000000000000000000052 +:20CEE000000000000000000000000000000000000000000000000000000000000000000032 +:20CF0000000000000000000000000000000000000000000000000000000000000000000011 +:20CF20000000000000000000000000000000000000000000000000000000000000000000F1 +:20CF40000000000000000000000000000000000000000000000000000000000000000000D1 +:20CF60000000000000000000000000000000000000000000000000000000000000000000B1 +:20CF8000000000000000000000000000000000000000000000000000000000000000000091 +:20CFA000000000000000000000000000000000000000000000000000000000000000000071 +:20CFC000000000000000000000000000000000000000000000000000000000000000000051 +:20CFE000000000000000000000000000000000000000000000000000000000000000000031 +:020000040800F2 +:20D00000000000000000000000000000000000000000000000000000000000000000000010 +:20D020000000000000000000000000000000000000000000000000000000000000000000F0 +:20D040000000000000000000000000000000000000000000000000000000000000000000D0 +:20D060000000000000000000000000000000000000000000000000000000000000000000B0 +:20D08000000000000000000000000000000000000000000000000000000000000000000090 +:20D0A000000000000000000000000000000000000000000000000000000000000000000070 +:20D0C000000000000000000000000000000000000000000000000000000000000000000050 +:20D0E000000000000000000000000000000000000000000000000000000000000000000030 +:20D1000000000000000000000000000000000000000000000000000000000000000000000F +:20D120000000000000000000000000000000000000000000000000000000000000000000EF +:20D140000000000000000000000000000000000000000000000000000000000000000000CF +:20D160000000000000000000000000000000000000000000000000000000000000000000AF +:20D1800000000000000000000000000000000000000000000000000000000000000000008F +:20D1A00000000000000000000000000000000000000000000000000000000000000000006F +:20D1C00000000000000000000000000000000000000000000000000000000000000000004F +:20D1E00000000000000000000000000000000000000000000000000000000000000000002F +:20D2000000000000000000000000000000000000000000000000000000000000000000000E +:20D220000000000000000000000000000000000000000000000000000000000000000000EE +:20D240000000000000000000000000000000000000000000000000000000000000000000CE +:20D260000000000000000000000000000000000000000000000000000000000000000000AE +:20D2800000000000000000000000000000000000000000000000000000000000000000008E +:20D2A00000000000000000000000000000000000000000000000000000000000000000006E +:20D2C00000000000000000000000000000000000000000000000000000000000000000004E +:20D2E00000000000000000000000000000000000000000000000000000000000000000002E +:20D3000000000000000000000000000000000000000000000000000000000000000000000D +:20D320000000000000000000000000000000000000000000000000000000000000000000ED +:20D340000000000000000000000000000000000000000000000000000000000000000000CD +:20D360000000000000000000000000000000000000000000000000000000000000000000AD +:20D3800000000000000000000000000000000000000000000000000000000000000000008D +:20D3A00000000000000000000000000000000000000000000000000000000000000000006D +:20D3C00000000000000000000000000000000000000000000000000000000000000000004D +:20D3E00000000000000000000000000000000000000000000000000000000000000000002D +:020000040800F2 +:20D4000000000000000000000000000000000000000000000000000000000000000000000C +:20D420000000000000000000000000000000000000000000000000000000000000000000EC +:20D440000000000000000000000000000000000000000000000000000000000000000000CC +:20D460000000000000000000000000000000000000000000000000000000000000000000AC +:20D4800000000000000000000000000000000000000000000000000000000000000000008C +:20D4A00000000000000000000000000000000000000000000000000000000000000000006C +:20D4C00000000000000000000000000000000000000000000000000000000000000000004C +:20D4E00000000000000000000000000000000000000000000000000000000000000000002C +:20D5000000000000000000000000000000000000000000000000000000000000000000000B +:20D520000000000000000000000000000000000000000000000000000000000000000000EB +:20D540000000000000000000000000000000000000000000000000000000000000000000CB +:20D560000000000000000000000000000000000000000000000000000000000000000000AB +:20D5800000000000000000000000000000000000000000000000000000000000000000008B +:20D5A00000000000000000000000000000000000000000000000000000000000000000006B +:20D5C00000000000000000000000000000000000000000000000000000000000000000004B +:20D5E00000000000000000000000000000000000000000000000000000000000000000002B +:20D6000000000000000000000000000000000000000000000000000000000000000000000A +:20D620000000000000000000000000000000000000000000000000000000000000000000EA +:20D640000000000000000000000000000000000000000000000000000000000000000000CA +:20D660000000000000000000000000000000000000000000000000000000000000000000AA +:20D6800000000000000000000000000000000000000000000000000000000000000000008A +:20D6A00000000000000000000000000000000000000000000000000000000000000000006A +:20D6C00000000000000000000000000000000000000000000000000000000000000000004A +:20D6E00000000000000000000000000000000000000000000000000000000000000000002A +:20D70000000000000000000000000000000000000000000000000000000000000000000009 +:20D720000000000000000000000000000000000000000000000000000000000000000000E9 +:20D740000000000000000000000000000000000000000000000000000000000000000000C9 +:20D760000000000000000000000000000000000000000000000000000000000000000000A9 +:20D78000000000000000000000000000000000000000000000000000000000000000000089 +:20D7A000000000000000000000000000000000000000000000000000000000000000000069 +:20D7C000000000000000000000000000000000000000000000000000000000000000000049 +:20D7E000000000000000000000000000000000000000000000000000000000000000000029 +:020000040800F2 +:20D80000000000000000000000000000000000000000000000000000000000000000000008 +:20D820000000000000000000000000000000000000000000000000000000000000000000E8 +:20D840000000000000000000000000000000000000000000000000000000000000000000C8 +:20D860000000000000000000000000000000000000000000000000000000000000000000A8 +:20D88000000000000000000000000000000000000000000000000000000000000000000088 +:20D8A000000000000000000000000000000000000000000000000000000000000000000068 +:20D8C000000000000000000000000000000000000000000000000000000000000000000048 +:20D8E000000000000000000000000000000000000000000000000000000000000000000028 +:20D90000000000000000000000000000000000000000000000000000000000000000000007 +:20D920000000000000000000000000000000000000000000000000000000000000000000E7 +:20D940000000000000000000000000000000000000000000000000000000000000000000C7 +:20D960000000000000000000000000000000000000000000000000000000000000000000A7 +:20D98000000000000000000000000000000000000000000000000000000000000000000087 +:20D9A000000000000000000000000000000000000000000000000000000000000000000067 +:20D9C000000000000000000000000000000000000000000000000000000000000000000047 +:20D9E000000000000000000000000000000000000000000000000000000000000000000027 +:20DA0000000000000000000000000000000000000000000000000000000000000000000006 +:20DA20000000000000000000000000000000000000000000000000000000000000000000E6 +:20DA40000000000000000000000000000000000000000000000000000000000000000000C6 +:20DA60000000000000000000000000000000000000000000000000000000000000000000A6 +:20DA8000000000000000000000000000000000000000000000000000000000000000000086 +:20DAA000000000000000000000000000000000000000000000000000000000000000000066 +:20DAC000000000000000000000000000000000000000000000000000000000000000000046 +:20DAE000000000000000000000000000000000000000000000000000000000000000000026 +:20DB0000000000000000000000000000000000000000000000000000000000000000000005 +:20DB20000000000000000000000000000000000000000000000000000000000000000000E5 +:20DB40000000000000000000000000000000000000000000000000000000000000000000C5 +:20DB60000000000000000000000000000000000000000000000000000000000000000000A5 +:20DB8000000000000000000000000000000000000000000000000000000000000000000085 +:20DBA000000000000000000000000000000000000000000000000000000000000000000065 +:20DBC000000000000000000000000000000000000000000000000000000000000000000045 +:20DBE000000000000000000000000000000000000000000000000000000000000000000025 +:020000040800F2 +:20DC0000000000000000000000000000000000000000000000000000000000000000000004 +:20DC20000000000000000000000000000000000000000000000000000000000000000000E4 +:20DC40000000000000000000000000000000000000000000000000000000000000000000C4 +:20DC60000000000000000000000000000000000000000000000000000000000000000000A4 +:20DC8000000000000000000000000000000000000000000000000000000000000000000084 +:20DCA000000000000000000000000000000000000000000000000000000000000000000064 +:20DCC000000000000000000000000000000000000000000000000000000000000000000044 +:20DCE000000000000000000000000000000000000000000000000000000000000000000024 +:20DD0000000000000000000000000000000000000000000000000000000000000000000003 +:20DD20000000000000000000000000000000000000000000000000000000000000000000E3 +:20DD40000000000000000000000000000000000000000000000000000000000000000000C3 +:20DD60000000000000000000000000000000000000000000000000000000000000000000A3 +:20DD8000000000000000000000000000000000000000000000000000000000000000000083 +:20DDA000000000000000000000000000000000000000000000000000000000000000000063 +:20DDC000000000000000000000000000000000000000000000000000000000000000000043 +:20DDE000000000000000000000000000000000000000000000000000000000000000000023 +:20DE0000000000000000000000000000000000000000000000000000000000000000000002 +:20DE20000000000000000000000000000000000000000000000000000000000000000000E2 +:20DE40000000000000000000000000000000000000000000000000000000000000000000C2 +:20DE60000000000000000000000000000000000000000000000000000000000000000000A2 +:20DE8000000000000000000000000000000000000000000000000000000000000000000082 +:20DEA000000000000000000000000000000000000000000000000000000000000000000062 +:20DEC000000000000000000000000000000000000000000000000000000000000000000042 +:20DEE000000000000000000000000000000000000000000000000000000000000000000022 +:20DF0000000000000000000000000000000000000000000000000000000000000000000001 +:20DF20000000000000000000000000000000000000000000000000000000000000000000E1 +:20DF40000000000000000000000000000000000000000000000000000000000000000000C1 +:20DF60000000000000000000000000000000000000000000000000000000000000000000A1 +:20DF8000000000000000000000000000000000000000000000000000000000000000000081 +:20DFA000000000000000000000000000000000000000000000000000000000000000000061 +:20DFC000000000000000000000000000000000000000000000000000000000000000000041 +:20DFE000000000000000000000000000000000000000000000000000000000000000000021 +:020000040800F2 +:20E00000000000000000000000000000000000000000000000000000000000000000000000 +:20E020000000000000000000000000000000000000000000000000000000000000000000E0 +:20E040000000000000000000000000000000000000000000000000000000000000000000C0 +:20E060000000000000000000000000000000000000000000000000000000000000000000A0 +:20E08000000000000000000000000000000000000000000000000000000000000000000080 +:20E0A000000000000000000000000000000000000000000000000000000000000000000060 +:20E0C000000000000000000000000000000000000000000000000000000000000000000040 +:20E0E000000000000000000000000000000000000000000000000000000000000000000020 +:20E100000000000000000000000000000000000000000000000000000000000000000000FF +:20E120000000000000000000000000000000000000000000000000000000000000000000DF +:20E140000000000000000000000000000000000000000000000000000000000000000000BF +:20E1600000000000000000000000000000000000000000000000000000000000000000009F +:20E1800000000000000000000000000000000000000000000000000000000000000000007F +:20E1A00000000000000000000000000000000000000000000000000000000000000000005F +:20E1C00000000000000000000000000000000000000000000000000000000000000000003F +:20E1E00000000000000000000000000000000000000000000000000000000000000000001F +:20E200000000000000000000000000000000000000000000000000000000000000000000FE +:20E220000000000000000000000000000000000000000000000000000000000000000000DE +:20E240000000000000000000000000000000000000000000000000000000000000000000BE +:20E2600000000000000000000000000000000000000000000000000000000000000000009E +:20E2800000000000000000000000000000000000000000000000000000000000000000007E +:20E2A00000000000000000000000000000000000000000000000000000000000000000005E +:20E2C00000000000000000000000000000000000000000000000000000000000000000003E +:20E2E00000000000000000000000000000000000000000000000000000000000000000001E +:20E300000000000000000000000000000000000000000000000000000000000000000000FD +:20E320000000000000000000000000000000000000000000000000000000000000000000DD +:20E340000000000000000000000000000000000000000000000000000000000000000000BD +:20E3600000000000000000000000000000000000000000000000000000000000000000009D +:20E3800000000000000000000000000000000000000000000000000000000000000000007D +:20E3A00000000000000000000000000000000000000000000000000000000000000000005D +:20E3C00000000000000000000000000000000000000000000000000000000000000000003D +:20E3E00000000000000000000000000000000000000000000000000000000000000000001D +:020000040800F2 +:20E400000000000000000000000000000000000000000000000000000000000000000000FC +:20E420000000000000000000000000000000000000000000000000000000000000000000DC +:20E440000000000000000000000000000000000000000000000000000000000000000000BC +:20E4600000000000000000000000000000000000000000000000000000000000000000009C +:20E4800000000000000000000000000000000000000000000000000000000000000000007C +:20E4A00000000000000000000000000000000000000000000000000000000000000000005C +:20E4C00000000000000000000000000000000000000000000000000000000000000000003C +:20E4E00000000000000000000000000000000000000000000000000000000000000000001C +:20E500000000000000000000000000000000000000000000000000000000000000000000FB +:20E520000000000000000000000000000000000000000000000000000000000000000000DB +:20E540000000000000000000000000000000000000000000000000000000000000000000BB +:20E5600000000000000000000000000000000000000000000000000000000000000000009B +:20E5800000000000000000000000000000000000000000000000000000000000000000007B +:20E5A00000000000000000000000000000000000000000000000000000000000000000005B +:20E5C00000000000000000000000000000000000000000000000000000000000000000003B +:20E5E00000000000000000000000000000000000000000000000000000000000000000001B +:20E60000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A +:20E62000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA +:20E64000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA +:20E66000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA +:20E68000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A +:20E6A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A +:20E6C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A +:20E6E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A +:20E70000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19 +:20E72000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9 +:20E74000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9 +:20E76000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9 +:20E78000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99 +:20E7A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79 +:20E7C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59 +:20E7E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39 +:020000040800F2 +:20E80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF18 +:20E82000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8 +:20E84000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8 +:20E86000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB8 +:20E88000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF98 +:20E8A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF78 +:20E8C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58 +:20E8E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF38 +:20E90000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF17 +:20E92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7 +:20E94000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD7 +:20E96000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB7 +:20E98000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF97 +:20E9A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF77 +:20E9C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57 +:20E9E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF37 +:20EA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF16 +:20EA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6 +:20EA4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD6 +:20EA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB6 +:20EA8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF96 +:20EAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF76 +:20EAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56 +:20EAE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF36 +:20EB0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF15 +:20EB2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5 +:20EB4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD5 +:20EB6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB5 +:20EB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF95 +:20EBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF75 +:20EBC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF55 +:20EBE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF35 +:020000040800F2 +:20EC0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF14 +:20EC2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4 +:20EC4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD4 +:20EC6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB4 +:20EC8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94 +:20ECA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF74 +:20ECC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF54 +:20ECE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF34 +:20ED0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF13 +:20ED2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3 +:20ED4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3 +:20ED6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB3 +:20ED8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF93 +:20EDA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF73 +:20EDC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF53 +:20EDE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF33 +:20EE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF12 +:20EE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 +:20EE4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2 +:20EE6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB2 +:20EE8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF92 +:20EEA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF72 +:20EEC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF52 +:20EEE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF32 +:20EF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11 +:20EF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1 +:20EF4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1 +:20EF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB1 +:20EF8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91 +:20EFA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71 +:20EFC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF51 +:20EFE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF31 +:020000040800F2 +:20F00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF10 +:20F02000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 +:20F04000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0 +:20F06000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0 +:20F08000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90 +:20F0A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70 +:20F0C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50 +:20F0E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30 +:20F10000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F +:20F12000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF +:20F14000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCF +:20F16000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAF +:20F18000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F +:20F1A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6F +:20F1C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4F +:20F1E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2F +:20F20000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E +:20F22000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE +:20F24000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE +:20F26000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAE +:20F28000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E +:20F2A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E +:20F2C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E +:20F2E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E +:20F30000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D +:20F32000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED +:20F34000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD +:20F36000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD +:20F38000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8D +:20F3A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6D +:20F3C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D +:20F3E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D +:020000040800F2 +:20F40000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0C +:20F42000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC +:20F44000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC +:20F46000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC +:20F48000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8C +:20F4A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C +:20F4C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4C +:20F4E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2C +:20F50000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B +:20F52000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB +:20F54000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB +:20F56000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB +:20F58000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B +:20F5A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B +:20F5C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B +:20F5E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2B +:20F60000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A +:20F62000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA +:20F64000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA +:20F66000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA +:20F68000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A +:20F6A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A +:20F6C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A +:20F6E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A +:20F70000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09 +:20F72000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9 +:20F74000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9 +:20F76000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9 +:20F78000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89 +:20F7A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69 +:20F7C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49 +:20F7E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29 +:020000040800F2 +:20F80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 +:20F82000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8 +:20F84000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC8 +:20F86000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA8 +:20F88000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF88 +:20F8A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF68 +:20F8C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF48 +:20F8E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF28 +:20F90000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF07 +:20F92000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE7 +:20F94000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7 +:20F96000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA7 +:20F98000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87 +:20F9A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF67 +:20F9C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF47 +:20F9E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27 +:20FA0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06 +:20FA2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE6 +:20FA4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC6 +:20FA6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA6 +:20FA8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF86 +:20FAA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF66 +:20FAC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF46 +:20FAE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF26 +:20FB0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF05 +:20FB2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5 +:20FB4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC5 +:20FB6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA5 +:20FB8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF85 +:20FBA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF65 +:20FBC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF45 +:20FBE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF25 +:020000040800F2 +:20FC0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF04 +:20FC2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE4 +:20FC4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC4 +:20FC6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA4 +:20FC8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF84 +:20FCA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF64 +:20FCC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF44 +:20FCE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF24 +:20FD0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03 +:20FD2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE3 +:20FD4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC3 +:20FD6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA3 +:20FD8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF83 +:20FDA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF63 +:20FDC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF43 +:20FDE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF23 +:20FE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 +:20FE2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2 +:20FE4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC2 +:20FE6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA2 +:20FE8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF82 +:20FEA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF62 +:20FEC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF42 +:20FEE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF22 +:20FF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +:20FF2000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1 +:20FF4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC1 +:20FF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA1 +:20FF8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81 +:20FFA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF61 +:20FFC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41 +:20FFE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21 +:00000001FF diff --git a/README.md b/README.md index f2c2c361..71e7cf9a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,32 @@ # TS100 -Source code for the TS100 Soldering Iron +This is a complete open source re-write of the software for the ts100 soldering iron. -## UNTESTED! +This was started to remove the need for USB for changing system settings. -This repository is my attempt (so far) at converting the source code for the TS100 soldering iron to the free System Workbench IDE and gcc based compilers. +The software has similar functionality to the original firmware. -I am also attempting to translate / comment as a go for a reference. - -Untested on actual hardware until noted otherwise. +## Features Working +* Soldering / Temperature control +* Full PID Iron Temp +* Adjusting temperature +* Automatic sleep +* Motion wake support +* Basic settings menu +* Input voltage UVLO measurement +* Saving settings to flash for persistence +* Improved GUI +* Use hardware I2C for communications +* Can disable movement detection if desired +## Features still to be implemented +* Manual Temp Calibration +# Upgrading your ts100 iron +This is completely safe, if it goes wrong just put the .hex file from the official website onto the unit and your back to the old firmware :) +1. Hold the button closest to the tip, and plug in the USB to the computer. +2. The unit will appear as a USB drive. +3. Drag the .hex file onto the USB drive. +4. The unit will disconnect and reconnect. +5. The filename will have changed to end in .RDY or .ERR . +6. If it ends with .RDY your done! Otherwise something went wrong. +7. If it went wrong try on a windows computer, some Mac / Linux machines do not play well with their boot loader. diff --git a/SystemDesign.md b/SystemDesign.md index 2a4d72c0..655e08e5 100644 --- a/SystemDesign.md +++ b/SystemDesign.md @@ -6,7 +6,7 @@ This is used for motion detection of the soldering iron. # USB Disk When the unit is plugged into the computer, it presents a FAT device to the operating system over the usb connection. -This is implimented using a ram buffer for the disk. +This is implemented using a ram buffer for the disk. @@ -14,10 +14,8 @@ This is implimented using a ram buffer for the disk. # Future improvements to be made These features are things I would like to add to the firmware -* Use hardware PWM for driving the heating element. * Use the sysTick hardware for timing of events * Move all the settings to an on device menu system instead of usb link * Move error codes into a unified struct * Rewrite most of the OLED stack to not require hardcoded values * Rework the modes of the unit to be neater - diff --git a/TS100/TS100.ioc b/TS100/TS100.ioc index 1b9ab12c..f360e2bf 100644 --- a/TS100/TS100.ioc +++ b/TS100/TS100.ioc @@ -42,8 +42,8 @@ Mcu.Pin9=PA14 Mcu.PinsNb=16 Mcu.UserConstants= Mcu.UserName=STM32F103T8Ux -MxCube.Version=4.16.0 -MxDb.Version=DB.4.0.160 +MxCube.Version=4.16.1 +MxDb.Version=DB.4.0.161 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true @@ -107,7 +107,7 @@ PB7.Signal=I2C1_SDA PCC.Checker=false PCC.Line=STM32F103 PCC.MCU=STM32F103T(8-B)Ux -PCC.MXVersion=4.16.0 +PCC.MXVersion=4.16.1 PCC.PartNumber=STM32F103T8Ux PCC.Seq0=0 PCC.Series=STM32F1 @@ -127,13 +127,13 @@ ProjectManager.HeapSize=0x200 ProjectManager.KeepUserCode=true ProjectManager.LastFirmware=true ProjectManager.LibraryCopy=1 -ProjectManager.PreviousToolchain= +ProjectManager.PreviousToolchain=SW4STM32 ProjectManager.ProjectBuild=false ProjectManager.ProjectFileName=TS100.ioc ProjectManager.ProjectName=TS100 ProjectManager.StackSize=0x400 ProjectManager.TargetToolchain=SW4STM32 -ProjectManager.ToolChainLocation=/home/ralim/Repo/ts100/TS100 +ProjectManager.ToolChainLocation=C\:\\Users\\Ralim\\Repo\\ts100\\TS100 ProjectManager.UnderRoot=true ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false,2-MX_I2C1_Init-I2C1-false,3-MX_ADC2_Init-ADC2-false,4-MX_USB_PCD_Init-USB-false,5-MX_ADC1_Init-ADC1-false RCC.ADCFreqValue=12000000 @@ -147,12 +147,13 @@ RCC.APB2TimFreq_Value=48000000 RCC.FCLKCortexFreq_Value=48000000 RCC.FamilyName=M RCC.HCLKFreq_Value=48000000 -RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtualString,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value +RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSource,PLLSourceVirtual,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value RCC.MCOFreq_Value=48000000 RCC.PLLCLKFreq_Value=48000000 RCC.PLLMCOFreq_Value=24000000 RCC.PLLMUL=RCC_PLL_MUL12 -RCC.PLLSourceVirtualString=RCC_PLLSOURCE_HSI_DIV2 +RCC.PLLSource=RCC_PLLSOURCE_HSI_DIV2 +RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI_DIV2 RCC.SYSCLKFreq_VALUE=48000000 RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK RCC.TimSysFreq_Value=48000000 diff --git a/workspace/ts100/.cproject b/workspace/ts100/.cproject index f9e92c1f..e6af6223 100644 --- a/workspace/ts100/.cproject +++ b/workspace/ts100/.cproject @@ -14,22 +14,26 @@ - + - diff --git a/workspace/ts100/.gitignore b/workspace/ts100/.gitignore new file mode 100644 index 00000000..3df573fe --- /dev/null +++ b/workspace/ts100/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/workspace/ts100/.settings/language.settings.xml b/workspace/ts100/.settings/language.settings.xml deleted file mode 100644 index 9cc48e9a..00000000 --- a/workspace/ts100/.settings/language.settings.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/workspace/ts100/LinkerScript.ld b/workspace/ts100/LinkerScript.ld index 80516a9f..cc040105 100644 --- a/workspace/ts100/LinkerScript.ld +++ b/workspace/ts100/LinkerScript.ld @@ -62,9 +62,11 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K - ROM (rx) : ORIGIN = 0x08004000, LENGTH = 36K + ROM (rx) : ORIGIN = 0x08004000, LENGTH = 47K + } -/*^ The rom is shortened as the last ~10K is used for storing the virtual USB Disk, and the offset at the beginning in the bootloader*/ +/*ROM (rx) : ORIGIN = 0x08004000, LENGTH = 48K*/ +/*^ The offset at the beginning in the bootloader, 1K at the end for settings (actually 256 bytes, but leaving room for now)*/ /* Sections */ SECTIONS { diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_core.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_core.h deleted file mode 100644 index ac95cc58..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_core.h +++ /dev/null @@ -1,259 +0,0 @@ -/** - ****************************************************************************** - * @file usb_core.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Standard protocol processing functions prototypes - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_CORE_H -#define __USB_CORE_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -typedef enum _CONTROL_STATE -{ - WAIT_SETUP, /* 0 */ - SETTING_UP, /* 1 */ - IN_DATA, /* 2 */ - OUT_DATA, /* 3 */ - LAST_IN_DATA, /* 4 */ - LAST_OUT_DATA, /* 5 */ - WAIT_STATUS_IN, /* 7 */ - WAIT_STATUS_OUT, /* 8 */ - STALLED, /* 9 */ - PAUSE /* 10 */ -} CONTROL_STATE; /* The state machine states of a control pipe */ - -typedef struct OneDescriptor -{ - uint8_t *Descriptor; - uint16_t Descriptor_Size; -} -ONE_DESCRIPTOR, *PONE_DESCRIPTOR; -/* All the request process routines return a value of this type - If the return value is not SUCCESS or NOT_READY, - the software will STALL the correspond endpoint */ -typedef enum _RESULT -{ - USB_SUCCESS = 0, /* Process successfully */ - USB_ERROR, - USB_UNSUPPORT, - USB_NOT_READY /* The process has not been finished, endpoint will be - NAK to further request */ -} RESULT; - - -/*-*-*-*-*-*-*-*-*-*-* Definitions for endpoint level -*-*-*-*-*-*-*-*-*-*-*-*/ -typedef struct _ENDPOINT_INFO -{ - /* When send data out of the device, - CopyData() is used to get data buffer 'Length' bytes data - if Length is 0, - CopyData() returns the total length of the data - if the request is not supported, returns 0 - (NEW Feature ) - if CopyData() returns -1, the calling routine should not proceed - further and will resume the SETUP process by the class device - if Length is not 0, - CopyData() returns a pointer to indicate the data location - Usb_wLength is the data remain to be sent, - Usb_wOffset is the Offset of original data - When receive data from the host, - CopyData() is used to get user data buffer which is capable - of Length bytes data to copy data from the endpoint buffer. - if Length is 0, - CopyData() returns the available data length, - if Length is not 0, - CopyData() returns user buffer address - Usb_rLength is the data remain to be received, - Usb_rPointer is the Offset of data buffer - */ - uint16_t Usb_wLength; - uint16_t Usb_wOffset; - uint16_t PacketSize; - uint8_t *(*CopyData)(uint16_t Length); -}ENDPOINT_INFO; - -/*-*-*-*-*-*-*-*-*-*-*-* Definitions for device level -*-*-*-*-*-*-*-*-*-*-*-*/ - -typedef struct _DEVICE -{ - uint8_t Total_Endpoint; /* Number of endpoints that are used */ - uint8_t Total_Configuration;/* Number of configuration available */ -} -DEVICE; - -typedef union -{ - uint16_t w; - struct BW - { - uint8_t bb1; - uint8_t bb0; - } - bw; -} uint16_t_uint8_t; - -typedef struct _DEVICE_INFO -{ - uint8_t USBbmRequestType; /* bmRequestType */ - uint8_t USBbRequest; /* bRequest */ - uint16_t_uint8_t USBwValues; /* wValue */ - uint16_t_uint8_t USBwIndexs; /* wIndex */ - uint16_t_uint8_t USBwLengths; /* wLength */ - - uint8_t ControlState; /* of type CONTROL_STATE */ - uint8_t Current_Feature; - uint8_t Current_Configuration; /* Selected configuration */ - uint8_t Current_Interface; /* Selected interface of current configuration */ - uint8_t Current_AlternateSetting;/* Selected Alternate Setting of current - interface*/ - - ENDPOINT_INFO Ctrl_Info; -}DEVICE_INFO; - -typedef struct _DEVICE_PROP -{ - void (*Init)(void); /* Initialize the device */ - void (*Reset)(void); /* Reset routine of this device */ - - /* Device dependent process after the status stage */ - void (*Process_Status_IN)(void); - void (*Process_Status_OUT)(void); - - /* Procedure of process on setup stage of a class specified request with data stage */ - /* All class specified requests with data stage are processed in Class_Data_Setup - Class_Data_Setup() - responses to check all special requests and fills ENDPOINT_INFO - according to the request - If IN tokens are expected, then wLength & wOffset will be filled - with the total transferring bytes and the starting position - If OUT tokens are expected, then rLength & rOffset will be filled - with the total expected bytes and the starting position in the buffer - - If the request is valid, Class_Data_Setup returns SUCCESS, else UNSUPPORT - - CAUTION: - Since GET_CONFIGURATION & GET_INTERFACE are highly related to - the individual classes, they will be checked and processed here. - */ - RESULT (*Class_Data_Setup)(uint8_t RequestNo); - - /* Procedure of process on setup stage of a class specified request without data stage */ - /* All class specified requests without data stage are processed in Class_NoData_Setup - Class_NoData_Setup - responses to check all special requests and perform the request - - CAUTION: - Since SET_CONFIGURATION & SET_INTERFACE are highly related to - the individual classes, they will be checked and processed here. - */ - RESULT (*Class_NoData_Setup)(uint8_t RequestNo); - - /*Class_Get_Interface_Setting - This function is used by the file usb_core.c to test if the selected Interface - and Alternate Setting (uint8_t Interface, uint8_t AlternateSetting) are supported by - the application. - This function is writing by user. It should return "SUCCESS" if the Interface - and Alternate Setting are supported by the application or "UNSUPPORT" if they - are not supported. */ - - RESULT (*Class_Get_Interface_Setting)(uint8_t Interface, uint8_t AlternateSetting); - - uint8_t* (*GetDeviceDescriptor)(uint16_t Length); - uint8_t* (*GetConfigDescriptor)(uint16_t Length); - uint8_t* (*GetStringDescriptor)(uint16_t Length); - - /* This field is not used in current library version. It is kept only for - compatibility with previous versions */ - void* RxEP_buffer; - - uint8_t MaxPacketSize; - -}DEVICE_PROP; - -typedef struct _USER_STANDARD_REQUESTS -{ - void (*User_GetConfiguration)(void); /* Get Configuration */ - void (*User_SetConfiguration)(void); /* Set Configuration */ - void (*User_GetInterface)(void); /* Get Interface */ - void (*User_SetInterface)(void); /* Set Interface */ - void (*User_GetStatus)(void); /* Get Status */ - void (*User_ClearFeature)(void); /* Clear Feature */ - void (*User_SetEndPointFeature)(void); /* Set Endpoint Feature */ - void (*User_SetDeviceFeature)(void); /* Set Device Feature */ - void (*User_SetDeviceAddress)(void); /* Set Device Address */ -} -USER_STANDARD_REQUESTS; - -/* Exported constants --------------------------------------------------------*/ -#define Type_Recipient (pInformation->USBbmRequestType & (REQUEST_TYPE | RECIPIENT)) - -#define Usb_rLength Usb_wLength -#define Usb_rOffset Usb_wOffset - -#define USBwValue USBwValues.w -#define USBwValue0 USBwValues.bw.bb0 -#define USBwValue1 USBwValues.bw.bb1 -#define USBwIndex USBwIndexs.w -#define USBwIndex0 USBwIndexs.bw.bb0 -#define USBwIndex1 USBwIndexs.bw.bb1 -#define USBwLength USBwLengths.w -#define USBwLength0 USBwLengths.bw.bb0 -#define USBwLength1 USBwLengths.bw.bb1 - -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -uint8_t Setup0_Process(void); -uint8_t Post0_Process(void); -uint8_t Out0_Process(void); -uint8_t In0_Process(void); - -RESULT Standard_SetEndPointFeature(void); -RESULT Standard_SetDeviceFeature(void); - -uint8_t *Standard_GetConfiguration(uint16_t Length); -RESULT Standard_SetConfiguration(void); -uint8_t *Standard_GetInterface(uint16_t Length); -RESULT Standard_SetInterface(void); -uint8_t *Standard_GetDescriptorData(uint16_t Length, PONE_DESCRIPTOR pDesc); - -uint8_t *Standard_GetStatus(uint16_t Length); -RESULT Standard_ClearFeature(void); -void SetDeviceAddress(uint8_t); -void NOP_Process(void); - -extern DEVICE_PROP Device_Property; -extern USER_STANDARD_REQUESTS User_Standard_Requests; -extern DEVICE Device_Table; -extern DEVICE_INFO Device_Info; - -/* cells saving status during interrupt servicing */ -extern volatile uint16_t SaveRState; -extern volatile uint16_t SaveTState; - -#endif /* __USB_CORE_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_def.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_def.h deleted file mode 100644 index 9c5c53fa..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_def.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - ****************************************************************************** - * @file usb_def.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Definitions related to USB Core - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_DEF_H -#define __USB_DEF_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -typedef enum _RECIPIENT_TYPE -{ - DEVICE_RECIPIENT, /* Recipient device */ - INTERFACE_RECIPIENT, /* Recipient interface */ - ENDPOINT_RECIPIENT, /* Recipient endpoint */ - OTHER_RECIPIENT -} RECIPIENT_TYPE; - - -typedef enum _STANDARD_REQUESTS -{ - GET_STATUS = 0, - CLEAR_FEATURE, - RESERVED1, - SET_FEATURE, - RESERVED2, - SET_ADDRESS, - GET_DESCRIPTOR, - SET_DESCRIPTOR, - GET_CONFIGURATION, - SET_CONFIGURATION, - GET_INTERFACE, - SET_INTERFACE, - TOTAL_sREQUEST, /* Total number of Standard request */ - SYNCH_FRAME = 12 -} STANDARD_REQUESTS; - -/* Definition of "USBwValue" */ -typedef enum _DESCRIPTOR_TYPE -{ - DEVICE_DESCRIPTOR = 1, - CONFIG_DESCRIPTOR, - STRING_DESCRIPTOR, - INTERFACE_DESCRIPTOR, - ENDPOINT_DESCRIPTOR -} DESCRIPTOR_TYPE; - -/* Feature selector of a SET_FEATURE or CLEAR_FEATURE */ -typedef enum _FEATURE_SELECTOR -{ - ENDPOINT_STALL, - DEVICE_REMOTE_WAKEUP -} FEATURE_SELECTOR; - -/* Exported constants --------------------------------------------------------*/ -/* Definition of "USBbmRequestType" */ -#define REQUEST_TYPE 0x60 /* Mask to get request type */ -#define STANDARD_REQUEST 0x00 /* Standard request */ -#define CLASS_REQUEST 0x20 /* Class request */ -#define VENDOR_REQUEST 0x40 /* Vendor request */ - -#define RECIPIENT 0x1F /* Mask to get recipient */ - -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ - -#endif /* __USB_DEF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_init.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_init.h deleted file mode 100644 index 2c11fa60..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_init.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - ****************************************************************************** - * @file usb_init.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Initialization routines & global variables - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_INIT_H -#define __USB_INIT_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -void USB_Init(void); - -/* External variables --------------------------------------------------------*/ -/* The number of current endpoint, it will be used to specify an endpoint */ -extern uint8_t EPindex; -/* The number of current device, it is an index to the Device_Table */ -/*extern uint8_t Device_no; */ -/* Points to the DEVICE_INFO structure of current device */ -/* The purpose of this register is to speed up the execution */ -extern DEVICE_INFO* pInformation; -/* Points to the DEVICE_PROP structure of current device */ -/* The purpose of this register is to speed up the execution */ -extern DEVICE_PROP* pProperty; -/* Temporary save the state of Rx & Tx status. */ -/* Whenever the Rx or Tx state is changed, its value is saved */ -/* in this variable first and will be set to the EPRB or EPRA */ -/* at the end of interrupt process */ -extern USER_STANDARD_REQUESTS *pUser_Standard_Requests; - -extern uint16_t SaveState ; -extern uint16_t wInterrupt_Mask; - -#endif /* __USB_INIT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_int.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_int.h deleted file mode 100644 index 5aea1231..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_int.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - ****************************************************************************** - * @file usb_int.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Endpoint CTR (Low and High) interrupt's service routines prototypes - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_INT_H -#define __USB_INT_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -void CTR_LP(void); -void CTR_HP(void); - -/* External variables --------------------------------------------------------*/ - -#endif /* __USB_INT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_lib.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_lib.h deleted file mode 100644 index d8f79be5..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_lib.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - ****************************************************************************** - * @file usb_lib.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief USB library include files - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_LIB_H -#define __USB_LIB_H - -/* Includes ------------------------------------------------------------------*/ -#include "usb_type.h" -#include "usb_regs.h" -#include "usb_def.h" -#include "usb_core.h" -#include "usb_init.h" -#include "usb_sil.h" -#include "usb_mem.h" -#include "usb_int.h" - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -/* External variables --------------------------------------------------------*/ - -#endif /* __USB_LIB_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem.h deleted file mode 100644 index aeb8635e..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - ****************************************************************************** - * @file usb_mem.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Utility prototypes functions for memory/PMA transfers - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_MEM_H -#define __USB_MEM_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -void UserToPMABufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes); -void PMAToUserBufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes); - -/* External variables --------------------------------------------------------*/ - -#endif /*__USB_MEM_H*/ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem1.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem1.h deleted file mode 100644 index cd489ed2..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_mem1.h +++ /dev/null @@ -1,32 +0,0 @@ -/******************** (C) COPYRIGHT 2007 STMicroelectronics ******************** -* File Name : usb_mem.h -* Author : MCD Application Team -* Version : V1.0 -* Date : 10/08/2007 -* Description : Utility prototypes functions for memory/PMA transfers -******************************************************************************** -* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS -* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. -* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, -* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE -* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING -* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. -*******************************************************************************/ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_MEM_H -#define __USB_MEM_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -void UserToPMABufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes); -void PMAToUserBufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes); - -/* External variables --------------------------------------------------------*/ - -#endif /*__USB_MEM_H*/ - -/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_regs.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_regs.h deleted file mode 100644 index c31c806e..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_regs.h +++ /dev/null @@ -1,685 +0,0 @@ -/** - ****************************************************************************** - * @file usb_regs.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Interface prototype functions to USB cell registers - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_REGS_H -#define __USB_REGS_H - -/* Includes ------------------------------------------------------------------*/ -#ifdef STM32F30X - #include "stm32f30x.h" -#else - #include "stm32f10x.h" -#endif -/* Exported types ------------------------------------------------------------*/ -typedef enum _EP_DBUF_DIR -{ - /* double buffered endpoint direction */ - EP_DBUF_ERR, - EP_DBUF_OUT, - EP_DBUF_IN -}EP_DBUF_DIR; - -/* endpoint buffer number */ -enum EP_BUF_NUM -{ - EP_NOBUF, - EP_BUF0, - EP_BUF1 -}; - -/* Exported constants --------------------------------------------------------*/ -#define RegBase (0x40005C00L) /* USB_IP Peripheral Registers base address */ -#define PMAAddr (0x40006000L) /* USB_IP Packet Memory Area base address */ - -/******************************************************************************/ -/* General registers */ -/******************************************************************************/ - -/* Control register */ -#define CNTR ((__IO unsigned *)(RegBase + 0x40)) -/* Interrupt status register */ -#define ISTR ((__IO unsigned *)(RegBase + 0x44)) -/* Frame number register */ -#define FNR ((__IO unsigned *)(RegBase + 0x48)) -/* Device address register */ -#define DADDR ((__IO unsigned *)(RegBase + 0x4C)) -/* Buffer Table address register */ -#define BTABLE ((__IO unsigned *)(RegBase + 0x50)) -/******************************************************************************/ -/* Endpoint registers */ -/******************************************************************************/ -#define EP0REG ((__IO unsigned *)(RegBase)) /* endpoint 0 register address */ - -/* Endpoint Addresses (w/direction) */ -#define EP0_OUT ((uint8_t)0x00) -#define EP0_IN ((uint8_t)0x80) -#define EP1_OUT ((uint8_t)0x01) -#define EP1_IN ((uint8_t)0x81) -#define EP2_OUT ((uint8_t)0x02) -#define EP2_IN ((uint8_t)0x82) -#define EP3_OUT ((uint8_t)0x03) -#define EP3_IN ((uint8_t)0x83) -#define EP4_OUT ((uint8_t)0x04) -#define EP4_IN ((uint8_t)0x84) -#define EP5_OUT ((uint8_t)0x05) -#define EP5_IN ((uint8_t)0x85) -#define EP6_OUT ((uint8_t)0x06) -#define EP6_IN ((uint8_t)0x86) -#define EP7_OUT ((uint8_t)0x07) -#define EP7_IN ((uint8_t)0x87) - -/* endpoints enumeration */ -#define ENDP0 ((uint8_t)0) -#define ENDP1 ((uint8_t)1) -#define ENDP2 ((uint8_t)2) -#define ENDP3 ((uint8_t)3) -#define ENDP4 ((uint8_t)4) -#define ENDP5 ((uint8_t)5) -#define ENDP6 ((uint8_t)6) -#define ENDP7 ((uint8_t)7) - -/******************************************************************************/ -/* ISTR interrupt events */ -/******************************************************************************/ -#define ISTR_CTR (0x8000) /* Correct TRansfer (clear-only bit) */ -#define ISTR_DOVR (0x4000) /* DMA OVeR/underrun (clear-only bit) */ -#define ISTR_ERR (0x2000) /* ERRor (clear-only bit) */ -#define ISTR_WKUP (0x1000) /* WaKe UP (clear-only bit) */ -#define ISTR_SUSP (0x0800) /* SUSPend (clear-only bit) */ -#define ISTR_RESET (0x0400) /* RESET (clear-only bit) */ -#define ISTR_SOF (0x0200) /* Start Of Frame (clear-only bit) */ -#define ISTR_ESOF (0x0100) /* Expected Start Of Frame (clear-only bit) */ - - -#define ISTR_DIR (0x0010) /* DIRection of transaction (read-only bit) */ -#define ISTR_EP_ID (0x000F) /* EndPoint IDentifier (read-only bit) */ - -#define CLR_CTR (~ISTR_CTR) /* clear Correct TRansfer bit */ -#define CLR_DOVR (~ISTR_DOVR) /* clear DMA OVeR/underrun bit*/ -#define CLR_ERR (~ISTR_ERR) /* clear ERRor bit */ -#define CLR_WKUP (~ISTR_WKUP) /* clear WaKe UP bit */ -#define CLR_SUSP (~ISTR_SUSP) /* clear SUSPend bit */ -#define CLR_RESET (~ISTR_RESET) /* clear RESET bit */ -#define CLR_SOF (~ISTR_SOF) /* clear Start Of Frame bit */ -#define CLR_ESOF (~ISTR_ESOF) /* clear Expected Start Of Frame bit */ - -/******************************************************************************/ -/* CNTR control register bits definitions */ -/******************************************************************************/ -#define CNTR_CTRM (0x8000) /* Correct TRansfer Mask */ -#define CNTR_DOVRM (0x4000) /* DMA OVeR/underrun Mask */ -#define CNTR_ERRM (0x2000) /* ERRor Mask */ -#define CNTR_WKUPM (0x1000) /* WaKe UP Mask */ -#define CNTR_SUSPM (0x0800) /* SUSPend Mask */ -#define CNTR_RESETM (0x0400) /* RESET Mask */ -#define CNTR_SOFM (0x0200) /* Start Of Frame Mask */ -#define CNTR_ESOFM (0x0100) /* Expected Start Of Frame Mask */ - - -#define CNTR_RESUME (0x0010) /* RESUME request */ -#define CNTR_FSUSP (0x0008) /* Force SUSPend */ -#define CNTR_LPMODE (0x0004) /* Low-power MODE */ -#define CNTR_PDWN (0x0002) /* Power DoWN */ -#define CNTR_FRES (0x0001) /* Force USB RESet */ - -/******************************************************************************/ -/* FNR Frame Number Register bit definitions */ -/******************************************************************************/ -#define FNR_RXDP (0x8000) /* status of D+ data line */ -#define FNR_RXDM (0x4000) /* status of D- data line */ -#define FNR_LCK (0x2000) /* LoCKed */ -#define FNR_LSOF (0x1800) /* Lost SOF */ -#define FNR_FN (0x07FF) /* Frame Number */ -/******************************************************************************/ -/* DADDR Device ADDRess bit definitions */ -/******************************************************************************/ -#define DADDR_EF (0x80) -#define DADDR_ADD (0x7F) -/******************************************************************************/ -/* Endpoint register */ -/******************************************************************************/ -/* bit positions */ -#define EP_CTR_RX (0x8000) /* EndPoint Correct TRansfer RX */ -#define EP_DTOG_RX (0x4000) /* EndPoint Data TOGGLE RX */ -#define EPRX_STAT (0x3000) /* EndPoint RX STATus bit field */ -#define EP_SETUP (0x0800) /* EndPoint SETUP */ -#define EP_T_FIELD (0x0600) /* EndPoint TYPE */ -#define EP_KIND (0x0100) /* EndPoint KIND */ -#define EP_CTR_TX (0x0080) /* EndPoint Correct TRansfer TX */ -#define EP_DTOG_TX (0x0040) /* EndPoint Data TOGGLE TX */ -#define EPTX_STAT (0x0030) /* EndPoint TX STATus bit field */ -#define EPADDR_FIELD (0x000F) /* EndPoint ADDRess FIELD */ - -/* EndPoint REGister MASK (no toggle fields) */ -#define EPREG_MASK (EP_CTR_RX|EP_SETUP|EP_T_FIELD|EP_KIND|EP_CTR_TX|EPADDR_FIELD) - -/* EP_TYPE[1:0] EndPoint TYPE */ -#define EP_TYPE_MASK (0x0600) /* EndPoint TYPE Mask */ -#define EP_BULK (0x0000) /* EndPoint BULK */ -#define EP_CONTROL (0x0200) /* EndPoint CONTROL */ -#define EP_ISOCHRONOUS (0x0400) /* EndPoint ISOCHRONOUS */ -#define EP_INTERRUPT (0x0600) /* EndPoint INTERRUPT */ -#define EP_T_MASK (~EP_T_FIELD & EPREG_MASK) - - -/* EP_KIND EndPoint KIND */ -#define EPKIND_MASK (~EP_KIND & EPREG_MASK) - -/* STAT_TX[1:0] STATus for TX transfer */ -#define EP_TX_DIS (0x0000) /* EndPoint TX DISabled */ -#define EP_TX_STALL (0x0010) /* EndPoint TX STALLed */ -#define EP_TX_NAK (0x0020) /* EndPoint TX NAKed */ -#define EP_TX_VALID (0x0030) /* EndPoint TX VALID */ -#define EPTX_DTOG1 (0x0010) /* EndPoint TX Data TOGgle bit1 */ -#define EPTX_DTOG2 (0x0020) /* EndPoint TX Data TOGgle bit2 */ -#define EPTX_DTOGMASK (EPTX_STAT|EPREG_MASK) - -/* STAT_RX[1:0] STATus for RX transfer */ -#define EP_RX_DIS (0x0000) /* EndPoint RX DISabled */ -#define EP_RX_STALL (0x1000) /* EndPoint RX STALLed */ -#define EP_RX_NAK (0x2000) /* EndPoint RX NAKed */ -#define EP_RX_VALID (0x3000) /* EndPoint RX VALID */ -#define EPRX_DTOG1 (0x1000) /* EndPoint RX Data TOGgle bit1 */ -#define EPRX_DTOG2 (0x2000) /* EndPoint RX Data TOGgle bit1 */ -#define EPRX_DTOGMASK (EPRX_STAT|EPREG_MASK) -/* Exported macro ------------------------------------------------------------*/ -/* SetCNTR */ -#define _SetCNTR(wRegValue) (*CNTR = (uint16_t)wRegValue) - -/* SetISTR */ -#define _SetISTR(wRegValue) (*ISTR = (uint16_t)wRegValue) - -/* SetDADDR */ -#define _SetDADDR(wRegValue) (*DADDR = (uint16_t)wRegValue) - -/* SetBTABLE */ -#define _SetBTABLE(wRegValue)(*BTABLE = (uint16_t)(wRegValue & 0xFFF8)) - -/* GetCNTR */ -#define _GetCNTR() ((uint16_t) *CNTR) - -/* GetISTR */ -#define _GetISTR() ((uint16_t) *ISTR) - -/* GetFNR */ -#define _GetFNR() ((uint16_t) *FNR) - -/* GetDADDR */ -#define _GetDADDR() ((uint16_t) *DADDR) - -/* GetBTABLE */ -#define _GetBTABLE() ((uint16_t) *BTABLE) - -/* SetENDPOINT */ -#define _SetENDPOINT(bEpNum,wRegValue) (*(EP0REG + bEpNum)= \ - (uint16_t)wRegValue) - -/* GetENDPOINT */ -#define _GetENDPOINT(bEpNum) ((uint16_t)(*(EP0REG + bEpNum))) - -/******************************************************************************* -* Macro Name : SetEPType -* Description : sets the type in the endpoint register(bits EP_TYPE[1:0]) -* Input : bEpNum: Endpoint Number. -* wType -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPType(bEpNum,wType) (_SetENDPOINT(bEpNum,\ - ((_GetENDPOINT(bEpNum) & EP_T_MASK) | wType ))) - -/******************************************************************************* -* Macro Name : GetEPType -* Description : gets the type in the endpoint register(bits EP_TYPE[1:0]) -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint Type -*******************************************************************************/ -#define _GetEPType(bEpNum) (_GetENDPOINT(bEpNum) & EP_T_FIELD) - -/******************************************************************************* -* Macro Name : SetEPTxStatus -* Description : sets the status for tx transfer (bits STAT_TX[1:0]). -* Input : bEpNum: Endpoint Number. -* wState: new state -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPTxStatus(bEpNum,wState) {\ - register uint16_t _wRegVal; \ - _wRegVal = _GetENDPOINT(bEpNum) & EPTX_DTOGMASK;\ - /* toggle first bit ? */ \ - if((EPTX_DTOG1 & wState)!= 0) \ - _wRegVal ^= EPTX_DTOG1; \ - /* toggle second bit ? */ \ - if((EPTX_DTOG2 & wState)!= 0) \ - _wRegVal ^= EPTX_DTOG2; \ - _SetENDPOINT(bEpNum, (_wRegVal | EP_CTR_RX|EP_CTR_TX)); \ - } /* _SetEPTxStatus */ - -/******************************************************************************* -* Macro Name : SetEPRxStatus -* Description : sets the status for rx transfer (bits STAT_TX[1:0]) -* Input : bEpNum: Endpoint Number. -* wState: new state. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPRxStatus(bEpNum,wState) {\ - register uint16_t _wRegVal; \ - \ - _wRegVal = _GetENDPOINT(bEpNum) & EPRX_DTOGMASK;\ - /* toggle first bit ? */ \ - if((EPRX_DTOG1 & wState)!= 0) \ - _wRegVal ^= EPRX_DTOG1; \ - /* toggle second bit ? */ \ - if((EPRX_DTOG2 & wState)!= 0) \ - _wRegVal ^= EPRX_DTOG2; \ - _SetENDPOINT(bEpNum, (_wRegVal | EP_CTR_RX|EP_CTR_TX)); \ - } /* _SetEPRxStatus */ - -/******************************************************************************* -* Macro Name : SetEPRxTxStatus -* Description : sets the status for rx & tx (bits STAT_TX[1:0] & STAT_RX[1:0]) -* Input : bEpNum: Endpoint Number. -* wStaterx: new state. -* wStatetx: new state. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPRxTxStatus(bEpNum,wStaterx,wStatetx) {\ - register uint32_t _wRegVal; \ - \ - _wRegVal = _GetENDPOINT(bEpNum) & (EPRX_DTOGMASK |EPTX_STAT) ;\ - /* toggle first bit ? */ \ - if((EPRX_DTOG1 & wStaterx)!= 0) \ - _wRegVal ^= EPRX_DTOG1; \ - /* toggle second bit ? */ \ - if((EPRX_DTOG2 & wStaterx)!= 0) \ - _wRegVal ^= EPRX_DTOG2; \ - /* toggle first bit ? */ \ - if((EPTX_DTOG1 & wStatetx)!= 0) \ - _wRegVal ^= EPTX_DTOG1; \ - /* toggle second bit ? */ \ - if((EPTX_DTOG2 & wStatetx)!= 0) \ - _wRegVal ^= EPTX_DTOG2; \ - _SetENDPOINT(bEpNum, _wRegVal | EP_CTR_RX|EP_CTR_TX); \ - } /* _SetEPRxTxStatus */ -/******************************************************************************* -* Macro Name : GetEPTxStatus / GetEPRxStatus -* Description : gets the status for tx/rx transfer (bits STAT_TX[1:0] -* /STAT_RX[1:0]) -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : status . -*******************************************************************************/ -#define _GetEPTxStatus(bEpNum) ((uint16_t)_GetENDPOINT(bEpNum) & EPTX_STAT) - -#define _GetEPRxStatus(bEpNum) ((uint16_t)_GetENDPOINT(bEpNum) & EPRX_STAT) - -/******************************************************************************* -* Macro Name : SetEPTxValid / SetEPRxValid -* Description : sets directly the VALID tx/rx-status into the enpoint register -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPTxValid(bEpNum) (_SetEPTxStatus(bEpNum, EP_TX_VALID)) - -#define _SetEPRxValid(bEpNum) (_SetEPRxStatus(bEpNum, EP_RX_VALID)) - -/******************************************************************************* -* Macro Name : GetTxStallStatus / GetRxStallStatus. -* Description : checks stall condition in an endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : TRUE = endpoint in stall condition. -*******************************************************************************/ -#define _GetTxStallStatus(bEpNum) (_GetEPTxStatus(bEpNum) \ - == EP_TX_STALL) -#define _GetRxStallStatus(bEpNum) (_GetEPRxStatus(bEpNum) \ - == EP_RX_STALL) - -/******************************************************************************* -* Macro Name : SetEP_KIND / ClearEP_KIND. -* Description : set & clear EP_KIND bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEP_KIND(bEpNum) (_SetENDPOINT(bEpNum, \ - (EP_CTR_RX|EP_CTR_TX|((_GetENDPOINT(bEpNum) | EP_KIND) & EPREG_MASK)))) -#define _ClearEP_KIND(bEpNum) (_SetENDPOINT(bEpNum, \ - (EP_CTR_RX|EP_CTR_TX|(_GetENDPOINT(bEpNum) & EPKIND_MASK)))) - -/******************************************************************************* -* Macro Name : Set_Status_Out / Clear_Status_Out. -* Description : Sets/clears directly STATUS_OUT bit in the endpoint register. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _Set_Status_Out(bEpNum) _SetEP_KIND(bEpNum) -#define _Clear_Status_Out(bEpNum) _ClearEP_KIND(bEpNum) - -/******************************************************************************* -* Macro Name : SetEPDoubleBuff / ClearEPDoubleBuff. -* Description : Sets/clears directly EP_KIND bit in the endpoint register. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPDoubleBuff(bEpNum) _SetEP_KIND(bEpNum) -#define _ClearEPDoubleBuff(bEpNum) _ClearEP_KIND(bEpNum) - -/******************************************************************************* -* Macro Name : ClearEP_CTR_RX / ClearEP_CTR_TX. -* Description : Clears bit CTR_RX / CTR_TX in the endpoint register. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _ClearEP_CTR_RX(bEpNum) (_SetENDPOINT(bEpNum,\ - _GetENDPOINT(bEpNum) & 0x7FFF & EPREG_MASK)) -#define _ClearEP_CTR_TX(bEpNum) (_SetENDPOINT(bEpNum,\ - _GetENDPOINT(bEpNum) & 0xFF7F & EPREG_MASK)) - -/******************************************************************************* -* Macro Name : ToggleDTOG_RX / ToggleDTOG_TX . -* Description : Toggles DTOG_RX / DTOG_TX bit in the endpoint register. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _ToggleDTOG_RX(bEpNum) (_SetENDPOINT(bEpNum, \ - EP_CTR_RX|EP_CTR_TX|EP_DTOG_RX | (_GetENDPOINT(bEpNum) & EPREG_MASK))) -#define _ToggleDTOG_TX(bEpNum) (_SetENDPOINT(bEpNum, \ - EP_CTR_RX|EP_CTR_TX|EP_DTOG_TX | (_GetENDPOINT(bEpNum) & EPREG_MASK))) - -/******************************************************************************* -* Macro Name : ClearDTOG_RX / ClearDTOG_TX. -* Description : Clears DTOG_RX / DTOG_TX bit in the endpoint register. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _ClearDTOG_RX(bEpNum) if((_GetENDPOINT(bEpNum) & EP_DTOG_RX) != 0)\ - _ToggleDTOG_RX(bEpNum) -#define _ClearDTOG_TX(bEpNum) if((_GetENDPOINT(bEpNum) & EP_DTOG_TX) != 0)\ - _ToggleDTOG_TX(bEpNum) -/******************************************************************************* -* Macro Name : SetEPAddress. -* Description : Sets address in an endpoint register. -* Input : bEpNum: Endpoint Number. -* bAddr: Address. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPAddress(bEpNum,bAddr) _SetENDPOINT(bEpNum,\ - EP_CTR_RX|EP_CTR_TX|(_GetENDPOINT(bEpNum) & EPREG_MASK) | bAddr) - -/******************************************************************************* -* Macro Name : GetEPAddress. -* Description : Gets address in an endpoint register. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _GetEPAddress(bEpNum) ((uint8_t)(_GetENDPOINT(bEpNum) & EPADDR_FIELD)) - -#define _pEPTxAddr(bEpNum) ((uint32_t *)((_GetBTABLE()+bEpNum*8 )*2 + PMAAddr)) -#define _pEPTxCount(bEpNum) ((uint32_t *)((_GetBTABLE()+bEpNum*8+2)*2 + PMAAddr)) -#define _pEPRxAddr(bEpNum) ((uint32_t *)((_GetBTABLE()+bEpNum*8+4)*2 + PMAAddr)) -#define _pEPRxCount(bEpNum) ((uint32_t *)((_GetBTABLE()+bEpNum*8+6)*2 + PMAAddr)) - -/******************************************************************************* -* Macro Name : SetEPTxAddr / SetEPRxAddr. -* Description : sets address of the tx/rx buffer. -* Input : bEpNum: Endpoint Number. -* wAddr: address to be set (must be word aligned). -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPTxAddr(bEpNum,wAddr) (*_pEPTxAddr(bEpNum) = ((wAddr >> 1) << 1)) -#define _SetEPRxAddr(bEpNum,wAddr) (*_pEPRxAddr(bEpNum) = ((wAddr >> 1) << 1)) - -/******************************************************************************* -* Macro Name : GetEPTxAddr / GetEPRxAddr. -* Description : Gets address of the tx/rx buffer. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : address of the buffer. -*******************************************************************************/ -#define _GetEPTxAddr(bEpNum) ((uint16_t)*_pEPTxAddr(bEpNum)) -#define _GetEPRxAddr(bEpNum) ((uint16_t)*_pEPRxAddr(bEpNum)) - -/******************************************************************************* -* Macro Name : SetEPCountRxReg. -* Description : Sets counter of rx buffer with no. of blocks. -* Input : pdwReg: pointer to counter. -* wCount: Counter. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _BlocksOf32(dwReg,wCount,wNBlocks) {\ - wNBlocks = wCount >> 5;\ - if((wCount & 0x1f) == 0)\ - wNBlocks--;\ - *pdwReg = (uint32_t)((wNBlocks << 10) | 0x8000);\ - }/* _BlocksOf32 */ - -#define _BlocksOf2(dwReg,wCount,wNBlocks) {\ - wNBlocks = wCount >> 1;\ - if((wCount & 0x1) != 0)\ - wNBlocks++;\ - *pdwReg = (uint32_t)(wNBlocks << 10);\ - }/* _BlocksOf2 */ - -#define _SetEPCountRxReg(dwReg,wCount) {\ - uint16_t wNBlocks;\ - if(wCount > 62){_BlocksOf32(dwReg,wCount,wNBlocks);}\ - else {_BlocksOf2(dwReg,wCount,wNBlocks);}\ - }/* _SetEPCountRxReg */ - - - -#define _SetEPRxDblBuf0Count(bEpNum,wCount) {\ - uint32_t *pdwReg = _pEPTxCount(bEpNum); \ - _SetEPCountRxReg(pdwReg, wCount);\ - } -/******************************************************************************* -* Macro Name : SetEPTxCount / SetEPRxCount. -* Description : sets counter for the tx/rx buffer. -* Input : bEpNum: endpoint number. -* wCount: Counter value. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPTxCount(bEpNum,wCount) (*_pEPTxCount(bEpNum) = wCount) -#define _SetEPRxCount(bEpNum,wCount) {\ - uint32_t *pdwReg = _pEPRxCount(bEpNum); \ - _SetEPCountRxReg(pdwReg, wCount);\ - } -/******************************************************************************* -* Macro Name : GetEPTxCount / GetEPRxCount. -* Description : gets counter of the tx buffer. -* Input : bEpNum: endpoint number. -* Output : None. -* Return : Counter value. -*******************************************************************************/ -#define _GetEPTxCount(bEpNum)((uint16_t)(*_pEPTxCount(bEpNum)) & 0x3ff) -#define _GetEPRxCount(bEpNum)((uint16_t)(*_pEPRxCount(bEpNum)) & 0x3ff) - -/******************************************************************************* -* Macro Name : SetEPDblBuf0Addr / SetEPDblBuf1Addr. -* Description : Sets buffer 0/1 address in a double buffer endpoint. -* Input : bEpNum: endpoint number. -* : wBuf0Addr: buffer 0 address. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPDblBuf0Addr(bEpNum,wBuf0Addr) {_SetEPTxAddr(bEpNum, wBuf0Addr);} -#define _SetEPDblBuf1Addr(bEpNum,wBuf1Addr) {_SetEPRxAddr(bEpNum, wBuf1Addr);} - -/******************************************************************************* -* Macro Name : SetEPDblBuffAddr. -* Description : Sets addresses in a double buffer endpoint. -* Input : bEpNum: endpoint number. -* : wBuf0Addr: buffer 0 address. -* : wBuf1Addr = buffer 1 address. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPDblBuffAddr(bEpNum,wBuf0Addr,wBuf1Addr) { \ - _SetEPDblBuf0Addr(bEpNum, wBuf0Addr);\ - _SetEPDblBuf1Addr(bEpNum, wBuf1Addr);\ - } /* _SetEPDblBuffAddr */ - -/******************************************************************************* -* Macro Name : GetEPDblBuf0Addr / GetEPDblBuf1Addr. -* Description : Gets buffer 0/1 address of a double buffer endpoint. -* Input : bEpNum: endpoint number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _GetEPDblBuf0Addr(bEpNum) (_GetEPTxAddr(bEpNum)) -#define _GetEPDblBuf1Addr(bEpNum) (_GetEPRxAddr(bEpNum)) - -/******************************************************************************* -* Macro Name : SetEPDblBuffCount / SetEPDblBuf0Count / SetEPDblBuf1Count. -* Description : Gets buffer 0/1 address of a double buffer endpoint. -* Input : bEpNum: endpoint number. -* : bDir: endpoint dir EP_DBUF_OUT = OUT -* EP_DBUF_IN = IN -* : wCount: Counter value -* Output : None. -* Return : None. -*******************************************************************************/ -#define _SetEPDblBuf0Count(bEpNum, bDir, wCount) { \ - if(bDir == EP_DBUF_OUT)\ - /* OUT endpoint */ \ - {_SetEPRxDblBuf0Count(bEpNum,wCount);} \ - else if(bDir == EP_DBUF_IN)\ - /* IN endpoint */ \ - *_pEPTxCount(bEpNum) = (uint32_t)wCount; \ - } /* SetEPDblBuf0Count*/ - -#define _SetEPDblBuf1Count(bEpNum, bDir, wCount) { \ - if(bDir == EP_DBUF_OUT)\ - /* OUT endpoint */ \ - {_SetEPRxCount(bEpNum,wCount);}\ - else if(bDir == EP_DBUF_IN)\ - /* IN endpoint */\ - *_pEPRxCount(bEpNum) = (uint32_t)wCount; \ - } /* SetEPDblBuf1Count */ - -#define _SetEPDblBuffCount(bEpNum, bDir, wCount) {\ - _SetEPDblBuf0Count(bEpNum, bDir, wCount); \ - _SetEPDblBuf1Count(bEpNum, bDir, wCount); \ - } /* _SetEPDblBuffCount */ - -/******************************************************************************* -* Macro Name : GetEPDblBuf0Count / GetEPDblBuf1Count. -* Description : Gets buffer 0/1 rx/tx counter for double buffering. -* Input : bEpNum: endpoint number. -* Output : None. -* Return : None. -*******************************************************************************/ -#define _GetEPDblBuf0Count(bEpNum) (_GetEPTxCount(bEpNum)) -#define _GetEPDblBuf1Count(bEpNum) (_GetEPRxCount(bEpNum)) - - -/* External variables --------------------------------------------------------*/ -extern volatile uint16_t wIstr; /* ISTR register last read value */ - -/* Exported functions ------------------------------------------------------- */ -void SetCNTR(uint16_t /*wRegValue*/); -void SetISTR(uint16_t /*wRegValue*/); -void SetDADDR(uint16_t /*wRegValue*/); -void SetBTABLE(uint16_t /*wRegValue*/); -void SetBTABLE(uint16_t /*wRegValue*/); -uint16_t GetCNTR(void); -uint16_t GetISTR(void); -uint16_t GetFNR(void); -uint16_t GetDADDR(void); -uint16_t GetBTABLE(void); -void SetENDPOINT(uint8_t /*bEpNum*/, uint16_t /*wRegValue*/); -uint16_t GetENDPOINT(uint8_t /*bEpNum*/); -void SetEPType(uint8_t /*bEpNum*/, uint16_t /*wType*/); -uint16_t GetEPType(uint8_t /*bEpNum*/); -void SetEPTxStatus(uint8_t /*bEpNum*/, uint16_t /*wState*/); -void SetEPRxStatus(uint8_t /*bEpNum*/, uint16_t /*wState*/); -void SetDouBleBuffEPStall(uint8_t /*bEpNum*/, uint8_t bDir); -uint16_t GetEPTxStatus(uint8_t /*bEpNum*/); -uint16_t GetEPRxStatus(uint8_t /*bEpNum*/); -void SetEPTxValid(uint8_t /*bEpNum*/); -void SetEPRxValid(uint8_t /*bEpNum*/); -uint16_t GetTxStallStatus(uint8_t /*bEpNum*/); -uint16_t GetRxStallStatus(uint8_t /*bEpNum*/); -void SetEP_KIND(uint8_t /*bEpNum*/); -void ClearEP_KIND(uint8_t /*bEpNum*/); -void Set_Status_Out(uint8_t /*bEpNum*/); -void Clear_Status_Out(uint8_t /*bEpNum*/); -void SetEPDoubleBuff(uint8_t /*bEpNum*/); -void ClearEPDoubleBuff(uint8_t /*bEpNum*/); -void ClearEP_CTR_RX(uint8_t /*bEpNum*/); -void ClearEP_CTR_TX(uint8_t /*bEpNum*/); -void ToggleDTOG_RX(uint8_t /*bEpNum*/); -void ToggleDTOG_TX(uint8_t /*bEpNum*/); -void ClearDTOG_RX(uint8_t /*bEpNum*/); -void ClearDTOG_TX(uint8_t /*bEpNum*/); -void SetEPAddress(uint8_t /*bEpNum*/, uint8_t /*bAddr*/); -uint8_t GetEPAddress(uint8_t /*bEpNum*/); -void SetEPTxAddr(uint8_t /*bEpNum*/, uint16_t /*wAddr*/); -void SetEPRxAddr(uint8_t /*bEpNum*/, uint16_t /*wAddr*/); -uint16_t GetEPTxAddr(uint8_t /*bEpNum*/); -uint16_t GetEPRxAddr(uint8_t /*bEpNum*/); -void SetEPCountRxReg(uint32_t * /*pdwReg*/, uint16_t /*wCount*/); -void SetEPTxCount(uint8_t /*bEpNum*/, uint16_t /*wCount*/); -void SetEPRxCount(uint8_t /*bEpNum*/, uint16_t /*wCount*/); -uint16_t GetEPTxCount(uint8_t /*bEpNum*/); -uint16_t GetEPRxCount(uint8_t /*bEpNum*/); -void SetEPDblBuf0Addr(uint8_t /*bEpNum*/, uint16_t /*wBuf0Addr*/); -void SetEPDblBuf1Addr(uint8_t /*bEpNum*/, uint16_t /*wBuf1Addr*/); -void SetEPDblBuffAddr(uint8_t /*bEpNum*/, uint16_t /*wBuf0Addr*/, uint16_t /*wBuf1Addr*/); -uint16_t GetEPDblBuf0Addr(uint8_t /*bEpNum*/); -uint16_t GetEPDblBuf1Addr(uint8_t /*bEpNum*/); -void SetEPDblBuffCount(uint8_t /*bEpNum*/, uint8_t /*bDir*/, uint16_t /*wCount*/); -void SetEPDblBuf0Count(uint8_t /*bEpNum*/, uint8_t /*bDir*/, uint16_t /*wCount*/); -void SetEPDblBuf1Count(uint8_t /*bEpNum*/, uint8_t /*bDir*/, uint16_t /*wCount*/); -uint16_t GetEPDblBuf0Count(uint8_t /*bEpNum*/); -uint16_t GetEPDblBuf1Count(uint8_t /*bEpNum*/); -EP_DBUF_DIR GetEPDblBufDir(uint8_t /*bEpNum*/); -void FreeUserBuffer(uint8_t bEpNum/*bEpNum*/, uint8_t bDir); -uint16_t ToWord(uint8_t, uint8_t); -uint16_t ByteSwap(uint16_t); - -#endif /* __USB_REGS_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_sil.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_sil.h deleted file mode 100644 index 0e941ccd..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_sil.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - ****************************************************************************** - * @file usb_sil.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Simplified Interface Layer function prototypes. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_SIL_H -#define __USB_SIL_H - -/* Includes ------------------------------------------------------------------*/ -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ - -uint32_t USB_SIL_Init(void); -uint32_t USB_SIL_Write(uint8_t bEpAddr, uint8_t* pBufferPointer, uint32_t wBufferSize); -uint32_t USB_SIL_Read(uint8_t bEpAddr, uint8_t* pBufferPointer); - -/* External variables --------------------------------------------------------*/ - -#endif /* __USB_SIL_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_type.h b/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_type.h deleted file mode 100644 index 8930accf..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/inc/usb_type.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - ****************************************************************************** - * @file usb_type.h - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Type definitions used by the USB Library - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_TYPE_H -#define __USB_TYPE_H - -/* Includes ------------------------------------------------------------------*/ -#include - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -#ifndef NULL -#define NULL ((void *)0) -#endif - -typedef enum -{ - FALSE = 0, TRUE = !FALSE -} -bool; - -/* Exported macro ------------------------------------------------------------*/ -/* Exported functions ------------------------------------------------------- */ -/* External variables --------------------------------------------------------*/ - -#endif /* __USB_TYPE_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_core.c b/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_core.c deleted file mode 100644 index a0c68056..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_core.c +++ /dev/null @@ -1,1033 +0,0 @@ -/** - ****************************************************************************** - * @file usb_core.c - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Standard protocol processing (USB v2.0) - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Includes ------------------------------------------------------------------*/ -#include "usb_lib.h" -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -#define ValBit(VAR,Place) (VAR & (1 << Place)) -#define SetBit(VAR,Place) (VAR |= (1 << Place)) -#define ClrBit(VAR,Place) (VAR &= ((1 << Place) ^ 255)) -#define Send0LengthData() { _SetEPTxCount(ENDP0, 0); \ - vSetEPTxStatus(EP_TX_VALID); \ - } - -#define vSetEPRxStatus(st) (SaveRState = st) -#define vSetEPTxStatus(st) (SaveTState = st) - -#define USB_StatusIn() Send0LengthData() -#define USB_StatusOut() vSetEPRxStatus(EP_RX_VALID) - -#define StatusInfo0 StatusInfo.bw.bb1 /* Reverse bb0 & bb1 */ -#define StatusInfo1 StatusInfo.bw.bb0 - -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -uint16_t_uint8_t StatusInfo; - -bool Data_Mul_MaxPacketSize = FALSE; -/* Private function prototypes -----------------------------------------------*/ -static void DataStageOut(void); -static void DataStageIn(void); -static void NoData_Setup0(void); -static void Data_Setup0(void); -/* Private functions ---------------------------------------------------------*/ - -/******************************************************************************* -* Function Name : Standard_GetConfiguration. -* Description : Return the current configuration variable address. -* Input : Length - How many bytes are needed. -* Output : None. -* Return : Return 1 , if the request is invalid when "Length" is 0. -* Return "Buffer" if the "Length" is not 0. -*******************************************************************************/ -uint8_t *Standard_GetConfiguration(uint16_t Length) -{ - if (Length == 0) - { - pInformation->Ctrl_Info.Usb_wLength = - sizeof(pInformation->Current_Configuration); - return 0; - } - pUser_Standard_Requests->User_GetConfiguration(); - return (uint8_t *)&pInformation->Current_Configuration; -} - -/******************************************************************************* -* Function Name : Standard_SetConfiguration. -* Description : This routine is called to set the configuration value -* Then each class should configure device itself. -* Input : None. -* Output : None. -* Return : Return USB_SUCCESS, if the request is performed. -* Return USB_UNSUPPORT, if the request is invalid. -*******************************************************************************/ -RESULT Standard_SetConfiguration(void) -{ - - if ((pInformation->USBwValue0 <= - Device_Table.Total_Configuration) && (pInformation->USBwValue1 == 0) - && (pInformation->USBwIndex == 0)) /*call Back usb spec 2.0*/ - { - pInformation->Current_Configuration = pInformation->USBwValue0; - pUser_Standard_Requests->User_SetConfiguration(); - return USB_SUCCESS; - } - else - { - return USB_UNSUPPORT; - } -} - -/******************************************************************************* -* Function Name : Standard_GetInterface. -* Description : Return the Alternate Setting of the current interface. -* Input : Length - How many bytes are needed. -* Output : None. -* Return : Return 0, if the request is invalid when "Length" is 0. -* Return "Buffer" if the "Length" is not 0. -*******************************************************************************/ -uint8_t *Standard_GetInterface(uint16_t Length) -{ - if (Length == 0) - { - pInformation->Ctrl_Info.Usb_wLength = - sizeof(pInformation->Current_AlternateSetting); - return 0; - } - pUser_Standard_Requests->User_GetInterface(); - return (uint8_t *)&pInformation->Current_AlternateSetting; -} - -/******************************************************************************* -* Function Name : Standard_SetInterface. -* Description : This routine is called to set the interface. -* Then each class should configure the interface them self. -* Input : None. -* Output : None. -* Return : - Return USB_SUCCESS, if the request is performed. -* - Return USB_UNSUPPORT, if the request is invalid. -*******************************************************************************/ -RESULT Standard_SetInterface(void) -{ - RESULT Re; - /*Test if the specified Interface and Alternate Setting are supported by - the application Firmware*/ - Re = (*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, pInformation->USBwValue0); - - if (pInformation->Current_Configuration != 0) - { - if ((Re != USB_SUCCESS) || (pInformation->USBwIndex1 != 0) - || (pInformation->USBwValue1 != 0)) - { - return USB_UNSUPPORT; - } - else if (Re == USB_SUCCESS) - { - pUser_Standard_Requests->User_SetInterface(); - pInformation->Current_Interface = pInformation->USBwIndex0; - pInformation->Current_AlternateSetting = pInformation->USBwValue0; - return USB_SUCCESS; - } - - } - - return USB_UNSUPPORT; -} - -/******************************************************************************* -* Function Name : Standard_GetStatus. -* Description : Copy the device request data to "StatusInfo buffer". -* Input : - Length - How many bytes are needed. -* Output : None. -* Return : Return 0, if the request is at end of data block, -* or is invalid when "Length" is 0. -*******************************************************************************/ -uint8_t *Standard_GetStatus(uint16_t Length) -{ - if (Length == 0) - { - pInformation->Ctrl_Info.Usb_wLength = 2; - return 0; - } - - /* Reset Status Information */ - StatusInfo.w = 0; - - if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)) - { - /*Get Device Status */ - uint8_t Feature = pInformation->Current_Feature; - - /* Remote Wakeup enabled */ - if (ValBit(Feature, 5)) - { - SetBit(StatusInfo0, 1); - } - else - { - ClrBit(StatusInfo0, 1); - } - - /* Bus-powered */ - if (ValBit(Feature, 6)) - { - SetBit(StatusInfo0, 0); - } - else /* Self-powered */ - { - ClrBit(StatusInfo0, 0); - } - } - /*Interface Status*/ - else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT)) - { - return (uint8_t *)&StatusInfo; - } - /*Get EndPoint Status*/ - else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT)) - { - uint8_t Related_Endpoint; - uint8_t wIndex0 = pInformation->USBwIndex0; - - Related_Endpoint = (wIndex0 & 0x0f); - if (ValBit(wIndex0, 7)) - { - /* IN endpoint */ - if (_GetTxStallStatus(Related_Endpoint)) - { - SetBit(StatusInfo0, 0); /* IN Endpoint stalled */ - } - } - else - { - /* OUT endpoint */ - if (_GetRxStallStatus(Related_Endpoint)) - { - SetBit(StatusInfo0, 0); /* OUT Endpoint stalled */ - } - } - - } - else - { - return NULL; - } - pUser_Standard_Requests->User_GetStatus(); - return (uint8_t *)&StatusInfo; -} - -/******************************************************************************* -* Function Name : Standard_ClearFeature. -* Description : Clear or disable a specific feature. -* Input : None. -* Output : None. -* Return : - Return USB_SUCCESS, if the request is performed. -* - Return USB_UNSUPPORT, if the request is invalid. -*******************************************************************************/ -RESULT Standard_ClearFeature(void) -{ - uint32_t Type_Rec = Type_Recipient; - uint32_t Status; - - - if (Type_Rec == (STANDARD_REQUEST | DEVICE_RECIPIENT)) - {/*Device Clear Feature*/ - ClrBit(pInformation->Current_Feature, 5); - return USB_SUCCESS; - } - else if (Type_Rec == (STANDARD_REQUEST | ENDPOINT_RECIPIENT)) - {/*EndPoint Clear Feature*/ - DEVICE* pDev; - uint32_t Related_Endpoint; - uint32_t wIndex0; - uint32_t rEP; - - if ((pInformation->USBwValue != ENDPOINT_STALL) - || (pInformation->USBwIndex1 != 0)) - { - return USB_UNSUPPORT; - } - - pDev = &Device_Table; - wIndex0 = pInformation->USBwIndex0; - rEP = wIndex0 & ~0x80; - Related_Endpoint = ENDP0 + rEP; - - if (ValBit(pInformation->USBwIndex0, 7)) - { - /*Get Status of endpoint & stall the request if the related_ENdpoint - is Disabled*/ - Status = _GetEPTxStatus(Related_Endpoint); - } - else - { - Status = _GetEPRxStatus(Related_Endpoint); - } - - if ((rEP >= pDev->Total_Endpoint) || (Status == 0) - || (pInformation->Current_Configuration == 0)) - { - return USB_UNSUPPORT; - } - - - if (wIndex0 & 0x80) - { - /* IN endpoint */ - if (_GetTxStallStatus(Related_Endpoint )) - { - ClearDTOG_TX(Related_Endpoint); - SetEPTxStatus(Related_Endpoint, EP_TX_VALID); - } - } - else - { - /* OUT endpoint */ - if (_GetRxStallStatus(Related_Endpoint)) - { - if (Related_Endpoint == ENDP0) - { - /* After clear the STALL, enable the default endpoint receiver */ - SetEPRxCount(Related_Endpoint, Device_Property.MaxPacketSize); - _SetEPRxStatus(Related_Endpoint, EP_RX_VALID); - } - else - { - ClearDTOG_RX(Related_Endpoint); - _SetEPRxStatus(Related_Endpoint, EP_RX_VALID); - } - } - } - pUser_Standard_Requests->User_ClearFeature(); - return USB_SUCCESS; - } - - return USB_UNSUPPORT; -} - -/******************************************************************************* -* Function Name : Standard_SetEndPointFeature -* Description : Set or enable a specific feature of EndPoint -* Input : None. -* Output : None. -* Return : - Return USB_SUCCESS, if the request is performed. -* - Return USB_UNSUPPORT, if the request is invalid. -*******************************************************************************/ -RESULT Standard_SetEndPointFeature(void) -{ - uint32_t wIndex0; - uint32_t Related_Endpoint; - uint32_t rEP; - uint32_t Status; - - wIndex0 = pInformation->USBwIndex0; - rEP = wIndex0 & ~0x80; - Related_Endpoint = ENDP0 + rEP; - - if (ValBit(pInformation->USBwIndex0, 7)) - { - /* get Status of endpoint & stall the request if the related_ENdpoint - is Disabled*/ - Status = _GetEPTxStatus(Related_Endpoint); - } - else - { - Status = _GetEPRxStatus(Related_Endpoint); - } - - if (Related_Endpoint >= Device_Table.Total_Endpoint - || pInformation->USBwValue != 0 || Status == 0 - || pInformation->Current_Configuration == 0) - { - return USB_UNSUPPORT; - } - else - { - if (wIndex0 & 0x80) - { - /* IN endpoint */ - _SetEPTxStatus(Related_Endpoint, EP_TX_STALL); - } - - else - { - /* OUT endpoint */ - _SetEPRxStatus(Related_Endpoint, EP_RX_STALL); - } - } - pUser_Standard_Requests->User_SetEndPointFeature(); - return USB_SUCCESS; -} - -/******************************************************************************* -* Function Name : Standard_SetDeviceFeature. -* Description : Set or enable a specific feature of Device. -* Input : None. -* Output : None. -* Return : - Return USB_SUCCESS, if the request is performed. -* - Return USB_UNSUPPORT, if the request is invalid. -*******************************************************************************/ -RESULT Standard_SetDeviceFeature(void) -{ - SetBit(pInformation->Current_Feature, 5); - pUser_Standard_Requests->User_SetDeviceFeature(); - return USB_SUCCESS; -} - -/******************************************************************************* -* Function Name : Standard_GetDescriptorData. -* Description : Standard_GetDescriptorData is used for descriptors transfer. -* : This routine is used for the descriptors resident in Flash -* or RAM -* pDesc can be in either Flash or RAM -* The purpose of this routine is to have a versatile way to -* response descriptors request. It allows user to generate -* certain descriptors with software or read descriptors from -* external storage part by part. -* Input : - Length - Length of the data in this transfer. -* - pDesc - A pointer points to descriptor struct. -* The structure gives the initial address of the descriptor and -* its original size. -* Output : None. -* Return : Address of a part of the descriptor pointed by the Usb_ -* wOffset The buffer pointed by this address contains at least -* Length bytes. -*******************************************************************************/ -uint8_t *Standard_GetDescriptorData(uint16_t Length, ONE_DESCRIPTOR *pDesc) -{ - uint32_t wOffset; - - wOffset = pInformation->Ctrl_Info.Usb_wOffset; - if (Length == 0) - { - pInformation->Ctrl_Info.Usb_wLength = pDesc->Descriptor_Size - wOffset; - return 0; - } - - return pDesc->Descriptor + wOffset; -} - -/******************************************************************************* -* Function Name : DataStageOut. -* Description : Data stage of a Control Write Transfer. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void DataStageOut(void) -{ - ENDPOINT_INFO *pEPinfo = &pInformation->Ctrl_Info; - uint32_t save_rLength; - - save_rLength = pEPinfo->Usb_rLength; - - if (pEPinfo->CopyData && save_rLength) - { - uint8_t *Buffer; - uint32_t Length; - - Length = pEPinfo->PacketSize; - if (Length > save_rLength) - { - Length = save_rLength; - } - - Buffer = (*pEPinfo->CopyData)(Length); - pEPinfo->Usb_rLength -= Length; - pEPinfo->Usb_rOffset += Length; - PMAToUserBufferCopy(Buffer, GetEPRxAddr(ENDP0), Length); - - } - - if (pEPinfo->Usb_rLength != 0) - { - vSetEPRxStatus(EP_RX_VALID);/* re-enable for next data reception */ - SetEPTxCount(ENDP0, 0); - vSetEPTxStatus(EP_TX_VALID);/* Expect the host to abort the data OUT stage */ - } - /* Set the next State*/ - if (pEPinfo->Usb_rLength >= pEPinfo->PacketSize) - { - pInformation->ControlState = OUT_DATA; - } - else - { - if (pEPinfo->Usb_rLength > 0) - { - pInformation->ControlState = LAST_OUT_DATA; - } - else if (pEPinfo->Usb_rLength == 0) - { - pInformation->ControlState = WAIT_STATUS_IN; - USB_StatusIn(); - } - } -} - -/******************************************************************************* -* Function Name : DataStageIn. -* Description : Data stage of a Control Read Transfer. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void DataStageIn(void) -{ - ENDPOINT_INFO *pEPinfo = &pInformation->Ctrl_Info; - uint32_t save_wLength = pEPinfo->Usb_wLength; - uint32_t ControlState = pInformation->ControlState; - - uint8_t *DataBuffer; - uint32_t Length; - - if ((save_wLength == 0) && (ControlState == LAST_IN_DATA)) - { - if(Data_Mul_MaxPacketSize == TRUE) - { - /* No more data to send and empty packet */ - Send0LengthData(); - ControlState = LAST_IN_DATA; - Data_Mul_MaxPacketSize = FALSE; - } - else - { - /* No more data to send so STALL the TX Status*/ - ControlState = WAIT_STATUS_OUT; - vSetEPTxStatus(EP_TX_STALL); - - } - - goto Expect_Status_Out; - } - - Length = pEPinfo->PacketSize; - ControlState = (save_wLength <= Length) ? LAST_IN_DATA : IN_DATA; - - if (Length > save_wLength) - { - Length = save_wLength; - } - - DataBuffer = (*pEPinfo->CopyData)(Length); - - UserToPMABufferCopy(DataBuffer, GetEPTxAddr(ENDP0), Length); - - SetEPTxCount(ENDP0, Length); - - pEPinfo->Usb_wLength -= Length; - pEPinfo->Usb_wOffset += Length; - vSetEPTxStatus(EP_TX_VALID); - - USB_StatusOut();/* Expect the host to abort the data IN stage */ - -Expect_Status_Out: - pInformation->ControlState = ControlState; -} - -/******************************************************************************* -* Function Name : NoData_Setup0. -* Description : Proceed the processing of setup request without data stage. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void NoData_Setup0(void) -{ - RESULT Result = USB_UNSUPPORT; - uint32_t RequestNo = pInformation->USBbRequest; - uint32_t ControlState; - - if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)) - { - /* Device Request*/ - /* SET_CONFIGURATION*/ - if (RequestNo == SET_CONFIGURATION) - { - Result = Standard_SetConfiguration(); - } - - /*SET ADDRESS*/ - else if (RequestNo == SET_ADDRESS) - { - if ((pInformation->USBwValue0 > 127) || (pInformation->USBwValue1 != 0) - || (pInformation->USBwIndex != 0) - || (pInformation->Current_Configuration != 0)) - /* Device Address should be 127 or less*/ - { - ControlState = STALLED; - goto exit_NoData_Setup0; - } - else - { - Result = USB_SUCCESS; - } - } - /*SET FEATURE for Device*/ - else if (RequestNo == SET_FEATURE) - { - if ((pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP) \ - && (pInformation->USBwIndex == 0)) - { - Result = Standard_SetDeviceFeature(); - } - else - { - Result = USB_UNSUPPORT; - } - } - /*Clear FEATURE for Device */ - else if (RequestNo == CLEAR_FEATURE) - { - if (pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP - && pInformation->USBwIndex == 0 - && ValBit(pInformation->Current_Feature, 5)) - { - Result = Standard_ClearFeature(); - } - else - { - Result = USB_UNSUPPORT; - } - } - - } - - /* Interface Request*/ - else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT)) - { - /*SET INTERFACE*/ - if (RequestNo == SET_INTERFACE) - { - Result = Standard_SetInterface(); - } - } - - /* EndPoint Request*/ - else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT)) - { - /*CLEAR FEATURE for EndPoint*/ - if (RequestNo == CLEAR_FEATURE) - { - Result = Standard_ClearFeature(); - } - /* SET FEATURE for EndPoint*/ - else if (RequestNo == SET_FEATURE) - { - Result = Standard_SetEndPointFeature(); - } - } - else - { - Result = USB_UNSUPPORT; - } - - - if (Result != USB_SUCCESS) - { - Result = (*pProperty->Class_NoData_Setup)(RequestNo); - if (Result == USB_NOT_READY) - { - ControlState = PAUSE; - goto exit_NoData_Setup0; - } - } - - if (Result != USB_SUCCESS) - { - ControlState = STALLED; - goto exit_NoData_Setup0; - } - - ControlState = WAIT_STATUS_IN;/* After no data stage SETUP */ - - USB_StatusIn(); - -exit_NoData_Setup0: - pInformation->ControlState = ControlState; - return; -} - -/******************************************************************************* -* Function Name : Data_Setup0. -* Description : Proceed the processing of setup request with data stage. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void Data_Setup0(void) -{ - uint8_t *(*CopyRoutine)(uint16_t); - RESULT Result; - uint32_t Request_No = pInformation->USBbRequest; - - uint32_t Related_Endpoint, Reserved; - uint32_t wOffset, Status; - - - - CopyRoutine = NULL; - wOffset = 0; - - /*GET DESCRIPTOR*/ - if (Request_No == GET_DESCRIPTOR) - { - if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)) - { - uint8_t wValue1 = pInformation->USBwValue1; - if (wValue1 == DEVICE_DESCRIPTOR) - { - CopyRoutine = pProperty->GetDeviceDescriptor; - } - else if (wValue1 == CONFIG_DESCRIPTOR) - { - CopyRoutine = pProperty->GetConfigDescriptor; - } - else if (wValue1 == STRING_DESCRIPTOR) - { - CopyRoutine = pProperty->GetStringDescriptor; - } /* End of GET_DESCRIPTOR */ - } - } - - /*GET STATUS*/ - else if ((Request_No == GET_STATUS) && (pInformation->USBwValue == 0) - && (pInformation->USBwLength == 0x0002) - && (pInformation->USBwIndex1 == 0)) - { - /* GET STATUS for Device*/ - if ((Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)) - && (pInformation->USBwIndex == 0)) - { - CopyRoutine = Standard_GetStatus; - } - - /* GET STATUS for Interface*/ - else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT)) - { - if (((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS) - && (pInformation->Current_Configuration != 0)) - { - CopyRoutine = Standard_GetStatus; - } - } - - /* GET STATUS for EndPoint*/ - else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT)) - { - Related_Endpoint = (pInformation->USBwIndex0 & 0x0f); - Reserved = pInformation->USBwIndex0 & 0x70; - - if (ValBit(pInformation->USBwIndex0, 7)) - { - /*Get Status of endpoint & stall the request if the related_ENdpoint - is Disabled*/ - Status = _GetEPTxStatus(Related_Endpoint); - } - else - { - Status = _GetEPRxStatus(Related_Endpoint); - } - - if ((Related_Endpoint < Device_Table.Total_Endpoint) && (Reserved == 0) - && (Status != 0)) - { - CopyRoutine = Standard_GetStatus; - } - } - - } - - /*GET CONFIGURATION*/ - else if (Request_No == GET_CONFIGURATION) - { - if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)) - { - CopyRoutine = Standard_GetConfiguration; - } - } - /*GET INTERFACE*/ - else if (Request_No == GET_INTERFACE) - { - if ((Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT)) - && (pInformation->Current_Configuration != 0) && (pInformation->USBwValue == 0) - && (pInformation->USBwIndex1 == 0) && (pInformation->USBwLength == 0x0001) - && ((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS)) - { - CopyRoutine = Standard_GetInterface; - } - - } - - if (CopyRoutine) - { - pInformation->Ctrl_Info.Usb_wOffset = wOffset; - pInformation->Ctrl_Info.CopyData = CopyRoutine; - /* sb in the original the cast to word was directly */ - /* now the cast is made step by step */ - (*CopyRoutine)(0); - Result = USB_SUCCESS; - } - else - { - Result = (*pProperty->Class_Data_Setup)(pInformation->USBbRequest); - if (Result == USB_NOT_READY) - { - pInformation->ControlState = PAUSE; - return; - } - } - - if (pInformation->Ctrl_Info.Usb_wLength == 0xFFFF) - { - /* Data is not ready, wait it */ - pInformation->ControlState = PAUSE; - return; - } - if ((Result == USB_UNSUPPORT) || (pInformation->Ctrl_Info.Usb_wLength == 0)) - { - /* Unsupported request */ - pInformation->ControlState = STALLED; - return; - } - - - if (ValBit(pInformation->USBbmRequestType, 7)) - { - /* Device ==> Host */ - __IO uint32_t wLength = pInformation->USBwLength; - - /* Restrict the data length to be the one host asks for */ - if (pInformation->Ctrl_Info.Usb_wLength > wLength) - { - pInformation->Ctrl_Info.Usb_wLength = wLength; - } - - else if (pInformation->Ctrl_Info.Usb_wLength < pInformation->USBwLength) - { - if (pInformation->Ctrl_Info.Usb_wLength < pProperty->MaxPacketSize) - { - Data_Mul_MaxPacketSize = FALSE; - } - else if ((pInformation->Ctrl_Info.Usb_wLength % pProperty->MaxPacketSize) == 0) - { - Data_Mul_MaxPacketSize = TRUE; - } - } - - pInformation->Ctrl_Info.PacketSize = pProperty->MaxPacketSize; - DataStageIn(); - } - else - { - pInformation->ControlState = OUT_DATA; - vSetEPRxStatus(EP_RX_VALID); /* enable for next data reception */ - } - - return; -} - -/******************************************************************************* -* Function Name : Setup0_Process -* Description : Get the device request data and dispatch to individual process. -* Input : None. -* Output : None. -* Return : Post0_Process. -*******************************************************************************/ -uint8_t Setup0_Process(void) -{ - - union - { - uint8_t* b; - uint16_t* w; - } pBuf; - uint16_t offset = 1; - - pBuf.b = PMAAddr + (uint8_t *)(_GetEPRxAddr(ENDP0) * 2); /* *2 for 32 bits addr */ - - if (pInformation->ControlState != PAUSE) - { - pInformation->USBbmRequestType = *pBuf.b++; /* bmRequestType */ - pInformation->USBbRequest = *pBuf.b++; /* bRequest */ - pBuf.w += offset; /* word not accessed because of 32 bits addressing */ - pInformation->USBwValue = ByteSwap(*pBuf.w++); /* wValue */ - pBuf.w += offset; /* word not accessed because of 32 bits addressing */ - pInformation->USBwIndex = ByteSwap(*pBuf.w++); /* wIndex */ - pBuf.w += offset; /* word not accessed because of 32 bits addressing */ - pInformation->USBwLength = *pBuf.w; /* wLength */ - } - - pInformation->ControlState = SETTING_UP; - if (pInformation->USBwLength == 0) - { - /* Setup with no data stage */ - NoData_Setup0(); - } - else - { - /* Setup with data stage */ - Data_Setup0(); - } - return Post0_Process(); -} - -/******************************************************************************* -* Function Name : In0_Process -* Description : Process the IN token on all default endpoint. -* Input : None. -* Output : None. -* Return : Post0_Process. -*******************************************************************************/ -uint8_t In0_Process(void) -{ - uint32_t ControlState = pInformation->ControlState; - - if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA)) - { - DataStageIn(); - /* ControlState may be changed outside the function */ - ControlState = pInformation->ControlState; - } - - else if (ControlState == WAIT_STATUS_IN) - { - if ((pInformation->USBbRequest == SET_ADDRESS) && - (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))) - { - SetDeviceAddress(pInformation->USBwValue0); - pUser_Standard_Requests->User_SetDeviceAddress(); - } - (*pProperty->Process_Status_IN)(); - ControlState = STALLED; - } - - else - { - ControlState = STALLED; - } - - pInformation->ControlState = ControlState; - - return Post0_Process(); -} - -/******************************************************************************* -* Function Name : Out0_Process -* Description : Process the OUT token on all default endpoint. -* Input : None. -* Output : None. -* Return : Post0_Process. -*******************************************************************************/ -uint8_t Out0_Process(void) -{ - uint32_t ControlState = pInformation->ControlState; - - if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA)) - { - /* host aborts the transfer before finish */ - ControlState = STALLED; - } - else if ((ControlState == OUT_DATA) || (ControlState == LAST_OUT_DATA)) - { - DataStageOut(); - ControlState = pInformation->ControlState; /* may be changed outside the function */ - } - - else if (ControlState == WAIT_STATUS_OUT) - { - (*pProperty->Process_Status_OUT)(); - ControlState = STALLED; - } - - - /* Unexpect state, STALL the endpoint */ - else - { - ControlState = STALLED; - } - - pInformation->ControlState = ControlState; - - return Post0_Process(); -} - -/******************************************************************************* -* Function Name : Post0_Process -* Description : Stall the Endpoint 0 in case of error. -* Input : None. -* Output : None. -* Return : - 0 if the control State is in PAUSE -* - 1 if not. -*******************************************************************************/ -uint8_t Post0_Process(void) -{ - - SetEPRxCount(ENDP0, Device_Property.MaxPacketSize); - - if (pInformation->ControlState == STALLED) - { - vSetEPRxStatus(EP_RX_STALL); - vSetEPTxStatus(EP_TX_STALL); - } - - return (pInformation->ControlState == PAUSE); -} - -/******************************************************************************* -* Function Name : SetDeviceAddress. -* Description : Set the device and all the used Endpoints addresses. -* Input : - Val: device address. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetDeviceAddress(uint8_t Val) -{ - uint32_t i; - uint32_t nEP = Device_Table.Total_Endpoint; - - /* set address in every used endpoint */ - for (i = 0; i < nEP; i++) - { - _SetEPAddress((uint8_t)i, (uint8_t)i); - } /* for */ - _SetDADDR(Val | DADDR_EF); /* set device address and enable function */ -} - -/******************************************************************************* -* Function Name : NOP_Process -* Description : No operation function. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void NOP_Process(void) -{ -} - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_init.c b/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_init.c deleted file mode 100644 index f9af7988..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_init.c +++ /dev/null @@ -1,76 +0,0 @@ -/** - ****************************************************************************** - * @file usb_init.c - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Initialization routines & global variables - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Includes ------------------------------------------------------------------*/ -#include "usb_lib.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -/* The number of current endpoint, it will be used to specify an endpoint */ - uint8_t EPindex; -/* The number of current device, it is an index to the Device_Table */ -/* uint8_t Device_no; */ -/* Points to the DEVICE_INFO structure of current device */ -/* The purpose of this register is to speed up the execution */ -DEVICE_INFO *pInformation; -/* Points to the DEVICE_PROP structure of current device */ -/* The purpose of this register is to speed up the execution */ -DEVICE_PROP *pProperty; -/* Temporary save the state of Rx & Tx status. */ -/* Whenever the Rx or Tx state is changed, its value is saved */ -/* in this variable first and will be set to the EPRB or EPRA */ -/* at the end of interrupt process */ -uint16_t SaveState ; -uint16_t wInterrupt_Mask; -DEVICE_INFO Device_Info; -USER_STANDARD_REQUESTS *pUser_Standard_Requests; - -/* Extern variables ----------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/******************************************************************************* -* Function Name : USB_Init -* Description : USB system initialization -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void USB_Init(void) -{ - pInformation = &Device_Info; - pInformation->ControlState = 2; - pProperty = &Device_Property; - pUser_Standard_Requests = &User_Standard_Requests; - /* Initialize devices one by one */ - pProperty->Init(); -} - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_int.c b/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_int.c deleted file mode 100644 index 1c4065dc..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_int.c +++ /dev/null @@ -1,195 +0,0 @@ -/** - ****************************************************************************** - * @file usb_int.c - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Endpoint CTR (Low and High) interrupt's service routines - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "usb_lib.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -__IO uint16_t SaveRState; -__IO uint16_t SaveTState; - -/* Extern variables ----------------------------------------------------------*/ -extern void (*pEpInt_IN[7])(void); /* Handles IN interrupts */ -extern void (*pEpInt_OUT[7])(void); /* Handles OUT interrupts */ - -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/******************************************************************************* -* Function Name : CTR_LP. -* Description : Low priority Endpoint Correct Transfer interrupt's service -* routine. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void CTR_LP(void) -{ - __IO uint16_t wEPVal = 0; - /* stay in loop while pending interrupts */ - while (((wIstr = _GetISTR()) & ISTR_CTR) != 0) - { - /* extract highest priority endpoint number */ - EPindex = (uint8_t)(wIstr & ISTR_EP_ID); - if (EPindex == 0) - { - /* Decode and service control endpoint interrupt */ - /* calling related service routine */ - /* (Setup0_Process, In0_Process, Out0_Process) */ - - /* save RX & TX status */ - /* and set both to NAK */ - - SaveRState = _GetENDPOINT(ENDP0); - SaveTState = SaveRState & EPTX_STAT; - SaveRState &= EPRX_STAT; - - _SetEPRxTxStatus(ENDP0,EP_RX_NAK,EP_TX_NAK); - - /* DIR bit = origin of the interrupt */ - - if ((wIstr & ISTR_DIR) == 0) - { - /* DIR = 0 */ - - /* DIR = 0 => IN int */ - /* DIR = 0 implies that (EP_CTR_TX = 1) always */ - - _ClearEP_CTR_TX(ENDP0); - In0_Process(); - - /* before terminate set Tx & Rx status */ - - _SetEPRxTxStatus(ENDP0,SaveRState,SaveTState); - return; - } - else - { - /* DIR = 1 */ - - /* DIR = 1 & CTR_RX => SETUP or OUT int */ - /* DIR = 1 & (CTR_TX | CTR_RX) => 2 int pending */ - - wEPVal = _GetENDPOINT(ENDP0); - - if ((wEPVal &EP_SETUP) != 0) - { - _ClearEP_CTR_RX(ENDP0); /* SETUP bit kept frozen while CTR_RX = 1 */ - Setup0_Process(); - /* before terminate set Tx & Rx status */ - - _SetEPRxTxStatus(ENDP0,SaveRState,SaveTState); - return; - } - - else if ((wEPVal & EP_CTR_RX) != 0) - { - _ClearEP_CTR_RX(ENDP0); - Out0_Process(); - /* before terminate set Tx & Rx status */ - - _SetEPRxTxStatus(ENDP0,SaveRState,SaveTState); - return; - } - } - }/* if(EPindex == 0) */ - else - { - /* Decode and service non control endpoints interrupt */ - - /* process related endpoint register */ - wEPVal = _GetENDPOINT(EPindex); - if ((wEPVal & EP_CTR_RX) != 0) - { - /* clear int flag */ - _ClearEP_CTR_RX(EPindex); - - /* call OUT service function */ - (*pEpInt_OUT[EPindex-1])(); - - } /* if((wEPVal & EP_CTR_RX) */ - - if ((wEPVal & EP_CTR_TX) != 0) - { - /* clear int flag */ - _ClearEP_CTR_TX(EPindex); - - /* call IN service function */ - (*pEpInt_IN[EPindex-1])(); - } /* if((wEPVal & EP_CTR_TX) != 0) */ - - }/* if(EPindex == 0) else */ - - }/* while(...) */ -} - -/******************************************************************************* -* Function Name : CTR_HP. -* Description : High Priority Endpoint Correct Transfer interrupt's service -* routine. -* Input : None. -* Output : None. -* Return : None. -*******************************************************************************/ -void CTR_HP(void) -{ - uint32_t wEPVal = 0; - - while (((wIstr = _GetISTR()) & ISTR_CTR) != 0) - { - _SetISTR((uint16_t)CLR_CTR); /* clear CTR flag */ - /* extract highest priority endpoint number */ - EPindex = (uint8_t)(wIstr & ISTR_EP_ID); - /* process related endpoint register */ - wEPVal = _GetENDPOINT(EPindex); - if ((wEPVal & EP_CTR_RX) != 0) - { - /* clear int flag */ - _ClearEP_CTR_RX(EPindex); - - /* call OUT service function */ - (*pEpInt_OUT[EPindex-1])(); - - } /* if((wEPVal & EP_CTR_RX) */ - else if ((wEPVal & EP_CTR_TX) != 0) - { - /* clear int flag */ - _ClearEP_CTR_TX(EPindex); - - /* call IN service function */ - (*pEpInt_IN[EPindex-1])(); - - - } /* if((wEPVal & EP_CTR_TX) != 0) */ - - }/* while(...) */ -} - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_mem.c b/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_mem.c deleted file mode 100644 index 1e34961c..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_mem.c +++ /dev/null @@ -1,87 +0,0 @@ -/** - ****************************************************************************** - * @file usb_mem.c - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Utility functions for memory transfers to/from PMA - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "usb_lib.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -/* Extern variables ----------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/******************************************************************************* -* Function Name : UserToPMABufferCopy -* Description : Copy a buffer from user memory area to packet memory area (PMA) -* Input : - pbUsrBuf: pointer to user memory area. -* - wPMABufAddr: address into PMA. -* - wNBytes: no. of bytes to be copied. -* Output : None. -* Return : None . -*******************************************************************************/ -void UserToPMABufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes) -{ - uint32_t n = (wNBytes + 1) >> 1; /* n = (wNBytes + 1) / 2 */ - uint32_t i, temp1, temp2; - uint16_t *pdwVal; - pdwVal = (uint16_t *)(wPMABufAddr * 2 + PMAAddr); - for (i = n; i != 0; i--) - { - temp1 = (uint16_t) * pbUsrBuf; - pbUsrBuf++; - temp2 = temp1 | (uint16_t) * pbUsrBuf << 8; - *pdwVal++ = temp2; - pdwVal++; - pbUsrBuf++; - } -} - -/******************************************************************************* -* Function Name : PMAToUserBufferCopy -* Description : Copy a buffer from user memory area to packet memory area (PMA) -* Input : - pbUsrBuf = pointer to user memory area. -* - wPMABufAddr = address into PMA. -* - wNBytes = no. of bytes to be copied. -* Output : None. -* Return : None. -*******************************************************************************/ -void PMAToUserBufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes) -{ - uint32_t n = (wNBytes + 1) >> 1;/* /2*/ - uint32_t i; - uint32_t *pdwVal; - pdwVal = (uint32_t *)(wPMABufAddr * 2 + PMAAddr); - for (i = n; i != 0; i--) - { - *(uint16_t*)pbUsrBuf++ = *pdwVal++; - pbUsrBuf++; - } -} - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_regs.c b/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_regs.c deleted file mode 100644 index b1dabdab..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_regs.c +++ /dev/null @@ -1,760 +0,0 @@ -/** - ****************************************************************************** - * @file usb_regs.c - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Interface functions to USB cell registers - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "usb_lib.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -/* Extern variables ----------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/******************************************************************************* -* Function Name : SetCNTR. -* Description : Set the CNTR register value. -* Input : wRegValue: new register value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetCNTR(uint16_t wRegValue) -{ - _SetCNTR(wRegValue); -} - -/******************************************************************************* -* Function Name : GetCNTR. -* Description : returns the CNTR register value. -* Input : None. -* Output : None. -* Return : CNTR register Value. -*******************************************************************************/ -uint16_t GetCNTR(void) -{ - return(_GetCNTR()); -} - -/******************************************************************************* -* Function Name : SetISTR. -* Description : Set the ISTR register value. -* Input : wRegValue: new register value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetISTR(uint16_t wRegValue) -{ - _SetISTR(wRegValue); -} - -/******************************************************************************* -* Function Name : GetISTR -* Description : Returns the ISTR register value. -* Input : None. -* Output : None. -* Return : ISTR register Value -*******************************************************************************/ -uint16_t GetISTR(void) -{ - return(_GetISTR()); -} - -/******************************************************************************* -* Function Name : GetFNR -* Description : Returns the FNR register value. -* Input : None. -* Output : None. -* Return : FNR register Value -*******************************************************************************/ -uint16_t GetFNR(void) -{ - return(_GetFNR()); -} - -/******************************************************************************* -* Function Name : SetDADDR -* Description : Set the DADDR register value. -* Input : wRegValue: new register value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetDADDR(uint16_t wRegValue) -{ - _SetDADDR(wRegValue); -} - -/******************************************************************************* -* Function Name : GetDADDR -* Description : Returns the DADDR register value. -* Input : None. -* Output : None. -* Return : DADDR register Value -*******************************************************************************/ -uint16_t GetDADDR(void) -{ - return(_GetDADDR()); -} - -/******************************************************************************* -* Function Name : SetBTABLE -* Description : Set the BTABLE. -* Input : wRegValue: New register value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetBTABLE(uint16_t wRegValue) -{ - _SetBTABLE(wRegValue); -} - -/******************************************************************************* -* Function Name : GetBTABLE. -* Description : Returns the BTABLE register value. -* Input : None. -* Output : None. -* Return : BTABLE address. -*******************************************************************************/ -uint16_t GetBTABLE(void) -{ - return(_GetBTABLE()); -} - -/******************************************************************************* -* Function Name : SetENDPOINT -* Description : Set the Endpoint register value. -* Input : bEpNum: Endpoint Number. -* wRegValue. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetENDPOINT(uint8_t bEpNum, uint16_t wRegValue) -{ - _SetENDPOINT(bEpNum, wRegValue); -} - -/******************************************************************************* -* Function Name : GetENDPOINT -* Description : Return the Endpoint register value. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint register value. -*******************************************************************************/ -uint16_t GetENDPOINT(uint8_t bEpNum) -{ - return(_GetENDPOINT(bEpNum)); -} - -/******************************************************************************* -* Function Name : SetEPType -* Description : sets the type in the endpoint register. -* Input : bEpNum: Endpoint Number. -* wType: type definition. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPType(uint8_t bEpNum, uint16_t wType) -{ - _SetEPType(bEpNum, wType); -} - -/******************************************************************************* -* Function Name : GetEPType -* Description : Returns the endpoint type. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint Type -*******************************************************************************/ -uint16_t GetEPType(uint8_t bEpNum) -{ - return(_GetEPType(bEpNum)); -} - -/******************************************************************************* -* Function Name : SetEPTxStatus -* Description : Set the status of Tx endpoint. -* Input : bEpNum: Endpoint Number. -* wState: new state. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPTxStatus(uint8_t bEpNum, uint16_t wState) -{ - _SetEPTxStatus(bEpNum, wState); -} - -/******************************************************************************* -* Function Name : SetEPRxStatus -* Description : Set the status of Rx endpoint. -* Input : bEpNum: Endpoint Number. -* wState: new state. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPRxStatus(uint8_t bEpNum, uint16_t wState) -{ - _SetEPRxStatus(bEpNum, wState); -} - -/******************************************************************************* -* Function Name : SetDouBleBuffEPStall -* Description : sets the status for Double Buffer Endpoint to STALL -* Input : bEpNum: Endpoint Number. -* bDir: Endpoint direction. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetDouBleBuffEPStall(uint8_t bEpNum, uint8_t bDir) -{ - uint16_t Endpoint_DTOG_Status; - Endpoint_DTOG_Status = GetENDPOINT(bEpNum); - if (bDir == EP_DBUF_OUT) - { /* OUT double buffered endpoint */ - _SetENDPOINT(bEpNum, Endpoint_DTOG_Status & ~EPRX_DTOG1); - } - else if (bDir == EP_DBUF_IN) - { /* IN double buffered endpoint */ - _SetENDPOINT(bEpNum, Endpoint_DTOG_Status & ~EPTX_DTOG1); - } -} - -/******************************************************************************* -* Function Name : GetEPTxStatus -* Description : Returns the endpoint Tx status. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint TX Status -*******************************************************************************/ -uint16_t GetEPTxStatus(uint8_t bEpNum) -{ - return(_GetEPTxStatus(bEpNum)); -} - -/******************************************************************************* -* Function Name : GetEPRxStatus -* Description : Returns the endpoint Rx status. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint RX Status -*******************************************************************************/ -uint16_t GetEPRxStatus(uint8_t bEpNum) -{ - return(_GetEPRxStatus(bEpNum)); -} - -/******************************************************************************* -* Function Name : SetEPTxValid -* Description : Valid the endpoint Tx Status. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPTxValid(uint8_t bEpNum) -{ - _SetEPTxStatus(bEpNum, EP_TX_VALID); -} - -/******************************************************************************* -* Function Name : SetEPRxValid -* Description : Valid the endpoint Rx Status. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPRxValid(uint8_t bEpNum) -{ - _SetEPRxStatus(bEpNum, EP_RX_VALID); -} - -/******************************************************************************* -* Function Name : SetEP_KIND -* Description : Clear the EP_KIND bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEP_KIND(uint8_t bEpNum) -{ - _SetEP_KIND(bEpNum); -} - -/******************************************************************************* -* Function Name : ClearEP_KIND -* Description : set the EP_KIND bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ClearEP_KIND(uint8_t bEpNum) -{ - _ClearEP_KIND(bEpNum); -} -/******************************************************************************* -* Function Name : Clear_Status_Out -* Description : Clear the Status Out of the related Endpoint -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void Clear_Status_Out(uint8_t bEpNum) -{ - _ClearEP_KIND(bEpNum); -} -/******************************************************************************* -* Function Name : Set_Status_Out -* Description : Set the Status Out of the related Endpoint -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void Set_Status_Out(uint8_t bEpNum) -{ - _SetEP_KIND(bEpNum); -} -/******************************************************************************* -* Function Name : SetEPDoubleBuff -* Description : Enable the double buffer feature for the endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDoubleBuff(uint8_t bEpNum) -{ - _SetEP_KIND(bEpNum); -} -/******************************************************************************* -* Function Name : ClearEPDoubleBuff -* Description : Disable the double buffer feature for the endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ClearEPDoubleBuff(uint8_t bEpNum) -{ - _ClearEP_KIND(bEpNum); -} -/******************************************************************************* -* Function Name : GetTxStallStatus -* Description : Returns the Stall status of the Tx endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Tx Stall status. -*******************************************************************************/ -uint16_t GetTxStallStatus(uint8_t bEpNum) -{ - return(_GetTxStallStatus(bEpNum)); -} -/******************************************************************************* -* Function Name : GetRxStallStatus -* Description : Returns the Stall status of the Rx endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Rx Stall status. -*******************************************************************************/ -uint16_t GetRxStallStatus(uint8_t bEpNum) -{ - return(_GetRxStallStatus(bEpNum)); -} -/******************************************************************************* -* Function Name : ClearEP_CTR_RX -* Description : Clear the CTR_RX bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ClearEP_CTR_RX(uint8_t bEpNum) -{ - _ClearEP_CTR_RX(bEpNum); -} -/******************************************************************************* -* Function Name : ClearEP_CTR_TX -* Description : Clear the CTR_TX bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ClearEP_CTR_TX(uint8_t bEpNum) -{ - _ClearEP_CTR_TX(bEpNum); -} -/******************************************************************************* -* Function Name : ToggleDTOG_RX -* Description : Toggle the DTOG_RX bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ToggleDTOG_RX(uint8_t bEpNum) -{ - _ToggleDTOG_RX(bEpNum); -} -/******************************************************************************* -* Function Name : ToggleDTOG_TX -* Description : Toggle the DTOG_TX bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ToggleDTOG_TX(uint8_t bEpNum) -{ - _ToggleDTOG_TX(bEpNum); -} -/******************************************************************************* -* Function Name : ClearDTOG_RX. -* Description : Clear the DTOG_RX bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ClearDTOG_RX(uint8_t bEpNum) -{ - _ClearDTOG_RX(bEpNum); -} -/******************************************************************************* -* Function Name : ClearDTOG_TX. -* Description : Clear the DTOG_TX bit. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -void ClearDTOG_TX(uint8_t bEpNum) -{ - _ClearDTOG_TX(bEpNum); -} -/******************************************************************************* -* Function Name : SetEPAddress -* Description : Set the endpoint address. -* Input : bEpNum: Endpoint Number. -* bAddr: New endpoint address. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPAddress(uint8_t bEpNum, uint8_t bAddr) -{ - _SetEPAddress(bEpNum, bAddr); -} -/******************************************************************************* -* Function Name : GetEPAddress -* Description : Get the endpoint address. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint address. -*******************************************************************************/ -uint8_t GetEPAddress(uint8_t bEpNum) -{ - return(_GetEPAddress(bEpNum)); -} -/******************************************************************************* -* Function Name : SetEPTxAddr -* Description : Set the endpoint Tx buffer address. -* Input : bEpNum: Endpoint Number. -* wAddr: new address. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPTxAddr(uint8_t bEpNum, uint16_t wAddr) -{ - _SetEPTxAddr(bEpNum, wAddr); -} -/******************************************************************************* -* Function Name : SetEPRxAddr -* Description : Set the endpoint Rx buffer address. -* Input : bEpNum: Endpoint Number. -* wAddr: new address. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPRxAddr(uint8_t bEpNum, uint16_t wAddr) -{ - _SetEPRxAddr(bEpNum, wAddr); -} -/******************************************************************************* -* Function Name : GetEPTxAddr -* Description : Returns the endpoint Tx buffer address. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Rx buffer address. -*******************************************************************************/ -uint16_t GetEPTxAddr(uint8_t bEpNum) -{ - return(_GetEPTxAddr(bEpNum)); -} -/******************************************************************************* -* Function Name : GetEPRxAddr. -* Description : Returns the endpoint Rx buffer address. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Rx buffer address. -*******************************************************************************/ -uint16_t GetEPRxAddr(uint8_t bEpNum) -{ - return(_GetEPRxAddr(bEpNum)); -} -/******************************************************************************* -* Function Name : SetEPTxCount. -* Description : Set the Tx count. -* Input : bEpNum: Endpoint Number. -* wCount: new count value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPTxCount(uint8_t bEpNum, uint16_t wCount) -{ - _SetEPTxCount(bEpNum, wCount); -} -/******************************************************************************* -* Function Name : SetEPCountRxReg. -* Description : Set the Count Rx Register value. -* Input : *pdwReg: point to the register. -* wCount: the new register value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPCountRxReg(uint32_t *pdwReg, uint16_t wCount) -{ - _SetEPCountRxReg(dwReg, wCount); -} -/******************************************************************************* -* Function Name : SetEPRxCount -* Description : Set the Rx count. -* Input : bEpNum: Endpoint Number. -* wCount: the new count value. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPRxCount(uint8_t bEpNum, uint16_t wCount) -{ - _SetEPRxCount(bEpNum, wCount); -} -/******************************************************************************* -* Function Name : GetEPTxCount -* Description : Get the Tx count. -* Input : bEpNum: Endpoint Number. -* Output : None -* Return : Tx count value. -*******************************************************************************/ -uint16_t GetEPTxCount(uint8_t bEpNum) -{ - return(_GetEPTxCount(bEpNum)); -} -/******************************************************************************* -* Function Name : GetEPRxCount -* Description : Get the Rx count. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Rx count value. -*******************************************************************************/ -uint16_t GetEPRxCount(uint8_t bEpNum) -{ - return(_GetEPRxCount(bEpNum)); -} -/******************************************************************************* -* Function Name : SetEPDblBuffAddr -* Description : Set the addresses of the buffer 0 and 1. -* Input : bEpNum: Endpoint Number. -* wBuf0Addr: new address of buffer 0. -* wBuf1Addr: new address of buffer 1. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDblBuffAddr(uint8_t bEpNum, uint16_t wBuf0Addr, uint16_t wBuf1Addr) -{ - _SetEPDblBuffAddr(bEpNum, wBuf0Addr, wBuf1Addr); -} -/******************************************************************************* -* Function Name : SetEPDblBuf0Addr -* Description : Set the Buffer 1 address. -* Input : bEpNum: Endpoint Number -* wBuf0Addr: new address. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDblBuf0Addr(uint8_t bEpNum, uint16_t wBuf0Addr) -{ - _SetEPDblBuf0Addr(bEpNum, wBuf0Addr); -} -/******************************************************************************* -* Function Name : SetEPDblBuf1Addr -* Description : Set the Buffer 1 address. -* Input : bEpNum: Endpoint Number -* wBuf1Addr: new address. -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDblBuf1Addr(uint8_t bEpNum, uint16_t wBuf1Addr) -{ - _SetEPDblBuf1Addr(bEpNum, wBuf1Addr); -} -/******************************************************************************* -* Function Name : GetEPDblBuf0Addr -* Description : Returns the address of the Buffer 0. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : None. -*******************************************************************************/ -uint16_t GetEPDblBuf0Addr(uint8_t bEpNum) -{ - return(_GetEPDblBuf0Addr(bEpNum)); -} -/******************************************************************************* -* Function Name : GetEPDblBuf1Addr -* Description : Returns the address of the Buffer 1. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Address of the Buffer 1. -*******************************************************************************/ -uint16_t GetEPDblBuf1Addr(uint8_t bEpNum) -{ - return(_GetEPDblBuf1Addr(bEpNum)); -} -/******************************************************************************* -* Function Name : SetEPDblBuffCount -* Description : Set the number of bytes for a double Buffer -* endpoint. -* Input : bEpNum,bDir, wCount -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDblBuffCount(uint8_t bEpNum, uint8_t bDir, uint16_t wCount) -{ - _SetEPDblBuffCount(bEpNum, bDir, wCount); -} -/******************************************************************************* -* Function Name : SetEPDblBuf0Count -* Description : Set the number of bytes in the buffer 0 of a double Buffer -* endpoint. -* Input : bEpNum, bDir, wCount -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDblBuf0Count(uint8_t bEpNum, uint8_t bDir, uint16_t wCount) -{ - _SetEPDblBuf0Count(bEpNum, bDir, wCount); -} -/******************************************************************************* -* Function Name : SetEPDblBuf1Count -* Description : Set the number of bytes in the buffer 0 of a double Buffer -* endpoint. -* Input : bEpNum, bDir, wCount -* Output : None. -* Return : None. -*******************************************************************************/ -void SetEPDblBuf1Count(uint8_t bEpNum, uint8_t bDir, uint16_t wCount) -{ - _SetEPDblBuf1Count(bEpNum, bDir, wCount); -} -/******************************************************************************* -* Function Name : GetEPDblBuf0Count -* Description : Returns the number of byte received in the buffer 0 of a double -* Buffer endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint Buffer 0 count -*******************************************************************************/ -uint16_t GetEPDblBuf0Count(uint8_t bEpNum) -{ - return(_GetEPDblBuf0Count(bEpNum)); -} -/******************************************************************************* -* Function Name : GetEPDblBuf1Count -* Description : Returns the number of data received in the buffer 1 of a double -* Buffer endpoint. -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : Endpoint Buffer 1 count. -*******************************************************************************/ -uint16_t GetEPDblBuf1Count(uint8_t bEpNum) -{ - return(_GetEPDblBuf1Count(bEpNum)); -} -/******************************************************************************* -* Function Name : GetEPDblBufDir -* Description : gets direction of the double buffered endpoint -* Input : bEpNum: Endpoint Number. -* Output : None. -* Return : EP_DBUF_OUT, EP_DBUF_IN, -* EP_DBUF_ERR if the endpoint counter not yet programmed. -*******************************************************************************/ -EP_DBUF_DIR GetEPDblBufDir(uint8_t bEpNum) -{ - if ((uint16_t)(*_pEPRxCount(bEpNum) & 0xFC00) != 0) - return(EP_DBUF_OUT); - else if (((uint16_t)(*_pEPTxCount(bEpNum)) & 0x03FF) != 0) - return(EP_DBUF_IN); - else - return(EP_DBUF_ERR); -} -/******************************************************************************* -* Function Name : FreeUserBuffer -* Description : free buffer used from the application realizing it to the line - toggles bit SW_BUF in the double buffered endpoint register -* Input : bEpNum, bDir -* Output : None. -* Return : None. -*******************************************************************************/ -void FreeUserBuffer(uint8_t bEpNum, uint8_t bDir) -{ - if (bDir == EP_DBUF_OUT) - { /* OUT double buffered endpoint */ - _ToggleDTOG_TX(bEpNum); - } - else if (bDir == EP_DBUF_IN) - { /* IN double buffered endpoint */ - _ToggleDTOG_RX(bEpNum); - } -} - -/******************************************************************************* -* Function Name : ToWord -* Description : merge two byte in a word. -* Input : bh: byte high, bl: bytes low. -* Output : None. -* Return : resulted word. -*******************************************************************************/ -uint16_t ToWord(uint8_t bh, uint8_t bl) -{ - uint16_t wRet; - wRet = (uint16_t)bl | ((uint16_t)bh << 8); - return(wRet); -} -/******************************************************************************* -* Function Name : ByteSwap -* Description : Swap two byte in a word. -* Input : wSwW: word to Swap. -* Output : None. -* Return : resulted word. -*******************************************************************************/ -uint16_t ByteSwap(uint16_t wSwW) -{ - uint8_t bTemp; - uint16_t wRet; - bTemp = (uint8_t)(wSwW & 0xff); - wRet = (wSwW >> 8) | ((uint16_t)bTemp << 8); - return(wRet); -} - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_sil.c b/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_sil.c deleted file mode 100644 index 24199049..00000000 --- a/workspace/ts100/STM32_USB-FS-Device_Driver/src/usb_sil.c +++ /dev/null @@ -1,103 +0,0 @@ -/** - ****************************************************************************** - * @file usb_sil.c - * @author MCD Application Team - * @version V4.0.0 - * @date 28-August-2012 - * @brief Simplified Interface Layer for Global Initialization and Endpoint - * Rea/Write operations. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2012 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Includes ------------------------------------------------------------------*/ -#include "usb_lib.h" - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ -/* Private variables ---------------------------------------------------------*/ -/* Extern variables ----------------------------------------------------------*/ -/* Private function prototypes -----------------------------------------------*/ -/* Private functions ---------------------------------------------------------*/ - -/******************************************************************************* -* Function Name : USB_SIL_Init -* Description : Initialize the USB Device IP and the Endpoint 0. -* Input : None. -* Output : None. -* Return : Status. -*******************************************************************************/ -uint32_t USB_SIL_Init(void) -{ - /* USB interrupts initialization */ - /* clear pending interrupts */ - _SetISTR(0); - wInterrupt_Mask = IMR_MSK; - /* set interrupts mask */ - _SetCNTR(wInterrupt_Mask); - return 0; -} - -/******************************************************************************* -* Function Name : USB_SIL_Write -* Description : Write a buffer of data to a selected endpoint. -* Input : - bEpAddr: The address of the non control endpoint. -* - pBufferPointer: The pointer to the buffer of data to be written -* to the endpoint. -* - wBufferSize: Number of data to be written (in bytes). -* Output : None. -* Return : Status. -*******************************************************************************/ -uint32_t USB_SIL_Write(uint8_t bEpAddr, uint8_t* pBufferPointer, uint32_t wBufferSize) -{ - /* Use the memory interface function to write to the selected endpoint */ - UserToPMABufferCopy(pBufferPointer, GetEPTxAddr(bEpAddr & 0x7F), wBufferSize); - - /* Update the data length in the control register */ - SetEPTxCount((bEpAddr & 0x7F), wBufferSize); - - return 0; -} - -/******************************************************************************* -* Function Name : USB_SIL_Read -* Description : Write a buffer of data to a selected endpoint. -* Input : - bEpAddr: The address of the non control endpoint. -* - pBufferPointer: The pointer to which will be saved the -* received data buffer. -* Output : None. -* Return : Number of received data (in Bytes). -*******************************************************************************/ -uint32_t USB_SIL_Read(uint8_t bEpAddr, uint8_t* pBufferPointer) -{ - uint32_t DataLength = 0; - - /* Get the number of received data on the selected Endpoint */ - DataLength = GetEPRxCount(bEpAddr & 0x7F); - - /* Use the memory interface function to write to the selected endpoint */ - PMAToUserBufferCopy(pBufferPointer, GetEPRxAddr(bEpAddr & 0x7F), DataLength); - - /* Return the number of received data */ - return DataLength; -} - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/inc/APP_Version.h b/workspace/ts100/inc/APP_Version.h deleted file mode 100644 index e3ad3308..00000000 --- a/workspace/ts100/inc/APP_Version.h +++ /dev/null @@ -1,43 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** - File Name : APP_Version.h - Version : S100 APP Ver 2.11 - Description: - Author : bure & Celery - Data: 2015/08/03 - History: - 2015/08/03 ͳһ������ - *******************************************************************************/ - -#ifndef __VERSION_H -#define __VERSION_H - -#define M_VER 'V','0' -#define S_VER '0','1' -#define OEM_TYPE "0" -#define APP_BASE 0x0800C000/*Start address of the virtual disk*/ - -/*----------------------------------------------------------------------------*/ -#ifdef TYPE_DS201 -#define PRODUCT_INFO "DS201" -#define SCH_VER "1.7B" -#else - #ifdef TYPE_DS202 - #include "DS202V1_6.h" - #define FLASH_PAGE 0x0800 - #else - #ifdef TYPE_DS203 - #define PRODUCT_INFO "DS203" - #define SCH_VER "2.70" - #else - #ifdef TYPE_S100 - #define PRODUCT_INFO "TS100" - #include "S100V0_1.h" - #endif - #endif - #endif -#endif - -/*----------------------------------------------------------------------------*/ -#define DFU_VER {M_VER,'.',S_VER,LCD_M, 0} -#endif /* VERSION_H */ -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/inc/Analog.h b/workspace/ts100/inc/Analog.h new file mode 100644 index 00000000..d4bae0d8 --- /dev/null +++ b/workspace/ts100/inc/Analog.h @@ -0,0 +1,20 @@ +/* + * Analog.h + * + * Created on: 20 Sep 2016 + * Author: ralim + * + * Interface to the ADC's basically + */ + +#ifndef ANALOG_H_ +#define ANALOG_H_ +#include "stm32f10x.h" +#include "Bios.h" +#include "Interrupt.h" +extern volatile uint16_t ADC1ConvertedValue[2]; + +uint16_t Get_ADC1Value(uint8_t i); +uint16_t readIronTemp(uint16_t calibration,uint8_t read);//read the iron temp in C X10 +uint16_t readDCVoltage();/*Get the system voltage X10*/ +#endif /* ANALOG_H_ */ diff --git a/workspace/ts100/inc/Bios.h b/workspace/ts100/inc/Bios.h index aa3e5bef..84faab60 100644 --- a/workspace/ts100/inc/Bios.h +++ b/workspace/ts100/inc/Bios.h @@ -1,59 +1,44 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** -File Name : Bios.h -Version : S100 APP Ver 2.11 -Description: -Author : bure & Celery -Data: 2015/08/03 -History: -2015/08/03 ͳһ������ -*******************************************************************************/ - +/* + * Setup functions for the basic hardware present in the system + */ #ifndef __BIOS_H #define __BIOS_H #include "stm32f10x.h" -#include "S100V0_1.h" -extern volatile u32 gTime[]; - -#define USB_DN_OUT() GPIOA->CRH = (GPIOA->CRH & 0xFFFF3FFF) | 0x00003000 -#define USB_DP_OUT() GPIOA->CRH = (GPIOA->CRH & 0xFFF3FFFF) | 0x00030000 - -#define USB_DN_EN() GPIOA->CRH = (GPIOA->CRH & 0xFFFFBFFF) | 0x0000B000 -#define USB_DP_EN() GPIOA->CRH = (GPIOA->CRH & 0xFFFBFFFF) | 0x000B0000 - -#define USB_DP_PD() GPIOA->CRH = (GPIOA->CRH & 0xFFF3FFFF) | 0x00030000 - -#define USB_DN_HIGH() GPIOA->BSRR = GPIO_Pin_11 -#define USB_DP_HIGH() GPIOA->BSRR = GPIO_Pin_12 - -#define USB_DN_LOW() GPIOA->BRR = GPIO_Pin_11 -#define USB_DP_LOW() GPIOA->BRR = GPIO_Pin_12 - -#define LOW 0 -#define HIGH 1 - -#define BLINK 1 // Bit0 : 0/1 ��ʾ/��˸״̬��־ -#define WAIT_TIMES 100000 - - -#define SECTOR_SIZE 512 -#define SECTOR_CNT 4096 -#define HEAT_T 200 +#include "S100V0_1.h"/*For pin definitions*/ +#include "Analog.h"/*So that we can attach the DMA to the output array*/ +#include "stm32f10x_flash.h" +#include "stm32f10x_rcc.h" +#include "stm32f10x_dma.h" +#include "stm32f10x_adc.h" +#include "stm32f10x_tim.h" +#include "stm32f10x_exti.h" +#include "stm32f10x_iwdg.h" +#include "misc.h" +extern volatile uint32_t gHeat_cnt; +inline void setIronTimer(uint32_t time) { + gHeat_cnt = time; +} +inline uint32_t getIronTimer() { + return gHeat_cnt; +} +/*Get set the remaining toggles of the heater output*/ u32 Get_HeatingTime(void); void Set_HeatingTime(u32 heating_time); -u16 Get_AdcValue(u8 i); + void Init_Gtime(void); -void Delay_Ms(u32 ms); -void Delay_HalfMs(u32 ms); void USB_Port(u8 state); void NVIC_Config(u16 tab_offset); void RCC_Config(void); void GPIO_Config(void); void Adc_Init(void); -void Init_Timer2(void); void Init_Timer3(void); -void TIM2_ISR(void); +/*Interrupts*/ void TIM3_ISR(void); +void Init_EXTI(void); +/*Watchdog*/ +void Start_Watchdog(uint32_t ms); +void Clear_Watchdog(void); #endif -/********************************* END OF FILE ********************************/ + diff --git a/workspace/ts100/inc/CTRL.h b/workspace/ts100/inc/CTRL.h deleted file mode 100644 index 58745dfe..00000000 --- a/workspace/ts100/inc/CTRL.h +++ /dev/null @@ -1,70 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : CTRL.h - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2015/07/07 ͳһ������ - *******************************************************************************/ -#ifndef _CTRL_H -#define _CTRL_H - -#include "stm32f10x.h" -#include "Bios.h" - -#define TEMPSHOW_TIMER gTime[0]/*TEMPSHOW_TIMER*/ -#define HEATING_TIMER gTime[1]/*HEATING_TIMER*/ -#define ENTER_WAIT_TIMER gTime[2]/*ENTER_WAIT_TIMER*/ -#define EFFECTIVE_KEY_TIMER gTime[3]/*EFFECTIVE_KEY_TIMER*/ -#define LEAVE_WAIT_TIMER gTime[4]/*LEAVE_WAIT_TIMER*/ -#define G6_TIMER gTime[5]/*SWITCH_SHOW_TIMER*/ -#define UI_TIMER gTime[6]/*UI_TIMER ͼ���������ʱ�����*/ -#define KD_TIMER gTime[7]/*������ʱ*/ - -///^^-- All the times in gTime are decremented by 1 if >0 by timer2 tick -//------------------------------ ��������------------------------------------// -#define KEY_ST(KEY_PIN) GPIO_ReadInputDataBit(GPIOA, KEY_PIN) -#define NO_KEY 0x0 /*NO Keys pressed*/ -#define KEY_V1 0x0100/*V1 key pressed*/ -#define KEY_V2 0x0040/*V2 Key pressed*/ -#define KEY_CN 0X8000/*(Long key press i think)*/ -#define KEY_V3 (KEY_V1|KEY_V2)/*Both Keys pressed*/ - -typedef enum WORK_STATUS { - IDLE = 1, //System is idle - THERMOMETER, //Thermometer mode, basically reads sensor and shows temp - TEMP_CTR, //Soldering Mode (Temp Controlled) - WAIT, //System in wait state - TEMP_SET, //Setting the soldering temp - CONFIG, //system config mode - MODE_CNG, //DFU mode i think?? - ALARM, //An alarm has been fired -} WORK_STATUS; - -typedef enum WARNING_STATUS { - NORMAL_TEMP = 1, HIGH_TEMP, SEN_ERR, HIGH_VOLTAGE, LOW_VOLTAGE, -} WARNING_STATUS; - -typedef struct { - u8 ver[16]; - s16 t_standby; // 200��C=1800 2520,�����¶� - s16 t_work; // 350��C=3362, �����¶� - s16 t_step; //���� - u32 wait_time; //3*60*100 3 mintute - u32 idle_time; //6*60*100 6 minute -} DEVICE_INFO_SYS; - -extern DEVICE_INFO_SYS device_info; -void Set_PrevTemp(s16 Temp); -u8 Get_CtrlStatus(void); -void Set_CtrlStatus(u8 status); -s16 Get_TempVal(void); -u16 Get_HtFlag(void); -void System_Init(void); -void Pid_Init(void); -u16 Pid_Realize(s16 temp); -u32 Heating_Time(s16 temp, s16 wk_temp); -void Status_Tran(void); -#endif -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/Disk.h b/workspace/ts100/inc/Disk.h deleted file mode 100644 index 6bc1aacd..00000000 --- a/workspace/ts100/inc/Disk.h +++ /dev/null @@ -1,95 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : Disk.h - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/08/03 - History: - 2016/09/13 : Ben V. Brown - english comments - 2015/08/03 : - *******************************************************************************/ -#ifndef __DISK_H -#define __DISK_H - -#include "stm32f10x_flash.h" -#include "usb_scsi.h" -#include "usb_regs.h" -#include "usb_conf.h" -#include "usb_bot.h" -#include "usb_mem.h" -#include "usb_lib.h" -#include "usb_pwr.h" - -#define SECTOR_SIZE 512 -#define SECTOR_CNT 4096 - -#define FAT1_SECTOR &gDisk_buff[0x000] -#define FAT2_SECTOR &gDisk_buff[0x200] -#define ROOT_SECTOR &gDisk_buff[0x400] -#define VOLUME_BASE &gDisk_buff[0x416] -#define OTHER_FILES &gDisk_buff[0x420] -#define FILE_SECTOR &gDisk_buff[0x600] -#define Root (u8*)ROOT_SECTOR - -//#define APP_BASE 0x0800C000 - -#define HEX 0 -#define BIN 2 -#define SET 1 - -#define RDY 0 -#define NOT 2 -#define END 3 -#define ERR 4 - -#define DATA_SEG 0x00 -#define DATA_END 0x01 -#define EXT_ADDR 0x04 - -#define TXFR_IDLE 0 -#define TXFR_ONGOING 1 - -//#define FAT_DATA 0x00FFFFF8 -#define VOLUME 0x40DD8D18 //0x3E645C29 - -#define BUFF 0 // - -#define V32_BASE SECTOR_SIZE // V32 8*4=32 -#define W_ADDR 0 -#define ADDR 1 -#define H_ADDR 2 -#define OFFSET 3 -#define SEC_CNT 4 -#define COUNT 5 -#define RD_CNT 6 -#define WR_CNT 7 - -#define VAR_BASE V32_BASE + 32 // VAR 9+17=26 -#define USB_ST 0 -#define SEG_KIND 1 -#define SEG_LEN 2 -#define SEG_SUM 3 -#define SEG_TMP 4 -#define SEG_ST 5 -#define DATA_CNT 6 -#define F_TYPE 7 -#define F_FLAG 8 -#define SEG_DATA 9 //9~26 - -u8 Cal_Val(u8 str[], u8 k, u8 flag); -void Disk_BuffInit(void); -u8 ReWrite_All(void); -u8 Config_Analysis(void); -void Disk_BuffInit(void); -void Disk_SecWrite(u8* pbuffer, u32 disk_addr); -void Close_File(void); -void Write_Memory(u32 w_offset, u32 w_length); -void Read_Memory(u32 r_offset, u32 r_length); -void Set_Ver(u8 str[], u8 i); -void Erase(void); -char * Get_Line(char *dst, char *src, int n, int m); -void Upper(u8* str, u16 len); -u8* SearchFile(u8* pfilename, u16* pfilelen, u16* root_addr); -u8 ReWriteFlsash(void); -#endif -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/inc/Ext_Flash.h b/workspace/ts100/inc/Ext_Flash.h deleted file mode 100644 index 4e61a773..00000000 --- a/workspace/ts100/inc/Ext_Flash.h +++ /dev/null @@ -1,53 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** -File Name : EXT_Flash.h -Version : S100 APP Ver 2.11 -Description: -Author : bure -Data: -History: -*******************************************************************************/ - -#ifndef __EXT_FLASH_H -#define __EXT_FLASH_H -//#include "stm32f10x_lib.h" -#include "stm32f10x.h" - -extern u8 flash_mode; -#define FLASH_2M 1 -#define FLASH_8M 2 -//#define W25Q64BV - -#define WREN 0x06 // Write enable instruction -#define READ 0x03 // Read from Memory instruction -#define RDSR 0x05 // Read Status Register instruction -#define PP 0x02 // Write to Memory instruction -#define PE 0xDB // Page Erase instruction -#define PW 0x0A // Page write instruction -#define DP 0xB9 // Deep power-down instruction -#define RDP 0xAB // Release from deep power-down instruction -//----W25Q64BV----------------------------------------------------------------// -#define CHIPE 0xC7 // Chip All Erase instruction -#define BE64 0xD8 // Block 32k Erase instruction -#define BE32 0x52 // Block 64k Erase instruction -#define SE 0x20 // Sector 4K Erase instruction -#define Dummy_Byte 0xA5 -#define EXT_FLASH_PageSize 256 - -//----------------------------------------------------------------------------// -#define WIP_Flag 0x01 // Write In Progress (WIP) flag - - -#define ExtFlash_CS_LOW() GPIO_ResetBits(GPIOB, GPIO_Pin_7) -#define ExtFlash_CS_HIGH() GPIO_SetBits(GPIOB, GPIO_Pin_7) - -void ExtFlash_PageWR(u8* pBuffer, u32 WriteAddr); -void ExtFlash_PageRD(u8* pBuffer, u32 ReadAddr, u16 Lenght); -void MAL_GetStatus (void); -u8 ExtFlash_ReadByte(void); -u8 ExtFlash_SendByte(u8 byte); -void ExtFlash_WriteEnable(void); -void ExtFlash_WaitForWriteEnd(void); -void ExtFlash_PageProg(u8* pBuffer, u32 WriteAddr,u8 CMD); -#endif - -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/inc/FAT12.h b/workspace/ts100/inc/FAT12.h deleted file mode 100644 index 85c64951..00000000 --- a/workspace/ts100/inc/FAT12.h +++ /dev/null @@ -1,29 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** -File Name : FAT12.h -Version : S100 APP Ver 2.11 -Description: -Author : bure -Data: -History: -*******************************************************************************/ -#ifndef __FAT12_H -#define __FAT12_H - -#include "stm32f10x.h" - - -u8 ReadFileSec(u8* Buffer, u16* Cluster); -u8 ReadDiskData(u8* pBuffer, u32 ReadAddr, u16 Lenght); -u8 NextCluster(u16* Cluster); -u8 ProgFileSec(u8* Buffer, u16* Cluster); -u8 ProgDiskPage(u8* Buffer, u32 ProgAddr); -u8 SeekBlank(u8* Buffer, u16* Cluster); -u8 SetCluster(u8* Buffer, u16* Cluster); -u8 OpenFileRd(u8* Buffer, u8* FileName, u16* Cluster, u32* pDirAddr); -u8 OpenFileWr(u8* Buffer, u8* FileName, u16* Cluster, u32* pDirAddr); -u8 CloseFile(u8* Buffer, u32 Lenght, u16* Cluster, u32* pDirAddr); -u8 FAT_SearchFile(u8* pBuffer, u8* pFileName, u16* pCluster, u32* pDirAddr,u32* flag); -void ExtFlash_PageWrite(u8* pBuffer, u32 WriteAddr, u8 Mode); - -#endif -/********************************* END OF FILE ********************************/ diff --git a/workspace/ts100/inc/Flash.h b/workspace/ts100/inc/Flash.h deleted file mode 100644 index fc5a9271..00000000 --- a/workspace/ts100/inc/Flash.h +++ /dev/null @@ -1,29 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** - File Name : Flash.h - Version : Author : bure -*******************************************************************************/ -#ifndef __EXT_FLASH_H -#define __EXT_FLASH_H -#include "stm32f10x.h" -#define PAGESIZE 256 - -#define WREN 0x06 // Write enable instruction -#define READ 0x03 // Read from Memory instruction -#define RDSR 0x05 // Read Status Register instruction -#define PP 0x02 // Write to Memory instruction -#define PW 0x0A // Page write instruction - -#define OK 0 // -#define SEC_ERR 1 // -#define TMAX 100000 // - -#define WIP_Flag 0x01 // Write In Progress (WIP) flag -#define Dummy_Byte 0xA5 - -u8 FLASH_Prog(u32 Address, u16 Data); -void FLASH_Erase(u32 Address); -void ExtFlashPageWR(u8* pBuffer, u32 WriteAddr); -void ExtFlashDataRD(u8* pBuffer, u32 ReadAddr, u16 Lenght); -#endif - -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/inc/Font.h b/workspace/ts100/inc/Font.h new file mode 100644 index 00000000..791feca4 --- /dev/null +++ b/workspace/ts100/inc/Font.h @@ -0,0 +1,95 @@ +/* + * Font.h + * + * Created on: 17 Sep 2016 + * Author: Ralim + * + * ... This file contains the font... + */ + +#ifndef FONT_H_ +#define FONT_H_ + +const u8 FONT[]={ + 0x00,0xF0,0xFC,0x0E,0x82,0xC2,0x62,0x1E,0xFC,0xF0,0x00,0x00,0x00,0x00, + 0x00,0x03,0x0F,0x1F,0x11,0x10,0x10,0x1C,0x0F,0x03,0x00,0x00,0x00,0x00,/*0*/ + 0x00,0x08,0x04,0x02,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x10,0x10,0x10,0x1F,0x1F,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*1*/ + 0x00,0x04,0x02,0x02,0x02,0xC6,0xFC,0x78,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x18,0x1C,0x16,0x13,0x11,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*2*/ + 0x00,0x02,0x02,0x42,0x42,0x66,0xFE,0x9C,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x10,0x10,0x10,0x10,0x10,0x08,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*3*/ + 0x00,0x00,0x80,0xE0,0x30,0x1C,0x06,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, + 0x00,0x03,0x03,0x02,0x02,0x02,0x02,0x1F,0x1F,0x02,0x02,0x00,0x00,0x00,/*4*/ + 0x00,0x7E,0x7E,0x42,0x42,0x42,0xC2,0x82,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x10,0x10,0x10,0x10,0x10,0x08,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*5*/ + 0x00,0xE0,0xF8,0x8C,0x44,0x42,0x42,0xC2,0x82,0x80,0x00,0x00,0x00,0x00, + 0x00,0x07,0x0F,0x18,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,/*6*/ + 0x00,0x02,0x02,0x02,0x02,0xC2,0xF2,0x1E,0x06,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x10,0x1C,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*7*/ + 0x00,0x38,0x7C,0x66,0xC2,0x82,0xC2,0x66,0x7C,0x3C,0x00,0x00,0x00,0x00, + 0x00,0x0E,0x0F,0x19,0x10,0x10,0x10,0x19,0x0F,0x0E,0x00,0x00,0x00,0x00,/*8*/ + 0x00,0x78,0x7C,0xC6,0x82,0x82,0x82,0x46,0xFC,0xF8,0x00,0x00,0x00,0x00, + 0x00,0x00,0x10,0x10,0x10,0x10,0x08,0x0C,0x07,0x03,0x00,0x00,0x00,0x00,/*9*/ + 0x00,0x00,0x80,0xF0,0x1E,0x02,0x1E,0xF0,0x80,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1C,0x0F,0x03,0x02,0x02,0x02,0x03,0x0F,0x1C,0x00,0x00,0x00,0x00,/*A*/ + 0x00,0xFE,0xFE,0x42,0x42,0x42,0xE6,0xBE,0x9C,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*B*/ + 0x00,0xF0,0xF8,0x0C,0x06,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00, + 0x00,0x03,0x0F,0x0C,0x18,0x10,0x10,0x10,0x08,0x00,0x00,0x00,0x00,0x00,/*C*/ + 0x00,0xFE,0xFE,0x02,0x02,0x02,0x06,0x0C,0xFC,0xF0,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x10,0x10,0x10,0x18,0x0C,0x07,0x03,0x00,0x00,0x00,0x00,/*D*/ + 0x00,0xFE,0xFE,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*E*/ + 0x00,0xFE,0xFE,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*F*/ + 0x00,0xF0,0xF8,0x0C,0x06,0x02,0x82,0x82,0x82,0x84,0x00,0x00,0x00,0x00, + 0x00,0x03,0x0F,0x0C,0x18,0x10,0x10,0x10,0x1F,0x1F,0x00,0x00,0x00,0x00,/*G*/ + 0x00,0xFE,0xFE,0x40,0x40,0x40,0x40,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,/*H*/ + 0x00,0x02,0x02,0x02,0xFE,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x10,0x10,0x10,0x1F,0x1F,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*I*/ + 0x00,0x02,0x02,0x02,0x02,0x02,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x08,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,/*J*/ + 0x00,0xFE,0xFE,0xC0,0xE0,0x30,0x18,0x0C,0x06,0x02,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x00,0x01,0x03,0x06,0x0C,0x18,0x10,0x00,0x00,0x00,0x00,/*K*/ + 0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*L*/ + 0x00,0x00,0xFE,0x06,0x3C,0xC0,0xC0,0x3C,0x06,0xFE,0x00,0x00,0x00,0x00, + 0x00,0x10,0x1F,0x00,0x00,0x01,0x01,0x00,0x00,0x1F,0x18,0x00,0x00,0x00,/*M*/ + 0x00,0xFE,0xFE,0x1E,0x70,0x80,0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x00,0x00,0x03,0x1C,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,/*N*/ + 0x00,0xF0,0xFC,0x0C,0x02,0x02,0x02,0x0E,0xFC,0xF0,0x00,0x00,0x00,0x00, + 0x00,0x03,0x0F,0x1C,0x10,0x10,0x10,0x0C,0x0F,0x03,0x00,0x00,0x00,0x00,/*O*/ + 0x00,0xFE,0xFE,0x02,0x02,0x02,0x86,0xFC,0x78,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*P*/ + 0x00,0xF0,0xF8,0x0C,0x02,0x02,0x02,0x02,0x0C,0xFC,0xF0,0x00,0x00,0x00, + 0x00,0x03,0x0F,0x1C,0x10,0x30,0x70,0xD8,0x8C,0x8F,0x83,0x40,0x00,0x00,/*Q*/ + 0x00,0xFE,0xFE,0x42,0x42,0xC2,0xE6,0x3C,0x1C,0x00,0x00,0x00,0x00,0x00, + 0x00,0x1F,0x1F,0x00,0x00,0x00,0x01,0x0F,0x1C,0x10,0x00,0x00,0x00,0x00,/*R*/ + 0x00,0x38,0x7C,0x66,0xC2,0xC2,0x82,0x84,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x08,0x10,0x10,0x10,0x10,0x19,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*S*/ + 0x00,0x02,0x02,0x02,0x02,0xFE,0xFE,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*T*/ + 0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x00,0x00,0x00,0x00, + 0x00,0x07,0x0F,0x18,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,/*U*/ + 0x00,0x0E,0x7E,0xE0,0x00,0x00,0x00,0xE0,0x7C,0x0E,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x03,0x1F,0x18,0x1F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,/*V*/ + 0x00,0x7E,0xFE,0x00,0x00,0xE0,0xE0,0x00,0x00,0xFE,0x7E,0x00,0x00,0x00, + 0x00,0x00,0x1F,0x18,0x0F,0x01,0x01,0x0F,0x18,0x1F,0x00,0x00,0x00,0x00,/*W*/ + 0x00,0x02,0x06,0x1C,0x38,0xE0,0xE0,0x38,0x1C,0x06,0x02,0x00,0x00,0x00, + 0x00,0x10,0x18,0x0E,0x07,0x01,0x01,0x07,0x0E,0x18,0x10,0x00,0x00,0x00,/*X*/ + 0x00,0x02,0x0E,0x3C,0xF0,0xC0,0xC0,0xF0,0x3C,0x0E,0x02,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*Y*/ + 0x00,0x02,0x02,0x02,0xC2,0xE2,0x3A,0x0E,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x10,0x1C,0x17,0x11,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*Z*/ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/* */ + + 0x00,0x60,0xF0,0x98,0x0C,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x01,0x03,0x06,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*<*/ + 0x00,0x02,0x06,0x0C,0x98,0xF0,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x04,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*>*/ +}; + +#endif /* FONT_H_ */ diff --git a/workspace/ts100/inc/Hardware.h b/workspace/ts100/inc/Hardware.h deleted file mode 100644 index 62ae094b..00000000 --- a/workspace/ts100/inc/Hardware.h +++ /dev/null @@ -1,49 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** -File Name : CTRL.h -Version : S100 APP Ver 2.11 -Description: -Author : Celery -Data: 2015/07/07 -History: -2015/07/07 ͳһ������ -*******************************************************************************/ -#ifndef _HARDWARE_H -#define _HARDWARE_H - -#include "stm32f10x.h" - -#define SI_COE 8//56 -#define SI_THRESHOLD 60 - -typedef enum VOL_CLASS { - H_ALARM = 0, - VOL_24, - VOL_19, - VOL_12, - VOL_5, - L_ALARM, -} VOL_CLASS; - -extern s32 gZerop_ad; -extern u8 gCalib_flag; -extern u32 gTurn_offv; - -u32 Get_gKey(void); -void Set_gKey(u32 key); -void Set_LongKeyFlag(u32 flag); -void Zero_Calibration(void); -int Read_Vb(u8 flag); -void Scan_Key(void); -u32 Get_SlAvg(u32 avg_data); -int Get_TempSlAvg(int avg_data); -u32 Get_AvgAd(void); -int Get_SensorTmp(void); -u16 Get_ThermometerTemp(void); -s16 Get_Temp(s16 wk_temp); -void Clear_Watchdog(void); -u32 Start_Watchdog(u32 ms); -u8 Get_AlarmType(void); -void Set_AlarmType(u8 type); -u32 Get_CalFlag(void); -#endif -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/I2C.h b/workspace/ts100/inc/I2C.h index 3a29b595..b20378b2 100644 --- a/workspace/ts100/inc/I2C.h +++ b/workspace/ts100/inc/I2C.h @@ -1,21 +1,16 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** -File Name : I2C.h -Version : S100 APP Ver 2.11 -Description: -Author : Celery -Data: 2015/08/03 -History: -2015/08/03 : -*******************************************************************************/ +/* + * I2C.h + * I2C wrapper for the stm32 hardware I2C port + */ #ifndef __I2C_H #define __I2C_H -#define I2C_TX 1 -#define I2C_RX 2 +#include "stm32f10x_i2c.h" +#include "stm32f10x.h" +#include "stm32f10x_gpio.h" void I2C_Configuration(void); -void Delay_uS(u32 us); -void I2C_PageWrite(u8* pbuf, u8 numbyte,u8 deviceaddr ); -void I2C_PageRead(u8* pbuf, u8 numbyte,u8 deviceaddr, u8 readaddr); +void I2C_PageWrite(u8* pbuf, u8 numbyte, u8 deviceaddr); +void I2C_PageRead(u8* pbuf, u8 numbyte, u8 deviceaddr, u8 readaddr); #endif /******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/Interrupt.h b/workspace/ts100/inc/Interrupt.h index 43badb3b..90551684 100644 --- a/workspace/ts100/inc/Interrupt.h +++ b/workspace/ts100/inc/Interrupt.h @@ -1,70 +1,41 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. *******************/ -/* Brief : Interrupt Service Routines Author : bure */ -/******************************************************************************/ +/* + * Interrupt Service Routines + * This file manages all the IRQ events that can be generated + */ #ifndef __INTERRUPT_H #define __INTERRUPT_H -//See here for refernce to this block http://embedded.kleier.selfhost.me/vector.php -static void forever (void); -void __attribute__ ((weak, alias ("forever"))) WWDG_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) PVD_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TAMPER_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) RTC_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) FLASH_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) RCC_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI0_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI1_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI2_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI3_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI4_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel1_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel2_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel3_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel4_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel5_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel6_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA1_Channel7_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) ADC1_2_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) USB_HP_CAN1_TX_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) CAN1_RX1_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) CAN1_SCE_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI9_5_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM1_BRK_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM1_UP_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM1_TRG_COM_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM1_CC_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM4_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) I2C1_EV_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) I2C1_ER_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) I2C2_EV_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) I2C2_ER_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) SPI1_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) SPI2_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) USART1_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) USART2_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) USART3_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) EXTI15_10_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) RTCAlarm_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) USBWakeUp_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM8_BRK_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM8_UP_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM8_TRG_COM_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM8_CC_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) ADC3_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) FSMC_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) SDIO_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM5_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) SPI3_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) UART4_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) UART5_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM6_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) TIM7_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA2_Channel1_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA2_Channel2_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA2_Channel3_IRQHandler (void); -void __attribute__ ((weak, alias ("forever"))) DMA2_Channel4_5_IRQHandler (void); +#include +/* Functions for access to data */ +extern volatile uint32_t system_Ticks; +void delayMs(uint32_t ticks); +volatile extern uint32_t lastKeyPress; +volatile extern uint32_t lastMovement; +volatile extern uint16_t keyState; +inline uint32_t millis() { + return system_Ticks; +} +inline uint32_t getLastButtonPress() { + return lastKeyPress; +} +inline void resetLastButtonPress() { + lastKeyPress = millis(); +} +inline void resetButtons() { + lastKeyPress = millis(); + keyState = 0; +} +inline uint32_t getLastMovement() { + return lastMovement; +} + +inline uint16_t getButtons() { + return keyState; +} + +/*IRQ prototypes*/ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); @@ -87,7 +58,64 @@ void I2C1_ER_IRQHandler(void); void TIM2_IRQHandler(void); void TIM3_IRQHandler(void); +void WWDG_IRQHandler(void); +void PVD_IRQHandler(void); +void TAMPER_IRQHandler(void); +void RTC_IRQHandler(void); +void FLASH_IRQHandler(void); +void RCC_IRQHandler(void); +void EXTI0_IRQHandler(void); +void EXTI1_IRQHandler(void); +void EXTI2_IRQHandler(void); +void EXTI3_IRQHandler(void); +void EXTI4_IRQHandler(void); +void DMA1_Channel1_IRQHandler(void); +void DMA1_Channel2_IRQHandler(void); +void DMA1_Channel3_IRQHandler(void); +void DMA1_Channel4_IRQHandler(void); +void DMA1_Channel5_IRQHandler(void); +void DMA1_Channel6_IRQHandler(void); +void DMA1_Channel7_IRQHandler(void); +void ADC1_2_IRQHandler(void); +void USB_HP_CAN1_TX_IRQHandler(void); +void CAN1_RX1_IRQHandler(void); +void CAN1_SCE_IRQHandler(void); +void EXTI9_5_IRQHandler(void); +void TIM1_BRK_IRQHandler(void); +void TIM1_UP_IRQHandler(void); +void TIM1_TRG_COM_IRQHandler(void); +void TIM1_CC_IRQHandler(void); +void TIM4_IRQHandler(void); +void I2C1_EV_IRQHandler(void); +void I2C1_ER_IRQHandler(void); +void I2C2_EV_IRQHandler(void); +void I2C2_ER_IRQHandler(void); +void SPI1_IRQHandler(void); +void SPI2_IRQHandler(void); +void USART1_IRQHandler(void); +void USART2_IRQHandler(void); +void USART3_IRQHandler(void); +void EXTI15_10_IRQHandler(void); +void RTCAlarm_IRQHandler(void); +void USBWakeUp_IRQHandler(void); +void TIM8_BRK_IRQHandler(void); +void TIM8_UP_IRQHandler(void); +void TIM8_TRG_COM_IRQHandler(void); +void TIM8_CC_IRQHandler(void); +void ADC3_IRQHandler(void); +void FSMC_IRQHandler(void); +void SDIO_IRQHandler(void); +void TIM5_IRQHandler(void); +void SPI3_IRQHandler(void); +void UART4_IRQHandler(void); +void UART5_IRQHandler(void); +void TIM6_IRQHandler(void); +void TIM7_IRQHandler(void); +void DMA2_Channel1_IRQHandler(void); +void DMA2_Channel2_IRQHandler(void); +void DMA2_Channel3_IRQHandler(void); +void DMA2_Channel4_5_IRQHandler(void); #endif /* __INTERRUPT_H */ diff --git a/workspace/ts100/inc/MMA8652FC.h b/workspace/ts100/inc/MMA8652FC.h index dddb6bdc..d5113287 100644 --- a/workspace/ts100/inc/MMA8652FC.h +++ b/workspace/ts100/inc/MMA8652FC.h @@ -1,19 +1,91 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** -File Name : MMA8652FC.h -Version : S100 APP Ver 2.11 -Description: -Author : Celery -Data: 2015/07/07 -History: -2015/07/07 ͳһ������ -*******************************************************************************/ +/* + * MMA8652FC.* + * Files for the built in accelerometer from NXP. + * This sets the unit up in motion detection mode with an interrupt on movement + * This interrupt is fed to PB5 which catches it via EXTI5 + * + * http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8652FC.pdf + * + * EXTI Motion config setup values lifted from AN4070 from NXP + * #defines also taken from ^ + * + * Ben V. Brown - + */ #ifndef __MMA8652FC__H #define __MMA8652FC__H + +void StartUp_Accelerometer(void);//This is the only function we expose + //--------------MMA8652 Device ID----------------------------------------------// #define DEVICE_ADDR 0X1D //--------------MMA8652 Registers-------------------------------------------// + +#define STATUS_REG 0x00 // STATUS Register + +#define OUT_X_MSB_REG 0x01 // [7:0] are 8 MSBs of the 14-bit X-axis sample +#define OUT_X_LSB_REG 0x02 // [7:2] are the 6 LSB of 14-bit X-axis sample +#define OUT_Y_MSB_REG 0x03 // [7:0] are 8 MSBs of the 14-bit Y-axis sample +#define OUT_Y_LSB_REG 0x04 // [7:2] are the 6 LSB of 14-bit Y-axis sample +#define OUT_Z_MSB_REG 0x05 // [7:0] are 8 MSBs of the 14-bit Z-axis sample +#define OUT_Z_LSB_REG 0x06 // [7:2] are the 6 LSB of 14-bit Z-axis sample + +#define F_SETUP_REG 0x09 // F_SETUP FIFO Setup Register +#define TRIG_CFG_REG 0x0A // TRIG_CFG Map of FIFO data capture events +#define SYSMOD_REG 0x0B // SYSMOD System Mode Register +#define INT_SOURCE_REG 0x0C // INT_SOURCE System Interrupt Status Register +#define WHO_AM_I_REG 0x0D // WHO_AM_I Device ID Register +#define XYZ_DATA_CFG_REG 0x0E // XYZ_DATA_CFG Sensor Data Configuration Register +#define HP_FILTER_CUTOFF_REG 0x0F // HP_FILTER_CUTOFF High Pass Filter Register + +#define PL_STATUS_REG 0x10 // PL_STATUS Portrait/Landscape Status Register +#define PL_CFG_REG 0x11 // PL_CFG Portrait/Landscape Configuration Register +#define PL_COUNT_REG 0x12 // PL_COUNT Portrait/Landscape Debounce Register +#define PL_BF_ZCOMP_REG 0x13 // PL_BF_ZCOMP Back/Front and Z Compensation Register +#define P_L_THS_REG 0x14 // P_L_THS Portrait to Landscape Threshold Register + +#define FF_MT_CFG_REG 0x15 // FF_MT_CFG Freefall and Motion Configuration Register +#define FF_MT_SRC_REG 0x16 // FF_MT_SRC Freefall and Motion Source Register +#define FF_MT_THS_REG 0x17 // FF_MT_THS Freefall and Motion Threshold Register +#define FF_MT_COUNT_REG 0x18 // FF_MT_COUNT Freefall Motion Count Register + +#define TRANSIENT_CFG_REG 0x1D // TRANSIENT_CFG Transient Configuration Register +#define TRANSIENT_SRC_REG 0x1E // TRANSIENT_SRC Transient Source Register +#define TRANSIENT_THS_REG 0x1F // TRANSIENT_THS Transient Threshold Register +#define TRANSIENT_COUNT_REG 0x20 // TRANSIENT_COUNT Transient Debounce Counter Register + +#define PULSE_CFG_REG 0x21 // PULSE_CFG Pulse Configuration Register +#define PULSE_SRC_REG 0x22 // PULSE_SRC Pulse Source Register +#define PULSE_THSX_REG 0x23 // PULSE_THS XYZ Pulse Threshold Registers +#define PULSE_THSY_REG 0x24 +#define PULSE_THSZ_REG 0x25 +#define PULSE_TMLT_REG 0x26 // PULSE_TMLT Pulse Time Window Register +#define PULSE_LTCY_REG 0x27 // PULSE_LTCY Pulse Latency Timer Register +#define PULSE_WIND_REG 0x28 // PULSE_WIND Second Pulse Time Window Register + +#define ASLP_COUNT_REG 0x29 // ASLP_COUNT Auto Sleep Inactivity Timer Register + +#define CTRL_REG1 0x2A // CTRL_REG1 System Control 1 Register +#define CTRL_REG2 0x2B // CTRL_REG2 System Control 2 Register +#define CTRL_REG3 0x2C // CTRL_REG3 Interrupt Control Register +#define CTRL_REG4 0x2D // CTRL_REG4 Interrupt Enable Register +#define CTRL_REG5 0x2E // CTRL_REG5 Interrupt Configuration Register + +#define OFF_X_REG 0x2F // XYZ Offset Correction Registers +#define OFF_Y_REG 0x30 +#define OFF_Z_REG 0x31 + +//MMA8652FC 7-bit I2C address + +#define MMA8652FC_I2C_ADDRESS 0x1D // MMA865xFC 7-bit I2C address is fixed + +//MMA8652FC Sensitivity + +#define SENSITIVITY_2G 1024 +#define SENSITIVITY_4G 512 +#define SENSITIVITY_8G 256 + #define STATUS_REG 0x00 #define X_MSB_REG 0X01 #define X_LSB_REG 0X02 @@ -27,15 +99,8 @@ History: #define INT_SOURCE 0X0C #define DEVICE_ID 0X0D -#define XYZ_DATA_CFG_REG 0X0E -#define CTRL_REG1 0X2A // -#define CTRL_REG2 0X2B //System Control 2 register -#define CTRL_REG3 0X2C // -#define CTRL_REG4 0X2D //Interrupt Enable register -#define CTRL_REG5 0X2E // - //-----STATUS_REG(0X00)-----Bit Define----------------------------------------// #define ZYXDR_BIT 0X08 //----XYZ_DATA_CFG_REG(0xE)-Bit Define----------------------------------------// @@ -54,7 +119,7 @@ History: #define FHZ2 0x5 //12.5hz #define FHZ1 0x6 //6.25hz #define FHZ0 0x7 //1.563hz -#define DataRateValue FHZ100 + //---------CTRL_REG2(0X2B)Bit Define------------------------------------------// #define MODS_MASK 0x03 //Oversampling Mode 4 #define Normal_Mode 0x0 //Normal=0,Low Noise Low Power MODS=1, @@ -70,16 +135,5 @@ History: #define INT_EN_FF_MT 1<<2 //Freefall/Motion Interrupt Enable #define INT_EN_DRDY 1<<0 //Data Ready Interrupt Enable -u16 Get_MmaShift(void); -void Set_MmaShift(u16 shift); -u16 Get_MmaActive(void); -void MMA865x_Standby(void); -void MMA865x_Active(void); -u16 Cheak_XYData(u16 x0,u16 y0,u16 x1,u16 y1); -u16 Update_X(void); -u16 Update_Y(void); -u16 Update_Z(void); -void Check_Accelerated(void); -void StartUp_Accelerated(void); #endif /******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/Modes.h b/workspace/ts100/inc/Modes.h new file mode 100644 index 00000000..aa00fca8 --- /dev/null +++ b/workspace/ts100/inc/Modes.h @@ -0,0 +1,36 @@ +/* + * Modes.h + * + * Created on: 17 Sep 2016 + * Author: Ralim + * + * Modes.h -> Main function for driving the application + * This processes the buttons then does the gui + */ + +#ifndef MODES_H_ +#define MODES_H_ +#include "Interrupt.h" +#include "S100V0_1.h" +#include "Oled.h" +#include "PID.h" +#include "Settings.h" +#include "Analog.h" +enum { + STARTUP, //we are sitting on the prompt to push a button + SOLDERING, + TEMP_ADJ, + SETTINGS, + SLEEP, + COOLING, + UVLOWARN, +} operatingMode; + +enum { + UVLO = 0, SLEEP_TEMP, SLEEP_TIME,MOTIONDETECT, + +} settingsPage; + +void ProcessUI(); +void DrawUI(); +#endif /* MODES_H_ */ diff --git a/workspace/ts100/inc/Oled.h b/workspace/ts100/inc/Oled.h index 4ceff112..303fa320 100644 --- a/workspace/ts100/inc/Oled.h +++ b/workspace/ts100/inc/Oled.h @@ -1,33 +1,31 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** -File Name : Oled.h -Version : S100 APP Ver 2.11 -Description: -Author : Celery -Data: 2015/07/07 -History: -2015/07/07 ͳһ������ -*******************************************************************************/ +/* + * Oled.h + * Functions for writing to the OLED screen + * Basically wraps drawing text and numbers to the OLED + * Uses font.h -> 14 pixel wide fixed width + */ #ifndef _OLED_SSD1306_H #define _OLED_SSD1306_H #define DEVICEADDR_OLED 0x3c #include "stm32f10x.h" -void Sc_Pt(u8 Co); +#include "Interrupt.h" + void Oled_DisplayOn(void); void Oled_DisplayOff(void); -u8* Oled_DrawArea(u8 x0,u8 y0,u8 wide, u8 high,u8* ptr); -void Set_ShowPos(u8 x,u8 y); -u8* Show_posi(u8 posi,u8* ptr,u8 word_width); -void Clean_Char(int k,u8 wide); -void Write_Command(u8 Data); -void Write_Data(u8 Data); +u8* Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 high, u8* ptr); +void Set_ShowPos(u8 x, u8 y); + void GPIO_Init_OLED(void); void Init_Oled(void); -u8* Data_Command(u8 len,u8* ptr); -void Reg_Command(u8 posi,u8 flag); -void Clear_Screen(void); -void Write_InitCommand_data(u32 Com_len,u8* data); -void Display_BG(void); +u8* Data_Command(u8 len, u8* ptr); +void Clear_Screen(void);//Clear the screen +/*Functions for writing to the screen*/ +void OLED_DrawString(char* string, uint8_t length); +void OLED_DrawChar(char c, uint8_t x); +void OLED_DrawTwoNumber(uint8_t in, uint8_t x); +void OLED_DrawThreeNumber(uint16_t in, uint8_t x); + #endif /******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/PID.h b/workspace/ts100/inc/PID.h new file mode 100644 index 00000000..3527c6d8 --- /dev/null +++ b/workspace/ts100/inc/PID.h @@ -0,0 +1,21 @@ +/* + * PID.h + * + * Created on: 20 Sep 2016 + * Author: ralim + * + * Functions for computing the PID for the iron temp + */ + +#ifndef PID_H_ +#define PID_H_ +#include "Analog.h" +#include "Interrupt.h" + +struct { + uint32_t kp, ki, kd; //PID values +} pidSettings; + +int32_t computePID(uint16_t setpoint); +void setupPID(void); +#endif /* PID_H_ */ diff --git a/workspace/ts100/inc/S100V0_1.h b/workspace/ts100/inc/S100V0_1.h index 38f49a3d..8a6374d8 100644 --- a/workspace/ts100/inc/S100V0_1.h +++ b/workspace/ts100/inc/S100V0_1.h @@ -1,68 +1,37 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** - Brief : �ײ�Ӳ������ Author : bure - Modified by Ben V. Brown into English - *******************************************************************************/ +/* + * Defines for the device + * These houses the settings for the device hardware + */ #include "stm32f10x.h" - -#define PRODUCT_INFO "TS100" -#define MCU_TYPE "STM32F103T8" -#define ADC_TYPE "MCU's ADC" -#define FPGA_TYPE "None" -#define SCH_VER "2.46" -// #define SSD1316 1 -// #define MFTSEEED "Manufacturer" -// #define MFTMINI "Manufacturer" - -#define SPIx SPI1 -#define FLASH_PAGE 0x0400 +#include "stm32f10x_gpio.h" //--------------------------- key Definitions ------------------------------// #define KEY1_PIN GPIO_Pin_9 //PA8 #define KEY2_PIN GPIO_Pin_6 //PA6 -#define KEY_1 !(GPIOA->IDR & KEY1_PIN) -#define KEY_2 !(GPIOA->IDR & KEY2_PIN) -#define KEY_DFU KEY_1 -#define KEY_ON 0 -#define I2C1_DMA_CHANNEL_TX DMA1_Channel6 -#define I2C1_DMA_CHANNEL_RX DMA1_Channel7 +#define KEY_A KEY1_PIN +#define KEY_B KEY2_PIN +#define BUT_A 0x01 +#define BUT_B 0x02 -#define I2C2_DMA_CHANNEL_TX DMA1_Channel4 -#define I2C2_DMA_CHANNEL_RX DMA1_Channel5 -#define I2C1_DR_Address 0x40005410 -#define I2C2_DR_Address 0x40005810 - -#define SERIAL_NO1 (*(u32*)0x1FFFF7E8) -#define SERIAL_NO2 (*(u32*)0x1FFFF7EC) -#define SERIAL_NO3 (*(u32*)0x1FFFF7F0) - -//--------------------------- OLED ��ؿ����ź� ------------------------------// +//--------------------------- OLED ------------------------------// #define OLED_RST_PIN GPIO_Pin_8 //PA9 #define OLED_RST() GPIO_ResetBits(GPIOA, OLED_RST_PIN) #define OLED_ACT() GPIO_SetBits (GPIOA, OLED_RST_PIN) -//------------------------------ ���ȿ����ź� --------------------------------// -#define HEAT_PIN GPIO_Pin_4 //PA15(JTDI) +//------------------------------ Iron Heater --------------------------------// +#define HEAT_PIN GPIO_Pin_4 +#define HEAT_OFF() GPIOB->BRR = HEAT_PIN +#define HEAT_ON() GPIOB->BSRR = HEAT_PIN -#define HEAT_OFF() GPIOB->BRR = HEAT_PIN//GPIO_ResetBits(GPIOB, HEAT_PIN) -#define HEAT_ON() GPIOB->BSRR = HEAT_PIN//GPIO_SetBits (GPIOB, HEAT_PIN) - -//---------------------�����ѹ���--VB---------------------------------------// +//-----------------------Battery voltage measurement---------------------------------------// #define VB_PIN GPIO_Pin_1 //PB1(Ai9) -//----------------------------ADX345 INT1,INT2--------------------------------// + +//----------------------------Accelerometer INT1,INT2--------------------------------// #define INT1_PIN GPIO_Pin_5 //PB5 #define INT2_PIN GPIO_Pin_3 //PB3 -//------------------------------ GPIO �˿����� -------------------------------// -#define GPIOA_OUTPUT() GPIOA->ODR = 0xFFFF; -#define GPIOA_L_DEF() GPIOA->CRL = 0x08888888; /* Ai7 K2 xxx xxx xxx xxx xxx xxx */ -#define GPIOA_H_DEF() GPIOA->CRH = 0x8BBBB883; /* xxx SWC SWD D+ D- xxx K1 nCR */ - -#define GPIOB_OUTPUT() GPIOB->ODR = 0xFFFF; -#define GPIOB_L_DEF() GPIOB->CRL = 0x44838800; /* SDA SCL It1 Po It2 xxx Ai9 Ai8 */ -#define GPIOB_H_DEF() GPIOB->CRH = 0x88888888; /* xxx xxx xxx xxx xxx xxx xxx xxx */ - -//--------------------------------- RCC ���� ---------------------------------// +//--------------------------------- RCC Clock Config ---------------------------------// #define RCC_PLL_EN() RCC->CR |= 0x01000000;// PLL En @@ -77,4 +46,3 @@ ||+-------Bit22 = 1 USB prescaler is PLL clock ++--------Bits31~27 Reserved*/ -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/Settings.h b/workspace/ts100/inc/Settings.h new file mode 100644 index 00000000..a1ed28f7 --- /dev/null +++ b/workspace/ts100/inc/Settings.h @@ -0,0 +1,28 @@ +/* + * Settings.h + * + * Created on: 29 Sep 2016 + * Author: Ralim + * + * Houses the system settings and allows saving / restoring from flash + */ + +#ifndef SETTINGS_H_ +#define SETTINGS_H_ +#include +#include "stm32f10x_flash.h" +#define SETTINGSVERSION 0x01 /*Change this if you change the struct below to prevent people getting out of sync*/ +struct { + uint32_t SolderingTemp; //current setpoint for the iron + uint32_t SleepTemp; //temp to drop to in sleep + uint8_t SleepTime; //minutes to sleep + uint8_t cutoutVoltage; //X10 the voltage we cutout at for undervoltage + uint8_t movementEnabled; + uint8_t version; +} systemSettings; +//Settings struct used for user settings + +void saveSettings(); +void restoreSettings(); +void resetSettings(); +#endif /* SETTINGS_H_ */ diff --git a/workspace/ts100/inc/UI.h b/workspace/ts100/inc/UI.h deleted file mode 100644 index 400eb42d..00000000 --- a/workspace/ts100/inc/UI.h +++ /dev/null @@ -1,46 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : UI.h - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2015/07/07 ͳһ������ - *******************************************************************************/ -#ifndef _UI_H -#define _UI_H - -#include "stm32f10x.h" - -u32 Get_UpdataFlag(void); -void Set_UpdataFlag(u32 Cont); -void APP_Init(void); -u32 Calculation_TWork(u8 Flag); -void Temp_SetProc(void); -void Display_Temp(u8 x, s16 Temp); -void Show_Notice(void); -void Show_Warning(void); -void Show_MiniTS(void); -void Show_TempDown(s16 Temp, s16 Dst_Temp); -void Set_TemperatureShowFlag(u8 flag); -s16 TemperatureShow_Change(u8 flag, s16 Tmp); -u8 Get_TemperatureShowFlag(void); - -void Show_Triangle(u8 empty, u8 fill); -void Shift_Char(u8* ptr, u8 pos); -void Show_Set(void); -void Show_OrderChar(u8* ptr, u8 num, u8 width); -u8 Reverse_Bin8(u8 data); -void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction); -u8 Show_TempReverse(u8 num, u8 width, u8 direction); -void Show_HeatingIcon(u32 ht_flag, u16 active); -void Display_Str(u8 x, char* str); -void Display_Str10(u8 x, char* str); -void Clear_Pervious(u16 data); -void Print_Integer(s32 data, u8 posi); -u8 Roll_Num(u16 Step, u8 Flag); -void OLed_Display(void); -void Show_Cal(u8 flag); -void Show_Config(void); -#endif -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/inc/WordLib.h b/workspace/ts100/inc/WordLib.h deleted file mode 100644 index 11ff17cd..00000000 --- a/workspace/ts100/inc/WordLib.h +++ /dev/null @@ -1,404 +0,0 @@ -#ifndef _WORDLIB_H -#define _WORDLIB_H - -const u8 wordlib[] = { //16*16 ÁÐÐÐʽ£¬ÒõÂë£¬ÄæÏò - 0x00,0x00,0x00,0xF8,0xFE,0x03,0x01,0x01,0x01,0x03,0xFE,0xFC,0xF0,0x00,0x00,0x00, - 0x00,0x00,0x00,0x3F,0x7F,0xE0,0x80,0x80,0x80,0xC0,0x7F,0x3F,0x07,0x00,0x00,0x00,/*"0",0*/ - 0x00,0x00,0x00,0x08,0x04,0x04,0x06,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x00,0x00,0x00,0x00,/*"1",1*/ - 0x00,0x00,0x00,0x06,0x07,0x01,0x01,0x01,0x81,0xC3,0x7F,0x3E,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xE0,0xF0,0xD8,0xCC,0xC6,0xC3,0xC0,0xC0,0xE0,0x00,0x00,0x00,0x00,/*"2",2*/ - 0x00,0x00,0x00,0x06,0x07,0x81,0x81,0x81,0xC1,0x63,0x3F,0x1E,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xE0,0xC0,0x80,0x80,0x81,0x81,0xC3,0x7F,0x3E,0x00,0x00,0x00,0x00,/*"3",3*/ - 0x00,0x00,0x00,0x00,0xC0,0x60,0x38,0x0C,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x06,0x07,0x05,0x04,0x04,0x84,0xFF,0xFF,0xC4,0x84,0x06,0x00,0x00,0x00,/*"4",4*/ - 0x00,0x00,0x00,0xFF,0xFF,0x83,0x83,0x83,0x83,0x83,0x83,0x03,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xE0,0xC0,0x80,0x80,0x80,0x80,0xC1,0x7F,0x3F,0x08,0x00,0x00,0x00,/*"5",5*/ - 0x00,0x00,0x00,0xE0,0xF8,0x9C,0x8E,0xC2,0xC3,0xC1,0x81,0x81,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x3F,0x7F,0xC0,0x80,0x80,0x80,0x80,0xC1,0x7F,0x3F,0x00,0x00,0x00,/*"6",6*/ - 0x00,0x00,0x00,0x0F,0x03,0x03,0x03,0x03,0x83,0xE3,0x3B,0x0F,0x03,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x80,0xE0,0x78,0x1E,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,/*"7",7*/ - 0x00,0x00,0x18,0x7E,0x7E,0xC3,0x81,0x81,0x81,0x81,0x67,0x7E,0x3C,0x00,0x00,0x00, - 0x00,0x00,0x1C,0x7E,0xFF,0xC1,0x80,0x80,0x80,0x81,0xE3,0x7F,0x3C,0x00,0x00,0x00,/*"8",8*/ - 0x00,0x00,0x78,0xFE,0xC6,0x03,0x01,0x01,0x01,0x03,0x9E,0xFC,0xF0,0x00,0x00,0x00, - 0x00,0x00,0x00,0x01,0x01,0x83,0x83,0xC3,0x61,0x71,0x3F,0x0F,0x01,0x00,0x00,0x00,/*"9",9*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",10*/ - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x01,0x01,0x01,0x00,//"+",11 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,//"-",12 - - 0x0E,0x11,0x11,0x0E,0xE0,0xF8,0x0C,0x06,0x03,0x01,0x01,0x01,0x01,0x02,0x1E,0x00, - 0x00,0x00,0x00,0x00,0x0F,0x3F,0x70,0xC0,0x80,0x80,0x80,0x80,0x80,0x40,0x20,0x00,/*"¡æ",13*/ - - 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,//":",14 - - 0x08,0x14,0x22,0x14,0x08,0x02,0x02,0xFE,0x06,0x02,0x02,0x02,0xC2,0x02,0x06,0x1E, - 0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x81,0x81,0x01,0x01,0x03,0x00,0x00,0x00,/*"¨H",15*/ - - 0xC0,0x30,0x08,0x04,0x04,0x02,0xFA,0xAA,0xFA,0x02,0x04,0x04,0x08,0x30,0xC0,0x00, - 0x07,0x18,0x20,0x40,0x58,0xA4,0xDB,0xDE,0xDB,0xA4,0x58,0x40,0x20,0x18,0x07,0x00,/*"ζȼÆ",16*/ -}; - -const u8 Maplib[] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88, - 0x98,0xBF,0xBF,0x98,0x88,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x20,0x60,0x60,0x60,0x60,0x60,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, - 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, - 0x90,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0xF8,0x88,0x84,0x82,0x82,0x83, - 0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x82, - 0x82,0x82,0x82,0x82,0x86,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,/*"C:\Users\888\Desktop\µçÀÓÌú.BMP",0*/ - - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90, - 0xB0,0xFE,0xFE,0xB0,0x90,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x20,0x60,0x60,0x60,0x60,0x60,0x60,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, - 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, - 0x90,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0xF8,0x88,0x84,0x82,0x82,0x83, - 0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x82, - 0x82,0x82,0x82,0x82,0x86,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, - 0x84,0x84,0x84,0x84,0x84,0x84,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0xFE,0x00,/*"C:\Users\888\Desktop\µçÀÓÌú.BMP",0*/ - - // 0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0x00,//"¼ýÍ·"2// - // 0x01,0x03,0x07,0x0F,0x1F,0x3F,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00, - 0x00,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0xFC,0xF8,0xF0,0xE0,0xC0,0x80, ///"¼ýÍ·"7/// - 0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x3F,0x1F,0x0F,0x07,0x03,0x01, - // 0x00,0xF8,0xF8,0x00,0x00,0xF8,0xF8,0xF8,0xF8,0x00,0x00,0xFE,0xFE,0xF8,0xE0,0x80, - // 0x00,0x1F,0x1F,0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x00,0x00,0x7F,0x7F,0x1F,0x07,0x01 //"¼ýÍ·8"// -}; - -const u8 Maplib1[] = {/* 14 * 16*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",15*/ - 0x00,0x01,0xFF,0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x81,0xC6,0x7E,0x38, - 0x00,0x80,0xFF,0xFF,0x81,0x81,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,/*"P",0*/ - 0x00,0x20,0x20,0x20,0xE0,0xE0,0x00,0x80,0x40,0x40,0x20,0x60,0xC0,0x40, - 0x00,0x80,0x80,0x80,0xFF,0xFF,0x81,0x80,0x80,0x80,0x00,0x00,0x00,0x00,/*"r",1*/ - 0x00,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x00,0x00, - 0x00,0x00,0x3F,0x7F,0x44,0x84,0x84,0x84,0x84,0x84,0x84,0x47,0x27,0x00,/*"e",2*/ - 0x00,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0xC0,0x00,0x00, - 0x00,0x00,0x20,0xC3,0x82,0x86,0x84,0x84,0x8C,0x8C,0x88,0x78,0x30,0x00,/*"s",3*/ - 0x00,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0xC0,0x00,0x00, - 0x00,0x00,0x20,0xC3,0x82,0x86,0x84,0x84,0x8C,0x8C,0x88,0x78,0x30,0x00,/*"s",4*/ - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0x60,0x20,0x10,0x18,0x0C,0x86, - 0xE0,0xE0,0xE0,0xEC,0xFC,0xF2,0xF3,0xF1,0xF0,0xF8,0xEC,0xE4,0xE4,0xE2,0xE3,0x01,/*"C:\Users\888\Desktop\sssss.BMP",0*/ - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x40,0x20,0x30,0x18,0x0C, - 0xC0,0xC0,0xC0,0xD8,0xF8,0xE4,0xE6,0xE3,0xE1,0xF1,0xD8,0xC8,0xC8,0xC4,0xC6,0x03,/*"C:\Users\888\Desktop\sssss.BMP",0*/ - - 0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00,0xC0,0x38,0x26,0x25,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x01,0x02,0x7F,0x7F,0x7F,0x06,0x09,0x09,0x09,0x09,0x09,0x09,0x39,0x48, - 0x48,0x48,0x48,0x30,0x10,0x08,0x08,0x04,/*"C:\Users\888\Desktop\´óÓÒ.BMP",0*/ - - 0xFC,0xFC,0x00,0x00,0x00,0x00,0xC0,0x38,0x26,0x25,0x01,0x01,0x01,0x01,0x01,0x01, - 0x01,0x01,0x02,0x02,0x7F,0x7F,0x06,0x09,0x09,0x09,0x09,0x09,0x09,0x39,0x48,0x48, - 0x48,0x48,0x30,0x10,0x08,0x08,0x04,0x04,/*"C:\Users\888\Desktop\´óÓÒ.BMP",0*/ - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0x60,0x30,0x18,0x0C,0x86, - 0x00,0xE0,0xE0,0xEC,0xF4,0xF6,0xF6,0xFB,0xF5,0xE8,0xE8,0xE4,0xE2,0xE2,0xE1,0x00,/*"δÃüÃûÎļþ",0*/ - - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x18,0x0C, - 0x00,0xC0,0xC0,0xD8,0xE8,0xEC,0xEC,0xF6,0xEB,0xD1,0xD1,0xC8,0xC4,0xC4,0xC2,0x01,/*"δÃüÃûÎļþ",0*/ - - 0xFE,0xFE,0xFE,0x80,0x40,0x40,0x60,0x58,0x54,0x02,0x02,0x02,0x02,0x02,0x02,0x84, - 0x3F,0x3F,0x3F,0x00,0x01,0x01,0x01,0x01,0x01,0x07,0x05,0x05,0x06,0x02,0x01,0x00,/*"δÃüÃûÎļþ",0*/ - - 0xFE,0xFE,0x80,0x40,0x40,0x60,0x58,0x54,0x02,0x02,0x02,0x02,0x02,0x02,0x84,0x84, - 0x3F,0x3F,0x00,0x01,0x01,0x01,0x01,0x01,0x07,0x05,0x05,0x06,0x02,0x01,0x00,0x00,/*"δÃüÃûÎļþ",0*/ -}; - -const u8 MiniTS[] = {/*16*16*/ - 0x01,0xF9,0xFF,0x3F,0xFF,0xF0,0x80,0x00,0x80,0xF0,0x7E,0xFF,0xFF,0xFF,0x01,0x01, - 0x80,0xFF,0xFF,0x80,0x83,0x1F,0xFF,0xF8,0x3F,0x87,0x80,0xFF,0xFF,0xFF,0x80,0x80,/*"M",0*/ - 0x00,0x00,0x00,0x20,0x20,0x20,0x63,0xE3,0xE3,0x03,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x80,0x00,0x00,0x00,/*"i",1*/ - 0x00,0x20,0xE0,0xE0,0xE0,0xC0,0x40,0x60,0x20,0x20,0x60,0xC0,0xC0,0x00,0x00,0x00, - 0x00,0x80,0xFF,0xFF,0xFF,0x80,0x80,0x00,0x00,0x80,0x80,0xFF,0xFF,0x80,0x80,0x00,/*"n",2*/ - 0x00,0x00,0x00,0x20,0x20,0x20,0x63,0xE3,0xE3,0x03,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x80,0x00,0x00,0x00,/*"i",3*/ - 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",4*/ - 0x00,0x06,0x07,0x03,0x01,0x01,0xFF,0xFF,0xFF,0x01,0x01,0x01,0x03,0x0F,0x0C,0x00, - 0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0xFF,0xFF,0x80,0x80,0x00,0x00,0x00,0x00,0x00,/*"T",5*/ - 0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x20,0x60,0x40,0xC0,0x80,0x00,0x00,0x00, - 0x00,0x0E,0x3F,0x7F,0xE1,0x80,0x80,0x80,0x80,0x80,0xC0,0x71,0x7F,0x3F,0x00,0x00,/*"o",6*/ - 0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x20,0x60,0x40,0xC0,0x80,0x00,0x00,0x00, - 0x00,0x0E,0x3F,0x7F,0xE1,0x80,0x80,0x80,0x80,0x80,0xC0,0x71,0x7F,0x3F,0x00,0x00,/*"o",7*/ - 0x00,0x00,0x00,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x80,0x00,0x00,0x00,/*"l",8*/ - 0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x20,0x60,0x40,0xC0,0xC0,0x00,0x00,0x00, - 0x00,0x00,0x20,0xE3,0xC3,0x86,0x86,0x84,0x8C,0x8C,0x8C,0xF8,0x78,0x30,0x00,0x00,/*"s",9*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",10*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",11*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",12*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",13*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",14*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",15*/ -}; -//const u8 Arrow[] = {/*16*16*/ -// 0x00,0x03,0x0E,0x18,0x60,0xC3,0x06,0x18,0x70,0xC0,0x00,0x00,0x00,0x80,0x60,0x38, -// 0x0C,0x83,0xC1,0x30,0x0C,0x07,0x01,0x00,/*"¡·",0*/ - -// 0x00,0x00,0xC0,0x60,0x18,0x0C,0xC3,0x71,0x18,0x06,0x03,0x00,0x00,0x01,0x03,0x0C, -// 0x30,0x61,0x87,0x0C,0x30,0xE0,0x80,0x00,/*"¡¶",0*/ - -// 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -// 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/ -//}; -const u8 Triangle[] = {/*16*16*/ - 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0xFE,0x00,0x00,0x00, - 0x00,0x00,0x01,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x3F,0x00,0x00,0x00,/*"×ó¡÷",0*/ - - 0x00,0x00,0xFE,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00, - 0x00,0x00,0x3F,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x01,0x01,0x00,0x00,0x00,/*"ÓÒ¡÷",0*/ - - 0x00,0x80,0x80,0xC0,0xC0,0x60,0x60,0x30,0x30,0x18,0x18,0x0C,0x0C,0xFE,0x00,0x00, - 0x00,0x01,0x01,0x03,0x03,0x06,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x7F,0x00,0x00,/*"¼Ó´Ö×ó¡÷",0*/ - - 0x00,0x00,0xFE,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x60,0xC0,0xC0,0x80,0x80,0x00, - 0x00,0x00,0x7F,0x30,0x30,0x18,0x18,0x0C,0x0C,0x06,0x06,0x03,0x03,0x01,0x01,0x00,/*"¼Ó´ÖÓÒ¡÷",0*/ - - 0x80,0x80,0xC0,0xC0,0xE0,0xE0,0xF0,0xF0,0xF8,0xF8,0xFC,0xFC,0xFE,0x00,0x00,0x00, - 0x00,0x00,0x01,0x01,0x03,0x03,0x07,0x07,0x0F,0x0F,0x1F,0x1F,0x3F,0x00,0x00,0x00,/*"×ó¡ø",1*/ - - 0x00,0x00,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xE0,0xE0,0xC0,0xC0,0x80,0x80,0x00, - 0x00,0x00,0x3F,0x1F,0x1F,0x0F,0x0F,0x07,0x07,0x03,0x03,0x01,0x01,0x00,0x00,0x00,/*"ÓÒ¡ø",1*/ -}; - -const u8 IhIcon[] = { - 0x00,0xF0,0xFE,0xFF,0xF0,0x00, - 0x00,0x7F,0x7F,0x7F,0x7F,0x00,/*"¼ÓÈÈ",0*/ - - 0xFF,0x0F,0xE1,0xE0,0x0F,0xFF, - 0xFF,0x80,0xBF,0xBF,0x80,0xFF,/*"·´Ïà",0*/ -}; -const u8 TempIcon[] = {/*16*16*/ - 0x10,0x18,0x8C,0xC6,0x63,0x63,0xC6,0x8C,0x18,0x10, - 0x42,0x63,0x31,0x18,0x0C,0x0C,0x18,0x31,0x63,0x42,/*"10*16",0*/ - - 0x00,0xF0,0x1E,0x1F,0xF0,0x00, - 0x00,0xFF,0x80,0x80,0xFF,0x00,/*"6*16",0*/ - - 0x42,0xC6,0x8C,0x18,0x30,0x30,0x18,0x8C,0xC6,0x42, - 0x08,0x18,0x31,0x63,0xC6,0xC6,0x63,0x31,0x18,0x08,/*"10*16",1*/ - - 0x8C,0x8C,0xC6,0xC6,0x8C,0x8C,0xC6,0xC6,0x8C,0x8C, - 0x31,0x31,0x18,0x18,0x31,0x31,0x18,0x18,0x31,0x31,/*"10*16",2*/ - - - 0x00,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x00, - 0x00,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x00,/*"ÎÂ¶ÈÆ½ºâ",0*/ - - 0x80,0xC0,0x60,0x30,0x98,0xCC,0x66,0x33,0x33,0x66,0xCC,0x98,0x30,0x60,0xC0,0x80, - 0x88,0xCC,0x66,0x33,0x19,0x0C,0x06,0x03,0x03,0x06,0x0C,0x19,0x33,0x66,0xCC,0x88,/*"¼ÓÈÈ",0*/ - - 0x11,0x33,0x66,0xCC,0x98,0x30,0x60,0xC0,0xC0,0x60,0x30,0x98,0xCC,0x66,0x33,0x11, - 0x01,0x03,0x06,0x0C,0x19,0x33,0x66,0xCC,0xCC,0x66,0x33,0x19,0x0C,0x06,0x03,0x01,/*"½µÎÂ",0*/ -}; - -const u8 Warning[] = {/*10*16*/ - 0x01,0xFF,0x00,0xE1,0x1F,0xE0,0x00,0xFF,0x01,0x00,0x00,0x01,0x1E,0x01,0x00,0x01, - 0x1E,0x01,0x00,0x00,/*"W",0*/ - 0x00,0x60,0x10,0x10,0x90,0x90,0xE0,0x00,0x00,0x00,0x00,0x0E,0x11,0x11,0x10,0x08, - 0x1F,0x18,0x00,0x00,/*"a",1*/ - 0x10,0x10,0xF0,0x40,0x20,0x10,0x10,0x30,0x00,0x00,0x10,0x10,0x1F,0x10,0x10,0x00, - 0x00,0x00,0x00,0x00,/*"r",2*/ - 0x10,0xF0,0x20,0x10,0x10,0x10,0x10,0xE0,0x00,0x00,0x10,0x1F,0x10,0x00,0x00,0x00, - 0x10,0x1F,0x10,0x00,/*"n",3*/ - 0x00,0x00,0x10,0x13,0xF3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x1F,0x10, - 0x10,0x00,0x00,0x00,/*"i",4*/ - 0x10,0xF0,0x20,0x10,0x10,0x10,0x10,0xE0,0x00,0x00,0x10,0x1F,0x10,0x00,0x00,0x00, - 0x10,0x1F,0x10,0x00,/*"n",5*/ - 0x00,0xE0,0x10,0x10,0x10,0x10,0xF0,0x10,0x00,0x00,0x00,0x7D,0x8A,0x8A,0x8A,0x8A, - 0x91,0x70,0x00,0x00,/*"g",6*/ - - 0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0x07,0x07,0xFE,0xF8,0xE0,0x80,0x00,0x00,0x00, - 0x10,0x1C,0x1F,0x1F,0x1F,0x1F,0x1F,0x12,0x12,0x1F,0x1F,0x1F,0x1F,0x1F,0x1C,0x10,/*"C:\Users\888\Desktop\attention.bmp",0*/ -}; -const u8 SenErr[] = {/*10*16*/ - 0x00,0x1C,0x22,0x21,0x41,0x41,0x41,0x82,0x07,0x00,0x00,0x1E,0x08,0x10,0x10,0x10, - 0x10,0x08,0x07,0x00,/*"S",0*/ - 0x00,0xC0,0xA0,0x90,0x90,0x90,0x90,0xA0,0xC0,0x00,0x00,0x07,0x08,0x10,0x10,0x10, - 0x10,0x08,0x04,0x00,/*"e",1*/ - 0x10,0xF0,0x20,0x10,0x10,0x10,0x10,0xE0,0x00,0x00,0x10,0x1F,0x10,0x00,0x00,0x00, - 0x10,0x1F,0x10,0x00,/*"n",2*/ - 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,/*"-",3*/ - 0x01,0xFF,0x21,0x21,0x21,0x21,0xF9,0x03,0x04,0x00,0x10,0x1F,0x10,0x10,0x10,0x10, - 0x10,0x18,0x04,0x00,/*"E",4*/ - 0x00,0x10,0x10,0xF0,0x40,0x20,0x10,0x10,0x30,0x00,0x00,0x10,0x10,0x1F,0x10,0x10, - 0x00,0x00,0x00,0x00,/*"r",5*/ - 0x00,0x10,0x10,0xF0,0x40,0x20,0x10,0x10,0x30,0x00,0x00,0x10,0x10,0x1F,0x10,0x10, - 0x00,0x00,0x00,0x00,/*"r",6*/ - -}; -const u8 HighVt[] = {/*10*16*/ - 0x01,0xFF,0x41,0x40,0x40,0x40,0x41,0xFF,0x01,0x00,0x10,0x1F,0x10,0x00,0x00,0x00, - 0x10,0x1F,0x10,0x00,/*"H",0*/ - 0x00,0x00,0x10,0x13,0xF3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x1F,0x10, - 0x10,0x00,0x00,0x00,/*"i",1*/ - 0x00,0x00,0xE0,0x10,0x10,0x10,0x10,0xF0,0x10,0x00,0x00,0x60,0x9D,0x8A,0x8A,0x8A, - 0x8A,0x91,0x70,0x00,/*"g",2*/ - 0x01,0xFF,0x20,0x10,0x10,0x10,0x10,0xE0,0x00,0x00,0x10,0x1F,0x10,0x00,0x00,0x00, - 0x10,0x1F,0x10,0x00,/*"h",3*/ - 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,/*"-",3*/ - 0x01,0x07,0x79,0x80,0x00,0x80,0x79,0x07,0x01,0x00,0x00,0x00,0x00,0x07,0x1C,0x07, - 0x00,0x00,0x00,0x00,/*"V",5*/ - 0x00,0x00,0x10,0x10,0xFE,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10, - 0x10,0x08,0x00,0x00,/*"t",6*/ -}; -const u8 LowVot[] = {/*10*16*/ - 0x01,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x1F,0x10,0x10,0x10,0x10, - 0x10,0x18,0x04,0x00,/*"L",0*/ - 0x00,0xC0,0x20,0x10,0x10,0x10,0x10,0x20,0xC0,0x00,0x00,0x07,0x08,0x10,0x10,0x10, - 0x10,0x08,0x07,0x00,/*"o",1*/ - 0x10,0xF0,0x00,0x10,0xF0,0x10,0x00,0xF0,0x10,0x00,0x00,0x03,0x1C,0x03,0x00,0x03, - 0x1C,0x03,0x00,0x00,/*"w",2*/ - 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,/*"-",3*/ - 0x01,0x07,0x79,0x80,0x00,0x80,0x79,0x07,0x01,0x00,0x00,0x00,0x00,0x07,0x1C,0x07, - 0x00,0x00,0x00,0x00,/*"V",4*/ - 0x00,0xC0,0x20,0x10,0x10,0x10,0x10,0x20,0xC0,0x00,0x00,0x07,0x08,0x10,0x10,0x10, - 0x10,0x08,0x07,0x00,/*"o",5*/ - 0x00,0x00,0x10,0x10,0xFE,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10, - 0x10,0x08,0x00,0x00,/*"t",6*/ -}; - -const u8 Cal_UnDone[] = { /*16*16 Cal_Ud*/ - 0xE0,0x18,0x04,0x02,0x12,0x21,0x41,0x81,0x81,0x41,0x22,0x12,0x04,0x18,0xE0,0x00, - 0x03,0x0C,0x10,0x20,0x28,0x44,0x42,0x41,0x41,0x42,0x24,0x28,0x10,0x0C,0x03,0x00,/*"У׼ʧ°Ü.BMP",0*/ - - 0xF0,0x0C,0x02,0x01,0x01,0x01,0x01,0x02,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x08,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C",0*/ - 0x00,0x60,0x10,0x10,0x90,0x90,0x90,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x0E,0x11,0x11,0x10,0x10,0x08,0x1F,0x10,0x18,0x00,0x00,0x00,0x00,0x00,0x00,/*"a",1*/ - 0x00,0x01,0x01,0x01,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x10,0x10,0x10,0x1F,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"l",2*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,/*"_",3*/ - 0x00,0x01,0x07,0x19,0xE0,0xB0,0x0D,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x10,0x18,0x17,0x00,0x01,0x16,0x18,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"X",4*/ - -}; - -const u8 Cal_Done[] = {/*16*16 Cal_Dn*/ - 0xE0,0x18,0x64,0xE2,0x82,0x01,0x01,0x01,0x01,0x01,0x82,0xE2,0x64,0x18,0xE0,0x00, - 0x03,0x0C,0x10,0x21,0x27,0x4E,0x58,0x50,0x58,0x4E,0x27,0x21,0x10,0x0C,0x03,0x00,/*"У׼³É¹¦.BMP",0*/ - - 0xF0,0x0C,0x02,0x01,0x01,0x01,0x01,0x02,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x08,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C",0*/ - 0x00,0x60,0x10,0x10,0x90,0x90,0x90,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x0E,0x11,0x11,0x10,0x10,0x08,0x1F,0x10,0x18,0x00,0x00,0x00,0x00,0x00,0x00,/*"a",1*/ - 0x00,0x01,0x01,0x01,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x10,0x10,0x10,0x1F,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"l",2*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,/*"_",3*/ - 0x01,0x07,0x79,0x80,0x00,0x80,0x79,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x07,0x1C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"V",4*/ - -}; - -const u8 Number12[] = {/*12*16*/ - 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10,0x20, - 0x20,0x10,0x0F,0x00,0x00,0x00,0x00,0x00,/*"0",0*/ - 0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F, - 0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,/*"1",1*/ - 0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x28,0x24, - 0x22,0x21,0x30,0x00,0x00,0x00,0x00,0x00,/*"2",2*/ - 0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x20,0x20, - 0x20,0x11,0x0E,0x00,0x00,0x00,0x00,0x00,/*"3",3*/ - 0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x04,0x24, - 0x24,0x3F,0x24,0x00,0x00,0x00,0x00,0x00,/*"4",4*/ - 0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x21,0x20, - 0x20,0x11,0x0E,0x00,0x00,0x00,0x00,0x00,/*"5",5*/ - 0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x11,0x20, - 0x20,0x11,0x0E,0x00,0x00,0x00,0x00,0x00,/*"6",6*/ - 0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"7",7*/ - 0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x21, - 0x21,0x22,0x1C,0x00,0x00,0x00,0x00,0x00,/*"8",8*/ - 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x22, - 0x22,0x11,0x0F,0x00,0x00,0x00,0x00,0x00,/*"9",9*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*".",10*/ -}; - -const u8 Number10[] = { /*10*16*/ - 0x00,0xE0,0x18,0x04,0x04,0x04,0x04,0x18,0xE0,0x00,0x00,0x0F,0x30,0x40,0x40,0x40, - 0x40,0x30,0x0F,0x00,/*"0",0*/ - 0x00,0x00,0x08,0x08,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x7F,0x40, - 0x40,0x00,0x00,0x00,/*"1",1*/ - 0x00,0x78,0x04,0x04,0x04,0x04,0x04,0x88,0x70,0x00,0x00,0x60,0x50,0x48,0x44,0x42, - 0x41,0x40,0x70,0x00,/*"2",2*/ - 0x00,0x38,0x04,0x04,0x84,0x84,0xC8,0x30,0x00,0x00,0x00,0x38,0x40,0x40,0x40,0x40, - 0x40,0x21,0x1E,0x00,/*"3",3*/ - 0x00,0x00,0x80,0x60,0x10,0x08,0xFE,0x00,0x00,0x00,0x00,0x07,0x04,0x04,0x44,0x44, - 0x7F,0x44,0x44,0x00,/*"4",4*/ - 0x00,0x00,0xFC,0x04,0x84,0x84,0x84,0x04,0x04,0x00,0x00,0x38,0x41,0x41,0x40,0x40, - 0x40,0x21,0x1E,0x00,/*"5",5*/ - 0x00,0xC0,0x30,0x88,0x84,0x84,0x84,0x04,0x18,0x00,0x00,0x0F,0x31,0x40,0x40,0x40, - 0x40,0x21,0x1E,0x00,/*"6",6*/ - 0x00,0x1C,0x04,0x04,0x84,0x44,0x34,0x0C,0x04,0x00,0x00,0x00,0x00,0x7E,0x01,0x00, - 0x00,0x00,0x00,0x00,/*"7",7*/ - 0x00,0x70,0x88,0x04,0x04,0x04,0x04,0x88,0x70,0x00,0x00,0x1C,0x22,0x41,0x41,0x41, - 0x41,0x22,0x1C,0x00,/*"8",8*/ - 0x00,0xF0,0x08,0x04,0x04,0x04,0x04,0x18,0xE0,0x00,0x00,0x30,0x41,0x42,0x42,0x42, - 0x22,0x19,0x07,0x00,/*"9",9*/ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,/*" ",10*/ - 0x1C,0x1C,0xC0,0x30,0x08,0x04,0x04,0x04,0x08,0x30,0x00,0x00,0x07,0x18,0x20,0x40, - 0x40,0x40,0x20,0x10,/*"¡æ",11*/ - 0x1C,0x12,0x0C,0x02,0x02,0xFE,0x82,0x82,0xE2,0x02,0x00,0x00,0x00,0x00,0x40,0x7F, - 0x40,0x00,0x03,0x00,/*"¨H",12*/ - -}; - -const u8 Guide[] = { /*16*16*/ - 0x00,0x00,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x18,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"D:\yinyongqin\ÀÓÌú½çÃæ\½µ½µ.BMP",0*/ - 0x00,0x00,0x30,0x60,0xC0,0x80,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x18,0x0C,0x06,0x03,0x19,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,/*"D:\yinyongqin\ÀÓÌú½çÃæ\½µ½µ.BMP",0*/ - 0x00,0x00,0x30,0x60,0xC0,0x80,0x30,0x60,0xC0,0x80,0x30,0x60,0xC0,0x80,0x00,0x00, - 0x00,0x00,0x18,0x0C,0x06,0x03,0x19,0x0C,0x06,0x03,0x19,0x0C,0x06,0x03,0x01,0x00,/*"D:\yinyongqin\ÀÓÌú½çÃæ\½µ½µ.BMP",0*/ - 0x00,0x00,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*">",0*/ - 0x00,0x00,0x18,0x30,0x60,0xC0,0x98,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x0C,0x06,0x03,0x01,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,/*">>",0*/ - 0x00,0x00,0x18,0x30,0x60,0xC0,0x98,0x30,0x60,0xC0,0x98,0x30,0x60,0xC0,0x80,0x00, - 0x00,0x00,0x0C,0x06,0x03,0x01,0x0C,0x06,0x03,0x01,0x0C,0x06,0x03,0x01,0x00,0x00,/*">>>",0*/ -}; -const u8 Config[] = { /*16*16*/ - 0x00,0x00,0x00,0xC0,0xF0,0x38,0x08,0x04,0x04,0x04,0x04,0x08,0x08,0x1C,0x00,0x00, - 0x00,0x00,0x00,0x0F,0x1F,0x30,0x60,0x40,0x40,0x40,0x40,0x20,0x30,0x08,0x00,0x00,/*"C",0*/ - 0x00,0x00,0x00,0xC0,0xF0,0x18,0x0C,0x04,0x04,0x04,0x0C,0x18,0xF0,0xC0,0x00,0x00, - 0x00,0x00,0x00,0x07,0x1F,0x30,0x60,0x40,0x40,0x40,0x60,0x30,0x1F,0x07,0x00,0x00,/*"O",1*/ - 0x00,0x00,0x00,0x04,0xFC,0x1C,0x38,0xE0,0xC0,0x00,0x00,0x04,0xFC,0x04,0x00,0x00, - 0x00,0x00,0x00,0x40,0x7F,0x40,0x00,0x00,0x01,0x07,0x1E,0x38,0x7F,0x00,0x00,0x00,/*"N",2*/ - 0x00,0x00,0x00,0x04,0xFC,0xFC,0x84,0x84,0x84,0x84,0xE4,0x04,0x0C,0x10,0x00,0x00, - 0x00,0x00,0x00,0x40,0x7F,0x7F,0x40,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,/*"F",3*/ - 0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0xFC,0xFC,0x04,0x04,0x04,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x7F,0x40,0x40,0x40,0x00,0x00,0x00,/*"I",4*/ - 0x00,0x00,0x00,0xC0,0xF0,0x38,0x08,0x04,0x04,0x04,0x04,0x0C,0x1C,0x00,0x00,0x00, - 0x00,0x00,0x00,0x07,0x1F,0x38,0x60,0x40,0x40,0x42,0x42,0x3E,0x3E,0x02,0x02,0x00,/*"G",5*/ -}; -#endif diff --git a/workspace/ts100/inc/stm32f10x_conf.h b/workspace/ts100/inc/stm32f10x_conf.h deleted file mode 100644 index cfda2db6..00000000 --- a/workspace/ts100/inc/stm32f10x_conf.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f10x_conf.h - * @author MCD Application Team - * @version V4.0.0 - * @date 21-January-2013 - * @brief Library configuration file. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT 2013 STMicroelectronics

- * - * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/software_license_agreement_liberty_v2 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ****************************************************************************** - */ - - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F10x_CONF_H -#define __STM32F10x_CONF_H - -/* Includes ------------------------------------------------------------------*/ -/* Uncomment the line below to enable peripheral header file inclusion */ -#include "stm32f10x_adc.h" -#include "stm32f10x_bkp.h" -#include "stm32f10x_can.h" -#include "stm32f10x_crc.h" -#include "stm32f10x_dac.h" -#include "stm32f10x_dbgmcu.h" -#include "stm32f10x_dma.h" -#include "stm32f10x_exti.h" -#include "stm32f10x_flash.h" -#include "stm32f10x_fsmc.h" -#include "stm32f10x_gpio.h" -#include "stm32f10x_i2c.h" -#include "stm32f10x_iwdg.h" -#include "stm32f10x_pwr.h" -#include "stm32f10x_rcc.h" -#include "stm32f10x_rtc.h" -#include "stm32f10x_sdio.h" -#include "stm32f10x_spi.h" -#include "stm32f10x_tim.h" -#include "stm32f10x_usart.h" -#include "stm32f10x_wwdg.h" -#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Uncomment the line below to expanse the "assert_param" macro in the - Standard Peripheral Library drivers code */ -/* #define USE_FULL_ASSERT 1 */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - -/******************************************************************************* -* Macro Name : assert_param -* Description : The assert_param macro is used for function's parameters check. -* Input : - expr: If expr is false, it calls assert_failed function -* which reports the name of the source file and the source -* line number of the call that failed. -* If expr is true, it returns no value. -* Return : None -*******************************************************************************/ - #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0) -#endif /* USE_FULL_ASSERT */ - -#endif /* __STM32F10x_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/inc/usb_bot.h b/workspace/ts100/inc/usb_bot.h deleted file mode 100644 index 88b8977f..00000000 --- a/workspace/ts100/inc/usb_bot.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************** (C) COPYRIGHT 2013 e-Design Co., Ltd. ******************** - File Name : USB_bot.h - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#ifndef __USB_BOT_H -#define __USB_BOT_H - -typedef struct _Bulk_Only_CBW -{ - u32 dSignature; - u32 dTag; - u32 dDataLength; - u8 bmFlags; - u8 bLUN; - u8 bCBLength; - u8 CB[16]; -} -Bulk_Only_CBW; - -/* Bulk-only Command Status Wrapper */ -typedef struct _Bulk_Only_CSW -{ - u32 dSignature; - u32 dTag; - u32 dDataResidue; - u8 bStatus; -} -Bulk_Only_CSW; - -#define BOT_IDLE 0 /* Idle state */ -#define BOT_DATA_OUT 1 /* Data Out state */ -#define BOT_DATA_IN 2 /* Data In state */ -#define BOT_DATA_IN_LAST 3 /* Last Data In Last */ -#define BOT_CSW_Send 4 /* Command Status Wrapper */ -#define BOT_ERROR 5 /* error state */ - -#define BOT_CBW_SIGNATURE 0x43425355 -#define BOT_CSW_SIGNATURE 0x53425355 -#define BOT_CBW_PACKET_LENGTH 31 - -#define CSW_DATA_LENGTH 0x000D - -/* CSW Status Definitions */ -#define CSW_CMD_PASSED 0x00 -#define CSW_CMD_FAILED 0x01 -#define CSW_PHASE_ERROR 0x02 - -#define SEND_CSW_DISABLE 0 -#define SEND_CSW_ENABLE 1 - -#define DIR_IN 0 -#define DIR_OUT 1 -#define BOTH_DIR 2 - -#define BULK_MAX_PACKET_SIZE 0x00000040 - -extern u8 Bot_State; -extern u16 Data_Len; -extern u8 Bot_State; -extern Bulk_Only_CBW CBW; -extern Bulk_Only_CSW CSW; -extern u8 Bulk_Buff[]; - -void Mass_Storage_In (void); -void Mass_Storage_Out (void); -void CBW_Decode(void); -void Transfer_Data_Request(u8* Data_Pointer, u16 Data_Len); -void Set_CSW (u8 CSW_Status, u8 Send_Permission); -void Bot_Abort(u8 Direction); - -#endif -/********************************* END OF FILE ******************************/ - diff --git a/workspace/ts100/inc/usb_conf.h b/workspace/ts100/inc/usb_conf.h deleted file mode 100644 index cdcf68e7..00000000 --- a/workspace/ts100/inc/usb_conf.h +++ /dev/null @@ -1,73 +0,0 @@ -/******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** -* File Name : usb_conf.h -* Author : MCD Application Team -* Version : V2.2.1 -* Date : 09/22/2008 -* Description : Mass Storage Demo configuration header -******************************************************************************** -* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS -* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. -* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, -* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE -* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING -* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. -*******************************************************************************/ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_CONF_H -#define __USB_CONF_H - -/*-------------------------------------------------------------*/ -/* EP_NUM */ -/* defines how many endpoints are used by the device */ -/*-------------------------------------------------------------*/ -#define EP_NUM (3) - -/*-------------------------------------------------------------*/ -/* -------------- Buffer Description Table -----------------*/ -/*-------------------------------------------------------------*/ -/* buffer table base address */ - -#define BTABLE_ADDRESS (0x00) - -/* EP0 */ -/* rx/tx buffer base address */ -#define ENDP0_RXADDR (0x18) -#define ENDP0_TXADDR (0x58) - -/* EP1 */ -/* tx buffer base address */ -#define ENDP1_TXADDR (0x98) - -/* EP2 */ -/* Rx buffer base address */ -#define ENDP2_RXADDR (0xD8) - - -/* ISTR events */ -/* IMR_MSK */ -/* mask defining which events has to be handled */ -/* by the device application software */ -#define IMR_MSK (CNTR_CTRM | CNTR_RESETM) - -/* CTR service routines */ -/* associated to defined endpoints */ -//#define EP1_IN_Callback NOP_Process -#define EP2_IN_Callback NOP_Process -#define EP3_IN_Callback NOP_Process -#define EP4_IN_Callback NOP_Process -#define EP5_IN_Callback NOP_Process -#define EP6_IN_Callback NOP_Process -#define EP7_IN_Callback NOP_Process - - -#define EP1_OUT_Callback NOP_Process -//#define EP2_OUT_Callback NOP_Process -#define EP3_OUT_Callback NOP_Process -#define EP4_OUT_Callback NOP_Process -#define EP5_OUT_Callback NOP_Process -#define EP6_OUT_Callback NOP_Process -#define EP7_OUT_Callback NOP_Process - -#endif /* __USB_CONF_H */ - -/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ diff --git a/workspace/ts100/inc/usb_desc.h b/workspace/ts100/inc/usb_desc.h deleted file mode 100644 index c6546763..00000000 --- a/workspace/ts100/inc/usb_desc.h +++ /dev/null @@ -1,35 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_desc.h - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#ifndef __USB_DESC_H -#define __USB_DESC_H - -#ifdef STM32F30X - #include "stm32f30x.h" -#else - #include "stm32f10x.h" -#endif - -#define MASS_SIZ_DEVICE_DESC 18 -#define MASS_SIZ_CONFIG_DESC 32 - -#define MASS_SIZ_STRING_LANGID 4 -#define MASS_SIZ_STRING_VENDOR 38 -#define MASS_SIZ_STRING_PRODUCT 38 -#define MASS_SIZ_STRING_SERIAL 26 -#define MASS_SIZ_STRING_INTERFACE 16 - -extern const u8 MASS_DeviceDescriptor[MASS_SIZ_DEVICE_DESC]; -extern const u8 MASS_ConfigDescriptor[MASS_SIZ_CONFIG_DESC]; - -extern const u8 MASS_StringLangID[MASS_SIZ_STRING_LANGID]; -extern const u8 MASS_StringVendor[MASS_SIZ_STRING_VENDOR]; -extern const u8 MASS_StringProduct[MASS_SIZ_STRING_PRODUCT]; -extern u8 MASS_StringSerial[MASS_SIZ_STRING_SERIAL]; -extern const u8 MASS_StringInterface[MASS_SIZ_STRING_INTERFACE]; - -#endif -/********************************* END OF FILE ******************************/ - - diff --git a/workspace/ts100/inc/usb_istr.h b/workspace/ts100/inc/usb_istr.h deleted file mode 100644 index ff56a5e8..00000000 --- a/workspace/ts100/inc/usb_istr.h +++ /dev/null @@ -1,64 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_istr.h - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#ifndef __USB_ISTR_H -#define __USB_ISTR_H - -#include "usb_conf.h" - -void CTR_HP(void); -void USB_Istr(void); - -/* function prototypes Automatically built defining related macros */ - -#ifdef CTR_CALLBACK -void CTR_Callback(void); -#endif - -#ifdef DOVR_CALLBACK -void DOVR_Callback(void); -#endif - -#ifdef ERR_CALLBACK -void ERR_Callback(void); -#endif - -#ifdef WKUP_CALLBACK -void WKUP_Callback(void); -#endif - -#ifdef SUSP_CALLBACK -void SUSP_Callback(void); -#endif - -#ifdef RESET_CALLBACK -void RESET_Callback(void); -#endif - -#ifdef SOF_CALLBACK -void SOF_Callback(void); -#endif - -#ifdef ESOF_CALLBACK -void ESOF_Callback(void); -#endif - -void EP1_IN_Callback(void); -void EP2_IN_Callback(void); -void EP3_IN_Callback(void); -void EP4_IN_Callback(void); -void EP5_IN_Callback(void); -void EP6_IN_Callback(void); -void EP7_IN_Callback(void); - -void EP1_OUT_Callback(void); -void EP2_OUT_Callback(void); -void EP3_OUT_Callback(void); -void EP4_OUT_Callback(void); -void EP5_OUT_Callback(void); -void EP6_OUT_Callback(void); -void EP7_OUT_Callback(void); - -#endif -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/inc/usb_prop.h b/workspace/ts100/inc/usb_prop.h deleted file mode 100644 index 8b6e0f68..00000000 --- a/workspace/ts100/inc/usb_prop.h +++ /dev/null @@ -1,51 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_prop.h - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#ifndef __usb_prop_H -#define __usb_prop_H - -#include "usb_core.h" - -#ifdef STM32F30X - #include "stm32f30x.h" -#elif STM32F10X_HD - #include "stm32f10x.h" -#endif - -#define Mass_Storage_GetConfiguration NOP_Process -/* #define Mass_Storage_SetConfiguration NOP_Process*/ -#define Mass_Storage_GetInterface NOP_Process -#define Mass_Storage_SetInterface NOP_Process -#define Mass_Storage_GetStatus NOP_Process -/* #define Mass_Storage_ClearFeature NOP_Process*/ -#define Mass_Storage_SetEndPointFeature NOP_Process -#define Mass_Storage_SetDeviceFeature NOP_Process -/*#define Mass_Storage_SetDeviceAddress NOP_Process*/ - -/* MASS Storage Requests*/ -#define GET_MAX_LUN 0xFE -#define MASS_STORAGE_RESET 0xFF -#define LUN_DATA_LENGTH 1 - -extern u32 Max_Lun; - -void MASS_init(void); -void MASS_Reset(void); -void Mass_Storage_SetConfiguration(void); -void Mass_Storage_ClearFeature(void); -void Mass_Storage_SetDeviceAddress (void); -void MASS_Status_In (void); -void MASS_Status_Out (void); -RESULT MASS_Data_Setup(u8); -RESULT MASS_NoData_Setup(u8); -RESULT MASS_Get_Interface_Setting(u8 Interface, u8 AlternateSetting); -u8 *MASS_GetDeviceDescriptor(u16 ); -u8 *MASS_GetConfigDescriptor(u16); -u8 *MASS_GetStringDescriptor(u16); -u8 *Get_Max_Lun(u16 Length); -void Get_SerialNum(void); - -#endif -/********************************* END OF FILE ******************************/ - diff --git a/workspace/ts100/inc/usb_pwr.h b/workspace/ts100/inc/usb_pwr.h deleted file mode 100644 index d1c167d6..00000000 --- a/workspace/ts100/inc/usb_pwr.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_pwr.h - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#ifndef __USB_PWR_H -#define __USB_PWR_H - -#include "usb_core.h" - -typedef enum _RESUME_STATE -{ - RESUME_EXTERNAL, - RESUME_INTERNAL, - RESUME_LATER, - RESUME_WAIT, - RESUME_START, - RESUME_ON, - RESUME_OFF, - RESUME_ESOF -} RESUME_STATE; - -typedef enum _DEVICE_STATE -{ - UNCONNECTED, - ATTACHED, - POWERED, - SUSPENDED, - ADDRESSED, - CONFIGURED -} DEVICE_STATE; - -void Suspend(void); -void Resume_Init(void); -void Resume(RESUME_STATE eResumeSetVal); -RESULT PowerOn(void); -RESULT PowerOff(void); - -extern vu32 bDeviceState; /* USB device status */ -extern vu8 fSuspendEnabled; /* true when suspend is possible */ - -#endif -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/inc/usb_scsi.h b/workspace/ts100/inc/usb_scsi.h deleted file mode 100644 index 1e9a9ccd..00000000 --- a/workspace/ts100/inc/usb_scsi.h +++ /dev/null @@ -1,125 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_scsi.h - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#ifndef __USB_SCSI_H -#define __USB_SCSI_H - -#ifdef STM32F30X - #include "stm32f30x.h" -#else - #include "stm32f10x.h" -#endif - -/* SCSI Commands */ -#define SCSI_FORMAT_UNIT 0x04 -#define SCSI_INQUIRY 0x12 -#define SCSI_MODE_SELECT6 0x15 -#define SCSI_MODE_SELECT10 0x55 -#define SCSI_MODE_SENSE6 0x1A -#define SCSI_MODE_SENSE10 0x5A -#define SCSI_ALLOW_MEDIUM_REMOVAL 0x1E -#define SCSI_READ6 0x08 -#define SCSI_READ10 0x28 -#define SCSI_READ12 0xA8 -#define SCSI_READ16 0x88 - -#define SCSI_READ_CAPACITY10 0x25 -#define SCSI_READ_CAPACITY16 0x9E - -#define SCSI_REQUEST_SENSE 0x03 -#define SCSI_START_STOP_UNIT 0x1B -#define SCSI_TEST_UNIT_READY 0x00 -#define SCSI_WRITE6 0x0A -#define SCSI_WRITE10 0x2A -#define SCSI_WRITE12 0xAA -#define SCSI_WRITE16 0x8A - -#define SCSI_VERIFY10 0x2F -#define SCSI_VERIFY12 0xAF -#define SCSI_VERIFY16 0x8F - -#define SCSI_SEND_DIAGNOSTIC 0x1D -#define SCSI_READ_FORMAT_CAPACITIES 0x23 - -#define NO_SENSE 0 -#define RECOVERED_ERROR 1 -#define NOT_READY 2 -#define MEDIUM_ERROR 3 -#define HARDWARE_ERROR 4 -#define ILLEGAL_REQUEST 5 -#define UNIT_ATTENTION 6 -#define DATA_PROTECT 7 -#define BLANK_CHECK 8 -#define VENDOR_SPECIFIC 9 -#define COPY_ABORTED 10 -#define ABORTED_COMMAND 11 -#define VOLUME_OVERFLOW 13 -#define MISCOMPARE 14 - - -#define INVALID_COMMAND 0x20 -#define INVALID_FIELED_IN_COMMAND 0x24 -#define PARAMETER_LIST_LENGTH_ERROR 0x1A -#define INVALID_FIELD_IN_PARAMETER_LIST 0x26 -#define ADDRESS_OUT_OF_RANGE 0x21 -#define MEDIUM_NOT_PRESENT 0x3A -#define MEDIUM_HAVE_CHANGED 0x28 - -#define READ_FORMAT_CAPACITY_DATA_LEN 0x0C -#define READ_CAPACITY10_DATA_LEN 0x08 -#define MODE_SENSE10_DATA_LEN 0x08 -#define MODE_SENSE6_DATA_LEN 0x04 -#define REQUEST_SENSE_DATA_LEN 0x12 -#define STANDARD_INQUIRY_DATA_LEN 0x24 // 0x24 -#define BLKVFY 0x04 - -extern u8 Page00_Inquiry_Data[]; -extern u8 Standard_Inquiry_Data[]; -extern u8 Mode_Sense6_data[]; -extern u8 Mode_Sense10_data[]; -extern u8 Scsi_Sense_Data[]; -extern u8 ReadCapacity10_Data[]; - -extern u8 Bot_State; - -void SCSI_Inquiry_Cmd(void); -void SCSI_ReadFormatCapacity_Cmd(void); -void SCSI_ReadCapacity10_Cmd(void); -void SCSI_RequestSense_Cmd (void); -void SCSI_Start_Stop_Unit_Cmd(void); -void SCSI_ModeSense6_Cmd (void); -void SCSI_ModeSense10_Cmd (void); -void SCSI_Write10_Cmd(u32 LBA , u32 BlockNbr); -void SCSI_Read10_Cmd(u32 LBA , u32 BlockNbr); -void SCSI_Verify10_Cmd(void); - -void SCSI_Invalid_Cmd(void); -void SCSI_Valid_Cmd(void); -u8 SCSI_Address_Management(u8 Cmd , u32 LBA , u32 BlockNbr); - -void Set_Scsi_Sense_Data(u8 Sens_Key, u8 Asc); -void SCSI_TestUnitReady_Cmd (void); -void SCSI_Format_Cmd (void); - -#define SCSI_Prevent_Removal_Cmd SCSI_Valid_Cmd - -// Invalid (Unsupported) commands -#define SCSI_READ_CAPACITY16_Cmd SCSI_Invalid_Cmd - -//#define SCSI_FormatUnit_Cmd SCSI_Invalid_Cmd -#define SCSI_Write6_Cmd SCSI_Invalid_Cmd -#define SCSI_Write16_Cmd SCSI_Invalid_Cmd -#define SCSI_Write12_Cmd SCSI_Invalid_Cmd -#define SCSI_Read6_Cmd SCSI_Invalid_Cmd -#define SCSI_Read12_Cmd SCSI_Invalid_Cmd -#define SCSI_Read16_Cmd SCSI_Invalid_Cmd -#define SCSI_Send_Diagnostic_Cmd SCSI_Invalid_Cmd -#define SCSI_Mode_Select6_Cmd SCSI_Invalid_Cmd -#define SCSI_Mode_Select10_Cmd SCSI_Invalid_Cmd -#define SCSI_Verify12_Cmd SCSI_Invalid_Cmd -#define SCSI_Verify16_Cmd SCSI_Invalid_Cmd - -#endif -/********************************* END OF FILE ******************************/ - diff --git a/workspace/ts100/src/2FAT12.c b/workspace/ts100/src/2FAT12.c deleted file mode 100644 index 424abf82..00000000 --- a/workspace/ts100/src/2FAT12.c +++ /dev/null @@ -1,284 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** - File Name : 2FAT12.c - Version : S100 APP Ver 2.11 - Description: - Author : bure & Celery - Data: 2015/08/03 - History: - 2016/09/13 Ben V. Brown -> English comments and cleaning up - 2015/08/03 - *******************************************************************************/ -#include -#include "FAT12.h" -#include "Bios.h" - -#define FAT_LEN 0x1800 -#define FAT1_BASE 0x00001000 // FAT1 -#define FAT2_BASE 0x00002800 // FAT2 -#define ROOT_BASE 0x00004000 // -#define FILE_BASE 0x00008000 // -#define SEC_LEN 512 //length of a sector -> 512 Bytes -#define FAT1_SEC 0x0C // FAT1 Sector -#define FAT2_SEC 0x0C // FAT2 Sector - -#define OK 0 //Error codes -#define SEC_ERR 1 // -#define FAT_ERR 2 // -#define OVER 3 // -#define NEW 4 // -#define END 0xFFF // - -#define OW 0 // -#define RW 1 // - -/******************************************************************************* - Function: NextCluster - Description: - Input: - *******************************************************************************/ -u8 NextCluster(u16* pCluster) { - u16 FatNum; - u32 Addr = FAT1_BASE + (*pCluster + *pCluster / 2); - - *(pCluster + 1) = *pCluster; // ����ǰһ���غ� -// *(pCluster+1)= 0; - if ((*pCluster >= END) || (*pCluster < 2)) - return OK; - if (ReadDiskData((u8*) &FatNum, Addr, 2) != OK) - return SEC_ERR; - *pCluster = (*pCluster & 1) ? (FatNum >> 4) : (FatNum & 0x0FFF); // ָ����һ���غ� - return OK; -} -/******************************************************************************* - Function: ReadFileSec - Description: - Input: - *******************************************************************************/ -u8 ReadFileSec(u8* pBuffer, u16* pCluster) { - u32 ReadAddr = FILE_BASE + SEC_LEN * (*pCluster - 2); - //This code appears to read the data in two chunks of 256 bytes... - if (ReadDiskData(pBuffer, ReadAddr, 256) != OK) - return SEC_ERR; // - pBuffer += 256; - ReadAddr += 256; - if (ReadDiskData(pBuffer, ReadAddr, 256) != OK) - return SEC_ERR; // Failed to read the sector - if (NextCluster(pCluster) != 0) - return FAT_ERR; // - return OK; -} -/******************************************************************************* - Function: ProgFileSec - Description: - Input: - *******************************************************************************/ -u8 ProgFileSec(u8* pBuffer, u16* pCluster) { - u16 Tmp; - u32 ProgAddr = FILE_BASE + SEC_LEN * (*pCluster - 2); - - if (ProgDiskPage(pBuffer, ProgAddr) != OK) - return SEC_ERR; // - pBuffer += 256; - ProgAddr += 256; - if (ProgDiskPage(pBuffer, ProgAddr) != OK) - return SEC_ERR; // - Tmp = *pCluster; - switch (Tmp) { - case 0: - case 1: - if (SeekBlank(pBuffer, pCluster) != OK) - return OVER; - if (SetCluster(pBuffer, pCluster) != OK) - return SEC_ERR; - *(pCluster + 1) = Tmp; - return OK; - case END: - default: - if (NextCluster(pCluster) != OK) - return FAT_ERR; - return OK; - } -} -/******************************************************************************* - Function: SeekBlank - Description: - Input: - *******************************************************************************/ -u8 SeekBlank(u8* pBuffer, u16* pCluster) { - u16 Offset, Tmp, i, n = 0; - u32 SecAddr; - - for (i = 0; i < 4096; i++) { - Offset = i + i / 2; - if ((Offset % 256) == 0) { - SecAddr = FAT1_BASE + (Offset & (~0xFF)); - if (ReadDiskData(pBuffer, SecAddr, 258) != 0) - return SEC_ERR; - } - Offset %= 256; - Tmp = pBuffer[Offset] + (pBuffer[Offset + 1] << 8); - Tmp = (i & 1) ? (Tmp >> 4) : (Tmp & 0xFFF); - if (Tmp == 0) { - *pCluster++ = i; - n++; - if (n > 1) - return OK; - } - } - *(pCluster + 1) = 0xFFF; - return OK; -} -/******************************************************************************* - Function: - Description: - Input: - *******************************************************************************/ -u8 SetCluster(u8* pBuffer, u16* pCluster) { - u16 Offset, Tmp, i, k; - u32 SecAddr; - - i = *pCluster; // ��ȡԭ��ǰ�غ� - k = *(pCluster + 1); // ��ȡ��һ�غ� - *pCluster = k; - Offset = i + i / 2; - SecAddr = FAT1_BASE + (Offset & (~0xFF)); - Tmp = Offset & 0xFF; - if (ReadDiskData(pBuffer, SecAddr, 256) != 0) - return SEC_ERR; - if (i & 1) - pBuffer[Tmp] = ((k << 4) & 0xF0) + (pBuffer[Tmp] & 0x0F); - else - pBuffer[Tmp] = k; - if (Tmp++ < 256) { - if (i & 1) - pBuffer[Tmp] = k >> 4; - else - pBuffer[Tmp] = ((k >> 8) & 0x0F) + (pBuffer[Tmp] & 0xF0); - if (ProgDiskPage(pBuffer, SecAddr) != 0) - return SEC_ERR; - } else { - if (ProgDiskPage(pBuffer, SecAddr) != 0) - return SEC_ERR; - SecAddr += 256; - if (ReadDiskData(pBuffer, SecAddr, 256) != 0) - return SEC_ERR; - if (i & 1) - pBuffer[0] = k >> 4; - else - pBuffer[0] = ((k >> 8) & 0x0F) + (pBuffer[0] & 0xF0); - if (ProgDiskPage(pBuffer, SecAddr) != 0) - return SEC_ERR; - } - return OK; -} -/******************************************************************************* - Function: - Description: - Input: - *******************************************************************************/ -u8 FAT_SearchFile(u8* pBuffer, u8* pFileName, u16* pCluster, u32* pDirAddr, - u32* flag) { - u16 i, n; - - *pCluster = 0; - for (*pDirAddr = ROOT_BASE; *pDirAddr < FILE_BASE;) { - if (ReadDiskData(pBuffer, *pDirAddr, 256) != OK) - return SEC_ERR; - for (n = 0; n < 256; n += 32) { - for (i = 0; i < 4; i++) { - if (pBuffer[n + i] != 0) { - if (pBuffer[n + i] != pFileName[i]) - break; - if (i == 3) { // �ҵ��ļ��� - *pCluster = *(u16*) (pBuffer + n + 0x1A); // �ļ���һ���غ� - return OK; - } - } else - return NEW; // ������һ���հ�Ŀ¼��󷵻� - } - *pDirAddr += 32; - } - } - return OVER; -} - -/******************************************************************************* - Function:OpenFileRd - Description: Opens a file for reading from - Input: - *******************************************************************************/ -u8 OpenFileRd(u8* pBuffer, u8* pFileName, u16* pCluster, u32* pDirAddr) { - u16 i, n; - - *pCluster = 0; - for (*pDirAddr = ROOT_BASE; *pDirAddr < FILE_BASE;) { - if (ReadDiskData(pBuffer, *pDirAddr, 256) != OK) - return SEC_ERR; - for (n = 0; n < 256; n += 32) { - for (i = 0; i < 11; i++) { - if (pBuffer[n + i] != 0) { - if (pBuffer[n + i] != pFileName[i]) - break; - if (i == 10) { // �ҵ��ļ��� - *pCluster = *(u16*) (pBuffer + n + 0x1A); // �ļ���һ���غ� - return OK; - } - } else - return NEW; // ������һ���հ�Ŀ¼��󷵻� - } - *pDirAddr += 32; - } - } - return OVER; -} -/******************************************************************************* - Function: OpenFileWr - Description: Opens a file for writing to - Input: - *******************************************************************************/ -u8 OpenFileWr(u8* pBuffer, u8* pFileName, u16* pCluster, u32* pDirAddr) { - u16 i, n; - - i = OpenFileRd(pBuffer, pFileName, pCluster, pDirAddr); - if (i != NEW) - return i; - else { // ��ǰ��Ϊ�հ�Ŀ¼�� - if (SeekBlank(pBuffer, pCluster) != OK) - return OVER; // ��FAT�������� - n = *pDirAddr & 0xFF; // nΪ��ǰҳĿ¼�� - if (ReadDiskData(pBuffer, (*pDirAddr) - n, 256) != OK) - return SEC_ERR; - for (i = 0; i < 11; i++) - pBuffer[n + i] = pFileName[i]; // ������Ŀ¼�� - *(u16*) (pBuffer + n + 0x1A) = *pCluster; - if (ProgDiskPage(pBuffer, (*pDirAddr) - n) != OK) - return SEC_ERR; - return OK; - } -} -/******************************************************************************* - Function: CloseFile - Description: Closes a file that was previously opened - Input: - *******************************************************************************/ -u8 CloseFile(u8* pBuffer, u32 Lenght, u16* pCluster, u32* pDirAddr) { - u16 n; - -// *pCluster = *(pCluster+1); // ��ȡǰһ���غ� - *(pCluster + 1) = 0xFFF; - SetCluster(pBuffer, pCluster); - if (ReadDiskData(pBuffer, (*pDirAddr & (~0xFF)), 256) != OK) - return SEC_ERR; - *(u8*) (pBuffer + (*pDirAddr & 0xFF) + 0x0B) = 0x20; - *(u32*) (pBuffer + (*pDirAddr & 0xFF) + 0x1C) = Lenght; - if (ProgDiskPage(pBuffer, (*pDirAddr & (~0xFF))) != OK) - return SEC_ERR; - for (n = 0; n < FAT1_SEC; n++) { - if (ReadDiskData(pBuffer, FAT1_BASE + n * 256, 256) != OK) - return SEC_ERR; - if (ProgDiskPage(pBuffer, FAT2_BASE + n * 256) != OK) - return SEC_ERR; - } - return OK; -} -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/Analog.c b/workspace/ts100/src/Analog.c new file mode 100644 index 00000000..591d3e96 --- /dev/null +++ b/workspace/ts100/src/Analog.c @@ -0,0 +1,123 @@ +/* + * Analog.c + * + * Created on: 20 Sep 2016 + * Author: ralim + * Contains the functions related to reading and scaling the adc pins + * This is used for temperature and battery voltage sense + */ +#include "Analog.h" + +//Reads the dc input and returns it as X10 voltage (ie 236 = 23.6V) +//Seems unstable below 9.5V input +uint16_t readDCVoltage() { + uint16_t reading = 0; + for (u8 i = 0; i < 10; i++) { + reading += ADC_GetConversionValue(ADC2); + } + reading /= 144; //take the average and convert to X10 voltage + return reading; //return the read voltage +} + +//This reads the thermocouple in the tip +//This allows us to read it in X10 mode +//Returns temperature in C X10 mode +int16_t readTipTemp() { + static uint32_t rollingAverage[4]; + static uint8_t rIndex = 0; + + /*The head has a thermocouple inline with the heater + This is read by turning off the heater + Then read the output of the op-amp that is connected across the connections + */ + uint32_t ad_sum = 0; + uint32_t max = 0, min; + uint32_t ad_value, avg_data; + uint32_t timer = getIronTimer(); + setIronTimer(0); //set the remaining time to zero + HEAT_OFF(); //heater must be off + delayMs(5); //wait for the heater to time out + uint8_t gMeas_cnt = 9; //how many measurements to make + max = ad_sum = min = Get_ADC1Value(0); + + while (gMeas_cnt > 0) { + ad_value = Get_ADC1Value(0); + ad_sum += ad_value; + if (ad_value > max) + max = ad_value; + if (ad_value < min) + min = ad_value; + + gMeas_cnt--; + } + setIronTimer(timer); + ad_sum = ad_sum - max - min; //remove the two outliers + avg_data = ad_sum / 8; //take the average + rollingAverage[rIndex] = avg_data; + rIndex = (rIndex + 1) % 4; + return (rollingAverage[0] + rollingAverage[1] + rollingAverage[2] + + rollingAverage[3]) / 4; //get the average + +} + +/******************************************************************************* + Function: + Description:Reads the temperature of the on board temp sensor for calibration + http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf + Output: The onboardTemp in C X 10 + *******************************************************************************/ +int readSensorTemp(void) { + static uint32_t rollingAverage[4]; + static uint8_t rIndex = 0; + u32 ad_sum = 0; + u32 max, min; + u32 ad_value, avg_data, slide_data; + + u8 gMeas_cnt = 9; + ad_sum = min = max = Get_ADC1Value(1); + while (gMeas_cnt > 0) { + ad_value = Get_ADC1Value(1); + ad_sum += ad_value; + if (ad_value > max) + max = ad_value; + if (ad_value < min) + min = ad_value; + gMeas_cnt--; + } + ad_sum = ad_sum - max - min; + avg_data = ad_sum / 8; + //^ Removes the two outliers from the data spread + + rollingAverage[rIndex] = avg_data; //store this result + rIndex = (rIndex + 1) % 4; //move the index + slide_data = (rollingAverage[0] + rollingAverage[1] + rollingAverage[2] + + rollingAverage[3]) / 4; //get the average + return (250 + (3300 * slide_data / 4096) - 750); + //(25 + ((10*(33*gSlide_data)/4096)-75)); + //^ Convert the reading to C + +} + +volatile uint16_t ADC1ConvertedValue[2]; +//returns the latest reading from ADC1 that was buffered using DMA +uint16_t Get_ADC1Value(uint8_t i) { + return ADC1ConvertedValue[i]; +} +//This returns the calibrated temperature reading of the iron temp +//inputs : calibration value / wether to take a new reading or not +uint16_t readIronTemp(uint16_t calibration_temp, uint8_t read) { + static uint16_t calTemp = 0; + static uint16_t lastVal = 0; + + if (calibration_temp != 0) + calTemp = calibration_temp; + + if (read) { + lastVal = (readTipTemp() * 1000 + 806 * readSensorTemp() + - calTemp * 1000) / 806; + + } + + return lastVal; + +} diff --git a/workspace/ts100/src/Bios.c b/workspace/ts100/src/Bios.c index 8539a4f0..c81fc5a6 100644 --- a/workspace/ts100/src/Bios.c +++ b/workspace/ts100/src/Bios.c @@ -1,110 +1,17 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : Bios.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2015/07/07 ͳһ������ - *******************************************************************************/ +/* + * Setup all the basic hardware in the system and handle timer3 tick + */ -#include -#include -#include "APP_Version.h" #include "Bios.h" #include "I2C.h" -#include "CTRL.h" -/******************************************************************************/ + #define ADC1_DR_Address ((u32)0x4001244C) +volatile uint32_t gHeat_cnt = 0; -vu32 gTimeOut, gMs_timeout; -volatile u32 gTime[8]; //times for timer storage -//^-- gTime is automatically decremented on each firing of timer 2 if >0 -vu16 ADC1ConvertedValue[2]; -vu32 gHeat_cnt = 0; - -/******************************************************************************* - ������: Get_AdcValue - ��������:��ȡADC ת����Ķ��� - �������:ת�����AD - ���ز���:NULL - *******************************************************************************/ -u16 Get_AdcValue(u8 i) { - return ADC1ConvertedValue[i]; -} -/******************************************************************************* - ������: Set_HeatingTime - ��������:���ü���ʱ�� - �������:heating_time ����ʱ�� - ���ز���:NULL - *******************************************************************************/ -void Set_HeatingTime(u32 heating_time) { - gHeat_cnt = heating_time; -} -/******************************************************************************* - ������: Get_HeatingTime - ��������:��ȡ����ʱ�� - �������:NULL - ���ز���:����ʱ�� - *******************************************************************************/ -u32 Get_HeatingTime(void) { - return gHeat_cnt; -} -/******************************************************************************* -Function: -Description: Init the global count down timers - *******************************************************************************/ -void Init_Gtime(void) { - u8 i; - - for (i = 0; i < 8; i++) - gTime[i] = 0; -} - -/******************************************************************************* - ������: Delay_Ms - ��������:��ʱ���� - �������:��ʱ�ȴ��ĺ�����ֵ - ���ز���:NULL - *******************************************************************************/ -void Delay_Ms(u32 ms) { - gMs_timeout = ms * 20; - while (gMs_timeout) - ; // {if(Scan_key()!=0)break;} -} -/******************************************************************************* - ������: Delay_HalfMs - ��������:ÿ��λΪ0.5�������ʱ���� - �������:��ʱ�ȴ���0.5������ - ���ز���:NULL - *******************************************************************************/ -void Delay_HalfMs(u32 ms) { - gMs_timeout = ms * 10; - while (gMs_timeout) - ; // {if(Scan_key()!=0)break;} -} - -/******************************************************************************* - Function: USB_Port - Description: Enables or disables the usb pins - Input: state == ENABLE or DISABLE - *******************************************************************************/ -void USB_Port(u8 state) { - USB_DN_LOW(); - USB_DP_LOW(); - if (state == DISABLE) { - USB_DN_OUT(); - USB_DP_OUT(); - } else { - USB_DN_EN(); - USB_DP_EN(); - } -} -/******************************************************************************* - Function:RCC_Config - Description:Setup the system clocks to use internal HSE to run the system at 48Mhz - *******************************************************************************/ +/* + * Setup system clocks to run off internal oscillator at 48Mhz + */ void RCC_Config(void) { RCC_DeInit(); FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable); @@ -123,90 +30,77 @@ void RCC_Config(void) { RCC_AHBPeriphClockCmd( RCC_AHBPeriph_SRAM | RCC_AHBPeriph_DMA1 | RCC_AHBPeriph_DMA2 | - RCC_AHBPeriph_FLITF, // Enable DMA1 clock ??? - ENABLE); + RCC_AHBPeriph_FLITF, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | - RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2, //| RCC_APB2Periph_ADC3, //RCC_APB2Periph_TIM1, - ENABLE); + RCC_APB2Periph_ADC1 | RCC_APB2Periph_ADC2, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3, ENABLE); RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_Div1); // USBCLK = 48MHz -} -/******************************************************************************* - Function: NVIC_Config - Description: Configures the NVIC table in the hardware - Input: (tab_offset) the table offset for the NVIC - *******************************************************************************/ -void NVIC_Config(u16 tab_offset) { - NVIC_InitTypeDef NVIC_InitStructure; + RCC_ClocksTypeDef RCC_Clocks; + RCC_GetClocksFreq(&RCC_Clocks); + SysTick_Config(RCC_Clocks.HCLK_Frequency / 1000); //Enable the systick timer at 1ms +} +/* + * Shift the NVIC (Interrupt table) location relative to flash start + */ +void NVIC_Config(u16 tab_offset) { NVIC_SetVectorTable(NVIC_VectTab_FLASH, tab_offset); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); - NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); } -/******************************************************************************* - Function:GPIO_Config - Description: Configures all the GPIO into required states - *******************************************************************************/ +/* + * Setup the GPIO + */ void GPIO_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE); // GPIOB & AFIO - GPIOA_OUTPUT() - ; - GPIOA_L_DEF() - ; - GPIOA_H_DEF() - ; + GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE); + GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE); - GPIOB_OUTPUT() - ; - GPIOB_L_DEF() - ; - GPIOB_H_DEF() - ; - -//------ PA7 TMP36 Analog input ----------------------------------------// + //------ PA7 TMP36 Analog input ----------------------------------------// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOA, &GPIO_InitStructure); -//------ OLED_RST_PIN(PB9) ------------------------------------------------------------// + //------ OLED_RST_PIN(PB9) ---------------------------------------------// GPIO_InitStructure.GPIO_Pin = OLED_RST_PIN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; - GPIO_Init(GPIOB, &GPIO_InitStructure); + GPIO_Init(GPIOA, &GPIO_InitStructure); -//------- Heat_Pin - Iron enable output PB4--------------------------------------------------------// - GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE); //Disable PB4=JNTRST + //------- Heat_Pin - Iron enable output PB4-----------------------------// GPIO_InitStructure.GPIO_Pin = HEAT_PIN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOB, &GPIO_InitStructure); -//------ PB0 Iron temp input---------------------------------------// + //----------- PB0 Iron temp input---------------------------------------// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOB, &GPIO_InitStructure); -//---------- INPUT Voltage Detection Pin VB PB1(Ai9) ---------------------------------------// + //---------- INPUT Voltage Detection Pin VB PB1(Ai9) -------------------// GPIO_InitStructure.GPIO_Pin = VB_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOB, &GPIO_InitStructure); -//-------- K1 = PA9, K2 = PA6 ----------------------------------------------------------// + //-------- K1 = PA9, K2 = PA6 ------------------------------------------// GPIO_InitStructure.GPIO_Pin = KEY1_PIN | KEY2_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_Init(GPIOA, &GPIO_InitStructure); + + //--------INT 1 == PB5 -------------------------------------------------// + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;//pullup just in case something resets the accel + GPIO_Init(GPIOB, &GPIO_InitStructure); + } -/******************************************************************************* - Function: Adc_Init - Description:Enable the ADC's and setup the DMA as well to automatically read them to system ram. - *******************************************************************************/ +/* + * Init the ADC's + * Setup ADC1 to read via DMA to device ram automatically + */ void Adc_Init(void) { u32 timeout = 10 * 0x1000; ADC_InitTypeDef ADC_InitStructure; @@ -220,7 +114,8 @@ void Adc_Init(void) { DMA_InitStructure.DMA_BufferSize = 2; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; - DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; + DMA_InitStructure.DMA_PeripheralDataSize = + DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_High; @@ -250,9 +145,12 @@ void Adc_Init(void) { ADC_Init(ADC2, &ADC_InitStructure); // ADC1,2 regular channel7 channel9 and channel8 configuration ----------// - ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2, ADC_SampleTime_239Cycles5); //28 or 55 - ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_239Cycles5); //28 or 55 - ADC_RegularChannelConfig(ADC2, ADC_Channel_9, 1, ADC_SampleTime_55Cycles5); //28 or 55 + ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2, + ADC_SampleTime_239Cycles5); //28 or 55 + ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 1, + ADC_SampleTime_239Cycles5); //28 or 55 + ADC_RegularChannelConfig(ADC2, ADC_Channel_9, 1, + ADC_SampleTime_55Cycles5); //28 or 55 /* Enable ADC1 DMA */ ADC_DMACmd(ADC1, ENABLE); @@ -275,43 +173,19 @@ void Adc_Init(void) { ADC_SoftwareStartConvCmd(ADC2, ENABLE); } -/******************************************************************************* - Function: - Description: Setup Timer2 to fire every 10ms - *******************************************************************************/ -void Init_Timer2(void) { - NVIC_InitTypeDef NVIC_InitStructure; - TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; - - NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0); - - TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; // (48MHz)/48 = 1MHz - TIM_TimeBaseStructure.TIM_Period = 10000 - 1; // Interrupt per 10mS - TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; - TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; - TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure); - TIM_ARRPreloadConfig(TIM2, ENABLE); - TIM_ITConfig(TIM2, TIM_IT_Update, ENABLE); - TIM_Cmd(TIM2, ENABLE); - - NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); -} -/******************************************************************************* -Function: -Description: Init Timer3 to fire every 50us to be used to control the irons software PWM - *******************************************************************************/ +/* + * Init Timer3 to fire every 50us to be used to control the irons software PWM + * This needs to be really fast as there is a cap used between this and the driver circuitry + * That prevents a stuck mcu heating the tip + */ void Init_Timer3(void) { NVIC_InitTypeDef NVIC_InitStructure; TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0); - TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; //(48MHz)/48 = 1MHz - TIM_TimeBaseStructure.TIM_Period = 50 - 1; // Interrupt per 50us + TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; //(48MHz)/48 = 1MHz + TIM_TimeBaseStructure.TIM_Period = 50 - 1; // Interrupt per 50us TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV2; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); @@ -325,50 +199,74 @@ void Init_Timer3(void) { NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); } -/******************************************************************************* - Function:TIM2_ISR - Description:Handles Timer 2 tick. (10mS) - Automatically decrements all >0 values in gTime. - Also reads the buttons every 4 ticks - *******************************************************************************/ -void TIM2_ISR(void) { - static u8 buttonReadDivider; +//We want to enable the EXTI IRQ for the two buttons on PA6 and PA9 +void Init_EXTI(void) { + EXTI_InitTypeDef EXTI_InitStructure; + NVIC_InitTypeDef NVIC_InitStructure; - TIM_ClearITPendingBit(TIM2, TIM_IT_Update); // Clear interrupt flag - for (u8 i = 0; i < 8; i++) - if (gTime[i] > 0) - gTime[i]--; + GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, + GPIO_PinSource6 | GPIO_PinSource9); + + GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, + GPIO_PinSource5); //PB5 == accelerometer + + /* Configure EXTI5/6/9 line */ + EXTI_InitStructure.EXTI_Line = EXTI_Line5 | EXTI_Line6 | EXTI_Line9; + EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; + EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling; //trigger on up and down + EXTI_InitStructure.EXTI_LineCmd = ENABLE; + EXTI_Init(&EXTI_InitStructure); + + /* Enable and set EXTI9_5 Interrupt to the lowest priority */ + NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn; + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; + NVIC_Init(&NVIC_InitStructure); - if (++buttonReadDivider % 4 == 0) - Scan_Key(); } -/******************************************************************************* - Function: TIM3_ISR - Description:Sets the output pin as appropriate - If the Heat_cnt >0 then heater on, otherwise off. - *******************************************************************************/ +//Start the system watchdog with a timeout specified +//Note you cannot turn this off once you turn it on +void Start_Watchdog(uint32_t ms) { + IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); + + /* IWDG counter clock: 40KHz(LSI) / 32 = 1.25 KHz (min:0.8ms -- max:3276.8ms */ + IWDG_SetPrescaler(IWDG_Prescaler_32); + + /* Set counter reload value to XXms */ + IWDG_SetReload(ms * 10 / 8); + + /* Reload IWDG counter */ + IWDG_ReloadCounter(); + + /* Enable IWDG (the LSI oscillator will be enabled by hardware) */ + IWDG_Enable(); +} + +//Reset the system watchdog +void Clear_Watchdog(void) { + IWDG_ReloadCounter(); +} + +//TIM3_ISR handles the tick of the timer 3 IRQ void TIM3_ISR(void) { volatile static u8 heat_flag = 0; + //heat flag == used to make the pin toggle + //As the output is passed through a cap, the iron is on whilever we provide a square wave drive output - TIM_ClearITPendingBit(TIM3, TIM_IT_Update); // Clear interrupt flag - - if (gTimeOut > 0) - gTimeOut--; - if (gMs_timeout > 0) - gMs_timeout--; + TIM_ClearITPendingBit(TIM3, TIM_IT_Update); + // Clear interrupt flag if (gHeat_cnt > 0) { - gHeat_cnt--; + --gHeat_cnt; if (heat_flag) - HEAT_OFF(); + HEAT_OFF(); //write the pin off else - HEAT_ON(); - - heat_flag = ~heat_flag; - } - if (gHeat_cnt == 0) { - HEAT_OFF(); + HEAT_ON(); //write the pin on + heat_flag = !heat_flag; + } else { + HEAT_OFF(); //set the pin low for measurements heat_flag = 0; } + } -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/CTRL.c b/workspace/ts100/src/CTRL.c deleted file mode 100644 index 9714b789..00000000 --- a/workspace/ts100/src/CTRL.c +++ /dev/null @@ -1,450 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : CTRL.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/08/03 - History: - 2015/07/07 ͳһ������ - 2015/08/03 �Ż��ƶ��ж� - *******************************************************************************/ -#include -#include -#include "CTRL.h" -#include "Bios.h" -#include "UI.h" -#include "Hardware.h" -#include "S100V0_1.h" -#include "Disk.h" -#include "MMA8652FC.h" - -#define HEATINGCYCLE 30 -/******************************************************************************/ -DEVICE_INFO_SYS device_info; -/******************************************************************************/ - -u8 gCtrl_status = 1; -//^ System current status / operating mode. -u16 gHt_flag = 0; -vs16 gTemp_data = 250; // -s16 gPrev_temp = 250; // -u8 gIs_restartkey = 0; // -u8 gPre_status = 1; // - -const DEVICE_INFO_SYS info_def = { "2.13", //Ver - 2000, //T_Standby; // 200C=1800 2520 - 3000, // T_Work; // 350C=3362, - 100, //T_Step; - 3 * 60 * 100, //Wait_Time; //3*60*100 3 minutes - 6 * 60 * 100 // Idle_Time; //6*60*100 6 minutes -}; -struct _pid { - s16 settemp; //Current ideal setpoint for the temp - s16 actualtemp; //Actual current temp of the tip - s16 err; //Error term - s16 err_last; //last error term - s32 ht_time; // - u16 kp, ki, kd; //Constants for the PID Controller - s32 integral; // -} pid; - -/******************************************************************************* - Function: Get_Ctrl_Status - Description: Returns the current operating Mode - Input:Void - Output:Current System Status - *******************************************************************************/ -u8 Get_CtrlStatus(void) { - return gCtrl_status; -} -/******************************************************************************* - Function: Set_CtrlStatus - Description: Set the current operating Mode - Input:status uint8_t - Output:Void - *******************************************************************************/ -void Set_CtrlStatus(u8 status) { - gCtrl_status = status; -} -/******************************************************************************* - Function: Set_PrevTemp - Description:Set the previous temp record for the PID - Input:Previous Temp (int16_t) - Output:Void - *******************************************************************************/ -void Set_PrevTemp(s16 temp) { - gPrev_temp = temp; -} - -/******************************************************************************* - Function: Get_HtFlag - Description: - Input:Void - Output:Void - - *******************************************************************************/ -u16 Get_HtFlag(void) { - return gHt_flag; -} -/******************************************************************************* - Function:Get_TempVal - Description: - Input:Void - Output:Void - *******************************************************************************/ -s16 Get_TempVal(void) { - return gTemp_data; -} - -/******************************************************************************* - Function:System_Init - Description:Init the device info to be a known start value (as defined at top of CTRL.c) - Input:Void - Output:Void - *******************************************************************************/ -void System_Init(void) { - memcpy((void*) &device_info, (void*) &info_def, sizeof(device_info)); -} -/******************************************************************************* - Function:Pid_Init - Description:Inits the PID values to defaults (0 usually) - Input:Void - Output:Void - *******************************************************************************/ -void Pid_Init(void) { - pid.settemp = 0; - pid.actualtemp = 0; - pid.err = 0; - pid.err_last = 0; - pid.integral = 0; - pid.ht_time = 0; - pid.kp = 15; - pid.ki = 2; - pid.kd = 1; -} - -/******************************************************************************* - Function:Pid_Realize - Description: Calculates the next heating value using the PID algorithum - Input:Current temp from the tip - Output: - *******************************************************************************/ -u16 Pid_Realize(s16 temp) { - u8 index = 0, index1 = 1; - s16 d_err = 0; - - pid.actualtemp = temp; - pid.err = pid.settemp - pid.actualtemp; // - - if (pid.err >= 500) - index = 0; - else { - index = 1; - pid.integral += pid.err; // - } -//////////////////////////////////////////////////////////////////////////////// -// - if (pid.settemp < pid.actualtemp) { - d_err = pid.actualtemp - pid.settemp; - if (d_err > 20) { - pid.integral = 0; // - index1 = 0; - index = 0; - } - } -//////////////////////////////////////////////////////////////////////////////// - if (pid.err <= 30) - index1 = 0; - else - index1 = 1; - pid.ht_time = pid.kp * pid.err + pid.ki * index * pid.integral - + pid.kd * (pid.err - pid.err_last) * index1; - pid.err_last = pid.err; - - if (pid.ht_time <= 0) - pid.ht_time = 0; - else if (pid.ht_time > 30 * 200) - pid.ht_time = 30 * 200; - - return pid.ht_time; - -} - -/******************************************************************************* - Function:Heating_Time - Description:Calcuates the on time for the heating element - Input: (temp) current Tip Temp, (wk_temp) current ideal setpoint temp - Output: The ON time for the heater element - *******************************************************************************/ -u32 Heating_Time(s16 temp, s16 wk_temp) { - u32 heat_timecnt; - - pid.settemp = wk_temp; - if (wk_temp > temp) { - if (wk_temp - temp >= 18) - gHt_flag = 0; //���� - else - gHt_flag = 2; //���� - } else { - if (temp - wk_temp <= 18) - gHt_flag = 2; //���� - else - gHt_flag = 1; //���� - } - - heat_timecnt = Pid_Realize(temp); //Sub_data * 1000; - - return heat_timecnt; -} -/******************************************************************************* - Function:Status_Tran - Description: Handles the current status of the unit, and task selection - Basically this is called in main() repeatedly - Input:Void - Output:Void - *******************************************************************************/ -void Status_Tran(void) // -{ - static u16 init_waitingtime = 0; //��ʼ����ʱ���־λ: 0=> δ��ʼ��,1=>�ѳ�ʼ�� - static u8 back_prestatus = 0; - s16 heat_timecnt = 0, wk_temp; - u16 mma_active; - - switch (Get_CtrlStatus()) { - case IDLE: - switch (Get_gKey()) { //Read current switch positions - case KEY_V1: //If V1 key is pressed - if (gIs_restartkey != 1) { //check we are not in a soft restart situation - if (Read_Vb(1) < 4) { //Read that the input voltage is acceptable?? - Set_CtrlStatus(TEMP_CTR); //Set to temperature controlled mode (Aka soldering mode) - init_waitingtime = 0; //Initialize the wait count to 0 - TEMPSHOW_TIMER= 0; //Initialize the timer to 0 - UI_TIMER= 0; - G6_TIMER= 0; - } - } - break; - case KEY_V2: //check if V2 key is pressed - if(gIs_restartkey != 1) { //check this is not a soft restart situation - Set_CtrlStatus(THERMOMETER);//Change system to Thermometer mode instead (ie reading temp only, no drive) - UI_TIMER = 0; - Set_LongKeyFlag(1);//Set the long key pressed flag?? - } - break; - case KEY_CN|KEY_V3: //If A&B pressed at the same time, no action - break; - } - if(gIs_restartkey && (KD_TIMER == 0)) { //This is a soft restart situation instead - gIs_restartkey = 0;//reset the flag for soft restart - Set_gKey(NO_KEY);//reset keys pressed - } - if(Read_Vb(1) == 0) { //Invalid voltage, I think this means no input power detected - if(Get_UpdataFlag() == 1) Set_UpdataFlag(0); - Set_CtrlStatus(ALARM); - } - if(gPre_status != WAIT && gPre_status != IDLE) { //System has been left alone, turn off screen to stop burn in - G6_TIMER = device_info.idle_time; - Set_gKey(NO_KEY); - gPre_status = IDLE; - } - break; - case TEMP_CTR: //We are in soldering mode - switch(Get_gKey()) { //switch on the pressed key - case KEY_CN|KEY_V1: - case KEY_CN|KEY_V2://if either key long pressed - Set_HeatingTime(0);//turn off heater - Set_CtrlStatus(TEMP_SET);//Goto temperature set mode - HEATING_TIMER = 0;//reset heating timer - EFFECTIVE_KEY_TIMER = 500; - break; - case KEY_CN|KEY_V3://Both keys pressed - Set_HeatingTime(0);//Stop the heater - Set_LongKeyFlag(0);//Reset the long key press flag - Set_CtrlStatus(IDLE);//Change the system back to IDLE state (stop soldering) - gPre_status = TEMP_CTR;//Set previous status - gIs_restartkey = 1; - KD_TIMER = 50;// - break; - } - - if(Read_Vb(1) >= 4) { //Check input voltage is in the acceptable range - Set_HeatingTime(0);//Turn of heater as we are out of range - Set_LongKeyFlag(0);//reset key flag - Set_CtrlStatus(IDLE);//reset to IDLE state - gPre_status = TEMP_CTR;//set previous state - gIs_restartkey = 1; - KD_TIMER = 50;// - } - - wk_temp = device_info.t_work; //update setpoint temp from the struct - if(HEATING_TIMER == 0) { - gTemp_data = Get_Temp(wk_temp); - heat_timecnt = Heating_Time(gTemp_data,wk_temp); //Calculate the on time for the heating cycle - Set_HeatingTime(heat_timecnt);//set the on time for the heating cycle - HEATING_TIMER = HEATINGCYCLE; - } - - if(Get_HeatingTime() == 0) { //If calcuated heater time is 0 stop the timer ? - HEATING_TIMER = 0; - } - - /* - * The logic here is : - * If the device is moving then disarm the timer and mark it as needed a re-init - * else check if the timer needs init, if it does set it up and exit - * if the timer does not need init, then check if the timer has expired (its a count down) - * If the timer has expired goto wait state instead and shutdown iron - */ - mma_active = Get_MmaShift(); //check the accelerometer for movement - if(mma_active == 0) { //MMA_active = 0 ==> static ,MMA_active = 1 ==>move - if(init_waitingtime == 0) { //If the waiting countdown timer is not initialized - init_waitingtime = 1;//we initialize it and set this <- flag. - ENTER_WAIT_TIMER = device_info.wait_time; - } - if((init_waitingtime != 0) && (ENTER_WAIT_TIMER == 0)) { //if timeout has been initalized and enter_wait_timer has reached 0 - gHt_flag = 0;//reset heating flags - UI_TIMER = 0;//reset ui timers - Set_HeatingTime(0);//turn off the soldering iron - Set_gKey(0);//clear keys - G6_TIMER = device_info.idle_time;//set the device to idle timer move - Set_CtrlStatus(WAIT);//Set system mode to waiting for movement - } - } else { //The iron is moving - init_waitingtime = 0;//mark the waiting timer for needing reset if movement stops again - } - - if(Get_AlarmType() > NORMAL_TEMP) { // - if(Get_UpdataFlag() == 1) Set_UpdataFlag(0); - Set_CtrlStatus(ALARM);//Change to alarm state - } - break; - - case WAIT: - //This mode (WAIT) occures when the iron has been idling on a desk for too long (ie someone forgot it was left on) - //In this state we drop to a lower, safer temp and wait for movement or button push to wake up to operating temp again - wk_temp = device_info.t_standby; - if(device_info.t_standby > device_info.t_work) { - //Check if the set temp was greater than the idle temp, if it was we set the idle temp to the set temp - //This is done to avoid standby going to a higher temp - wk_temp = device_info.t_work; - } - //if the heating timer has expired, update the readings - if(HEATING_TIMER == 0) { - gTemp_data = Get_Temp(wk_temp); //read the tip temp - heat_timecnt = Heating_Time(gTemp_data,wk_temp);//calculate the new heating timer value from temps - Set_HeatingTime(heat_timecnt);//apply the new heating timer - HEATING_TIMER = 30;//set update rate for heating_timer - } - - if(Read_Vb(1) >= 4) { //If the input voltage is not valid - Set_HeatingTime(0);//turn off heater - Set_LongKeyFlag(0);//reset key press flag - Set_CtrlStatus(IDLE);//goto IDLE state - G6_TIMER = device_info.idle_time; - gPre_status = WAIT;//set previous state - gIs_restartkey = 1; - KD_TIMER = 50;// - } - - if(G6_TIMER == 0) { // - Set_HeatingTime(0); - Set_LongKeyFlag(0); - gIs_restartkey = 1; - KD_TIMER = 200;// - gPre_status = WAIT; - Set_CtrlStatus(IDLE); - } - - //If movement has occurred OR a key has been pressed -> Wakeup back to soldering - mma_active = Get_MmaShift();//read accelerometer - if(mma_active == 1 || Get_gKey() != 0) { - UI_TIMER = 0; //reset the un-needed timers - G6_TIMER = 0; - init_waitingtime = 0; - Set_CtrlStatus(TEMP_CTR);//Go back to soldering iron mode - } - - if(Get_AlarmType() > NORMAL_TEMP) { //If an alarm has occurred?? - if(Get_UpdataFlag() == 1) Set_UpdataFlag(0); - Set_CtrlStatus(ALARM);//goto alarm error state - } - break; - - case TEMP_SET: //We are in the setting soldering iron temp mode - if(EFFECTIVE_KEY_TIMER == 0) { - gCalib_flag = 1; - Disk_BuffInit(); - Config_Analysis(); // - gCalib_flag = 0; - Set_CtrlStatus(TEMP_CTR);//return to soldering mode - TEMPSHOW_TIMER = 0;//turn off the timer - } - break; - - case THERMOMETER: //we are measuring the tip temp without applying any power - if(KD_TIMER > 0) { - Set_gKey(NO_KEY); - break; - } - - switch(Get_gKey()) { - case KEY_CN|KEY_V1: - case KEY_CN|KEY_V2: - back_prestatus = 1; - break; - case KEY_CN|KEY_V3: - Zero_Calibration(); //Calibrate the temperature (i think??) - if(Get_CalFlag() == 1) { - Disk_BuffInit(); - Config_Analysis(); // ��������U�� - } - KD_TIMER = 200; //20150717 �޸� - break; - default: - break; - } - if(back_prestatus == 1) { //we are exiting - back_prestatus = 0;//clear flag - Set_HeatingTime(0);//turn off heater? (not sure why this is done again) - Set_CtrlStatus(IDLE);//Goto IDLE state - gPre_status = THERMOMETER;//set previous state - gIs_restartkey = 1;//signal soft restart required as we may have done a calibration - Set_LongKeyFlag(0);//reset long key hold flag - KD_TIMER = 50;// - } - break; - case ALARM: //An error has occured so we are in alarm state - switch(Get_AlarmType()) { - case HIGH_TEMP: //over temp condition - case SEN_ERR://sensor reading error - wk_temp = device_info.t_work; - gTemp_data = Get_Temp(wk_temp); - if(Get_AlarmType() == NORMAL_TEMP) { - Set_CtrlStatus(TEMP_CTR); - Set_UpdataFlag(0); - } - break; - case HIGH_VOLTAGE: //over voltage - case LOW_VOLTAGE://under voltage - if(Read_Vb(1) >= 1 && Read_Vb(1) <= 3) { - Set_HeatingTime(0); //turn off heater - Set_LongKeyFlag(0);//reset key flag - gIs_restartkey = 1; - UI_TIMER = 2;// 2�� - gPre_status = THERMOMETER; - Set_CtrlStatus(IDLE); - } - break; - } -//V-- No idea what this does yet.. At all.. since it will always be skipped.. - if(Get_HeatingTime != 0) { - Set_HeatingTime(0); //����ֹͣ���� - HEAT_OFF(); - } - break; - default: - break; - } -} - -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/Disk.c b/workspace/ts100/src/Disk.c deleted file mode 100644 index 7154226f..00000000 --- a/workspace/ts100/src/Disk.c +++ /dev/null @@ -1,773 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : Disk.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2016/09/13 Ben V. Brown English notation/comments - 2015/07/07 - *******************************************************************************/ -#include -#include -#include "APP_Version.h" -#include "Disk.h" -#include "Bios.h" -#include "Flash.h" -#include "Oled.h" -#include "UI.h" -#include "CTRL.h" -#include "Hardware.h" - -#define Delay_mS Delay_Ms -void Disk_SecWrite(u8* pBuffer, u32 DiskAddr); -void Disk_SecRead(u8* pBuffer, u32 DiskAddr); -void Soft_Delay(void); -//Hard coded boot sector for the virtual device -const uint8_t BOOT_SEC[512] = { 0xEB, 0x3C, 0x90, 0x4D, 0x53, 0x44, 0x4F, 0x53, - 0x35, 0x2E, 0x30, 0x00, 0x02, 0x01, 0x08, 0x00, 0x02, 0x00, 0x02, 0x50, - 0x00, 0xF8, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0xA2, 0x98, 0xE4, 0x6C, 0x4E, - 0x4F, 0x20, 0x4E, 0x41, 0x4D, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, - 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x33, 0xC9, 0x8E, 0xD1, 0xBC, 0xF0, - 0x7B, 0x8E, 0xD9, 0xB8, 0x00, 0x20, 0x8E, 0xC0, 0xFC, 0xBD, 0x00, 0x7C, - 0x38, 0x4E, 0x24, 0x7D, 0x24, 0x8B, 0xC1, 0x99, 0xE8, 0x3C, 0x01, 0x72, - 0x1C, 0x83, 0xEB, 0x3A, 0x66, 0xA1, 0x1C, 0x7C, 0x26, 0x66, 0x3B, 0x07, - 0x26, 0x8A, 0x57, 0xFC, 0x75, 0x06, 0x80, 0xCA, 0x02, 0x88, 0x56, 0x02, - 0x80, 0xC3, 0x10, 0x73, 0xEB, 0x33, 0xC9, 0x8A, 0x46, 0x10, 0x98, 0xF7, - 0x66, 0x16, 0x03, 0x46, 0x1C, 0x13, 0x56, 0x1E, 0x03, 0x46, 0x0E, 0x13, - 0xD1, 0x8B, 0x76, 0x11, 0x60, 0x89, 0x46, 0xFC, 0x89, 0x56, 0xFE, 0xB8, - 0x20, 0x00, 0xF7, 0xE6, 0x8B, 0x5E, 0x0B, 0x03, 0xC3, 0x48, 0xF7, 0xF3, - 0x01, 0x46, 0xFC, 0x11, 0x4E, 0xFE, 0x61, 0xBF, 0x00, 0x00, 0xE8, 0xE6, - 0x00, 0x72, 0x39, 0x26, 0x38, 0x2D, 0x74, 0x17, 0x60, 0xB1, 0x0B, 0xBE, - 0xA1, 0x7D, 0xF3, 0xA6, 0x61, 0x74, 0x32, 0x4E, 0x74, 0x09, 0x83, 0xC7, - 0x20, 0x3B, 0xFB, 0x72, 0xE6, 0xEB, 0xDC, 0xA0, 0xFB, 0x7D, 0xB4, 0x7D, - 0x8B, 0xF0, 0xAC, 0x98, 0x40, 0x74, 0x0C, 0x48, 0x74, 0x13, 0xB4, 0x0E, - 0xBB, 0x07, 0x00, 0xCD, 0x10, 0xEB, 0xEF, 0xA0, 0xFD, 0x7D, 0xEB, 0xE6, - 0xA0, 0xFC, 0x7D, 0xEB, 0xE1, 0xCD, 0x16, 0xCD, 0x19, 0x26, 0x8B, 0x55, - 0x1A, 0x52, 0xB0, 0x01, 0xBB, 0x00, 0x00, 0xE8, 0x3B, 0x00, 0x72, 0xE8, - 0x5B, 0x8A, 0x56, 0x24, 0xBE, 0x0B, 0x7C, 0x8B, 0xFC, 0xC7, 0x46, 0xF0, - 0x3D, 0x7D, 0xC7, 0x46, 0xF4, 0x29, 0x7D, 0x8C, 0xD9, 0x89, 0x4E, 0xF2, - 0x89, 0x4E, 0xF6, 0xC6, 0x06, 0x96, 0x7D, 0xCB, 0xEA, 0x03, 0x00, 0x00, - 0x20, 0x0F, 0xB6, 0xC8, 0x66, 0x8B, 0x46, 0xF8, 0x66, 0x03, 0x46, 0x1C, - 0x66, 0x8B, 0xD0, 0x66, 0xC1, 0xEA, 0x10, 0xEB, 0x5E, 0x0F, 0xB6, 0xC8, - 0x4A, 0x4A, 0x8A, 0x46, 0x0D, 0x32, 0xE4, 0xF7, 0xE2, 0x03, 0x46, 0xFC, - 0x13, 0x56, 0xFE, 0xEB, 0x4A, 0x52, 0x50, 0x06, 0x53, 0x6A, 0x01, 0x6A, - 0x10, 0x91, 0x8B, 0x46, 0x18, 0x96, 0x92, 0x33, 0xD2, 0xF7, 0xF6, 0x91, - 0xF7, 0xF6, 0x42, 0x87, 0xCA, 0xF7, 0x76, 0x1A, 0x8A, 0xF2, 0x8A, 0xE8, - 0xC0, 0xCC, 0x02, 0x0A, 0xCC, 0xB8, 0x01, 0x02, 0x80, 0x7E, 0x02, 0x0E, - 0x75, 0x04, 0xB4, 0x42, 0x8B, 0xF4, 0x8A, 0x56, 0x24, 0xCD, 0x13, 0x61, - 0x61, 0x72, 0x0B, 0x40, 0x75, 0x01, 0x42, 0x03, 0x5E, 0x0B, 0x49, 0x75, - 0x06, 0xF8, 0xC3, 0x41, 0xBB, 0x00, 0x00, 0x60, 0x66, 0x6A, 0x00, 0xEB, - 0xB0, 0x4E, 0x54, 0x4C, 0x44, 0x52, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x0D, 0x0A, 0x52, 0x65, 0x6D, 0x6F, 0x76, 0x65, 0x20, 0x64, 0x69, 0x73, - 0x6B, 0x73, 0x20, 0x6F, 0x72, 0x20, 0x6F, 0x74, 0x68, 0x65, 0x72, 0x20, - 0x6D, 0x65, 0x64, 0x69, 0x61, 0x2E, 0xFF, 0x0D, 0x0A, 0x44, 0x69, 0x73, - 0x6B, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72, 0xFF, 0x0D, 0x0A, 0x50, 0x72, - 0x65, 0x73, 0x73, 0x20, 0x61, 0x6E, 0x79, 0x20, 0x6B, 0x65, 0x79, 0x20, - 0x74, 0x6F, 0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0D, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0xCB, 0xD8, 0x55, 0xAA }; - -static u8 gDisk_buff[0x2600]; //RAM Buffer used to implement the virtual disk -static u32 gDisk_var[(512 + 32 + 28) / 4]; // -static u32 *gV32 = (u32*) &gDisk_var[512 / 4]; -static u8 *gVar = (u8*) &gDisk_var[512 / 4 + 8]; - -static u8 *gBuff = (u8*) &gDisk_var[0]; -const u8 gFat_data[] = { 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; //{0xF8,0XFF,0XFF,0xff,0X0f};// -//The options -const char *gKey_words[] = { "T_Standby", "T_Work", "Wait_Time", "Idle_Time", - "T_Step", "Turn_Off_v", "TempShowFlag", "ZeroP_Ad" }; -//default settings -const char *gDef_set[] = { "T_Standby=200", "T_Work=300", "Wait_Time=180", - "Idle_Time=360", "T_Step=10", "Turn_Off_v=10", "TempShowFlag=0", - "ZeroP_Ad=239" }; -//comments for accepted range -const char *gSet_range[] = { " #(100~400)\r\n", " #(100~400)\r\n", - " #(60~9999)\r\n", " #(300~9999)\r\n", " #(5~25)\r\n", - " #(9~12)\r\n", " #(0,1)\r\n", " #ReadOnly\r\n" }; - -static u8 gFile_con[512]; //file contents buffer -#define CONFIG_CONT 8 /*Number of variables in config.txt*/ -u8 gRewriteflag[16]; //This flags if this sector has changed and needs to be written to flash - -#define ROW_CONT 35 -#define FILE_CONT 254 -/******************************************************************************* - Function: Soft_Delay() - Description: Small software delay. - *******************************************************************************/ -void Soft_Delay() { - int i, j; - for (i = 0; i < 1000; i++) - for (j = 0; j < 100; j++) - ; -} -/******************************************************************************* - Function: Set_Ver - Description: - Input: - *******************************************************************************/ -void Set_Ver(u8 str[], u8 k) { - s16 set_ver = 0; - - switch (k) { - case 0: - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - device_info.t_standby = set_ver * 10; - break; - case 1: - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - if (!gCalib_flag) - device_info.t_work = set_ver * 10; - break; - case 2: - if (str[3] <= '9' && str[3] >= '0') { //4 - set_ver = (str[0] - 48) * 1000 + (str[1] - 48) * 100 - + (str[2] - 48) * 10 + (str[3] - 48); - } else if (str[2] <= '9' && str[2] >= '0') { //3 - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - } else if (str[1] <= '9' && str[1] >= '0') { //2 - set_ver = (str[0] - 48) * 10 + (str[1] - 48); - } - device_info.wait_time = set_ver * 100; - break; - case 3: - if (str[3] <= '9' && str[3] >= '0') { //4 - set_ver = (str[0] - 48) * 1000 + (str[1] - 48) * 100 - + (str[2] - 48) * 10 + (str[3] - 48); - } else if (str[2] <= '9' && str[2] >= '0') { //3 - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - } - device_info.idle_time = set_ver * 100; - break; - case 4: - if (str[1] <= '9' && str[1] >= '0') { //2 - set_ver = (str[0] - 48) * 10 + (str[1] - 48); - } else { - set_ver = str[0] - 48; - } - device_info.t_step = set_ver * 10; - break; - case 5: - if (str[3] <= '9' && str[3] >= '0') { //4 - set_ver = (str[0] - 48) * 1000 + (str[1] - 48) * 100 - + (str[2] - 48) * 10 + (str[3] - 48); - } else if (str[2] <= '9' && str[2] >= '0') { //3 - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - } else if (str[1] <= '9' && str[1] >= '0') { //2 - set_ver = (str[0] - 48) * 10 + (str[1] - 48); - } else { - set_ver = str[0] - 48; - } - gTurn_offv = set_ver * 10; - break; - case 6: - set_ver = str[0] - 48; - Set_TemperatureShowFlag(set_ver); - break; - case 7: - if (str[2] <= '9' && str[2] >= '0') { //3 - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - } else if (str[1] <= '9' && str[1] >= '0') { //2 - set_ver = (str[0] - 48) * 10 + (str[1] - 48); - } else { - set_ver = str[0] - 48; - } - if (!gCalib_flag) - gZerop_ad = set_ver; - - break; - default: - break; - } -} -/******************************************************************************* - Function: Cal_Val - Description: - Inputs: - Output: - *******************************************************************************/ -u8 Cal_Val(u8 str[], u8 k, u8 flag) { - u16 set_ver; - - switch (k) { - case 0: - case 1: - if (str[2] > '9' || str[2] < '0' || // - str[1] > '9' || str[1] < '0' || // - str[0] > '4' || str[0] <= '0' || // - (str[0] == '4' && (str[1] != '0' || str[2] != '0'))) - return 0; - break; - case 2: - if (str[3] <= '9' && str[3] >= '0') { // - if ((str[2] > '9' && str[2] < '0') - || (str[1] > '9' && str[1] < '0')) // - return 0; - } else if (str[2] <= '9' && str[2] >= '0') { // - if (str[1] > '9' && str[1] < '0') // - return 0; - } else if (str[1] <= '9' && str[1] >= '0') { // - if (str[0] > '9' || str[0] < '6') // - return 0; - } else { - return 0; - } - break; - case 3: - if (str[3] <= '9' && str[3] >= '0') { //4 - if ((str[2] > '9' && str[2] < '0') - || (str[1] > '9' && str[1] < '0')) // - return 0; - } else if (str[2] <= '9' && str[2] >= '0') { //3 - if (str[0] > '9' || str[0] < '3') // - return 0; - } else { // - return 0; - } - break; - case 4: //T_Step=10 #(5~25) - if (str[1] <= '5' && str[1] >= '0') { // - if (str[0] > '2' || str[0] < '0') // - return 0; - } else { - if (str[0] < '5' && (str[0] != '1')) { - return 0; - } - } - break; - case 5: //Turn_Off_v=10 #(9~12) - if (str[1] <= '2' && str[1] >= '0') { // - if (str[0] > '9' || str[0] < '0') // - return 0; - } else { - if (str[0] < '9') { - return 0; - } - } - break; - case 6: //TempShowFlag=0 #(0,1) - if (str[0] != '1' && str[0] != '0') - return 0; - break; - case 7: - if (str[2] <= '9' && str[2] >= '0') { //3 - set_ver = (str[0] - 48) * 100 + (str[1] - 48) * 10 + (str[2] - 48); - } else if (str[1] <= '9' && str[1] >= '0') { //2 - set_ver = (str[0] - 48) * 10 + (str[1] - 48); - } else { - set_ver = str[0] - 48; - } - if (flag == 1) { - if (set_ver != gZerop_ad) - return 0; - } - break; - default: - break; - } - return 1; -} -/******************************************************************************* - Function:Disk_BuffInit - Description: Initializes the buffer for the virtual disk. By loading from the chips flash - *******************************************************************************/ -void Disk_BuffInit(void) { - memcpy(gDisk_buff, (u8*) APP_BASE, 0x2600); - memset(gRewriteflag, 0, 16); -} -/******************************************************************************* - Function: Upper - Description: Converts the string passed in to upper case - Inputs: (str) buffer to change, (len) length of the buffer - *******************************************************************************/ -void Upper(u8* str, u16 len) { - u16 i; - for (i = 0; i < len; i++) //Loop through the string - if (str[i] >= 'a' && str[i] <= 'z') //if char is lower case - str[i] -= 32; //shift to upper case -} -/******************************************************************************* - Function: SearchFile - Description: - Inputs: (pfilename) filename to look for, (pfilelen) length of the file,(root_addr) root folder to search from - Outputs: NULL (failed) or pointer to file start - *******************************************************************************/ -u8* SearchFile(u8* pfilename, u16* pfilelen, u16* root_addr) { - u16 n, sector; - u8 str_name[11]; - u8* pdiraddr; - - pdiraddr = ROOT_SECTOR; - - for (n = 0; n < 16; n++) { - memcpy(str_name, pdiraddr, 11); - Upper(str_name, 11); //ensure path is upper case - if (memcmp(str_name, pfilename, 11) == 0) { - memcpy((u8*) pfilelen, pdiraddr + 0x1C, 2); - memcpy((u8*) §or, pdiraddr + 0x1A, 2); - return (u8*) FILE_SECTOR + (sector - 2) * 512; - } - - pdiraddr += 32; - root_addr++; - } - return NULL; -} - -/******************************************************************************* - Function:Config_Analysis - Description:Reads the CONFIG.TXT if file is found and also the LOGIN.BMP file as well - - *******************************************************************************/ -u8 Config_Analysis(void) { - u32 i, j, k, m, flag; - u16 file_len; - u8 t_p[CONFIG_CONT][ROW_CONT]; - u8 str[FILE_CONT]; - u8 is_illegality = 0; - u8* p_file; - u16 root_addr; - - root_addr = 0; - m = 0; - j = 0; - //read in the config.txt if it exists - if ((p_file = SearchFile((u8*) ("CONFIG TXT"), &file_len, &root_addr))) { - memset(t_p, 0x00, CONFIG_CONT * ROW_CONT); - memcpy((u8*) gFile_con, p_file, 512); - for (k = 0; k < CONFIG_CONT; k++) { - j = 0; - for (i = m; i < strlen((char *) gFile_con); i++) { - if (gFile_con[i] == 0x0D && gFile_con[i + 1] == 0x0A) - break; - else { - if (j < ROW_CONT) - t_p[k][j++] = gFile_con[i]; - m++; - } - } - t_p[k][j] = '\0'; - m = i + 2; - } - for (k = 0; k < CONFIG_CONT; k++) { - if (memcmp(t_p[k], gKey_words[k], strlen(gKey_words[k])) == 0) { - flag = 0; - for (i = strlen(gKey_words[k]); i < strlen((char *) t_p[k]); - i++) { - if (t_p[k][i] >= '0' && t_p[k][i] <= '9') { - if (t_p[k][i] == '0') { - if (k == 6) { - flag = 1; - break; - } else { - flag = 0; - break; - } - } - flag = 1; - break; - } else if ((t_p[k][i] != 0x20) && (t_p[k][i] != 0x3d)) { - flag = 0; - break; - } - } - if (flag && Cal_Val(t_p[k] + i, k, 0)) { - Set_Ver(t_p[k] + i, k); - if (k == 0) - sprintf((char *) t_p[k], "T_Standby=%d", - device_info.t_standby / 10); - else if (k == 1) - sprintf((char *) t_p[k], "T_Work=%d", - device_info.t_work / 10); - else if (k == 2) - sprintf((char *) t_p[k], "Wait_Time=%ld", - device_info.wait_time / 100); - else if (k == 3) - sprintf((char *) t_p[k], "Idle_Time=%ld", - device_info.idle_time / 100); - else if (k == 4) - sprintf((char *) t_p[k], "T_Step=%d", - device_info.t_step / 10); - else if (k == 5) - sprintf((char *) t_p[k], "Turn_Off_v=%ld", - gTurn_offv / 10); - else if (k == 6) - sprintf((char *) t_p[k], "TempShowFlag=%d", - Get_TemperatureShowFlag()); - else if (k == 7) - sprintf((char *) t_p[k], "ZeroP_Ad=%ld", gZerop_ad); - } else { - memset(t_p[k], 0, strlen((char *) t_p[k])); - memcpy(t_p[k], gDef_set[k], strlen((char *) gDef_set[k])); - is_illegality = 1; - } - } else { - memcpy(t_p[k], gDef_set[k], strlen((char *) gDef_set[k])); - is_illegality = 1; - } - } - - if (is_illegality || gCalib_flag) { - memset(str, 0x00, FILE_CONT); - m = 0; - for (k = 0; k < CONFIG_CONT; k++) { - strcat((char *) str, (char *) t_p[k]); - strcat((char *) str, (char *) gSet_range[k]); - } - m = strlen((char *) str); - - if (m < 256) { - gDisk_buff[0x400 + root_addr * 32 + 0x1C] = m; //strlen((char *)str); - gDisk_buff[0x400 + root_addr * 32 + 0x1D] = 0; - } else { - gDisk_buff[0x400 + root_addr * 32 + 0x1C] = m % 256; - gDisk_buff[0x400 + root_addr * 32 + 0x1D] = m / 256; - } - - gRewriteflag[(p_file - ROOT_SECTOR + 0x200) / 0x400] = 1; - memcpy(p_file, str, strlen((char *) str)); - ReWriteFlsash(); - } - } else { - if ((p_file = SearchFile("LOGOIN BMP", &file_len, &root_addr))) { - memcpy(str, p_file, 254); - memset(gDisk_buff, 0x00, 0x2600); - memcpy(ROOT_SECTOR + 32, "LOGOIN BMP", 0xC); - memcpy(FILE_SECTOR + 512, str, 254); - gDisk_buff[0x40B + 32] = 0x0; //���� - *(u32*) (VOLUME_BASE + 32) = VOLUME; - gDisk_buff[0x41A + 32] = 0x03; //�غ� - gDisk_buff[0x41C + 32] = 254; //�ļ���С - } else { - memset(gDisk_buff, 0x00, 0x2600); - } - - memcpy(ROOT_SECTOR, "CONFIG TXT", 0xC); - memcpy(FAT1_SECTOR, gFat_data, 6); - memcpy(FAT2_SECTOR, gFat_data, 6); - - m = 0; - for (k = 0; k < CONFIG_CONT; k++) { - memcpy(FILE_SECTOR + m, gDef_set[k], strlen((char *) gDef_set[k])); - m += strlen((char *) gDef_set[k]); - memcpy(FILE_SECTOR + m, gSet_range[k], - strlen((char *) gSet_range[k])); - m += strlen((char *) gSet_range[k]); - } - - gDisk_buff[0x40B] = 0x0; - *(u32*) VOLUME_BASE = VOLUME; - gDisk_buff[0x41A] = 0x02; - gDisk_buff[0x41C] = m; - ReWrite_All(); - } - - gVar[F_TYPE] = HEX; - gVar[F_FLAG] = RDY; - gVar[SEG_ST] = 0; - gV32[OFFSET] = 0; - gV32[COUNT] = 0; - gV32[WR_CNT] = 0; - gV32[RD_CNT] = 0; - return 0; -} -/******************************************************************************* - Function: Disk_SecWrite - Description: - Inputs: - *******************************************************************************/ -void Disk_SecWrite(u8* pbuffer, u32 diskaddr) { - u32 i, j, k, m, flag; - u8 t_p[CONFIG_CONT][ROW_CONT]; - u8 str[FILE_CONT]; - u8 ver[20]; - static u16 Config_flag = 0; - - if (diskaddr == 0x1000) { // Write FAT1 sector - if (memcmp(pbuffer, (u8*) FAT1_SECTOR, 512)) { //check different - memcpy((u8*) FAT1_SECTOR, pbuffer, 512); - gRewriteflag[0] = 1; - } - } else if (diskaddr == 0x2800) { // Write FAT2 sector - if (memcmp(pbuffer, (u8*) FAT2_SECTOR, 512)) { //check different - memcpy((u8*) FAT2_SECTOR, pbuffer, 512); - gRewriteflag[0] = 1; - } - } else if (diskaddr == 0x4000) { // Write DIR sector - if (memcmp(pbuffer, (u8*) ROOT_SECTOR, 512)) { //check different - memcpy((u8*) ROOT_SECTOR, pbuffer, 512); - gRewriteflag[1] = 1; - for (i = 0; i < 16; i++) { - memcpy((u8*) ver, (u8*) (pbuffer), 12); //copy the filename out for comparison - if (memcmp(ver, "CONFIG TXT", 11) == 0) { //if file name matches - Config_flag = pbuffer[0x1A]; - break; - } - pbuffer += 32; //move to the next chunk of the pbuffer - } - } - } else if (diskaddr >= 0x8000 && diskaddr <= 0xA000) { // Write FILE sector - if (memcmp(pbuffer, (u8*) (FILE_SECTOR + (diskaddr - 0x8000)), 512)) { //check if different - memcpy((u8*) (FILE_SECTOR + (diskaddr - 0x8000)), pbuffer, 512); - } - if ((((diskaddr - 0x8000) / 0x200) + 2) == Config_flag) { - m = 0; - memset(t_p, 0x00, CONFIG_CONT * ROW_CONT); - memcpy((u8*) (gFile_con), pbuffer, 512); - - for (k = 0; k < CONFIG_CONT; k++) { // - j = 0; - for (i = m; i < strlen((char *) gFile_con); i++) { // - if (gFile_con[i] == 0x0D && gFile_con[i + 1] == 0x0A) - break; - else { - if (j < ROW_CONT) - t_p[k][j++] = gFile_con[i]; - m++; - } - } - t_p[k][j] = '\0'; - m = i + 2; - } - - for (k = 0; k < CONFIG_CONT; k++) { - if (memcmp(t_p[k], gKey_words[k], strlen(gKey_words[k])) == 0) { - flag = 0; - for (i = strlen(gKey_words[k]); i < strlen((char *) t_p[k]); - i++) { - if (t_p[k][i] >= '0' && t_p[k][i] <= '9') { - if (t_p[k][i] == '0') { - if (k == 6) { - flag = 1; - break; - } else { - flag = 0; - break; - } - } - flag = 1; - break; - } else if ((t_p[k][i] != 0x20) && (t_p[k][i] != 0x3d)) { - flag = 0; - break; - } - } - if ((!flag) || (!Cal_Val(t_p[k] + i, k, 1))) { - return; - } else { - Set_Ver(t_p[k] + i, k); - - memset(t_p[k], 0, strlen((char *) t_p[k])); - if (k == 0) - sprintf((char *) t_p[k], "T_Standby=%d", - device_info.t_standby / 10); - else if (k == 1) - sprintf((char *) t_p[k], "T_Work=%d", - device_info.t_work / 10); - else if (k == 2) - sprintf((char *) t_p[k], "Wait_Time=%ld", - device_info.wait_time / 100); - else if (k == 3) - sprintf((char *) t_p[k], "Idle_Time=%ld", - device_info.idle_time / 100); - else if (k == 4) - sprintf((char *) t_p[k], "T_Step=%d", - device_info.t_step / 10); - else if (k == 5) - sprintf((char *) t_p[k], "Turn_Off_v=%ld", - gTurn_offv / 10); - else if (k == 6) - sprintf((char *) t_p[k], "TempShowFlag=%d", - Get_TemperatureShowFlag()); - else if (k == 7) - sprintf((char *) t_p[k], "ZeroP_Ad=%ld", gZerop_ad); - } - } else { - memcpy(t_p[k], gDef_set[k], strlen((char *) gDef_set[k])); - return; - } - } - - memset(str, 0, FILE_CONT); - for (k = 0; k < CONFIG_CONT; k++) { - strcat((char *) str, (char *) t_p[k]); - strcat((char *) str, (char *) gSet_range[k]); - } - m = strlen((char *) str); - gDisk_buff[0x400 + (Config_flag - 2) * 32 + 0x1C] = m % 256; - gDisk_buff[0x400 + (Config_flag - 2) * 32 + 0x1D] = m / 256; - - memcpy((u8*) (FILE_SECTOR), (u8*) str, 512); - gRewriteflag[1] = 1; - gRewriteflag[((diskaddr - 0x8000 + 0x200) / 0x400) + 1] = 1; - ReWriteFlsash(); - return; - - } - - gRewriteflag[1] = 1; - gRewriteflag[((diskaddr - 0x8000 + 0x200) / 0x400) + 1] = 1; - ReWriteFlsash(); - } - ReWriteFlsash(); -} - -/******************************************************************************* - Function: Disk_SecRead - Description: Reads a sector from the virtual disk - *******************************************************************************/ -void Disk_SecRead(u8* pbuffer, u32 disk_addr) { - Soft_Delay(); - if (disk_addr == 0x0000) { // Read BOOT sector - memcpy(pbuffer, BOOT_SEC, 512); - } else if (disk_addr == 0x1000) { // Read FAT1 sector - memcpy(pbuffer, FAT1_SECTOR, 512); - } else if (disk_addr == 0x2800) { // Read FAT2 sector - memcpy(pbuffer, FAT2_SECTOR, 512); - } else if (disk_addr == 0x4000) { // Read DIR sector - memcpy(pbuffer, (u8*) (ROOT_SECTOR), 512); - } else if (disk_addr >= 0x8000 && disk_addr <= 0xA000) { // Read FILE sector - memcpy(pbuffer, (u8*) (APP_BASE + 0x600 + (disk_addr - 0x8000)), 512); - } else { - memset(pbuffer, 0, 512); //unknown, return 0's - } -} -/******************************************************************************* - Function:ReWriteFlsash - Description: - Output:RDY(all good) or ERR (error) - *******************************************************************************/ -u8 ReWriteFlsash(void) { - u32 i, j; - u8 result; - u16 *f_buff; - - FLASH_Unlock(); - for (i = 0; i < 16; i++) { - if (gRewriteflag[i]) { - gRewriteflag[i] = 0; - FLASH_Erase(APP_BASE + i * 0x400); - f_buff = (u16*) &gDisk_buff[i * 0x400]; - for (j = 0; j < 0x400; j += 2) { //Loop through the 1k block - result = FLASH_Prog((u32) (APP_BASE + i * 0x400 + j), //program each 16 bit block - *f_buff++); - if (result != FLASH_COMPLETE) { //something went wrong - FLASH_Lock(); //make sure the flash is locked again - return ERR; //return ERR - } - } - break; - } - } - FLASH_Lock(); - return RDY; -} -/******************************************************************************* - Function: ReWrite_All - Description: - Output: - *******************************************************************************/ -u8 ReWrite_All(void) { - u16 i; - u8 result; - u16 *f_buff = (u16*) gDisk_buff; - - FLASH_Unlock(); - for (i = 0; i < 9; i++) - FLASH_Erase(APP_BASE + i * 0x400); - for (i = 0; i < 0X2600; i += 2) { - result = FLASH_Prog((u32) (APP_BASE + i), *f_buff++); - if (result != FLASH_COMPLETE) - return ERR; - } - FLASH_Lock(); - return RDY; -} -/******************************************************************************* - Function:Erase - Description: Erase the first 9k from APP_BASE - *******************************************************************************/ -void Erase(void) { - u16 i; - FLASH_Unlock(); //unlock the mcu flash controller - for (i = 0; i < 9; i++) - FLASH_Erase(APP_BASE + i * 0x400); //erase the flash - - FLASH_Lock(); -} -/******************************************************************************* - Function: Read_Memory - Description: - *******************************************************************************/ -void Read_Memory(u32 r_offset, u32 r_length) { - static u32 offset, length, block_offset; - - if (gVar[USB_ST] == TXFR_IDLE) { - offset = r_offset * SECTOR_SIZE; - length = r_length * SECTOR_SIZE; - gVar[USB_ST] = TXFR_ONGOING; - } - if (gVar[USB_ST] == TXFR_ONGOING) { - if (!gV32[RD_CNT]) { - Disk_SecRead(gBuff, offset); - UserToPMABufferCopy(gBuff, ENDP1_TXADDR, BULK_MAX_PACKET_SIZE); - gV32[RD_CNT] = SECTOR_SIZE - BULK_MAX_PACKET_SIZE; - block_offset = BULK_MAX_PACKET_SIZE; - } else { - UserToPMABufferCopy(gBuff + block_offset, ENDP1_TXADDR, - BULK_MAX_PACKET_SIZE); - gV32[RD_CNT] -= BULK_MAX_PACKET_SIZE; - block_offset += BULK_MAX_PACKET_SIZE; - } - SetEPTxCount(ENDP1, BULK_MAX_PACKET_SIZE); - SetEPTxStatus(ENDP1, EP_TX_VALID); - offset += BULK_MAX_PACKET_SIZE; - length -= BULK_MAX_PACKET_SIZE; - - CSW.dDataResidue -= BULK_MAX_PACKET_SIZE; - } - if (length == 0) { - gV32[RD_CNT] = 0; - block_offset = 0; - offset = 0; - Bot_State = BOT_DATA_IN_LAST; - gVar[USB_ST] = TXFR_IDLE; - } -} -/******************************************************************************* - Function: Write_Memory - Description: - *******************************************************************************/ -void Write_Memory(u32 w_offset, u32 w_length) { - static u32 offset, length; - u32 idx, temp = gV32[WR_CNT] + 64; - - if (gVar[USB_ST] == TXFR_IDLE) { - offset = w_offset * SECTOR_SIZE; - length = w_length * SECTOR_SIZE; - gVar[USB_ST] = TXFR_ONGOING; - } - if (gVar[USB_ST] == TXFR_ONGOING) { - for (idx = 0; gV32[WR_CNT] < temp; gV32[WR_CNT]++) - *(u8 *) (gBuff + gV32[WR_CNT]) = Bulk_Buff[idx++]; - - offset += Data_Len; - length -= Data_Len; - - if (!(length % SECTOR_SIZE)) { - gV32[WR_CNT] = 0; - Disk_SecWrite(gBuff, offset - SECTOR_SIZE); - } - - CSW.dDataResidue -= Data_Len; - SetEPRxStatus(ENDP2, EP_RX_VALID); /* enable the next transaction*/ - } - if ((length == 0) || (Bot_State == BOT_CSW_Send)) { - gV32[WR_CNT] = 0; - Set_CSW(CSW_CMD_PASSED, SEND_CSW_ENABLE); - gVar[USB_ST] = TXFR_IDLE; - } -} -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/Ext_Flash.c b/workspace/ts100/src/Ext_Flash.c deleted file mode 100644 index a0093dbc..00000000 --- a/workspace/ts100/src/Ext_Flash.c +++ /dev/null @@ -1,198 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** -File Name : EXT_Flash.c -Version : S100 APP Ver 2.11 -Description: -Author : bure -Data: -History: -*******************************************************************************/ - -#include -#include -#include "Ext_Flash.h" -#include "Bios.h" - - -#define OK 0 // ������� -#define SEC_ERR 1 // ��������� -#define TMAX 100000 // ��ʱ���� - -u32 Mass_Memory_Size; -u32 Mass_Block_Size; -u32 Mass_Block_Count; -u32 Tout; - - -u8 flash_mode; - -void ExtFLASH_SectorErase(u32 SectorAddr); - -/******************************************************************************* - SPI_FLASH_SectorErase : Sector Erases the specified FLASH Page.(4k/sector) -*******************************************************************************/ -void ExtFLASH_SectorErase(u32 SectorAddr) -{ - ExtFlash_WriteEnable(); - ExtFlash_CS_LOW(); - ExtFlash_SendByte(SE); - ExtFlash_SendByte((SectorAddr & 0xFF0000) >> 16); //Send high address byte - ExtFlash_SendByte((SectorAddr & 0xFF00) >> 8); //Send medium address byte - ExtFlash_SendByte(SectorAddr & 0xFF); //Send low address byte - ExtFlash_CS_HIGH(); - ExtFlash_WaitForWriteEnd(); // Wait the end of Flash writing -} - - -void ExtFlash_PageWR(u8* pBuffer, u32 WriteAddr) -{ - u32 addr,i,j; - u8* ptr; - u8 page=0,flag=0,write_mode; - u8 buffer[256]; - - flag=0; - if(flash_mode==FLASH_8M) { - addr=WriteAddr & 0xFFF000; - page=16; - } else { - page=1; - addr=WriteAddr & 0xFFFF00; - } - while(page>0) { - ExtFlash_PageRD((u8*)&buffer,addr, 256); - for(j=0; j<255; j++) { - if(buffer[j++]!=0xff) { - flag=1; - break; - } - } - addr+=256; - page--; - } - if(flash_mode==FLASH_8M) { - page=16; - addr=WriteAddr & 0xFFF000; - if(flag==1)ExtFLASH_SectorErase(addr); - write_mode=PP; - } else { - page=1; - addr=WriteAddr & 0xFFFF00; - if(flag==1)write_mode=PW; - else write_mode=PP; - } - ptr=pBuffer; - for(i=0; i> 16); - ExtFlash_SendByte((WriteAddr & 0xFF00) >> 8); - ExtFlash_SendByte(WriteAddr & 0xFF); - while(Lenght--) { // while there is data to be written on the FLASH - ExtFlash_SendByte((*pBuffer)); - pBuffer++; - } - ExtFlash_CS_HIGH(); - ExtFlash_WaitForWriteEnd(); -} - -/******************************************************************************* - SPI_FLASH_BufferRead -*******************************************************************************/ -void ExtFlash_PageRD(u8* pBuffer, u32 ReadAddr, u16 Lenght) -{ - ExtFlash_CS_HIGH(); - ExtFlash_WaitForWriteEnd(); - ExtFlash_CS_LOW(); - ExtFlash_SendByte(READ); - ExtFlash_SendByte((ReadAddr & 0xFF0000) >> 16); - ExtFlash_SendByte((ReadAddr& 0xFF00) >> 8); - ExtFlash_SendByte(ReadAddr & 0xFF); - - while(Lenght--) { // while there is data to be read - *pBuffer = (ExtFlash_SendByte(Dummy_Byte)); - pBuffer++; - } - ExtFlash_CS_HIGH(); -} -/******************************************************************************* - SPI_FLASH_ReadByte -*******************************************************************************/ -u8 ExtFlash_ReadByte(void) -{ - return (ExtFlash_SendByte(Dummy_Byte)); -} - -/******************************************************************************* - SPI_FLASH_SendByte -*******************************************************************************/ -u8 ExtFlash_SendByte(u8 byte) -{ - Tout = 0; - while(SPI_I2S_GetFlagStatus(SPI3, SPI_I2S_FLAG_TXE) == RESET) { - if(Tout++ > TMAX) return 255; - } - SPI_I2S_SendData(SPI3, byte); - Tout = 0; - while(SPI_I2S_GetFlagStatus(SPI3, SPI_I2S_FLAG_RXNE) == RESET) { - if(Tout++ > TMAX) return 255; - } - return SPI_I2S_ReceiveData(SPI3); -} -/******************************************************************************* - SPI_FLASH_WriteEnable -*******************************************************************************/ -void ExtFlash_WriteEnable(void) -{ - ExtFlash_CS_LOW(); - ExtFlash_SendByte(WREN); - ExtFlash_CS_HIGH(); -} -/******************************************************************************* - SPI_FLASH_WaitForWriteEnd -*******************************************************************************/ -void ExtFlash_WaitForWriteEnd(void) -{ - u8 FLASH_Status = 0; - - ExtFlash_CS_LOW(); - ExtFlash_SendByte(RDSR); - Tout = 0; - do { - FLASH_Status = ExtFlash_SendByte(Dummy_Byte); - if(Tout++ > TMAX) return; - } while((FLASH_Status & WIP_Flag) == SET); // Write in progress - ExtFlash_CS_HIGH(); -} -/******************************************************************************* - MAL_GetStatus -*******************************************************************************/ -void MAL_GetStatus (void) -{ - if(flash_mode==FLASH_8M) { - Mass_Block_Count = 2048; //FLASH_SIZE/FLASH_PAGE_SIZE; - Mass_Block_Size = 512*8; //FLASH_PAGE_SIZE; 4096 - Mass_Memory_Size = 512*4096*4 ; //FLASH_SIZE; 0x800000; - } else { - Mass_Block_Count = 4096; //FLASH_SIZE/FLASH_PAGE_SIZE; 4096 - Mass_Block_Size = 512; //FLASH_PAGE_SIZE; - Mass_Memory_Size = 512*4096 ; //FLASH_SIZE; 0x200000; - } -} - -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/Flash.c b/workspace/ts100/src/Flash.c deleted file mode 100644 index ee5b4f73..00000000 --- a/workspace/ts100/src/Flash.c +++ /dev/null @@ -1,33 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ******************** - File Name : Flash.c - Version : Author : bure - *******************************************************************************/ -#include "APP_Version.h" -#include "Flash.h" -#include "Bios.h" - - -/******************************************************************************* - Function: FLASH_Prog - Description: Programs the data into the system flash at the specified address - *******************************************************************************/ -u8 FLASH_Prog(u32 Address, u16 Data) { - if (FLASH_WaitForLastOperation(WAIT_TIMES) != FLASH_TIMEOUT) - FLASH_ClearFlag( - FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); - return FLASH_ProgramHalfWord(Address, Data); -} -/******************************************************************************* - Function: FLASH_Erase - Description: Erases a page of flash - Inputs: Starting address for the page to erase - *******************************************************************************/ -void FLASH_Erase(u32 Address) { - if (Address % FLASH_PAGE == 0) { // FLASH Page start (1K/Page) - if (FLASH_WaitForLastOperation(WAIT_TIMES) != FLASH_TIMEOUT) //wait for last op to finish - FLASH_ClearFlag( - FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); - FLASH_ErasePage(Address); // FLASH Page erase - } -} -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/Hardware.c b/workspace/ts100/src/Hardware.c deleted file mode 100644 index 0a0294df..00000000 --- a/workspace/ts100/src/Hardware.c +++ /dev/null @@ -1,384 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : CTRL.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2015/07/07 ͳһ������ - 2015/07/20 �Ӵ��¶ȱ������� - *******************************************************************************/ -#include -#include -#include "APP_Version.h" -#include "Hardware.h" -#include "CTRL.h" -#include "Bios.h" -#include "UI.h" -/******************************************************************************/ -#define CAL_AD 250 -const u32 gVol[] = { 3900, 2760, 1720, 584 }; -const u16 gRate[] = { 300, 150, 90, 40 }; -s32 gZerop_ad = 239; -u32 gTurn_offv = 100; -u8 gCalib_flag = 0; -vu16 gMeas_cnt = 0;/* Measure*/ -u32 gKey_in; -u8 gLongkey_flag = 0; -u8 gAlarm_type = 1; -/******************************************************************************* - ������: Get_CalFlag - ��������:��ȡУ׼״̬ - �������:NULL - ���ز���:У׼״̬��־ - *******************************************************************************/ -u32 Get_CalFlag(void) { - return gCalib_flag; -} - -/******************************************************************************* - ������: Get_gKey - ��������:��ȡ����״̬ - �������:NULL - ���ز���:����״̬ - *******************************************************************************/ -u32 Get_gKey(void) { - return gKey_in; -} -/******************************************************************************* - ������: Set_gKey - ��������:���ð���״̬ - �������:Ҫ���õİ���״̬ - ���ز���:NULL - *******************************************************************************/ -void Set_gKey(u32 key) { - gKey_in = key; -} -/******************************************************************************* - ������: Set_LongKeyFlag - ��������:���ó�������־ - �������:0 :�����Գ����� 1: ���Գ��� - ���ز���:NULL - *******************************************************************************/ -void Set_LongKeyFlag(u32 flag) { - gLongkey_flag = flag; -} -/******************************************************************************* - ������: Get_AlarmType - ��������:��ȡ�������� - �������:NULL - ���ز���: �������� - 0:���� - 1:sensor - err - 2:���� - 3:��ѹ - *******************************************************************************/ -u8 Get_AlarmType(void) { - return gAlarm_type; -} -/******************************************************************************* - ������: Set_AlarmType - ��������:�������� - �������: �������� - 0:���� - 1:sen - err - 2:���� - 3:��ѹ - ���ز���:NULL - *******************************************************************************/ -void Set_AlarmType(u8 type) { - gAlarm_type = type; -} -/******************************************************************************* - Function: Read_Vb - Description:Reads the input voltage and compares it to the thresholds?? - Input:Selects which threshold we are comparing to - Output:Returns a key for if the voltage is in spec (I think) - *******************************************************************************/ -int Read_Vb(u8 flag) { - u32 tmp, i, sum = 0; - - for (i = 0; i < 10; i++) { - tmp = ADC_GetConversionValue(ADC2); - sum += tmp; - } - tmp = sum / 10; - if (tmp >= (gVol[0] + gVol[0] / 100)) { - gAlarm_type = HIGH_VOLTAGE; - return H_ALARM; //����3500 - } - tmp = (tmp * 10 / 144); //��ѹvb = 3.3 * 85 *ad / 40950 - - for (i = 0; i < 4; i++) { - if (i == 2) { - if (flag == 0) { - if (tmp >= gRate[i]) - break; - } else { - if (tmp >= gTurn_offv) - break; - } - } else { - if (tmp >= gRate[i]) - break; - } - } - return (i + 1); -} -/******************************************************************************* - ������: Scan_Key - ��������:ɨ�����(50msÿ��) - �������:NULL - ���ز���:NULL - *******************************************************************************/ -void Scan_Key(void) { - static u32 p_cnt = 0, key_statuslast = 0; - u32 key_state = 0; - - if ((~GPIOA->IDR) & 0x0200) - key_state |= KEY_V1; //KEY_V1 - if ((~GPIOA->IDR) & 0x0040) - key_state |= KEY_V2; //KEY_V2 - - if (key_state == 0) - return; - - if (gLongkey_flag == 1) { //LongKey_flag :���Ƴ�������־ - if (key_statuslast == key_state) { - p_cnt++; - if (p_cnt > 21) - Set_gKey(KEY_CN | key_state); //������ - } else { - p_cnt = 0; - key_statuslast = key_state; - Set_gKey(key_state); - } - } else { - p_cnt = 0; - key_statuslast = key_state; - Set_gKey(key_state); - } - -} - -/******************************************************************************* - ������: Get_SlAvg - ��������:����ƽ��ֵ - �������:avg_data ƽ����ADÖµ - ���ز���:����ƽ��ֵ - *******************************************************************************/ -u32 Get_SlAvg(u32 avg_data) { - static u32 sum_avg = 0; - static u8 init_flag = 0; - u16 si_avg = sum_avg / SI_COE, abs; - - if (init_flag == 0) { /*��һ���ϵ�*/ - sum_avg = SI_COE * avg_data; - init_flag = 1; - return sum_avg / SI_COE; - } - if (avg_data > si_avg) - abs = avg_data - si_avg; - else - abs = si_avg - avg_data; - - if (abs > SI_THRESHOLD) - sum_avg = SI_COE * avg_data; - else - sum_avg += avg_data - sum_avg / SI_COE; - - return sum_avg / SI_COE; -} - -/******************************************************************************* - Function: - Description: Read the thermocouple in the soldering iron head - Output:Soldering Iron temperature - *******************************************************************************/ -u32 Get_AvgAd(void) { - /*The head has a thermocouple inline with the heater - This is read by turning off the heater - Then read the output of the op-amp that is connected across the connections - */ - static u32 ad_sum = 0; - static u32 max = 0, min = 5000; - u32 ad_value, avg_data, slide_data = 0; - - Set_HeatingTime(0); //set the remaining time to zero - HEAT_OFF(); //heater must be off - Delay_HalfMs(25); //wait for the heater to time out - gMeas_cnt = 10; //how many measurements to make - - while (gMeas_cnt > 0) { - ad_value = Get_AdcValue(0); //Read_Tmp(); - ad_sum += ad_value; - if (ad_value > max) - max = ad_value; - if (ad_value < min) - min = ad_value; - - if (gMeas_cnt == 1) { //We have just taken the last reading - ad_sum = ad_sum - max - min; //remove the two outliers - avg_data = ad_sum / 8; //take the average - - slide_data = Get_SlAvg(avg_data); - ad_sum = 0; - min = 5000; - max = 0; - } - gMeas_cnt--; - } - return slide_data; //gSlide_data; -} - -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -int Get_TempSlAvg(int avg_data) { - static int sum_avg = 0; - static u8 init_flag = 0; - - if (init_flag == 0) { - sum_avg = 8 * avg_data; - init_flag = 1; - return sum_avg / 8; - } - - sum_avg += avg_data - sum_avg / 8; - - return sum_avg / 8; -} - -/******************************************************************************* - Function: - Description:Reads the temperature of the on board temp sensor for calibration - http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf - Output: The onboardTemp in C - *******************************************************************************/ -int Get_SensorTmp(void) { - u32 ad_sum = 0; - u32 max = 0, min = 5000; - u32 ad_value, avg_data, slide_data; - int sensor_temp = 0; - - gMeas_cnt = 10; - - while (gMeas_cnt > 0) { - ad_value = Get_AdcValue(1); - ad_sum += ad_value; - if (ad_value > max) - max = ad_value; - if (ad_value < min) - min = ad_value; - - if (gMeas_cnt == 1) { - ad_sum = ad_sum - max - min; - avg_data = ad_sum / 8; - //^ Removes the two outliers from the data spread - slide_data = Get_TempSlAvg(avg_data); - sensor_temp = (250 + (3300 * slide_data / 4096) - 750); //(25 + ((10*(33*gSlide_data)/4096)-75)); - //^ Convert the reading to C - ad_sum = 0; - min = 5000; - max = 0; - } - gMeas_cnt--; - } - return sensor_temp; -} - -/******************************************************************************* - Function: - Description: Reads the Zero Temp.. And does something.. - *******************************************************************************/ -void Zero_Calibration(void) { - u32 zerop; - int cool_tmp; - - zerop = Get_AvgAd(); //get the current - cool_tmp = Get_SensorTmp(); //get the temp of the onboard sensor - - if (zerop >= 400) { //If the tip is too hot abort - gCalib_flag = 2; - } else { - if (cool_tmp < 300) { //If cool temp is cool enough continue - gZerop_ad = zerop; //store the zero point - gCalib_flag = 1; - } else { //abort if too warm - gCalib_flag = 2; - } - } -} -/******************************************************************************* - ������: Get_Temp - ��������:�������,�ȶ��¶�,����AD�����¶� - �������:wk_temp �����¶� - ���ز���:ʵ���¶� - *******************************************************************************/ -s16 Get_Temp(s16 wk_temp) { - int ad_value, cool_tmp, compensation = 0; - static u16 cnt = 0, h_cnt = 0; - - ad_value = Get_AvgAd(); - cool_tmp = Get_SensorTmp(); - - if (ad_value == 4095) - h_cnt++; - else { - h_cnt = 0; - if (ad_value > 3800 && ad_value < 4095) - cnt++; - else - cnt = 0; - } - if (h_cnt >= 60 && cnt == 0) - gAlarm_type = SEN_ERR; //Sensor error -- too many invalid readings - if (h_cnt == 0 && cnt >= 10) - gAlarm_type = HIGH_TEMP; //Stuck at a really high temp -> Has mosfet failed - if (h_cnt < 60 && cnt < 10) - gAlarm_type = NORMAL_TEMP; //No errors so far - - compensation = 80 + 150 * (wk_temp - 1000) / 3000; - if (wk_temp == 1000) - compensation -= 10; - - if (wk_temp != 0) { - if (ad_value > (compensation + gZerop_ad)) - ad_value -= compensation; - } - if (cool_tmp > 400) - cool_tmp = 400; //cap cool temp at 40C - - return (ad_value * 1000 + 806 * cool_tmp - gZerop_ad * 1000) / 806; -} - -/******************************************************************************* - Function:Start_Watchdog - Description: Starts the system watchdog timer - *******************************************************************************/ -u32 Start_Watchdog(u32 ms) { - IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); - - /* IWDG counter clock: 40KHz(LSI) / 32 = 1.25 KHz (min:0.8ms -- max:3276.8ms */ - IWDG_SetPrescaler(IWDG_Prescaler_32); - - /* Set counter reload value to XXms */ - IWDG_SetReload(ms * 10 / 8); - - /* Reload IWDG counter */ - IWDG_ReloadCounter(); - - /* Enable IWDG (the LSI oscillator will be enabled by hardware) */ - IWDG_Enable(); - return 1; -} -/******************************************************************************* - Function:Clear_Watchdog - Description:Resets the watchdog timer - *******************************************************************************/ -void Clear_Watchdog(void) { - IWDG_ReloadCounter(); - -} -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/I2C.c b/workspace/ts100/src/I2C.c index 51d626ad..bed47bf3 100644 --- a/workspace/ts100/src/I2C.c +++ b/workspace/ts100/src/I2C.c @@ -1,229 +1,148 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** -File Name : I2C.c -Version : S100 APP Ver 2.11 -Description: -Author : Celery -Data: 2015/07/20 -History: -2015/07/07 ͳһ������ -2015/07/21 I2C_DELAYTIME = 2; -*******************************************************************************/ - -#include "stm32f10x.h" +/* + * I2C.h hardware interface class + * Based on the STM32 app note AN2824 + */ #include "I2C.h" -#include "Bios.h" -#include "Oled.h" -#include "S100V0_1.h" -// --------- ����I2C�ӿ���ض���-------- // -#define SDA GPIO_Pin_7 -#define SCL GPIO_Pin_6 +/* + * Configure the I2C port hardware + */ +void I2C_Configuration(void) { + GPIO_InitTypeDef GPIO_InitStructure; + I2C_InitTypeDef I2C_InitStructure; -#define HIGH 1 -#define LOW 0 + /* PB6,7 SCL and SDA */ + GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD; + GPIO_Init(GPIOB, &GPIO_InitStructure); -#define SDA_VAL GPIO_ReadInputDataBit(GPIOB, SDA) -#define SCL_VAL GPIO_ReadInputDataBit(GPIOB, SCL) - -#define I2C_MORE 1 -#define I2C_LAST 0 -#define I2C_TIMEOUT 255 - -#define FAILURE 0 -#define SUCCEED 1 -#define I2C_DELAYTIME 2 - -static void Sim_I2C_Set(u8 pin, u8 status); -static void Sim_I2C_Stop(void); -static void Sim_I2C_Start(void); -static u8 Sim_I2C_RD_Byte(u8 more); -static u8 Sim_I2C_WR_Byte(u8 data); - -/******************************************************************************* -������: Delay_uS -��������: �����ʱ -�������:us -���ز���:NULL -*******************************************************************************/ -void Delay_uS(u32 us) -{ - while(us) us--; -} -/******************************************************************************* -������: I2C_Configuration -��������: ����I2C -�������:NULL -���ز���:NULL -*******************************************************************************/ -void I2C_Configuration(void) -{ - GPIO_InitTypeDef GPIO_InitStructure; - I2C_InitTypeDef I2C_InitStructure; - - GPIO_Init_OLED(); - /* PB6,7 SCL and SDA */ - GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD; - GPIO_Init(GPIOB, &GPIO_InitStructure); - - /* I2C1 configuration ------------------------------------------------------*/ - I2C_InitStructure.I2C_Mode = I2C_Mode_I2C; - I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2; - I2C_InitStructure.I2C_OwnAddress1 = DEVICEADDR_OLED; - I2C_InitStructure.I2C_Ack = I2C_Ack_Enable; - I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit; - I2C_InitStructure.I2C_ClockSpeed = 100000;//100k - I2C_Init(I2C1, &I2C_InitStructure); - I2C_Cmd(I2C1, ENABLE); + /* I2C1 configuration ------------------------------------------------------*/ + I2C_InitStructure.I2C_Mode = I2C_Mode_I2C; + I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2; + I2C_InitStructure.I2C_Ack = I2C_Ack_Enable; + I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit; + I2C_InitStructure.I2C_ClockSpeed = 100000; //100k + I2C_Init(I2C1, &I2C_InitStructure); + I2C_Cmd(I2C1, ENABLE); } -/******************************************************************************* -������: I2C_Configuration -��������: ����I2C -�������:NULL -���ز���:NULL -*******************************************************************************/ -void Sim_I2C_Set(u8 pin, u8 status) -{ - if(status == HIGH) GPIO_SetBits (GPIOB, pin); - if(status == LOW) GPIO_ResetBits(GPIOB, pin); -} -/******************************************************************************* -������: Sim_I2C_Start -��������: ��ʼ -�������:NULL -���ز���:NULL -*******************************************************************************/ -void Sim_I2C_Start(void) -{ - GPIO_InitTypeDef GPIO_InitStructure; +/* + * Writes a page of data over I2C using the I2C1 peripheral in the stm32 + * + */ +void I2C_PageWrite(u8* buf, u8 nbyte, u8 deviceaddr) { - RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); // I2C_PIN_EN(); - GPIO_InitStructure.GPIO_Pin = SCL | SDA; - GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD; - GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; - GPIO_Init (GPIOB, &GPIO_InitStructure); + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY)) { + } + // Intiate Start Sequence + I2C_GenerateSTART(I2C1, ENABLE); + while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT)) { + } + // Send Address + I2C_Send7bitAddress(I2C1, deviceaddr << 1, I2C_Direction_Transmitter); + while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) { + } + // Write first byte EV8_1 + I2C_SendData(I2C1, *buf++); - Sim_I2C_Set(SCL, LOW); // SCL low - Sim_I2C_Set(SDA, HIGH); // SDA float, set as output high - Sim_I2C_Set(SCL, HIGH); // SCL high - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SDA, LOW); // SDA high->low while sclk high, S state occur... - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, LOW); // SCL low -} -/******************************************************************************* -������: Sim_I2C_Stop -��������: Í£Ö¹ -�������:NULL -���ز���:NULL -*******************************************************************************/ -void Sim_I2C_Stop(void) -{ - Sim_I2C_Set(SCL, LOW); // SCL low - Sim_I2C_Set(SDA, LOW); // SDA low - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, HIGH); // SCL high - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SDA, HIGH); // SDA low->high while sclk high, P state occur - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, LOW); // SCL low - Delay_uS(I2C_DELAYTIME); -} -/******************************************************************************* -������: Sim_I2C_WR_Byte -��������:��I2Cд��λ���� -�������:dataҪд������� -���ز���:NULL -*******************************************************************************/ -u8 Sim_I2C_WR_Byte(u8 data) -{ - u8 i = 8; + while (--nbyte) { + // wait on BTF + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_BTF)) { + } + I2C_SendData(I2C1, *buf++); + } - while(i--) { //send out a bit by sda line. - Sim_I2C_Set(SCL, LOW); // sclk low - if(data & 0x80) Sim_I2C_Set(SDA, HIGH); // send bit is 1 - else Sim_I2C_Set(SDA, LOW); // send bit is 0 - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, HIGH); // SCL high - Delay_uS(I2C_DELAYTIME); - data <<=1; // left shift 1 bit, MSB send first. - } - Sim_I2C_Set(SCL, LOW); // SCL low - Sim_I2C_Set(SDA, HIGH); // SDA set as input - for(i=I2C_TIMEOUT; i!=0; i--) { // wait for sda low to receive ack - Delay_uS(I2C_DELAYTIME); - if (!SDA_VAL) { - Sim_I2C_Set(SCL, HIGH); // SCL high - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, LOW); // SCL_LOW(); - Delay_uS(I2C_DELAYTIME); - return SUCCEED; - } - } - return FAILURE; -} -/******************************************************************************* -������: Sim_I2C_RD_Byte -��������:��I2C������� -�������:more -���ز���:�����İ�λ���� -*******************************************************************************/ -u8 Sim_I2C_RD_Byte(u8 more) -{ - u8 i = 8, byte = 0; + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_BTF)) { + } + I2C_GenerateSTOP(I2C1, ENABLE); + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_STOPF)) { + } - Sim_I2C_Set(SDA, HIGH); // SDA set as input - while(i--) { - Sim_I2C_Set(SCL, LOW); // SCL low - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, HIGH); // SCL high - Delay_uS(I2C_DELAYTIME); - byte <<=1; //recv a bit - if (SDA_VAL) byte |= 0x01; - } - Sim_I2C_Set(SCL, LOW); - if(!more) Sim_I2C_Set(SDA, HIGH); //last byte, send nack. - else Sim_I2C_Set(SDA, LOW); //send ack - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, HIGH); // SCL_HIGH(); - Delay_uS(I2C_DELAYTIME); - Sim_I2C_Set(SCL, LOW); - return byte; } -/******************************************************************************* -������: I2C_PageWrite -��������:�� ��ַ deviceaddr �numbyte���ֽڵ����ݣ�д���������pbuf -�������:pbuf д������ݣ�numbyte Ϊд����ֽ�����deviceaddrΪд��ĵ�ַ -���ز���:NULL -*******************************************************************************/ -void I2C_PageWrite(u8* pbuf, u8 numbyte,u8 deviceaddr ) -{ - Sim_I2C_Start(); - Sim_I2C_WR_Byte(deviceaddr<<1); - while(numbyte--) Sim_I2C_WR_Byte(*pbuf++); - Sim_I2C_Stop(); -} -/******************************************************************************* -������: I2C_PageRead -��������:��I2C������� -�������: pbuf �������Ĵ�ŵ�ַ numbyteΪ���������ֽ��� - deviceaddr�豸��ַ readaddr��ȡ�����ݵ�ַ -���ز���:�����İ�λ���� -*******************************************************************************/ -void I2C_PageRead(u8* pbuf, u8 numbyte,u8 deviceaddr, u8 readaddr) -{ - Sim_I2C_Start(); - Sim_I2C_WR_Byte(deviceaddr<<1); - Sim_I2C_WR_Byte(readaddr); - Sim_I2C_Start(); - Sim_I2C_WR_Byte((deviceaddr<<1)|1); - while(numbyte--) { - if(numbyte) *pbuf++ = Sim_I2C_RD_Byte(I2C_MORE); - else *pbuf++ = Sim_I2C_RD_Byte(I2C_LAST); - } - Sim_I2C_Stop(); +/* + * Read Page of data using I2C1 peripheral + */ + +void I2C_PageRead(u8* buf, u8 nbyte, u8 deviceaddr, u8 readaddr) { + I2C_GenerateSTART(I2C1, ENABLE); + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_SB) == RESET) + ; + I2C_Send7bitAddress(I2C1, deviceaddr << 1, I2C_Direction_Transmitter); + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_ADDR) == RESET) + ; + I2C_GetFlagStatus(I2C1, I2C_FLAG_MSL); + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_TXE) == RESET) + ; + // Send an 8bit byte address + I2C_SendData(I2C1, readaddr); + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY)) { + } + I2C_AcknowledgeConfig(I2C1, DISABLE); + I2C_NACKPositionConfig(I2C1, I2C_NACKPosition_Current); + I2C_GenerateSTART(I2C1, ENABLE); + while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT)) { + } + I2C_Send7bitAddress(I2C1, deviceaddr << 1, I2C_Direction_Receiver); + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_ADDR)) { + } + if (nbyte == 1) { + // Clear Ack bit + I2C_AcknowledgeConfig(I2C1, DISABLE); + // EV6_1 -- must be atomic -- Clear ADDR, generate STOP + __disable_irq(); + (void) I2C1->SR2; + I2C_GenerateSTOP(I2C1, ENABLE); + __enable_irq(); + // Receive data EV7 + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_RXNE)) { + } + *buf++ = I2C_ReceiveData(I2C1); + } else if (nbyte == 2) { + // Set POS flag + I2C_NACKPositionConfig(I2C1, I2C_NACKPosition_Next); + // EV6_1 -- must be atomic and in this order + __disable_irq(); + (void) I2C1->SR2; // Clear ADDR flag + I2C_AcknowledgeConfig(I2C1, DISABLE); // Clear Ack bit + __enable_irq(); + // EV7_3 -- Wait for BTF, program stop, read data twice + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_BTF)) { + } + __disable_irq(); + I2C_GenerateSTOP(I2C1, ENABLE); + *buf++ = I2C1->DR; + __enable_irq(); + *buf++ = I2C1->DR; + } else { + (void) I2C1->SR2; // Clear ADDR flag + while (nbyte-- != 3) { + // EV7 -- cannot guarantee 1 transfer completion time, wait for BTF + // instead of RXNE + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_BTF)) { + } + *buf++ = I2C_ReceiveData(I2C1); + } + + while (!I2C_GetFlagStatus(I2C1, I2C_FLAG_BTF)) { + } + // EV7_2 -- Figure 1 has an error, doesn't read N-2 ! + I2C_AcknowledgeConfig(I2C1, DISABLE); // clear ack bit + __disable_irq(); + *buf++ = I2C_ReceiveData(I2C1); // receive byte N-2 + I2C_GenerateSTOP(I2C1, ENABLE); // program stop + __enable_irq(); + *buf++ = I2C_ReceiveData(I2C1); // receive byte N-1 + // wait for byte N + while (!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED)) { + } + *buf++ = I2C_ReceiveData(I2C1); + nbyte = 0; + } + // Wait for stop + while (I2C_GetFlagStatus(I2C1, I2C_FLAG_STOPF)) { + } + return; } -/******************************** END OF FILE *********************************/ + diff --git a/workspace/ts100/src/Interrupt.c b/workspace/ts100/src/Interrupt.c index c99d7373..43dbb4a3 100644 --- a/workspace/ts100/src/Interrupt.c +++ b/workspace/ts100/src/Interrupt.c @@ -1,14 +1,18 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. *******************/ -/* Brief : Interrupt Service Routines Author : bure */ -/******************************************************************************/ #include "Interrupt.h" -#include "usb_istr.h" #include "Bios.h" #include "I2C.h" -/******************************************************************************/ -/* Processor Exceptions Handlers */ -/******************************************************************************/ +volatile uint32_t system_Ticks; +volatile uint32_t lastKeyPress; //millis() at the last button event +volatile uint16_t keyState; //tracks the button status +volatile uint32_t lastMovement; //millis() at last movement event + +//Delay in milliseconds using systemTick +void delayMs(uint32_t ticks) { + uint32_t endtime = ticks + millis(); + while (millis() < endtime) + ; +} void NMI_Handler(void) { ; @@ -34,6 +38,160 @@ void UsageFault_Handler(void) { ; } +//Handles the tick of the sysTick events +void SysTick_Handler(void) { + ++system_Ticks; +} + +/*Peripheral Interrupts */ + +void TIM3_IRQHandler(void) { + TIM3_ISR(); +} + +//EXTI IRQ handler +//used for buttons and movement +void EXTI9_5_IRQHandler(void) { +//we are interested in line 9 and line 6 for buttons + //Lien 5 == movement + if (EXTI_GetITStatus(EXTI_Line9) != RESET) { + if (GPIO_ReadInputDataBit(GPIOA, KEY_A) == SET) + keyState &= ~(BUT_A); + else + keyState |= BUT_A; + lastKeyPress = millis(); + EXTI_ClearITPendingBit(EXTI_Line9); + } else if (EXTI_GetITStatus(EXTI_Line6) != RESET) { + if (GPIO_ReadInputDataBit(GPIOA, KEY_B) == SET) + keyState &= ~(BUT_B); + else + keyState |= BUT_B; + lastKeyPress = millis(); + EXTI_ClearITPendingBit(EXTI_Line6); + } else if (EXTI_GetITStatus(EXTI_Line5) != RESET) { //Movement Event + lastMovement = millis(); + EXTI_ClearITPendingBit(EXTI_Line5); + } + +} + +/*********************** UNUSED IRQ *****************************************/ +void WWDG_IRQHandler(void) { +} +void PVD_IRQHandler(void) { +} +void TAMPER_IRQHandler(void) { +} +void RTC_IRQHandler(void) { +} +void FLASH_IRQHandler(void) { +} +void RCC_IRQHandler(void) { +} +void EXTI0_IRQHandler(void) { +} +void EXTI1_IRQHandler(void) { +} +void EXTI2_IRQHandler(void) { +} +void EXTI3_IRQHandler(void) { +} +void EXTI4_IRQHandler(void) { +} +void DMA1_Channel1_IRQHandler(void) { +} +void DMA1_Channel2_IRQHandler(void) { +} +void DMA1_Channel3_IRQHandler(void) { +} +void DMA1_Channel4_IRQHandler(void) { +} +void DMA1_Channel5_IRQHandler(void) { +} +void DMA1_Channel6_IRQHandler(void) { +} +void DMA1_Channel7_IRQHandler(void) { +} +void ADC1_2_IRQHandler(void) { +} +void USB_HP_CAN1_TX_IRQHandler(void) { +} +void CAN1_RX1_IRQHandler(void) { +} +void CAN1_SCE_IRQHandler(void) { +} + +void TIM1_BRK_IRQHandler(void) { +} +void TIM1_UP_IRQHandler(void) { +} +void TIM1_TRG_COM_IRQHandler(void) { +} +void TIM1_CC_IRQHandler(void) { +} +void TIM4_IRQHandler(void) { +} +void I2C1_EV_IRQHandler(void) { +} +void I2C1_ER_IRQHandler(void) { +} +void I2C2_EV_IRQHandler(void) { +} +void I2C2_ER_IRQHandler(void) { +} +void SPI1_IRQHandler(void) { +} +void SPI2_IRQHandler(void) { +} +void USART1_IRQHandler(void) { +} +void USART2_IRQHandler(void) { +} +void USART3_IRQHandler(void) { +} +void EXTI15_10_IRQHandler(void) { +} +void RTCAlarm_IRQHandler(void) { +} +void USBWakeUp_IRQHandler(void) { +} +void TIM8_BRK_IRQHandler(void) { +} +void TIM8_UP_IRQHandler(void) { +} +void TIM8_TRG_COM_IRQHandler(void) { +} +void TIM8_CC_IRQHandler(void) { +} +void ADC3_IRQHandler(void) { +} +void FSMC_IRQHandler(void) { +} +void SDIO_IRQHandler(void) { +} +void TIM5_IRQHandler(void) { +} +void SPI3_IRQHandler(void) { +} +void UART4_IRQHandler(void) { +} +void UART5_IRQHandler(void) { +} +void TIM6_IRQHandler(void) { +} +void TIM7_IRQHandler(void) { +} +void DMA2_Channel1_IRQHandler(void) { +} +void DMA2_Channel2_IRQHandler(void) { +} +void DMA2_Channel3_IRQHandler(void) { +} +void DMA2_Channel4_5_IRQHandler(void) { +} +void TIM2_IRQHandler(void) { + +} void SVC_Handler(void) { } @@ -43,33 +201,8 @@ void DebugMon_Handler(void) { void PendSV_Handler(void) { } -void SysTick_Handler(void) { -} - -/******************************************************************************/ -/* Peripherals Interrupt Handlers */ -/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ -/* available peripheral interrupt handler's name please refer to the startup */ -/* file (startup_stm32f30x.s). */ -/******************************************************************************/ - void USB_LP_CAN1_RX0_IRQHandler(void) { - USB_Istr(); -} -void TIM2_IRQHandler(void) { - TIM2_ISR(); + } -void TIM3_IRQHandler(void) { - TIM3_ISR(); -} -/*This loop is used for un assigned IRQ's so that the debugger can catch them*/ -static void forever() - -{ - for (;;) - ; -} - -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/MMA8652FC.c b/workspace/ts100/src/MMA8652FC.c index d8488e99..8d473261 100644 --- a/workspace/ts100/src/MMA8652FC.c +++ b/workspace/ts100/src/MMA8652FC.c @@ -1,252 +1,43 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : MMA8652FC.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2016/09/13 Ben V. Brown - English comments and fixing a few errors - 2015/07/07 ͳһ������ - *******************************************************************************/ +/* + * MMA8652FC.* + * Files for the built in accelerometer from NXP. + * This sets the unit up in motion detection mode with an interrupt on movement + * This interrupt is fed to PB5 which catches it via EXTI5 + * + * http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8652FC.pdf + * + * EXTI Motion config setup values lifted from AN4070from NXP + * + * Ben V. Brown - + */ #include -#include -#include "APP_Version.h" #include "Bios.h" -#include "Oled.h" #include "MMA8652FC.h" #include "I2C.h" -#include "CTRL.h" -#include "UI.h" -//------------------------------------------------------------------// - -static int IIC_RegWrite(u8 reg, u8 data); -static int IIC_RegRead(u8 reg); -static int Read_ZYXDr(void); - -u16 gactive = 0, gShift = 0; -u8 gMmatxdata; - -typedef struct { - u8 hi; - u8 lo; - -} DR_Value; - -DR_Value gX_value, gY_value, gZ_value; - -/******************************************************************************* - Function: - Description:Returns if the unit is actively being moved - Output: if the unit is active or not. - *******************************************************************************/ -u16 Get_MmaActive(void) { - return gactive; -} -/******************************************************************************* - Function: Get_MmaActive - Description:Returns if movement has occured (0==still,1==movement) - *******************************************************************************/ -u16 Get_MmaShift(void) { - return gShift; -} -/******************************************************************************* - Function: Set_MmaShift - Description: Set the Shift Value - Input: shift value - *******************************************************************************/ -void Set_MmaShift(u16 shift) { - gShift = shift; -} - -/******************************************************************************* - Function:IIC_RegWrite - Description:Writes a value to a register - Input:the register, the data - Output: 1 if the write succeeded - *******************************************************************************/ -int IIC_RegWrite(u8 reg, u8 data) { - u8 tx_data[20]; +void I2C_RegisterWrite(uint8_t reg, uint8_t data) { + u8 tx_data[2]; tx_data[0] = reg; tx_data[1] = data; I2C_PageWrite(tx_data, 2, DEVICE_ADDR); - return 1; } -/******************************************************************************* - Function:IIC_RegRead - Description: Reads a register from I2C, using a single byte addressing scheme - Inputs: uint8_t register to read - Output: 1 if the read worked. - *******************************************************************************/ -int IIC_RegRead(u8 reg) { - u8 tx_data[20]; + +uint8_t I2C_RegisterRead(uint8_t reg) { + u8 tx_data[3]; tx_data[0] = reg; - I2C_PageRead(tx_data, 1, DEVICE_ADDR, reg); - gMmatxdata = tx_data[0]; - return 1; -} -/******************************************************************************* - Function: MMA865x_Standby - Description: Put the MMA865 into standby mode - *******************************************************************************/ -void MMA865x_Standby(void) { - //Put the sensor into Standby Mode by clearing - // the Active bit of the System Control 1 Register - IIC_RegWrite(CTRL_REG1, 0); //(IIC_RegRead(CTRL_REG1) & ~ ACTIVE_MASK) -} -/******************************************************************************* - Function: MMA865x_Active - Description: Put the MMA865 into active mode - *******************************************************************************/ -void MMA865x_Active(void) { - // Put the sensor into Active Mode by setting the - // Active bit of the System Control 1 Register - IIC_RegWrite(CTRL_REG1, ACTIVE_MASK); //(IIC_RegRead(CTRL_REG1) | ACTIVE_MASK) -} -/******************************************************************************* - Function: IIC_RegRead - Description:Setup the MMA865x IC settings - *******************************************************************************/ -void StartUp_Accelerated(void) { - //Put the unit into standby state so we can edit its configuration registers - MMA865x_Standby(); - //Set the unit to full scale measurement - IIC_RegWrite(XYZ_DATA_CFG_REG, FULL_SCALE_8G); //(IIC_RegRead(XYZ_DATA_CFG_REG) & ~FS_MASK) - //Set the unit to the required update rate (eg 100Hz) - IIC_RegWrite(CTRL_REG1, DataRateValue); //IIC_RegRead(CTRL_REG1)| - - IIC_RegWrite(CTRL_REG2, 0); //Normal mode - - //Change the unit back to active mode to exit setup and start the readings - MMA865x_Active(); + return tx_data[0]; } -/******************************************************************************* - Function: Read_ZYXDr - Description: - Output: 1 if new data, 0 if not - *******************************************************************************/ -int Read_ZYXDr(void) { - u8 reg_flag; - u8 ptr, i; - u8 value[6] = { 0, 0, 0, 0, 0, 0 }; - //Poll the ZYXDR status bit and wait for it to set - if (IIC_RegRead(STATUS_REG)) { //check we can read the status - reg_flag = gMmatxdata; - if ((reg_flag & ZYXDR_BIT) != 0) { //if new measurement - //Read 12/10-bit XYZ results using a 6 byte IIC access - ptr = X_MSB_REG; - for (i = 0; i < 6; i++) { - if (IIC_RegRead(ptr++) == 0) - break; +void StartUp_Accelerometer(void) { + I2C_RegisterWrite(CTRL_REG2, 0); //Normal mode + I2C_RegisterWrite( CTRL_REG2, 0x40); // Reset all registers to POR values + delayMs(2); // ~1ms delay + I2C_RegisterWrite(FF_MT_CFG_REG, 0x78); // Enable motion detection for X and Y axis, latch enabled + I2C_RegisterWrite(FF_MT_THS_REG, 0x0F); // Set threshold + I2C_RegisterWrite(FF_MT_COUNT_REG, 0x01); // Set debounce to 100ms - value[i] = gMmatxdata; - //Copy and save each result as a 16-bit left-justified value - gX_value.hi = value[0]; - gX_value.lo = value[1]; - gY_value.hi = value[2]; - gY_value.lo = value[3]; - gZ_value.hi = value[4]; - gZ_value.lo = value[5]; - return 1; - } - } else - return 0; - } - return 0; + I2C_RegisterWrite( CTRL_REG4, 0x04); // Enable motion interrupt + I2C_RegisterWrite( CTRL_REG5, 0x04);// Route motion interrupts to INT1 ->PB5 ->EXTI + I2C_RegisterWrite( CTRL_REG1, 0x19); // ODR=100 Hz, Active mode } -/******************************************************************************* - Function: Cheak_XYData - Description: Check the input X,Y for a large enough acceleration to wake the unit - Inputs:x0,y0,x1,y1 to check - Output: if the unit is active - *******************************************************************************/ -u16 Cheak_XYData(u16 x0, u16 y0, u16 x1, u16 y1) { - u16 active = 0; - gShift = 0; - - if ((x1 > (x0 + 32)) || (x1 < (x0 - 32))) - gShift = 1; - if ((y1 > (y0 + 32)) || (y1 < (y0 - 32))) - gShift = 1; - - if ((x1 > (x0 + 16)) || (x1 < (x0 - 16))) - active = 1; - if ((y1 > (y0 + 16)) || (y1 < (y0 - 16))) - active = 1; - - return active; -} -/******************************************************************************* - Function: Update_X - Description: Converts the read value for x into an actual properly located value - Output: X - *******************************************************************************/ -u16 Update_X(void) { - u16 value, x; - - value = ((gX_value.hi << 8) | (gX_value.lo & 0xf0)) >> 4; - if (gX_value.hi > 0x7f) - x = (~value + 1) & 0xfff; - else - x = value & 0xfff; - - return x; -} -/******************************************************************************* - Function: Update_Y - Description: Converts the read value for y into an actual properly located value - Output: Y - *******************************************************************************/ -u16 Update_Y(void) { - u16 value, y; - - value = ((gY_value.hi << 8) | (gY_value.lo & 0xf0)) >> 4; - if (gY_value.hi > 0x7f) - y = (~value + 1) & 0xfff; - else - y = value & 0xfff; - - return y; -} -/******************************************************************************* - Function: Update_Z - Description: Converts the read value for z into an actual properly located value - Output: Z - *******************************************************************************/ -u16 Update_Z(void) { - u16 value, z; - - value = ((gZ_value.hi << 8) | (gZ_value.lo & 0xf0)) >> 4; - if (gZ_value.hi > 0x7f) - z = (~value + 1) & 0xfff; - else - z = value & 0xfff; - - return z; -} -/******************************************************************************* - Function: Check_Accelerated - Description:Check if the unit has moved - *******************************************************************************/ -void Check_Accelerated(void) { - static u16 x0 = 0, y0 = 0; - u16 x1, y1; - - if (Read_ZYXDr()) { //Read the new values from the accelerometer - x1 = Update_X(); //convert the values into usable form - y1 = Update_Y(); - } else { - x1 = x0; - y1 = y0; //use old values - gactive = 0; - return; - } - - gactive = Cheak_XYData(x0, y0, x1, y1); //gactive == If the unit is moving or not - - x0 = x1; - y0 = y1; -} -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/Main.c b/workspace/ts100/src/Main.c index 1762b02c..8d4c9c85 100644 --- a/workspace/ts100/src/Main.c +++ b/workspace/ts100/src/Main.c @@ -1,63 +1,41 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : main.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2016/8/11 Updates by Ben V. Brown - Cleanup and english comments - 2015/07/07 ͳһ������ - *******************************************************************************/ -#include -#include -#include "APP_Version.h" -#include "Disk.h" +/* + * Created by Ben V. Brown + */ + +#include "Modes.h" #include "Bios.h" -#include "usb_lib.h" -#include "I2C.h" -#include "Flash.h" #include "MMA8652FC.h" -#include "UI.h" +#include "PID.h" #include "Oled.h" -#include "CTRL.h" -#include "Hardware.h" +#include "Settings.h" +#include "I2C.h" +void setup(); + int main(void) { - RCC_Config(); //setup system clock - NVIC_Config(0x4000); - Init_Timer2(); //init the timers - Init_Timer3(); - GPIO_Config();//setup all the GPIO pins - - USB_Port(DISABLE);//disable the USB hardware - Delay_Ms(200);//pause to let hardware stabilize - USB_Port(ENABLE);//enable the USB hardware - USB_Init(); - I2C_Configuration(); //init the i2c bus - - Adc_Init(); //init adc and dma - if (Get_CtrlStatus() != CONFIG) - StartUp_Accelerated();//start the accelerometer if not in config mode - - System_Init();//load known safe values - Init_Oled();//init the OLED display - Clear_Screen();//clear the display buffer to black - Init_Gtime();//init the count down timers - APP_Init();//pick operating mode via input voltage - - Disk_BuffInit();//fill the buffer for the virtual disk - Config_Analysis(); //read in config from virtual disk - Pid_Init(); //init the pid to starting values - Set_gKey(NO_KEY); //reset keys to all off - Start_Watchdog(3000);//start the system watchdog as 3 seconds - + setup(); while (1) { Clear_Watchdog(); //reset the Watchdog - if (Get_CtrlStatus() != CONFIG && LEAVE_WAIT_TIMER== 0) { - Check_Accelerated(); //update readings from the accelerometer - LEAVE_WAIT_TIMER = 50;//reset timer so we dont poll accelerometer for another 500ms - } - OLed_Display(); //Draw in the Oled display for this mode - Status_Tran(); //Handle user input and mode changing + ProcessUI(); + DrawUI(); + delayMs(50); } } -/******************************** END OF FILE *********************************/ +void setup() +{ + RCC_Config(); //setup system clock + NVIC_Config(0x4000); //this shifts the NVIC table to be offset, for the usb bootloader's size + GPIO_Config(); //setup all the GPIO pins + Init_EXTI(); //init the EXTI inputs + Init_Timer3(); //Used for the soldering iron tip + Adc_Init(); //init adc and dma + I2C_Configuration(); //Start the I2C hardware + GPIO_Init_OLED(); //Init the GPIO ports for the OLED + StartUp_Accelerometer(); //start the accelerometer + Init_Oled(); //init the OLED display + Clear_Screen(); //clear the display buffer to black + setupPID(); //init the PID values + readIronTemp(239, 0); //load the default calibration value + restoreSettings(); //Load settings + + Start_Watchdog(1000); //start the system watchdog as 1 seconds timeout +} diff --git a/workspace/ts100/src/Modes.c b/workspace/ts100/src/Modes.c new file mode 100644 index 00000000..9936fb56 --- /dev/null +++ b/workspace/ts100/src/Modes.c @@ -0,0 +1,282 @@ +/* + * Modes.c + * + * Created on: 17 Sep 2016 + * Author: Ralim + */ +#include "Modes.h" +//This does the required processing and state changes +void ProcessUI() { + uint8_t Buttons = getButtons(); //read the buttons status + static uint32_t lastModeChange = 0; + if (millis() - getLastButtonPress() < 200) + Buttons = 0; + //rough prevention for de-bouncing and allocates settling time + + switch (operatingMode) { + case STARTUP: + if ((millis() - getLastButtonPress() > 1000)) { + if (Buttons & BUT_A) { + //A key pressed so we are moving to soldering mode + operatingMode = SOLDERING; + resetLastButtonPress(); + resetButtons(); + } else if (Buttons & BUT_B) { + //B Button was pressed so we are moving to the Settings menu + operatingMode = SETTINGS; + resetLastButtonPress(); + resetButtons(); + } + } + //Nothing else to check here + break; + case SOLDERING: + //We need to check the buttons if we need to jump out + if (Buttons & BUT_A) { + //A key pressed so we are moving to temp set + operatingMode = TEMP_ADJ; + resetLastButtonPress(); + resetButtons(); + } else if (Buttons & BUT_B) { + //B Button was pressed so we are moving back to idle + operatingMode = COOLING; + resetLastButtonPress(); + resetButtons(); + } else { + //We need to check the timer for movement in case we need to goto idle + if (systemSettings.movementEnabled) + if (millis() - getLastMovement() + > (systemSettings.SleepTime * 60000)) { + if (millis() - getLastButtonPress() + > (systemSettings.SleepTime * 60000)) { + operatingMode = SLEEP; + return; + } + } + uint16_t voltage = readDCVoltage(); //get X10 voltage + if ((voltage / 10) < systemSettings.cutoutVoltage) { + operatingMode = UVLOWARN; + resetLastButtonPress(); + resetButtons(); + lastModeChange = millis(); + } + //If no buttons pushed we need to perform the PID loop for the iron temp + int32_t newOutput = computePID(systemSettings.SolderingTemp); + + setIronTimer(newOutput); + + } + break; + case TEMP_ADJ: + if (Buttons & BUT_A) { + //A key pressed so we are moving down in temp + resetLastButtonPress(); + if (systemSettings.SolderingTemp > 1000) + systemSettings.SolderingTemp -= 100; + } else if (Buttons & BUT_B) { + //B key pressed so we are moving up in temp + resetLastButtonPress(); + if (systemSettings.SolderingTemp < 4500) + systemSettings.SolderingTemp += 100; + } else { + //we check the timeout for how long the buttons have not been pushed + //if idle for > 3 seconds then we return to soldering + if (millis() - getLastButtonPress() > 3000) + operatingMode = SOLDERING; + } + break; + case SETTINGS: + //Settings is the mode with the most logic + //Here we are in the menu so we need to increment through the sub menus / increase the value + if (millis() - getLastButtonPress() < 400) + return; + + if (Buttons & BUT_A) { + resetLastButtonPress(); + //A key iterates through the menu + if (settingsPage == 3) { + //Roll off the end + settingsPage = 0; //reset + operatingMode = STARTUP; + saveSettings(); //Save the settings + } else + ++settingsPage; //move to the next option + } else if (Buttons & BUT_B) { + resetLastButtonPress(); + //B changes the value selected + switch (settingsPage) { + case UVLO: + //we are incrementing the cutout voltage + systemSettings.cutoutVoltage += 1; //Go up 1V at a jump + if (systemSettings.cutoutVoltage > 24) + systemSettings.cutoutVoltage = 9; + else if (systemSettings.cutoutVoltage < 9) + systemSettings.cutoutVoltage = 9; //cant set UVLO below 9V + break; + case SLEEP_TEMP: + systemSettings.SleepTemp += 100; //Go up 10c at a time + if (systemSettings.SleepTemp > 3000) + systemSettings.SleepTemp = 1000;//cant sleep higher than 300 + break; + case SLEEP_TIME: + ++systemSettings.SleepTime; //Go up 1 minute at a time + if (systemSettings.SleepTime > 60) + systemSettings.SleepTime = 2; //cant set time over an hour + //Remember that ^ is the time of no movement + break; + case MOTIONDETECT: + systemSettings.movementEnabled = + !systemSettings.movementEnabled; + break; + default: + break; + } + } + break; + case SLEEP: + //The iron is sleeping at a lower temperature due to lack of movement + if (Buttons & BUT_A) { + //A Button was pressed so we are moving back to soldering + operatingMode = SOLDERING; + resetLastButtonPress(); + resetButtons(); + return; + } else if (Buttons & BUT_B) { + //B Button was pressed so we are moving back to soldering + operatingMode = SOLDERING; + resetLastButtonPress(); + resetButtons(); + return; + } else if (systemSettings.movementEnabled) + if (millis() - getLastMovement() < 1000) {//moved in the last second + operatingMode = SOLDERING; //Goto active mode again + return; + } + //else if nothing has been pushed we need to compute the PID to keep the iron at the sleep temp + int32_t newOutput = computePID(systemSettings.SleepTemp); + + setIronTimer(newOutput); + + break; + case COOLING: { + setIronTimer(0); //turn off heating + //This mode warns the user the iron is still cooling down + uint16_t temp = readIronTemp(0, 1); //take a new reading as the heater code is not taking new readings + if (temp < 500) { //if the temp is < 50C then we can go back to IDLE + operatingMode = STARTUP; + resetLastButtonPress(); + resetButtons(); + } else { //we check if the user has pushed a button to ack + if ((millis() - getLastButtonPress() > 200) + && (millis() - getLastButtonPress() < 2000)) { + if (getButtons() && (BUT_A | BUT_B)) { + //A button was pushed + operatingMode = STARTUP; + resetLastButtonPress(); + resetButtons(); + } + } + } + } + break; + case UVLOWARN: + //We are here if the DC voltage went too low + //We want to jump back to IDLE after a bit + if (millis() - lastModeChange > 3000) { //its been 3 seconds + operatingMode = STARTUP; //jump back to idle mode + } + break; + default: + break; + } +} + +void DrawUI() { + uint16_t temp = readIronTemp(0, 0) / 10; + switch (operatingMode) { + case STARTUP: + //We are chilling in the idle mode + //Check if movement in the last 5 minutes , if not sleep OLED + if (millis() - getLastMovement() > (5 * 60 * 1000) + && (millis() - getLastButtonPress() > (5 * 60 * 1000))) { + //OLED off + Oled_DisplayOff(); + } else { + Oled_DisplayOn(); + OLED_DrawString("IDLE ", 7); //write the word IDLE + } + break; + case SOLDERING: + //The user is soldering + { + if (getIronTimer() == 0) { + OLED_DrawChar('C', 14 * 4); + } else { + if (getIronTimer() < 500) { + OLED_DrawChar(' ', 14 * 4); + } else { //we are heating + OLED_DrawChar('H', 14 * 4); + } + } + OLED_DrawThreeNumber(temp, 0); + OLED_DrawChar(' ', 14 * 3); + OLED_DrawChar(' ', 14 * 5); + OLED_DrawChar(' ', 14 * 6); + } + break; + case TEMP_ADJ: + //We are prompting the user to change the temp so we draw the current setpoint temp + //With the nifty arrows + OLED_DrawChar('<', 0); + OLED_DrawThreeNumber(systemSettings.SolderingTemp / 10, 14 * 1); + OLED_DrawChar(' ', 14 * 4); + OLED_DrawChar('>', 14 * 5); + break; + case SETTINGS: + //We are prompting the user the setting name + + switch (settingsPage) { + case UVLO: + OLED_DrawString("UVLO", 4); + OLED_DrawTwoNumber(systemSettings.cutoutVoltage, 14 * 4); + //OLED_DrawChar('V', 14 * 5); + + break; + case SLEEP_TEMP: + OLED_DrawString("STMP", 4); + OLED_DrawThreeNumber(systemSettings.SleepTemp / 10, 14 * 4); + //OLED_DrawChar('V', 14 * 5); + + break; + case SLEEP_TIME: + OLED_DrawString("STME ", 5); + OLED_DrawTwoNumber(systemSettings.SleepTime, 14 * 5); + break; + case MOTIONDETECT:/*Toggle the mode*/ + if (systemSettings.movementEnabled) + OLED_DrawString("MOTN T", 7); + else + OLED_DrawString("MOTN F", 7); + break; + default: + break; + } + break; + case SLEEP: + //The iron is in sleep temp mode + //Draw in temp and sleep + OLED_DrawString("SLP", 3); + OLED_DrawThreeNumber(temp, 14 * 3); + break; + case COOLING: + //We are warning the user the tip is cooling + OLED_DrawString("COL", 3); + OLED_DrawThreeNumber(temp, 14 * 3); + break; + case UVLOWARN: + OLED_DrawString("UND VL", 6); + break; + default: + break; + } +} diff --git a/workspace/ts100/src/Oled.c b/workspace/ts100/src/Oled.c index b4237131..c578a793 100644 --- a/workspace/ts100/src/Oled.c +++ b/workspace/ts100/src/Oled.c @@ -1,51 +1,25 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : Oled.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/07/07 - History: - 2015/07/07 ͳһ������ - *******************************************************************************/ +/* + * + * OLED.c + * Functions for working with the oled screen. + * Writes to the screen using I2C + */ #include #include -#include "APP_Version.h" + #include "Oled.h" #include "Bios.h" #include "I2C.h" -#include "Hardware.h" -#include "Disk.h" -#include "UI.h" +#include "Font.h" +/*Setup params for the OLED screen*/ +u8 OLED_Setup_Array[46] = { 0x80, 0xAE, 0x80, 0xD5, 0x80, 0x52, 0x80, 0xA8, + 0x80, 0x0f, 0x80, 0xC0, 0x80, 0xD3, 0x80, 0x00, 0x80, 0x40, 0x80, 0xA0, + 0x80, 0x8D, 0x80, 0x14, 0x80, 0xDA, 0x80, 0x02, 0x80, 0x81, 0x80, 0x33, + 0x80, 0xD9, 0x80, 0xF1, 0x80, 0xDB, 0x80, 0x30, 0x80, 0xA4, 0x80, 0XA6, + 0x80, 0xAF }; -//Setup params depending on oled model -#ifdef SSD1316 -u8 gOled_param[50] = {0x80,0xAE,0x80,0x00,0x80,0x10,0x80,0x40,0x80,0xB0,0x80, - 0x81,0x80,0xFF,0x80,0xA0,0x80,0xA6,0x80,0xA8,0x80,0x1F, - 0x80,0xC8,0x80,0xD3,0x80,0x00,0x80,0xD5,0x80,0x80,0x80, - 0xD9,0x80,0x22,0x80,0xDA,0x80,0x12,0x80,0xDB,0x80,0x40, - 0x80,0x8D,0x80,0x14,0x80,0xAF, -}; -#else -u8 gOled_param[46] = { 0x80, 0xAE, 0x80, 0xD5, 0x80, 0x52, 0x80, 0xA8, 0x80, - 0x0f, 0x80, 0xC0, 0x80, 0xD3, 0x80, 0x00, 0x80, 0x40, 0x80, 0xA0, 0x80, - 0x8D, 0x80, 0x14, 0x80, 0xDA, 0x80, 0x02, 0x80, 0x81, 0x80, 0x33, 0x80, - 0xD9, 0x80, 0xF1, 0x80, 0xDB, 0x80, 0x30, 0x80, 0xA4, 0x80, 0XA6, 0x80, - 0xAF }; -#endif -/******************************************************************************* - ������: Sc_Pt - ��������:��Ļ�����ı���Ļ�Աȶ� - �������:Co��Ļ�ԱȶȲ��� - ���ز���:NULL - *******************************************************************************/ -void Sc_Pt(u8 Co) //������ -{ - u8 pt[4] = { 0x80, 0x81, 0x80, Co }; - - I2C_PageWrite(pt, 4, DEVICEADDR_OLED); -} /******************************************************************************* Function: Oled_DisplayOn Description:Turn on the Oled display @@ -71,16 +45,16 @@ void Oled_DisplayOff(void) { Input: number of bytes to write, array to write Output: *******************************************************************************/ -u8* Data_Command(u8 wide, u8* ptr) { +u8* Data_Command(u8 length, u8* data) { int i; u8 tx_data[128]; //here are are inserting the data write command at the beginning tx_data[0] = 0x40; - wide += 1; - for (i = 1; i < wide; i++) //Loop through the array of data - tx_data[i] = *ptr++; - I2C_PageWrite(tx_data, wide, DEVICEADDR_OLED); //write out the buffer - return ptr; + length += 1; + for (i = 1; i < length; i++) //Loop through the array of data + tx_data[i] = *data++; + I2C_PageWrite(tx_data, length, DEVICEADDR_OLED); //write out the buffer + return data; } /******************************************************************************* Function:Set_ShowPos @@ -89,10 +63,8 @@ u8* Data_Command(u8 wide, u8* ptr) { *******************************************************************************/ void Set_ShowPos(u8 x, u8 y) { u8 pos_param[8] = { 0x80, 0xB0, 0x80, 0x21, 0x80, 0x20, 0x80, 0x7F }; - pos_param[5] = x + 32; pos_param[1] += y; - I2C_PageWrite(pos_param, 8, DEVICEADDR_OLED); } @@ -123,20 +95,6 @@ u8* Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 high, u8* ptr) { return ptr; } -/******************************************************************************* - Function:Clean_Char - Description:Overwries a square to off, used to overwrite a char - Inputs:(k) input X position char starts at, (wide) how many pixels wide the char is - *******************************************************************************/ -void Clean_Char(int k, u8 wide) { - int i; - u8 tx_data[128]; - - memset(&tx_data[0], 0, wide); - for (i = 0; i < 2; i++) { - Oled_DrawArea(k, i * 8, wide, 8, tx_data); - } -} /******************************************************************************* Function:GPIO_Init_OLED Description:Init the outputs as needed for the OLED (in this case the RST line) @@ -157,17 +115,11 @@ void Init_Oled(void) { u8 param_len; OLED_RST(); - Delay_Ms(2); - OLED_ACT(); - Delay_Ms(2); - -#ifdef SSD1316 - param_len = 50; -#else + delayMs(2); + OLED_ACT(); //Toggling reset to reset the oled + delayMs(2); param_len = 46; -#endif - - I2C_PageWrite((u8 *) gOled_param, param_len, DEVICEADDR_OLED); + I2C_PageWrite((u8 *) OLED_Setup_Array, param_len, DEVICEADDR_OLED); } /******************************************************************************* @@ -176,20 +128,56 @@ void Init_Oled(void) { *******************************************************************************/ void Clear_Screen(void) { u8 tx_data[128]; - u8 i, wd; - -#ifdef SSD1316 - wd = 32; -#else - wd = 16; -#endif - memset(&tx_data[0], 0, 128); - for (i = 0; i < wd / 8; i++) { + for (u8 i = 0; i < 2; i++) { Oled_DrawArea(0, i * 8, 128, 8, tx_data); } } +void OLED_DrawString(char* string, uint8_t length) { + for (uint8_t i = 0; i < length; i++) { + OLED_DrawChar(string[i], i * 14); + } +} +void OLED_DrawChar(char c, uint8_t x) { + if ((x) > (128 - 14)) + return; //Rudimentary clipping to not draw off screen + u8* ptr; + ptr = (u8*) FONT; + if (c >= 'A' && c <= 'Z') { + ptr += (c - 'A' + 10) * (14 * 2); //alpha is ofset 10 chars into the array + } else if (c >= '0' && c <= '9') + ptr += (c - '0') * (14 * 2); + else if (c < 10) + ptr += (c) * (14 * 2); + else if (c == ' ') { + //blank on space bar + ptr += (36) * (14 * 2); + } else if (c == '<') { + ptr += (37) * (14 * 2); + } else if (c == '>') { + ptr += (38) * (14 * 2); + } -/******************************** END OF FILE *********************************/ + Oled_DrawArea(x, 0, 14, 16, (u8*) ptr); +} +/* + * Draw a 2 digit number to the display + * */ +void OLED_DrawTwoNumber(uint8_t in, uint8_t x) { + OLED_DrawChar((in / 10) % 10, x); + OLED_DrawChar(in % 10, x + 14); +} +void OLED_DrawThreeNumber(uint16_t in, uint8_t x) { + OLED_DrawChar((in / 100) % 10, x); + OLED_DrawChar((in / 10) % 10, x + 14); + OLED_DrawChar(in % 10, x + 28); +} +void OLED_DrawFourNumber(uint16_t in, uint8_t x) { + + OLED_DrawChar((in / 1000) % 10, x); + OLED_DrawChar((in / 100) % 10, x + 14); + OLED_DrawChar((in / 10) % 10, x + 28); + OLED_DrawChar(in % 10, x + 42); +} diff --git a/workspace/ts100/src/PID.c b/workspace/ts100/src/PID.c new file mode 100644 index 00000000..b086f0ea --- /dev/null +++ b/workspace/ts100/src/PID.c @@ -0,0 +1,41 @@ +/* + * PID.c + * + * Created on: 20 Sep 2016 + * Author: ralim + */ + +#include "PID.h" +#define MAXPIDOUTPUT 50000 +//This function computes the new value for the ON time of the system +//This is the return value from this function +int32_t computePID(uint16_t setpoint) { + int32_t ITerm = 0; + static int16_t lastReading = 0; + uint16_t currentReading = readIronTemp(0, 1); //get the current temp of the iron + int16_t error = (int16_t) setpoint - (int16_t) currentReading; //calculate the error term + ITerm += (pidSettings.ki * error); + if (ITerm > MAXPIDOUTPUT) + ITerm = MAXPIDOUTPUT; + else if (ITerm < 0) + ITerm = 0; //cap at 0 since we cant force the iron to cool itself :) + + int16_t DInput = (currentReading - lastReading); //compute the input to the D term + int32_t output = (pidSettings.kp * error) + (ITerm) + - (pidSettings.kd * DInput); + if (output > MAXPIDOUTPUT) + output = MAXPIDOUTPUT; + else if (output < 0) + output = 0; + + lastReading = currentReading; //storing values for next iteration of the loop + return output; + +} +/*Sets up the pid values*/ +void setupPID(void) { + pidSettings.kp = 22; + pidSettings.ki = 7; + pidSettings.kd = 2; + +} diff --git a/workspace/ts100/src/Settings.c b/workspace/ts100/src/Settings.c new file mode 100644 index 00000000..849a6dc9 --- /dev/null +++ b/workspace/ts100/src/Settings.c @@ -0,0 +1,52 @@ +/* + * Settings.c + * + * Created on: 29 Sep 2016 + * Author: Ralim + * + * This file holds the users settings and saves / restores them to the devices flash + */ + +#include "Settings.h" +#define FLASH_ADDR (0x8000000|48896) +void saveSettings() { +//First we erase the flash + FLASH_Unlock(); //unlock flash writing + FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); + while (FLASH_ErasePage(FLASH_ADDR) != FLASH_COMPLETE) + ; //wait for it + //erased the chunk + //now we program it + uint16_t *data = (uint16_t*) &systemSettings; + for (uint8_t i = 0; i < (sizeof(systemSettings) / 2); i++) { + FLASH_ProgramHalfWord(FLASH_ADDR + (i * 2), data[i]); + } +} + +void restoreSettings() { + //We read the flash + uint16_t *data = (uint16_t*) &systemSettings; + for(uint8_t i=0;i<(sizeof(systemSettings)/2);i++) + { + data[i] = *(uint16_t *)(FLASH_ADDR + (i*2)); + } + //if the version is correct were done + //if not we reset and save + if (systemSettings.version != SETTINGSVERSION) { + //probably not setup + resetSettings(); + saveSettings(); + } + +} + +void resetSettings() { + + systemSettings.SleepTemp = 900; + systemSettings.SleepTime = 1; + systemSettings.SolderingTemp = 3200; + systemSettings.movementEnabled = 1; //we use movement detection + systemSettings.cutoutVoltage = 9; + systemSettings.version=SETTINGSVERSION; +} + diff --git a/workspace/ts100/src/UI.c b/workspace/ts100/src/UI.c deleted file mode 100644 index 4f925517..00000000 --- a/workspace/ts100/src/UI.c +++ /dev/null @@ -1,1036 +0,0 @@ -/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. ********************** - File Name : UI.c - Version : S100 APP Ver 2.11 - Description: - Author : Celery - Data: 2015/08/03 - History: - 2015/07/07 ͳһ������ - 2015/08/03 �Ż��ƶ��ж� - *******************************************************************************/ -#include -#include -#include "APP_Version.h" -#include "UI.h" -#include "CTRL.h" -#include "WordLib.h" -#include "Bios.h" -#include "Oled.h" -#include "Hardware.h" -#include "Disk.h" -#include "MMA8652FC.h" -/******************************************************************************/ -u8 gTemp_array[16 * 16 + 16]; -u8 gTemperatureshowflag = 0; -u8 gUp_flag = 0, gDown_flag = 0, gLevel_flag = 0, gTempset_showctrl = 0; -u16 gTemp_array_u16[208]; -u16 gSet_table[2] = { 4000, 1000 }; -u32 gCont = 0; -/******************************************************************************/ - -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -u32 Get_UpdataFlag(void) { - return gCont; -} -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Set_UpdataFlag(u32 cont) { - gCont = cont; -} -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Set_TemperatureShowFlag(u8 flag) { - gTemperatureshowflag = flag; -} -/******************************************************************************* - Function: - Description:Ö¾ - *******************************************************************************/ -u8 Get_TemperatureShowFlag(void) { - return gTemperatureshowflag; -} -/******************************************************************************* - Function: - Description: Converts F to C or C to F. - Input: flag = if flag==0 converts C to F - *******************************************************************************/ -s16 TemperatureShow_Change(u8 flag, s16 tmp) { - if (flag == 0) { - return (320 + tmp * 9 / 5); - } else { - return (5 * tmp - 1600) / 9; - } -} -/******************************************************************************* - Function:APP_Init - Description:Init the operating mode by looking at input voltage to pick USB or normal - *******************************************************************************/ -void APP_Init(void) { - int rev; - - HEATING_TIMER= 0; - UI_TIMER= 0; - - rev = Read_Vb(0); //Read input voltage - if (rev == 0) //no input volatage == error state - Set_CtrlStatus(ALARM); - else if (rev >= 4) { //We are USB powered (5V approx at input) - Set_LongKeyFlag(1); - Set_CtrlStatus(CONFIG); - } else { //Normal mode > ~9V at input - Set_CtrlStatus(IDLE); - G6_TIMER= device_info.idle_time; - } - -} - -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Display_Temp(u8 x, s16 temp) { - char Str[8]; - - memset(Str, 0x0, 6); - sprintf(Str, "%d", temp); - - if (gTemperatureshowflag == 0) { - if (temp > 99) - Str[3] = 'C'; - else if (temp > 9) { - Str[2] = 'C'; - Str[3] = ' '; - } else if (temp < 0) { - if (temp + 9 >= 0) { - Str[2] = 'C'; - Str[3] = ' '; - } else { - Str[3] = 'C'; - } - } else { - Str[1] = 'C'; - Str[2] = ' '; - Str[3] = ' '; - } - } else { - if (temp > 99) - Str[3] = 'E'; - else if (temp > 9) { - Str[2] = 'E'; - Str[3] = ' '; - } else if (temp < 0) { - if (temp + 9 >= 0) { - Str[2] = 'E'; - Str[3] = ' '; - } else { - Str[3] = 'E'; - } - } else { - Str[1] = 'E'; - Str[2] = ' '; - Str[3] = ' '; - } - } - Display_Str(x, Str); - TEMPSHOW_TIMER= 20; //200ms -} -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Show_Notice(void) { - int j, k; - static u8* ptr0; - static u8 posi = 0, i = 0; - - if (i == 0) { //1 - ptr0 = Oled_DrawArea(0, 0, 96, 16, (u8*) Maplib); - } else if (i == 1) { //2 - ptr0 = Oled_DrawArea(0, 0, 96, 16, ptr0); - } else if (i == 2) { //3 - ptr0 = Oled_DrawArea(0, 0, 96, 16, (u8*) Maplib); - } else if (i == 3) { //4 - for (j = 0; j < 6; j++) { - k = 84; - while (k >= posi) { - ptr0 = (u8*) Maplib1 + j * 28; - Clean_Char(k + 7, 14); - ptr0 = Oled_DrawArea(k, 0, 14, 16, ptr0); - k -= 7; - Delay_Ms(10); - } - posi += 14; - } - posi = 0; - } - i++; - if (i == 4) - i = 0; -} - -/******************************************************************************* - Function: - Description: Draws the word CONFIG to the screen - *******************************************************************************/ -void Show_Config(void) { - u8* ptr; - u8 j; - - ptr = (u8*) Config; - for (j = 0; j < 6; j++) { - ptr = Oled_DrawArea(j * 16, 0, 16, 16, ptr); - } -} - -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Show_TempDown(s16 temp, s16 dst_temp) { - static u8 guide_ui = 0; - char str[8]; - - memset(str, 0x0, 6); - sprintf(str, "%d", temp); - if (gTemperatureshowflag == 0) { - if (temp > 99) - str[3] = 'C'; - else { - str[2] = 'C'; - str[3] = ' '; - } - } else { - if (temp > 99) - str[3] = 'E'; - else { - str[2] = 'E'; - str[3] = ' '; - } - } - - Display_Str10(1, str); - - Oled_DrawArea(41, 0, 16, 16, (u8*) (Guide + (guide_ui++) * 32)); - - if (guide_ui == 3) - guide_ui = 0; - - memset(str, 0x0, 6); - sprintf(str, "%d", dst_temp); - if (gTemperatureshowflag == 0) { - if (temp > 99) - str[3] = 'C'; - else { - str[2] = 'C'; - str[3] = ' '; - } - } else { - if (temp > 99) - str[3] = 'E'; - else { - str[2] = 'E'; - str[3] = ' '; - } - } - - Display_Str10(56, str); -} -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Show_Cal(u8 flag) { - u8 i; - u8* ptr = 0; - - if (flag == 1) - ptr = (u8*) Cal_Done; - else if (flag == 2) - ptr = (u8*) Cal_UnDone; - - ptr = Oled_DrawArea(0, 0, 16, 16, (u8*) ptr); - - for (i = 1; i < 6; i++) - ptr = Oled_DrawArea(16 * i, 0, 16, 16, (u8*) ptr); - Delay_Ms(1000); - Clear_Watchdog(); -} -/******************************************************************************* - Function: - Description: - *******************************************************************************/ -void Show_Warning(void) { - u8 i; - u8* ptr = 0; - static u8 flag = 0; - - switch (Get_AlarmType()) { - case HIGH_TEMP: - ptr = (u8*) Warning; - break; - case SEN_ERR: - ptr = (u8*) SenErr; - break; - case HIGH_VOLTAGE: - ptr = (u8*) HighVt; - break; - case LOW_VOLTAGE: - ptr = (u8*) LowVot; - break; - } - - Oled_DrawArea(0, 0, 16, 16, (u8*) Warning + 20 * 7); - if (flag == 0) { - for (i = 2; i < 9; i++) - Oled_DrawArea(10 * i, 0, 10, 16, (u8*) ptr + (i - 2) * 20); - flag = 1; - } else { - Clean_Char(16, 80); - flag = 0; - } -} - -/***************************************************************** - Function: Show_Triangle - Description:Draws in a triangle - Input:(empty_trgl) - - empty_trgl: 0,1,2 ���Ӵ�,��Ӵ�,�ҼӴ� - fill_trgl: 0,1,2 ��ʵ��,��ʵ��,��ʵ�� - *******************************************************************/ -void Show_Triangle(u8 empty_trgl, u8 fill_trgl) { - u8* ptr; - ptr = (u8*) Triangle; //Get pointer to the pre-computed triangle array - if ((empty_trgl == 0) && (fill_trgl == 0)) { - ptr = Oled_DrawArea(0, 0, 16, 16, (u8*) ptr); - ptr = Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr); - } else if ((empty_trgl != 0) && (fill_trgl == 0)) { - if (empty_trgl == 1) { - ptr += 32; - Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr); - ptr += 32; - Oled_DrawArea(0, 0, 16, 16, (u8*) ptr); - } else if (empty_trgl == 2) { - Oled_DrawArea(0, 0, 16, 16, (u8*) ptr); - ptr += 32 * 3; - Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr); - } - } else if ((empty_trgl == 0) && (fill_trgl != 0)) { - if (fill_trgl == 1) { - ptr += 32; - Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr); - ptr += 32 * 3; - Oled_DrawArea(0, 0, 16, 16, (u8*) ptr); - } else if (fill_trgl == 2) { - Oled_DrawArea(0, 0, 16, 16, (u8*) ptr); - ptr += 32 * 5; - Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr); - } - } -} -/******************************************************************************* - ������: Shift_Char - ��������:�ַ����������ƶ���ָ��λ�� - �������:ptr �ƶ����ַ� pos �ƶ�����ָ��λ�� - ���ز���:NULL - *******************************************************************************/ -void Shift_Char(u8* ptr, u8 pos) { - int k; - u8* ptr0; - - k = 80; - pos = pos * 16; //�* �ַ�= �ַ�����λ�� - while (k >= pos) { - ptr0 = (u8*) ptr; - Clean_Char(k + 16, 16); - ptr0 = Oled_DrawArea(k, 0, 16, 16, (u8*) ptr0); - k -= 16; - Delay_Ms(25); - } -} - -/******************************************************************************* - Function:Show_Set - Description: Show the setpoint temp on the Oled - *******************************************************************************/ -void Show_Set(void) { - u8 m, k; - s16 num_temp; - - if (Get_TemperatureShowFlag() == 1) { - num_temp = TemperatureShow_Change(0, device_info.t_work); - } else { - num_temp = device_info.t_work; - } - - Shift_Char((u8*) Triangle + 0 * 32, 0); - m = num_temp / 1000; //�� - Shift_Char((u8*) wordlib + m * 32, 1); - k = (num_temp - m * 1000) / 100; //Ê® - Shift_Char((u8*) wordlib + k * 32, 2); - m = (num_temp - m * 1000 - k * 100) / 10; - Shift_Char((u8*) wordlib + m * 32, 3); - Shift_Char((u8*) wordlib + 13 * 32, 4); - Shift_Char((u8*) Triangle + 1 * 32, 5); -} -/******************************************************************************* - ������: Show_OrderChar - ��������:����̬��ʾ�ַ� - �������: ptr:�ֽڿ�num:����width:��� - ���ز���:NULL - *******************************************************************************/ -void Show_OrderChar(u8* ptr, u8 num, u8 width) { - static u8 i = 1, j = 0, k = 0, m = 10; - //i��Դ���鿪ʼλ - //j��Ŀ�����鿪ʼλ - //m�������ij��� - - if (gLevel_flag == 0) { //ǰһ״̬���Ǻ��� - i = 1; - j = 0; - m = 8; - gUp_flag = 0; - gDown_flag = 0; - gLevel_flag = 1; - } - - if (i == 0) { - for (k = 0; k <= m; k++) { - gTemp_array[k] = *(ptr + 52 + j + k - 1); - gTemp_array[k + width] = *(ptr + 52 + width + k + j - 1); - } - m++; - j--; - if (m == 11) { - m--; - j = 0; - i = 1; - return; - } - } - - if (j == 0) { - for (k = 1; k < m; k++) { - gTemp_array[k + i] = *(ptr + 52 + j + k - 1); - gTemp_array[k + i + width] = *(ptr + 52 + width + k + j - 1); - } - m--; - i++; - if (m == 0) { - m++; - j = 9; - i = 0; - } - } -} - -/******************************************************************************* - Function:Reverse_Bin8 - Description:Reverses the bit order of a uint8_t - Input:Value to reverse - Output:Reversed Value - *******************************************************************************/ -u8 Reverse_Bin8(u8 data) { - u8 i, cache, result = 0; - - for (i = 0; i < 8; i++) { - cache = data & (1 << i); - if (i < 4) { - cache <<= 7 - 2 * i; - } else { - cache >>= 2 * i - 7; - } - result += cache; - } - return result; -} -/******************************************************************************* - ������: Show_ReverseChar - ��������:����̬��ʾ�ַ� - �������: ptr:�ֽڿ� num:���� - width:��� direction :���� (0 up, 1 down) - ���ز���:NULL - *******************************************************************************/ -void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction) { - static u32 j = 0, m = 0, po_j[3] = { 0, 0, 0 }, po_m[3] = { 0, 0, 16 }; - u32 i, k; - - if (direction == 0) { //up - if (gUp_flag == 0) { //ǰһ״̬���Ǽ��� - j = 0; - m = 0; - gUp_flag = 1; - gDown_flag = 0; - gLevel_flag = 0; - } else { - j = po_j[0]; - m = po_m[0]; - } - } else if (direction == 1) { - if (gDown_flag == 0) { //ǰһ״̬���ǽ��� - j = 0; - m = 0; - gUp_flag = 0; - gDown_flag = 1; - gLevel_flag = 0; - } else { - j = po_j[1]; - m = po_m[1]; - } - } else { - j = po_j[2]; - m = po_m[2]; - } - for (i = 0; i < width * 2 * num; i++) - gTemp_array[i] = Reverse_Bin8(*(ptr + i)); //����8λ - - for (k = 0; k < width * 2 * num; k += width * 2) - for (i = 0; i < width; i++) { - gTemp_array_u16[i + k] = ((gTemp_array[i + k] & 0x00FF) << 8) - | gTemp_array[i + k + width]; //�ϰ벿�°벿���u16 ������λ - if (direction == 1) { - if (j == 0) - gTemp_array_u16[i + k] <<= m; //����գ�������ʾ - else - gTemp_array_u16[i + k] >>= j; //����գ�������ʾ - } else { //�� - if (m == 0) - gTemp_array_u16[i + k] <<= j; //����գ�������ʾ - else - gTemp_array_u16[i + k] >>= m; //����գ�������ʾ - } - gTemp_array[i + k] = (gTemp_array_u16[i + k] & 0xFF00) >> 8; - gTemp_array[i + k + width] = gTemp_array_u16[i + k] & 0x00FF; - } - - for (i = 0; i < width * 2 * num; i++) - gTemp_array[i] = Reverse_Bin8(gTemp_array[i]); //��������� - - if (m == 0 && j == 16) { //ȫ��ʾ������ʾ'ͷ��' - j = 0; - m = 16; - } - if (m == 0) - j++; - else - m--; - - if (direction == 0) { //up - po_j[0] = j; - po_m[0] = m; - } else if (direction == 1) { - po_j[1] = j; - po_m[1] = m; - } else { - po_j[2] = j; - po_m[2] = m; - } -} - -/******************************************************************************* - Show_TempReverse ����̬��ʾ�¶��ַ� - word_num: ���� - word_width: ��� - direction : ���� (0 up, 1 down) - *******************************************************************************/ -u8 Show_TempReverse(u8 num, u8 width, u8 direction) { - static int i, j = 0, m = 16, k; - u8 g, s, b; - u8* ptr; - s16 num_temp; - - if (Get_TemperatureShowFlag() == 1) { - num_temp = TemperatureShow_Change(0, device_info.t_work); - } else { - num_temp = device_info.t_work; - } - - num_temp = num_temp / 10; - b = num_temp / 100; - s = (num_temp - b * 100) / 10; - g = (num_temp - b * 100 - s * 10); - - if (gTempset_showctrl == 1) { - j = 1; - m = 0; - gTempset_showctrl = 0; - } else if (gTempset_showctrl == 2) { - j = 0; - m = 16; - gTempset_showctrl = 0; - } - for (i = 0; i < width * 2; i++) { - gTemp_array[0 * 32 + i] = Reverse_Bin8(*(wordlib + b * 32 + i)); //����8λ - gTemp_array[1 * 32 + i] = Reverse_Bin8(*(wordlib + s * 32 + i)); //����8λ - gTemp_array[2 * 32 + i] = Reverse_Bin8(*(wordlib + g * 32 + i)); //����8λ - if (Get_TemperatureShowFlag() == 1) { - gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 15 * 32 + i)); //����8λ - } else { - gTemp_array[3 * 32 + i] = Reverse_Bin8(*(wordlib + 13 * 32 + i)); //����8λ - } - } - //�޸�K �ij�ʼֵ�ܸı俪ʼ�������ַ�λ�ø�λ����ʮλ���ǰ�λ - for (k = (3 - num) * width * 2; k < width * 2 * 3; k += width * 2) - for (i = 0; i < width; i++) { - gTemp_array_u16[i + k] = ((gTemp_array[i + k] & 0x00FF) << 8) - | gTemp_array[i + k + width]; //�ϰ벿�°벿���u16 ������λ - if (direction == 0) { //�� - if (m == 0) - gTemp_array_u16[i + k] <<= j; //����գ�������ʾ - else - gTemp_array_u16[i + k] >>= m; //����գ�������ʾ - } else { - if (j == 0) - gTemp_array_u16[i + k] <<= m; //����գ�������ʾ - else - gTemp_array_u16[i + k] >>= j; //����գ�������ʾ - } - gTemp_array[i + k] = (gTemp_array_u16[i + k] & 0xFF00) >> 8; - gTemp_array[i + k + width] = gTemp_array_u16[i + k] & 0x00FF; - } - for (i = 0; i < width * 2; i++) { - gTemp_array[0 * 32 + i] = Reverse_Bin8(gTemp_array[0 * 32 + i]); - gTemp_array[1 * 32 + i] = Reverse_Bin8(gTemp_array[1 * 32 + i]); - gTemp_array[2 * 32 + i] = Reverse_Bin8(gTemp_array[2 * 32 + i]); - gTemp_array[3 * 32 + i] = Reverse_Bin8(gTemp_array[3 * 32 + i]); - } - - ptr = (u8*) gTemp_array; - for (i = 1; i <= 4; i++) - ptr = Oled_DrawArea(16 * i, 0, 16, 16, (u8*) ptr); - if ((m == 0 && j == 0) || (m == 0 && j == 16)) - return 0; - if (m == 0) - j++; - else - m--; - return 1; -} - -/******************************************************************************* - ������: Show_HeatingIcon - ��������:��̬ѡ����ȵ�״̬��ʶ - �������: ht_flag ���±�ʾ active �ƶ���ʶ - ���ز���:NULL - *******************************************************************************/ -void Show_HeatingIcon(u32 ht_flag, u16 active) { - u8* ptr; - - memset(gTemp_array, 0, 20); - if (ht_flag == 0) - Show_ReverseChar((u8*) TempIcon, 1, 10, 0); //(5,ptr,16);//����// - else if (ht_flag == 1) - Show_ReverseChar((u8*) TempIcon + 32, 1, 10, 1); //(5,ptr+32,16);//����// - else if (ht_flag == 2) - Show_OrderChar((u8*) TempIcon, 1, 10); //(5,ptr+64,16);//����// - - ptr = (u8*) gTemp_array; - Oled_DrawArea(86, 0, 10, 16, (u8*) ptr); - - if (Get_CtrlStatus() == WAIT) - Oled_DrawArea(80, 0, 6, 16, (u8*) IhIcon + 12); - else { - if (active == 0) - Oled_DrawArea(80, 0, 6, 16, (u8*) TempIcon + 20); - else - Oled_DrawArea(80, 0, 6, 16, (u8*) IhIcon); - } -} -/******************************************************************************* - ������: Display_Str - ��������:��ʾ16*16�ַ��� - �������:x: � str :��ʾ�ַ��� - ���ز���:NULL - *******************************************************************************/ -void Display_Str(u8 x, char* str) { - u8* ptr; - u8 temp; - - if ((x < 1) || (x > 8)) - x = 0; - else - x--; - while (*str != 0) { - temp = *str++; - if (temp == ' ') - temp = 10; - else if (temp == '-') - temp = 12; - else { - if ((temp >= 0x30) && (temp < 0x3a)) - temp = temp - 0x30; /* 0 --9 */ - else { - if ((temp >= 0x41) && (temp <= 0x46)) - temp = temp - 0x41 + 11;/*ABD*/ - else - return; - } - } - ptr = (u8*) wordlib; - ptr += temp * 32; - Oled_DrawArea(x * 16, 0, 16, 16, (u8*) ptr); - x++; - } -} -/******************************************************************************* - ������: Display_Str10 - ��������:��ʾ���Ϊ10���ַ��� - �������:x: � str :��ʾ�ַ��� - ���ز���:NULL - *******************************************************************************/ -void Display_Str10(u8 x, char* str) { - u8* ptr; - u8 temp; - u8 position = 0; - - while (*str != 0) { - temp = *str++; - if (temp == 'C') - temp = 11; - else if (temp == 'E') - temp = 12; - else { - if ((temp >= 0x30) && (temp < 0x3a)) - temp = temp - 0x30; /* 0 --9 */ - else { - temp = 10; - } - } - ptr = (u8*) Number10; - ptr += temp * 20; - Oled_DrawArea(x + position * 10, 0, 10, 16, (u8*) ptr); - position++; - } -} - -/******************************************************************************* - ������: Print_Integer - ��������:�������ݴ�ӡ���� - �������:data ����,posi � - ���ز���:NULL - *******************************************************************************/ -void Print_Integer(s32 data, u8 posi) { - char str[8]; - - Clear_Screen(); - sprintf(str, "%d", data); - Display_Str(posi, str); -} -/******************************************************************************* - ������: Calculation_TWork - ��������:���������¶ȵ�ֵ(�Ӽ����ò�����Ľ��) - �������:Flag (0+ or 1-) - ���ز���:�¶ȼӼ����ò�����Ľ�� - *******************************************************************************/ -u32 Calculation_TWork(u8 Flag) { - s16 num_temp; - - if (Get_TemperatureShowFlag() == 1) { - num_temp = TemperatureShow_Change(0, device_info.t_work); - if (Flag == 0) - num_temp += device_info.t_step; - else - num_temp -= device_info.t_step; - return TemperatureShow_Change(1, num_temp); - } else { - if (Flag == 0) - return (device_info.t_work + device_info.t_step); - else - return (device_info.t_work - device_info.t_step); - } -} -/******************************************************************************* - ������: Roll_Num - ��������:�����У���Ҫ�������¶�ֵ��λ�� - �������:step ����,Flag (0+ or 1-) - ���ز���:��Ҫ�����ĸ��� - *******************************************************************************/ -u8 Roll_Num(u16 step, u8 flag) { - u16 b1, b2, g1, g2; - s16 num_temp; - - if (Get_TemperatureShowFlag() == 1) { - num_temp = TemperatureShow_Change(0, device_info.t_work); - } else { - num_temp = device_info.t_work; - } - b2 = (num_temp) / 1000; - g2 = (num_temp) / 100; - - if (flag == 0) { - b1 = (num_temp + step) / 1000; - g1 = (num_temp + step) / 100; - if (b1 != b2) - return 3; - else if (g1 != g2) - return 2; - else - return 1; - } else { - b1 = (num_temp - step) / 1000; - g1 = (num_temp - step) / 100; - - if (b1 != b2) - return 3; - else if (g1 != g2) - return 2; - else - return 1; - } -} -/******************************************************************************* - ������: Temp_SetProc - ��������:�����¶� - �������:NULL - ���ز���:NULL - *******************************************************************************/ -void Temp_SetProc(void) { - u8 theRoll_num = 3; - static u16 cont = 0; - - if (device_info.t_step == 10) - cont = 1; - - if (EFFECTIVE_KEY_TIMER> 0) { - if(gCont != 0) { - //���ý������������� - gCont = 0; - Set_LongKeyFlag(0); - Clear_Screen(); - - Show_Set(); - } - switch(Get_gKey()) { - case KEY_V1: - //����,���·�,��ǰ����ʾ��ʧ - //����ֵ���� - if(device_info.t_work > gSet_table[1]) { - gTempset_showctrl = 1; - theRoll_num = Roll_Num(device_info.t_step,1); - while(Show_TempReverse(theRoll_num,16,1)); - device_info.t_work = Calculation_TWork(1); - if(device_info.t_work < gSet_table[1]) device_info.t_work = gSet_table[1]; - gTempset_showctrl = 2; - while(Show_TempReverse(theRoll_num,16,1)); - Show_Triangle(1,0); - } - if(device_info.t_work == gSet_table[1]) Show_Triangle(0,1); - break; - case KEY_V2: - //����,���Ϸ�,��ǰ����ʾ��ʧ - //����ֵ���� - if(device_info.t_work < gSet_table[0]) { - gTempset_showctrl = 1; - theRoll_num = Roll_Num(device_info.t_step,0); - while(Show_TempReverse(theRoll_num,16,0)); - device_info.t_work = Calculation_TWork(0); - if(device_info.t_work > gSet_table[0]) device_info.t_work = gSet_table[0]; - gTempset_showctrl = 2; - while(Show_TempReverse(theRoll_num,16,0)); - Show_Triangle(2,0); - } - - if(device_info.t_work == gSet_table[0]) Show_Triangle(0,2); - break; - default: - break; - } - if(Get_gKey() > NO_KEY) { - if(cont > 0 && EFFECTIVE_KEY_TIMER > 260) { - device_info.t_step = 10 + cont * 50; - cont++; - } - EFFECTIVE_KEY_TIMER = 300; - Set_gKey(NO_KEY); - } - if(cont > 0 && EFFECTIVE_KEY_TIMER <= 260) { - device_info.t_step = 10; - cont = 1; - } - } -} - -/******************************************************************************* - Function: - Description: This function draws in the appropriate content to the Oled as per the current program status - *******************************************************************************/ -void OLed_Display(void) { - u16 ht_flag; - s16 temp_val, dst_temp; - static u8 td_flag = 0, config_show = 0; - static u16 td_cnt = 0; - static u16 bk = 0x33, id_cnt = 0; - - switch (Get_CtrlStatus()) { - case IDLE: - if (gCont == 1) { - gCont = 0; - Clear_Screen(); - } - - if (UI_TIMER== 0 && G6_TIMER != 0) { - Show_Notice(); - UI_TIMER = 50; - } - if(G6_TIMER == 0) { //���� - id_cnt++; - if(id_cnt == 50)Sc_Pt(bk--); - if(bk == 0) Oled_DisplayOff(); - } - if((Get_MmaShift() == 1) || (Get_gKey() != NO_KEY)) { - G6_TIMER = device_info.idle_time; //reset the idle timer - bk = 0x33; - Sc_Pt(bk); - Oled_DisplayOn(); - } - break; - case TEMP_CTR: - if(gCont == 0) { - gCont = 1; - Set_LongKeyFlag(1); - Clear_Screen(); - } - ht_flag = Get_HtFlag(); - if(ht_flag != 1) { - if(td_flag == 1) Clear_Screen(); - td_cnt = 0; - td_flag = 0; - } - - if(td_cnt == 75 && td_flag == 0) { - Clear_Screen(); - td_flag = 1; - } - - if(td_flag && UI_TIMER == 0) { - temp_val = Get_TempVal(); - dst_temp = device_info.t_work; - if(Get_TemperatureShowFlag() == 1) { - temp_val = TemperatureShow_Change(0,temp_val); - dst_temp = TemperatureShow_Change(0,dst_temp); - } - Show_TempDown(temp_val,dst_temp); - UI_TIMER = 50; - } - if((TEMPSHOW_TIMER == 0) && (!td_flag)) { - temp_val = Get_TempVal(); - if((temp_val > device_info.t_work) && (temp_val - device_info.t_work < 18)) temp_val = device_info.t_work; - else if((temp_val <= device_info.t_work) && (device_info.t_work - temp_val < 18)) temp_val = device_info.t_work; - if(Get_TemperatureShowFlag() == 1) { - temp_val = TemperatureShow_Change(0,temp_val); - } - - Display_Temp(1,temp_val/10); - Show_HeatingIcon(ht_flag,Get_MmaActive()); //0����1����2���� - td_cnt++; - } - break; - case TEMP_SET: - Temp_SetProc(); //���� - break; - case CONFIG: - if(gCont == 1) { - gCont = 0; - Clear_Screen(); - } - switch(Get_gKey()) { - case KEY_CN|KEY_V1: - config_show = 1; - break; - case KEY_CN|KEY_V2: - config_show = 2; - break; - case KEY_CN|KEY_V3: - config_show = 0; - break; - default: - break; - } - if(config_show == 0) { - Show_Config(); - } - if(config_show != 3) { - Set_gKey(NO_KEY); - config_show = 3; - } - break; - case THERMOMETER: - if(gCont == 0) { - gCont = 1; - Clear_Screen(); - } - if(gCalib_flag != 0) { - //��ʾУ׼��� - Show_Cal(gCalib_flag); - gCalib_flag = 0; - Clear_Screen(); - } - if(UI_TIMER == 0) { - temp_val = Get_Temp(0); - if(Get_TemperatureShowFlag() == 1) { - temp_val = TemperatureShow_Change(0,temp_val); - } - Display_Temp(1,temp_val/10); - Display_Str(6,"F"); - UI_TIMER = 20; - } - break; - case ALARM: - if(gCont == 0) { - gCont = 1; - Clear_Screen(); - } - if(gCont == 1 && UI_TIMER == 0) { - Show_Warning(); - UI_TIMER = 50; - } - break; - case WAIT: - temp_val = Get_TempVal(); - if((temp_val > device_info.t_standby) && (temp_val - device_info.t_standby <= 18)) temp_val = device_info.t_standby; - else if((temp_val <= device_info.t_standby) && (device_info.t_standby - temp_val <= 18)) temp_val = device_info.t_standby; - - ht_flag = Get_HtFlag(); - - if(ht_flag != 1) { - if(td_flag == 1) Clear_Screen(); - td_cnt = 0; - td_flag = 0; - } - - if(td_cnt == 50 && td_flag == 0) { - Clear_Screen(); - td_flag = 1; - } - - if(td_flag && UI_TIMER == 0) { - dst_temp = device_info.t_standby; - if(Get_TemperatureShowFlag() == 1) { - temp_val = TemperatureShow_Change(0,temp_val); - dst_temp = TemperatureShow_Change(0,dst_temp); - } - Show_TempDown(temp_val,dst_temp); - UI_TIMER = 50; - } - if((TEMPSHOW_TIMER == 0) && (!td_flag)) { - if(Get_TemperatureShowFlag() == 1) { - temp_val = TemperatureShow_Change(0,temp_val); - } - Display_Temp(1,temp_val/10); - Show_HeatingIcon(ht_flag,Get_MmaActive()); //0����1����2���� - td_cnt++; - } - break; - default: - break; - } -} - -/******************************** END OF FILE *********************************/ diff --git a/workspace/ts100/src/usb_bot.c b/workspace/ts100/src/usb_bot.c deleted file mode 100644 index 055d5832..00000000 --- a/workspace/ts100/src/usb_bot.c +++ /dev/null @@ -1,269 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_bot.c - Version : STM32_USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#include "usb_scsi.h" -#include "usb_regs.h" -#include "usb_mem.h" -#include "usb_conf.h" -#include "usb_bot.h" -#include "usb_prop.h" - -u8 Bot_State; -u8 Bulk_Buff[BULK_MAX_PACKET_SIZE]; // Data_ data buffer -u16 Data_Len; -Bulk_Only_CBW CBW; -Bulk_Only_CSW CSW; -u32 SCSI_LBA , SCSI_BlkLen; - -/******************************************************************************* - Mass_Storage_In: Mass Storage IN transfer. -*******************************************************************************/ -void Mass_Storage_In (void) -{ - switch (Bot_State) - { - case BOT_CSW_Send: - case BOT_ERROR: - Bot_State = BOT_IDLE; - SetEPRxStatus(ENDP2, EP_RX_VALID);/* enable the Endpoint to receive the next cmd*/ - break; - case BOT_DATA_IN: - switch (CBW.CB[0]) - { - case SCSI_READ10: - SCSI_Read10_Cmd(SCSI_LBA , SCSI_BlkLen); - break; - } - break; - case BOT_DATA_IN_LAST: - Set_CSW (CSW_CMD_PASSED, SEND_CSW_ENABLE); - SetEPRxStatus(ENDP2, EP_RX_VALID); - break; - - default: - break; - } -} -/******************************************************************************* - Mass_Storage_Out: Mass Storage OUT transfer. -*******************************************************************************/ -void Mass_Storage_Out (void) -{ - u8 CMD; - CMD = CBW.CB[0]; - Data_Len = GetEPRxCount(ENDP2); - - PMAToUserBufferCopy(Bulk_Buff, ENDP2_RXADDR, Data_Len); - - switch (Bot_State) - { - case BOT_IDLE: - CBW_Decode(); - break; - case BOT_DATA_OUT: - if (CMD == SCSI_WRITE10) - { - SCSI_Write10_Cmd(SCSI_LBA , SCSI_BlkLen); - break; - } - Bot_Abort(DIR_OUT); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_PHASE_ERROR, SEND_CSW_DISABLE); - break; - default: - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_PHASE_ERROR, SEND_CSW_DISABLE); - break; - } -} -/******************************************************************************* - CBW_Decode: Decode the received CBW and call the related SCSI command -*******************************************************************************/ -void CBW_Decode(void) -{ - u32 Counter; - - for (Counter = 0; Counter < Data_Len; Counter++) - { - *((u8 *)&CBW + Counter) = Bulk_Buff[Counter]; - } - CSW.dTag = CBW.dTag; - CSW.dDataResidue = CBW.dDataLength; - if (Data_Len != BOT_CBW_PACKET_LENGTH) - { - Bot_Abort(BOTH_DIR); - // reset the CBW.dSignature to desible the clear feature until receiving a Mass storage reset - CBW.dSignature = 0; - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, PARAMETER_LIST_LENGTH_ERROR); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - return; - } - - if ((CBW.CB[0] == SCSI_READ10 ) || (CBW.CB[0] == SCSI_WRITE10 )) - { - // Calculate Logical Block Address - SCSI_LBA = (CBW.CB[2] << 24) | (CBW.CB[3] << 16) | (CBW.CB[4] << 8) | CBW.CB[5]; - // Calculate the Number of Blocks to transfer - SCSI_BlkLen = (CBW.CB[7] << 8) | CBW.CB[8]; - } - - if (CBW.dSignature == BOT_CBW_SIGNATURE) - { - // Valid CBW - if ((CBW.bLUN > Max_Lun) || (CBW.bCBLength < 1) || (CBW.bCBLength > 16)) - { - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - } - else - { - switch (CBW.CB[0]) - { - case SCSI_REQUEST_SENSE: - SCSI_RequestSense_Cmd (); - break; - case SCSI_INQUIRY: - SCSI_Inquiry_Cmd(); - break; - case SCSI_START_STOP_UNIT: - SCSI_Start_Stop_Unit_Cmd(); - break; - case SCSI_ALLOW_MEDIUM_REMOVAL: - SCSI_Start_Stop_Unit_Cmd(); - break; - case SCSI_MODE_SENSE6: - SCSI_ModeSense6_Cmd (); - break; - case SCSI_MODE_SENSE10: - SCSI_ModeSense10_Cmd (); - break; - case SCSI_READ_FORMAT_CAPACITIES: - SCSI_ReadFormatCapacity_Cmd(); - break; - case SCSI_READ_CAPACITY10: - SCSI_ReadCapacity10_Cmd(); - break; - case SCSI_TEST_UNIT_READY: - SCSI_TestUnitReady_Cmd(); - break; - case SCSI_READ10: - SCSI_Read10_Cmd(SCSI_LBA , SCSI_BlkLen); - break; - case SCSI_WRITE10: - SCSI_Write10_Cmd(SCSI_LBA , SCSI_BlkLen); - break; - case SCSI_VERIFY10: - SCSI_Verify10_Cmd(); - break; - //Unsupported command - case SCSI_MODE_SELECT10: - SCSI_Mode_Select10_Cmd(); - break; - case SCSI_MODE_SELECT6: - SCSI_Mode_Select6_Cmd(); - break; - - case SCSI_SEND_DIAGNOSTIC: - SCSI_Send_Diagnostic_Cmd(); - break; - case SCSI_READ6: - SCSI_Read6_Cmd(); - break; - case SCSI_READ12: - SCSI_Read12_Cmd(); - break; - case SCSI_READ16: - SCSI_Read16_Cmd(); - break; - case SCSI_READ_CAPACITY16: - SCSI_READ_CAPACITY16_Cmd(); - break; - case SCSI_WRITE6: - SCSI_Write6_Cmd(); - break; - case SCSI_WRITE12: - SCSI_Write12_Cmd(); - break; - case SCSI_WRITE16: - SCSI_Write16_Cmd(); - break; - case SCSI_VERIFY12: - SCSI_Verify12_Cmd(); - break; - case SCSI_VERIFY16: - SCSI_Verify16_Cmd(); - break; - - default: - { - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - } - } - } - } - else - { - // Invalid CBW - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - } -} -/******************************************************************************* - Transfer_Data_Request: Send the request response to the PC HOST. - Input : u8* Data_Address : point to the data to transfer. - u16 Data_Length : the nember of Bytes to transfer. -*******************************************************************************/ -void Transfer_Data_Request(u8* Data_Pointer, u16 Data_Len) -{ - UserToPMABufferCopy(Data_Pointer, ENDP1_TXADDR, Data_Len); - SetEPTxCount(ENDP1, Data_Len); - SetEPTxStatus(ENDP1, EP_TX_VALID); - Bot_State = BOT_DATA_IN_LAST; - CSW.dDataResidue -= Data_Len; - CSW.bStatus = CSW_CMD_PASSED; -} -/******************************************************************************* - Set_CSW: Set the SCW with the needed fields. - Input : u8 CSW_Status this filed can be CSW_CMD_PASSED,CSW_CMD_FAILED, - or CSW_PHASE_ERROR. -*******************************************************************************/ -void Set_CSW (u8 CSW_Status, u8 Send_Permission) -{ - CSW.dSignature = BOT_CSW_SIGNATURE; - CSW.bStatus = CSW_Status; - UserToPMABufferCopy(((u8 *)& CSW), ENDP1_TXADDR, CSW_DATA_LENGTH); - SetEPTxCount(ENDP1, CSW_DATA_LENGTH); - Bot_State = BOT_ERROR; - if (Send_Permission){ - Bot_State = BOT_CSW_Send; - SetEPTxStatus(ENDP1, EP_TX_VALID); - } -} -/******************************************************************************* - Bot_Abort: Stall the needed Endpoint according to the selected direction. - Input : Endpoint direction IN, OUT or both directions -*******************************************************************************/ -void Bot_Abort(u8 Direction) -{ - switch (Direction){ - case DIR_IN : - SetEPTxStatus(ENDP1, EP_TX_STALL); - break; - case DIR_OUT : - SetEPRxStatus(ENDP2, EP_RX_STALL); - break; - case BOTH_DIR : - SetEPTxStatus(ENDP1, EP_TX_STALL); - SetEPRxStatus(ENDP2, EP_RX_STALL); - break; - default: - break; - } -} -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/usb_desc.c b/workspace/ts100/src/usb_desc.c deleted file mode 100644 index e005e6f2..00000000 --- a/workspace/ts100/src/usb_desc.c +++ /dev/null @@ -1,109 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_desc.c - Version : STM32_USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#include "usb_desc.h" - -const u8 MASS_DeviceDescriptor[MASS_SIZ_DEVICE_DESC] ={ - 0x12, /* bLength */ - 0x01, /* bDescriptorType */ - 0x00, /* bcdUSB, version 2.00 */ - 0x02, - 0x00, /* bDeviceClass : each interface define the device class */ - 0x00, /* bDeviceSubClass */ - 0x00, /* bDeviceProtocol */ - 0x40, /* bMaxPacketSize0 0x40 = 64 */ - 0x83, /* idVendor (0483) */ - 0x04, - 0x20, /* idProduct */ - 0x57, - 0x00, /* bcdDevice 2.00*/ - 0x02, - 1, /* index of string Manufacturer */ - /**/ - 2, /* index of string descriptor of product*/ - /* */ - 3, /* */ - /* */ - /* */ - 0x01 /*bNumConfigurations */ - }; -const u8 MASS_ConfigDescriptor[MASS_SIZ_CONFIG_DESC] ={ - 0x09, /* bLength: Configuation Descriptor size */ - 0x02, /* bDescriptorType: Configuration */ - MASS_SIZ_CONFIG_DESC, - 0x00, - 0x01, /* bNumInterfaces: 1 interface */ - 0x01, /* bConfigurationValue: */ - /* Configuration value */ - 0x00, /* iConfiguration: */ - /* Index of string descriptor */ - /* describing the configuration */ - 0xC0, /* bmAttributes: */ - /* bus powered */ - 0x32, /* MaxPower 100 mA */ - - /******************** Descriptor of Mass Storage interface ********************/ - /* 09 */ - 0x09, /* bLength: Interface Descriptor size */ - 0x04, /* bDescriptorType: */ - /* Interface descriptor type */ - 0x00, /* bInterfaceNumber: Number of Interface */ - 0x00, /* bAlternateSetting: Alternate setting */ - 0x02, /* bNumEndpoints*/ - 0x08, /* bInterfaceClass: MASS STORAGE Class */ - 0x06, /* bInterfaceSubClass : SCSI transparent*/ - 0x50, /* nInterfaceProtocol */ - 4, /* iInterface: */ - /* 18 */ - 0x07, /*Endpoint descriptor length = 7*/ - 0x05, /*Endpoint descriptor type */ - 0x81, /*Endpoint address (IN, address 1) */ - 0x02, /*Bulk endpoint type */ - 0x40, /*Maximum packet size (64 bytes) */ - 0x00, - 0x00, /*Polling interval in milliseconds */ - /* 25 */ - 0x07, /*Endpoint descriptor length = 7 */ - 0x05, /*Endpoint descriptor type */ - 0x02, /*Endpoint address (OUT, address 2) */ - 0x02, /*Bulk endpoint type */ - 0x40, /*Maximum packet size (64 bytes) */ - 0x00, - 0x00 /*Polling interval in milliseconds*/ - /*32*/ - }; -const u8 MASS_StringLangID[MASS_SIZ_STRING_LANGID] ={ - MASS_SIZ_STRING_LANGID, - 0x03, - 0x09, - 0x04 - }; // LangID = 0x0409: U.S. English // -const u8 MASS_StringVendor[MASS_SIZ_STRING_VENDOR] ={ - MASS_SIZ_STRING_VENDOR, // Size of manufaturer string // - 0x03, // bDescriptorType = String descriptor // - // Manufacturer: "STMicroelectronics" // - 'S', 0, 'T', 0, 'M', 0, 'i', 0, 'c', 0, 'r', 0, 'o', 0, 'e', 0, - 'l', 0, 'e', 0, 'c', 0, 't', 0, 'r', 0, 'o', 0, 'n', 0, 'i', 0, - 'c', 0, 's', 0 - }; -const u8 MASS_StringProduct[MASS_SIZ_STRING_PRODUCT] ={ - MASS_SIZ_STRING_PRODUCT, - 0x03, - // Product name: "STM32F10x:USB Mass Storage" // - 'S', 0, 'T', 0, 'M', 0, '3', 0, '2', 0, ' ', 0, 'M', 0, 'a', 0, 's', 0, - 's', 0, ' ', 0, 'S', 0, 't', 0, 'o', 0, 'r', 0, 'a', 0, 'g', 0, 'e', 0 - }; -u8 MASS_StringSerial[MASS_SIZ_STRING_SERIAL] ={ - MASS_SIZ_STRING_SERIAL, - 0x03, - // Serial number// - 'S', 0, 'T', 0, 'M', 0, '3', 0, '2', 0, '1', 0, '0', 0 - }; -const u8 MASS_StringInterface[MASS_SIZ_STRING_INTERFACE] ={ - MASS_SIZ_STRING_INTERFACE, - 0x03, - // Interface 0: "ST Mass" // - 'S', 0, 'T', 0, ' ', 0, 'M', 0, 'a', 0, 's', 0, 's', 0 - }; -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/usb_istr.c b/workspace/ts100/src/usb_istr.c deleted file mode 100644 index 7d91c011..00000000 --- a/workspace/ts100/src/usb_istr.c +++ /dev/null @@ -1,138 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_istr.c - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#include "usb_type.h" -#include "usb_regs.h" -#include "usb_pwr.h" -#include "usb_istr.h" -#include "usb_init.h" -#include "usb_int.h" -#include "usb_bot.h" - -volatile u16 wIstr; /* ISTR register last read value */ -volatile u8 bIntPackSOF = 0; /* SOFs received between 2 consecutive packets */ - -void (*pEpInt_IN[7])(void) ={ - EP1_IN_Callback, - EP2_IN_Callback, - EP3_IN_Callback, - EP4_IN_Callback, - EP5_IN_Callback, - EP6_IN_Callback, - EP7_IN_Callback, - }; -void (*pEpInt_OUT[7])(void) ={ - EP1_OUT_Callback, - EP2_OUT_Callback, - EP3_OUT_Callback, - EP4_OUT_Callback, - EP5_OUT_Callback, - EP6_OUT_Callback, - EP7_OUT_Callback, - }; -/******************************************************************************* - USB_Istr: ISTR events interrupt service routine -*******************************************************************************/ -void USB_Istr(void) -{ - wIstr = _GetISTR(); -#if (IMR_MSK & ISTR_RESET) - if (wIstr & ISTR_RESET & wInterrupt_Mask){ -// _SetISTR((u16)CLR_RESET); - Device_Property.Reset(); - _SetISTR((u16)CLR_RESET); -//#ifdef RESET_CALLBACK -// RESET_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_DOVR) - if (wIstr & ISTR_DOVR & wInterrupt_Mask){ - _SetISTR((u16)CLR_DOVR); -//#ifdef DOVR_CALLBACK -// DOVR_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_ERR) - if (wIstr & ISTR_ERR & wInterrupt_Mask){ - _SetISTR((u16)CLR_ERR); -//#ifdef ERR_CALLBACK -// ERR_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_WKUP) - if (wIstr & ISTR_WKUP & wInterrupt_Mask){ -// _SetISTR((u16)CLR_WKUP); - Resume(RESUME_EXTERNAL); - _SetISTR((u16)CLR_WKUP); -//#ifdef WKUP_CALLBACK -// WKUP_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_SUSP) - if (wIstr & ISTR_SUSP & wInterrupt_Mask){ // check if SUSPEND is possible - if (fSuspendEnabled) Suspend(); - else Resume(RESUME_LATER); // if not possible then resume after xx ms - _SetISTR((u16)CLR_SUSP); // clear of the ISTR bit must be done after setting of CNTR_FSUSP -//#ifdef SUSP_CALLBACK -// SUSP_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_SOF) - if (wIstr & ISTR_SOF & wInterrupt_Mask){ - _SetISTR((u16)CLR_SOF); - bIntPackSOF++; -//#ifdef SOF_CALLBACK -// SOF_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_ESOF) - if (wIstr & ISTR_ESOF & wInterrupt_Mask){ -// _SetISTR((u16)CLR_ESOF); // resume handling timing is made with ESOFs - Resume(RESUME_ESOF); // request without change of the machine state - _SetISTR((u16)CLR_ESOF); // resume handling timing is made with ESOFs -//#ifdef ESOF_CALLBACK -// ESOF_Callback(); -//#endif - } -#endif -//----------------------------------------------------------------------------- -#if (IMR_MSK & ISTR_CTR) - if (wIstr & ISTR_CTR & wInterrupt_Mask){ - /* servicing of the endpoint correct transfer interrupt */ - /* clear of the CTR flag into the sub */ - CTR_LP(); -//#ifdef CTR_CALLBACK -// CTR_Callback(); -//#endif - } -#endif -} /* USB_Istr */ -/******************************************************************************* - EP1_IN_Callback: EP1 IN Callback Routine -*******************************************************************************/ -void EP1_IN_Callback(void) -{ - Mass_Storage_In(); -} -/******************************************************************************* - EP2_OUT_Callback: EP2 OUT Callback Routine. -*******************************************************************************/ -void EP2_OUT_Callback(void) -{ - Mass_Storage_Out(); -} -/********************************* END OF FILE ******************************/ - diff --git a/workspace/ts100/src/usb_prop.c b/workspace/ts100/src/usb_prop.c deleted file mode 100644 index cb2201eb..00000000 --- a/workspace/ts100/src/usb_prop.c +++ /dev/null @@ -1,262 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_prop.c - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#include "usb_desc.h" -#include "usb_pwr.h" -#include "usb_bot.h" -#include "usb_prop.h" -#include "usb_lib.h" -#include "Bios.h" -#include "APP_Version.h" - -u32 Max_Lun = 0; - -DEVICE Device_Table ={ EP_NUM, 1 }; -DEVICE_PROP Device_Property ={ - MASS_init, - MASS_Reset, - MASS_Status_In, - MASS_Status_Out, - MASS_Data_Setup, - MASS_NoData_Setup, - MASS_Get_Interface_Setting, - MASS_GetDeviceDescriptor, - MASS_GetConfigDescriptor, - MASS_GetStringDescriptor, - 0, - 0x40 // MAX PACKET SIZE - }; -USER_STANDARD_REQUESTS User_Standard_Requests ={ - Mass_Storage_GetConfiguration, - Mass_Storage_SetConfiguration, - Mass_Storage_GetInterface, - Mass_Storage_SetInterface, - Mass_Storage_GetStatus, - Mass_Storage_ClearFeature, - Mass_Storage_SetEndPointFeature, - Mass_Storage_SetDeviceFeature, - Mass_Storage_SetDeviceAddress - }; -ONE_DESCRIPTOR Device_Descriptor ={ - (u8*)MASS_DeviceDescriptor, - MASS_SIZ_DEVICE_DESC - }; -ONE_DESCRIPTOR Config_Descriptor ={ - (u8*)MASS_ConfigDescriptor, - MASS_SIZ_CONFIG_DESC - }; -ONE_DESCRIPTOR String_Descriptor[5] ={ - {(u8*)MASS_StringLangID, MASS_SIZ_STRING_LANGID}, - {(u8*)MASS_StringVendor, MASS_SIZ_STRING_VENDOR}, - {(u8*)MASS_StringProduct, MASS_SIZ_STRING_PRODUCT}, - {(u8*)MASS_StringSerial, MASS_SIZ_STRING_SERIAL}, - {(u8*)MASS_StringInterface, MASS_SIZ_STRING_INTERFACE}, - }; - -/******************************************************************************* - MASS_init: Mass Storage init routine. -*******************************************************************************/ -void MASS_init() -{ - Get_SerialNum(); // Update the serial number string descriptor with the data from the unique ID - pInformation->Current_Configuration = 0; - PowerOn(); // Connect the device - _SetISTR(0); // USB interrupts initialization. clear pending interrupts - wInterrupt_Mask = IMR_MSK; - _SetCNTR(wInterrupt_Mask); // set interrupts mask - bDeviceState = UNCONNECTED; -} -/******************************************************************************* - MASS_Reset: Mass Storage reset routine. -*******************************************************************************/ -void MASS_Reset() -{ - Device_Info.Current_Configuration = 0; // Set the device as not configured - pInformation->Current_Feature = MASS_ConfigDescriptor[7]; // Current Feature initialization - SetBTABLE(BTABLE_ADDRESS); - // Initialize Endpoint 0 - SetEPType(ENDP0, EP_CONTROL); - SetEPTxStatus(ENDP0, EP_TX_NAK); - SetEPRxAddr(ENDP0, ENDP0_RXADDR); - SetEPRxCount(ENDP0, Device_Property.MaxPacketSize); - SetEPTxAddr(ENDP0, ENDP0_TXADDR); - Clear_Status_Out(ENDP0); - SetEPRxValid(ENDP0); - //Initialize Endpoint 1 - SetEPType(ENDP1, EP_BULK); - SetEPTxAddr(ENDP1, ENDP1_TXADDR); - SetEPTxStatus(ENDP1, EP_TX_NAK); - SetEPRxStatus(ENDP1, EP_RX_DIS); - // Initialize Endpoint 2 - SetEPType(ENDP2, EP_BULK); - SetEPRxAddr(ENDP2, ENDP2_RXADDR); - SetEPRxCount(ENDP2, Device_Property.MaxPacketSize); - SetEPRxStatus(ENDP2, EP_RX_VALID); - SetEPTxStatus(ENDP2, EP_TX_DIS); - - SetEPRxCount(ENDP0, Device_Property.MaxPacketSize); - SetEPRxValid(ENDP0); - // Set the device to response on default address - SetDeviceAddress(0); - - bDeviceState = ATTACHED; - - CBW.dSignature = BOT_CBW_SIGNATURE; - Bot_State = BOT_IDLE; -} - -/******************************************************************************* - Mass_Storage_SetConfiguration: Handle the SetConfiguration request. -*******************************************************************************/ -void Mass_Storage_SetConfiguration(void) -{ - if (pInformation->Current_Configuration != 0){ - bDeviceState = CONFIGURED; // Device configured - ClearDTOG_TX(ENDP1); - ClearDTOG_RX(ENDP2); - Bot_State = BOT_IDLE; // set the Bot state machine to the IDLE state - } -} -/******************************************************************************* - Mass_Storage_ClearFeature: Handle the ClearFeature request. -*******************************************************************************/ -void Mass_Storage_ClearFeature(void) -{ - /* when the host send a CBW with invalid signature or invalid length the two - Endpoints (IN & OUT) shall stall until receiving a Mass Storage Reset */ - if (CBW.dSignature != BOT_CBW_SIGNATURE) - Bot_Abort(BOTH_DIR); -} -/******************************************************************************* - Mass_Storage_SetConfiguration: Udpade the device state to addressed. -*******************************************************************************/ -void Mass_Storage_SetDeviceAddress (void) -{ - bDeviceState = ADDRESSED; -} -/******************************************************************************* - MASS_Status_In: Mass Storage Status IN routine. -*******************************************************************************/ -void MASS_Status_In(void) -{ - return; -} -/******************************************************************************* - MASS_Status_Out: Mass Storage Status OUT routine. -*******************************************************************************/ -void MASS_Status_Out(void) -{ - return; -} -/******************************************************************************* - MASS_Data_Setup: Handle the data class specific requests. -*******************************************************************************/ -RESULT MASS_Data_Setup(u8 RequestNo) -{ - u8* (*CopyRoutine)(u16); - - CopyRoutine = NULL; - if ((Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT)) - && (RequestNo == GET_MAX_LUN) && (pInformation->USBwValue == 0) - && (pInformation->USBwIndex == 0) && (pInformation->USBwLength == 0x01)) - { - CopyRoutine = Get_Max_Lun; - } else return USB_UNSUPPORT; - if (CopyRoutine == NULL) return USB_UNSUPPORT; - pInformation->Ctrl_Info.CopyData = CopyRoutine; - pInformation->Ctrl_Info.Usb_wOffset = 0; - (*CopyRoutine)(0); - return USB_SUCCESS; -} -/******************************************************************************* - MASS_NoData_Setup: Handle the no data class specific requests. -*******************************************************************************/ -RESULT MASS_NoData_Setup(u8 RequestNo) -{ - if ((Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT)) - && (RequestNo == MASS_STORAGE_RESET) && (pInformation->USBwValue == 0) - && (pInformation->USBwIndex == 0) && (pInformation->USBwLength == 0x00)) - { - ClearDTOG_TX(ENDP1); // Initialize Endpoint 1 - ClearDTOG_RX(ENDP2); // Initialize Endpoint 2 - CBW.dSignature = BOT_CBW_SIGNATURE; // intialise the CBW signature to enable the clear feature - Bot_State = BOT_IDLE; - return USB_SUCCESS; - } - return USB_UNSUPPORT; -} -/******************************************************************************* - MASS_Get_Interface_Setting: Test the interface and the alternate setting - according to the supported one. -*******************************************************************************/ -RESULT MASS_Get_Interface_Setting(u8 Interface, u8 AlternateSetting) -{ - if (AlternateSetting > 0) return USB_UNSUPPORT;// in this application we don't have AlternateSetting - else if (Interface > 0) return USB_UNSUPPORT; // in this application we have only 1 interfaces - return USB_SUCCESS; -} -/******************************************************************************* - MASS_GetDeviceDescriptor: Get the device descriptor. -*******************************************************************************/ -u8 *MASS_GetDeviceDescriptor(u16 Length) -{ - return Standard_GetDescriptorData(Length, &Device_Descriptor ); -} -/******************************************************************************* - MASS_GetConfigDescriptor: Get the configuration descriptor. -*******************************************************************************/ -u8 *MASS_GetConfigDescriptor(u16 Length) -{ - return Standard_GetDescriptorData(Length, &Config_Descriptor ); -} - -/******************************************************************************* - MASS_GetStringDescriptor: Get the string descriptors according to - the needed index. -*******************************************************************************/ -u8 *MASS_GetStringDescriptor(u16 Length) -{ - u8 wValue0 = pInformation->USBwValue0; - if (wValue0 > 5) return NULL; - else return Standard_GetDescriptorData(Length, &String_Descriptor[wValue0]); -} -/******************************************************************************* - Get_Max_Lun: Handle the Get Max Lun request. -*******************************************************************************/ -u8 *Get_Max_Lun(u16 Length) -{ - if (Length == 0){ - pInformation->Ctrl_Info.Usb_wLength = LUN_DATA_LENGTH; - return 0; - } else return((u8*)(&Max_Lun)); -} -/******************************************************************************* -Get_SerialNum : Create the serial number string descriptor. -*******************************************************************************/ -void Get_SerialNum(void) -{ - u32 Device_Serial0, Device_Serial1, Device_Serial2; - - Device_Serial0 = SERIAL_NO1; - Device_Serial1 = SERIAL_NO2; - Device_Serial2 = SERIAL_NO3; - - if (Device_Serial0 != 0){ - MASS_StringSerial[ 2] = (u8)( Device_Serial0 & 0x000000FF); - MASS_StringSerial[ 4] = (u8)((Device_Serial0 & 0x0000FF00) >> 8); - MASS_StringSerial[ 6] = (u8)((Device_Serial0 & 0x00FF0000) >> 16); - MASS_StringSerial[ 8] = (u8)((Device_Serial0 & 0xFF000000) >> 24); - - MASS_StringSerial[10] = (u8)( Device_Serial1 & 0x000000FF); - MASS_StringSerial[12] = (u8)((Device_Serial1 & 0x0000FF00) >> 8); - MASS_StringSerial[14] = (u8)((Device_Serial1 & 0x00FF0000) >> 16); - MASS_StringSerial[16] = (u8)((Device_Serial1 & 0xFF000000) >> 24); - - MASS_StringSerial[18] = (u8)( Device_Serial2 & 0x000000FF); - MASS_StringSerial[20] = (u8)((Device_Serial2 & 0x0000FF00) >> 8); - MASS_StringSerial[22] = (u8)((Device_Serial2 & 0x00FF0000) >> 16); - MASS_StringSerial[24] = (u8)((Device_Serial2 & 0xFF000000) >> 24); - } -} -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/usb_pwr.c b/workspace/ts100/src/usb_pwr.c deleted file mode 100644 index 459d1c20..00000000 --- a/workspace/ts100/src/usb_pwr.c +++ /dev/null @@ -1,152 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_pwr.c - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#include "usb_lib.h" -#include "usb_conf.h" -#include "usb_pwr.h" - -vu32 bDeviceState = UNCONNECTED; // USB device status -vu8 fSuspendEnabled = TRUE; // true when suspend is possible - -struct{ - volatile RESUME_STATE eState; - volatile u8 bESOFcnt; -} ResumeS; - -/******************************************************************************* - PowerOn Return : USB_SUCCESS - -*******************************************************************************/ -RESULT PowerOn(void) -{ - u16 wRegVal; - - /*** CNTR_PWDN = 0 ***/ - wRegVal = CNTR_FRES; - _SetCNTR(wRegVal); - /*** CNTR_FRES = 0 ***/ - wInterrupt_Mask = 0; - _SetCNTR(wInterrupt_Mask); - /*** Clear pending interrupts ***/ - _SetISTR(0); - /*** Set interrupt mask ***/ - wInterrupt_Mask = CNTR_RESETM | CNTR_SUSPM | CNTR_WKUPM; - _SetCNTR(wInterrupt_Mask); - - return USB_SUCCESS; -} -/******************************************************************************* - PowerOff: handles switch-off conditions Return : USB_SUCCESS -*******************************************************************************/ -RESULT PowerOff() -{ - /* disable all ints and force USB reset */ - _SetCNTR(CNTR_FRES); - /* clear interrupt status register */ - _SetISTR(0); - /* Disable the Pull-Up*/ -// USB_Cable_Config(DISABLE); - /* switch-off device */ - _SetCNTR(CNTR_FRES + CNTR_PDWN); - /* sw variables reset */ - /* ... */ - - return USB_SUCCESS; -} -/******************************************************************************* - Suspend: sets suspend mode operating conditions - Return : USB_SUCCESS. -*******************************************************************************/ -void Suspend(void) -{ - u16 wCNTR; - /* suspend preparation */ - /* macrocell enters suspend mode */ - wCNTR = _GetCNTR(); - wCNTR |= CNTR_FSUSP; - _SetCNTR(wCNTR); - /* ------------------ ONLY WITH BUS-POWERED DEVICES ---------------------- */ - /* power reduction */ - /* ... on connected devices */ - /* force low-power mode in the macrocell */ - wCNTR = _GetCNTR(); - wCNTR |= CNTR_LPMODE; - _SetCNTR(wCNTR); -} -/******************************************************************************* - Resume_Init: Handles wake-up restoring normal operations -* Return : USB_SUCCESS. -*******************************************************************************/ -void Resume_Init(void) -{ - u16 wCNTR; - /* ------------------ ONLY WITH BUS-POWERED DEVICES ---------------------- */ - /* restart the clocks */ - /* CNTR_LPMODE = 0 */ - wCNTR = _GetCNTR(); - wCNTR &= (~CNTR_LPMODE); - _SetCNTR(wCNTR); - /* restore full power */ - /* ... on connected devices */ - /* reset FSUSP bit */ - _SetCNTR(IMR_MSK); - /* reverse suspend preparation */ - /* ... */ -} -/******************************************************************************* - Resume: This is the state machine handling resume operations and - timing sequence. The control is based on the Resume structure - variables and on the ESOF interrupt calling this subroutine - without changing machine state. - Input: a state machine value (RESUME_STATE) - RESUME_ESOF doesn't change ResumeS.eState allowing - decrementing of the ESOF counter in different states. -*******************************************************************************/ -void Resume(RESUME_STATE eResumeSetVal) -{ - u16 wCNTR; - - if (eResumeSetVal != RESUME_ESOF) ResumeS.eState = eResumeSetVal; - switch (ResumeS.eState){ - case RESUME_EXTERNAL: - Resume_Init(); - ResumeS.eState = RESUME_OFF; - break; - case RESUME_INTERNAL: - Resume_Init(); - ResumeS.eState = RESUME_START; - break; - case RESUME_LATER: - ResumeS.bESOFcnt = 2; - ResumeS.eState = RESUME_WAIT; - break; - case RESUME_WAIT: - ResumeS.bESOFcnt--; - if (ResumeS.bESOFcnt == 0) - ResumeS.eState = RESUME_START; - break; - case RESUME_START: - wCNTR = _GetCNTR(); - wCNTR |= CNTR_RESUME; - _SetCNTR(wCNTR); - ResumeS.eState = RESUME_ON; - ResumeS.bESOFcnt = 10; - break; - case RESUME_ON: - ResumeS.bESOFcnt--; - if (ResumeS.bESOFcnt == 0){ - wCNTR = _GetCNTR(); - wCNTR &= (~CNTR_RESUME); - _SetCNTR(wCNTR); - ResumeS.eState = RESUME_OFF; - } - break; - case RESUME_OFF: - case RESUME_ESOF: - default: - ResumeS.eState = RESUME_OFF; - break; - } -} -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/src/usb_scsi.c b/workspace/ts100/src/usb_scsi.c deleted file mode 100644 index 088b31cf..00000000 --- a/workspace/ts100/src/usb_scsi.c +++ /dev/null @@ -1,230 +0,0 @@ -/******************** (C) COPYRIGHT 2015 e-Design Co., Ltd. ******************** - File Name : USB_scsi.c - Version : STM32 USB Disk Ver 3.4 Author : MCD Application Team & bure -*******************************************************************************/ -#include "usb_scsi.h" -#include "usb_bot.h" -#include "usb_regs.h" -#include "usb_lib.h" -#include "Disk.h" - -u8 Page00_Inquiry_Data[] ={ 0, 0, 0, 0, 0}; -u8 Mode_Sense6_data[] ={0x03, 0x00, 0x00, 0x00}; -u8 Mode_Sense10_data[] ={0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -u8 Scsi_Sense_Data[] ={0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -u8 ReadCapacity10_Data[] ={ 0, 0, 0, 0, 0, 0, 0, 0}; -u8 ReadFormatCapacity[] ={ 0, 0, 0, 8, 0, 0, 0, 0, 2, 0, 0, 0}; - -#ifdef DFU_MODE - uc8 Disk_Inquiry_Str[] ={0x00, 0x80, 0x02, 0x02, 36-4, 0x00, 0x00, 0x00, - 'V', 'i', 'r', 't', 'u', 'a', 'l', ' ', - 'D', 'F', 'U', ' ', 'D', 'i', 's', 'k', - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', - ' ', ' ', ' ', ' ', }; -#else - uc8 Disk_Inquiry_Str[] ={0x00, 0x80, 0x02, 0x02, 36-4, 0x00, 0x00, 0x00, - 'M', 'i', 'n', 'i', ' ', 'D', 'S', 'O', - 'D', 'i', 's', 'k', ' ', ' ', ' ', ' ', - ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', - ' ', ' ', ' ', ' ', }; -#endif - -/******************************************************************************* - SCSI_Inquiry_Cmd: SCSI Inquiry Command routine. -*******************************************************************************/ -void SCSI_Inquiry_Cmd(void) -{ - u8* Inquiry_Data; - u16 Inquiry_Data_Length; - - if (CBW.CB[1] & 0x01){ // Evpd is set - Inquiry_Data = Page00_Inquiry_Data; - Inquiry_Data_Length = 5; - } else { - Inquiry_Data = (u8*)Disk_Inquiry_Str; - if (CBW.CB[4] <= STANDARD_INQUIRY_DATA_LEN) Inquiry_Data_Length = CBW.CB[4]; - else Inquiry_Data_Length = STANDARD_INQUIRY_DATA_LEN; - } - Transfer_Data_Request(Inquiry_Data, Inquiry_Data_Length); -} -/******************************************************************************* - SCSI_ReadFormatCapacity_Cmd: SCSI ReadFormatCapacity Command routine. -*******************************************************************************/ -void SCSI_ReadFormatCapacity_Cmd(void) -{ - ReadFormatCapacity[ 4] = (u8)(SECTOR_SIZE >> 24); - ReadFormatCapacity[ 5] = (u8)(SECTOR_SIZE >> 16); - ReadFormatCapacity[ 6] = (u8)(SECTOR_SIZE >> 8); - ReadFormatCapacity[ 7] = (u8)(SECTOR_SIZE); - - ReadFormatCapacity[ 9] = (u8)(SECTOR_SIZE >> 16); - ReadFormatCapacity[10] = (u8)(SECTOR_SIZE >> 8); - ReadFormatCapacity[11] = (u8)(SECTOR_SIZE); - - Transfer_Data_Request(ReadFormatCapacity, READ_FORMAT_CAPACITY_DATA_LEN); -} -/******************************************************************************* - SCSI_ReadCapacity10_Cmd: SCSI ReadCapacity10 Command routine. -*******************************************************************************/ -void SCSI_ReadCapacity10_Cmd(void) -{ - ReadCapacity10_Data[0] = (u8)(SECTOR_CNT - 1 >> 24); - ReadCapacity10_Data[1] = (u8)(SECTOR_CNT - 1 >> 16); - ReadCapacity10_Data[2] = (u8)(SECTOR_CNT - 1 >> 8); - ReadCapacity10_Data[3] = (u8)(SECTOR_CNT - 1); - - ReadCapacity10_Data[4] = (u8)(SECTOR_SIZE >> 24); - ReadCapacity10_Data[5] = (u8)(SECTOR_SIZE >> 16); - ReadCapacity10_Data[6] = (u8)(SECTOR_SIZE >> 8); - ReadCapacity10_Data[7] = (u8)(SECTOR_SIZE); - - Transfer_Data_Request(ReadCapacity10_Data, READ_CAPACITY10_DATA_LEN); -} -/******************************************************************************* - SCSI_ModeSense6_Cmd: SCSI ModeSense6 Command routine. -*******************************************************************************/ -void SCSI_ModeSense6_Cmd (void) -{ - Transfer_Data_Request(Mode_Sense6_data, MODE_SENSE6_DATA_LEN); -} -/******************************************************************************* - SCSI_ModeSense10_Cmd: SCSI ModeSense10 Command routine. -*******************************************************************************/ -void SCSI_ModeSense10_Cmd (void) -{ - Transfer_Data_Request(Mode_Sense10_data, MODE_SENSE10_DATA_LEN); -} -/******************************************************************************* - SCSI_RequestSense_Cmd: SCSI RequestSense Command routine. -*******************************************************************************/ -void SCSI_RequestSense_Cmd (void) -{ - u8 Request_Sense_data_Length; - - if (CBW.CB[4] <= REQUEST_SENSE_DATA_LEN) Request_Sense_data_Length = CBW.CB[4]; - else Request_Sense_data_Length = REQUEST_SENSE_DATA_LEN; - - Transfer_Data_Request(Scsi_Sense_Data, Request_Sense_data_Length); -} - -/******************************************************************************* - Set_Scsi_Sense_Data: Set Scsi Sense Data routine. -*******************************************************************************/ -void Set_Scsi_Sense_Data(u8 Sens_Key, u8 Asc) -{ - Scsi_Sense_Data[2] = Sens_Key; - Scsi_Sense_Data[12] = Asc; -} -/******************************************************************************* - SCSI_Start_Stop_Unit_Cmd: SCSI Start_Stop_Unit Command routine. -*******************************************************************************/ -void SCSI_Start_Stop_Unit_Cmd(void) -{ - Set_CSW (CSW_CMD_PASSED, SEND_CSW_ENABLE); -} -/******************************************************************************* - SCSI_Read10_Cmd: SCSI Read10 Command routine. -*******************************************************************************/ -void SCSI_Read10_Cmd(u32 LBA , u32 BlockNbr) -{ - if (Bot_State == BOT_IDLE){ - if (!(SCSI_Address_Management(SCSI_READ10, LBA, BlockNbr))) return;//address out of range - if ((CBW.bmFlags & 0x80) != 0){ - Bot_State = BOT_DATA_IN; - Read_Memory(LBA , BlockNbr); - } else { - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_ENABLE); - } - return; - } else if (Bot_State == BOT_DATA_IN) Read_Memory(LBA , BlockNbr); -} -/******************************************************************************* - SCSI_Write10_Cmd: SCSI Write10 Command routine. -*******************************************************************************/ -void SCSI_Write10_Cmd(u32 LBA , u32 BlockNbr) -{ - if (Bot_State == BOT_IDLE){ - if (!(SCSI_Address_Management(SCSI_WRITE10 , LBA, BlockNbr))) return;//address out of range - if ((CBW.bmFlags & 0x80) == 0){ - Bot_State = BOT_DATA_OUT; - SetEPRxStatus(ENDP2, EP_RX_VALID); - } else { - Bot_Abort(DIR_IN); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - } - return; - } else if (Bot_State == BOT_DATA_OUT) Write_Memory(LBA , BlockNbr); -} -/******************************************************************************* - SCSI_Verify10_Cmd: SCSI Verify10 Command routine. -*******************************************************************************/ -void SCSI_Verify10_Cmd(void) -{ - if ((CBW.dDataLength == 0) && !(CBW.CB[1] & BLKVFY)){ // BLKVFY not set - Set_CSW (CSW_CMD_PASSED, SEND_CSW_ENABLE); - } else { - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - } -} -/******************************************************************************* - SCSI_Valid_Cmd: Valid Commands routine. -*******************************************************************************/ -void SCSI_Valid_Cmd(void) -{ - if (CBW.dDataLength != 0){ - Bot_Abort(BOTH_DIR); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - } else Set_CSW (CSW_CMD_PASSED, SEND_CSW_ENABLE); -} -/******************************************************************************* - SCSI_Valid_Cmd: Valid Commands routine. -*******************************************************************************/ -void SCSI_TestUnitReady_Cmd(void) -{ - Set_CSW (CSW_CMD_PASSED, SEND_CSW_ENABLE); -} -/******************************************************************************* - SCSI_Invalid_Cmd: Invalid Commands routine -*******************************************************************************/ -void SCSI_Invalid_Cmd(void) -{ - if (CBW.dDataLength == 0) Bot_Abort(DIR_IN); - else{ - if ((CBW.bmFlags & 0x80) != 0) Bot_Abort(DIR_IN); - else Bot_Abort(BOTH_DIR); - } - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); -} -/******************************************************************************* - SCSI_Address_Management: Test the received address. - Input: Cmd the command can be SCSI_READ10 or SCSI_WRITE10. - Return: Read\Write status (bool). -*******************************************************************************/ -u8 SCSI_Address_Management(u8 Cmd , u32 LBA , u32 BlockNbr) -{ - - if ((LBA + BlockNbr) > SECTOR_CNT){ - if (Cmd == SCSI_WRITE10) Bot_Abort(BOTH_DIR); - Bot_Abort(DIR_IN); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, ADDRESS_OUT_OF_RANGE); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - return (FALSE); - } - if (CBW.dDataLength != BlockNbr * SECTOR_SIZE){ - if (Cmd == SCSI_WRITE10) Bot_Abort(BOTH_DIR); - else Bot_Abort(DIR_IN); - Set_Scsi_Sense_Data(ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND); - Set_CSW (CSW_CMD_FAILED, SEND_CSW_DISABLE); - return (FALSE); - } - return (TRUE); -} -/********************************* END OF FILE ******************************/ diff --git a/workspace/ts100/ts100.cfg b/workspace/ts100/ts100.cfg index 628e83f1..ba0519ec 100644 --- a/workspace/ts100/ts100.cfg +++ b/workspace/ts100/ts100.cfg @@ -10,4 +10,6 @@ transport select "hla_swd" source [find target/stm32f1x_stlink.cfg] # use hardware reset, connect under reset -reset_config srst_only srst_nogate +#reset_config srst_only srst_nogate +#software +reset_config none separate \ No newline at end of file