diff options
22 files changed, 6203 insertions, 0 deletions
| diff --git a/dist/default/production/memoryfile.xml b/dist/default/production/memoryfile.xml new file mode 100644 index 0000000..f45eea2 --- /dev/null +++ b/dist/default/production/memoryfile.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project> +  <executable name="dist/default/production/resbox.X.production.elf"> +    <memory name="data"> +      <units>bytes</units> +      <length>2048</length> +      <used>92</used> +      <free>1956</free> +    </memory> +    <memory name="program"> +      <units>bytes</units> +      <length>16128</length> +      <used>3801</used> +      <free>12327</free> +    </memory> +  </executable> +</project> diff --git a/dist/default/production/resbox.X.production.elf b/dist/default/production/resbox.X.production.elfBinary files differ new file mode 100755 index 0000000..bd61075 --- /dev/null +++ b/dist/default/production/resbox.X.production.elf diff --git a/dist/default/production/resbox.X.production.hex b/dist/default/production/resbox.X.production.hex new file mode 100644 index 0000000..4c99e38 --- /dev/null +++ b/dist/default/production/resbox.X.production.hex @@ -0,0 +1,771 @@ +:020000040000fa +:080000000002040000000000f2 +:020000040000fa +:040008005e04000092 +:020000040000fa +:04000c00ac03000041 +:020000040000fa +:04001000ee030000fb +:020000040000fa +:04001400cc03000019 +:020000040000fa +:040018000e040000d2 +:020000040000fa +:04001c005e0400007e +:020000040000fa +:040020005e0400007a +:020000040000fa +:040024005e04000076 +:020000040000fa +:040028005e04000072 +:020000040000fa +:04002c005e0400006e +:020000040000fa +:040030005e0400006a +:020000040000fa +:040034002e04000096 +:020000040000fa +:040038005e04000062 +:020000040000fa +:04003c005e0400005e +:020000040000fa +:040040005e0400005a +:020000040000fa +:040044005e04000056 +:020000040000fa +:040048005e04000052 +:020000040000fa +:04004c005e0400004e +:020000040000fa +:040050005e0400004a +:020000040000fa +:040054005e04000046 +:020000040000fa +:040058005e04000042 +:020000040000fa +:04005c005e0400003e +:020000040000fa +:040060005e0400003a +:020000040000fa +:040064005e04000036 +:020000040000fa +:040068005e04000032 +:020000040000fa +:04006c005e0400002e +:020000040000fa +:040070005e0400002a +:020000040000fa +:040074005e04000026 +:020000040000fa +:040078005e04000022 +:020000040000fa +:04007c005e0400001e +:020000040000fa +:040080005e0400001a +:020000040000fa +:040084005e04000016 +:020000040000fa +:040088005e04000012 +:020000040000fa +:04008c005e0400000e +:020000040000fa +:040090005e0400000a +:020000040000fa +:040094005e04000006 +:020000040000fa +:040098005e04000002 +:020000040000fa +:04009c005e040000fe +:020000040000fa +:0400a0005e040000fa +:020000040000fa +:0400a4005e040000f6 +:020000040000fa +:0400a8005e040000f2 +:020000040000fa +:0400ac005e040000ee +:020000040000fa +:0400b0005e040000ea +:020000040000fa +:0400b4005e040000e6 +:020000040000fa +:0400b8005e040000e2 +:020000040000fa +:0400bc005e040000de +:020000040000fa +:0400c0005e040000da +:020000040000fa +:0400c4005e040000d6 +:020000040000fa +:0400c8005e040000d2 +:020000040000fa +:0400cc005e040000ce +:020000040000fa +:0400d0005e040000ca +:020000040000fa +:0400d4005e040000c6 +:020000040000fa +:0400d8005e040000c2 +:020000040000fa +:0400dc005e040000be +:020000040000fa +:0400e0005e040000ba +:020000040000fa +:0400e4005e040000b6 +:020000040000fa +:0400e8005e040000b2 +:020000040000fa +:0400ec00cc02000042 +:020000040000fa +:0400f0005e040000aa +:020000040000fa +:0400f4005e040000a6 +:020000040000fa +:0400f8005e040000a2 +:020000040000fa +:0400fc005e0400009e +:020000040000fa +:040100005e04000099 +:020000040000fa +:040104005e04000095 +:020000040000fa +:040108005e04000091 +:020000040000fa +:04010c005e0400008d +:020000040000fa +:040110005e04000089 +:020000040000fa +:040114005e04000085 +:020000040000fa +:040118005e04000081 +:020000040000fa +:04011c005e0400007d +:020000040000fa +:040120005e04000079 +:020000040000fa +:040124005e04000075 +:020000040000fa +:040128005e04000071 +:020000040000fa +:04012c005e0400006d +:020000040000fa +:040130005e04000069 +:020000040000fa +:040134005e04000065 +:020000040000fa +:040138005e04000061 +:020000040000fa +:04013c005e0400005d +:020000040000fa +:040140005e04000059 +:020000040000fa +:040144005e04000055 +:020000040000fa +:040148005e04000051 +:020000040000fa +:04014c005e0400004d +:020000040000fa +:040150005e04000049 +:020000040000fa +:040154005e04000045 +:020000040000fa +:040158005e04000041 +:020000040000fa +:04015c005e0400003d +:020000040000fa +:040160005e04000039 +:020000040000fa +:040164005e04000035 +:020000040000fa +:040168005e04000031 +:020000040000fa +:04016c005e0400002d +:020000040000fa +:040170005e04000029 +:020000040000fa +:040174005e04000025 +:020000040000fa +:040178005e04000021 +:020000040000fa +:04017c005e0400001d +:020000040000fa +:040180005e04000019 +:020000040000fa +:040184005e04000015 +:020000040000fa +:040188005e04000011 +:020000040000fa +:04018c005e0400000d +:020000040000fa +:040190005e04000009 +:020000040000fa +:040194005e04000005 +:020000040000fa +:040198005e04000001 +:020000040000fa +:04019c005e040000fd +:020000040000fa +:0401a0005e040000f9 +:020000040000fa +:0401a4005e040000f5 +:020000040000fa +:0401a8005e040000f1 +:020000040000fa +:0401ac005e040000ed +:020000040000fa +:040208005e04000090 +:020000040000fa +:04020c00ac0300003f +:020000040000fa +:04021000ee030000f9 +:020000040000fa +:04021400cc03000017 +:020000040000fa +:040218000e040000d0 +:020000040000fa +:04021c005e0400007c +:020000040000fa +:040220005e04000078 +:020000040000fa +:040224005e04000074 +:020000040000fa +:040228005e04000070 +:020000040000fa +:04022c005e0400006c +:020000040000fa +:040230005e04000068 +:020000040000fa +:040234002e04000094 +:020000040000fa +:040238005e04000060 +:020000040000fa +:04023c005e0400005c +:020000040000fa +:040240005e04000058 +:020000040000fa +:040244005e04000054 +:020000040000fa +:040248005e04000050 +:020000040000fa +:04024c005e0400004c +:020000040000fa +:040250005e04000048 +:020000040000fa +:040254005e04000044 +:020000040000fa +:040258005e04000040 +:020000040000fa +:04025c005e0400003c +:020000040000fa +:040260005e04000038 +:020000040000fa +:040264005e04000034 +:020000040000fa +:040268005e04000030 +:020000040000fa +:04026c005e0400002c +:020000040000fa +:040270005e04000028 +:020000040000fa +:040274005e04000024 +:020000040000fa +:040278005e04000020 +:020000040000fa +:04027c005e0400001c +:020000040000fa +:040280005e04000018 +:020000040000fa +:040284005e04000014 +:020000040000fa +:040288005e04000010 +:020000040000fa +:04028c005e0400000c +:020000040000fa +:040290005e04000008 +:020000040000fa +:040294005e04000004 +:020000040000fa +:040298005e04000000 +:020000040000fa +:04029c005e040000fc +:020000040000fa +:0402a0005e040000f8 +:020000040000fa +:0402a4005e040000f4 +:020000040000fa +:0402a8005e040000f0 +:020000040000fa +:0402ac005e040000ec +:020000040000fa +:0402b0005e040000e8 +:020000040000fa +:0402b4005e040000e4 +:020000040000fa +:0402b8005e040000e0 +:020000040000fa +:0402bc005e040000dc +:020000040000fa +:0402c0005e040000d8 +:020000040000fa +:0402c4005e040000d4 +:020000040000fa +:0402c8005e040000d0 +:020000040000fa +:0402cc005e040000cc +:020000040000fa +:0402d0005e040000c8 +:020000040000fa +:0402d4005e040000c4 +:020000040000fa +:0402d8005e040000c0 +:020000040000fa +:0402dc005e040000bc +:020000040000fa +:0402e0005e040000b8 +:020000040000fa +:0402e4005e040000b4 +:020000040000fa +:0402e8005e040000b0 +:020000040000fa +:0402ec00cc02000040 +:020000040000fa +:0402f0005e040000a8 +:020000040000fa +:0402f4005e040000a4 +:020000040000fa +:0402f8005e040000a0 +:020000040000fa +:0402fc005e0400009c +:020000040000fa +:040300005e04000097 +:020000040000fa +:040304005e04000093 +:020000040000fa +:040308005e0400008f +:020000040000fa +:04030c005e0400008b +:020000040000fa +:040310005e04000087 +:020000040000fa +:040314005e04000083 +:020000040000fa +:040318005e0400007f +:020000040000fa +:04031c005e0400007b +:020000040000fa +:040320005e04000077 +:020000040000fa +:040324005e04000073 +:020000040000fa +:040328005e0400006f +:020000040000fa +:04032c005e0400006b +:020000040000fa +:040330005e04000067 +:020000040000fa +:040334005e04000063 +:020000040000fa +:040338005e0400005f +:020000040000fa +:04033c005e0400005b +:020000040000fa +:040340005e04000057 +:020000040000fa +:040344005e04000053 +:020000040000fa +:040348005e0400004f +:020000040000fa +:04034c005e0400004b +:020000040000fa +:040350005e04000047 +:020000040000fa +:040354005e04000043 +:020000040000fa +:040358005e0400003f +:020000040000fa +:04035c005e0400003b +:020000040000fa +:040360005e04000037 +:020000040000fa +:040364005e04000033 +:020000040000fa +:040368005e0400002f +:020000040000fa +:04036c005e0400002b +:020000040000fa +:040370005e04000027 +:020000040000fa +:040374005e04000023 +:020000040000fa +:040378005e0400001f +:020000040000fa +:04037c005e0400001b +:020000040000fa +:040380005e04000017 +:020000040000fa +:040384005e04000013 +:020000040000fa +:040388005e0400000f +:020000040000fa +:04038c005e0400000b +:020000040000fa +:040390005e04000007 +:020000040000fa +:040394005e04000003 +:020000040000fa +:040398005e040000ff +:020000040000fa +:04039c005e040000fb +:020000040000fa +:0403a0005e040000f7 +:020000040000fa +:0403a4005e040000f3 +:020000040000fa +:0403a8005e040000ef +:020000040000fa +:0403ac005e040000eb +:020000040000fa +:10040000cf8520000eff20000e01880000000000b4 +:10041000000020000000e000020032000001200087 +:100420002002880014000700260107000000e000f9 +:1004300003003a0060b420000100200002003700f1 +:100440000000200001002000810f70000100320038 +:1004500014000700000020000000e000020032004d +:100460000000020000000000be0a020000000000c0 +:100470000040da000000fe004440a9000000200017 +:100480000000e0000300320000002000a00188000e +:100490004440a800000006008a1f78008b1f7800e7 +:1004a0000000060091018800800478000000eb0045 +:1004b0001a003700e284440032a0b4009905ba0063 +:1004c000e284440032a0b4009906ba00e2844400f9 +:1004d00032a0b4000006eb00476fde00fd07b2005b +:1004e000636ce10003003a00ebff07000000eb0043 +:1004f0000a003700606ce10004003a00005deb0088 +:100500008b05e900fdff3e00040037006168e10053 +:10051000010032000086eb000b00070019c7ba008b +:100520001905ba000e04e00003003a000a00e000da +:10053000e0ff3a0000000600fe07b2009e018800be +:100540008a047800f5ff3700395dba008b05e900b1 +:100550000c003200295dba008b05e900080032006a +:100560000c00e00003003a00e284440032a0b40032 +:10057000f5ff370019ddba008b05e900faff3a00f4 +:100580008904e800e184440032a0b40000000600c1 +:100590000000000000000000809fbe00821f780065 +:1005a0000000fa0050048000620060000000e000db +:1005b00046003200c0108000640060000000e000cf +:1005c00007003200801080000040780040e8b7004b +:1005d00042c8bf000080fb00801088001282a80083 +:1005e000c0108000640060000000e00037003a00a6 +:1005f0000021ef00c1108000000220000080600098 +:100600000000e00015003a0061168000000820009c +:100610000080600000f0a7000000ea000000e90090 +:100620004f00de00004078000080fb0061006000a9 +:100630004700dd00611680000170a100010070001c +:100640006016880010c0b3004be8b700801080002f +:100650000040780040e8b7001282a800c110800076 +:1006600000022000008060000000e000170032005f +:100670004bc8bf00e14f500005003a0080108000d9 +:10068000004078003fe8b7004b68ef000e003700ed +:100690003fc8bf00e54f500008003e003fc8bf0004 +:1006a0000081fb00801080008040780010842000d2 +:1006b00000004100014878000300370080108000ee +:1006c0000040780040e8b7001282a8005004800083 +:1006d000640060000000e00005003a009110800016 +:1006e00000042000008060000000e00006003200ee +:1006f000801080000040780040e8b7008a40a900e0 +:1007000012c2a9001282a8008a20a90091108000bc +:10071000000420000080600000f0a7000000ea0054 +:100720000000e9004f00de00004078000080fb0080 +:10073000610060004800dd00611680000180a100ba +:1007400001007000601688000080fa004f017800f8 +:100750004f00be00004006003600f800809fbe003b +:10076000829fbe00849fbe00869fbe000000fa00ec +:100770008020a9000000eb00ff0307000080fa00c2 +:100780004f03be004f02be004f01be004f00be002f +:100790003600f900004006003600f800809fbe00d9 +:1007a000829fbe00849fbe00869fbe000000fa00ac +:1007b000f60307008040a90010002000ee030700a8 +:1007c0000080fa004f03be004f02be004f01be0082 +:1007d0004f00be003600f900004006003600f80069 +:1007e000809fbe00829fbe00849fbe00869fbe0089 +:1007f0000000fa008060a90020002000de0307004e +:100800000080fa004f03be004f02be004f01be0041 +:100810004f00be003600f900004006003600f80028 +:10082000809fbe00829fbe00849fbe00869fbe0048 +:100830000000fa008080a90030002000ce030700ed +:100840000080fa004f03be004f02be004f01be0001 +:100850004f00be003600f900004006003600f800e8 +:10086000809fbe00829fbe00849fbe00869fbe0008 +:100870000000fa00a04280000000e0000200320008 +:10088000a04280000000010057c8bf000040e800ff +:1008900057e8b70010c0b30056e8b7008460a9005d +:1008a0000080fa004f03be004f02be004f01be00a1 +:1008b0004f00be003600f900004006000040da009c +:0808c0000000fe00000005002d +:020000040000fa +:1008c8000400fa00004f780011479800224798006a +:1008d8001e407800ef4f500002003600f0c0b30011 +:1008e800004f78001e409000e54f5000020036008f +:1008f80050c0b3001047980000c8b30024e8b70000 +:1009080024c8bf0022e8b70022c8bf0020e8b7000b +:100918001e80fb00f10f20000008dd0000f0a7009a +:100928000000ea000000e9004f00de000040780007 +:1009380025e8b7001e80fb0068005000f10f20007a +:100948000008dd0000f0a7000000ea000000e90050 +:100958004f00de00804078001e4090000080fb00c1 +:10096800640050004700dd000040780000c07000bf +:1009780023e8b7001e4090000080fb000000e9005b +:10098800f10f20000008dd0000f0a7000000ea00d9 +:100998000000e9004f00de00804078002e40900003 +:1009a8000080fb004700dd000040780000c07000b8 +:1009b80021e8b7006282200061c0b30000822000f5 +:1009c800cb0107000080fb00704188000080fa001e +:1009d800000006000200fa00000f780032c8bf00cd +:1009e8000080fb004800dd008040780032c8bf006e +:1009f8000004e00002003a0000c8b300010037001c +:100a08000040eb0000c070000004a00024e8b7001c +:100a180024c8bf0022e8b70022c8bf0020e8b700fa +:100a28001e0078001040780021e8b7001e00e8009a +:100a38001040780023e8b7001e80e80010407800d6 +:100a480025e8b7000080fa00000006000200fa005e +:100a5800000f780032c8bf000080fb004800dd00ae +:100a68008040780032c8bf000004e00002003a006d +:100a780000c8b300010037000040eb0000c0700060 +:100a88000024a00024e8b70024c8bf0022e8b7006b +:100a980022c8bf0020e8b7001e0078001040780088 +:100aa80021e8b7001e00e8001040780023e8b700ee +:100ab8001e80e8001040780025e8b7000080fa00a2 +:100ac800000006000200fa00000f780032c8bf00dc +:100ad8000080fb004800dd008040780032c8bf007d +:100ae8000004e00002003a0000c8b300010037002b +:100af8000040eb0000c070005040b30024e8b7008d +:100b080024c8bf0022e8b70022c8bf0020e8b70009 +:100b18001e0078001040780021e8b7001e00e800a9 +:100b28001040780023e8b7001e80e80010407800e5 +:100b380025e8b7000080fa00000006000000fa006f +:100b480060c4b30024e8b70024c8bf0022e8b70097 +:100b580022c8bf0020e8b7000080fa0000000600a5 +:100b68000200fa00000f780032c8bf000080fb00c6 +:100b78004800dd008040780032c8bf000004e00073 +:100b880002003a0000c8b300010037000040eb0043 +:100b980000c070000034a00024e8b70024c8bf00db +:100ba80022e8b70022c8bf0020e8b7001e0078007e +:100bb8001040780021e8b7001e00e80010407800d7 +:100bc80023e8b7001e80e8001040780025e8b70049 +:100bd8000080fa00000006000000fa0090c4b3008c +:100be80024e8b70024c8bf0022e8b70022c8bf0025 +:100bf80020e8b7000080fa00000006000000fa00b4 +:100c0800a0c4b30024e8b70024c8bf0022e8b70096 +:100c180022c8bf0020e8b7000080fa0000000600e4 +:100c28000200fa00000f780032c8bf000080fb0005 +:100c38004800dd008040780032c8bf000004e000b2 +:100c480002003a0000c8b300010037000040eb0082 +:100c580000c07000b040b30024e8b70024c8bf004b +:100c680022e8b70022c8bf0020e8b7001e007800bd +:100c78001040780021e8b7001e00e8001040780016 +:100c880023e8b7001e80e8001040780025e8b70088 +:100c98000080fa00000006000200fa00000f780049 +:100ca800c0c8b30020e8b70000c8b30021e8b70007 +:100cb80026c8bf000080fb008000780020c8bf0065 +:100cc8000080fb000101780021c0b3000801070083 +:100cd8000080fb00704188000080fa0000000600d8 +:100ce8000200fa00000f7800d0c8b30024e8b7006b +:100cf80024c8bf0022e8b70022c8bf0020e8b70018 +:100d08001e0078001040780021e8b7001e00e800b7 +:100d18001040780023e8b7001e80e80010407800f3 +:100d280025e8b7000080fa00000006000200fa007b +:100d3800000f780032c8bf000080fb004800dd00cb +:100d48008040780032c8bf000004e00002003a008a +:100d580000c8b300010037000040eb0000c070007d +:100d6800e040b30024e8b70024c8bf0022e8b70079 +:100d780022c8bf0020e8b7001e00780010407800a5 +:100d880021e8b7001e00e8001040780023e8b7000b +:100d98001e80e8001040780025e8b7000080fa00bf +:100da800000006000200fa00000f780032c8bf00f9 +:100db8000080fb004800dd008040780032c8bf009a +:100dc8000004e00002003a0000c8b3000100370048 +:100dd8000040eb0000c070000044a00024e8b70009 +:100de80024c8bf0022e8b70022c8bf0020e8b70027 +:100df80001822000914078001e00780010007800e1 +:100e08004600dd004e00de000040780000c07000a3 +:100e180020e8b70021822000914078001e80e80079 +:100e2800100078004600dd004e00de00004078002b +:100e380000c0700022e8b70041822000914078008d +:100e48001e01780066004100100078004600dd00b1 +:100e58004e00de000040780000c0700024e8b700b3 +:100e68001e007800100078000040780021e8b700e4 +:100e78001e80e800100078000040780023e8b700e2 +:100e88009e007800648040001000780000407800e0 +:100e980025e8b7000080fa00000006000200fa000a +:100ea800000f780032c8bf000080fb004800dd005a +:100eb8008040780032c8bf000004e00002003a0019 +:100ec80000c8b300010037000040eb0000c070000c +:100ed8004041b30024e8b70024c8bf0022e8b700a7 +:100ee80022c8bf0020e8b7000182200091407800a6 +:100ef8001e007800100078004600dd004e00de007d +:100f08000040780000c0700020e8b700218220006f +:100f1800914078001e80e800100078004600dd004f +:100f28004e00de000040780000c0700022e8b700e4 +:100f380041822000914078001e017800660041003f +:100f4800100078004600dd004e00de00004078000a +:100f580000c0700024e8b7001e0078001000780078 +:100f68000040780021e8b7001e80e80010007800f3 +:100f78000040780023e8b7009e00780064804000b5 +:100f8800100078000040780025e8b7000080fa00db +:100f9800000006000200fa00000f780032c8bf0007 +:100fa8000080fb004800dd008040780032c8bf00a8 +:100fb8000004e00002003a0000c8b3000100370056 +:100fc8000040eb0080c0700040c2b30000c0700059 +:100fd80024e8b70024c8bf0022e8b70022c8bf0031 +:100fe80020e8b7001e0078001040780021e8b7001c +:100ff8001e00e8001040780023e8b7001e80e800d3 +:101008001040780025e8b7000080fa0000000600cc +:101018000200fa00000f780032c8bf000080fb0011 +:101028004800dd008040780032c8bf000004e000be +:1010380002003a0000c8b300010037000040eb008e +:1010480080c0700050c2b30000c0700024e8b70030 +:1010580024c8bf0022e8b70022c8bf0020e8b700b4 +:101068001e0078001040780021e8b7001e00e80054 +:101078001040780023e8b7001e80e8001040780090 +:1010880025e8b7000080fa00000006000000fa001a +:101098000008200040108800a002200010108800de +:1010a8000422ef000622ef000c22ef0010002000bf +:1010b800501088000080fa00000006000200fa00c4 +:1010c800004f78001e80fb00001088000000000020 +:1010d80040108000610060000000e000fcff32006a +:1010e80000108000004078000080fa000000060030 +:1010f8000800fa00881f78001007980041479800f8 +:10110800320798000000eb00000f78001e009000e6 +:101118000000e0001d0032003e0090000000e000ea +:1011280014003200080037003e0090001e04400002 +:101138001e0090001e00400010407800dfff0700ee +:10114800004c78001e0fe8004e4090000080fb0025 +:101158009e0f5000f4ff3e001a0037001e0090005a +:101168001e00400010407800d4ff07001e0fe80062 +:1011780001003700000000004e4090000080fb0096 +:101188009e0f5000f5ff3e000e0037003e00900015 +:101198000000e0000b003200060037003e0090001f +:1011a8001e0440000040eb00c4ff0700004c78001c +:1011b8001e0fe8004e4090000080fb009e0f50007c +:1011c800f6ff3e001e007800004078004f047800cb +:1011d8000080fa00000006000000fa0040108000bd +:1011e8006100600000f0a7000000ea000000e900cc +:1011f8004f00de00004078000080fa000000060082 +:101208000000fa0011108000000820000080600033 +:1012180000f0a7000000ea000000e9004f00de002f +:10122800004078000080fa00000006000000fa0084 +:1012380011108000000420000080600000f0a7006a +:101248000000ea000000e9004f00de0000407800de +:101258000080fa00000006000000fa00cde2a900b4 +:101268000080fa00000006000000fa00cde2a800a5 +:101278000080fa00000006000000fa003628ef009f +:101288000000eb00120007000000eb00160007004a +:1012980000082000c010880060022000901088001c +:1012a80010002000a010880090012000b0108800d5 +:1012b8001c22ef0000032000d01088008a40a900fb +:1012c8008a20a9009a20a8000080fa0000000600e1 +:1012d8000200fa00000f78009e007800d1418800d3 +:1012e8000080fa00000006000200fa00000f7800f3 +:1012f8009e007800c14188000080fa0000000600c6 +:101308000000fa00d04180000080fa0000000600ca +:101318000000fa00c04180000080fa0000000600ca +:101328000200fa00000f78009e007800e1108800a3 +:101338000080fa00000006000400fa001007980078 +:101348009e009000010f78009e009000f00f200092 +:10135800808f50000c0036001e4090000080fb007b +:101368000000400000407800e640600000cfb30075 +:1013780000c07000104798001e4090000080fb00dd +:10138800d0108800030037001e4078000080fb0062 +:10139800d01088001e007800e04188000080fa0024 +:1013a800000006000200fa00000f78001e00780016 +:1013b800e10f500009003200e10f5000030039002e +:1013c800e20f50000a003200150037003ec8bf0087 +:1013d8000080fb00801088001100370010c0b300a7 +:1013e8004de8b700c0842000bfff07000c0037009d +:1013f80080108000004078003ee8b700e1832000bc +:101408009140780040c6b30080cf500002003600fb +:10141800ccc2a90002003700ccc2a800000000001e +:1014280010c0b3000080fa00000006000000fa00b7 +:101438000021ef00104e2e0010088800000328003d +:1014480020088800a04280000000e00002003a0066 +:1014580060a62000200007008460a9009460a8000e +:101468005668ef000080fa00000006000200fa004b +:10147800000f78009e007800110888005668ef0079 +:101488000080fa00000006000000fa001008800042 +:101498000080fa00000006000200fa00000f780041 +:1014a8009e007800010888005668ef000080fa0066 +:1014b800000006000000fa00000880000080fa0022 +:1014c800000006000000fa00cd02a900cce2a80046 +:1014d8000080fa00000006000200fa00000f780001 +:1014e8009460a9009e007800a14288009460a8003a +:1014f8000080fa00000006000000fa005668ef00bd +:101508009460a80005e1a8000080fa000000060029 +:101518000000fa0005e1a9009460a9000080fa0023 +:10152800000006000200fa00618520009140780062 +:10153800014f78001e4078000004e00001003200ee +:101548005668ef001e4078000080fa000000060090 +:101558000000fa0057c8bf000080fb000080fa00b6 +:10156800000006000000fa005768ef000080fa004b +:10157800000006000000fa00890007003aff070093 +:10158800c422a800201680000000d100614060003d +:101598000080fb0061006000211680000100a100ae +:1015a8000100700020168800c482a8002aff0700e6 +:1015b8005ac8bf000080fb00b7fd07002aff0700dc +:1015c800ccc2a900cce2a800cd02a8006116800018 +:1015d80000102000008060000000e00007003200da +:1015e8001dff070012c0b30051c0b300f0c0b30024 +:1015f800b3fc07001cff0700f4ff370016ff0700c5 +:101608000041eb0051c0b300f0c0b300acfc0700d0 +:1016180015ff0700edff37000000fa000010230057 +:10162800203a88004827ef004e27ef007027ef0088 +:101638007227ef007427ef007627ef007a27ef0074 +:101648007e27ef002200200080072000a10920004b +:1016580033742000804978008149780082497800f5 +:101668000001eb00600420007105200023742000b5 +:101678008049780081497800824978000080fa0022 +:041688000000060058 +:020000040000fa +:10168c003608000014000000000000004a080000aa +:10169c000a000000020000003001aa0001303100f5 +:1016ac003233340000000000580800000200000033 +:1016bc0002000000ffff00000008000020000000f6 +:1016cc00000000005a0800000200000000000000aa +:1016dc002008000016000000000000005408000064 +:0c16ec00040000000000000000000000ee +:020000040000fa +:1016f8000000fa00c422ef00cc22ef00400a2000cc +:1017080000168800f0432500401688005620ef0098 +:101718005820ef006e20ef007020ef00c622ef0087 +:10172800001c200070168800e024ef00000325004c +:10173800102788000080fa00000006000000fa0068 +:10174800e1058000f0f82f00008060000040a00054 +:10175800e005880021058000f0ff28000080600077 +:1017680000c0a000200588000080fa0000000600e4 +:101778000200fa00000f78009e007800c14288003d +:10178800ffff37000000fa00008020008007780083 +:1017980080812000000188000080fa000000060017 +:1017a8000000fa00d2ff07009bff0700e3ff0700d5 +:1017b800b1fe070035fe07001cff07000080fa0095 +:0417c8000000060017 +:020000040000fa +:0200000401f009 +:04000000ffffff00ff +:020000040000fa +:0200000401f009 +:04000800ffffff00f7 +:020000040000fa +:0200000401f009 +:04000c005aff000097 +:020000040000fa +:0200000401f009 +:04001000baff000033 +:020000040000fa +:0200000401f009 +:040014005fff00008a +:020000040000fa +:0200000401f009 +:04001800ffff0000e6 +:020000040000fa +:0200000401f009 +:04001c00ffff0000e2 +:00000001FF diff --git a/dist/default/production/resbox.X.production.map b/dist/default/production/resbox.X.production.map new file mode 100644 index 0000000..3bf4994 --- /dev/null +++ b/dist/default/production/resbox.X.production.map @@ -0,0 +1,1506 @@ +Microchip Technology Inc, v2.10 (B) + +Tool Name: +  /opt/microchip/xc16/v2.10/bin/bin/../bin/elf-ld + +Command: +  -p24FV16KM202 \ +  --mdfp=/opt/microchip/mplabx/v6.15/packs/Microchip/PIC24F-KA-KL-KM_DFP/1.4.83/xc16 \ +  -o \ +  dist/default/production/resbox.X.production.elf \ +  -L/opt/microchip/xc16/v2.10/bin/bin/.. \ +  -L/opt/microchip/mplabx/v6.15/packs/Microchip/PIC24F-KA-KL-KM_DFP/1.4.83/xc16/bin/../support/PIC24F/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../lib \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/PIC24E/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/PIC24F/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/PIC24H/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/dsPIC30F/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/dsPIC33C/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/dsPIC33E/gld \ +  -L/opt/microchip/xc16/v2.10/bin/bin/../../support/dsPIC33F/gld \ +  build/default/production/mcc_generated_files/interrupt_manager.o \ +  build/default/production/mcc_generated_files/clock.o \ +  build/default/production/mcc_generated_files/pin_manager.o \ +  build/default/production/mcc_generated_files/mssp2_i2c.o \ +  build/default/production/mcc_generated_files/system.o \ +  build/default/production/mcc_generated_files/traps.o \ +  build/default/production/mcc_generated_files/mcc.o \ +  build/default/production/mcc_generated_files/mssp1_spi.o \ +  build/default/production/main.o \ +  build/default/production/SPI.o \ +  build/default/production/mcc_generated_files/tmr1.o \ +  --defsym=__MPLAB_BUILD=1 \ +  -Tp24FV16KM202.gld.00 \ +  --stack=16 \ +  --check-sections \ +  --data-init \ +  --pack-data \ +  --handles \ +  --isr \ +  --no-gc-sections \ +  --fill-upper=0 \ +  --stackguard=16 \ +  --no-force-link \ +  --smart-io \ +  -Map=dist/default/production/resbox.X.production.map \ +  --report-mem \ +  --memorysummary \ +  dist/default/production/memoryfile.xml \ +  -start-group \ +  --library=c99-pic30-elf \ +  --library=m-elf \ +  --library=c99-elf \ +  -end-group \ + + +Optional library libpPIC24Fxxx.a not found +Archive member included because of file (symbol) + +/opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(crt0_standard.o) +                              (__resetPRI) +/opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(data_init_standard.o) +                              /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(crt0_standard.o) (__data_init_standard) +/opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(crt_start_mode_normal.Meo) +                              (__crt_start_mode_normal) + + +Selected CodeGuard Options: +  FGS:GWRP:OFF +  FGS:GCP:OFF +  FBS:BWRP:OFF +  FBS:BSS:OFF + +CodeGuard FLASH Memory: +  boot    (none) +  secure  (none) +  general 0x200 to 0x2bfe + +CodeGuard RAM Memory: +  general 0x800 to 0xfff +  secure  (none) +  boot    (none) + +CodeGuard EEPROM Memory: +  general 0x7ffe00 to 0x7fffff +  secure  (none) +  boot    (none) + + +xc16-ld 2.10 (B) + +Default Code Model: Small +Default Data Model: Small +Default Scalar Model: Small + +"program" Memory  [Origin = 0x200, Length = 0x2a00] + +section                    address   length (PC units)   length (bytes) (dec) +-------                    -------   -----------------   -------------------- +.text                        0x200               0x264           0x396  (918) +.text                        0x464               0x6e2           0xa53  (2643) +.dinit                       0xb46                0x36            0x51  (81) +.text                        0xb7c                0x6a            0x9f  (159) + +                 Total "program" memory used (bytes):          0xed9  (3801) 23% + + +"data" Memory  [Origin = 0x800, Length = 0x800] + +section                    address      alignment gaps    total length  (dec) +-------                    -------      --------------    ------------------- +.nbss                        0x800                   0            0x4a  (74) +.ndata                       0x84a                   0             0xa  (10) +.nbss                        0x854                   0             0x4  (4) +.ndata                       0x858                   0             0x2  (2) +.nbss                        0x85a                   0             0x2  (2) + +                 Total "data" memory used (bytes):           0x5c  (92) 4% + + +Dynamic Memory Usage + +region                     address                      maximum length  (dec) +------                     -------                      --------------------- +heap                             0                                   0  (0) +stack                        0x85c                               0x7a4  (1956) + +                 Maximum dynamic memory (bytes):          0x7a4  (1956) + +Info: Project is using a large data memory model when small data memory model is sufficient. + + +External Symbols in Data Memory (by address): + +                    0x0820                  _WriteBuffer +                    0x0826                  _ReadBuffer +                    0x082c                  _writeData +                    0x082e                  _readData +                    0x0830                  _addr0 +                    0x0831                  _addr1 +                    0x0832                  _write +                    0x0834                  _total +                    0x083e                  _yeah +                    0x083f                  _index +                    0x0840                  _temp +                    0x0841                  _i2cArray +                    0x084a                  _slaveAddress +                    0x084b                  _regAdd +                    0x0854                  _TMR1_InterruptHandler +                    0x085a                  _nullarray + +External Symbols in Data Memory (by name): + +                    0x0826                  _ReadBuffer +                    0x0854                  _TMR1_InterruptHandler +                    0x0820                  _WriteBuffer +                    0x0830                  _addr0 +                    0x0831                  _addr1 +                    0x0841                  _i2cArray +                    0x083f                  _index +                    0x085a                  _nullarray +                    0x082e                  _readData +                    0x084b                  _regAdd +                    0x084a                  _slaveAddress +                    0x0840                  _temp +                    0x0834                  _total +                    0x0832                  _write +                    0x082c                  _writeData +                    0x083e                  _yeah + +External Symbols in Program Memory (by address): + +                  0x000200                  __resetPRI +                  0x00023c                  __psv_init +                  0x000252                  __data_init +                  0x000252                  __data_init_standard +                  0x0002cc                  __MSSP2Interrupt +                  0x0003ac                  __OscillatorFail +                  0x0003cc                  __StackError +                  0x0003ee                  __AddressError +                  0x00040e                  __MathError +                  0x00042e                  __T1Interrupt +                  0x00045e                  __DefaultInterrupt +                  0x000464                  _Message_OUT +                  0x0004ee                  _Message_BIM +                  0x00052a                  _Message_MAPIN0 +                  0x000566                  _Message_MAPIN1 +                  0x0005a2                  _Message_INST +                  0x0005b4                  _Message_DAGIOL +                  0x0005f0                  _Message_DAGOSM +                  0x000602                  _Message_DAGOLON +                  0x000614                  _Message_DAGOLONEN +                  0x000650                  _Message_HWCR +                  0x000674                  _Message_HWCROCL +                  0x00069a                  _Message_HWCRPWM +                  0x0006d6                  _Message_PWMCR0 +                  0x000752                  _Message_PWMCR1 +                  0x0007ce                  _Message_PWMOUT +                  0x00080c                  _Message_PWMMAP +                  0x00084a                  _MSSP1_SPI_Initialize +                  0x000862                  _MSSP1_SPI_Exchange8bit +                  0x00087c                  _MSSP1_SPI_Exchange8bitBuffer +                  0x0008f0                  _MSSP1_SPI_IsBufferFull +                  0x000904                  _MSSP1_SPI_HasWriteCollisionOccured +                  0x00091a                  _MSSP1_SPI_HasReceiveOverflowOccured +                  0x000930                  _SPI_slaveSelect +                  0x000938                  _SPI_slaveDeselect +                  0x000940                  _MSSP2_I2C_Initialize +                  0x00096c                  _MSSP2_I2C_ReadPointerSet +                  0x000978                  _MSSP2_I2C_WritePointerSet +                  0x000984                  _MSSP2_I2C_ReadPointerGet +                  0x00098c                  _MSSP2_I2C_WritePointerGet +                  0x000994                  _MSSP2_I2C_SlaveAddressMaskSet +                  0x0009a0                  _MSSP2_I2C_SlaveAddressSet +                  0x0009d6                  _MSSP2_I2C_StatusCallback +                  0x000a1a                  _TMR1_Initialize +                  0x000a3a                  _TMR1_Period16BitSet +                  0x000a48                  _TMR1_Period16BitGet +                  0x000a50                  _TMR1_Counter16BitSet +                  0x000a5e                  _TMR1_Counter16BitGet +                  0x000a70                  _TMR1_SetInterruptHandler +                  0x000a80                  _TMR1_Start +                  0x000a8c                  _TMR1_Stop +                  0x000a96                  _TMR1_GetElapsedThenClear +                  0x000aac                  _TMR1_SoftwareCounterGet +                  0x000ab6                  _TMR1_SoftwareCounterClear +                  0x000abe                  _main +                  0x000b10                  _CLOCK_Initialize +                  0x000b7c                  _PIN_MANAGER_Initialize +                  0x000ba2                  _INTERRUPT_Initialize +                  0x000bd4                  _SYSTEM_Initialize +                  0xf80000                  __FBS.sec +                  0xf80004                  __FGS.sec + +External Symbols in Program Memory (by name): + +                  0x000b10                  _CLOCK_Initialize +                  0x000ba2                  _INTERRUPT_Initialize +                  0x000862                  _MSSP1_SPI_Exchange8bit +                  0x00087c                  _MSSP1_SPI_Exchange8bitBuffer +                  0x00091a                  _MSSP1_SPI_HasReceiveOverflowOccured +                  0x000904                  _MSSP1_SPI_HasWriteCollisionOccured +                  0x00084a                  _MSSP1_SPI_Initialize +                  0x0008f0                  _MSSP1_SPI_IsBufferFull +                  0x000940                  _MSSP2_I2C_Initialize +                  0x000984                  _MSSP2_I2C_ReadPointerGet +                  0x00096c                  _MSSP2_I2C_ReadPointerSet +                  0x000994                  _MSSP2_I2C_SlaveAddressMaskSet +                  0x0009a0                  _MSSP2_I2C_SlaveAddressSet +                  0x0009d6                  _MSSP2_I2C_StatusCallback +                  0x00098c                  _MSSP2_I2C_WritePointerGet +                  0x000978                  _MSSP2_I2C_WritePointerSet +                  0x0004ee                  _Message_BIM +                  0x0005b4                  _Message_DAGIOL +                  0x000602                  _Message_DAGOLON +                  0x000614                  _Message_DAGOLONEN +                  0x0005f0                  _Message_DAGOSM +                  0x000650                  _Message_HWCR +                  0x000674                  _Message_HWCROCL +                  0x00069a                  _Message_HWCRPWM +                  0x0005a2                  _Message_INST +                  0x00052a                  _Message_MAPIN0 +                  0x000566                  _Message_MAPIN1 +                  0x000464                  _Message_OUT +                  0x0006d6                  _Message_PWMCR0 +                  0x000752                  _Message_PWMCR1 +                  0x00080c                  _Message_PWMMAP +                  0x0007ce                  _Message_PWMOUT +                  0x000b7c                  _PIN_MANAGER_Initialize +                  0x000938                  _SPI_slaveDeselect +                  0x000930                  _SPI_slaveSelect +                  0x000bd4                  _SYSTEM_Initialize +                  0x000a5e                  _TMR1_Counter16BitGet +                  0x000a50                  _TMR1_Counter16BitSet +                  0x000a96                  _TMR1_GetElapsedThenClear +                  0x000a1a                  _TMR1_Initialize +                  0x000a48                  _TMR1_Period16BitGet +                  0x000a3a                  _TMR1_Period16BitSet +                  0x000a70                  _TMR1_SetInterruptHandler +                  0x000ab6                  _TMR1_SoftwareCounterClear +                  0x000aac                  _TMR1_SoftwareCounterGet +                  0x000a80                  _TMR1_Start +                  0x000a8c                  _TMR1_Stop +                  0x0003ee                  __AddressError +                  0x00045e                  __DefaultInterrupt +                  0xf80000                  __FBS.sec +                  0xf80004                  __FGS.sec +                  0x0002cc                  __MSSP2Interrupt +                  0x00040e                  __MathError +                  0x0003ac                  __OscillatorFail +                  0x0003cc                  __StackError +                  0x00042e                  __T1Interrupt +                  0x000252                  __data_init +                  0x000252                  __data_init_standard +                  0x00023c                  __psv_init +                  0x000200                  __resetPRI +                  0x000abe                  _main + +Memory Configuration + +Name             Origin             Length             Attributes +data             0x000800           0x000800           a !xr +reset            0x000000           0x000004   +ivt              0x000004           0x0000fc   +_reserved        0x000100           0x000004   +aivt             0x000104           0x0000fc   +program          0x000200           0x002a00           xr +eedata           0x7ffe00           0x000200   +FBS              0xf80000           0x000002   +FGS              0xf80004           0x000002   +FOSCSEL          0xf80006           0x000002   +FOSC             0xf80008           0x000002   +FWDT             0xf8000a           0x000002   +FPOR             0xf8000c           0x000002   +FICD             0xf8000e           0x000002   +*default*        0x000000           0xffffffffffffffff   + +Linker script and memory map + +LOAD build/default/production/mcc_generated_files/interrupt_manager.o +LOAD build/default/production/mcc_generated_files/clock.o +LOAD build/default/production/mcc_generated_files/pin_manager.o +LOAD build/default/production/mcc_generated_files/mssp2_i2c.o +LOAD build/default/production/mcc_generated_files/system.o +LOAD build/default/production/mcc_generated_files/traps.o +LOAD build/default/production/mcc_generated_files/mcc.o +LOAD build/default/production/mcc_generated_files/mssp1_spi.o +LOAD build/default/production/main.o +LOAD build/default/production/SPI.o +LOAD build/default/production/mcc_generated_files/tmr1.o +                    0x0001                  __MPLAB_BUILD = 0x1 +LOAD pPIC24Fxxx +LOAD /opt/microchip/xc16/v2.10/bin/bin/../../lib/libfx-elf.a +                    0xf80000                  __FBS = 0xf80000 +                    0xf80004                  __FGS = 0xf80004 +                    0xf80006                  __FOSCSEL = 0xf80006 +                    0xf80008                  __FOSC = 0xf80008 +                    0xf8000a                  __FWDT = 0xf8000a +                    0xf8000c                  __FPOR = 0xf8000c +                    0xf8000e                  __FICD = 0xf8000e +                    0x0001                  __NO_HANDLES = 0x1 +                    0x0200                  __CODE_BASE = 0x200 +                    0x2a00                  __CODE_LENGTH = 0x2a00 +                    0x0004                  __IVT_BASE = 0x4 +                    0x0104                  __AIVT_BASE = 0x104 +                    0x0800                  __DATA_BASE = 0x800 +                    0x0800                  __DATA_LENGTH = 0x800 + +.reset            0x000000          0x4 +                  0x000000          0x2 SHORT 0x200 ABSOLUTE (__reset) +                  0x000001          0x2 SHORT 0x4 +                  0x000002          0x2 SHORT 0x0 ((ABSOLUTE (__reset) >> 0x10) & 0x7f) +                  0x000003          0x2 SHORT 0x0 + +.text             0x000200        0x264 + *(.init) + .init            0x000200         0x4c /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(crt0_standard.o) +                  0x000200                  __reset +                  0x000200                  __resetPRI +                  0x00023c                  __psv_init + .init            0x00024c         0x7c /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(data_init_standard.o) +                  0x000252                  __data_init +                  0x000252                  __data_init_standard + *(.user_init) + *(.handle) + *(.isr*) + .isr.text        0x0002cc         0xe0 build/default/production/mcc_generated_files/mssp2_i2c.o +                  0x0002cc                  __MSSP2Interrupt + .isr.text        0x0003ac         0x82 build/default/production/mcc_generated_files/traps.o +                  0x0003ac                  __OscillatorFail +                  0x0003cc                  __StackError +                  0x0003ee                  __AddressError +                  0x00040e                  __MathError + .isr.text        0x00042e         0x30 build/default/production/mcc_generated_files/tmr1.o +                  0x00042e                  __T1Interrupt + .isr             0x00045e          0x4 default_isr +                  0x00045e                  __DefaultInterrupt + *(.libc) + *(.libm) + *(.libdsp) + *(.lib*) + .libpic30_crt_start_mode +                  0x000462          0x2 /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(crt_start_mode_normal.Meo) +                  0x000462                  __crt_start_mode_normal +                  0x000462                  __crt_start_mode + +usercode + *(usercode) + +__FBS             0xf80000          0x2 + *(__FBS.sec*) + __FBS.sec        0xf80000          0x2 /CW/_FBSx0 Ôþ\ +                  0xf80000                  __FBS.sec + +__FGS             0xf80004          0x2 + *(__FGS.sec*) + __FGS.sec        0xf80004          0x2 /CW/_FGS¨lŸÔþ\ +                  0xf80004                  __FGS.sec + +__FOSCSEL + *(__FOSCSEL.sec*) + +__FOSC + *(__FOSC.sec*) + +__FWDT + *(__FWDT.sec*) + +__FPOR + *(__FPOR.sec*) + +__FICD + *(__FICD.sec*) + +.comment + *(.comment) + +.debug_info       0x000000       0x3c77 + *(.debug_info) + .debug_info      0x000000        0x525 build/default/production/mcc_generated_files/interrupt_manager.o + .debug_info      0x000525        0x28b build/default/production/mcc_generated_files/clock.o + .debug_info      0x0007b0        0x2ea build/default/production/mcc_generated_files/pin_manager.o + .debug_info      0x000a9a        0xe28 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_info      0x0018c2        0x327 build/default/production/mcc_generated_files/system.o + .debug_info      0x001be9        0x390 build/default/production/mcc_generated_files/traps.o + .debug_info      0x001f79        0x935 build/default/production/mcc_generated_files/mssp1_spi.o + .debug_info      0x0028ae        0x3fb build/default/production/main.o + .debug_info      0x002ca9        0x534 build/default/production/SPI.o + .debug_info      0x0031dd        0xa9a build/default/production/mcc_generated_files/tmr1.o + *(.gnu.linkonce.wi.*) + +.debug_abbrev     0x000000        0x967 + *(.debug_abbrev) + .debug_abbrev    0x000000         0xb4 build/default/production/mcc_generated_files/interrupt_manager.o + .debug_abbrev    0x0000b4         0x59 build/default/production/mcc_generated_files/clock.o + .debug_abbrev    0x00010d         0x6a build/default/production/mcc_generated_files/pin_manager.o + .debug_abbrev    0x000177        0x1d7 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_abbrev    0x00034e         0xb4 build/default/production/mcc_generated_files/system.o + .debug_abbrev    0x000402        0x10d build/default/production/mcc_generated_files/traps.o + .debug_abbrev    0x00050f          0x1 build/default/production/mcc_generated_files/mcc.o + .debug_abbrev    0x000510        0x11c build/default/production/mcc_generated_files/mssp1_spi.o + .debug_abbrev    0x00062c         0xd9 build/default/production/main.o + .debug_abbrev    0x000705         0xd5 build/default/production/SPI.o + .debug_abbrev    0x0007da        0x18d build/default/production/mcc_generated_files/tmr1.o + +.debug_line       0x000000        0xb82 + *(.debug_line) + .debug_line      0x000000        0x110 build/default/production/mcc_generated_files/interrupt_manager.o + .debug_line      0x000110        0x10d build/default/production/mcc_generated_files/clock.o + .debug_line      0x00021d        0x114 build/default/production/mcc_generated_files/pin_manager.o + .debug_line      0x000331        0x185 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_line      0x0004b6        0x10a build/default/production/mcc_generated_files/system.o + .debug_line      0x0005c0        0x135 build/default/production/mcc_generated_files/traps.o + .debug_line      0x0006f5         0x1a build/default/production/mcc_generated_files/mcc.o + .debug_line      0x00070f        0x136 build/default/production/mcc_generated_files/mssp1_spi.o + .debug_line      0x000845        0x106 build/default/production/main.o + .debug_line      0x00094b         0xe9 build/default/production/SPI.o + .debug_line      0x000a34        0x14e build/default/production/mcc_generated_files/tmr1.o + +.debug_frame      0x000000        0x760 + *(.debug_frame) + .debug_frame     0x000000         0x2e build/default/production/mcc_generated_files/interrupt_manager.o + .debug_frame     0x00002e         0x2e build/default/production/mcc_generated_files/clock.o + .debug_frame     0x00005c         0x2e build/default/production/mcc_generated_files/pin_manager.o + .debug_frame     0x00008a        0x110 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_frame     0x00019a         0x2e build/default/production/mcc_generated_files/system.o + .debug_frame     0x0001c8        0x140 build/default/production/mcc_generated_files/traps.o + .debug_frame     0x000308         0xec build/default/production/mcc_generated_files/mssp1_spi.o + .debug_frame     0x0003f4         0x2e build/default/production/main.o + .debug_frame     0x000422        0x1b4 build/default/production/SPI.o + .debug_frame     0x0005d6        0x18a build/default/production/mcc_generated_files/tmr1.o + +.debug_str        0x000000        0x153 + *(.debug_str) + .debug_str       0x000000         0x13 build/default/production/mcc_generated_files/interrupt_manager.o + .debug_str       0x000013         0x62 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_str       0x000075          0xc build/default/production/mcc_generated_files/system.o + .debug_str       0x000081          0xc build/default/production/mcc_generated_files/traps.o + .debug_str       0x00008d         0x47 build/default/production/mcc_generated_files/mssp1_spi.o + .debug_str       0x0000d4         0x1c build/default/production/main.o + .debug_str       0x0000f0         0x28 build/default/production/SPI.o + .debug_str       0x000118         0x3b build/default/production/mcc_generated_files/tmr1.o + +.debug_loc + *(.debug_loc) + +.debug_macinfo + *(.debug_macinfo) + +.debug_pubnames +                  0x000000        0x687 + *(.debug_pubnames) + .debug_pubnames +                  0x000000         0x2b build/default/production/mcc_generated_files/interrupt_manager.o + .debug_pubnames +                  0x00002b         0x27 build/default/production/mcc_generated_files/clock.o + .debug_pubnames +                  0x000052         0x2d build/default/production/mcc_generated_files/pin_manager.o + .debug_pubnames +                  0x00007f        0x157 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_pubnames +                  0x0001d6         0x28 build/default/production/mcc_generated_files/system.o + .debug_pubnames +                  0x0001fe         0x6f build/default/production/mcc_generated_files/traps.o + .debug_pubnames +                  0x00026d         0xfb build/default/production/mcc_generated_files/mssp1_spi.o + .debug_pubnames +                  0x000368         0x29 build/default/production/main.o + .debug_pubnames +                  0x000391        0x1a0 build/default/production/SPI.o + .debug_pubnames +                  0x000531        0x156 build/default/production/mcc_generated_files/tmr1.o + +.debug_ranges + *(.debug_ranges) + +.debug_aranges    0x000000         0xf0 + *(.debug_aranges) + .debug_aranges +                  0x000000         0x18 build/default/production/mcc_generated_files/interrupt_manager.o + .debug_aranges +                  0x000018         0x18 build/default/production/mcc_generated_files/clock.o + .debug_aranges +                  0x000030         0x18 build/default/production/mcc_generated_files/pin_manager.o + .debug_aranges +                  0x000048         0x18 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_aranges +                  0x000060         0x18 build/default/production/mcc_generated_files/system.o + .debug_aranges +                  0x000078         0x18 build/default/production/mcc_generated_files/traps.o + .debug_aranges +                  0x000090         0x18 build/default/production/mcc_generated_files/mssp1_spi.o + .debug_aranges +                  0x0000a8         0x18 build/default/production/main.o + .debug_aranges +                  0x0000c0         0x18 build/default/production/SPI.o + .debug_aranges +                  0x0000d8         0x18 build/default/production/mcc_generated_files/tmr1.o +                    0x0000                  WREG0 = 0x0 +                    0x0000                  _WREG0 = 0x0 +                    0x0002                  WREG1 = 0x2 +                    0x0002                  _WREG1 = 0x2 +                    0x0004                  WREG2 = 0x4 +                    0x0004                  _WREG2 = 0x4 +                    0x0006                  WREG3 = 0x6 +                    0x0006                  _WREG3 = 0x6 +                    0x0008                  WREG4 = 0x8 +                    0x0008                  _WREG4 = 0x8 +                    0x000a                  WREG5 = 0xa +                    0x000a                  _WREG5 = 0xa +                    0x000c                  WREG6 = 0xc +                    0x000c                  _WREG6 = 0xc +                    0x000e                  WREG7 = 0xe +                    0x000e                  _WREG7 = 0xe +                    0x0010                  WREG8 = 0x10 +                    0x0010                  _WREG8 = 0x10 +                    0x0012                  WREG9 = 0x12 +                    0x0012                  _WREG9 = 0x12 +                    0x0014                  WREG10 = 0x14 +                    0x0014                  _WREG10 = 0x14 +                    0x0016                  WREG11 = 0x16 +                    0x0016                  _WREG11 = 0x16 +                    0x0018                  WREG12 = 0x18 +                    0x0018                  _WREG12 = 0x18 +                    0x001a                  WREG13 = 0x1a +                    0x001a                  _WREG13 = 0x1a +                    0x001c                  WREG14 = 0x1c +                    0x001c                  _WREG14 = 0x1c +                    0x001e                  WREG15 = 0x1e +                    0x001e                  _WREG15 = 0x1e +                    0x0020                  SPLIM = 0x20 +                    0x0020                  _SPLIM = 0x20 +                    0x002e                  PCL = 0x2e +                    0x002e                  _PCL = 0x2e +                    0x0030                  PCH = 0x30 +                    0x0030                  _PCH = 0x30 +                    0x0032                  TBLPAG = 0x32 +                    0x0032                  _TBLPAG = 0x32 +                    0x0032                  _TBLPAGbits = 0x32 +                    0x0034                  PSVPAG = 0x34 +                    0x0034                  _PSVPAG = 0x34 +                    0x0034                  _PSVPAGbits = 0x34 +                    0x0036                  RCOUNT = 0x36 +                    0x0036                  _RCOUNT = 0x36 +                    0x0042                  SR = 0x42 +                    0x0042                  _SR = 0x42 +                    0x0042                  _SRbits = 0x42 +                    0x0044                  CORCON = 0x44 +                    0x0044                  _CORCON = 0x44 +                    0x0044                  _CORCONbits = 0x44 +                    0x0052                  DISICNT = 0x52 +                    0x0052                  _DISICNT = 0x52 +                    0x0052                  _DISICNTbits = 0x52 +                    0x0056                  CNPD1 = 0x56 +                    0x0056                  _CNPD1 = 0x56 +                    0x0056                  _CNPD1bits = 0x56 +                    0x0058                  CNPD2 = 0x58 +                    0x0058                  _CNPD2 = 0x58 +                    0x0058                  _CNPD2bits = 0x58 +                    0x0062                  CNEN1 = 0x62 +                    0x0062                  _CNEN1 = 0x62 +                    0x0062                  _CNEN1bits = 0x62 +                    0x0064                  CNEN2 = 0x64 +                    0x0064                  _CNEN2 = 0x64 +                    0x0064                  _CNEN2bits = 0x64 +                    0x006e                  CNPU1 = 0x6e +                    0x006e                  _CNPU1 = 0x6e +                    0x006e                  _CNPU1bits = 0x6e +                    0x0070                  CNPU2 = 0x70 +                    0x0070                  _CNPU2 = 0x70 +                    0x0070                  _CNPU2bits = 0x70 +                    0x0080                  INTCON1 = 0x80 +                    0x0080                  _INTCON1 = 0x80 +                    0x0080                  _INTCON1bits = 0x80 +                    0x0082                  INTCON2 = 0x82 +                    0x0082                  _INTCON2 = 0x82 +                    0x0082                  _INTCON2bits = 0x82 +                    0x0084                  IFS0 = 0x84 +                    0x0084                  _IFS0 = 0x84 +                    0x0084                  _IFS0bits = 0x84 +                    0x0086                  IFS1 = 0x86 +                    0x0086                  _IFS1 = 0x86 +                    0x0086                  _IFS1bits = 0x86 +                    0x0088                  IFS2 = 0x88 +                    0x0088                  _IFS2 = 0x88 +                    0x0088                  _IFS2bits = 0x88 +                    0x008a                  IFS3 = 0x8a +                    0x008a                  _IFS3 = 0x8a +                    0x008a                  _IFS3bits = 0x8a +                    0x008c                  IFS4 = 0x8c +                    0x008c                  _IFS4 = 0x8c +                    0x008c                  _IFS4bits = 0x8c +                    0x008e                  IFS5 = 0x8e +                    0x008e                  _IFS5 = 0x8e +                    0x008e                  _IFS5bits = 0x8e +                    0x0090                  IFS6 = 0x90 +                    0x0090                  _IFS6 = 0x90 +                    0x0090                  _IFS6bits = 0x90 +                    0x0094                  IEC0 = 0x94 +                    0x0094                  _IEC0 = 0x94 +                    0x0094                  _IEC0bits = 0x94 +                    0x0096                  IEC1 = 0x96 +                    0x0096                  _IEC1 = 0x96 +                    0x0096                  _IEC1bits = 0x96 +                    0x0098                  IEC2 = 0x98 +                    0x0098                  _IEC2 = 0x98 +                    0x0098                  _IEC2bits = 0x98 +                    0x009a                  IEC3 = 0x9a +                    0x009a                  _IEC3 = 0x9a +                    0x009a                  _IEC3bits = 0x9a +                    0x009c                  IEC4 = 0x9c +                    0x009c                  _IEC4 = 0x9c +                    0x009c                  _IEC4bits = 0x9c +                    0x009e                  IEC5 = 0x9e +                    0x009e                  _IEC5 = 0x9e +                    0x009e                  _IEC5bits = 0x9e +                    0x00a0                  IEC6 = 0xa0 +                    0x00a0                  _IEC6 = 0xa0 +                    0x00a0                  _IEC6bits = 0xa0 +                    0x00a4                  IPC0 = 0xa4 +                    0x00a4                  _IPC0 = 0xa4 +                    0x00a4                  _IPC0bits = 0xa4 +                    0x00a6                  IPC1 = 0xa6 +                    0x00a6                  _IPC1 = 0xa6 +                    0x00a6                  _IPC1bits = 0xa6 +                    0x00a8                  IPC2 = 0xa8 +                    0x00a8                  _IPC2 = 0xa8 +                    0x00a8                  _IPC2bits = 0xa8 +                    0x00aa                  IPC3 = 0xaa +                    0x00aa                  _IPC3 = 0xaa +                    0x00aa                  _IPC3bits = 0xaa +                    0x00ac                  IPC4 = 0xac +                    0x00ac                  _IPC4 = 0xac +                    0x00ac                  _IPC4bits = 0xac +                    0x00ae                  IPC5 = 0xae +                    0x00ae                  _IPC5 = 0xae +                    0x00ae                  _IPC5bits = 0xae +                    0x00b0                  IPC6 = 0xb0 +                    0x00b0                  _IPC6 = 0xb0 +                    0x00b0                  _IPC6bits = 0xb0 +                    0x00b2                  IPC7 = 0xb2 +                    0x00b2                  _IPC7 = 0xb2 +                    0x00b2                  _IPC7bits = 0xb2 +                    0x00b8                  IPC10 = 0xb8 +                    0x00b8                  _IPC10 = 0xb8 +                    0x00b8                  _IPC10bits = 0xb8 +                    0x00bc                  IPC12 = 0xbc +                    0x00bc                  _IPC12 = 0xbc +                    0x00bc                  _IPC12bits = 0xbc +                    0x00c2                  IPC15 = 0xc2 +                    0x00c2                  _IPC15 = 0xc2 +                    0x00c2                  _IPC15bits = 0xc2 +                    0x00c4                  IPC16 = 0xc4 +                    0x00c4                  _IPC16 = 0xc4 +                    0x00c4                  _IPC16bits = 0xc4 +                    0x00c8                  IPC18 = 0xc8 +                    0x00c8                  _IPC18 = 0xc8 +                    0x00c8                  _IPC18bits = 0xc8 +                    0x00ca                  IPC19 = 0xca +                    0x00ca                  _IPC19 = 0xca +                    0x00ca                  _IPC19bits = 0xca +                    0x00cc                  IPC20 = 0xcc +                    0x00cc                  _IPC20 = 0xcc +                    0x00cc                  _IPC20bits = 0xcc +                    0x00d4                  IPC24 = 0xd4 +                    0x00d4                  _IPC24 = 0xd4 +                    0x00d4                  _IPC24bits = 0xd4 +                    0x00e0                  INTTREG = 0xe0 +                    0x00e0                  _INTTREG = 0xe0 +                    0x00e0                  _INTTREGbits = 0xe0 +                    0x0100                  TMR1 = 0x100 +                    0x0100                  _TMR1 = 0x100 +                    0x0102                  PR1 = 0x102 +                    0x0102                  _PR1 = 0x102 +                    0x0104                  T1CON = 0x104 +                    0x0104                  _T1CON = 0x104 +                    0x0104                  _T1CONbits = 0x104 +                    0x0122                  CLC1CONL = 0x122 +                    0x0122                  _CLC1CONL = 0x122 +                    0x0122                  _CLC1CONLbits = 0x122 +                    0x0124                  CLC1CONH = 0x124 +                    0x0124                  _CLC1CONH = 0x124 +                    0x0124                  _CLC1CONHbits = 0x124 +                    0x0126                  CLC1SEL = 0x126 +                    0x0126                  _CLC1SEL = 0x126 +                    0x0126                  _CLC1SELbits = 0x126 +                    0x0126                  CLC1SELL = 0x126 +                    0x0126                  _CLC1SELL = 0x126 +                    0x0126                  _CLC1SELLbits = 0x126 +                    0x012a                  CLC1GLSL = 0x12a +                    0x012a                  _CLC1GLSL = 0x12a +                    0x012a                  _CLC1GLSLbits = 0x12a +                    0x012c                  CLC1GLSH = 0x12c +                    0x012c                  _CLC1GLSH = 0x12c +                    0x012c                  _CLC1GLSHbits = 0x12c +                    0x012e                  CLC2CONL = 0x12e +                    0x012e                  _CLC2CONL = 0x12e +                    0x012e                  _CLC2CONLbits = 0x12e +                    0x0130                  CLC2CONH = 0x130 +                    0x0130                  _CLC2CONH = 0x130 +                    0x0130                  _CLC2CONHbits = 0x130 +                    0x0132                  CLC2SEL = 0x132 +                    0x0132                  _CLC2SEL = 0x132 +                    0x0132                  _CLC2SELbits = 0x132 +                    0x0132                  CLC2SELL = 0x132 +                    0x0132                  _CLC2SELL = 0x132 +                    0x0132                  _CLC2SELLbits = 0x132 +                    0x0136                  CLC2GLSL = 0x136 +                    0x0136                  _CLC2GLSL = 0x136 +                    0x0136                  _CLC2GLSLbits = 0x136 +                    0x0138                  CLC2GLSH = 0x138 +                    0x0138                  _CLC2GLSH = 0x138 +                    0x0138                  _CLC2GLSHbits = 0x138 +                    0x0140                  CCP1CON1L = 0x140 +                    0x0140                  _CCP1CON1L = 0x140 +                    0x0140                  _CCP1CON1Lbits = 0x140 +                    0x0142                  CCP1CON1H = 0x142 +                    0x0142                  _CCP1CON1H = 0x142 +                    0x0142                  _CCP1CON1Hbits = 0x142 +                    0x0144                  CCP1CON2L = 0x144 +                    0x0144                  _CCP1CON2L = 0x144 +                    0x0144                  _CCP1CON2Lbits = 0x144 +                    0x0146                  CCP1CON2H = 0x146 +                    0x0146                  _CCP1CON2H = 0x146 +                    0x0146                  _CCP1CON2Hbits = 0x146 +                    0x0148                  CCP1CON3L = 0x148 +                    0x0148                  _CCP1CON3L = 0x148 +                    0x0148                  _CCP1CON3Lbits = 0x148 +                    0x014a                  CCP1CON3H = 0x14a +                    0x014a                  _CCP1CON3H = 0x14a +                    0x014a                  _CCP1CON3Hbits = 0x14a +                    0x014c                  CCP1STAT = 0x14c +                    0x014c                  _CCP1STAT = 0x14c +                    0x014c                  _CCP1STATbits = 0x14c +                    0x014c                  CCP1STATL = 0x14c +                    0x014c                  _CCP1STATL = 0x14c +                    0x014c                  _CCP1STATLbits = 0x14c +                    0x0150                  CCP1TMRL = 0x150 +                    0x0150                  _CCP1TMRL = 0x150 +                    0x0152                  CCP1TMRH = 0x152 +                    0x0152                  _CCP1TMRH = 0x152 +                    0x0154                  CCP1PRL = 0x154 +                    0x0154                  _CCP1PRL = 0x154 +                    0x0156                  CCP1PRH = 0x156 +                    0x0156                  _CCP1PRH = 0x156 +                    0x0158                  CCP1RA = 0x158 +                    0x0158                  _CCP1RA = 0x158 +                    0x0158                  CCP1RAL = 0x158 +                    0x0158                  _CCP1RAL = 0x158 +                    0x015c                  CCP1RB = 0x15c +                    0x015c                  _CCP1RB = 0x15c +                    0x015c                  CCP1RBL = 0x15c +                    0x015c                  _CCP1RBL = 0x15c +                    0x0160                  CCP1BUFL = 0x160 +                    0x0160                  _CCP1BUFL = 0x160 +                    0x0162                  CCP1BUFH = 0x162 +                    0x0162                  _CCP1BUFH = 0x162 +                    0x0164                  CCP2CON1L = 0x164 +                    0x0164                  _CCP2CON1L = 0x164 +                    0x0164                  _CCP2CON1Lbits = 0x164 +                    0x0166                  CCP2CON1H = 0x166 +                    0x0166                  _CCP2CON1H = 0x166 +                    0x0166                  _CCP2CON1Hbits = 0x166 +                    0x0168                  CCP2CON2L = 0x168 +                    0x0168                  _CCP2CON2L = 0x168 +                    0x0168                  _CCP2CON2Lbits = 0x168 +                    0x016a                  CCP2CON2H = 0x16a +                    0x016a                  _CCP2CON2H = 0x16a +                    0x016a                  _CCP2CON2Hbits = 0x16a +                    0x016c                  CCP2CON3L = 0x16c +                    0x016c                  _CCP2CON3L = 0x16c +                    0x016c                  _CCP2CON3Lbits = 0x16c +                    0x016e                  CCP2CON3H = 0x16e +                    0x016e                  _CCP2CON3H = 0x16e +                    0x016e                  _CCP2CON3Hbits = 0x16e +                    0x0170                  CCP2STAT = 0x170 +                    0x0170                  _CCP2STAT = 0x170 +                    0x0170                  _CCP2STATbits = 0x170 +                    0x0170                  CCP2STATL = 0x170 +                    0x0170                  _CCP2STATL = 0x170 +                    0x0170                  _CCP2STATLbits = 0x170 +                    0x0174                  CCP2TMRL = 0x174 +                    0x0174                  _CCP2TMRL = 0x174 +                    0x0176                  CCP2TMRH = 0x176 +                    0x0176                  _CCP2TMRH = 0x176 +                    0x0178                  CCP2PRL = 0x178 +                    0x0178                  _CCP2PRL = 0x178 +                    0x017a                  CCP2PRH = 0x17a +                    0x017a                  _CCP2PRH = 0x17a +                    0x017c                  CCP2RA = 0x17c +                    0x017c                  _CCP2RA = 0x17c +                    0x017c                  CCP2RAL = 0x17c +                    0x017c                  _CCP2RAL = 0x17c +                    0x0180                  CCP2RB = 0x180 +                    0x0180                  _CCP2RB = 0x180 +                    0x0180                  CCP2RBL = 0x180 +                    0x0180                  _CCP2RBL = 0x180 +                    0x0184                  CCP2BUFL = 0x184 +                    0x0184                  _CCP2BUFL = 0x184 +                    0x0186                  CCP2BUFH = 0x186 +                    0x0186                  _CCP2BUFH = 0x186 +                    0x0188                  CCP3CON1L = 0x188 +                    0x0188                  _CCP3CON1L = 0x188 +                    0x0188                  _CCP3CON1Lbits = 0x188 +                    0x018a                  CCP3CON1H = 0x18a +                    0x018a                  _CCP3CON1H = 0x18a +                    0x018a                  _CCP3CON1Hbits = 0x18a +                    0x018c                  CCP3CON2L = 0x18c +                    0x018c                  _CCP3CON2L = 0x18c +                    0x018c                  _CCP3CON2Lbits = 0x18c +                    0x018e                  CCP3CON2H = 0x18e +                    0x018e                  _CCP3CON2H = 0x18e +                    0x018e                  _CCP3CON2Hbits = 0x18e +                    0x0190                  CCP3CON3L = 0x190 +                    0x0190                  _CCP3CON3L = 0x190 +                    0x0190                  _CCP3CON3Lbits = 0x190 +                    0x0192                  CCP3CON3H = 0x192 +                    0x0192                  _CCP3CON3H = 0x192 +                    0x0192                  _CCP3CON3Hbits = 0x192 +                    0x0194                  CCP3STAT = 0x194 +                    0x0194                  _CCP3STAT = 0x194 +                    0x0194                  _CCP3STATbits = 0x194 +                    0x0194                  CCP3STATL = 0x194 +                    0x0194                  _CCP3STATL = 0x194 +                    0x0194                  _CCP3STATLbits = 0x194 +                    0x0198                  CCP3TMRL = 0x198 +                    0x0198                  _CCP3TMRL = 0x198 +                    0x019a                  CCP3TMRH = 0x19a +                    0x019a                  _CCP3TMRH = 0x19a +                    0x019c                  CCP3PRL = 0x19c +                    0x019c                  _CCP3PRL = 0x19c +                    0x019e                  CCP3PRH = 0x19e +                    0x019e                  _CCP3PRH = 0x19e +                    0x01a0                  CCP3RA = 0x1a0 +                    0x01a0                  _CCP3RA = 0x1a0 +                    0x01a0                  CCP3RAL = 0x1a0 +                    0x01a0                  _CCP3RAL = 0x1a0 +                    0x01a4                  CCP3RB = 0x1a4 +                    0x01a4                  _CCP3RB = 0x1a4 +                    0x01a4                  CCP3RBL = 0x1a4 +                    0x01a4                  _CCP3RBL = 0x1a4 +                    0x01a8                  CCP3BUFL = 0x1a8 +                    0x01a8                  _CCP3BUFL = 0x1a8 +                    0x01aa                  CCP3BUFH = 0x1aa +                    0x01aa                  _CCP3BUFH = 0x1aa +                    0x01ac                  CCP4CON1L = 0x1ac +                    0x01ac                  _CCP4CON1L = 0x1ac +                    0x01ac                  _CCP4CON1Lbits = 0x1ac +                    0x01ae                  CCP4CON1H = 0x1ae +                    0x01ae                  _CCP4CON1H = 0x1ae +                    0x01ae                  _CCP4CON1Hbits = 0x1ae +                    0x01b0                  CCP4CON2L = 0x1b0 +                    0x01b0                  _CCP4CON2L = 0x1b0 +                    0x01b0                  _CCP4CON2Lbits = 0x1b0 +                    0x01b2                  CCP4CON2H = 0x1b2 +                    0x01b2                  _CCP4CON2H = 0x1b2 +                    0x01b2                  _CCP4CON2Hbits = 0x1b2 +                    0x01b6                  CCP4CON3H = 0x1b6 +                    0x01b6                  _CCP4CON3H = 0x1b6 +                    0x01b6                  _CCP4CON3Hbits = 0x1b6 +                    0x01b8                  CCP4STAT = 0x1b8 +                    0x01b8                  _CCP4STAT = 0x1b8 +                    0x01b8                  _CCP4STATbits = 0x1b8 +                    0x01b8                  CCP4STATL = 0x1b8 +                    0x01b8                  _CCP4STATL = 0x1b8 +                    0x01b8                  _CCP4STATLbits = 0x1b8 +                    0x01bc                  CCP4TMRL = 0x1bc +                    0x01bc                  _CCP4TMRL = 0x1bc +                    0x01be                  CCP4TMRH = 0x1be +                    0x01be                  _CCP4TMRH = 0x1be +                    0x01c0                  CCP4PRL = 0x1c0 +                    0x01c0                  _CCP4PRL = 0x1c0 +                    0x01c2                  CCP4PRH = 0x1c2 +                    0x01c2                  _CCP4PRH = 0x1c2 +                    0x01c4                  CCP4RA = 0x1c4 +                    0x01c4                  _CCP4RA = 0x1c4 +                    0x01c4                  CCP4RAL = 0x1c4 +                    0x01c4                  _CCP4RAL = 0x1c4 +                    0x01c8                  CCP4RB = 0x1c8 +                    0x01c8                  _CCP4RB = 0x1c8 +                    0x01c8                  CCP4RBL = 0x1c8 +                    0x01c8                  _CCP4RBL = 0x1c8 +                    0x01cc                  CCP4BUFL = 0x1cc +                    0x01cc                  _CCP4BUFL = 0x1cc +                    0x01ce                  CCP4BUFH = 0x1ce +                    0x01ce                  _CCP4BUFH = 0x1ce +                    0x01d0                  CCP5CON1L = 0x1d0 +                    0x01d0                  _CCP5CON1L = 0x1d0 +                    0x01d0                  _CCP5CON1Lbits = 0x1d0 +                    0x01d2                  CCP5CON1H = 0x1d2 +                    0x01d2                  _CCP5CON1H = 0x1d2 +                    0x01d2                  _CCP5CON1Hbits = 0x1d2 +                    0x01d4                  CCP5CON2L = 0x1d4 +                    0x01d4                  _CCP5CON2L = 0x1d4 +                    0x01d4                  _CCP5CON2Lbits = 0x1d4 +                    0x01d6                  CCP5CON2H = 0x1d6 +                    0x01d6                  _CCP5CON2H = 0x1d6 +                    0x01d6                  _CCP5CON2Hbits = 0x1d6 +                    0x01da                  CCP5CON3H = 0x1da +                    0x01da                  _CCP5CON3H = 0x1da +                    0x01da                  _CCP5CON3Hbits = 0x1da +                    0x01dc                  CCP5STAT = 0x1dc +                    0x01dc                  _CCP5STAT = 0x1dc +                    0x01dc                  _CCP5STATbits = 0x1dc +                    0x01dc                  CCP5STATL = 0x1dc +                    0x01dc                  _CCP5STATL = 0x1dc +                    0x01dc                  _CCP5STATLbits = 0x1dc +                    0x01e0                  CCP5TMRL = 0x1e0 +                    0x01e0                  _CCP5TMRL = 0x1e0 +                    0x01e2                  CCP5TMRH = 0x1e2 +                    0x01e2                  _CCP5TMRH = 0x1e2 +                    0x01e4                  CCP5PRL = 0x1e4 +                    0x01e4                  _CCP5PRL = 0x1e4 +                    0x01e6                  CCP5PRH = 0x1e6 +                    0x01e6                  _CCP5PRH = 0x1e6 +                    0x01e8                  CCP5RA = 0x1e8 +                    0x01e8                  _CCP5RA = 0x1e8 +                    0x01e8                  CCP5RAL = 0x1e8 +                    0x01e8                  _CCP5RAL = 0x1e8 +                    0x01ec                  CCP5RB = 0x1ec +                    0x01ec                  _CCP5RB = 0x1ec +                    0x01ec                  CCP5RBL = 0x1ec +                    0x01ec                  _CCP5RBL = 0x1ec +                    0x01f0                  CCP5BUFL = 0x1f0 +                    0x01f0                  _CCP5BUFL = 0x1f0 +                    0x01f2                  CCP5BUFH = 0x1f2 +                    0x01f2                  _CCP5BUFH = 0x1f2 +                    0x0200                  SPI1BUF = 0x200 +                    0x0200                  _SPI1BUF = 0x200 +                    0x0200                  _SPI1BUFbits = 0x200 +                    0x0200                  SSP1BUF = 0x200 +                    0x0200                  _SSP1BUF = 0x200 +                    0x0200                  _SSP1BUFbits = 0x200 +                    0x0202                  SSP1CON1 = 0x202 +                    0x0202                  _SSP1CON1 = 0x202 +                    0x0202                  _SSP1CON1bits = 0x202 +                    0x0204                  SSP1CON2 = 0x204 +                    0x0204                  _SSP1CON2 = 0x204 +                    0x0204                  _SSP1CON2bits = 0x204 +                    0x0206                  SSP1CON3 = 0x206 +                    0x0206                  _SSP1CON3 = 0x206 +                    0x0206                  _SSP1CON3bits = 0x206 +                    0x0208                  SSP1STAT = 0x208 +                    0x0208                  _SSP1STAT = 0x208 +                    0x0208                  _SSP1STATbits = 0x208 +                    0x020a                  I2C1ADD = 0x20a +                    0x020a                  _I2C1ADD = 0x20a +                    0x020a                  _I2C1ADDbits = 0x20a +                    0x020a                  I2C1BRG = 0x20a +                    0x020a                  _I2C1BRG = 0x20a +                    0x020a                  _I2C1BRGbits = 0x20a +                    0x020a                  SSP1ADD = 0x20a +                    0x020a                  _SSP1ADD = 0x20a +                    0x020a                  _SSP1ADDbits = 0x20a +                    0x020a                  SSP1BRG = 0x20a +                    0x020a                  _SSP1BRG = 0x20a +                    0x020a                  _SSP1BRGbits = 0x20a +                    0x020c                  I2C1MSK = 0x20c +                    0x020c                  _I2C1MSK = 0x20c +                    0x020c                  _I2C1MSKbits = 0x20c +                    0x020c                  SSP1MSK = 0x20c +                    0x020c                  _SSP1MSK = 0x20c +                    0x020c                  _SSP1MSKbits = 0x20c +                    0x0210                  SPI2BUF = 0x210 +                    0x0210                  _SPI2BUF = 0x210 +                    0x0210                  _SPI2BUFbits = 0x210 +                    0x0210                  SSP2BUF = 0x210 +                    0x0210                  _SSP2BUF = 0x210 +                    0x0210                  _SSP2BUFbits = 0x210 +                    0x0212                  SSP2CON1 = 0x212 +                    0x0212                  _SSP2CON1 = 0x212 +                    0x0212                  _SSP2CON1bits = 0x212 +                    0x0214                  SSP2CON2 = 0x214 +                    0x0214                  _SSP2CON2 = 0x214 +                    0x0214                  _SSP2CON2bits = 0x214 +                    0x0216                  SSP2CON3 = 0x216 +                    0x0216                  _SSP2CON3 = 0x216 +                    0x0216                  _SSP2CON3bits = 0x216 +                    0x0218                  SSP2STAT = 0x218 +                    0x0218                  _SSP2STAT = 0x218 +                    0x0218                  _SSP2STATbits = 0x218 +                    0x021a                  I2C2ADD = 0x21a +                    0x021a                  _I2C2ADD = 0x21a +                    0x021a                  _I2C2ADDbits = 0x21a +                    0x021a                  I2C2BRG = 0x21a +                    0x021a                  _I2C2BRG = 0x21a +                    0x021a                  _I2C2BRGbits = 0x21a +                    0x021a                  SSP2ADD = 0x21a +                    0x021a                  _SSP2ADD = 0x21a +                    0x021a                  _SSP2ADDbits = 0x21a +                    0x021a                  SSP2BRG = 0x21a +                    0x021a                  _SSP2BRG = 0x21a +                    0x021a                  _SSP2BRGbits = 0x21a +                    0x021c                  I2C2MSK = 0x21c +                    0x021c                  _I2C2MSK = 0x21c +                    0x021c                  _I2C2MSKbits = 0x21c +                    0x021c                  SSP2MSK = 0x21c +                    0x021c                  _SSP2MSK = 0x21c +                    0x021c                  _SSP2MSKbits = 0x21c +                    0x0220                  U1MODE = 0x220 +                    0x0220                  _U1MODE = 0x220 +                    0x0220                  _U1MODEbits = 0x220 +                    0x0222                  U1STA = 0x222 +                    0x0222                  _U1STA = 0x222 +                    0x0222                  _U1STAbits = 0x222 +                    0x0224                  U1TXREG = 0x224 +                    0x0224                  _U1TXREG = 0x224 +                    0x0226                  U1RXREG = 0x226 +                    0x0226                  _U1RXREG = 0x226 +                    0x0228                  U1BRG = 0x228 +                    0x0228                  _U1BRG = 0x228 +                    0x0230                  U2MODE = 0x230 +                    0x0230                  _U2MODE = 0x230 +                    0x0230                  _U2MODEbits = 0x230 +                    0x0232                  U2STA = 0x232 +                    0x0232                  _U2STA = 0x232 +                    0x0232                  _U2STAbits = 0x232 +                    0x0234                  U2TXREG = 0x234 +                    0x0234                  _U2TXREG = 0x234 +                    0x0236                  U2RXREG = 0x236 +                    0x0236                  _U2RXREG = 0x236 +                    0x0238                  U2BRG = 0x238 +                    0x0238                  _U2BRG = 0x238 +                    0x024a                  AMP1CON = 0x24a +                    0x024a                  _AMP1CON = 0x24a +                    0x024a                  _AMP1CONbits = 0x24a +                    0x024c                  AMP2CON = 0x24c +                    0x024c                  _AMP2CON = 0x24c +                    0x024c                  _AMP2CONbits = 0x24c +                    0x0274                  DAC1CON = 0x274 +                    0x0274                  _DAC1CON = 0x274 +                    0x0274                  _DAC1CONbits = 0x274 +                    0x0276                  DAC1DAT = 0x276 +                    0x0276                  _DAC1DAT = 0x276 +                    0x0278                  DAC2CON = 0x278 +                    0x0278                  _DAC2CON = 0x278 +                    0x0278                  _DAC2CONbits = 0x278 +                    0x027a                  DAC2DAT = 0x27a +                    0x027a                  _DAC2DAT = 0x27a +                    0x02c0                  TRISA = 0x2c0 +                    0x02c0                  _TRISA = 0x2c0 +                    0x02c0                  _TRISAbits = 0x2c0 +                    0x02c2                  PORTA = 0x2c2 +                    0x02c2                  _PORTA = 0x2c2 +                    0x02c2                  _PORTAbits = 0x2c2 +                    0x02c4                  LATA = 0x2c4 +                    0x02c4                  _LATA = 0x2c4 +                    0x02c4                  _LATAbits = 0x2c4 +                    0x02c6                  ODCA = 0x2c6 +                    0x02c6                  _ODCA = 0x2c6 +                    0x02c6                  _ODCAbits = 0x2c6 +                    0x02c8                  TRISB = 0x2c8 +                    0x02c8                  _TRISB = 0x2c8 +                    0x02c8                  _TRISBbits = 0x2c8 +                    0x02ca                  PORTB = 0x2ca +                    0x02ca                  _PORTB = 0x2ca +                    0x02ca                  _PORTBbits = 0x2ca +                    0x02cc                  LATB = 0x2cc +                    0x02cc                  _LATB = 0x2cc +                    0x02cc                  _LATBbits = 0x2cc +                    0x02ce                  ODCB = 0x2ce +                    0x02ce                  _ODCB = 0x2ce +                    0x02ce                  _ODCBbits = 0x2ce +                    0x02fc                  PADCFG1 = 0x2fc +                    0x02fc                  _PADCFG1 = 0x2fc +                    0x02fc                  _PADCFG1bits = 0x2fc +                    0x0300                  ADC1BUF0 = 0x300 +                    0x0300                  _ADC1BUF0 = 0x300 +                    0x0302                  ADC1BUF1 = 0x302 +                    0x0302                  _ADC1BUF1 = 0x302 +                    0x0304                  ADC1BUF2 = 0x304 +                    0x0304                  _ADC1BUF2 = 0x304 +                    0x0306                  ADC1BUF3 = 0x306 +                    0x0306                  _ADC1BUF3 = 0x306 +                    0x0308                  ADC1BUF4 = 0x308 +                    0x0308                  _ADC1BUF4 = 0x308 +                    0x030a                  ADC1BUF5 = 0x30a +                    0x030a                  _ADC1BUF5 = 0x30a +                    0x030c                  ADC1BUF6 = 0x30c +                    0x030c                  _ADC1BUF6 = 0x30c +                    0x030e                  ADC1BUF7 = 0x30e +                    0x030e                  _ADC1BUF7 = 0x30e +                    0x0310                  ADC1BUF8 = 0x310 +                    0x0310                  _ADC1BUF8 = 0x310 +                    0x0312                  ADC1BUF9 = 0x312 +                    0x0312                  _ADC1BUF9 = 0x312 +                    0x0314                  ADC1BUF10 = 0x314 +                    0x0314                  _ADC1BUF10 = 0x314 +                    0x0316                  ADC1BUF11 = 0x316 +                    0x0316                  _ADC1BUF11 = 0x316 +                    0x0318                  ADC1BUF12 = 0x318 +                    0x0318                  _ADC1BUF12 = 0x318 +                    0x031a                  ADC1BUF13 = 0x31a +                    0x031a                  _ADC1BUF13 = 0x31a +                    0x031c                  ADC1BUF14 = 0x31c +                    0x031c                  _ADC1BUF14 = 0x31c +                    0x031e                  ADC1BUF15 = 0x31e +                    0x031e                  _ADC1BUF15 = 0x31e +                    0x0320                  ADC1BUF16 = 0x320 +                    0x0320                  _ADC1BUF16 = 0x320 +                    0x0322                  ADC1BUF17 = 0x322 +                    0x0322                  _ADC1BUF17 = 0x322 +                    0x0324                  ADC1BUF18 = 0x324 +                    0x0324                  _ADC1BUF18 = 0x324 +                    0x0326                  ADC1BUF19 = 0x326 +                    0x0326                  _ADC1BUF19 = 0x326 +                    0x0328                  ADC1BUF20 = 0x328 +                    0x0328                  _ADC1BUF20 = 0x328 +                    0x032a                  ADC1BUF21 = 0x32a +                    0x032a                  _ADC1BUF21 = 0x32a +                    0x032c                  ADC1BUF22 = 0x32c +                    0x032c                  _ADC1BUF22 = 0x32c +                    0x032e                  ADC1BUF23 = 0x32e +                    0x032e                  _ADC1BUF23 = 0x32e +                    0x0340                  AD1CON1 = 0x340 +                    0x0340                  _AD1CON1 = 0x340 +                    0x0340                  _AD1CON1bits = 0x340 +                    0x0342                  AD1CON2 = 0x342 +                    0x0342                  _AD1CON2 = 0x342 +                    0x0342                  _AD1CON2bits = 0x342 +                    0x0344                  AD1CON3 = 0x344 +                    0x0344                  _AD1CON3 = 0x344 +                    0x0344                  _AD1CON3bits = 0x344 +                    0x0348                  AD1CHS = 0x348 +                    0x0348                  _AD1CHS = 0x348 +                    0x0348                  _AD1CHSbits = 0x348 +                    0x0348                  AD1CHS0 = 0x348 +                    0x0348                  _AD1CHS0 = 0x348 +                    0x0348                  _AD1CHS0bits = 0x348 +                    0x034e                  AD1CSSH = 0x34e +                    0x034e                  _AD1CSSH = 0x34e +                    0x034e                  _AD1CSSHbits = 0x34e +                    0x0350                  AD1CSSL = 0x350 +                    0x0350                  _AD1CSSL = 0x350 +                    0x0350                  _AD1CSSLbits = 0x350 +                    0x0354                  AD1CON5 = 0x354 +                    0x0354                  _AD1CON5 = 0x354 +                    0x0354                  _AD1CON5bits = 0x354 +                    0x0356                  AD1CHITH = 0x356 +                    0x0356                  _AD1CHITH = 0x356 +                    0x0356                  _AD1CHITHbits = 0x356 +                    0x0358                  AD1CHITL = 0x358 +                    0x0358                  _AD1CHITL = 0x358 +                    0x0358                  _AD1CHITLbits = 0x358 +                    0x035a                  CTMUCON1L = 0x35a +                    0x035a                  _CTMUCON1L = 0x35a +                    0x035a                  _CTMUCON1Lbits = 0x35a +                    0x035c                  CTMUCON1H = 0x35c +                    0x035c                  _CTMUCON1H = 0x35c +                    0x035c                  _CTMUCON1Hbits = 0x35c +                    0x035e                  CTMUCON2 = 0x35e +                    0x035e                  _CTMUCON2 = 0x35e +                    0x035e                  _CTMUCON2bits = 0x35e +                    0x035e                  CTMUCON2L = 0x35e +                    0x035e                  _CTMUCON2L = 0x35e +                    0x035e                  _CTMUCON2Lbits = 0x35e +                    0x0360                  AD1CTMENH = 0x360 +                    0x0360                  _AD1CTMENH = 0x360 +                    0x0360                  _AD1CTMENHbits = 0x360 +                    0x0362                  AD1CTMENL = 0x362 +                    0x0362                  _AD1CTMENL = 0x362 +                    0x0362                  _AD1CTMENLbits = 0x362 +                    0x04e0                  ANSA = 0x4e0 +                    0x04e0                  _ANSA = 0x4e0 +                    0x04e0                  _ANSAbits = 0x4e0 +                    0x04e0                  ANSELA = 0x4e0 +                    0x04e0                  _ANSELA = 0x4e0 +                    0x04e0                  _ANSELAbits = 0x4e0 +                    0x04e2                  ANSB = 0x4e2 +                    0x04e2                  _ANSB = 0x4e2 +                    0x04e2                  _ANSBbits = 0x4e2 +                    0x04e2                  ANSELB = 0x4e2 +                    0x04e2                  _ANSELB = 0x4e2 +                    0x04e2                  _ANSELBbits = 0x4e2 +                    0x0620                  ALRMVAL = 0x620 +                    0x0620                  _ALRMVAL = 0x620 +                    0x0622                  ALCFGRPT = 0x622 +                    0x0622                  _ALCFGRPT = 0x622 +                    0x0622                  _ALCFGRPTbits = 0x622 +                    0x0624                  RTCVAL = 0x624 +                    0x0624                  _RTCVAL = 0x624 +                    0x0626                  RCFGCAL = 0x626 +                    0x0626                  _RCFGCAL = 0x626 +                    0x0626                  _RCFGCALbits = 0x626 +                    0x0628                  RTCPWC = 0x628 +                    0x0628                  _RTCPWC = 0x628 +                    0x0628                  _RTCPWCbits = 0x628 +                    0x0630                  CMSTAT = 0x630 +                    0x0630                  _CMSTAT = 0x630 +                    0x0630                  _CMSTATbits = 0x630 +                    0x0632                  CVRCON = 0x632 +                    0x0632                  _CVRCON = 0x632 +                    0x0632                  _CVRCONbits = 0x632 +                    0x0634                  CM1CON = 0x634 +                    0x0634                  _CM1CON = 0x634 +                    0x0634                  _CM1CONbits = 0x634 +                    0x0636                  CM2CON = 0x636 +                    0x0636                  _CM2CON = 0x636 +                    0x0636                  _CM2CONbits = 0x636 +                    0x0638                  CM3CON = 0x638 +                    0x0638                  _CM3CON = 0x638 +                    0x0638                  _CM3CONbits = 0x638 +                    0x0670                  BUFCON0 = 0x670 +                    0x0670                  _BUFCON0 = 0x670 +                    0x0670                  _BUFCON0bits = 0x670 +                    0x0740                  RCON = 0x740 +                    0x0740                  _RCON = 0x740 +                    0x0740                  _RCONbits = 0x740 +                    0x0742                  OSCCON = 0x742 +                    0x0742                  _OSCCON = 0x742 +                    0x0742                  _OSCCONbits = 0x742 +                    0x0742                  OSCCONL = 0x742 +                    0x0742                  _OSCCONL = 0x742 +                    0x0743                  OSCCONH = 0x743 +                    0x0743                  _OSCCONH = 0x743 +                    0x0744                  CLKDIV = 0x744 +                    0x0744                  _CLKDIV = 0x744 +                    0x0744                  _CLKDIVbits = 0x744 +                    0x0748                  OSCTUN = 0x748 +                    0x0748                  _OSCTUN = 0x748 +                    0x0748                  _OSCTUNbits = 0x748 +                    0x074e                  REFOCON = 0x74e +                    0x074e                  _REFOCON = 0x74e +                    0x074e                  _REFOCONbits = 0x74e +                    0x0756                  HLVDCON = 0x756 +                    0x0756                  _HLVDCON = 0x756 +                    0x0756                  _HLVDCONbits = 0x756 +                    0x0760                  NVMCON = 0x760 +                    0x0760                  _NVMCON = 0x760 +                    0x0760                  _NVMCONbits = 0x760 +                    0x0766                  NVMKEY = 0x766 +                    0x0766                  _NVMKEY = 0x766 +                    0x0766                  _NVMKEYbits = 0x766 +                    0x0768                  ULPWCON = 0x768 +                    0x0768                  _ULPWCON = 0x768 +                    0x0768                  _ULPWCONbits = 0x768 +                    0x0770                  PMD1 = 0x770 +                    0x0770                  _PMD1 = 0x770 +                    0x0770                  _PMD1bits = 0x770 +                    0x0772                  PMD2 = 0x772 +                    0x0772                  _PMD2 = 0x772 +                    0x0772                  _PMD2bits = 0x772 +                    0x0774                  PMD3 = 0x774 +                    0x0774                  _PMD3 = 0x774 +                    0x0774                  _PMD3bits = 0x774 +                    0x0776                  PMD4 = 0x776 +                    0x0776                  _PMD4 = 0x776 +                    0x0776                  _PMD4bits = 0x776 +                    0x077a                  PMD6 = 0x77a +                    0x077a                  _PMD6 = 0x77a +                    0x077a                  _PMD6bits = 0x77a +                    0x077e                  PMD8 = 0x77e +                    0x077e                  _PMD8 = 0x77e +                    0x077e                  _PMD8bits = 0x77e +                    0x0220                  UART1 = 0x220 +                    0x0220                  _UART1 = 0x220 +                    0x0230                  UART2 = 0x230 +                    0x0230                  _UART2 = 0x230 +START GROUP +LOAD /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a +LOAD /opt/microchip/xc16/v2.10/bin/bin/../../lib/libm-elf.a +LOAD /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-elf.a +END GROUP +OUTPUT(dist/default/production/resbox.X.production.elf elf32-pic30) +LOAD /CW/_FGS¨lŸÔþ\ +LOAD /CW/_FBSx0 Ôþ\ +LOAD jump_table +LOAD default_isr +LOAD data_init + +.debug_pubtypes +                  0x0000f0        0x42c + .debug_pubtypes +                  0x0000f0         0x5b build/default/production/mcc_generated_files/interrupt_manager.o + .debug_pubtypes +                  0x00014b         0x2b build/default/production/mcc_generated_files/clock.o + .debug_pubtypes +                  0x000176         0x1f build/default/production/mcc_generated_files/pin_manager.o + .debug_pubtypes +                  0x000195        0x114 build/default/production/mcc_generated_files/mssp2_i2c.o + .debug_pubtypes +                  0x0002a9         0x42 build/default/production/mcc_generated_files/system.o + .debug_pubtypes +                  0x0002eb         0x4e build/default/production/mcc_generated_files/traps.o + .debug_pubtypes +                  0x000339         0x92 build/default/production/mcc_generated_files/mssp1_spi.o + .debug_pubtypes +                  0x0003cb         0x65 build/default/production/main.o + .debug_pubtypes +                  0x000430         0x2b build/default/production/SPI.o + .debug_pubtypes +                  0x00045b         0xc1 build/default/production/mcc_generated_files/tmr1.o + +__c30_signature +                  0x00051c         0x4e + __c30_signature +                  0x00051c          0x6 build/default/production/mcc_generated_files/interrupt_manager.o + __c30_signature +                  0x000522          0x6 build/default/production/mcc_generated_files/clock.o + __c30_signature +                  0x000528          0x6 build/default/production/mcc_generated_files/pin_manager.o + __c30_signature +                  0x00052e          0x6 build/default/production/mcc_generated_files/mssp2_i2c.o + __c30_signature +                  0x000534          0x6 build/default/production/mcc_generated_files/system.o + __c30_signature +                  0x00053a          0x6 build/default/production/mcc_generated_files/traps.o + __c30_signature +                  0x000540          0x6 build/default/production/mcc_generated_files/mcc.o + __c30_signature +                  0x000546          0x6 build/default/production/mcc_generated_files/mssp1_spi.o + __c30_signature +                  0x00054c          0x6 build/default/production/main.o + __c30_signature +                  0x000552          0x6 build/default/production/SPI.o + __c30_signature +                  0x000558          0x6 build/default/production/mcc_generated_files/tmr1.o + __c30_signature +                  0x00055e          0x6 /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(crt0_standard.o) + __c30_signature +                  0x000564          0x6 /opt/microchip/xc16/v2.10/bin/bin/../../lib/libc99-pic30-elf.a(data_init_standard.o) + +.nbss               0x0800         0x4a + .nbss              0x0800         0x20 build/default/production/mcc_generated_files/traps.o + .nbss              0x0820         0x16 build/default/production/SPI.o +                    0x0820                  _WriteBuffer +                    0x0826                  _ReadBuffer +                    0x082c                  _writeData +                    0x082e                  _readData +                    0x0830                  _addr0 +                    0x0831                  _addr1 +                    0x0832                  _write +                    0x0834                  _total + .nbss              0x0836         0x14 build/default/production/mcc_generated_files/mssp2_i2c.o +                    0x083e                  _yeah +                    0x083f                  _index +                    0x0840                  _temp +                    0x0841                  _i2cArray + +.ndata              0x084a          0xa + .ndata             0x084a          0xa build/default/production/mcc_generated_files/mssp2_i2c.o +                    0x084a                  _slaveAddress +                    0x084b                  _regAdd + +.nbss               0x0854          0x4 + .nbss              0x0854          0x4 build/default/production/mcc_generated_files/tmr1.o +                    0x0854                  _TMR1_InterruptHandler + +.ndata              0x0858          0x2 + .ndata             0x0858          0x2 build/default/production/mcc_generated_files/traps.o + +.nbss               0x085a          0x2 + .nbss              0x085a          0x2 build/default/production/main.o +                    0x085a                  _nullarray + +.ivt._MSSP2Interrupt +                  0x000076          0x2 + .ivt._MSSP2Interrupt +                  0x000076          0x2 build/default/production/mcc_generated_files/mssp2_i2c.o + +.config_ICS       0xf8000e          0x2 + .config_ICS      0xf8000e          0x2 build/default/production/mcc_generated_files/system.o + +.config_MCLRE     0xf8000c          0x2 + .config_MCLRE    0xf8000c          0x2 build/default/production/mcc_generated_files/system.o + +.config_WINDIS    0xf8000a          0x2 + .config_WINDIS +                  0xf8000a          0x2 build/default/production/mcc_generated_files/system.o + +.config_FCKSM     0xf80008          0x2 + .config_FCKSM    0xf80008          0x2 build/default/production/mcc_generated_files/system.o + +.config_IESO      0xf80006          0x2 + .config_IESO     0xf80006          0x2 build/default/production/mcc_generated_files/system.o + +.ivt._OscillatorFail +                  0x000006          0x2 + .ivt._OscillatorFail +                  0x000006          0x2 build/default/production/mcc_generated_files/traps.o + +.ivt._StackError +                  0x00000a          0x2 + .ivt._StackError +                  0x00000a          0x2 build/default/production/mcc_generated_files/traps.o + +.ivt._AddressError +                  0x000008          0x2 + .ivt._AddressError +                  0x000008          0x2 build/default/production/mcc_generated_files/traps.o + +.ivt._MathError +                  0x00000c          0x2 + .ivt._MathError +                  0x00000c          0x2 build/default/production/mcc_generated_files/traps.o + +.ivt._T1Interrupt +                  0x00001a          0x2 + .ivt._T1Interrupt +                  0x00001a          0x2 build/default/production/mcc_generated_files/tmr1.o + +.text             0x000464        0x6e2 + .text            0x000464        0x3e6 build/default/production/SPI.o +                  0x000464                  _Message_OUT +                  0x0004ee                  _Message_BIM +                  0x00052a                  _Message_MAPIN0 +                  0x000566                  _Message_MAPIN1 +                  0x0005a2                  _Message_INST +                  0x0005b4                  _Message_DAGIOL +                  0x0005f0                  _Message_DAGOSM +                  0x000602                  _Message_DAGOLON +                  0x000614                  _Message_DAGOLONEN +                  0x000650                  _Message_HWCR +                  0x000674                  _Message_HWCROCL +                  0x00069a                  _Message_HWCRPWM +                  0x0006d6                  _Message_PWMCR0 +                  0x000752                  _Message_PWMCR1 +                  0x0007ce                  _Message_PWMOUT +                  0x00080c                  _Message_PWMMAP + .text            0x00084a         0xf6 build/default/production/mcc_generated_files/mssp1_spi.o +                  0x00084a                  _MSSP1_SPI_Initialize +                  0x000862                  _MSSP1_SPI_Exchange8bit +                  0x00087c                  _MSSP1_SPI_Exchange8bitBuffer +                  0x0008f0                  _MSSP1_SPI_IsBufferFull +                  0x000904                  _MSSP1_SPI_HasWriteCollisionOccured +                  0x00091a                  _MSSP1_SPI_HasReceiveOverflowOccured +                  0x000930                  _SPI_slaveSelect +                  0x000938                  _SPI_slaveDeselect + .text            0x000940         0xda build/default/production/mcc_generated_files/mssp2_i2c.o +                  0x000940                  _MSSP2_I2C_Initialize +                  0x00096c                  _MSSP2_I2C_ReadPointerSet +                  0x000978                  _MSSP2_I2C_WritePointerSet +                  0x000984                  _MSSP2_I2C_ReadPointerGet +                  0x00098c                  _MSSP2_I2C_WritePointerGet +                  0x000994                  _MSSP2_I2C_SlaveAddressMaskSet +                  0x0009a0                  _MSSP2_I2C_SlaveAddressSet +                  0x0009d6                  _MSSP2_I2C_StatusCallback + .text            0x000a1a         0xa4 build/default/production/mcc_generated_files/tmr1.o +                  0x000a1a                  _TMR1_Initialize +                  0x000a3a                  _TMR1_Period16BitSet +                  0x000a48                  _TMR1_Period16BitGet +                  0x000a50                  _TMR1_Counter16BitSet +                  0x000a5e                  _TMR1_Counter16BitGet +                  0x000a66                  _TMR1_CallBack +                  0x000a70                  _TMR1_SetInterruptHandler +                  0x000a80                  _TMR1_Start +                  0x000a8c                  _TMR1_Stop +                  0x000a96                  _TMR1_GetElapsedThenClear +                  0x000aac                  _TMR1_SoftwareCounterGet +                  0x000ab6                  _TMR1_SoftwareCounterClear + .text            0x000abe         0x52 build/default/production/main.o +                  0x000abe                  _main + .text            0x000b10         0x36 build/default/production/mcc_generated_files/clock.o +                  0x000b10                  _CLOCK_Initialize + +.dinit            0x000b46         0x36 + .dinit           0x000b46         0x36 data_init + +.text             0x000b7c         0x6a + .text            0x000b7c         0x26 build/default/production/mcc_generated_files/pin_manager.o +                  0x000b7c                  _PIN_MANAGER_Initialize + .text            0x000ba2         0x1a build/default/production/mcc_generated_files/interrupt_manager.o +                  0x000ba2                  _INTERRUPT_Initialize + .text            0x000bbc         0x18 build/default/production/mcc_generated_files/traps.o +                  0x000bbc                  _TRAPS_halt_on_error + .text            0x000bd4         0x12 build/default/production/mcc_generated_files/system.o +                  0x000bd4                  _SYSTEM_Initialize diff --git a/mcc_generated_files/clock.c b/mcc_generated_files/clock.c new file mode 100644 index 0000000..2d07d28 --- /dev/null +++ b/mcc_generated_files/clock.c @@ -0,0 +1,72 @@ +/**
 +  @Generated PIC24 / dsPIC33 / PIC32MM MCUs Source File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    clock.c
 +
 +  @Summary:
 +    This is the clock.c file generated using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This header file provides implementations for driver APIs for all modules selected in the GUI.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#include <stdint.h>
 +#include "xc.h"
 +#include "clock.h"
 +
 +void CLOCK_Initialize(void)
 +{
 +    // RCDIV FRC/2; DOZE 1:8; DOZEN disabled; ROI disabled; 
 +    CLKDIV = 0x3100;
 +    // TUN Center frequency; 
 +    OSCTUN = 0x00;
 +    // ROEN disabled; ROSEL FOSC; RODIV 0; ROSSLP disabled; 
 +    REFOCON = 0x00;
 +    // ADC1MD enabled; SSP1MD enabled; T1MD enabled; U2MD enabled; U1MD enabled; 
 +    PMD1 = 0x00;
 +    // CCP2MD enabled; CCP1MD enabled; CCP4MD enabled; CCP3MD enabled; CCP5MD enabled; 
 +    PMD2 = 0x00;
 +    // SSP2MD enabled; RTCCMD enabled; CMPMD enabled; DAC1MD enabled; 
 +    PMD3 = 0x00;
 +    // CTMUMD enabled; REFOMD enabled; ULPWUMD enabled; HLVDMD enabled; 
 +    PMD4 = 0x00;
 +    // AMP2MD enabled; AMP1MD enabled; DAC2MD enabled; 
 +    PMD6 = 0x00;
 +    // CLC1MD enabled; CLC2MD enabled; 
 +    PMD8 = 0x00;
 +    // CF no clock failure; NOSC PRI; SOSCEN disabled; SOSCDRV disabled; CLKLOCK unlocked; OSWEN Switch is Complete; 
 +    __builtin_write_OSCCONH((uint8_t) (0x02));
 +    __builtin_write_OSCCONL((uint8_t) (0x00));
 +}
 diff --git a/mcc_generated_files/clock.h b/mcc_generated_files/clock.h new file mode 100644 index 0000000..6b6c2d7 --- /dev/null +++ b/mcc_generated_files/clock.h @@ -0,0 +1,80 @@ +/**
 +  @Generated PIC24 / dsPIC33 / PIC32MM MCUs Source File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    clock.h
 +
 +  @Summary:
 +    This is the clock.h file generated using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This header file provides implementations for driver APIs for all modules selected in the GUI.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef CLOCK_H
 +#define	CLOCK_H
 +
 +/**
 +  Section: Included Files
 +*/
 +
 +#include <stdbool.h>
 +
 +#ifndef _XTAL_FREQ
 +#define _XTAL_FREQ  20000000UL
 +#endif
 +
 +#define CLOCK_SystemFrequencyGet()        (20000000UL)
 +
 +#define CLOCK_PeripheralFrequencyGet()    (CLOCK_SystemFrequencyGet() / 2)
 +
 +#define CLOCK_InstructionFrequencyGet()   (CLOCK_SystemFrequencyGet() / 2)
 +/**
 + * @Param
 +    none
 + * @Returns
 +    none
 + * @Description
 +    Initializes the oscillator to the default states configured in the
 + *                  MCC GUI
 + * @Example
 +    CLOCK_Initialize(void);
 + */
 +void CLOCK_Initialize(void);
 +
 +
 +#endif	/* CLOCK_H */
 +/**
 + End of File
 +*/
\ No newline at end of file diff --git a/mcc_generated_files/interrupt_manager.c b/mcc_generated_files/interrupt_manager.c new file mode 100644 index 0000000..cc601c1 --- /dev/null +++ b/mcc_generated_files/interrupt_manager.c @@ -0,0 +1,62 @@ +/**
 +  System Interrupts Generated Driver File 
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    interrupt_manager.h
 +
 +  @Summary:
 +    This is the generated driver implementation file for setting up the
 +    interrupts using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This source file provides implementations for PIC24 / dsPIC33 / PIC32MM MCUs interrupts.
 +    Generation Information : 
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +/**
 +    Section: Includes
 +*/
 +#include <xc.h>
 +
 +/**
 +    void INTERRUPT_Initialize (void)
 +*/
 +void INTERRUPT_Initialize (void)
 +{
 +    //    SSPI: MSSP2 - I2C/SPI Interrupt
 +    //    Priority: 1
 +        IPC12bits.SSP2IP = 1;
 +    //    TI: T1 - Timer1
 +    //    Priority: 1
 +        IPC0bits.T1IP = 1;
 +
 +}
 diff --git a/mcc_generated_files/interrupt_manager.h b/mcc_generated_files/interrupt_manager.h new file mode 100644 index 0000000..e88d4cc --- /dev/null +++ b/mcc_generated_files/interrupt_manager.h @@ -0,0 +1,167 @@ +/**
 +  System Interrupts Generated Driver File 
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    interrupt_manager.h
 +
 +  @Summary:
 +    This is the generated driver implementation file for setting up the
 +    interrupts using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This source file provides implementations for PIC24 / dsPIC33 / PIC32MM MCUs interrupts.
 +    Generation Information : 
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _INTERRUPT_MANAGER_H
 +#define _INTERRUPT_MANAGER_H
 +
 +/**
 +  @Summary
 +    Initializes the interrupt priorities of the PIC24FV16KM202
 +
 +  @Description
 +    This routine sets the interrupt priorities of the modules that have been configured
 +    for the PIC24FV16KM202
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    void SYSTEM_Initialize(void)
 +    {
 +        // Other initializers are called from this function
 +        INTERRUPT_Initialize ();
 +    }
 +    </code>
 +
 +*/
 +void INTERRUPT_Initialize(void);
 +
 +/**
 +  @Summary
 +    Enables global interrupts of the PIC24FV16KM202
 +
 +  @Description
 +    This routine enables the global interrupt bit for the PIC24FV16KM202
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    void SYSTEM_Initialize(void)
 +    {
 +        // Other initializers are called from this function
 +        INTERRUPT_GlobalEnable ();
 +    }
 +    </code>
 +
 +*/
 +inline static void INTERRUPT_GlobalEnable(void)
 +{
 +    __builtin_enable_interrupts();
 +}
 +
 +/**
 +  @Summary
 +    Disables global interrupts of the PIC24FV16KM202
 +
 +  @Description
 +    This routine disables the global interrupt bit for the PIC24FV16KM202
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    void SYSTEM_Initialize(void)
 +    {
 +        // Other initializers are called from this function
 +        INTERRUPT_GlobalDisable ();
 +    }
 +    </code>
 +
 +*/
 +inline static void INTERRUPT_GlobalDisable(void)
 +{
 +    __builtin_disable_interrupts();
 +}
 +
 +/**
 +  @Summary
 +    Returns the interrupt vector number of the interrupt which is pending.
 +
 +  @Description
 +    This routine returns the interrupt vector number of the interrupt which is pending.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +        uint16_t ivrNum;
 +        ivrNum = INTERRUPT_VectorNumberGet();
 +    </code>
 +
 +*/
 +inline static uint16_t INTERRUPT_VectorNumberGet(void)
 +{
 +    return _VECNUM; 
 +}
 +
 +#endif
\ No newline at end of file diff --git a/mcc_generated_files/mcc.c b/mcc_generated_files/mcc.c new file mode 100644 index 0000000..f842343 --- /dev/null +++ b/mcc_generated_files/mcc.c @@ -0,0 +1,47 @@ +/**
 +  @Generated PIC24 / dsPIC33 / PIC32MM MCUs Source File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    mcc.c
 +
 +  @Summary:
 +    This is the mcc.c file generated using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    The configuration contents of this file are moved to system.c and this file will be removed in future MCC releases. 
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +/**
 + End of File
 +*/
\ No newline at end of file diff --git a/mcc_generated_files/mcc.h b/mcc_generated_files/mcc.h new file mode 100644 index 0000000..090afe8 --- /dev/null +++ b/mcc_generated_files/mcc.h @@ -0,0 +1,65 @@ +/**
 +  @Generated PIC24 / dsPIC33 / PIC32MM MCUs Header File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    mcc.h
 +
 +  @Summary:
 +    This is the mcc.h file generated using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This file will be removed in future MCC releases. Use system.h instead.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef MCC_H
 +#define	MCC_H
 +#include <xc.h>
 +#include "system.h"
 +#include "clock.h"
 +#include "pin_manager.h"
 +#include <stdint.h>
 +#include <stdbool.h>
 +
 +#include "tmr1.h"
 +#include "interrupt_manager.h"
 +#include "traps.h"
 +#include "mssp1_spi.h"
 +#include "mssp2_i2c.h"
 +
 +#warning "This file will be removed in future MCC releases. Use system.h instead."
 +
 +#endif	/* MCC_H */
 +/**
 + End of File
 +*/
\ No newline at end of file diff --git a/mcc_generated_files/mssp1_spi.c b/mcc_generated_files/mssp1_spi.c new file mode 100644 index 0000000..d776f9e --- /dev/null +++ b/mcc_generated_files/mssp1_spi.c @@ -0,0 +1,148 @@ +/**
 +  MSSP1_SPI Generated Driver API Header File
 +
 +  @Company
 +    Microchip Technology Inc.
 +
 +  @File Name
 +    mssp1_spi.c
 +
 +  @Summary
 +    This is the generated source file for the MSSP1_SPI driver using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description
 +    This source file provides APIs for driver for MSSP1_SPI.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +/**
 +  Section: Included Files
 +*/
 +
 +#include "mssp1_spi.h"
 +
 +/**
 +  Section: Driver Interface
 +*/
 +
 +
 +void MSSP1_SPI_Initialize (void)
 +{
 +    // SMP End; CKE Idle to Active; 
 +    SSP1STAT = 0x80;
 +    // SSPEN enabled; WCOL no_collision; CKP Idle:Low, Active:High; SSPM FOSC/(2 * (BRG_Value_SPI + 1)); SSPOV no_overflow; 
 +    SSP1CON1 = 0x2A;
 +    // ACKEN disabled; GCEN disabled; PEN disabled; ACKDT acknowledge; RSEN disabled; RCEN disabled; SEN disabled; 
 +    SSP1CON2 = 0x00;
 +    // SBCDE disabled; BOEN disabled; SCIE disabled; PCIE disabled; DHEN disabled; SDAHT 100ns; AHEN disabled; 
 +    SSP1CON3 = 0x00;
 +    // AMSK 0; 
 +    SSP1MSK = 0x00;
 +    // SSPADD 1; 
 +    SSP1ADD = 0x01;
 +}
 +
 +uint8_t MSSP1_SPI_Exchange8bit( uint8_t data )
 +{
 +
 +    SSP1BUF = data;
 +
 +    while (SSP1STATbits.BF == false)
 +    {
 +
 +    }
 +
 +    return SSP1BUF;
 +}
 +
 +uint8_t MSSP1_SPI_Exchange8bitBuffer(uint8_t *dataTransmitted, uint8_t bufLen, uint8_t *dataReceived)
 +{
 +    uint16_t bytesWritten = 0;
 +
 +    if(dataTransmitted != NULL)
 +    {
 +        if(dataReceived != NULL)
 +        {
 +            while(bytesWritten < bufLen )
 +            {
 +                dataReceived[bytesWritten] = MSSP1_SPI_Exchange8bit(dataTransmitted[bytesWritten]);
 +                bytesWritten++;
 +            }
 +        }else
 +        {
 +            while(bytesWritten < bufLen )
 +            {
 +                MSSP1_SPI_Exchange8bit(dataTransmitted[bytesWritten]);
 +                bytesWritten++;
 +            }
 +        }
 +    }
 +    else
 +    {
 +        if(dataReceived != NULL)
 +        {
 +            while(bytesWritten < bufLen )
 +            {
 +                dataReceived[bytesWritten] = MSSP1_SPI_Exchange8bit(MSSP1_SPI_DUMMY_DATA);
 +                bytesWritten++;
 +            }
 +        }
 +    }
 +    return bytesWritten;
 +}
 +
 +bool MSSP1_SPI_IsBufferFull( void )
 +{ 
 +    return (!SSP1STATbits.BF);
 +}
 +
 +bool MSSP1_SPI_HasWriteCollisionOccured( void )
 +{ 
 +    return (!SSP1CON1bits.WCOL);
 +}
 +
 +bool MSSP1_SPI_HasReceiveOverflowOccured( void )
 +{ 
 +    return (!SSP1CON1bits.SSPOV);
 +}
 +void SPI_slaveSelect(void)
 +{
 +    _LATB15 = 0;
 +}
 +
 +
 +void SPI_slaveDeselect(void)
 +{
 +    _LATB15 = 1;
 +}
 +
 +/**
 + End of File
 +*/
 diff --git a/mcc_generated_files/mssp1_spi.h b/mcc_generated_files/mssp1_spi.h new file mode 100644 index 0000000..83b648d --- /dev/null +++ b/mcc_generated_files/mssp1_spi.h @@ -0,0 +1,254 @@ +/**
 +  MSSP1_SPI Generated Driver API Header File
 +
 +  @Company
 +    Microchip Technology Inc.
 +
 +  @File Name
 +    mssp1_spi.h
 +
 +  @Summary
 +    This is the generated header file for the MSSP1_SPI driver using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description
 +    This header file provides APIs for driver for MSSP1_SPI.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _MSSP1_SPI_H
 +#define _MSSP1_SPI_H
 +
 +/**
 +  Section: Included Files
 +*/
 +#include <xc.h>
 +#include <stdint.h>
 +#include <stdbool.h>
 +#include <stddef.h>
 +
 +#ifdef __cplusplus  // Provide C++ Compatibility
 +
 +    extern "C" {
 +
 +#endif
 +
 +/**
 + Section: Data Type Definitions
 +*/
 +//This definition is used during read operation of SPI
 +#define MSSP1_SPI_DUMMY_DATA 0x0
 +        
 +/**
 +  Section: Interface Routines
 +*/
 +
 +/**
 +  @Summary
 +    Initializes the MSSP instance : 1
 +
 +  @Description
 +    This routine initializes the mssp1_spi driver instance for : 1
 +    index, making it ready for clients to open and use it.
 +    This routine must be called before any other MSSP1_SPI routine is called.
 +    This routine should only be called once during system initialization.
 +
 +  @Preconditions
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t   myWriteBuffer[MY_BUFFER_SIZE];
 +    uint16_t   myReadBuffer[MY_BUFFER_SIZE];
 +    uint16_t writeData;
 +    uint16_t readData;
 +    unsigned int    total;
 +    MSSP1_SPI_Initialize;
 + 
 +    total = 0;
 +    do
 +    {
 +        total  = MSSP1_SPI_Exchange8bitBuffer( &myWriteBuffer[total], MY_BUFFER_SIZE - total, &myWriteBuffer[total]);
 +
 +        // Do something else...
 +
 +    } while( total < MY_BUFFER_SIZE );
 +
 +    readData = MSSP1_SPI_Exchange8bit( writeData);
 +
 +    </code>
 +
 +*/
 +void MSSP1_SPI_Initialize (void);
 +
 +/**
 +  @Summary
 +    Exchanges one byte of data from MSSP1_SPI
 +
 +  @Description
 +    This routine exchanges one byte of data from the MSSP1_SPI.
 +    This is a blocking routine.
 +
 +  @Preconditions
 +    The MSSP1_SPI_Initialize routine must have been called for the specified
 +    MSSP1_SPI driver instance.
 +
 +  @Param
 +    data         - Data to be written onto MSSP1_SPI.
 +
 +  @Returns
 +    Data read from MSSP1_SPI
 +
 +  @Example 
 +    Refer to MSSP1_SPI_Initialize() for an example	
 + 
 +*/
 +uint8_t MSSP1_SPI_Exchange8bit( uint8_t data );
 +
 +/**
 +  @Summary
 +    Exchanges data from a buffer of size one byte from MSSP1_SPI
 +
 +  @Description
 +    This routine exchanges data from a buffer of size one byte from the MSSP1_SPI.
 +    This is a blocking routine.
 +
 +  @Preconditions
 +    The MSSP1_SPI_Initialize routine must have been called for the specified
 +    MSSP1_SPI driver instance.
 +
 +  @Param
 +    dataTransmitted         - Buffer of data to be written from MSSP1_SPI.
 +    bufLen         - Number of words to be exchanged.
 +    dataReceived         - Buffer of data to be read into MSSP1_SPI.
 +
 +  @Returns
 +    Number of words written/read.
 +
 +  @Example 
 +    Refer to MSSP1_SPI_Initialize() for an example	
 + 
 +*/
 +uint8_t MSSP1_SPI_Exchange8bitBuffer(uint8_t *dataTransmitted, uint8_t bufLen, uint8_t *dataReceived);
 +
 +/**
 +  @Summary
 +    Gets the status of the buffer if its full.
 +
 +  @Description
 +    This routine gets the status of the buffer if its full.
 +
 +  @Preconditions
 +    The MSSP1_SPI_Initialize routine must have been called for the specified
 +    MSSP1_SPI driver instance.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    true - if the buffer is full
 +    false - if the buffer is not full.
 +
 +  @Example 
 +    Refer to MSSP1_SPI_Initialize() for an example	
 + 
 +*/
 +bool MSSP1_SPI_IsBufferFull( void );
 +
 +/**
 +  @Summary
 +    Gets the status of write collision.
 +
 +  @Description
 +    This routine gets the status of write collision.
 +
 +  @Preconditions
 +    The MSSP1_SPI_Initialize routine must have been called for the specified
 +    MSSP1_SPI driver instance.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    true - if the write collision has occurred.
 +    false - if the write collision has not occurred.
 +
 +  @Example 
 +    Refer to MSSP1_SPI_Initialize() for an example	
 + 
 +*/
 +bool MSSP1_SPI_HasWriteCollisionOccured( void );
 +
 +/**
 +  @Summary
 +    Gets the status of receive overflow.
 +
 +  @Description
 +    This routine gets the status of receive overflow.
 +
 +  @Preconditions
 +    The MSSP1_SPI_Initialize routine must have been called for the specified
 +    MSSP1_SPI driver instance.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    true - if receive overflow has occurred.
 +    false - if receive overflow has not occurred.
 +
 +  @Example 
 +    Refer to MSSP1_SPI_Initialize() for an example	
 + 
 +*/
 +bool MSSP1_SPI_HasReceiveOverflowOccured( void );
 +
 +void SPI_slaveSelect(void);
 +
 +
 +void SPI_slaveDeselect(void);
 +
 +
 +#ifdef __cplusplus  // Provide C++ Compatibility
 +
 +    }
 +
 +#endif
 +
 +#endif //_MSSP1_SPI_H
 +    
 +/**
 + End of File
 +*/
 diff --git a/mcc_generated_files/mssp2_i2c.c b/mcc_generated_files/mssp2_i2c.c new file mode 100644 index 0000000..67646e1 --- /dev/null +++ b/mcc_generated_files/mssp2_i2c.c @@ -0,0 +1,386 @@ +/**
 +  MSSP2_I2C Generated Driver File
 +
 +  @Company
 +    Microchip Technology Inc.
 +
 +  @File Name
 +    mssp2_i2c.c
 +
 +  @Summary
 +    This is the generated source file for the MSSP2_I2C driver using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description
 +    This source file provides APIs for driver for MSSP2_I2C.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202        
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#include "mssp2_i2c.h"
 +
 +/**
 + Section: Data Types
 +*/
 +
 +/**
 +  I2C Slave Driver State Enumeration
 +
 +  @Summary
 +    Defines the different states of the i2c slave.
 +
 +  @Description
 +    This defines the different states that the i2c slave
 +    used to process transactions on the i2c bus.
 +*/
 +typedef enum
 +{
 +    S_SLAVE_IDLE,
 +    S_SLAVE_RECEIVE_MODE,
 +    S_SLAVE_TRANSMIT_MODE,
 +    S_SLAVE_LOW_BYTE_ADDRESS_DETECT,
 +
 +} I2C_SLAVE_STATES;
 +
 +/**
 +  I2C uint16_t union 
 +
 +  @Summary
 +    Defines the data type to easily manage the slave addresses.
 + 
 +  @Description
 +    This defines the data type to easily swap between lsb and msb
 +    of the slave address when doing 10-bit addressing.
 + */
 +typedef union
 +{
 +    uint8_t  uint168BitValue[2];
 +    uint16_t uint16Value;
 +}UINT16_UNION;
 +
 +/**
 + Section: Macro Definitions
 +*/
 +
 +/* defined for MSSP2_I2C */
 +
 +#define MSSP2_I2C_TRANSMIT_REG                       SSP2BUF                 // Defines the transmit register used to send data.
 +#define MSSP2_I2C_RECEIVE_REG                        SSP2BUF                 // Defines the receive register used to receive data.
 +
 +#define MSSP2_I2C_MASK_REG                           SSP2MSK                 // Defines the address mask register.
 +#define MSSP2_I2C_ADDRESS_REG                        SSP2ADD                 // Defines the address register. 
 +
 +// The following control bits are used in the I2C state machine to manage
 +// the I2C module and determine next states.
 +#define MSSP2_I2C_SERIAL_PORT_ENABLE_BIT             SSP2CON1bits.SSPEN      // I2C port enable control bit.
 +#define MSSP2_I2C_MODE_SELECT_BITS                   SSP2CON1bits.SSPM       // I2C Slave Mode control bit.
 +#define MSSP2_I2C_RELEASE_SCL_CLOCK_CONTROL_BIT      SSP2CON1bits.CKP        // I2C clock stretch/release control bit.
 +#define MSSP2_I2C_RECEIVE_OVERFLOW_STATUS_BIT        SSP2CON1bits.SSPOV      // I2C receive buffer overflow status bit.
 +#define MSSP2_I2C_ACKNOWLEDGE_STATUS_BIT             SSP2CON2bits.ACKSTAT    // I2C ACK status bit.
 +
 +// The following status bits are used in the I2C state machine to determine
 +// the next states.
 +#define MSSP2_I2C_READ_NOT_WRITE_STATUS_BIT          SSP2STATbits.R_NOT_W    // I2C current transaction read/write status bit.
 +#define MSSP2_I2C_DATA_NOT_ADDRESS_STATUS_BIT        SSP2STATbits.D_NOT_A    // I2C last byte receive was data/address status bit.
 +
 +/**
 + Section: Local Functions
 +*/
 +
 +inline void __attribute__ ((always_inline)) MSSP2_I2C_TransmitProcess(void);
 +inline void __attribute__ ((always_inline)) MSSP2_I2C_ReceiveProcess(void);
 +
 +/**
 + Section: Local Variables
 +*/
 +
 +static I2C_SLAVE_STATES   mssp2_i2c_slave_state;
 +static uint8_t                *p_mssp2_i2c_write_pointer;
 +static uint8_t                *p_mssp2_i2c_read_pointer;
 +static UINT16_UNION           mssp2_i2c_slave_address;
 +uint8_t yeah;
 +
 +#define ARRAY_CNT 6 // Number of bytes in array
 +uint8_t slaveAddress = 0x30; // 7-bit slave address
 +uint8_t index = 0; // Array pointer
 +uint8_t temp = 0; // Temp register
 +uint8_t regAdd = 1; // First data byte was reg add
 +uint8_t i2cArray[ARRAY_CNT] =
 +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 +
 +
 +/**
 +  Prototype:        void MSSP2_I2C_Initialize(void)
 +  Input:            none
 +  Output:           none
 +  Description:      MSSP2_I2C_Initialize is an
 +                    initialization routine that takes inputs from the GUI.
 +  Usage:            MSSP2_I2C_Initialize();
 +*/
 +void MSSP2_I2C_Initialize(void)
 +{
 +
 +    // initialize the state
 +    mssp2_i2c_slave_state = S_SLAVE_IDLE;
 +
 +    MSSP2_I2C_ReadPointerSet(NULL);
 +    MSSP2_I2C_WritePointerSet(NULL);
 +
 +    // initialize the hardware
 +    // SMP Standard Speed; CKE Idle to Active; 
 +    SSP2STAT = 0x80;
 +    // SSPEN enabled; WCOL no_collision; CKP Clock Stretch; SSPM 7 Bit; SSPOV no_overflow; 
 +    SSP2CON1 = 0x2E & 0x26;
 +    // ACKEN disabled; GCEN disabled; PEN disabled; ACKDT acknowledge; RSEN disabled; RCEN disabled; SEN enabled; 
 +    SSP2CON2 = 0x01;
 +    // SBCDE disabled; BOEN enabled; SCIE disabled; PCIE disabled; DHEN disabled; SDAHT 300ns; AHEN disabled; 
 +    SSP2CON3 = 0x18 | 0x01;
 +    // AMSK 0; 
 +    SSP2MSK = 0x00;
 +    // Set up the slave address: SSPADD 7; 
 +    //MSSP2_I2C_SlaveAddressSet(0x07);    
 +    
 +    SSP2ADD = 0x30;
 +    IFS3bits.BCL2IF = 0; // Clear Bus Collision IF
 +    
 +
 +    /* MSSP2 - I2C/SPI Interrupt */
 +    // clear the master interrupt flag
 +    IFS3bits.SSP2IF = 0;
 +    // enable the master interrupt
 +    IEC3bits.SSP2IE = 1;
 +}
 +
 +void __attribute__((interrupt, no_auto_psv)) _MSSP2Interrupt(void) {
 +    if (IFS3bits.SSP2IF) // Check for SSPIF
 +    {
 +        if (SSP2STATbits.R_NOT_W == 1) // Master read (slave transmit)
 +        {
 +            temp = SSP2BUF;
 +            SSP2BUF = i2cArray[1]; // Load array value
 +            SSP2CON1bits.CKP = 1; // Release clock stretch
 +        }
 +        if (SSP2STATbits.R_NOT_W == 0) // Master write (slave receive)
 +        {
 +            TMR1 = 0x00; //Reset our timer when a message is received.
 +            if (SSP2STATbits.D_NOT_A == 0) // Last byte was an address
 +            {                
 +                _LATB7 = !_LATB7;
 +                regAdd = 1; // Next byte register address
 +                temp = SSP2BUF; // Clear BF
 +                SSP2CON1bits.CKP = 1; // Release clock stretch
 +            }
 +            if (SSP2STATbits.D_NOT_A == 1) // Last byte was data
 +            {
 +                if (regAdd == 1) // Last byte was register add
 +                {
 +                    index = SSP2BUF; // Load register address
 +                    regAdd = 0; // Next byte will be true data
 +                } else {
 +                    if (index < ARRAY_CNT) // Within boundaries?
 +                    {
 +                        i2cArray[index] = SSP2BUF; // Yes, read SSP1BUF
 +                    } else {
 +                        temp = SSP2BUF; // No, discard data
 +                    }
 +                }
 +                SSP2CON1bits.CKP = 1; // Release clock stretch
 +            }
 +        }
 +    }
 +    if ((IFS3bits.BCL2IF == 1) || (SSP2CON1bits.SSPOV == 1)) {
 +        temp = SSP2BUF; // Clear BF
 +        IFS3bits.BCL2IF = 0; // Clear BCLIF
 +        SSP2CON1bits.SSPOV = 0;
 +        SSP2CON1bits.CKP = 1; // Release clock stretching
 +    }
 +    IFS3bits.SSP2IF = 0; // Clear SSP1IF
 +    _LATB8 = !SSP2CON1bits.SSPOV;
 +}
 +
 +void MSSP2_I2C_ReadPointerSet(uint8_t *p)
 +{
 +    p_mssp2_i2c_read_pointer = p;
 +}
 +
 +
 +void MSSP2_I2C_WritePointerSet(uint8_t *p)
 +{
 +    p_mssp2_i2c_write_pointer = p;
 +}
 +
 +
 +uint8_t *MSSP2_I2C_ReadPointerGet(void)
 +{
 +    return (p_mssp2_i2c_read_pointer);
 +}
 +
 +
 +uint8_t *MSSP2_I2C_WritePointerGet(void)
 +{
 +    return (p_mssp2_i2c_write_pointer);
 +}
 +
 +void MSSP2_I2C_SlaveAddressMaskSet(
 +                                uint16_t mask)
 +{
 +    MSSP2_I2C_MASK_REG = mask;
 +}
 +
 +void MSSP2_I2C_SlaveAddressSet(
 +                                uint16_t address)
 +{
 +    UINT16_UNION add;
 +
 +    add.uint16Value = address;
 +
 +    if (address > 0xFF)
 +    {
 +        // use 10 bit address
 +        add.uint168BitValue[1] = (0xF0 | ((add.uint168BitValue[1] << 1) & 0x06));
 +        MSSP2_I2C_ADDRESS_REG = add.uint168BitValue[1];
 +    }
 +    else
 +    {
 +        // use 7 bit address
 +        MSSP2_I2C_ADDRESS_REG = add.uint168BitValue[0];
 +    }
 +    mssp2_i2c_slave_address.uint16Value = add.uint16Value;
 +
 +}
 +
 +inline void __attribute__ ((always_inline)) MSSP2_I2C_TransmitProcess(void)
 +{
 +    // get the data to be transmitted
 +
 +    // sanity check (to avoid stress)
 +    if (p_mssp2_i2c_read_pointer == NULL)
 +        return;
 +
 +    //MSSP2_I2C_TRANSMIT_REG = *p_mssp2_i2c_read_pointer;
 +    MSSP2_I2C_TRANSMIT_REG = yeah;
 +
 +    // set the SCL clock to be released
 +    MSSP2_I2C_RELEASE_SCL_CLOCK_CONTROL_BIT = 1;
 +
 +}
 +
 +inline void __attribute__ ((always_inline)) MSSP2_I2C_ReceiveProcess(void)
 +{   
 +    // store the received data 
 +    
 +    // sanity check (to avoid stress)
 +    if (p_mssp2_i2c_write_pointer == NULL)
 +        return;
 +
 +    *p_mssp2_i2c_write_pointer = MSSP2_I2C_RECEIVE_REG;
 +
 +}
 +
 +/* Note: This is an example of the MSSP2_I2C_StatusCallback()
 +         implementation. This is an emulated EEPROM Memory
 +         configured to act as a I2C Slave Device.
 +         For specific slave device implementation, remove
 +         or modify this function to the specific slave device
 +         behavior.
 +*/
 +
 +static uint8_t mssp2_i2c_slaveWriteData = 0xAA;
 +
 +bool MSSP2_I2C_StatusCallback(MSSP2_I2C_SLAVE_DRIVER_STATUS status)
 +{
 +
 +    // this emulates the slave device memory where data written to slave
 +    // is placed and data read from slave is taken
 +    static uint8_t EMULATE_EEPROM_Memory[5] =
 +            {
 +                0x30, 0x31, 0x32, 0x33, 0x34
 +            };
 +
 +    static uint16_t address = 0;
 +    static bool     addressState = true;
 +
 +    switch (status)
 +    {
 +        case MSSP2_I2C_SLAVE_TRANSMIT_REQUEST_DETECTED:
 +
 +            // set up the slave driver buffer transmit pointer
 +            //MSSP2_I2C_ReadPointerSet(&EMULATE_EEPROM_Memory[address]);
 +            //address++;
 +            //if(address > 5) address = 0;
 +            SSP2BUF = yeah;
 +            
 +            break;
 +
 +        case MSSP2_I2C_SLAVE_RECEIVE_REQUEST_DETECTED:
 +
 +            addressState = true;
 +
 +            // set up the slave driver buffer receive pointer
 +            MSSP2_I2C_WritePointerSet(&mssp2_i2c_slaveWriteData);
 +
 +            break;
 +
 +        case MSSP2_I2C_SLAVE_RECEIVED_DATA_DETECTED:
 +
 +           /* if (addressState == true)
 +            {
 +
 +                    address = mssp2_i2c_slaveWriteData;
 +                    addressState = false;
 +                    if(address > 31) _LATB6=0;
 +                else _LATB6=1;
 +            }
 +            else // if (addressState == false)
 +            {
 +                // set the memory with the received data
 +                EMULATE_EEPROM_Memory[address] = mssp2_i2c_slaveWriteData;
 +                
 +            }*/
 +            yeah = SSP2BUF;
 +            if(yeah > 100) _LATB6=0;
 +                else _LATB6=1;
 +
 +            break;
 +
 +        case MSSP2_I2C_SLAVE_10BIT_RECEIVE_REQUEST_DETECTED:
 +
 +            // do something here when 10-bit address is detected
 +
 +            // 10-bit address is detected
 +
 +            break;
 +
 +        default:
 +            break;
 +
 +    }
 +
 +    return true;
 +}
 +
 diff --git a/mcc_generated_files/mssp2_i2c.h b/mcc_generated_files/mssp2_i2c.h new file mode 100644 index 0000000..3fbd36c --- /dev/null +++ b/mcc_generated_files/mssp2_i2c.h @@ -0,0 +1,488 @@ +/**
 +  MSSP2_I2C Generated Driver API Header File
 +
 +  @Company
 +    Microchip Technology Inc.
 +
 +  @File Name
 +    mssp2_i2c.h
 +
 +  @Summary
 +    This is the generated header file for the MSSP2_I2C driver using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description
 +    This header file provides APIs for driver for MSSP2_I2C.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202   
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _MSSP2_I2C_H
 +#define _MSSP2_I2C_H
 +
 +#include <stdint.h>
 +#include <stdbool.h>
 +#include <stddef.h>
 +#include <xc.h>
 +
 +#ifdef __cplusplus  //* Provide C++ Compatibility */
 +
 +    extern "C" {
 +
 +#endif
 +
 +/**
 +  I2C Slave Driver Status
 +
 +  @Summary
 +    Defines the different status that the slave driver has
 +    detected over the i2c bus.
 +
 +  @Description
 +    This defines the different status that the slave driver has
 +    detected over the i2c bus. The status is passed to the
 +    MSSP2_I2C_StatusCallback() callback function that is implemented by
 +    the user of the slave driver as a parameter to inform the user
 +    that there was a change in the status of the driver due to
 +    transactions on the i2c bus. User of the slave driver can use these
 +    to manage the read or write buffers.
 +
 + */
 +
 +typedef enum
 +{
 +    /* This state indicates that the slave driver has detected a transmit request from the master.
 +       The next transaction will be a read transaction. Application should prime the transmit
 +       buffer with the valid data to be sent to the master using the: I2C2_ReadPointerSet()
 +       
 +     */
 +    MSSP2_I2C_SLAVE_TRANSMIT_REQUEST_DETECTED,
 +            
 +    /* This state indicates that the slave driver has detected a reception request from the master.
 +       The next transaction will be a write transaction. Application should set up the receive 
 +       buffer by setting the location of the receive buffer using the: I2C2_WritePointerSet()
 +     */
 +    MSSP2_I2C_SLAVE_RECEIVE_REQUEST_DETECTED,
 +
 +    /* This state indicates that the slave driver has received data from the master.
 +       Application can use this status to process the received data set up the receive
 +       buffer in anticipation of next reception in case the master sends more data. 
 +       See MSSP2_I2C_SLAVE_RECEIVE_REQUEST_DETECTED.
 +     */
 +    MSSP2_I2C_SLAVE_RECEIVED_DATA_DETECTED,
 +            
 +    /* This state indicates that the slave driver has detected the most significant
 +       byte of the 10-bit slave address. Another transaction with the least 
 +       significant byte of the 10-bit address with a read/write request will
 +       be detected next. This second detection is automatically done by the 
 +       driver which may return one of the following:
 +           a. MSSP2_I2C_SLAVE_RECEIVE_REQUEST_DETECTED
 +           b. MSSP2_I2C_SLAVE_TRANSMIT_REQUEST_DETECTED
 +           c. MSSP2_I2C_SLAVE_10BIT_RECEIVE_REQUEST_DETECTED
 +       a or b is detected depending on the read/write bit of the received 
 +       control data. If c is detected next, the master decided to resend
 +       the most significant address.  
 +     */
 +    MSSP2_I2C_SLAVE_10BIT_RECEIVE_REQUEST_DETECTED,
 +
 +} MSSP2_I2C_SLAVE_DRIVER_STATUS;
 +
 +#define MSSP2_I2C_SLAVE_DEFAULT_ADDRESS          0x7
 +
 +/**
 +    @Summary
 +        Initializes and enables the i2c slave instance : 2
 +
 +    @Description
 +        This routine initializes the i2c slave driver instance for : 2
 +        index, making it ready for clients to open and use it.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        None
 +
 +    @Returns
 +        None
 +
 +    @Example
 +        <code>
 +
 +            uint8_t SlaveReadBuffer;
 +            uint8_t SlaveWriteBuffer;
 +
 +            // initialize the i2c slave driver    
 +            MSSP2_I2C_Initialize();
 +    
 +            // set up the slave driver
 + 
 +            // initialize the location of the read buffer
 +            MSSP2_I2C_ReadPointerSet(SlaveReadBuffer);
 +            // initialize the location of the write buffer
 +            MSSP2_I2C_WritePointerSet(SlaveWriteBuffer);
 +  
 +        </code>
 +*/
 +
 +void MSSP2_I2C_Initialize(void);
 +
 +
 +/**
 +    @Summary
 +        This function sets the slave address mask.
 +
 +    @Description
 +        This function sets the 10-bit slave address mask to be able to
 +        respond to multiple addresses. This function should be called
 +        after the initialization of the module.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        mask - The address mask to be used when filtering
 +            addresses from the i2c master transactions.
 +
 +    @Returns
 +        None
 +
 +    @Example
 +        <code>
 +            Refer to MSSP2_I2C_SlaveAddressSet() for an example	
 +        </code>
 +
 +*/
 +
 +void MSSP2_I2C_SlaveAddressMaskSet(
 +                                uint16_t mask);
 +
 +/**
 +    @Summary
 +        This function sets the slave address.
 +
 +    @Description
 +        This function sets the 10-bit slave address to be used by the
 +        module when filtering transactions from the i2c masters in the
 +        bus. The function analyzes the given address and decides if
 +        the 10-bit or 7-bit mode will be enabled. Once the function
 +        returns, the given address is set for the slave module.
 +
 +        This function should be called after the initialization of
 +        the module.
 +
 +        When changing the slave address the module must be idle.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        address - The address to be used to determine if the transaction
 +            is intended for this slave module.
 +
 +    @Returns
 +        None
 +
 +    @Example
 +        <code>
 +            // initialize the i2c slave driver    
 +            MSSP2_I2C_Initializer();
 + 
 +            // set the slave address and address mask if the default
 +            // values set in the initialize is not the desired values.
 +            MSSP2_I2C_SlaveAddressMaskSet(0x0xF);
 +            MSSP2_I2C_SlaveAddressSet(0x3C);
 + 
 +        </code>
 +
 +*/
 +
 +void MSSP2_I2C_SlaveAddressSet(
 +                                uint16_t address);
 +
 +/**
 +    @Summary
 +        This function sets the read pointer for the slave driver.
 +
 +    @Description
 +        This function sets the read pointer that the driver will
 +        need to retrieve data that will be transmitted to the master
 +        whenever the master requests a read.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        *p - The pointer to the read buffer, that will be used to transmit
 +             data to the requesting i2c master.
 +
 +    @Returns
 +        None
 +
 +    @Example
 +        <code>
 +            Refer to MSSP2_I2C_Initialize() for an example	
 +        </code>
 +
 +*/
 +
 +void MSSP2_I2C_ReadPointerSet(uint8_t *p);
 +
 +/**
 +    @Summary
 +        This function sets the write pointer for the slave driver.
 +
 +    @Description
 +        This function sets the write pointer that the driver will
 +        need to save data that will be received from the master
 +        whenever the master requests a write.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        *p - The pointer to the read buffer, that will be used to transmit
 +             data to the requesting i2c master.
 +
 +    @Returns
 +        None
 +
 +    @Example
 +        <code>
 +            Refer to MSSP2_I2C_Initialize() for an example	
 +        </code>
 +
 +*/
 +
 +void MSSP2_I2C_WritePointerSet(uint8_t *p);
 +
 +/**
 +    @Summary
 +        This function returns the current read pointer used by the
 +        slave driver.
 +
 +    @Description
 +        This function returns the current read pointer used by the
 +        slave driver. As the operation executes, the pointer is
 +        incremented. User of the slave driver can use this function
 +        to check on the current address that the pointer is pointing to.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        None
 +
 +    @Returns
 +        The current pointer used to transmit data to the requesting
 +        i2c master
 +
 +    @Example
 +        <code>
 +            uint8_t *pReadBuffer;
 + 
 +            pReadBuffer = MSSP2_I2C_ReadPointerGet();
 +
 +        </code>
 +
 +*/
 +
 +uint8_t *MSSP2_I2C_ReadPointerGet(void);
 +
 +/**
 +    @Summary
 +        This function returns the current write pointer used by the
 +        slave driver.
 +
 +    @Description
 +        This function returns the current write pointer used by the
 +        slave driver. As the operation executes, the pointer is
 +        incremented. User of the slave driver can use this function
 +        to check on the current address that the pointer is pointing to.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        None
 +
 +    @Returns
 +        The current pointer used to save received data from the requesting
 +        i2c master
 +
 +    @Example
 +        <code>
 +            uint8_t *pWriteBuffer;
 + 
 +            pWriteBuffer = MSSP2_I2C_WritePointerGet();
 +  
 +        </code>
 +
 +*/
 +
 +uint8_t *MSSP2_I2C_WritePointerGet(void);
 +
 +/**
 +   @Summary
 +        This application implemented function passes the
 +        status of the i2c slave driver.
 +
 +    @Description
 +        This application implemented function passes the
 +        status of the i2c slave driver. The status passed
 +        can be used by the application to manage the read and
 +        write buffers. This function is called by the slave
 +        driver everytime there is an event in the i2c bus that caused
 +        an interrupt in the i2c slave module to be asserted.
 +
 +        The function will return boolean. The value of the return
 +        will determine if the next received byte will be ack'ed or 
 +        nack'ed. By doing that, the application can have the 
 +        ability to delay incoming transactions. When a false is
 +        returned, the next transactions will be nack'ed forcing the 
 +        master to restart the transactions. 
 + 
 +        Returning a false will give the application a chance to
 +        prepare for the next transactions (for example: a read
 +        requests from the master) or process the recently received
 +        data.
 +
 +    @Preconditions
 +        None
 +
 +    @Param
 +        status - The latest status of the slave driver due
 +            to an event in the i2c bus.
 +
 +    @Returns
 +        True, if the application is ready for the next transaction.
 +        False, if the application is not ready for the next transaction.
 +
 +    @Example
 +        <code>
 + 
 +
 +            // Example implementation of the callback
 +
 +            static uint8_t mssp2_i2c_slaveWriteData = 0xAA;
 +
 +            bool MSSP2_I2C_StatusCallback(MSSP2_I2C_SLAVE_DRIVER_STATUS status)
 +            {
 +
 +                // this emulates the slave device memory where data written to slave
 +                // is placed and data read from slave is taken
 +                static uint8_t EMULATE_EEPROM_Memory[64] =
 +                        {
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 +                        };
 +
 +                static uint16_t address, addrByteCount;
 +                static bool     addressState = true;
 +
 +                switch (status)
 +                {
 +                    case MSSP2_I2C_SLAVE_TRANSMIT_REQUEST_DETECTED:
 +
 +                        // set up the slave driver buffer transmit pointer
 +                        MSSP2_I2C_ReadPointerSet(&EMULATE_EEPROM_Memory[address]);
 +                        address++;
 +
 +                        break;
 +
 +                    case MSSP2_I2C_SLAVE_RECEIVE_REQUEST_DETECTED:
 +
 +                        addrByteCount = 0;
 +                        addressState = true;
 +
 +                        // set up the slave driver buffer receive pointer
 +                        MSSP2_I2C_WritePointerSet(&mssp2_i2c_slaveWriteData);
 +
 +                        break;
 +
 +                    case MSSP2_I2C_SLAVE_RECEIVED_DATA_DETECTED:
 +
 +                        if (addressState == true)
 +                        {
 +                            // get the address of the memory being written
 +                            if (addrByteCount == 0)
 +                            {
 +                                address = (mssp2_i2c_slaveWriteData << 8) & 0xFF00;
 +                                addrByteCount++;
 +                            }
 +                            else if (addrByteCount == 1)
 +                            {
 +                                address = address | mssp2_i2c_slaveWriteData;
 +                                addrByteCount = 0;
 +                                addressState = false;
 +                            }
 +                        }
 +                        else // if (addressState == false)
 +                        {
 +                            // set the memory with the received data
 +                            EMULATE_EEPROM_Memory[address] = mssp2_i2c_slaveWriteData;
 +                        }
 +
 +                        break;
 +
 +                    case MSSP2_I2C_SLAVE_10BIT_RECEIVE_REQUEST_DETECTED:
 +
 +                        // do something here when 10-bit address is detected
 +
 +                        // 10-bit address is detected
 +
 +                        break;
 +
 +                    default:
 +                        break;
 +
 +                }
 +
 +                return true;
 +            }
 +
 +        </code>
 +
 + */
 +
 +#pragma message "MSSP2_I2C_StatusCallback() is an Application implemented function. If this function is already implemented, you can turn off this message by deleting or commenting out this message."
 +bool MSSP2_I2C_StatusCallback(MSSP2_I2C_SLAVE_DRIVER_STATUS status);
 +
 +#ifdef __cplusplus  // Provide C++ Compatibility
 +
 +    }
 +
 +#endif
 +
 +#endif  /* _MSSP2_I2C_H */
\ No newline at end of file diff --git a/mcc_generated_files/pin_manager.c b/mcc_generated_files/pin_manager.c new file mode 100644 index 0000000..8aa798a --- /dev/null +++ b/mcc_generated_files/pin_manager.c @@ -0,0 +1,92 @@ +/**
 +  PIN MANAGER Generated Driver File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    pin_manager.c
 +
 +  @Summary:
 +    This is the generated manager file for the PIC24 / dsPIC33 / PIC32MM MCUs device.  This manager
 +    configures the pins direction, initial state, analog setting.
 +
 +  @Description:
 +    This source file provides implementations for PIN MANAGER.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +
 +/**
 +    Section: Includes
 +*/
 +
 +#include <xc.h>
 +#include <stdio.h>
 +#include "pin_manager.h"
 +
 +/**
 + Section: Driver Interface Function Definitions
 +*/
 +void PIN_MANAGER_Initialize (void)
 +{
 +    /****************************************************************************
 +     * Setting the Output Latch SFR(s)
 +     ***************************************************************************/
 +    LATA = 0x0000;
 +    LATB = 0x0000;
 +
 +    /****************************************************************************
 +     * Setting the GPIO Direction SFR(s)
 +     ***************************************************************************/
 +    TRISA = 0x00A4;
 +    TRISB = 0x543F;
 +
 +    /****************************************************************************
 +     * Setting the Weak Pull Up and Weak Pull Down SFR(s)
 +     ***************************************************************************/
 +    CNPD1 = 0x0000;
 +    CNPD2 = 0x0000;
 +    CNPU1 = 0x0000;
 +    CNPU2 = 0x0000;
 +
 +    /****************************************************************************
 +     * Setting the Open Drain SFR(s)
 +     ***************************************************************************/
 +    ODCA = 0x0000;
 +    ODCB = 0x01C0;
 +
 +    /****************************************************************************
 +     * Setting the Analog/Digital Configuration SFR(s)
 +     ***************************************************************************/
 +    ANSA = 0x0000;
 +    ANSB = 0x5030;
 +}
 +
 diff --git a/mcc_generated_files/pin_manager.h b/mcc_generated_files/pin_manager.h new file mode 100644 index 0000000..8f18362 --- /dev/null +++ b/mcc_generated_files/pin_manager.h @@ -0,0 +1,1113 @@ +/**
 +  PIN MANAGER Generated Driver File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    pin_manager.h
 +
 +  @Summary:
 +    This is the generated manager file for the PIC24 / dsPIC33 / PIC32MM MCUs device.  This manager
 +    configures the pins direction, initial state, analog setting.
 +
 +  @Description:
 +    This source file provides implementations for PIN MANAGER.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _PIN_MANAGER_H
 +#define _PIN_MANAGER_H
 +/**
 +    Section: Includes
 +*/
 +#include <xc.h>
 +
 +/**
 +    Section: Device Pin Macros
 +*/
 +/**
 +  @Summary
 +    Sets the GPIO pin, RA0, high using LATA0.
 +
 +  @Description
 +    Sets the GPIO pin, RA0, high using LATA0.
 +
 +  @Preconditions
 +    The RA0 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RA0 high (1)
 +    IO_RA0_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RA0_SetHigh()          (_LATA0 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RA0, low using LATA0.
 +
 +  @Description
 +    Sets the GPIO pin, RA0, low using LATA0.
 +
 +  @Preconditions
 +    The RA0 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RA0 low (0)
 +    IO_RA0_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RA0_SetLow()           (_LATA0 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RA0, using LATA0.
 +
 +  @Description
 +    Toggles the GPIO pin, RA0, using LATA0.
 +
 +  @Preconditions
 +    The RA0 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RA0
 +    IO_RA0_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RA0_Toggle()           (_LATA0 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RA0.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RA0.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RA0
 +    postValue = IO_RA0_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RA0_GetValue()         _RA0
 +/**
 +  @Summary
 +    Configures the GPIO pin, RA0, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RA0, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RA0 as an input
 +    IO_RA0_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RA0_SetDigitalInput()  (_TRISA0 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RA0, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RA0, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RA0 as an output
 +    IO_RA0_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RA0_SetDigitalOutput() (_TRISA0 = 0)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RA1, high using LATA1.
 +
 +  @Description
 +    Sets the GPIO pin, RA1, high using LATA1.
 +
 +  @Preconditions
 +    The RA1 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RA1 high (1)
 +    IO_RA1_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RA1_SetHigh()          (_LATA1 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RA1, low using LATA1.
 +
 +  @Description
 +    Sets the GPIO pin, RA1, low using LATA1.
 +
 +  @Preconditions
 +    The RA1 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RA1 low (0)
 +    IO_RA1_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RA1_SetLow()           (_LATA1 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RA1, using LATA1.
 +
 +  @Description
 +    Toggles the GPIO pin, RA1, using LATA1.
 +
 +  @Preconditions
 +    The RA1 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RA1
 +    IO_RA1_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RA1_Toggle()           (_LATA1 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RA1.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RA1.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RA1
 +    postValue = IO_RA1_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RA1_GetValue()         _RA1
 +/**
 +  @Summary
 +    Configures the GPIO pin, RA1, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RA1, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RA1 as an input
 +    IO_RA1_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RA1_SetDigitalInput()  (_TRISA1 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RA1, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RA1, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RA1 as an output
 +    IO_RA1_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RA1_SetDigitalOutput() (_TRISA1 = 0)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RA4, high using LATA4.
 +
 +  @Description
 +    Sets the GPIO pin, RA4, high using LATA4.
 +
 +  @Preconditions
 +    The RA4 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RA4 high (1)
 +    IO_RA4_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RA4_SetHigh()          (_LATA4 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RA4, low using LATA4.
 +
 +  @Description
 +    Sets the GPIO pin, RA4, low using LATA4.
 +
 +  @Preconditions
 +    The RA4 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RA4 low (0)
 +    IO_RA4_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RA4_SetLow()           (_LATA4 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RA4, using LATA4.
 +
 +  @Description
 +    Toggles the GPIO pin, RA4, using LATA4.
 +
 +  @Preconditions
 +    The RA4 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RA4
 +    IO_RA4_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RA4_Toggle()           (_LATA4 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RA4.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RA4.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RA4
 +    postValue = IO_RA4_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RA4_GetValue()         _RA4
 +/**
 +  @Summary
 +    Configures the GPIO pin, RA4, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RA4, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RA4 as an input
 +    IO_RA4_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RA4_SetDigitalInput()  (_TRISA4 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RA4, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RA4, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RA4 as an output
 +    IO_RA4_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RA4_SetDigitalOutput() (_TRISA4 = 0)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB6, high using LATB6.
 +
 +  @Description
 +    Sets the GPIO pin, RB6, high using LATB6.
 +
 +  @Preconditions
 +    The RB6 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB6 high (1)
 +    IO_RB6_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RB6_SetHigh()          (_LATB6 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB6, low using LATB6.
 +
 +  @Description
 +    Sets the GPIO pin, RB6, low using LATB6.
 +
 +  @Preconditions
 +    The RB6 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB6 low (0)
 +    IO_RB6_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RB6_SetLow()           (_LATB6 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RB6, using LATB6.
 +
 +  @Description
 +    Toggles the GPIO pin, RB6, using LATB6.
 +
 +  @Preconditions
 +    The RB6 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RB6
 +    IO_RB6_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RB6_Toggle()           (_LATB6 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RB6.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RB6.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RB6
 +    postValue = IO_RB6_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RB6_GetValue()         _RB6
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB6, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RB6, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB6 as an input
 +    IO_RB6_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RB6_SetDigitalInput()  (_TRISB6 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB6, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RB6, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB6 as an output
 +    IO_RB6_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RB6_SetDigitalOutput() (_TRISB6 = 0)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB7, high using LATB7.
 +
 +  @Description
 +    Sets the GPIO pin, RB7, high using LATB7.
 +
 +  @Preconditions
 +    The RB7 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB7 high (1)
 +    IO_RB7_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RB7_SetHigh()          (_LATB7 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB7, low using LATB7.
 +
 +  @Description
 +    Sets the GPIO pin, RB7, low using LATB7.
 +
 +  @Preconditions
 +    The RB7 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB7 low (0)
 +    IO_RB7_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RB7_SetLow()           (_LATB7 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RB7, using LATB7.
 +
 +  @Description
 +    Toggles the GPIO pin, RB7, using LATB7.
 +
 +  @Preconditions
 +    The RB7 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RB7
 +    IO_RB7_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RB7_Toggle()           (_LATB7 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RB7.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RB7.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RB7
 +    postValue = IO_RB7_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RB7_GetValue()         _RB7
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB7, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RB7, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB7 as an input
 +    IO_RB7_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RB7_SetDigitalInput()  (_TRISB7 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB7, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RB7, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB7 as an output
 +    IO_RB7_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RB7_SetDigitalOutput() (_TRISB7 = 0)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB8, high using LATB8.
 +
 +  @Description
 +    Sets the GPIO pin, RB8, high using LATB8.
 +
 +  @Preconditions
 +    The RB8 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB8 high (1)
 +    IO_RB8_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RB8_SetHigh()          (_LATB8 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB8, low using LATB8.
 +
 +  @Description
 +    Sets the GPIO pin, RB8, low using LATB8.
 +
 +  @Preconditions
 +    The RB8 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB8 low (0)
 +    IO_RB8_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RB8_SetLow()           (_LATB8 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RB8, using LATB8.
 +
 +  @Description
 +    Toggles the GPIO pin, RB8, using LATB8.
 +
 +  @Preconditions
 +    The RB8 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RB8
 +    IO_RB8_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RB8_Toggle()           (_LATB8 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RB8.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RB8.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RB8
 +    postValue = IO_RB8_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RB8_GetValue()         _RB8
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB8, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RB8, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB8 as an input
 +    IO_RB8_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RB8_SetDigitalInput()  (_TRISB8 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB8, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RB8, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB8 as an output
 +    IO_RB8_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RB8_SetDigitalOutput() (_TRISB8 = 0)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB9, high using LATB9.
 +
 +  @Description
 +    Sets the GPIO pin, RB9, high using LATB9.
 +
 +  @Preconditions
 +    The RB9 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB9 high (1)
 +    IO_RB9_SetHigh();
 +    </code>
 +
 +*/
 +#define IO_RB9_SetHigh()          (_LATB9 = 1)
 +/**
 +  @Summary
 +    Sets the GPIO pin, RB9, low using LATB9.
 +
 +  @Description
 +    Sets the GPIO pin, RB9, low using LATB9.
 +
 +  @Preconditions
 +    The RB9 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Set RB9 low (0)
 +    IO_RB9_SetLow();
 +    </code>
 +
 +*/
 +#define IO_RB9_SetLow()           (_LATB9 = 0)
 +/**
 +  @Summary
 +    Toggles the GPIO pin, RB9, using LATB9.
 +
 +  @Description
 +    Toggles the GPIO pin, RB9, using LATB9.
 +
 +  @Preconditions
 +    The RB9 must be set to an output.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Toggle RB9
 +    IO_RB9_Toggle();
 +    </code>
 +
 +*/
 +#define IO_RB9_Toggle()           (_LATB9 ^= 1)
 +/**
 +  @Summary
 +    Reads the value of the GPIO pin, RB9.
 +
 +  @Description
 +    Reads the value of the GPIO pin, RB9.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    uint16_t portValue;
 +
 +    // Read RB9
 +    postValue = IO_RB9_GetValue();
 +    </code>
 +
 +*/
 +#define IO_RB9_GetValue()         _RB9
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB9, as an input.
 +
 +  @Description
 +    Configures the GPIO pin, RB9, as an input.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB9 as an input
 +    IO_RB9_SetDigitalInput();
 +    </code>
 +
 +*/
 +#define IO_RB9_SetDigitalInput()  (_TRISB9 = 1)
 +/**
 +  @Summary
 +    Configures the GPIO pin, RB9, as an output.
 +
 +  @Description
 +    Configures the GPIO pin, RB9, as an output.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    // Sets the RB9 as an output
 +    IO_RB9_SetDigitalOutput();
 +    </code>
 +
 +*/
 +#define IO_RB9_SetDigitalOutput() (_TRISB9 = 0)
 +
 +/**
 +    Section: Function Prototypes
 +*/
 +/**
 +  @Summary
 +    Configures the pin settings of the PIC24FV16KM202
 +
 +  @Description
 +    This is the generated manager file for the PIC24 / dsPIC33 / PIC32MM MCUs device.  This manager
 +    configures the pins direction, initial state, analog setting.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    <code>
 +    void SYSTEM_Initialize(void)
 +    {
 +        // Other initializers are called from this function
 +        PIN_MANAGER_Initialize();
 +    }
 +    </code>
 +
 +*/
 +void PIN_MANAGER_Initialize (void);
 +
 +
 +
 +#endif
 diff --git a/mcc_generated_files/system.c b/mcc_generated_files/system.c new file mode 100644 index 0000000..a128daf --- /dev/null +++ b/mcc_generated_files/system.c @@ -0,0 +1,106 @@ +/**
 +  @Generated PIC24 / dsPIC33 / PIC32MM MCUs Source File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    system.h
 +
 +  @Summary:
 +    This is the sysetm.h file generated using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This header file provides implementations for driver APIs for all modules selected in the GUI.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +// Configuration bits: selected in the GUI
 +
 +// FBS
 +#pragma config BWRP = OFF    //Boot Segment Write Protect->Disabled
 +#pragma config BSS = OFF    //Boot segment Protect->No boot program flash segment
 +
 +// FGS
 +#pragma config GWRP = OFF    //General Segment Write Protect->General segment may be written
 +#pragma config GCP = OFF    //General Segment Code Protect->No Protection
 +
 +// FOSCSEL
 +#pragma config FNOSC = PRI    //Oscillator Select->Primary Oscillator (XT, HS, EC)
 +#pragma config SOSCSRC = DIG    //SOSC Source Type->Digital Mode for use with external source
 +#pragma config LPRCSEL = HP    //LPRC Oscillator Power and Accuracy->High Power, High Accuracy Mode
 +#pragma config IESO = OFF    //Internal External Switch Over bit->Internal External Switchover mode disabled (Two-speed Start-up disabled)
 +
 +// FOSC
 +#pragma config POSCMOD = HS    //Primary Oscillator Configuration bits->HS oscillator mode selected
 +#pragma config OSCIOFNC = IO    //CLKO Enable Configuration bit->Port I/O enabled (CLKO disabled)
 +#pragma config POSCFREQ = HS    //Primary Oscillator Frequency Range Configuration bits->Primary oscillator/external clock input frequency greater than 8MHz
 +#pragma config SOSCSEL = SOSCHP    //SOSC Power Selection Configuration bits->Secondary Oscillator configured for high-power operation
 +#pragma config FCKSM = CSDCMD    //Clock Switching and Monitor Selection->Both Clock Switching and Fail-safe Clock Monitor are disabled
 +
 +// FWDT
 +#pragma config WDTPS = PS32768    //Watchdog Timer Postscale Select bits->1:32768
 +#pragma config FWPSA = PR128    //WDT Prescaler bit->WDT prescaler ratio of 1:128
 +#pragma config FWDTEN = OFF    //Watchdog Timer Enable bits->WDT disabled in hardware; SWDTEN bit disabled
 +#pragma config WINDIS = OFF    //Windowed Watchdog Timer Disable bit->Standard WDT selected(windowed WDT disabled)
 +
 +// FPOR
 +#pragma config BOREN = BOR3    //Brown-out Reset Enable bits->Brown-out Reset enabled in hardware, SBOREN bit disabled
 +#pragma config RETCFG = OFF    //->Retention regulator is not available
 +#pragma config PWRTEN = ON    //Power-up Timer Enable bit->PWRT enabled
 +#pragma config I2C1SEL = PRI    //Alternate I2C1 Pin Mapping bit->Use Default SCL1/SDA1 Pins For I2C1
 +#pragma config BORV = V18    //Brown-out Reset Voltage bits->Brown-out Reset set to lowest voltage (1.8V)
 +#pragma config MCLRE = ON    //MCLR Pin Enable bit->RA5 input pin disabled, MCLR pin enabled
 +
 +// FICD
 +#pragma config ICS = PGx1    //ICD Pin Placement Select bits->EMUC/EMUD share PGC1/PGD1
 +
 +#include "pin_manager.h"
 +#include "clock.h"
 +#include "system.h"
 +#include "tmr1.h"
 +#include "interrupt_manager.h"
 +#include "traps.h"
 +#include "mssp1_spi.h"
 +#include "mssp2_i2c.h"
 +
 +void SYSTEM_Initialize(void)
 +{
 +    PIN_MANAGER_Initialize();
 +    CLOCK_Initialize();
 +    INTERRUPT_Initialize();
 +    MSSP2_I2C_Initialize();
 +    MSSP1_SPI_Initialize();
 +    TMR1_Initialize();
 +}
 +
 +/**
 + End of File
 +*/
\ No newline at end of file diff --git a/mcc_generated_files/system.h b/mcc_generated_files/system.h new file mode 100644 index 0000000..1125509 --- /dev/null +++ b/mcc_generated_files/system.h @@ -0,0 +1,70 @@ +/**
 +  @Generated PIC24 / dsPIC33 / PIC32MM MCUs Source File
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    system.h
 +
 +  @Summary:
 +    This is the system.h file generated using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This header file provides implementations for driver APIs for all modules selected in the GUI.
 +    Generation Information :
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _XTAL_FREQ
 +#define _XTAL_FREQ  20000000UL
 +#endif
 +
 +#include "xc.h"
 +#include "stdint.h"
 +
 +#ifndef SYSTEM_H
 +#define	SYSTEM_H
 +
 +/**
 + * @Param
 +    none
 + * @Returns
 +    none
 + * @Description
 +    Initializes the device to the default states configured in the
 + *                  MCC GUI
 + * @Example
 +    SYSTEM_Initialize(void);
 + */
 +void SYSTEM_Initialize(void);
 +#endif	/* SYSTEM_H */
 +/**
 + End of File
 +*/
\ No newline at end of file diff --git a/mcc_generated_files/tmr1.c b/mcc_generated_files/tmr1.c new file mode 100644 index 0000000..25bc139 --- /dev/null +++ b/mcc_generated_files/tmr1.c @@ -0,0 +1,219 @@ +
 +/**
 +  TMR1 Generated Driver API Source File 
 +
 +  @Company
 +    Microchip Technology Inc.
 +
 +  @File Name
 +    tmr1.c
 +
 +  @Summary
 +    This is the generated source file for the TMR1 driver using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description
 +    This source file provides APIs for driver for TMR1. 
 +    Generation Information : 
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +/**
 +  Section: Included Files
 +*/
 +
 +#include <stdio.h>
 +#include "tmr1.h"
 +
 +/**
 + Section: File specific functions
 +*/
 +void (*TMR1_InterruptHandler)(void) = NULL;
 +void TMR1_CallBack(void);
 +
 +/**
 +  Section: Data Type Definitions
 +*/
 +
 +/** TMR Driver Hardware Instance Object
 +
 +  @Summary
 +    Defines the object required for the maintenance of the hardware instance.
 +
 +  @Description
 +    This defines the object required for the maintenance of the hardware
 +    instance. This object exists once per hardware instance of the peripheral.
 +
 +  Remarks:
 +    None.
 +*/
 +
 +typedef struct _TMR_OBJ_STRUCT
 +{
 +    /* Timer Elapsed */
 +    volatile bool           timerElapsed;
 +    /*Software Counter value*/
 +    volatile uint8_t        count;
 +
 +} TMR_OBJ;
 +
 +static TMR_OBJ tmr1_obj;
 +
 +/**
 +  Section: Driver Interface
 +*/
 +
 +void TMR1_Initialize (void)
 +{
 +    //TMR1 0; 
 +    TMR1 = 0x00;
 +    //Period = 1.5000128 s; Frequency = 10000000 Hz; PR1 39062; 
 +    PR1 = 0xE4E1;
 +    //TCKPS 1:256; TON enabled; TSIDL disabled; TCS FOSC/2; TECS SOSC; TSYNC disabled; TGATE disabled; 
 +    T1CON = 0x8030;
 +
 +    if(TMR1_InterruptHandler == NULL)
 +    {
 +        TMR1_SetInterruptHandler(&TMR1_CallBack);
 +    }
 +
 +    IFS0bits.T1IF = false;
 +    IEC0bits.T1IE = true;
 +	
 +    tmr1_obj.timerElapsed = false;
 +
 +}
 +
 +
 +void __attribute__ ( ( interrupt, no_auto_psv ) ) _T1Interrupt (  )
 +{
 +    /* Check if the Timer Interrupt/Status is set */
 +
 +    //***User Area Begin
 +
 +    // ticker function call;
 +    // ticker is 1 -> Callback function gets called everytime this ISR executes
 +        if(TMR1_InterruptHandler) 
 +    { 
 +           TMR1_InterruptHandler(); 
 +    }
 +
 +    //***User Area End
 +
 +    tmr1_obj.count++;
 +    tmr1_obj.timerElapsed = true;
 +    IFS0bits.T1IF = false;
 +}
 +
 +void TMR1_Period16BitSet( uint16_t value )
 +{
 +    /* Update the counter values */
 +    PR1 = value;
 +    /* Reset the status information */
 +    tmr1_obj.timerElapsed = false;
 +}
 +
 +uint16_t TMR1_Period16BitGet( void )
 +{
 +    return( PR1 );
 +}
 +
 +void TMR1_Counter16BitSet ( uint16_t value )
 +{
 +    /* Update the counter values */
 +    TMR1 = value;
 +    /* Reset the status information */
 +    tmr1_obj.timerElapsed = false;
 +}
 +
 +uint16_t TMR1_Counter16BitGet( void )
 +{
 +    return( TMR1 );
 +}
 +
 +
 +void __attribute__ ((weak)) TMR1_CallBack(void)
 +{
 +    _LATB8 = 0;
 +    _LATB7 = 1;
 +}
 +
 +void  TMR1_SetInterruptHandler(void (* InterruptHandler)(void))
 +{ 
 +    IEC0bits.T1IE = false;
 +    TMR1_InterruptHandler = InterruptHandler; 
 +    IEC0bits.T1IE = true;
 +}
 +
 +void TMR1_Start( void )
 +{
 +    /* Reset the status information */
 +    tmr1_obj.timerElapsed = false;
 +
 +    /*Enable the interrupt*/
 +    IEC0bits.T1IE = true;
 +
 +    /* Start the Timer */
 +    T1CONbits.TON = 1;
 +}
 +
 +void TMR1_Stop( void )
 +{
 +    /* Stop the Timer */
 +    T1CONbits.TON = false;
 +
 +    /*Disable the interrupt*/
 +    IEC0bits.T1IE = false;
 +}
 +
 +bool TMR1_GetElapsedThenClear(void)
 +{
 +    bool status;
 +    
 +    status = tmr1_obj.timerElapsed;
 +
 +    if(status == true)
 +    {
 +        tmr1_obj.timerElapsed = false;
 +    }
 +    return status;
 +}
 +
 +int TMR1_SoftwareCounterGet(void)
 +{
 +    return tmr1_obj.count;
 +}
 +
 +void TMR1_SoftwareCounterClear(void)
 +{
 +    tmr1_obj.count = 0; 
 +}
 +
 +/**
 + End of File
 +*/
 diff --git a/mcc_generated_files/tmr1.h b/mcc_generated_files/tmr1.h new file mode 100644 index 0000000..cf60e9b --- /dev/null +++ b/mcc_generated_files/tmr1.h @@ -0,0 +1,331 @@ +/**
 +  TMR1 Generated Driver API Header File 
 +
 +  @Company
 +    Microchip Technology Inc.
 +
 +  @File Name
 +    tmr1.h
 +
 +  @Summary
 +    This is the generated header file for the TMR1 driver using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description
 +    This header file provides APIs for driver for TMR1. 
 +    Generation Information : 
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB 	          :  MPLAB X v6.05
 +*/
 +
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _TMR1_H
 +#define _TMR1_H
 +
 +/**
 +  Section: Included Files
 +*/
 +
 +#include <xc.h>
 +#include <stdint.h>
 +#include <stdbool.h>
 +
 +#ifdef __cplusplus  // Provide C++ Compatibility
 +
 +    extern "C" {
 +
 +#endif
 +
 +#define TMR1_INTERRUPT_TICKER_FACTOR    1
 +
 +/**
 +  Section: Interface Routines
 +*/
 +
 +/**
 +  @Summary
 +    Initializes hardware and data for the given instance of the TMR module
 +
 +  @Description
 +    This routine initializes hardware for the instance of the TMR module,
 +    using the hardware initialization given data.  It also initializes all
 +    necessary internal data.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None
 + 
 +  @Example 
 +    <code>
 +    bool statusTimer1;
 +    uint16_t period;
 +    uint16_t value;
 +
 +    period = 0x20;
 +
 +    TMR1_Initialize();
 +
 +    TMR1_Period16BitSet(period);
 +
 +    if((value = TMR1_Period16BitGet())== period)
 +    {
 +        TMR1_Start();
 +    }
 +
 +    while(1)
 +    {
 +        TMR1_Tasks();
 +        if( (statusTimer1 = TMR1_GetElapsedThenClear()) == true)
 +        {
 +            TMR1_Stop();
 +        }
 +    }
 +    </code>
 +*/
 +void TMR1_Initialize (void);
 +
 +
 +/**
 +  @Summary
 +    Updates 16-bit timer value
 +
 +  @Description
 +    This routine updates 16-bit timer value
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +void TMR1_Period16BitSet( uint16_t value );
 +
 +/**
 +
 +  @Summary
 +    Provides the timer 16-bit period value
 +
 +  @Description
 +    This routine provides the timer 16-bit period value
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    Timer 16-bit period value
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +uint16_t TMR1_Period16BitGet( void );
 +
 +/**
 +  @Summary
 +    Updates the timer's 16-bit value
 +
 +  @Description
 +    This routine updates the timer's 16-bit value
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None
 +
 +  @Example 
 +    <code>
 +    uint16_t value=0xF0F0;
 +
 +    TMR1_Counter16BitSet(value));
 +
 +    while(1)
 +    {
 +        TMR1_Tasks();
 +        if( (value == TMR1_Counter16BitGet()))
 +        {
 +            TMR1_Stop();
 +        }
 +    }
 +    </code>
 +*/
 +
 +void TMR1_Counter16BitSet ( uint16_t value );
 +
 +/**
 +  @Summary
 +    Provides 16-bit current counter value
 +
 +  @Description
 +    This routine provides 16-bit current counter value
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    16-bit current counter value
 + 
 +  @Example 
 +    Refer to the example of TMR1_Counter16BitSet();
 +*/
 +
 +uint16_t TMR1_Counter16BitGet( void );
 +
 +/**
 +  @Summary
 +    Assigns a function pointer with a callback address.
 +
 +  @Description
 +    This routine assigns a function pointer with a callback address.
 +
 +  @Param
 +    Address of the callback routine.
 +
 +  @Returns
 +    None
 + 
 +  @Example 
 +    <code>
 +        TMR1_SetInterruptHandler(&TMR1_CallBack);
 +    </code>
 +*/
 +
 +void TMR1_SetInterruptHandler(void (* InterruptHandler)(void));
 +
 +/**
 +  @Summary
 +    Starts the TMR
 +
 +  @Description
 +    This routine starts the TMR
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +void TMR1_Start( void );
 +
 +/**
 +  @Summary
 +    Stops the TMR
 +
 +  @Description
 +    This routine stops the TMR
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +void TMR1_Stop( void );
 +
 +/**
 +  @Summary
 +    Returns the elapsed status of the timer and clears if flag is set.
 +
 +  @Description
 +    This routine returns the elapsed status of the timer and clears 
 +    flag if its set.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    True - Timer has elapsed.
 +    False - Timer has not elapsed.
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +bool TMR1_GetElapsedThenClear(void);
 +
 +/**
 +  @Summary
 +    Returns the software counter value.
 +
 +  @Description
 +    This routine returns the software counter value.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    Software counter value.
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +int TMR1_SoftwareCounterGet(void);
 +
 +/**
 +  @Summary
 +    Clears the software counter value.
 +
 +  @Description
 +    This routine clears the software counter value.
 +
 +  @Param
 +    None.
 +
 +  @Returns
 +    None
 + 
 +  @Example 
 +    Refer to the example of TMR1_Initialize();
 +*/
 +
 +void TMR1_SoftwareCounterClear(void);
 +
 +#ifdef __cplusplus  // Provide C++ Compatibility
 +
 +    }
 +
 +#endif
 +
 +#endif //_TMR1_H
 +    
 +/**
 + End of File
 +*/
 diff --git a/mcc_generated_files/traps.c b/mcc_generated_files/traps.c new file mode 100644 index 0000000..65b5ccf --- /dev/null +++ b/mcc_generated_files/traps.c @@ -0,0 +1,122 @@ +/**
 +  System Traps Generated Driver File 
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    traps.h
 +
 +  @Summary:
 +    This is the generated driver implementation file for handling traps
 +    using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This source file provides implementations for PIC24 / dsPIC33 / PIC32MM MCUs traps.
 +    Generation Information : 
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +/**
 +    Section: Includes
 +*/
 +#include <xc.h>
 +#include "traps.h"
 +
 +#define ERROR_HANDLER __attribute__((interrupt,no_auto_psv))
 +#define FAILSAFE_STACK_GUARDSIZE 8
 +
 +/**
 + * a private place to store the error code if we run into a severe error
 + */
 +static uint16_t TRAPS_error_code = -1;
 +
 +/**
 + * Halts 
 + * 
 + * @param code error code
 + */
 +void __attribute__((weak)) TRAPS_halt_on_error(uint16_t code)
 +{
 +    TRAPS_error_code = code;
 +#ifdef __DEBUG    
 +    __builtin_software_breakpoint();
 +    /* If we are in debug mode, cause a software breakpoint in the debugger */
 +#endif
 +    while(1);
 +    
 +}
 +
 +/**
 + * Sets the stack pointer to a backup area of memory, in case we run into
 + * a stack error (in which case we can't really trust the stack pointer)
 + */
 +inline static void use_failsafe_stack(void)
 +{
 +    static uint8_t failsafe_stack[32];
 +    asm volatile (
 +        "   mov    %[pstack], W15\n"
 +        :
 +        : [pstack]"r"(failsafe_stack)
 +    );
 +/* Controls where the stack pointer limit is, relative to the end of the
 + * failsafe stack
 + */    
 +    SPLIM = (uint16_t)(((uint8_t *)failsafe_stack) + sizeof(failsafe_stack) 
 +            - FAILSAFE_STACK_GUARDSIZE);
 +}
 +
 +/** Oscillator Fail Trap vector**/
 +void ERROR_HANDLER _OscillatorFail(void)
 +{
 +    INTCON1bits.OSCFAIL = 0;  //Clear the trap flag
 +    TRAPS_halt_on_error(TRAPS_OSC_FAIL);
 +}
 +/** Stack Error Trap Vector**/
 +void ERROR_HANDLER _StackError(void)
 +{
 +    /* We use a failsafe stack: the presence of a stack-pointer error
 +     * means that we cannot trust the stack to operate correctly unless
 +     * we set the stack pointer to a safe place.
 +     */
 +    use_failsafe_stack(); 
 +    INTCON1bits.STKERR = 0;  //Clear the trap flag
 +    TRAPS_halt_on_error(TRAPS_STACK_ERR);
 +}
 +/** Address Error Trap Vector**/
 +void ERROR_HANDLER _AddressError(void)
 +{
 +    INTCON1bits.ADDRERR = 0;  //Clear the trap flag
 +    TRAPS_halt_on_error(TRAPS_ADDRESS_ERR);
 +}
 +/** Math Error Trap Vector**/
 +void ERROR_HANDLER _MathError(void)
 +{
 +    INTCON1bits.MATHERR = 0;  //Clear the trap flag
 +    TRAPS_halt_on_error(TRAPS_MATH_ERR);
 +}
 diff --git a/mcc_generated_files/traps.h b/mcc_generated_files/traps.h new file mode 100644 index 0000000..80443bc --- /dev/null +++ b/mcc_generated_files/traps.h @@ -0,0 +1,86 @@ +/**
 +  System Traps Generated Driver File 
 +
 +  @Company:
 +    Microchip Technology Inc.
 +
 +  @File Name:
 +    traps.h
 +
 +  @Summary:
 +    This is the generated driver implementation file for handling traps
 +    using PIC24 / dsPIC33 / PIC32MM MCUs
 +
 +  @Description:
 +    This source file provides implementations for PIC24 / dsPIC33 / PIC32MM MCUs traps.
 +    Generation Information : 
 +        Product Revision  :  PIC24 / dsPIC33 / PIC32MM MCUs - 1.171.4
 +        Device            :  PIC24FV16KM202
 +    The generated drivers are tested against the following:
 +        Compiler          :  XC16 v2.10
 +        MPLAB             :  MPLAB X v6.05
 +*/
 +/*
 +    (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
 +    software and any derivatives exclusively with Microchip products.
 +
 +    THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
 +    EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
 +    WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
 +    PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION
 +    WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.
 +
 +    IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
 +    INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
 +    WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
 +    BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
 +    FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
 +    ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
 +    THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
 +
 +    MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
 +    TERMS.
 +*/
 +
 +#ifndef _TRAPS_H
 +#define _TRAPS_H
 +
 +#include <stdint.h>
 +
 +/**
 + * Error codes
 + */
 +typedef enum 
 +{
 +    /* ----- Traps ----- */
 +    TRAPS_OSC_FAIL = 0, /** Oscillator Fail Trap vector */
 +    TRAPS_STACK_ERR = 1, /** Stack Error Trap Vector */
 +    TRAPS_ADDRESS_ERR = 2, /** Address Error Trap Vector */
 +    TRAPS_MATH_ERR = 3, /** Math Error Trap Vector */
 +} TRAPS_ERROR_CODE;
 +
 +/**
 +  @Summary
 +    Default handler for the traps
 +
 +  @Description
 +    This routine will be called whenever a trap happens. It stores the trap
 +    error code and waits forever.
 +    This routine has a weak attribute and can be over written.
 +
 +  @Preconditions
 +    None.
 +
 +  @Returns
 +    None.
 +
 +  @Param
 +    None.
 +
 +  @Example
 +    None.
 +
 +*/
 +void TRAPS_halt_on_error(uint16_t code);
 +
 +#endif
\ No newline at end of file | 
