From c9335332df86fbc895a8868a34abcc98817d53f0 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Sat, 6 Dec 2025 14:22:21 -0600 Subject: Inital Commit --- .../119ea452f4fc9dce5d9ccac4a50e055b7722276c | 1 + .../13b7dbf04d4f86cc33dea191f2580790a7e4cb41 | 1 + .../1f7a1067d2a8525ae9d220271878efb282359c5 | 1 + .../37635bba81897aff7ba7962b372638677124c269 | 1 + .../3f72406f95220d42b2256b0f1706819179cc130d | 1 + .../444664807302b43af5c2b42a24470e83cb158c7a | 1 + .../447d79eece8821c8ff3d9313d70bc8ac3b644e52 | 1 + .../49ec2b1ac283e98f46f1dd98b8a0de3dbc263e27 | 1 + .../5379a32e4c352269081cc43677c888ade78ad84d | 1 + .../551e9106af1af7c240d53f57034d4d84585321ba | 1 + .../58453a66b6f4b02dc2f6b71a3826d2ab15283ed5 | 1 + .../58695d98c93e6a4a095a379402e7e446ad662866 | 1 + .../6504fa809c4ef723fb4e340ed8b1a1109ddd2d27 | 1 + .../7083d129ca9b20d8786cb84794de51a55c8c0a78 | 1 + .../736273f779566a6251c43695ded17446451c308d | 1 + .../769ec27fad26c186edfe4a4772d01fda9f2f41f4 | 1 + .../791ebde66195b582a15b7eb765dfc5ade65855ec | 1 + .../818eb014b8680fa93937d2de23ae56cb61053707 | 1 + .../8515ad1026cc0e3e798e9dd18a5c71996f45c6d1 | 1 + .../8574e5161dcc5d8072d7d143fb60eabce4586510 | 1 + .../876387dbc7da936ea49bd91733a24b9b5840cd94 | 1 + .../8b3f500194eb49631e42e437bfe2c6322dbdf170 | 1 + .../96307a5e21873e5dec6d65b3189c9c0f9723e60e | 1 + .../969d5c011737a5133b0a0888cbaebe797f92aaff | 1 + .../a29f9609dfbc9f6606afe35bf15b66270b264af1 | 1 + .../a7b947332bceb0b23c2514f9a7902b4d4bf8787c | 1 + .../aa3764a455640e0b10c311c7e12d4953b5bb688d | 1 + .../aa581855220e27c90afe295422bed91ba6b09b49 | 1 + .../b01dd824a4e7f84204f252f9f07942c96e5987be | 1 + .../b176cd41a25c41d03119e60722de8a59de7380cd | 1 + .../b818ef71be46591872b143b73edaf5bb169cf738 | 1 + .../c2b4acdf04de6d9b3090ce53f1eedb271b4521b4 | 1 + .../c4224de29e8af762aa3366718cf78d9f22e6a952 | 1 + .../c710e5c8cbc136d90e0864e2c324e73ef551fa02 | 1 + .../c9994122bab4a224b0693a0f0afe0999d6243bd0 | 1 + .../d53de71f84fc736ccd92111f3145ed397a4a0c5b | 1 + .../d567dc75d5206a6c4c10363abac6ba0ac0647f90 | 1 + .../d70bc12934e602f1c0ff69877eea812361815c7b | 1 + .../da39a3ee5e6b4b0d3255bfef95601890afd80709 | 0 .../dd496a97ddf4f0751754ce8ea5e6f9f2f7e8b1fc | 1 + .../dd863690b2baffe7603c63f2b8b79ef250ed9284 | 1 + .../e1341334b199a52d8df572a7f7e7be114c49c8ad | 1 + .../e6386dd43f082a50010aa5966a6124897c1e9af9 | 1 + .../e86907bac8944cebb9306686b49ad1e347e300e9 | 1 + .../ef4a9549e0417a4d1a3a2c68cda4ec174b18f32c | 1 + .../efae0acc409a5e23086330eb57212c97f7475d07 | 1 + .../f0d40d34239aa16c91e82595c054020821a4a72d | 1 + .../f7bcf8548832b05080e1f00cd1033ac0917d236 | 1 + .../fb6fb497af895f16327d3aa71d2eb1500a43cec1 | 1 + Makefile | 113 ++ RSBcode.mc3 | 386 ++++ RSBcode.mc3.bak0 | 133 ++ main.c | 48 + mcc-manifest-autosave.yml | 30 + mcc-manifest-generated-success.yml | 30 + mcc_generated_files/spi/spi0.h | 176 ++ mcc_generated_files/spi/spi_interface.h | 65 + mcc_generated_files/spi/spi_polling_types.h | 49 + mcc_generated_files/spi/src/spi0.c | 240 +++ mcc_generated_files/system/ccp.h | 72 + mcc_generated_files/system/clock.h | 70 + mcc_generated_files/system/config_bits.h | 44 + mcc_generated_files/system/interrupt.h | 57 + mcc_generated_files/system/pins.h | 608 ++++++ mcc_generated_files/system/port.h | 902 +++++++++ mcc_generated_files/system/protected_io.h | 80 + mcc_generated_files/system/src/clock.c | 105 ++ mcc_generated_files/system/src/config_bits.c | 50 + mcc_generated_files/system/src/interrupt.c | 53 + mcc_generated_files/system/src/pins.c | 393 ++++ mcc_generated_files/system/src/protected_io.S | 90 + mcc_generated_files/system/src/syscfg.c | 64 + mcc_generated_files/system/src/system.c | 47 + mcc_generated_files/system/syscfg.h | 83 + mcc_generated_files/system/system.h | 66 + mcc_generated_files/system/utils/assembler.h | 49 + mcc_generated_files/system/utils/assembler/gas.h | 120 ++ mcc_generated_files/system/utils/assembler/iar.h | 104 ++ mcc_generated_files/system/utils/atomic.h | 87 + mcc_generated_files/system/utils/compiler.h | 72 + mcc_generated_files/system/utils/interrupt_avr8.h | 88 + mcc_generated_files/system/utils/utils.h | 52 + mcc_generated_files/system/utils/utils_assert.h | 60 + mcc_generated_files/usb/src/usb0.c | 89 + mcc_generated_files/usb/usb0.h | 74 + .../usb/usb_common/usb_common_elements.h | 99 + mcc_generated_files/usb/usb_common/usb_core.c | 212 +++ mcc_generated_files/usb/usb_common/usb_core.h | 95 + .../usb/usb_common/usb_core_descriptors.c | 658 +++++++ .../usb/usb_common/usb_core_descriptors.h | 181 ++ .../usb/usb_common/usb_core_events.c | 170 ++ .../usb/usb_common/usb_core_events.h | 158 ++ .../usb/usb_common/usb_core_requests.c | 194 ++ .../usb/usb_common/usb_core_requests.h | 105 ++ .../usb/usb_common/usb_core_requests_device.c | 181 ++ .../usb/usb_common/usb_core_requests_device.h | 107 ++ .../usb/usb_common/usb_core_requests_endpoint.c | 137 ++ .../usb/usb_common/usb_core_requests_endpoint.h | 84 + .../usb/usb_common/usb_core_requests_interface.c | 145 ++ .../usb/usb_common/usb_core_requests_interface.h | 101 + .../usb/usb_common/usb_core_transfer.c | 175 ++ .../usb/usb_common/usb_core_transfer.h | 116 ++ .../usb/usb_common/usb_protocol_headers.h | 660 +++++++ mcc_generated_files/usb/usb_config.h | 118 ++ mcc_generated_files/usb/usb_descriptors.c | 157 ++ mcc_generated_files/usb/usb_descriptors.h | 117 ++ mcc_generated_files/usb/usb_device.c | 95 + mcc_generated_files/usb/usb_device.h | 75 + .../usb/usb_peripheral/usb_peripheral.c | 646 +++++++ .../usb/usb_peripheral/usb_peripheral.h | 336 ++++ .../usb/usb_peripheral/usb_peripheral_avr_du.h | 1930 ++++++++++++++++++++ .../usb/usb_peripheral/usb_peripheral_endpoint.c | 510 ++++++ .../usb/usb_peripheral/usb_peripheral_endpoint.h | 171 ++ .../usb/usb_peripheral/usb_peripheral_read_write.c | 484 +++++ .../usb/usb_peripheral/usb_peripheral_read_write.h | 222 +++ mcc_generated_files/usb/usb_vendor/usb_vendor.c | 41 + mcc_generated_files/usb/usb_vendor/usb_vendor.h | 52 + nbproject/Makefile-default.mk | 430 +++++ nbproject/Makefile-genesis.properties | 13 + nbproject/Makefile-impl.mk | 69 + nbproject/Makefile-local-default.mk | 36 + nbproject/Makefile-variables.mk | 10 + nbproject/configurations.xml | 295 +++ nbproject/private/configurations.xml | 25 + nbproject/private/private.xml | 18 + nbproject/project.xml | 23 + 126 files changed, 14348 insertions(+) create mode 100644 .generated_files/flags/default/119ea452f4fc9dce5d9ccac4a50e055b7722276c create mode 100644 .generated_files/flags/default/13b7dbf04d4f86cc33dea191f2580790a7e4cb41 create mode 100644 .generated_files/flags/default/1f7a1067d2a8525ae9d220271878efb282359c5 create mode 100644 .generated_files/flags/default/37635bba81897aff7ba7962b372638677124c269 create mode 100644 .generated_files/flags/default/3f72406f95220d42b2256b0f1706819179cc130d create mode 100644 .generated_files/flags/default/444664807302b43af5c2b42a24470e83cb158c7a create mode 100644 .generated_files/flags/default/447d79eece8821c8ff3d9313d70bc8ac3b644e52 create mode 100644 .generated_files/flags/default/49ec2b1ac283e98f46f1dd98b8a0de3dbc263e27 create mode 100644 .generated_files/flags/default/5379a32e4c352269081cc43677c888ade78ad84d create mode 100644 .generated_files/flags/default/551e9106af1af7c240d53f57034d4d84585321ba create mode 100644 .generated_files/flags/default/58453a66b6f4b02dc2f6b71a3826d2ab15283ed5 create mode 100644 .generated_files/flags/default/58695d98c93e6a4a095a379402e7e446ad662866 create mode 100644 .generated_files/flags/default/6504fa809c4ef723fb4e340ed8b1a1109ddd2d27 create mode 100644 .generated_files/flags/default/7083d129ca9b20d8786cb84794de51a55c8c0a78 create mode 100644 .generated_files/flags/default/736273f779566a6251c43695ded17446451c308d create mode 100644 .generated_files/flags/default/769ec27fad26c186edfe4a4772d01fda9f2f41f4 create mode 100644 .generated_files/flags/default/791ebde66195b582a15b7eb765dfc5ade65855ec create mode 100644 .generated_files/flags/default/818eb014b8680fa93937d2de23ae56cb61053707 create mode 100644 .generated_files/flags/default/8515ad1026cc0e3e798e9dd18a5c71996f45c6d1 create mode 100644 .generated_files/flags/default/8574e5161dcc5d8072d7d143fb60eabce4586510 create mode 100644 .generated_files/flags/default/876387dbc7da936ea49bd91733a24b9b5840cd94 create mode 100644 .generated_files/flags/default/8b3f500194eb49631e42e437bfe2c6322dbdf170 create mode 100644 .generated_files/flags/default/96307a5e21873e5dec6d65b3189c9c0f9723e60e create mode 100644 .generated_files/flags/default/969d5c011737a5133b0a0888cbaebe797f92aaff create mode 100644 .generated_files/flags/default/a29f9609dfbc9f6606afe35bf15b66270b264af1 create mode 100644 .generated_files/flags/default/a7b947332bceb0b23c2514f9a7902b4d4bf8787c create mode 100644 .generated_files/flags/default/aa3764a455640e0b10c311c7e12d4953b5bb688d create mode 100644 .generated_files/flags/default/aa581855220e27c90afe295422bed91ba6b09b49 create mode 100644 .generated_files/flags/default/b01dd824a4e7f84204f252f9f07942c96e5987be create mode 100644 .generated_files/flags/default/b176cd41a25c41d03119e60722de8a59de7380cd create mode 100644 .generated_files/flags/default/b818ef71be46591872b143b73edaf5bb169cf738 create mode 100644 .generated_files/flags/default/c2b4acdf04de6d9b3090ce53f1eedb271b4521b4 create mode 100644 .generated_files/flags/default/c4224de29e8af762aa3366718cf78d9f22e6a952 create mode 100644 .generated_files/flags/default/c710e5c8cbc136d90e0864e2c324e73ef551fa02 create mode 100644 .generated_files/flags/default/c9994122bab4a224b0693a0f0afe0999d6243bd0 create mode 100644 .generated_files/flags/default/d53de71f84fc736ccd92111f3145ed397a4a0c5b create mode 100644 .generated_files/flags/default/d567dc75d5206a6c4c10363abac6ba0ac0647f90 create mode 100644 .generated_files/flags/default/d70bc12934e602f1c0ff69877eea812361815c7b create mode 100644 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 create mode 100644 .generated_files/flags/default/dd496a97ddf4f0751754ce8ea5e6f9f2f7e8b1fc create mode 100644 .generated_files/flags/default/dd863690b2baffe7603c63f2b8b79ef250ed9284 create mode 100644 .generated_files/flags/default/e1341334b199a52d8df572a7f7e7be114c49c8ad create mode 100644 .generated_files/flags/default/e6386dd43f082a50010aa5966a6124897c1e9af9 create mode 100644 .generated_files/flags/default/e86907bac8944cebb9306686b49ad1e347e300e9 create mode 100644 .generated_files/flags/default/ef4a9549e0417a4d1a3a2c68cda4ec174b18f32c create mode 100644 .generated_files/flags/default/efae0acc409a5e23086330eb57212c97f7475d07 create mode 100644 .generated_files/flags/default/f0d40d34239aa16c91e82595c054020821a4a72d create mode 100644 .generated_files/flags/default/f7bcf8548832b05080e1f00cd1033ac0917d236 create mode 100644 .generated_files/flags/default/fb6fb497af895f16327d3aa71d2eb1500a43cec1 create mode 100644 Makefile create mode 100644 RSBcode.mc3 create mode 100644 RSBcode.mc3.bak0 create mode 100644 main.c create mode 100644 mcc-manifest-autosave.yml create mode 100644 mcc-manifest-generated-success.yml create mode 100644 mcc_generated_files/spi/spi0.h create mode 100644 mcc_generated_files/spi/spi_interface.h create mode 100644 mcc_generated_files/spi/spi_polling_types.h create mode 100644 mcc_generated_files/spi/src/spi0.c create mode 100644 mcc_generated_files/system/ccp.h create mode 100644 mcc_generated_files/system/clock.h create mode 100644 mcc_generated_files/system/config_bits.h create mode 100644 mcc_generated_files/system/interrupt.h create mode 100644 mcc_generated_files/system/pins.h create mode 100644 mcc_generated_files/system/port.h create mode 100644 mcc_generated_files/system/protected_io.h create mode 100644 mcc_generated_files/system/src/clock.c create mode 100644 mcc_generated_files/system/src/config_bits.c create mode 100644 mcc_generated_files/system/src/interrupt.c create mode 100644 mcc_generated_files/system/src/pins.c create mode 100644 mcc_generated_files/system/src/protected_io.S create mode 100644 mcc_generated_files/system/src/syscfg.c create mode 100644 mcc_generated_files/system/src/system.c create mode 100644 mcc_generated_files/system/syscfg.h create mode 100644 mcc_generated_files/system/system.h create mode 100644 mcc_generated_files/system/utils/assembler.h create mode 100644 mcc_generated_files/system/utils/assembler/gas.h create mode 100644 mcc_generated_files/system/utils/assembler/iar.h create mode 100644 mcc_generated_files/system/utils/atomic.h create mode 100644 mcc_generated_files/system/utils/compiler.h create mode 100644 mcc_generated_files/system/utils/interrupt_avr8.h create mode 100644 mcc_generated_files/system/utils/utils.h create mode 100644 mcc_generated_files/system/utils/utils_assert.h create mode 100644 mcc_generated_files/usb/src/usb0.c create mode 100644 mcc_generated_files/usb/usb0.h create mode 100644 mcc_generated_files/usb/usb_common/usb_common_elements.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_descriptors.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_descriptors.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_events.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_events.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests_device.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests_device.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests_interface.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_requests_interface.h create mode 100644 mcc_generated_files/usb/usb_common/usb_core_transfer.c create mode 100644 mcc_generated_files/usb/usb_common/usb_core_transfer.h create mode 100644 mcc_generated_files/usb/usb_common/usb_protocol_headers.h create mode 100644 mcc_generated_files/usb/usb_config.h create mode 100644 mcc_generated_files/usb/usb_descriptors.c create mode 100644 mcc_generated_files/usb/usb_descriptors.h create mode 100644 mcc_generated_files/usb/usb_device.c create mode 100644 mcc_generated_files/usb/usb_device.h create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral.c create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral.h create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral_avr_du.h create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.h create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c create mode 100644 mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.h create mode 100644 mcc_generated_files/usb/usb_vendor/usb_vendor.c create mode 100644 mcc_generated_files/usb/usb_vendor/usb_vendor.h create mode 100644 nbproject/Makefile-default.mk create mode 100644 nbproject/Makefile-genesis.properties create mode 100644 nbproject/Makefile-impl.mk create mode 100644 nbproject/Makefile-local-default.mk create mode 100644 nbproject/Makefile-variables.mk create mode 100644 nbproject/configurations.xml create mode 100644 nbproject/private/configurations.xml create mode 100644 nbproject/private/private.xml create mode 100644 nbproject/project.xml diff --git a/.generated_files/flags/default/119ea452f4fc9dce5d9ccac4a50e055b7722276c b/.generated_files/flags/default/119ea452f4fc9dce5d9ccac4a50e055b7722276c new file mode 100644 index 0000000..2e91c76 --- /dev/null +++ b/.generated_files/flags/default/119ea452f4fc9dce5d9ccac4a50e055b7722276c @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/syscfg.c \ No newline at end of file diff --git a/.generated_files/flags/default/13b7dbf04d4f86cc33dea191f2580790a7e4cb41 b/.generated_files/flags/default/13b7dbf04d4f86cc33dea191f2580790a7e4cb41 new file mode 100644 index 0000000..7f3a9e4 --- /dev/null +++ b/.generated_files/flags/default/13b7dbf04d4f86cc33dea191f2580790a7e4cb41 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_vendor/usb_vendor.c \ No newline at end of file diff --git a/.generated_files/flags/default/1f7a1067d2a8525ae9d220271878efb282359c5 b/.generated_files/flags/default/1f7a1067d2a8525ae9d220271878efb282359c5 new file mode 100644 index 0000000..0a02527 --- /dev/null +++ b/.generated_files/flags/default/1f7a1067d2a8525ae9d220271878efb282359c5 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/src/usb0.c \ No newline at end of file diff --git a/.generated_files/flags/default/37635bba81897aff7ba7962b372638677124c269 b/.generated_files/flags/default/37635bba81897aff7ba7962b372638677124c269 new file mode 100644 index 0000000..7c26aef --- /dev/null +++ b/.generated_files/flags/default/37635bba81897aff7ba7962b372638677124c269 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/main.c \ No newline at end of file diff --git a/.generated_files/flags/default/3f72406f95220d42b2256b0f1706819179cc130d b/.generated_files/flags/default/3f72406f95220d42b2256b0f1706819179cc130d new file mode 100644 index 0000000..582ba59 --- /dev/null +++ b/.generated_files/flags/default/3f72406f95220d42b2256b0f1706819179cc130d @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_events.c \ No newline at end of file diff --git a/.generated_files/flags/default/444664807302b43af5c2b42a24470e83cb158c7a b/.generated_files/flags/default/444664807302b43af5c2b42a24470e83cb158c7a new file mode 100644 index 0000000..78aef31 --- /dev/null +++ b/.generated_files/flags/default/444664807302b43af5c2b42a24470e83cb158c7a @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/pins.c \ No newline at end of file diff --git a/.generated_files/flags/default/447d79eece8821c8ff3d9313d70bc8ac3b644e52 b/.generated_files/flags/default/447d79eece8821c8ff3d9313d70bc8ac3b644e52 new file mode 100644 index 0000000..de3c39b --- /dev/null +++ b/.generated_files/flags/default/447d79eece8821c8ff3d9313d70bc8ac3b644e52 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/syscfg.c \ No newline at end of file diff --git a/.generated_files/flags/default/49ec2b1ac283e98f46f1dd98b8a0de3dbc263e27 b/.generated_files/flags/default/49ec2b1ac283e98f46f1dd98b8a0de3dbc263e27 new file mode 100644 index 0000000..76c8cf1 --- /dev/null +++ b/.generated_files/flags/default/49ec2b1ac283e98f46f1dd98b8a0de3dbc263e27 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_device.c \ No newline at end of file diff --git a/.generated_files/flags/default/5379a32e4c352269081cc43677c888ade78ad84d b/.generated_files/flags/default/5379a32e4c352269081cc43677c888ade78ad84d new file mode 100644 index 0000000..0d9dee4 --- /dev/null +++ b/.generated_files/flags/default/5379a32e4c352269081cc43677c888ade78ad84d @@ -0,0 +1 @@ + -c $(MP_EXTRA_AS_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -x assembler-with-cpp -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -Wa,--defsym=__MPLAB_BUILD=1 /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/protected_io.S \ No newline at end of file diff --git a/.generated_files/flags/default/551e9106af1af7c240d53f57034d4d84585321ba b/.generated_files/flags/default/551e9106af1af7c240d53f57034d4d84585321ba new file mode 100644 index 0000000..e339cc7 --- /dev/null +++ b/.generated_files/flags/default/551e9106af1af7c240d53f57034d4d84585321ba @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/system.c \ No newline at end of file diff --git a/.generated_files/flags/default/58453a66b6f4b02dc2f6b71a3826d2ab15283ed5 b/.generated_files/flags/default/58453a66b6f4b02dc2f6b71a3826d2ab15283ed5 new file mode 100644 index 0000000..96b3e39 --- /dev/null +++ b/.generated_files/flags/default/58453a66b6f4b02dc2f6b71a3826d2ab15283ed5 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests.c \ No newline at end of file diff --git a/.generated_files/flags/default/58695d98c93e6a4a095a379402e7e446ad662866 b/.generated_files/flags/default/58695d98c93e6a4a095a379402e7e446ad662866 new file mode 100644 index 0000000..bdf5100 --- /dev/null +++ b/.generated_files/flags/default/58695d98c93e6a4a095a379402e7e446ad662866 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_descriptors.c \ No newline at end of file diff --git a/.generated_files/flags/default/6504fa809c4ef723fb4e340ed8b1a1109ddd2d27 b/.generated_files/flags/default/6504fa809c4ef723fb4e340ed8b1a1109ddd2d27 new file mode 100644 index 0000000..ab678eb --- /dev/null +++ b/.generated_files/flags/default/6504fa809c4ef723fb4e340ed8b1a1109ddd2d27 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_descriptors.c \ No newline at end of file diff --git a/.generated_files/flags/default/7083d129ca9b20d8786cb84794de51a55c8c0a78 b/.generated_files/flags/default/7083d129ca9b20d8786cb84794de51a55c8c0a78 new file mode 100644 index 0000000..0193d15 --- /dev/null +++ b/.generated_files/flags/default/7083d129ca9b20d8786cb84794de51a55c8c0a78 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core.c \ No newline at end of file diff --git a/.generated_files/flags/default/736273f779566a6251c43695ded17446451c308d b/.generated_files/flags/default/736273f779566a6251c43695ded17446451c308d new file mode 100644 index 0000000..8efa5c4 --- /dev/null +++ b/.generated_files/flags/default/736273f779566a6251c43695ded17446451c308d @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/pins.c \ No newline at end of file diff --git a/.generated_files/flags/default/769ec27fad26c186edfe4a4772d01fda9f2f41f4 b/.generated_files/flags/default/769ec27fad26c186edfe4a4772d01fda9f2f41f4 new file mode 100644 index 0000000..b028038 --- /dev/null +++ b/.generated_files/flags/default/769ec27fad26c186edfe4a4772d01fda9f2f41f4 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests_device.c \ No newline at end of file diff --git a/.generated_files/flags/default/791ebde66195b582a15b7eb765dfc5ade65855ec b/.generated_files/flags/default/791ebde66195b582a15b7eb765dfc5ade65855ec new file mode 100644 index 0000000..fbf1b66 --- /dev/null +++ b/.generated_files/flags/default/791ebde66195b582a15b7eb765dfc5ade65855ec @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/interrupt.c \ No newline at end of file diff --git a/.generated_files/flags/default/818eb014b8680fa93937d2de23ae56cb61053707 b/.generated_files/flags/default/818eb014b8680fa93937d2de23ae56cb61053707 new file mode 100644 index 0000000..e8e9fd6 --- /dev/null +++ b/.generated_files/flags/default/818eb014b8680fa93937d2de23ae56cb61053707 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/src/usb0.c \ No newline at end of file diff --git a/.generated_files/flags/default/8515ad1026cc0e3e798e9dd18a5c71996f45c6d1 b/.generated_files/flags/default/8515ad1026cc0e3e798e9dd18a5c71996f45c6d1 new file mode 100644 index 0000000..b553f04 --- /dev/null +++ b/.generated_files/flags/default/8515ad1026cc0e3e798e9dd18a5c71996f45c6d1 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_device.c \ No newline at end of file diff --git a/.generated_files/flags/default/8574e5161dcc5d8072d7d143fb60eabce4586510 b/.generated_files/flags/default/8574e5161dcc5d8072d7d143fb60eabce4586510 new file mode 100644 index 0000000..9e4d670 --- /dev/null +++ b/.generated_files/flags/default/8574e5161dcc5d8072d7d143fb60eabce4586510 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/clock.c \ No newline at end of file diff --git a/.generated_files/flags/default/876387dbc7da936ea49bd91733a24b9b5840cd94 b/.generated_files/flags/default/876387dbc7da936ea49bd91733a24b9b5840cd94 new file mode 100644 index 0000000..38de15b --- /dev/null +++ b/.generated_files/flags/default/876387dbc7da936ea49bd91733a24b9b5840cd94 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c \ No newline at end of file diff --git a/.generated_files/flags/default/8b3f500194eb49631e42e437bfe2c6322dbdf170 b/.generated_files/flags/default/8b3f500194eb49631e42e437bfe2c6322dbdf170 new file mode 100644 index 0000000..d7cf1f3 --- /dev/null +++ b/.generated_files/flags/default/8b3f500194eb49631e42e437bfe2c6322dbdf170 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c \ No newline at end of file diff --git a/.generated_files/flags/default/96307a5e21873e5dec6d65b3189c9c0f9723e60e b/.generated_files/flags/default/96307a5e21873e5dec6d65b3189c9c0f9723e60e new file mode 100644 index 0000000..a802c7b --- /dev/null +++ b/.generated_files/flags/default/96307a5e21873e5dec6d65b3189c9c0f9723e60e @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests_interface.c \ No newline at end of file diff --git a/.generated_files/flags/default/969d5c011737a5133b0a0888cbaebe797f92aaff b/.generated_files/flags/default/969d5c011737a5133b0a0888cbaebe797f92aaff new file mode 100644 index 0000000..d34001f --- /dev/null +++ b/.generated_files/flags/default/969d5c011737a5133b0a0888cbaebe797f92aaff @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c \ No newline at end of file diff --git a/.generated_files/flags/default/a29f9609dfbc9f6606afe35bf15b66270b264af1 b/.generated_files/flags/default/a29f9609dfbc9f6606afe35bf15b66270b264af1 new file mode 100644 index 0000000..31a7ac4 --- /dev/null +++ b/.generated_files/flags/default/a29f9609dfbc9f6606afe35bf15b66270b264af1 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_events.c \ No newline at end of file diff --git a/.generated_files/flags/default/a7b947332bceb0b23c2514f9a7902b4d4bf8787c b/.generated_files/flags/default/a7b947332bceb0b23c2514f9a7902b4d4bf8787c new file mode 100644 index 0000000..0780cc8 --- /dev/null +++ b/.generated_files/flags/default/a7b947332bceb0b23c2514f9a7902b4d4bf8787c @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/config_bits.c \ No newline at end of file diff --git a/.generated_files/flags/default/aa3764a455640e0b10c311c7e12d4953b5bb688d b/.generated_files/flags/default/aa3764a455640e0b10c311c7e12d4953b5bb688d new file mode 100644 index 0000000..08daa18 --- /dev/null +++ b/.generated_files/flags/default/aa3764a455640e0b10c311c7e12d4953b5bb688d @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/interrupt.c \ No newline at end of file diff --git a/.generated_files/flags/default/aa581855220e27c90afe295422bed91ba6b09b49 b/.generated_files/flags/default/aa581855220e27c90afe295422bed91ba6b09b49 new file mode 100644 index 0000000..4e936ac --- /dev/null +++ b/.generated_files/flags/default/aa581855220e27c90afe295422bed91ba6b09b49 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/config_bits.c \ No newline at end of file diff --git a/.generated_files/flags/default/b01dd824a4e7f84204f252f9f07942c96e5987be b/.generated_files/flags/default/b01dd824a4e7f84204f252f9f07942c96e5987be new file mode 100644 index 0000000..ca9e5b0 --- /dev/null +++ b/.generated_files/flags/default/b01dd824a4e7f84204f252f9f07942c96e5987be @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_peripheral/usb_peripheral.c \ No newline at end of file diff --git a/.generated_files/flags/default/b176cd41a25c41d03119e60722de8a59de7380cd b/.generated_files/flags/default/b176cd41a25c41d03119e60722de8a59de7380cd new file mode 100644 index 0000000..2819074 --- /dev/null +++ b/.generated_files/flags/default/b176cd41a25c41d03119e60722de8a59de7380cd @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/spi/src/spi0.c \ No newline at end of file diff --git a/.generated_files/flags/default/b818ef71be46591872b143b73edaf5bb169cf738 b/.generated_files/flags/default/b818ef71be46591872b143b73edaf5bb169cf738 new file mode 100644 index 0000000..d8258be --- /dev/null +++ b/.generated_files/flags/default/b818ef71be46591872b143b73edaf5bb169cf738 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_vendor/usb_vendor.c \ No newline at end of file diff --git a/.generated_files/flags/default/c2b4acdf04de6d9b3090ce53f1eedb271b4521b4 b/.generated_files/flags/default/c2b4acdf04de6d9b3090ce53f1eedb271b4521b4 new file mode 100644 index 0000000..b73b550 --- /dev/null +++ b/.generated_files/flags/default/c2b4acdf04de6d9b3090ce53f1eedb271b4521b4 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/clock.c \ No newline at end of file diff --git a/.generated_files/flags/default/c4224de29e8af762aa3366718cf78d9f22e6a952 b/.generated_files/flags/default/c4224de29e8af762aa3366718cf78d9f22e6a952 new file mode 100644 index 0000000..f0b94db --- /dev/null +++ b/.generated_files/flags/default/c4224de29e8af762aa3366718cf78d9f22e6a952 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests_interface.c \ No newline at end of file diff --git a/.generated_files/flags/default/c710e5c8cbc136d90e0864e2c324e73ef551fa02 b/.generated_files/flags/default/c710e5c8cbc136d90e0864e2c324e73ef551fa02 new file mode 100644 index 0000000..bc9eed6 --- /dev/null +++ b/.generated_files/flags/default/c710e5c8cbc136d90e0864e2c324e73ef551fa02 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c \ No newline at end of file diff --git a/.generated_files/flags/default/c9994122bab4a224b0693a0f0afe0999d6243bd0 b/.generated_files/flags/default/c9994122bab4a224b0693a0f0afe0999d6243bd0 new file mode 100644 index 0000000..7da16d0 --- /dev/null +++ b/.generated_files/flags/default/c9994122bab4a224b0693a0f0afe0999d6243bd0 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests_device.c \ No newline at end of file diff --git a/.generated_files/flags/default/d53de71f84fc736ccd92111f3145ed397a4a0c5b b/.generated_files/flags/default/d53de71f84fc736ccd92111f3145ed397a4a0c5b new file mode 100644 index 0000000..077b5ab --- /dev/null +++ b/.generated_files/flags/default/d53de71f84fc736ccd92111f3145ed397a4a0c5b @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_peripheral/usb_peripheral.c \ No newline at end of file diff --git a/.generated_files/flags/default/d567dc75d5206a6c4c10363abac6ba0ac0647f90 b/.generated_files/flags/default/d567dc75d5206a6c4c10363abac6ba0ac0647f90 new file mode 100644 index 0000000..6afa654 --- /dev/null +++ b/.generated_files/flags/default/d567dc75d5206a6c4c10363abac6ba0ac0647f90 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_descriptors.c \ No newline at end of file diff --git a/.generated_files/flags/default/d70bc12934e602f1c0ff69877eea812361815c7b b/.generated_files/flags/default/d70bc12934e602f1c0ff69877eea812361815c7b new file mode 100644 index 0000000..fc20419 --- /dev/null +++ b/.generated_files/flags/default/d70bc12934e602f1c0ff69877eea812361815c7b @@ -0,0 +1 @@ + -c $(MP_EXTRA_AS_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x assembler-with-cpp -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -Wa,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/protected_io.S \ No newline at end of file diff --git a/.generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 b/.generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 new file mode 100644 index 0000000..e69de29 diff --git a/.generated_files/flags/default/dd496a97ddf4f0751754ce8ea5e6f9f2f7e8b1fc b/.generated_files/flags/default/dd496a97ddf4f0751754ce8ea5e6f9f2f7e8b1fc new file mode 100644 index 0000000..ee1035a --- /dev/null +++ b/.generated_files/flags/default/dd496a97ddf4f0751754ce8ea5e6f9f2f7e8b1fc @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/main.c \ No newline at end of file diff --git a/.generated_files/flags/default/dd863690b2baffe7603c63f2b8b79ef250ed9284 b/.generated_files/flags/default/dd863690b2baffe7603c63f2b8b79ef250ed9284 new file mode 100644 index 0000000..0df9538 --- /dev/null +++ b/.generated_files/flags/default/dd863690b2baffe7603c63f2b8b79ef250ed9284 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/system.c \ No newline at end of file diff --git a/.generated_files/flags/default/e1341334b199a52d8df572a7f7e7be114c49c8ad b/.generated_files/flags/default/e1341334b199a52d8df572a7f7e7be114c49c8ad new file mode 100644 index 0000000..96dd8f5 --- /dev/null +++ b/.generated_files/flags/default/e1341334b199a52d8df572a7f7e7be114c49c8ad @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_transfer.c \ No newline at end of file diff --git a/.generated_files/flags/default/e6386dd43f082a50010aa5966a6124897c1e9af9 b/.generated_files/flags/default/e6386dd43f082a50010aa5966a6124897c1e9af9 new file mode 100644 index 0000000..b484b8a --- /dev/null +++ b/.generated_files/flags/default/e6386dd43f082a50010aa5966a6124897c1e9af9 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_transfer.c \ No newline at end of file diff --git a/.generated_files/flags/default/e86907bac8944cebb9306686b49ad1e347e300e9 b/.generated_files/flags/default/e86907bac8944cebb9306686b49ad1e347e300e9 new file mode 100644 index 0000000..99bcaf2 --- /dev/null +++ b/.generated_files/flags/default/e86907bac8944cebb9306686b49ad1e347e300e9 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c \ No newline at end of file diff --git a/.generated_files/flags/default/ef4a9549e0417a4d1a3a2c68cda4ec174b18f32c b/.generated_files/flags/default/ef4a9549e0417a4d1a3a2c68cda4ec174b18f32c new file mode 100644 index 0000000..38ebca3 --- /dev/null +++ b/.generated_files/flags/default/ef4a9549e0417a4d1a3a2c68cda4ec174b18f32c @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests.c \ No newline at end of file diff --git a/.generated_files/flags/default/efae0acc409a5e23086330eb57212c97f7475d07 b/.generated_files/flags/default/efae0acc409a5e23086330eb57212c97f7475d07 new file mode 100644 index 0000000..3d29c4c --- /dev/null +++ b/.generated_files/flags/default/efae0acc409a5e23086330eb57212c97f7475d07 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/spi/src/spi0.c \ No newline at end of file diff --git a/.generated_files/flags/default/f0d40d34239aa16c91e82595c054020821a4a72d b/.generated_files/flags/default/f0d40d34239aa16c91e82595c054020821a4a72d new file mode 100644 index 0000000..db926b8 --- /dev/null +++ b/.generated_files/flags/default/f0d40d34239aa16c91e82595c054020821a4a72d @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c \ No newline at end of file diff --git a/.generated_files/flags/default/f7bcf8548832b05080e1f00cd1033ac0917d236 b/.generated_files/flags/default/f7bcf8548832b05080e1f00cd1033ac0917d236 new file mode 100644 index 0000000..b7d0280 --- /dev/null +++ b/.generated_files/flags/default/f7bcf8548832b05080e1f00cd1033ac0917d236 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core_descriptors.c \ No newline at end of file diff --git a/.generated_files/flags/default/fb6fb497af895f16327d3aa71d2eb1500a43cec1 b/.generated_files/flags/default/fb6fb497af895f16327d3aa71d2eb1500a43cec1 new file mode 100644 index 0000000..3ca3aba --- /dev/null +++ b/.generated_files/flags/default/fb6fb497af895f16327d3aa71d2eb1500a43cec1 @@ -0,0 +1 @@ + $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem /home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/usb/usb_common/usb_core.c \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fca8e2c --- /dev/null +++ b/Makefile @@ -0,0 +1,113 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin +RANLIB=ranlib + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... +# WARNING: the IDE does not call this target since it takes a long time to +# simply run make. Instead, the IDE removes the configuration directories +# under build and dist directly without calling make. +# This target is left here so people can do a clean when running a clean +# outside the IDE. + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/RSBcode.mc3 b/RSBcode.mc3 new file mode 100644 index 0000000..e0df77a --- /dev/null +++ b/RSBcode.mc3 @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Application Builder + class com.microchip.mcc.melody.module.FrameworkModule + + + CLKCTRL + class com.microchip.mcc.melody.hw.module.HardwareModule + + + CPUINT + class com.microchip.mcc.melody.hw.module.HardwareModule + + + Configuration Bits + class com.microchip.mcc.melody.hw.module.HardwareModule + + + MAIN MANAGER + class com.microchip.mcc.melody.hw.module.HardwareModule + + + Pin Manager + class com.microchip.mcc.melody.hw.module.HardwareModule + + + SPI0 + class com.microchip.mcc.melody.hw.module.HardwareModule + + + SYSCFG + class com.microchip.mcc.melody.hw.module.HardwareModule + + + USB0 + class com.microchip.mcc.melody.hw.module.HardwareModule + + + meta + class com.microchip.mcc.melody.hw.module.HardwareModule + + + module0 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module1 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module12 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module18 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module2 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module3 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module4 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module43 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module6 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module9 + class com.microchip.mcc.melody.script.module.ScriptModule + + + + + + + + + {} + + + + {"userAddedModules":["module43","module4","module6","module12","module1","module0","module3","module2"],"version":"CURRENT","modules":{"module43":{"scriptId":"@mchp-mcc/usb-device-stack","imports":{"usb_interface":{"interfaceId":{"name":"usb-interface","version":"^1.*"},"handle":{"providerId":"module18","exportId":"usb_interface"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module1","exportId":"initializer_system"}},"project_properties":{"interfaceId":{"name":"project-properties","version":"^1.*"},"handle":{"providerId":"com.microchip.mcc.melody.adapter.ProjectConfigurationAdapter","exportId":"project-properties"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"general":{"device":"Vendor"},"interrupts":{"interruptDriven":true}},"configs":{"interfaceTable":[{"intfKey":"intfGrp1","index":0.0,"rowId":1.0,"name":"Interface0Alternate1","interface":0.0,"altInterface":1.0}],"interfaces":[{"intfKey":"intfGrp1","index":0.0,"rowId":1.0,"name":"Interface0Alternate1","interface":0.0,"altInterface":1.0,"endpointTable":[{"endptNum":1.0,"direction":"IN","transferType":"Isochronous","syncType":"Asynchronous","usageType":"Data","packetSize":"64","interval":1.0,"mpEnable":false,"autoZlp":false,"rowId":"intfgrp1endpt0"}],"endpointCount":1.0,"class":"Vendor"}],"config1":{"selfPowered":true},"interfaceCount":1.0}}},"module4":{"scriptId":"@mchp-mcc/scf-avr8-interrupt-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"scf_avr8_interrupt_v1":{"interfaceId":{"name":"scf-avr8-interrupt-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CPUINT"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module1","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"interrupt":{"iSreg":true}}}},"module6":{"scriptId":"@mchp-mcc/scf-avr8-clkctrl-v3","imports":{"sys_init_basic_interface":{"interfaceId":{"name":"sys-init-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"sys_init_basic_interface"}},"pins_interface":{"interfaceId":{"name":"pins-interface","version":"^1"},"handle":{"providerId":"module3","exportId":"pins-interface"}},"scf_avr8_clkctrl_v3":{"interfaceId":{"name":"scf-avr8-clkctrl-v3","version":"^1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CLKCTRL"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"configbits_basic_interface":{"interfaceId":{"name":"configbits-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"configbits_basic_interface"}},"config_device":{"interfaceId":{"name":"config-device","version":"^1"},"handle":{"providerId":"module1","exportId":"config_device"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"hardware":{"clkselMclkctrla":"External clock","externalClk":2.4E7,"clkoutMclkctrla":true,"penMclkctrlb":false},"advanced":{"selhfXoschfctrla":"XTAL","enableXoschfctrla":true,"runstbyXoschfctrla":true,"autotuneOschfctrla":"OFF","frqrangeXoschfctrla":"24M","runstdbyOschfctrla":false,"enableXosc32kctrla":false},"software":{"unusedKey":""}}}},"module9":{"scriptId":"@mchp-mcc/scf-avr8-syscfg-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"^1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"sys_init_basic_interface":{"interfaceId":{"name":"sys-init-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"sys_init_basic_interface"}},"scf_avr8_syscfg_v1":{"interfaceId":{"name":"scf-avr8-syscfg-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"SYSCFG"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module12":{"scriptId":"@mchp-mcc/scf-avr8-spi-v1","imports":{"sys_init_basic_interface":{"interfaceId":{"name":"sys-init-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"sys_init_basic_interface"}},"scf_avr8_spi_v1":{"interfaceId":{"name":"scf-avr8-spi-v1","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"SPI0"}},"pins_interface":{"interfaceId":{"name":"pins-interface","version":"^1"},"handle":{"providerId":"module3","exportId":"pins-interface"}},"clock_basic_interface":{"interfaceId":{"name":"clock-basic-interface","version":"^1"},"handle":{"providerId":"module6","exportId":"clock_basic_interface"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"meta"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module18":{"scriptId":"@mchp-mcc/scf-avr8-usb-v1","imports":{"pins_interface":{"interfaceId":{"name":"pins-interface","version":"^1.*"},"handle":{"providerId":"module3","exportId":"pins-interface"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1.*"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"osc_clocks":{"interfaceId":{"name":"osc-clocks","version":"^0.*"},"handle":{"providerId":"module6","exportId":"osc_clocks"}},"syscfg_interface":{"interfaceId":{"name":"syscfg-usb-interface","version":"^1.*"},"handle":{"providerId":"module9","exportId":"syscfg_usb_interface"}},"scf_avr8_usb_v1":{"interfaceId":{"name":"scf-avr8-usb-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"USB0"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module1","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module1":{"scriptId":"@mchp-mcc/avr8-configuration-bits-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"initializer_main":{"interfaceId":{"name":"initializer-main","version":"^0.*"},"handle":{"providerId":"module0","exportId":"initializer_main"}},"avr8_configuration_bits_v1":{"interfaceId":{"name":"avr8-configuration-bits-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"Configuration Bits"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"SYSCFG0":{"rstpincfgSyscfg0":"Reset mode"}}}},"module0":{"scriptId":"@mchp-mcc/main-manager","imports":{"main":{"interfaceId":{"name":"main-manager","version":"^1.*"},"handle":{"providerId":"mccDevice","exportId":"MAIN MANAGER"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module3":{"scriptId":"@mchp-mcc/pin-content-processor","imports":{"device-meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"pin-architecture":{"interfaceId":{"name":"pin-architecture","version":"1.0.0"},"handle":{"providerId":"module2","exportId":"pin-architecture"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"saved":{"meta":{"module":"module9"},"rows":{"pcp":{"GPIO$GPIO$input":{"pins":{"PD0":{"state":"MUL"},"PD1":{"state":"MUL"},"PD2":{"state":"MUL"},"PD3":{"state":"MUL"},"PD4":{"state":"MUL"},"PD5":{"state":"MUL"},"PD6":{"state":"MUL"},"PA2":{"state":"MUL"},"PA3":{"state":"MUL"},"PD7":{"state":"MUL"}}},"GPIO$GPIO$output":{"pins":{"PD0":{"state":"L"},"PD1":{"state":"L"},"PD2":{"state":"L"},"PD3":{"state":"L"},"PD4":{"state":"L"},"PD5":{"state":"L"},"PD6":{"state":"L"},"PA2":{"state":"L"},"PA3":{"state":"L"},"PD7":{"state":"L"}}}}}}}},"module2":{"scriptId":"@mchp-mcc/avr8-pin-manager","imports":{"avr8-pin-manager":{"interfaceId":{"name":"avr8-pin-manager","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"Pin Manager"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module1","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}}},"content":{"@mchp-mcc/avr-8bit":"4.14.2","@mchp-mcc/scf-avr8-usb-v1":"1.0.0","@mchp-mcc/pin-content-processor":"3.11.0","@mchp-mcc/scf-avr8-syscfg-v1":"1.0.0","@mchp-mcc/avr8-pin-manager":"4.6.2","@mchp-mcc/scf-avr8-spi-v1":"5.1.0","@mchp-mcc/scf-avr8-clkctrl-v3":"2.0.10","@mchp-mcc/scf-avr8-interrupt-v1":"5.0.12","@mchp-mcc/main-manager":"3.1.2","@mchp-mcc/avr8-configuration-bits-v1":"4.3.0","@mchp-mcc/usb-device-stack":"1.1.0"}} + + + + + main.c + acecf8d74e3ab0b948d22b939feb5887c006d73bff970f37b9829e231be015c2 + + + mcc_generated_files/spi/spi0.h + 12c48657bf2b726299fb4c1ce2e205fb2162949e21d8c2f5cdee049315cb0fcf + + + mcc_generated_files/spi/spi_interface.h + 110edb2c873fe78cc19da22c55e714190e1daf41f2ff5390c3c9244779953754 + + + mcc_generated_files/spi/spi_polling_types.h + 05633391e96042ffa8a48cf9513894fe2d0d3a6e8711171cf77c42023763f465 + + + mcc_generated_files/spi/src/spi0.c + c10d795bfa660b9c708c4b8c0b7ba7e8f3cbc4e6bd482d269b39138a036ac8aa + + + mcc_generated_files/system/ccp.h + b559b52393dd1e0a4a86eb3c4d71bc07c5a6de7f9f9a12e1299b8debbc3b8755 + + + mcc_generated_files/system/clock.h + ab8ee96e4ff5d3b68fb145d93fb8a2fcb597da2337f412b296ac0812a3404242 + + + mcc_generated_files/system/config_bits.h + 27811c4674fbfcc5d2f4c334a03a4ad9ea4d84fd2c3fb8849bf80bf56d1e997e + + + mcc_generated_files/system/interrupt.h + 78aabc532c7cc2026519e7cc4c076a7e83ba2553c90fd2198ef7bafc39659d48 + + + mcc_generated_files/system/pins.h + 6428401b4798e4d7c648c0a330c237b622ea1957910ae5a9d52a5ef22d19c422 + + + mcc_generated_files/system/port.h + 642ca38937f0c843a3b6e443c71e134d74eb714d77c01c7d3a78d8fd5dd5c0f0 + + + mcc_generated_files/system/protected_io.h + baad7e45c82815a757f9880d23fb6a672c292c3ed5516999332be7b126b510cd + + + mcc_generated_files/system/src/clock.c + 80377083e1b2a543e0cd17a7bd45bfc4d47c99f8aad83c12e8e15e71dd0eed00 + + + mcc_generated_files/system/src/config_bits.c + 566d8d3a82b890aee64f7afec31700ffe4482b95222789dbe7d6cc6409b85da6 + + + mcc_generated_files/system/src/interrupt.c + d4317faa88eff5330f33c46980af74811dddc607e7fd24c5cf7ef75a7ea7bc15 + + + mcc_generated_files/system/src/pins.c + 430ac871157a5362ee5f025279aa93cf3b59c9dab57a14f2d39341b7d89a466a + + + mcc_generated_files/system/src/protected_io.S + 2b281b85929437e560ddc71a47c6e2a4a4760fc9f461a39c635aefaa9a3820b4 + + + mcc_generated_files/system/src/syscfg.c + bb905078b5ac2670373310c2b1bc77bdb92e8f1e0d86a1c8487fc6f4f876e061 + + + mcc_generated_files/system/src/system.c + 469eccd01d671dab422d9f292d50aea75a1b0b7a301aa4631fe0074feb825b5a + + + mcc_generated_files/system/syscfg.h + 77b8611016dfddc891b2b8837050df5fb0fed572ab6ce0cd4880545865782fc3 + + + mcc_generated_files/system/system.h + 5cd06470729cc334f41f3a8ab461ce371e501e80ea11a731c3a441bef4b52860 + + + mcc_generated_files/system/utils/assembler.h + bc477c3fd99ef84827b179a438d53453a3b1e301316d8e872ccaa6179cbfb5c0 + + + mcc_generated_files/system/utils/assembler/gas.h + f175ebfcbf89fa500a1ba8fc493fa23d20009439a9b0cc4613d567916de93bcc + + + mcc_generated_files/system/utils/assembler/iar.h + 2bcda4485faf0a44298bc8767fe76f5a76b4d77029d7c5101b551b58f0db785b + + + mcc_generated_files/system/utils/atomic.h + 2f4ec99eff6b2b6f4f91ccab5af8016071874890bb7244db0d0ab4877efedfdf + + + mcc_generated_files/system/utils/compiler.h + 761900ef59c41595090107e2efa272cece99c96217f6def4e93235ba3209ffd4 + + + mcc_generated_files/system/utils/interrupt_avr8.h + f63120fffdeebe08304113b664b9f6c9bb6feafd5aefed742f97e7e6f5961a89 + + + mcc_generated_files/system/utils/utils.h + c2e0e5900c6e2ef8d0f1bf8b5d928065d2c3e8458640010d7d1731edcd5b55c6 + + + mcc_generated_files/system/utils/utils_assert.h + 0ebf5529534fd6b38c9e4d38d97bb1bf270486c288d1cb84d3f9f69b718f900f + + + mcc_generated_files/usb/src/usb0.c + 150c2af6ad24d42ac3f802b435cbc8ee57433ceaa40ac390127991b656027881 + + + mcc_generated_files/usb/usb0.h + 9e2cf1f7d5d815d0794901967bf999cdccee876865389d2f1f6ae3b10143eb18 + + + mcc_generated_files/usb/usb_common/usb_common_elements.h + 0b253bab4de474643d111d19bb27b94ec7b9136f40de2746e2330b57bb82423d + + + mcc_generated_files/usb/usb_common/usb_core.c + 87f29f0fc84ecd54765eff03e2f46c2711d6e21734c6afaddf66d4dc0066fc02 + + + mcc_generated_files/usb/usb_common/usb_core.h + eda98246eaeefd29dd8e983c3b58ce3fb44936564d6e287eef6e5020947a3afa + + + mcc_generated_files/usb/usb_common/usb_core_descriptors.c + 910a3fd85157ecba31bfb291e5fdd9b2f9664cf5fe49e83bd679a2348db10ee2 + + + mcc_generated_files/usb/usb_common/usb_core_descriptors.h + ba57547394bdb8fadd716fe96e2b2a7cc969cee6d578f34ae11fd73ffee784ac + + + mcc_generated_files/usb/usb_common/usb_core_events.c + a43a2564616b338b664f169e64286b6812ed70e72ec375c066546de62e9183cc + + + mcc_generated_files/usb/usb_common/usb_core_events.h + 1c71d2d9f14e6a8b6fe35aa5f5adada7729ccd7b23835dcab425d395f8fa82c5 + + + mcc_generated_files/usb/usb_common/usb_core_requests.c + 6bd3ba8ec62f438ea9f430da43517a685a26ee06fe81eb3f89cc2082d6b338ff + + + mcc_generated_files/usb/usb_common/usb_core_requests.h + 0328d64365566933df21d0aeca6634bcbfcf9a18016875a886e208ee7a3780fe + + + mcc_generated_files/usb/usb_common/usb_core_requests_device.c + 03f834e007ec466d5fd629d28aea90a6620b8ff93a4944d2a98c62de71e4f41f + + + mcc_generated_files/usb/usb_common/usb_core_requests_device.h + f523945e8767ae2d44823aef83a852d07dc288830c11c9005187c7362dad6094 + + + mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c + 0a375dede570c36b4604fb47be9a988c43d24bb687109643087c0abaadc0273a + + + mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.h + 3dcdcfc291967933a14ef33287eceb260b8e3485f7c86b868fec6d704ab4370f + + + mcc_generated_files/usb/usb_common/usb_core_requests_interface.c + a8ef16b763e5e112d8af736fb03d308d01ec797a27e7ecc8e30d77c84e2be4f0 + + + mcc_generated_files/usb/usb_common/usb_core_requests_interface.h + aef6572fa424d64fcc9ba1d0223aecdc713a96408a140d8205156aaf88e0cb4e + + + mcc_generated_files/usb/usb_common/usb_core_transfer.c + ae371faa0074161eb36dd98bfb35d8d0a09d679055f023c6f07c9ce9f307c0b3 + + + mcc_generated_files/usb/usb_common/usb_core_transfer.h + aa987571b524642479a060c738e094b9d9041325b5bc1e45a9972264c2e343ff + + + mcc_generated_files/usb/usb_common/usb_protocol_headers.h + ffd7043169b9c84ed1ba08b6b65487f88da524d72b170fae155d59826adafdda + + + mcc_generated_files/usb/usb_config.h + 2759cff8f4d151efd5c594a1c0ed9c53e86b7ff941c1711eea5815a406c56bb1 + + + mcc_generated_files/usb/usb_descriptors.c + b0997d723339383da4600355b36e9b916c64c52eae2915a99eec9095efc91200 + + + mcc_generated_files/usb/usb_descriptors.h + 6bb580f08f661ab61fb3e5a3a27aa7b542e9f7c4c0356bbd95dd9519c989a0eb + + + mcc_generated_files/usb/usb_device.c + d4e9bc589b7bc8026912730c346649a641aef05220c1f5f9f4809c96467ce6a3 + + + mcc_generated_files/usb/usb_device.h + aceb95982c652f77659507aab3d8f870485c0ca6f3686634c818d8f2685d2c53 + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral.c + 3969148f6f217cd9beb8f829ab3ca5da149e541def97bbfdea45cfa2a3273958 + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral.h + 32b8d65e34d45f474398afdfec9f2a1bf571dcbfdd6b9499a8925858a8cdbdbb + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_avr_du.h + 25328772bf8e83d40ee2ea0f29a220af2268ae4cbcc5bd5787490b6ea6c9a8ce + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c + ca53923984b015e76b4ea46d66f15b5cf6c36abf0766a30540d0671b059d74ca + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.h + 309496c9ba92b97f727abc3bb1b0b0516d0938cb6f270288360ea3465164622c + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c + 46646204555a99e303bc5032be0bb19bc4c240800f973c7de50fe26d8bbf986c + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.h + 13c9d763e7e10070d41af7e13033ec7a167d4d2ad8bf0c102dd3964719aa8402 + + + mcc_generated_files/usb/usb_vendor/usb_vendor.c + b0cbbad99cc03556c31f8d332a8312c65409d24fc0620caa0af74ea958a22414 + + + mcc_generated_files/usb/usb_vendor/usb_vendor.h + 4bfb855dbd97167599877ea168b6fc44c1ea9686999a91cff89405bd18346ece + + + \ No newline at end of file diff --git a/RSBcode.mc3.bak0 b/RSBcode.mc3.bak0 new file mode 100644 index 0000000..71b7e2b --- /dev/null +++ b/RSBcode.mc3.bak0 @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Application Builder + class com.microchip.mcc.melody.module.FrameworkModule + + + CLKCTRL + class com.microchip.mcc.melody.hw.module.HardwareModule + + + CPUINT + class com.microchip.mcc.melody.hw.module.HardwareModule + + + Configuration Bits + class com.microchip.mcc.melody.hw.module.HardwareModule + + + MAIN MANAGER + class com.microchip.mcc.melody.hw.module.HardwareModule + + + Pin Manager + class com.microchip.mcc.melody.hw.module.HardwareModule + + + SPI0 + class com.microchip.mcc.melody.hw.module.HardwareModule + + + SYSCFG + class com.microchip.mcc.melody.hw.module.HardwareModule + + + USB0 + class com.microchip.mcc.melody.hw.module.HardwareModule + + + meta + class com.microchip.mcc.melody.hw.module.HardwareModule + + + module0 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module1 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module12 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module18 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module2 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module3 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module33 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module4 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module59 + class com.microchip.mcc.melody.script.module.ScriptModule + + + module6 + class com.microchip.mcc.melody.script.module.ScriptModule + + + + + + + + + {} + + + + {"userAddedModules":["module12","module59"],"version":"INITIAL","modules":{"module4":{"scriptId":"@mchp-mcc/scf-avr8-interrupt-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"scf_avr8_interrupt_v1":{"interfaceId":{"name":"scf-avr8-interrupt-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CPUINT"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0"},"handle":{"providerId":"module1","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module6":{"scriptId":"@mchp-mcc/scf-avr8-clkctrl-v3","imports":{"sys_init_basic_interface":{"interfaceId":{"name":"sys-init-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"sys_init_basic_interface"}},"pins_interface":{"interfaceId":{"name":"pins-interface","version":"^1"},"handle":{"providerId":"module3","exportId":"pins-interface"}},"scf_avr8_clkctrl_v3":{"interfaceId":{"name":"scf-avr8-clkctrl-v3","version":"^1.0.0"},"handle":{"providerId":"mccDevice","exportId":"CLKCTRL"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"configbits_basic_interface":{"interfaceId":{"name":"configbits-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"configbits_basic_interface"}},"config_device":{"interfaceId":{"name":"config-device","version":"^1"},"handle":{"providerId":"module1","exportId":"config_device"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"main":{"hardware":{"clkselMclkctrla":"External clock","externalClk":2.4E7,"clkoutMclkctrla":true,"penMclkctrlb":false},"advanced":{"selhfXoschfctrla":"XTAL","enableXoschfctrla":true,"runstbyXoschfctrla":false,"autotuneOschfctrla":"OFF","frqrangeXoschfctrla":"24M"},"software":{"unusedKey":""}}}},"module12":{"scriptId":"@mchp-mcc/scf-avr8-spi-v1","imports":{"sys_init_basic_interface":{"interfaceId":{"name":"sys-init-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"sys_init_basic_interface"}},"scf_avr8_spi_v1":{"interfaceId":{"name":"scf-avr8-spi-v1","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"SPI0"}},"pins_interface":{"interfaceId":{"name":"pins-interface","version":"^1"},"handle":{"providerId":"module3","exportId":"pins-interface"}},"clock_basic_interface":{"interfaceId":{"name":"clock-basic-interface","version":"^1"},"handle":{"providerId":"module6","exportId":"clock_basic_interface"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"^1"},"handle":{"providerId":"mccDevice","exportId":"meta"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module33":{"scriptId":"@mchp-mcc/scf-avr8-usb-v1","imports":{"pins_interface":{"interfaceId":{"name":"pins-interface","version":"^1.*"},"handle":{"providerId":"module3","exportId":"pins-interface"}},"interrupt_standard":{"interfaceId":{"name":"interrupt-standard","version":"^1.*"},"handle":{"providerId":"module4","exportId":"interrupt"}},"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"osc_clocks":{"interfaceId":{"name":"osc-clocks","version":"^0.*"},"handle":{"providerId":"module6","exportId":"osc_clocks"}},"syscfg_interface":{"interfaceId":{"name":"syscfg-usb-interface","version":"^1.*"},"handle":{"providerId":"module18","exportId":"syscfg_usb_interface"}},"scf_avr8_usb_v1":{"interfaceId":{"name":"scf-avr8-usb-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"USB0"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module1","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module18":{"scriptId":"@mchp-mcc/scf-avr8-syscfg-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"^1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"sys_init_basic_interface":{"interfaceId":{"name":"sys-init-basic-interface","version":"^1"},"handle":{"providerId":"module1","exportId":"sys_init_basic_interface"}},"scf_avr8_syscfg_v1":{"interfaceId":{"name":"scf-avr8-syscfg-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"SYSCFG"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module59":{"scriptId":"@mchp-mcc/usb-device-stack","imports":{"usb_interface":{"interfaceId":{"name":"usb-interface","version":"^1.*"},"handle":{"providerId":"module33","exportId":"usb_interface"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module1","exportId":"initializer_system"}},"project_properties":{"interfaceId":{"name":"project-properties","version":"^1.*"},"handle":{"providerId":"com.microchip.mcc.melody.adapter.ProjectConfigurationAdapter","exportId":"project-properties"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module1":{"scriptId":"@mchp-mcc/avr8-configuration-bits-v1","imports":{"device_meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"initializer_main":{"interfaceId":{"name":"initializer-main","version":"^0.*"},"handle":{"providerId":"module0","exportId":"initializer_main"}},"avr8_configuration_bits_v1":{"interfaceId":{"name":"avr8-configuration-bits-v1","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"Configuration Bits"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module0":{"scriptId":"@mchp-mcc/main-manager","imports":{"main":{"interfaceId":{"name":"main-manager","version":"^1.*"},"handle":{"providerId":"mccDevice","exportId":"MAIN MANAGER"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}},"module3":{"scriptId":"@mchp-mcc/pin-content-processor","imports":{"device-meta":{"interfaceId":{"name":"device-meta","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"meta"}},"pin-architecture":{"interfaceId":{"name":"pin-architecture","version":"1.0.0"},"handle":{"providerId":"module2","exportId":"pin-architecture"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{"saved":{"meta":{"module":"module6"},"rows":{"pcp":{"GPIO$GPIO$input":{"pins":{"PD0":{"state":"MUL"},"PD1":{"state":"MUL"},"PD2":{"state":"MUL"},"PD3":{"state":"MUL"},"PD4":{"state":"MUL"},"PD5":{"state":"MUL"},"PD6":{"state":"MUL"},"PA2":{"state":"MUL"},"PA3":{"state":"MUL"},"PD7":{"state":"MUL"}}},"GPIO$GPIO$output":{"pins":{"PD0":{"state":"L"},"PD1":{"state":"L"},"PD2":{"state":"L"},"PD3":{"state":"L"},"PD4":{"state":"L"},"PD5":{"state":"L"},"PD6":{"state":"L"},"PA2":{"state":"L"},"PA3":{"state":"L"},"PD7":{"state":"L"}}}}}}}},"module2":{"scriptId":"@mchp-mcc/avr8-pin-manager","imports":{"avr8-pin-manager":{"interfaceId":{"name":"avr8-pin-manager","version":"1.0.0"},"handle":{"providerId":"mccDevice","exportId":"Pin Manager"}},"initializer_system":{"interfaceId":{"name":"initializer-system","version":"^0.*"},"handle":{"providerId":"module1","exportId":"initializer_system"}}},"framewSpecificState":{"userEditedImports":[]},"payload":{}}},"content":{"@mchp-mcc/avr-8bit":"4.14.2","@mchp-mcc/scf-avr8-usb-v1":"1.0.0","@mchp-mcc/pin-content-processor":"3.11.0","@mchp-mcc/scf-avr8-syscfg-v1":"1.0.0","@mchp-mcc/avr8-pin-manager":"4.6.2","@mchp-mcc/scf-avr8-spi-v1":"5.1.0","@mchp-mcc/scf-avr8-clkctrl-v3":"2.0.10","@mchp-mcc/scf-avr8-interrupt-v1":"5.0.12","@mchp-mcc/main-manager":"3.1.2","@mchp-mcc/avr8-configuration-bits-v1":"4.3.0","@mchp-mcc/usb-device-stack":"1.1.0"}} + + + + \ No newline at end of file diff --git a/main.c b/main.c new file mode 100644 index 0000000..bf00309 --- /dev/null +++ b/main.c @@ -0,0 +1,48 @@ + /* + * MAIN Generated Driver File + * + * @file main.c + * + * @defgroup main MAIN + * + * @brief This is the generated driver implementation file for the MAIN driver. + * + * @version MAIN Driver Version 1.0.2 + * + * @version Package Version: 3.1.2 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ +#include "mcc_generated_files/system/system.h" + +/* + Main application +*/ + +int main(void) +{ + SYSTEM_Initialize(); + + while(1) + { + } +} \ No newline at end of file diff --git a/mcc-manifest-autosave.yml b/mcc-manifest-autosave.yml new file mode 100644 index 0000000..6f6c2ea --- /dev/null +++ b/mcc-manifest-autosave.yml @@ -0,0 +1,30 @@ +# This file has been autogenerated by MPLAB Code Configurator. Please do not edit this file. + +manifest_file_version: 1.0.0 +project: RSBcode +creation_date: 2025-12-06T13:59:16.169-06:00[US/Central] +operating_system: Linux +mcc_mode: IDE +mcc_mode_version: v6.25 +device_name: AVR64DU28 +compiler: XC8 3.10 +mcc_version: 5.5.2 +mcc_core_version: 5.7.1 +content_manager_version: 5.0.1 +is_mcc_offline: false +is_using_prerelease_versions: false +mcc_content_registries: https://registry.npmjs.org/ +device_library: {library_class: com.microchip.mcc.melody.Library, name: Melody, version: 2.10.0} +packs: {name: AVR-Dx_DFP, version: 2.7.321} +modules: +- {name: '@mchp-mcc/avr-8bit', type: MELODY, version: 4.14.2} +- {name: '@mchp-mcc/avr8-configuration-bits-v1', type: MELODY, version: 4.3.0} +- {name: '@mchp-mcc/avr8-pin-manager', type: MELODY, version: 4.6.2} +- {name: '@mchp-mcc/main-manager', type: MELODY, version: 3.1.2} +- {name: '@mchp-mcc/pin-content-processor', type: MELODY, version: 3.11.0} +- {name: '@mchp-mcc/scf-avr8-clkctrl-v3', type: MELODY, version: 2.0.10} +- {name: '@mchp-mcc/scf-avr8-interrupt-v1', type: MELODY, version: 5.0.12} +- {name: '@mchp-mcc/scf-avr8-spi-v1', type: MELODY, version: 5.1.0} +- {name: '@mchp-mcc/scf-avr8-syscfg-v1', type: MELODY, version: 1.0.0} +- {name: '@mchp-mcc/scf-avr8-usb-v1', type: MELODY, version: 1.0.0} +- {name: '@mchp-mcc/usb-device-stack', type: MELODY, version: 1.1.0} diff --git a/mcc-manifest-generated-success.yml b/mcc-manifest-generated-success.yml new file mode 100644 index 0000000..1468695 --- /dev/null +++ b/mcc-manifest-generated-success.yml @@ -0,0 +1,30 @@ +# This file has been autogenerated by MPLAB Code Configurator. Please do not edit this file. + +manifest_file_version: 1.0.0 +project: RSBcode +creation_date: 2025-12-06T13:59:16.156-06:00[US/Central] +operating_system: Linux +mcc_mode: IDE +mcc_mode_version: v6.25 +device_name: AVR64DU28 +compiler: XC8 3.10 +mcc_version: 5.5.2 +mcc_core_version: 5.7.1 +content_manager_version: 5.0.1 +is_mcc_offline: false +is_using_prerelease_versions: false +mcc_content_registries: https://registry.npmjs.org/ +device_library: {library_class: com.microchip.mcc.melody.Library, name: Melody, version: 2.10.0} +packs: {name: AVR-Dx_DFP, version: 2.7.321} +modules: +- {name: '@mchp-mcc/avr-8bit', type: MELODY, version: 4.14.2} +- {name: '@mchp-mcc/avr8-configuration-bits-v1', type: MELODY, version: 4.3.0} +- {name: '@mchp-mcc/avr8-pin-manager', type: MELODY, version: 4.6.2} +- {name: '@mchp-mcc/main-manager', type: MELODY, version: 3.1.2} +- {name: '@mchp-mcc/pin-content-processor', type: MELODY, version: 3.11.0} +- {name: '@mchp-mcc/scf-avr8-clkctrl-v3', type: MELODY, version: 2.0.10} +- {name: '@mchp-mcc/scf-avr8-interrupt-v1', type: MELODY, version: 5.0.12} +- {name: '@mchp-mcc/scf-avr8-spi-v1', type: MELODY, version: 5.1.0} +- {name: '@mchp-mcc/scf-avr8-syscfg-v1', type: MELODY, version: 1.0.0} +- {name: '@mchp-mcc/scf-avr8-usb-v1', type: MELODY, version: 1.0.0} +- {name: '@mchp-mcc/usb-device-stack', type: MELODY, version: 1.1.0} diff --git a/mcc_generated_files/spi/spi0.h b/mcc_generated_files/spi/spi0.h new file mode 100644 index 0000000..b590eaa --- /dev/null +++ b/mcc_generated_files/spi/spi0.h @@ -0,0 +1,176 @@ +/** + * SPI0 Generated Driver API Header File + * + * @file spi0.h + * + * @defgroup spi0 SPI0 + * + * @brief This header file provides API prototypes for the SPI0 driver. + * + * @version SPI0 Driver Version 3.1.0 + * + * @version SPI0 Package Version 5.1.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef SPI0_H +#define SPI0_H + +#include +#include "../system/utils/compiler.h" +#include "spi_interface.h" + +/** + * @ingroup spi0 + * @struct SPI_INTERFACE SPI0 + * @brief SPI driver interface object. + */ +extern const struct SPI_INTERFACE SPI0_s; + + +/** + * @ingroup spi0 + * @typedef enum SPI0_configuration_name_t + * @brief Enumeration for the different configurations supported by the driver. + * A configuration is specified as parameter to SPI0_Open() + * and is used by the function to set SPI parameters as specified by the configuration. + */ +typedef enum +{ + SPI0_DEFAULT +} SPI0_configuration_name_t; + +/** + * @ingroup spi0 + * @brief Initializes the SPI0 module. + * @param None. + * @return None. + */ +void SPI0_Initialize(void); + +/** + * @ingroup spi0 + * @brief Deinitializes the SPI0 module + * @param None. + * @return None. + */ +void SPI0_Deinitialize(void); + +/** + * @ingroup spi0 + * @brief Enables the SPI0 module with the configurations passed as the parameter. + * See spi0_configuration_name_t for the available configurations. + * @param spiConfigIndex The Configuration index + * @retval True SPI0 module is enabled successfully with the chosen configuration + * @retval False SPI0 module is already open with another configuration + */ +bool SPI0_Open(uint8_t spiConfigIndex); + +/** + * @ingroup spi0 + * @brief Closes the active configuration of the SPI0 module. + * @param None. + * @return None. + */ +void SPI0_Close(void); + +/** + * @ingroup spi0 + * @brief Exchanges one byte using the SPI protocol. This function is blocking. + * @param byteData The byte to be written + * @return Received data byte + */ +uint8_t SPI0_ByteExchange(uint8_t byteData); + +/** + * @ingroup spi0 + * @brief Exchanges the buffer using the SPI protocol with separate transmit and receive buffer locations. This function is blocking in Polling mode. + * @param [in] *txBuffer Buffer address of the data to be transmitted during exchange + * @param [in] *rxBuffer Buffer address of the data to be received during exchange + * @param [in] bufferSize Size of the data in bytes + * @return None. + */ +void SPI0_Transfer(const void * txBuffer, void * rxBuffer, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Exchanges the buffer using the SPI protocol. This function is blocking in Polling mode. + * @param [in,out] *bufferData Buffer address of the data to be exchanged + * @param [in] bufferSize Size of the data in bytes + * @return None. + */ +void SPI0_BufferExchange(void * bufferData, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Writes a buffer using the SPI protocol. This function is blocking in Polling mode. + * @param [in] *bufferData Buffer address of the data to be written + * @param [in] bufferSize Size of the data in bytes + * @return None. + */ +void SPI0_BufferWrite(void * bufferData, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Reads a buffer using the SPI protocol. This function is blocking in Polling mode. + * @param [out] *bufferData Buffer address of the data to be read + * @param [in] bufferSize Size of the data in bytes + * @return None. + */ +void SPI0_BufferRead(void * bufferData, size_t bufferSize); + +/** + * @ingroup spi0 + * @brief Writes one byte using the SPI protocol. This function is blocking in Polling mode. + * @param byteData The byte to be written + * @return None. + */ +void SPI0_ByteWrite(uint8_t byteData); + +/** + * @ingroup spi0 + * @brief Receives one byte using SPI protocol. This function is blocking. + * @param None. + * @return Received data byte + */ +uint8_t SPI0_ByteRead(void); + +/** + * @ingroup spi0 + * @brief Checks if the SPI0 module is ready to read data. + * @param None. + * @retval True SPI0 module has data ready in buffer + * @retval False SPI0 module is not ready to read data + */ +bool SPI0_IsRxReady(void); + +/** + * @ingroup spi0 + * @brief Checks if the SPI0 module is ready to write data. + * @param None. + * @retval True SPI0 module is ready to write data + * @retval False SPI0 module is not ready to write data + */ +bool SPI0_IsTxReady(void); + + +#endif /* SPI0_H */ diff --git a/mcc_generated_files/spi/spi_interface.h b/mcc_generated_files/spi/spi_interface.h new file mode 100644 index 0000000..1ea91dd --- /dev/null +++ b/mcc_generated_files/spi/spi_interface.h @@ -0,0 +1,65 @@ +/** + * SPI Driver API Interface File + * + * @file spi_interface.h + * + * @defgroup spi SPI + * + * @brief This header file provides API prototypes for the SPI module in Polling and Interrupt mode. + * + * @version SPI Interface Version v3.1.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef SPI_INTERFACE_H +#define SPI_INTERFACE_H + +#include +#include +#include + +/** + * @ingroup spi + * @struct SPI_INTERFACE SPI + * @brief SPI Driver prototypes struct. + */ +struct SPI_INTERFACE +{ + void (*Initialize)(void); + void (*Deinitialize)(void); + bool (*Open)(uint8_t spiConfigIndex); + void (*Close)(void); + void (*Transfer)(const void *txBuffer, void *rxBuffer, size_t bufferSize); + void (*BufferExchange)(void *bufferData, size_t bufferSize); + void (*BufferRead)(void *bufferData, size_t bufferSize); + void (*BufferWrite)(void *bufferData, size_t bufferSize); + uint8_t (*ByteExchange)(uint8_t byteData); + uint8_t (*ByteRead)(void); + void (*ByteWrite)(uint8_t byteData); + bool (*IsRxReady)(void); + bool (*IsTxReady)(void); + void (*RxCompleteCallbackRegister)(void (*callbackHandler)(void)); + void (*TxCompleteCallbackRegister)(void (*callbackHandler)(void)); +}; + +#endif /* SPI_INTERFACE_H */ diff --git a/mcc_generated_files/spi/spi_polling_types.h b/mcc_generated_files/spi/spi_polling_types.h new file mode 100644 index 0000000..4bc07f7 --- /dev/null +++ b/mcc_generated_files/spi/spi_polling_types.h @@ -0,0 +1,49 @@ +/** + * SPI Type Definitions Header File + * + * @file spi_polling_types.h + * + * @defgroup spi SPI + * + * @brief This header file provides type definitions for the SPI module operation in Polling mode. + * + * @version SPI Driver Version 3.1.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef SPI_POLLING_TYPES_H +#define SPI_POLLING_TYPES_H + + +/** + * @ingroup spi + * @typedef struct spi_configuration_t + * @brief Holds register configurations for SPI module. + */ +typedef struct +{ + uint8_t ctrla; + uint8_t ctrlb; +} spi_configuration_t; + +#endif /* SPI_POLLING_TYPES_H */ diff --git a/mcc_generated_files/spi/src/spi0.c b/mcc_generated_files/spi/src/spi0.c new file mode 100644 index 0000000..ba16982 --- /dev/null +++ b/mcc_generated_files/spi/src/spi0.c @@ -0,0 +1,240 @@ +/** + * SPI0 Generated Driver File + * + * @file spi0.c + * + * @ingroup spi0 + * + * @brief This file contains the driver code for the SPI0 module. + * + * @version SPI0 Driver Version 3.1.0 + * + * @version SPI0 Package Version 5.1.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../spi0.h" +#include "../spi_polling_types.h" + +const struct SPI_INTERFACE SPI0_s = +{ + .Initialize = SPI0_Initialize, + .Deinitialize = SPI0_Deinitialize, + .Open = SPI0_Open, + .Close = SPI0_Close, + .Transfer = SPI0_Transfer, + .BufferExchange = SPI0_BufferExchange, + .BufferWrite = SPI0_BufferWrite, + .BufferRead = SPI0_BufferRead, + .ByteExchange = SPI0_ByteExchange, + .ByteWrite = SPI0_ByteWrite, + .ByteRead = SPI0_ByteRead, + .IsTxReady = SPI0_IsTxReady, + .IsRxReady = SPI0_IsRxReady, + .RxCompleteCallbackRegister = NULL, + .TxCompleteCallbackRegister = NULL +}; + +static const spi_configuration_t spi0_configuration[] = +{ + { 0x34, 0xC4 } +}; + +void SPI0_Initialize(void) +{ + SPI0.CTRLA &= ~SPI_ENABLE_bm; + SPI0.CTRLA = (1 << SPI_CLK2X_bp) /* CLK2X (enabled) */ + |(0 << SPI_DORD_bp) /* DORD (disabled) */ + |(0 << SPI_ENABLE_bp) /* ENABLE (disabled) */ + |(1 << SPI_MASTER_bp) /* MASTER (enabled) */ + |(SPI_PRESC_DIV64_gc); /* PRESC (DIV64) */ + SPI0.CTRLB = (1 << SPI_BUFEN_bp) /* BUFEN (enabled) */ + |(1 << SPI_BUFWR_bp) /* BUFWR (enabled) */ + |(SPI_MODE_0_gc) /* MODE (0) */ + |(1 << SPI_SSD_bp); /* SSD (enabled) */ +} + +void SPI0_Deinitialize(void) +{ + SPI0.CTRLA = 0x0; + SPI0.CTRLB = 0x0; + SPI0.INTCTRL = 0x0; +} + +bool SPI0_Open(uint8_t spiConfigIndex) +{ + bool returnValue = false; + if (0 == (SPI0.CTRLA & SPI_ENABLE_bm)) + { + SPI0.CTRLB = spi0_configuration[spiConfigIndex].ctrlb; + SPI0.CTRLA = spi0_configuration[spiConfigIndex].ctrla; + SPI0.CTRLA |= SPI_ENABLE_bm; + returnValue = true; + } + else + { + returnValue = false; + } + return returnValue; +} + +void SPI0_Close(void) +{ + SPI0.CTRLA &= ~SPI_ENABLE_bm; +} + +uint8_t SPI0_ByteExchange(uint8_t byteData) +{ + uint8_t readData = 0; + SPI0.DATA = byteData; + while (0 == (SPI0.INTFLAGS & SPI_RXCIF_bm)) + { + ; // Wait until ongoing SPI transfer is completed + } + readData = SPI0.DATA; + return readData; +} + +void SPI0_ByteWrite(uint8_t byteData) +{ + SPI0.DATA = byteData; +} + +uint8_t SPI0_ByteRead(void) +{ + return SPI0.DATA; +} + +void SPI0_Transfer(const void *txBuffer, void *rxBuffer, size_t bufferSize) +{ + const uint8_t *bufferTransmit = (const uint8_t *)txBuffer; + uint8_t *bufferReceive = (uint8_t *)rxBuffer; + size_t bufferInputSize = bufferSize; + while(0U != bufferInputSize) + { + SPI0.DATA = *bufferTransmit; + while (0 == (SPI0.INTFLAGS & SPI_RXCIF_bm)) + { + ; // Wait until ongoing SPI transfer is completed + } + *bufferReceive = SPI0.DATA; + bufferTransmit++; + bufferReceive++; + bufferInputSize--; + } +} + +void SPI0_BufferExchange(void *bufferData, size_t bufferSize) +{ + uint8_t *buffer = (uint8_t *)bufferData; + size_t bufferInputSize = bufferSize; + while(0U != bufferInputSize) + { + SPI0.DATA = *buffer; + while (0 == (SPI0.INTFLAGS & SPI_RXCIF_bm)) + { + ; // Wait until ongoing SPI transfer is completed + } + *buffer = SPI0.DATA; + buffer++; + bufferInputSize--; + } +} + +void SPI0_BufferWrite(void *bufferData, size_t bufferSize) +{ + uint8_t *buffer = (uint8_t *)bufferData; + uint8_t readData = 0; + size_t bufferInputSize = bufferSize; + while(0U != bufferInputSize) + { + SPI0.DATA = *buffer; + while(0 == (SPI0.INTFLAGS & SPI_RXCIF_bm)) + { + ; // Wait until ongoing SPI transfer is completed + } + readData = SPI0.DATA; + (void) readData; + buffer++; + bufferInputSize--; + } +} + +void SPI0_BufferRead(void *bufferData, size_t bufferSize) +{ + uint8_t *buffer = (uint8_t *)bufferData; + size_t bufferInputSize = bufferSize; + while(0U != bufferInputSize) + { + SPI0.DATA = 0; + while (0 == (SPI0.INTFLAGS & SPI_RXCIF_bm)) + { + ; // Wait until ongoing SPI transfer is completed + } + *buffer = SPI0.DATA; + buffer++; + bufferInputSize--; + } +} + +bool SPI0_IsTxReady(void) +{ + bool returnValue = false; + if(0 != (SPI0.CTRLA & SPI_ENABLE_bm)) + { + if(0 != (SPI0.INTFLAGS & SPI_DREIF_bm)) + { + returnValue = true; + } + else + { + returnValue = false; + } + } + else + { + returnValue = false; + } + return returnValue; +} + +bool SPI0_IsRxReady(void) +{ + bool returnValue = false; + if(0 != (SPI0.CTRLA & SPI_ENABLE_bm)) + { + if(0 != (SPI0.INTFLAGS & SPI_RXCIF_bm)) + { + returnValue = true; + } + else + { + returnValue = false; + } + } + else + { + returnValue = false; + } + return returnValue; +} \ No newline at end of file diff --git a/mcc_generated_files/system/ccp.h b/mcc_generated_files/system/ccp.h new file mode 100644 index 0000000..b6d9e0f --- /dev/null +++ b/mcc_generated_files/system/ccp.h @@ -0,0 +1,72 @@ +/** + * CCP Header File + * + * @file ccp.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the Configuration Change Protection (CCP) header file for the Configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef CPU_CCP_H +#define CPU_CCP_H + +#include "../system/utils/compiler.h" +#include "../system/protected_io.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Writes to a CCP-protected 8-bit I/O register. + * @param addr Address of the I/O register. + * @param value Value to be written. + * NOTE: Using IAR Embedded workbench, the choice of memory model has an impact on calling convention. + * Memory model must be defined in the Assembler preprocessor directives to be visible to the preprocessor. + */ +static inline void ccp_write_io(void *addr, uint8_t value) +{ + protected_write_io(addr, CCP_IOREG_gc, value); +} + +/** + * @brief Writes to a CCP-protected 8-bit SPM register. + * @param addr Address of the SPM register. + * @param value Value to be written. + * NOTE: Using IAR Embedded workbench, the choice of memory model has an impacton calling convention. + * Memory model must be defined in the Assembler preprocessor directives to be visible to the preprocessor. + */ +static inline void ccp_write_spm(void *addr, uint8_t value) +{ + protected_write_io(addr, CCP_SPM_gc, value); +} + +#ifdef __cplusplus +} +#endif + +#endif /* CPU_CCP_H */ diff --git a/mcc_generated_files/system/clock.h b/mcc_generated_files/system/clock.h new file mode 100644 index 0000000..8840a00 --- /dev/null +++ b/mcc_generated_files/system/clock.h @@ -0,0 +1,70 @@ + +/** + * CLKCTRL Generated Driver API Header File + * + * @file clkctrl.h + * + * @defgroup clkctrl CLKCTRL + * + * @brief This header file provides APIs for the CLKCTRL driver. + * + * @version CLKCTRL Driver Version 1.1.4 + * + * @version Package Version 2.0.10 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef CLOCK_H +#define CLOCK_H + +#ifndef F_CPU +#define F_CPU 24000000UL +#endif + +#include "ccp.h" + +/** + * @ingroup clkctrl + * @brief Initializes the CLKCTRL module. + * @param None. + * @return None. + */ +void CLOCK_Initialize(void); + +/** + * @ingroup clkctrl + * @brief Enables the Clock Failure Detection on the main clock. + * @param CLKCTRL_CFDSRC_t cfd_source - main clock source for CFD + * @return None. + */ +void CFD_Enable(CLKCTRL_CFDSRC_t cfd_source); + +/** + * @ingroup clkctrl + * @brief Disables the Clock Failure Detection on the main clock. + * @param None. + * @return None. + */ +void CFD_Disable(void); + +#endif // CLOCK_H \ No newline at end of file diff --git a/mcc_generated_files/system/config_bits.h b/mcc_generated_files/system/config_bits.h new file mode 100644 index 0000000..25fe43a --- /dev/null +++ b/mcc_generated_files/system/config_bits.h @@ -0,0 +1,44 @@ +/** + * CONFIGURATION BITS Generated Driver Header File + * + * @file config_bits.h + * + * @defgroup config_bitsdriver CONFIGBITS Driver + * + * @brief This file contains the API Prototypes for the Configuration Bits driver. + * + * @version Driver Version 1.0.5 + * + * @version Package Version 4.3.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef CONFIG_BITS_H +#define CONFIG_BITS_H + +#include "../system/clock.h" + +#endif //CONFIG_BITS_H +/** + End of File +*/ \ No newline at end of file diff --git a/mcc_generated_files/system/interrupt.h b/mcc_generated_files/system/interrupt.h new file mode 100644 index 0000000..73ed652 --- /dev/null +++ b/mcc_generated_files/system/interrupt.h @@ -0,0 +1,57 @@ +/** + * Interrupt Manager Generated Driver API Header File. + * + * @file interrupt.h + * + * @defgroup interrupt INTERRUPT + * + * @brief This file contains the API prototype for the Interrupt Manager. + * + * @version Interrupt Manager Driver Version 1.0.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef INTERRUPT_H +#define INTERRUPT_H + +#include "../system/utils/compiler.h" +#include "ccp.h" +#include "../system/utils/atomic.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @ingroup interrupt + * @brief Initializes the Interrupt module. + * @retval 0 - Initialization is successful. + */ +int8_t CPUINT_Initialize(); + +#ifdef __cplusplus +} +#endif + +#endif /* INTERRUPT_H */ \ No newline at end of file diff --git a/mcc_generated_files/system/pins.h b/mcc_generated_files/system/pins.h new file mode 100644 index 0000000..63292fd --- /dev/null +++ b/mcc_generated_files/system/pins.h @@ -0,0 +1,608 @@ +/** + * Generated Pins header File + * + * @file pins.h + * + * @defgroup pinsdriver Pins Driver + * + * @brief This is generated driver header for pins. + * This header file provides APIs for all pins selected in the GUI. + * + * @version Driver Version 1.1.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef PINS_H_INCLUDED +#define PINS_H_INCLUDED + +#include +#include "./port.h" + +//get/set IO_PA5 aliases +#define IO_PA5_SetHigh() do { PORTA_OUTSET = 0x20; } while(0) +#define IO_PA5_SetLow() do { PORTA_OUTCLR = 0x20; } while(0) +#define IO_PA5_Toggle() do { PORTA_OUTTGL = 0x20; } while(0) +#define IO_PA5_GetValue() (VPORTA.IN & (0x1 << 5)) +#define IO_PA5_SetDigitalInput() do { PORTA_DIRCLR = 0x20; } while(0) +#define IO_PA5_SetDigitalOutput() do { PORTA_DIRSET = 0x20; } while(0) +#define IO_PA5_SetPullUp() do { PORTA_PIN5CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PA5_ResetPullUp() do { PORTA_PIN5CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PA5_SetInverted() do { PORTA_PIN5CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PA5_ResetInverted() do { PORTA_PIN5CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PA5_DisableInterruptOnChange() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PA5_EnableInterruptForBothEdges() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PA5_EnableInterruptForRisingEdge() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PA5_EnableInterruptForFallingEdge() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PA5_DisableDigitalInputBuffer() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PA5_EnableInterruptForLowLevelSensing() do { PORTA.PIN5CTRL = (PORTA.PIN5CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA5_SetInterruptHandler IO_PA5_SetInterruptHandler + +//get/set IO_PA4 aliases +#define IO_PA4_SetHigh() do { PORTA_OUTSET = 0x10; } while(0) +#define IO_PA4_SetLow() do { PORTA_OUTCLR = 0x10; } while(0) +#define IO_PA4_Toggle() do { PORTA_OUTTGL = 0x10; } while(0) +#define IO_PA4_GetValue() (VPORTA.IN & (0x1 << 4)) +#define IO_PA4_SetDigitalInput() do { PORTA_DIRCLR = 0x10; } while(0) +#define IO_PA4_SetDigitalOutput() do { PORTA_DIRSET = 0x10; } while(0) +#define IO_PA4_SetPullUp() do { PORTA_PIN4CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PA4_ResetPullUp() do { PORTA_PIN4CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PA4_SetInverted() do { PORTA_PIN4CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PA4_ResetInverted() do { PORTA_PIN4CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PA4_DisableInterruptOnChange() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PA4_EnableInterruptForBothEdges() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PA4_EnableInterruptForRisingEdge() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PA4_EnableInterruptForFallingEdge() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PA4_DisableDigitalInputBuffer() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PA4_EnableInterruptForLowLevelSensing() do { PORTA.PIN4CTRL = (PORTA.PIN4CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA4_SetInterruptHandler IO_PA4_SetInterruptHandler + +//get/set IO_PA6 aliases +#define IO_PA6_SetHigh() do { PORTA_OUTSET = 0x40; } while(0) +#define IO_PA6_SetLow() do { PORTA_OUTCLR = 0x40; } while(0) +#define IO_PA6_Toggle() do { PORTA_OUTTGL = 0x40; } while(0) +#define IO_PA6_GetValue() (VPORTA.IN & (0x1 << 6)) +#define IO_PA6_SetDigitalInput() do { PORTA_DIRCLR = 0x40; } while(0) +#define IO_PA6_SetDigitalOutput() do { PORTA_DIRSET = 0x40; } while(0) +#define IO_PA6_SetPullUp() do { PORTA_PIN6CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PA6_ResetPullUp() do { PORTA_PIN6CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PA6_SetInverted() do { PORTA_PIN6CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PA6_ResetInverted() do { PORTA_PIN6CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PA6_DisableInterruptOnChange() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PA6_EnableInterruptForBothEdges() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PA6_EnableInterruptForRisingEdge() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PA6_EnableInterruptForFallingEdge() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PA6_DisableDigitalInputBuffer() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PA6_EnableInterruptForLowLevelSensing() do { PORTA.PIN6CTRL = (PORTA.PIN6CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA6_SetInterruptHandler IO_PA6_SetInterruptHandler + +//get/set IO_PA7 aliases +#define IO_PA7_SetHigh() do { PORTA_OUTSET = 0x80; } while(0) +#define IO_PA7_SetLow() do { PORTA_OUTCLR = 0x80; } while(0) +#define IO_PA7_Toggle() do { PORTA_OUTTGL = 0x80; } while(0) +#define IO_PA7_GetValue() (VPORTA.IN & (0x1 << 7)) +#define IO_PA7_SetDigitalInput() do { PORTA_DIRCLR = 0x80; } while(0) +#define IO_PA7_SetDigitalOutput() do { PORTA_DIRSET = 0x80; } while(0) +#define IO_PA7_SetPullUp() do { PORTA_PIN7CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PA7_ResetPullUp() do { PORTA_PIN7CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PA7_SetInverted() do { PORTA_PIN7CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PA7_ResetInverted() do { PORTA_PIN7CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PA7_DisableInterruptOnChange() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PA7_EnableInterruptForBothEdges() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PA7_EnableInterruptForRisingEdge() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PA7_EnableInterruptForFallingEdge() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PA7_DisableDigitalInputBuffer() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PA7_EnableInterruptForLowLevelSensing() do { PORTA.PIN7CTRL = (PORTA.PIN7CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA7_SetInterruptHandler IO_PA7_SetInterruptHandler + +//get/set IO_PA2 aliases +#define IO_PA2_SetHigh() do { PORTA_OUTSET = 0x4; } while(0) +#define IO_PA2_SetLow() do { PORTA_OUTCLR = 0x4; } while(0) +#define IO_PA2_Toggle() do { PORTA_OUTTGL = 0x4; } while(0) +#define IO_PA2_GetValue() (VPORTA.IN & (0x1 << 2)) +#define IO_PA2_SetDigitalInput() do { PORTA_DIRCLR = 0x4; } while(0) +#define IO_PA2_SetDigitalOutput() do { PORTA_DIRSET = 0x4; } while(0) +#define IO_PA2_SetPullUp() do { PORTA_PIN2CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PA2_ResetPullUp() do { PORTA_PIN2CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PA2_SetInverted() do { PORTA_PIN2CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PA2_ResetInverted() do { PORTA_PIN2CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PA2_DisableInterruptOnChange() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PA2_EnableInterruptForBothEdges() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PA2_EnableInterruptForRisingEdge() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PA2_EnableInterruptForFallingEdge() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PA2_DisableDigitalInputBuffer() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PA2_EnableInterruptForLowLevelSensing() do { PORTA.PIN2CTRL = (PORTA.PIN2CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA2_SetInterruptHandler IO_PA2_SetInterruptHandler + +//get/set IO_PA3 aliases +#define IO_PA3_SetHigh() do { PORTA_OUTSET = 0x8; } while(0) +#define IO_PA3_SetLow() do { PORTA_OUTCLR = 0x8; } while(0) +#define IO_PA3_Toggle() do { PORTA_OUTTGL = 0x8; } while(0) +#define IO_PA3_GetValue() (VPORTA.IN & (0x1 << 3)) +#define IO_PA3_SetDigitalInput() do { PORTA_DIRCLR = 0x8; } while(0) +#define IO_PA3_SetDigitalOutput() do { PORTA_DIRSET = 0x8; } while(0) +#define IO_PA3_SetPullUp() do { PORTA_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PA3_ResetPullUp() do { PORTA_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PA3_SetInverted() do { PORTA_PIN3CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PA3_ResetInverted() do { PORTA_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PA3_DisableInterruptOnChange() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PA3_EnableInterruptForBothEdges() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PA3_EnableInterruptForRisingEdge() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PA3_EnableInterruptForFallingEdge() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PA3_DisableDigitalInputBuffer() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PA3_EnableInterruptForLowLevelSensing() do { PORTA.PIN3CTRL = (PORTA.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PA3_SetInterruptHandler IO_PA3_SetInterruptHandler + +//get/set IO_PD0 aliases +#define IO_PD0_SetHigh() do { PORTD_OUTSET = 0x1; } while(0) +#define IO_PD0_SetLow() do { PORTD_OUTCLR = 0x1; } while(0) +#define IO_PD0_Toggle() do { PORTD_OUTTGL = 0x1; } while(0) +#define IO_PD0_GetValue() (VPORTD.IN & (0x1 << 0)) +#define IO_PD0_SetDigitalInput() do { PORTD_DIRCLR = 0x1; } while(0) +#define IO_PD0_SetDigitalOutput() do { PORTD_DIRSET = 0x1; } while(0) +#define IO_PD0_SetPullUp() do { PORTD_PIN0CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD0_ResetPullUp() do { PORTD_PIN0CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD0_SetInverted() do { PORTD_PIN0CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD0_ResetInverted() do { PORTD_PIN0CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD0_DisableInterruptOnChange() do { PORTD.PIN0CTRL = (PORTD.PIN0CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD0_EnableInterruptForBothEdges() do { PORTD.PIN0CTRL = (PORTD.PIN0CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD0_EnableInterruptForRisingEdge() do { PORTD.PIN0CTRL = (PORTD.PIN0CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD0_EnableInterruptForFallingEdge() do { PORTD.PIN0CTRL = (PORTD.PIN0CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD0_DisableDigitalInputBuffer() do { PORTD.PIN0CTRL = (PORTD.PIN0CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD0_EnableInterruptForLowLevelSensing() do { PORTD.PIN0CTRL = (PORTD.PIN0CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD0_SetInterruptHandler IO_PD0_SetInterruptHandler + +//get/set IO_PD1 aliases +#define IO_PD1_SetHigh() do { PORTD_OUTSET = 0x2; } while(0) +#define IO_PD1_SetLow() do { PORTD_OUTCLR = 0x2; } while(0) +#define IO_PD1_Toggle() do { PORTD_OUTTGL = 0x2; } while(0) +#define IO_PD1_GetValue() (VPORTD.IN & (0x1 << 1)) +#define IO_PD1_SetDigitalInput() do { PORTD_DIRCLR = 0x2; } while(0) +#define IO_PD1_SetDigitalOutput() do { PORTD_DIRSET = 0x2; } while(0) +#define IO_PD1_SetPullUp() do { PORTD_PIN1CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD1_ResetPullUp() do { PORTD_PIN1CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD1_SetInverted() do { PORTD_PIN1CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD1_ResetInverted() do { PORTD_PIN1CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD1_DisableInterruptOnChange() do { PORTD.PIN1CTRL = (PORTD.PIN1CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD1_EnableInterruptForBothEdges() do { PORTD.PIN1CTRL = (PORTD.PIN1CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD1_EnableInterruptForRisingEdge() do { PORTD.PIN1CTRL = (PORTD.PIN1CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD1_EnableInterruptForFallingEdge() do { PORTD.PIN1CTRL = (PORTD.PIN1CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD1_DisableDigitalInputBuffer() do { PORTD.PIN1CTRL = (PORTD.PIN1CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD1_EnableInterruptForLowLevelSensing() do { PORTD.PIN1CTRL = (PORTD.PIN1CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD1_SetInterruptHandler IO_PD1_SetInterruptHandler + +//get/set IO_PD2 aliases +#define IO_PD2_SetHigh() do { PORTD_OUTSET = 0x4; } while(0) +#define IO_PD2_SetLow() do { PORTD_OUTCLR = 0x4; } while(0) +#define IO_PD2_Toggle() do { PORTD_OUTTGL = 0x4; } while(0) +#define IO_PD2_GetValue() (VPORTD.IN & (0x1 << 2)) +#define IO_PD2_SetDigitalInput() do { PORTD_DIRCLR = 0x4; } while(0) +#define IO_PD2_SetDigitalOutput() do { PORTD_DIRSET = 0x4; } while(0) +#define IO_PD2_SetPullUp() do { PORTD_PIN2CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD2_ResetPullUp() do { PORTD_PIN2CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD2_SetInverted() do { PORTD_PIN2CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD2_ResetInverted() do { PORTD_PIN2CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD2_DisableInterruptOnChange() do { PORTD.PIN2CTRL = (PORTD.PIN2CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD2_EnableInterruptForBothEdges() do { PORTD.PIN2CTRL = (PORTD.PIN2CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD2_EnableInterruptForRisingEdge() do { PORTD.PIN2CTRL = (PORTD.PIN2CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD2_EnableInterruptForFallingEdge() do { PORTD.PIN2CTRL = (PORTD.PIN2CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD2_DisableDigitalInputBuffer() do { PORTD.PIN2CTRL = (PORTD.PIN2CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD2_EnableInterruptForLowLevelSensing() do { PORTD.PIN2CTRL = (PORTD.PIN2CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD2_SetInterruptHandler IO_PD2_SetInterruptHandler + +//get/set IO_PD3 aliases +#define IO_PD3_SetHigh() do { PORTD_OUTSET = 0x8; } while(0) +#define IO_PD3_SetLow() do { PORTD_OUTCLR = 0x8; } while(0) +#define IO_PD3_Toggle() do { PORTD_OUTTGL = 0x8; } while(0) +#define IO_PD3_GetValue() (VPORTD.IN & (0x1 << 3)) +#define IO_PD3_SetDigitalInput() do { PORTD_DIRCLR = 0x8; } while(0) +#define IO_PD3_SetDigitalOutput() do { PORTD_DIRSET = 0x8; } while(0) +#define IO_PD3_SetPullUp() do { PORTD_PIN3CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD3_ResetPullUp() do { PORTD_PIN3CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD3_SetInverted() do { PORTD_PIN3CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD3_ResetInverted() do { PORTD_PIN3CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD3_DisableInterruptOnChange() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD3_EnableInterruptForBothEdges() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD3_EnableInterruptForRisingEdge() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD3_EnableInterruptForFallingEdge() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD3_DisableDigitalInputBuffer() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD3_EnableInterruptForLowLevelSensing() do { PORTD.PIN3CTRL = (PORTD.PIN3CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD3_SetInterruptHandler IO_PD3_SetInterruptHandler + +//get/set IO_PD4 aliases +#define IO_PD4_SetHigh() do { PORTD_OUTSET = 0x10; } while(0) +#define IO_PD4_SetLow() do { PORTD_OUTCLR = 0x10; } while(0) +#define IO_PD4_Toggle() do { PORTD_OUTTGL = 0x10; } while(0) +#define IO_PD4_GetValue() (VPORTD.IN & (0x1 << 4)) +#define IO_PD4_SetDigitalInput() do { PORTD_DIRCLR = 0x10; } while(0) +#define IO_PD4_SetDigitalOutput() do { PORTD_DIRSET = 0x10; } while(0) +#define IO_PD4_SetPullUp() do { PORTD_PIN4CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD4_ResetPullUp() do { PORTD_PIN4CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD4_SetInverted() do { PORTD_PIN4CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD4_ResetInverted() do { PORTD_PIN4CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD4_DisableInterruptOnChange() do { PORTD.PIN4CTRL = (PORTD.PIN4CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD4_EnableInterruptForBothEdges() do { PORTD.PIN4CTRL = (PORTD.PIN4CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD4_EnableInterruptForRisingEdge() do { PORTD.PIN4CTRL = (PORTD.PIN4CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD4_EnableInterruptForFallingEdge() do { PORTD.PIN4CTRL = (PORTD.PIN4CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD4_DisableDigitalInputBuffer() do { PORTD.PIN4CTRL = (PORTD.PIN4CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD4_EnableInterruptForLowLevelSensing() do { PORTD.PIN4CTRL = (PORTD.PIN4CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD4_SetInterruptHandler IO_PD4_SetInterruptHandler + +//get/set IO_PD5 aliases +#define IO_PD5_SetHigh() do { PORTD_OUTSET = 0x20; } while(0) +#define IO_PD5_SetLow() do { PORTD_OUTCLR = 0x20; } while(0) +#define IO_PD5_Toggle() do { PORTD_OUTTGL = 0x20; } while(0) +#define IO_PD5_GetValue() (VPORTD.IN & (0x1 << 5)) +#define IO_PD5_SetDigitalInput() do { PORTD_DIRCLR = 0x20; } while(0) +#define IO_PD5_SetDigitalOutput() do { PORTD_DIRSET = 0x20; } while(0) +#define IO_PD5_SetPullUp() do { PORTD_PIN5CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD5_ResetPullUp() do { PORTD_PIN5CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD5_SetInverted() do { PORTD_PIN5CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD5_ResetInverted() do { PORTD_PIN5CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD5_DisableInterruptOnChange() do { PORTD.PIN5CTRL = (PORTD.PIN5CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD5_EnableInterruptForBothEdges() do { PORTD.PIN5CTRL = (PORTD.PIN5CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD5_EnableInterruptForRisingEdge() do { PORTD.PIN5CTRL = (PORTD.PIN5CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD5_EnableInterruptForFallingEdge() do { PORTD.PIN5CTRL = (PORTD.PIN5CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD5_DisableDigitalInputBuffer() do { PORTD.PIN5CTRL = (PORTD.PIN5CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD5_EnableInterruptForLowLevelSensing() do { PORTD.PIN5CTRL = (PORTD.PIN5CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD5_SetInterruptHandler IO_PD5_SetInterruptHandler + +//get/set IO_PD6 aliases +#define IO_PD6_SetHigh() do { PORTD_OUTSET = 0x40; } while(0) +#define IO_PD6_SetLow() do { PORTD_OUTCLR = 0x40; } while(0) +#define IO_PD6_Toggle() do { PORTD_OUTTGL = 0x40; } while(0) +#define IO_PD6_GetValue() (VPORTD.IN & (0x1 << 6)) +#define IO_PD6_SetDigitalInput() do { PORTD_DIRCLR = 0x40; } while(0) +#define IO_PD6_SetDigitalOutput() do { PORTD_DIRSET = 0x40; } while(0) +#define IO_PD6_SetPullUp() do { PORTD_PIN6CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD6_ResetPullUp() do { PORTD_PIN6CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD6_SetInverted() do { PORTD_PIN6CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD6_ResetInverted() do { PORTD_PIN6CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD6_DisableInterruptOnChange() do { PORTD.PIN6CTRL = (PORTD.PIN6CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD6_EnableInterruptForBothEdges() do { PORTD.PIN6CTRL = (PORTD.PIN6CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD6_EnableInterruptForRisingEdge() do { PORTD.PIN6CTRL = (PORTD.PIN6CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD6_EnableInterruptForFallingEdge() do { PORTD.PIN6CTRL = (PORTD.PIN6CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD6_DisableDigitalInputBuffer() do { PORTD.PIN6CTRL = (PORTD.PIN6CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD6_EnableInterruptForLowLevelSensing() do { PORTD.PIN6CTRL = (PORTD.PIN6CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD6_SetInterruptHandler IO_PD6_SetInterruptHandler + +//get/set IO_PD7 aliases +#define IO_PD7_SetHigh() do { PORTD_OUTSET = 0x80; } while(0) +#define IO_PD7_SetLow() do { PORTD_OUTCLR = 0x80; } while(0) +#define IO_PD7_Toggle() do { PORTD_OUTTGL = 0x80; } while(0) +#define IO_PD7_GetValue() (VPORTD.IN & (0x1 << 7)) +#define IO_PD7_SetDigitalInput() do { PORTD_DIRCLR = 0x80; } while(0) +#define IO_PD7_SetDigitalOutput() do { PORTD_DIRSET = 0x80; } while(0) +#define IO_PD7_SetPullUp() do { PORTD_PIN7CTRL |= PORT_PULLUPEN_bm; } while(0) +#define IO_PD7_ResetPullUp() do { PORTD_PIN7CTRL &= ~PORT_PULLUPEN_bm; } while(0) +#define IO_PD7_SetInverted() do { PORTD_PIN7CTRL |= PORT_INVEN_bm; } while(0) +#define IO_PD7_ResetInverted() do { PORTD_PIN7CTRL &= ~PORT_INVEN_bm; } while(0) +#define IO_PD7_DisableInterruptOnChange() do { PORTD.PIN7CTRL = (PORTD.PIN7CTRL & ~PORT_ISC_gm) | 0x0 ; } while(0) +#define IO_PD7_EnableInterruptForBothEdges() do { PORTD.PIN7CTRL = (PORTD.PIN7CTRL & ~PORT_ISC_gm) | 0x1 ; } while(0) +#define IO_PD7_EnableInterruptForRisingEdge() do { PORTD.PIN7CTRL = (PORTD.PIN7CTRL & ~PORT_ISC_gm) | 0x2 ; } while(0) +#define IO_PD7_EnableInterruptForFallingEdge() do { PORTD.PIN7CTRL = (PORTD.PIN7CTRL & ~PORT_ISC_gm) | 0x3 ; } while(0) +#define IO_PD7_DisableDigitalInputBuffer() do { PORTD.PIN7CTRL = (PORTD.PIN7CTRL & ~PORT_ISC_gm) | 0x4 ; } while(0) +#define IO_PD7_EnableInterruptForLowLevelSensing() do { PORTD.PIN7CTRL = (PORTD.PIN7CTRL & ~PORT_ISC_gm) | 0x5 ; } while(0) +#define PD7_SetInterruptHandler IO_PD7_SetInterruptHandler + +/** + * @ingroup pinsdriver + * @brief GPIO and peripheral I/O initialization + * @param none + * @return none + */ +void PIN_MANAGER_Initialize(); + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PA5 pin. + * This is a predefined interrupt handler to be used together with the IO_PA5_SetInterruptHandler() method. + * This handler is called every time the IO_PA5 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PA5_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PA5 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PA5 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PA5_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PA4 pin. + * This is a predefined interrupt handler to be used together with the IO_PA4_SetInterruptHandler() method. + * This handler is called every time the IO_PA4 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PA4_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PA4 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PA4 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PA4_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PA6 pin. + * This is a predefined interrupt handler to be used together with the IO_PA6_SetInterruptHandler() method. + * This handler is called every time the IO_PA6 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PA6_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PA6 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PA6 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PA6_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PA7 pin. + * This is a predefined interrupt handler to be used together with the IO_PA7_SetInterruptHandler() method. + * This handler is called every time the IO_PA7 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PA7_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PA7 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PA7 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PA7_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PA2 pin. + * This is a predefined interrupt handler to be used together with the IO_PA2_SetInterruptHandler() method. + * This handler is called every time the IO_PA2 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PA2_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PA2 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PA2 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PA2_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PA3 pin. + * This is a predefined interrupt handler to be used together with the IO_PA3_SetInterruptHandler() method. + * This handler is called every time the IO_PA3 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PA3_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PA3 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PA3 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PA3_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD0 pin. + * This is a predefined interrupt handler to be used together with the IO_PD0_SetInterruptHandler() method. + * This handler is called every time the IO_PD0 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD0_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD0 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD0 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD0_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD1 pin. + * This is a predefined interrupt handler to be used together with the IO_PD1_SetInterruptHandler() method. + * This handler is called every time the IO_PD1 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD1_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD1 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD1 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD1_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD2 pin. + * This is a predefined interrupt handler to be used together with the IO_PD2_SetInterruptHandler() method. + * This handler is called every time the IO_PD2 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD2_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD2 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD2 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD2_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD3 pin. + * This is a predefined interrupt handler to be used together with the IO_PD3_SetInterruptHandler() method. + * This handler is called every time the IO_PD3 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD3_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD3 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD3 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD3_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD4 pin. + * This is a predefined interrupt handler to be used together with the IO_PD4_SetInterruptHandler() method. + * This handler is called every time the IO_PD4 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD4_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD4 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD4 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD4_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD5 pin. + * This is a predefined interrupt handler to be used together with the IO_PD5_SetInterruptHandler() method. + * This handler is called every time the IO_PD5 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD5_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD5 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD5 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD5_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD6 pin. + * This is a predefined interrupt handler to be used together with the IO_PD6_SetInterruptHandler() method. + * This handler is called every time the IO_PD6 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD6_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD6 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD6 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD6_SetInterruptHandler(void (* interruptHandler)(void)) ; + +/** + * @ingroup pinsdriver + * @brief Default Interrupt Handler for IO_PD7 pin. + * This is a predefined interrupt handler to be used together with the IO_PD7_SetInterruptHandler() method. + * This handler is called every time the IO_PD7 ISR is executed. + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param none + * @return none + */ +void IO_PD7_DefaultInterruptHandler(void); + +/** + * @ingroup pinsdriver + * @brief Interrupt Handler Setter for IO_PD7 pin input-sense-config functionality. + * Allows selecting an interrupt handler for IO_PD7 at application runtime + * @pre PIN_MANAGER_Initialize() has been called at least once + * @param InterruptHandler function pointer. + * @return none + */ +void IO_PD7_SetInterruptHandler(void (* interruptHandler)(void)) ; +#endif /* PINS_H_INCLUDED */ diff --git a/mcc_generated_files/system/port.h b/mcc_generated_files/system/port.h new file mode 100644 index 0000000..3c6c5fb --- /dev/null +++ b/mcc_generated_files/system/port.h @@ -0,0 +1,902 @@ +/** + * Generated Ports header File + * + * @file port.h + * + * @ingroup pinsdriver + * + * @brief This Source file provides APIs. + * + * @version Driver Version 1.0.1 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef PORT_INCLUDED +#define PORT_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include "utils/compiler.h" + +/* @ingroup pinsdriver + * @enum port_pull_mode + * Defines the pullup modes. + */ +enum port_pull_mode { + PORT_PULL_OFF, + PORT_PULL_UP, +}; + +/* @ingroup pinsdriver + * @enum port_dir + * Defines the port directions. + */ +enum port_dir { + PORT_DIR_IN, + PORT_DIR_OUT, + PORT_DIR_OFF, +}; + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTA_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTA_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTA_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTA + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTA_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTA.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTA.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTA + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTA_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTA.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTA.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTA + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTA_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTA.OUT |= mask; + } else { + VPORTA.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTA_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTA.OUT |= (1 << pin); + } else { + VPORTA.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTA_toggle_port_level(const uint8_t mask) +{ + PORTA.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTA_toggle_pin_level(const uint8_t pin) +{ + PORTA.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTA_get_port_level() +{ + return VPORTA.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTA_get_pin_level(const uint8_t pin) +{ + return VPORTA.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTA_write_port(const uint8_t value) +{ + VPORTA.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTC_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTC_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTC_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTC + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTC_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTC.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTC.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTC + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTC_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTC.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTC.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTC + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTC_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTC.OUT |= mask; + } else { + VPORTC.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTC_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTC.OUT |= (1 << pin); + } else { + VPORTC.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTC_toggle_port_level(const uint8_t mask) +{ + PORTC.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTC_toggle_pin_level(const uint8_t pin) +{ + PORTC.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTC_get_port_level() +{ + return VPORTC.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTC_get_pin_level(const uint8_t pin) +{ + return VPORTC.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTC_write_port(const uint8_t value) +{ + VPORTC.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTD_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTD_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTD_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTD + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTD_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTD.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTD.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTD + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTD_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTD.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTD.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTD + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTD_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTD.OUT |= mask; + } else { + VPORTD.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTD_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTD.OUT |= (1 << pin); + } else { + VPORTD.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTD_toggle_port_level(const uint8_t mask) +{ + PORTD.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTD_toggle_pin_level(const uint8_t pin) +{ + PORTD.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTD_get_port_level() +{ + return VPORTD.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTD_get_pin_level(const uint8_t pin) +{ + return VPORTD.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTD_write_port(const uint8_t value) +{ + VPORTD.OUT = value; +} + +/** + * @ingroup pinsdriver + * @brief Set port pin pull mode, Configure pin to pull up, down or disable pull mode, supported pull modes are defined by device used. + * @param pin The pin number within port + * @param pull_mode Pin pull mode + * @return none + */ +static inline void PORTF_set_pin_pull_mode(const uint8_t pin, const enum port_pull_mode pull_mode) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); + + if (pull_mode == PORT_PULL_UP) { + *port_pin_ctrl |= PORT_PULLUPEN_bm; + } else if (pull_mode == PORT_PULL_OFF) { + *port_pin_ctrl &= ~PORT_PULLUPEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin inverted mode, Configure pin invert I/O or not. + * @param pin The pin number within port + * @param inverted Pin inverted mode + * @return none + */ +static inline void PORTF_pin_set_inverted(const uint8_t pin, const bool inverted) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); + + if (inverted) { + *port_pin_ctrl |= PORT_INVEN_bm; + } else { + *port_pin_ctrl &= ~PORT_INVEN_bm; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin input/sense configuration, Enable/disable digital input buffer and pin change interrupt, + * select pin interrupt edge/level sensing mode + * @param The pin number within port + * @param isc PORT_ISC_t + * @return none + */ +static inline void PORTF_pin_set_isc(const uint8_t pin, const PORT_ISC_t isc) +{ + volatile uint8_t *port_pin_ctrl = ((uint8_t *)&PORTF + 0x10 + pin); + + *port_pin_ctrl = (*port_pin_ctrl & ~PORT_ISC_gm) | isc; +} + +/** + * @ingroup pinsdriver + * @brief Set port data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param mask Bit mask where 1 means apply direction setting to the + * corresponding pin + * @param dir port_dir + * @return none + */ +static inline void PORTF_set_port_dir(const uint8_t mask, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTF.DIR &= ~mask; + break; + case PORT_DIR_OUT: + VPORTF.DIR |= mask; + break; + case PORT_DIR_OFF: + /*/ should activate the pullup for power saving + but a bit costly to do it here */ + { + for (uint8_t i = 0; i < 8; i++) { + if (mask & 1 << i) { + *((uint8_t *)&PORTF + 0x10 + i) |= 1 << PORT_PULLUPEN_bp; + } + } + } + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port pin data direction, Select if the pin data direction is input, output or disabled. + * If disabled state is not possible, this function throws an assert. + * + * @param pin The pin number within port + * @param dir port_dir + * @return none + */ +static inline void PORTF_set_pin_dir(const uint8_t pin, const enum port_dir dir) +{ + switch (dir) { + case PORT_DIR_IN: + VPORTF.DIR &= ~(1 << pin); + break; + case PORT_DIR_OUT: + VPORTF.DIR |= (1 << pin); + break; + case PORT_DIR_OFF: + *((uint8_t *)&PORTF + 0x10 + pin) |= 1 << PORT_PULLUPEN_bp; + break; + default: + break; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on the pins defined by the bit mask. + * + * @param mask Bit mask where 1 means apply port level to the corresponding + * pin + * @param level -boolean value that defines the logic state of the pin level + * false = Pin levels set to "low" state + * @return none + */ +static inline void PORTF_set_port_level(const uint8_t mask, const bool level) +{ + if (level == true) { + VPORTF.OUT |= mask; + } else { + VPORTF.OUT &= ~mask; + } +} + +/** + * @ingroup pinsdriver + * @brief Set port level, Sets output level on a pin. + * + * @param pin The pin number within port + * @param level -boolean value that defines the logic state of the pin level + * @return none + */ +static inline void PORTF_set_pin_level(const uint8_t pin, const bool level) +{ + if (level == true) { + VPORTF.OUT |= (1 << pin); + } else { + VPORTF.OUT &= ~(1 << pin); + } +} + +/** + * @ingroup pinsdriver + * @brief Toggle out level on pins, Toggle the pin levels on pins defined by bit mask. + * + * @param mask Bit mask where 1 means toggle pin level to the corresponding + * pin + * @return none + */ +static inline void PORTF_toggle_port_level(const uint8_t mask) +{ + PORTF.OUTTGL = mask; +} + +/** + * @ingroup pinsdriver + * @brief Toggle output level on pin, Toggle the pin levels on pins defined by bit mask. + * + * @param pin The pin number within port + * @return none + */ +static inline void PORTF_toggle_pin_level(const uint8_t pin) +{ + PORTF.OUTTGL = 1 << pin; +} + +/** + * @ingroup pinsdriver + * @brief Get input level on pins, Read the input level on pins connected to a port. + * + * @param none + * @return none + */ +static inline uint8_t PORTF_get_port_level() +{ + return VPORTF.IN; +} + +/** + * @ingroup pinsdriver + * @brief Get level on pin, Reads the level on pins connected to a port. + * + * @param pin The pin number within port + * @return none + */ +static inline bool PORTF_get_pin_level(const uint8_t pin) +{ + return VPORTF.IN & (1 << pin); +} + +/** + * @ingroup pinsdriver + * @brief Write value to Port, Write directly to the port OUT register. + * + * @param value Value to write to the port register + * @return none + */ +static inline void PORTF_write_port(const uint8_t value) +{ + VPORTF.OUT = value; +} +#ifdef __cplusplus +} +#endif + +#endif /* PORT_INCLUDED */ \ No newline at end of file diff --git a/mcc_generated_files/system/protected_io.h b/mcc_generated_files/system/protected_io.h new file mode 100644 index 0000000..05d934c --- /dev/null +++ b/mcc_generated_files/system/protected_io.h @@ -0,0 +1,80 @@ +/** + * protected_io Header File + * + * @file protected_io.h + * + * @defgroup doc_driver_system_protected_io Protected IO + * + * @brief This file contains the generated prtected_io header file for the CONFIGURATION BITS. + * + * @version Driver Version 1.0.0 + * + *@{ +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef PROTECTED_IO_H +#define PROTECTED_IO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__DOXYGEN__) +//! \name IAR Memory Model defines. +//@{ + +/** + * @def CONFIG_MEMORY_MODEL_TINY + * @brief Configuration symbol to enable 8 bit pointers. + */ +#define CONFIG_MEMORY_MODEL_TINY + +/** + * @def CONFIG_MEMORY_MODEL_SMALL + * @brief Configuration symbol to enable 16 bit pointers. + * NOTE: If no memory model is defined, SMALL is default. + */ +#define CONFIG_MEMORY_MODEL_SMALL + +/** + * @def CONFIG_MEMORY_MODEL_LARGE + * @brief Configuration symbol to enable 24 bit pointers. + */ +#define CONFIG_MEMORY_MODEL_LARGE + +//@} +#endif + +/** + * @brief Writes to an 8-bit I/O register protected by CCP or a protection bit. + * @param addr Address of the I/O register. + * @param magic CCP magic value or Mask for protection bit. + * @param value Value to be written. + * NOTE: Using IAR Embedded workbench, the choice of memory model has an impact on calling convention. + * Memory model must be defined in the Assembler preprocessor directives to be visible to the preprocessor. + */ +extern void protected_write_io(void *addr, uint8_t magic, uint8_t value); + +/** @} */ + +#endif /* PROTECTED_IO_H */ diff --git a/mcc_generated_files/system/src/clock.c b/mcc_generated_files/system/src/clock.c new file mode 100644 index 0000000..08efbea --- /dev/null +++ b/mcc_generated_files/system/src/clock.c @@ -0,0 +1,105 @@ + + +/** + * CLKCTRL Generated Driver File + * + * @file clkctrl.c + * + * @ingroup clkctrl + * + * @brief This file contains the driver code for CLKCTRL module. + * + * version CLKCTRL Driver Version 1.1.4 + * + * @version Package Version 2.0.10 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../clock.h" + +void CLOCK_Initialize(void) +{ + ccp_write_io((void*)&(CLKCTRL.MCLKCTRLA),(1 << CLKCTRL_CLKOUT_bp) // CLKOUT enabled + | CLKCTRL_CLKSEL_EXTCLK_gc // CLKSEL External clock + ); + ccp_write_io((void*)&(CLKCTRL.MCLKCTRLB),CLKCTRL_PDIV_DIV2_gc // PDIV Divide by 2 + | (0 << CLKCTRL_PEN_bp) // PEN disabled + ); + ccp_write_io((void*)&(CLKCTRL.OSC32KCTRLA),(0 << CLKCTRL_RUNSTDBY_bp) // RUNSTDBY disabled + ); + ccp_write_io((void*)&(CLKCTRL.OSCHFCTRLA),CLKCTRL_AUTOTUNE_OFF_gc // AUTOTUNE OFF + | CLKCTRL_FRQSEL_4M_gc // FRQSEL 4 MHz system clock (default) + | (0 << CLKCTRL_RUNSTDBY_bp) // RUNSTDBY disabled + | CLKCTRL_ALGSEL_BIN_gc // ALGSEL BIN + ); + ccp_write_io((void*)&(CLKCTRL.OSCHFTUNE),0x0 // TUNE 0x0 + ); + + ccp_write_io((void*)&(CLKCTRL.XOSC32KCTRLA),CLKCTRL_CSUT_1K_gc // CSUT 1k cycles + | (0 << CLKCTRL_ENABLE_bp) // ENABLE disabled + | (0 << CLKCTRL_LPMODE_bp) // LPMODE disabled + | (0 << CLKCTRL_RUNSTDBY_bp) // RUNSTDBY disabled + | CLKCTRL_SEL_XTAL_gc // SEL XTAL + ); + ccp_write_io((void*)&(CLKCTRL.MCLKCTRLC),(0 << CLKCTRL_CFDEN_bp) // CFDEN disabled + | CLKCTRL_CFDSRC_XOSCHF_gc // CFDSRC XOSCHF + | (0 << CLKCTRL_CFDTST_bp) // CFDTST disabled + ); + ccp_write_io((void*)&(CLKCTRL.MCLKINTCTRL),(0 << CLKCTRL_CFD_bp) // CFD disabled + | CLKCTRL_INTTYPE_INT_gc // INTTYPE INT + ); + ccp_write_io((void*)&(CLKCTRL.MCLKINTFLAGS),(0 << CLKCTRL_CFD_bp) // CFD disabled + ); + ccp_write_io((void*)&(CLKCTRL.XOSCHFCTRLA),CLKCTRL_CSUTHF_256_gc // CSUTHF 256 + | (1 << CLKCTRL_ENABLE_bp) // ENABLE enabled + | CLKCTRL_FRQRANGE_24M_gc // FRQRANGE 24M + | (1 << CLKCTRL_RUNSTBY_bp) // RUNSTBY enabled + | CLKCTRL_SELHF_XTAL_gc // SELHF XTAL + ); + + ccp_write_io((void*)&(CLKCTRL.MCLKTIMEBASE),0x18 // TIMEBASE 24 + ); + + // System clock stability check by polling the status register. + while(!(CLKCTRL.MCLKSTATUS & CLKCTRL_EXTS_bm)) + { + } + +} + +void CFD_Enable(CLKCTRL_CFDSRC_t cfd_source) +{ + /* Enable Clock Failure Detection on main clock */ + ccp_write_io((uint8_t *) & CLKCTRL.MCLKCTRLC, cfd_source | CLKCTRL_CFDEN_bm); +} + +void CFD_Disable(void) +{ + /* Disable Clock Failure Detection on main clock */ + ccp_write_io((uint8_t *) & CLKCTRL.MCLKCTRLC, CLKCTRL.MCLKCTRLC & ~CLKCTRL_CFDEN_bm); +} + + +/** + End of File +*/ \ No newline at end of file diff --git a/mcc_generated_files/system/src/config_bits.c b/mcc_generated_files/system/src/config_bits.c new file mode 100644 index 0000000..44dd4ce --- /dev/null +++ b/mcc_generated_files/system/src/config_bits.c @@ -0,0 +1,50 @@ +/** + * CONFIGURATION BITS Generated Driver Source File + * + * @file config_bits.c + * + * @ingroup config_bitsdriver + * + * @brief This file contains the API implementation for the Device Configuration Bits driver. + * + * @version Driver Version 1.0.5 + * + * @version Package Version 4.3.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include + +/** + * Configures the Fuse bits. + */ +FUSES = +{ + .BODCFG = ACTIVE_DISABLE_gc | LVL_BODLEVEL0_gc | SAMPFREQ_128Hz_gc | SLEEP_DISABLE_gc, + .BOOTSIZE = 0x0, + .CODESIZE = 0x0, + .OSCCFG = CLKSEL_OSCHF_gc, + .PDICFG = KEY_NOTACT_gc | LEVEL_BASIC_gc, + .SYSCFG0 = CRCSEL_CRC16_gc | CRCSRC_NOCRC_gc | RSTPINCFG_RST_gc | UPDIPINCFG_UPDI_gc, + .SYSCFG1 = SUT_0MS_gc | USBSINK_ENABLE_gc, + .WDTCFG = PERIOD_OFF_gc | WINDOW_OFF_gc, +}; diff --git a/mcc_generated_files/system/src/interrupt.c b/mcc_generated_files/system/src/interrupt.c new file mode 100644 index 0000000..aeb81e6 --- /dev/null +++ b/mcc_generated_files/system/src/interrupt.c @@ -0,0 +1,53 @@ +/** + * Interrupt Manager Generated Driver File. + * + * @file interrupt.c + * + * @ingroup interrupt + * + * @brief This file contains the API implementation for the Interrupt Manager. + * + * @version Interrupt Manager Driver Version 1.0.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../interrupt.h" + +int8_t CPUINT_Initialize() +{ + /* IVSEL and CVT are Configuration Change Protected */ + + //CVT disabled; IVSEL disabled; LVL0RR disabled; + ccp_write_io((void*)&(CPUINT.CTRLA),0x0); + + //LVL0PRI 0; + CPUINT.LVL0PRI = 0x0; + + //LVL1VEC 0; + CPUINT.LVL1VEC = 0x0; + + ENABLE_INTERRUPTS(); + + return 0; +} \ No newline at end of file diff --git a/mcc_generated_files/system/src/pins.c b/mcc_generated_files/system/src/pins.c new file mode 100644 index 0000000..92133c9 --- /dev/null +++ b/mcc_generated_files/system/src/pins.c @@ -0,0 +1,393 @@ +/** + * Generated Driver File + * + * @file pins.c + * + * @ingroup pinsdriver + * + * @brief This is generated driver implementation for pins. + * This file provides implementations for pin APIs for all pins selected in the GUI. + * + * @version Driver Version 1.1.0 +*/ + +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../pins.h" + +static void (*IO_PA5_InterruptHandler)(void); +static void (*IO_PA4_InterruptHandler)(void); +static void (*IO_PA6_InterruptHandler)(void); +static void (*IO_PA7_InterruptHandler)(void); +static void (*IO_PA2_InterruptHandler)(void); +static void (*IO_PA3_InterruptHandler)(void); +static void (*IO_PD0_InterruptHandler)(void); +static void (*IO_PD1_InterruptHandler)(void); +static void (*IO_PD2_InterruptHandler)(void); +static void (*IO_PD3_InterruptHandler)(void); +static void (*IO_PD4_InterruptHandler)(void); +static void (*IO_PD5_InterruptHandler)(void); +static void (*IO_PD6_InterruptHandler)(void); +static void (*IO_PD7_InterruptHandler)(void); + +void PIN_MANAGER_Initialize() +{ + + /* OUT Registers Initialization */ + PORTA.OUT = 0x0; + PORTC.OUT = 0x0; + PORTD.OUT = 0x0; + PORTF.OUT = 0x0; + + /* DIR Registers Initialization */ + PORTA.DIR = 0xDC; + PORTC.DIR = 0x0; + PORTD.DIR = 0xFF; + PORTF.DIR = 0x0; + + /* PINxCTRL registers Initialization */ + PORTA.PIN0CTRL = 0x0; + PORTA.PIN1CTRL = 0x0; + PORTA.PIN2CTRL = 0x0; + PORTA.PIN3CTRL = 0x0; + PORTA.PIN4CTRL = 0x0; + PORTA.PIN5CTRL = 0x0; + PORTA.PIN6CTRL = 0x0; + PORTA.PIN7CTRL = 0x0; + PORTC.PIN0CTRL = 0x0; + PORTC.PIN1CTRL = 0x0; + PORTC.PIN2CTRL = 0x0; + PORTC.PIN3CTRL = 0x0; + PORTC.PIN4CTRL = 0x0; + PORTC.PIN5CTRL = 0x0; + PORTC.PIN6CTRL = 0x0; + PORTC.PIN7CTRL = 0x0; + PORTD.PIN0CTRL = 0x0; + PORTD.PIN1CTRL = 0x0; + PORTD.PIN2CTRL = 0x0; + PORTD.PIN3CTRL = 0x0; + PORTD.PIN4CTRL = 0x0; + PORTD.PIN5CTRL = 0x0; + PORTD.PIN6CTRL = 0x0; + PORTD.PIN7CTRL = 0x0; + PORTF.PIN0CTRL = 0x0; + PORTF.PIN1CTRL = 0x0; + PORTF.PIN2CTRL = 0x0; + PORTF.PIN3CTRL = 0x0; + PORTF.PIN4CTRL = 0x0; + PORTF.PIN5CTRL = 0x0; + PORTF.PIN6CTRL = 0x0; + PORTF.PIN7CTRL = 0x0; + + /* PORTMUX Initialization */ + PORTMUX.CCLROUTEA = 0x0; + PORTMUX.EVSYSROUTEA = 0x0; + PORTMUX.SPIROUTEA = 0x0; + PORTMUX.TCAROUTEA = 0x0; + PORTMUX.TCBROUTEA = 0x0; + PORTMUX.TWIROUTEA = 0x0; + PORTMUX.USARTROUTEA = 0x0; + + // register default ISC callback functions at runtime; use these methods to register a custom function + IO_PA5_SetInterruptHandler(IO_PA5_DefaultInterruptHandler); + IO_PA4_SetInterruptHandler(IO_PA4_DefaultInterruptHandler); + IO_PA6_SetInterruptHandler(IO_PA6_DefaultInterruptHandler); + IO_PA7_SetInterruptHandler(IO_PA7_DefaultInterruptHandler); + IO_PA2_SetInterruptHandler(IO_PA2_DefaultInterruptHandler); + IO_PA3_SetInterruptHandler(IO_PA3_DefaultInterruptHandler); + IO_PD0_SetInterruptHandler(IO_PD0_DefaultInterruptHandler); + IO_PD1_SetInterruptHandler(IO_PD1_DefaultInterruptHandler); + IO_PD2_SetInterruptHandler(IO_PD2_DefaultInterruptHandler); + IO_PD3_SetInterruptHandler(IO_PD3_DefaultInterruptHandler); + IO_PD4_SetInterruptHandler(IO_PD4_DefaultInterruptHandler); + IO_PD5_SetInterruptHandler(IO_PD5_DefaultInterruptHandler); + IO_PD6_SetInterruptHandler(IO_PD6_DefaultInterruptHandler); + IO_PD7_SetInterruptHandler(IO_PD7_DefaultInterruptHandler); +} + +/** + Allows selecting an interrupt handler for IO_PA5 at application runtime +*/ +void IO_PA5_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PA5_InterruptHandler = interruptHandler; +} + +void IO_PA5_DefaultInterruptHandler(void) +{ + // add your IO_PA5 interrupt custom code + // or set custom function using IO_PA5_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PA4 at application runtime +*/ +void IO_PA4_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PA4_InterruptHandler = interruptHandler; +} + +void IO_PA4_DefaultInterruptHandler(void) +{ + // add your IO_PA4 interrupt custom code + // or set custom function using IO_PA4_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PA6 at application runtime +*/ +void IO_PA6_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PA6_InterruptHandler = interruptHandler; +} + +void IO_PA6_DefaultInterruptHandler(void) +{ + // add your IO_PA6 interrupt custom code + // or set custom function using IO_PA6_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PA7 at application runtime +*/ +void IO_PA7_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PA7_InterruptHandler = interruptHandler; +} + +void IO_PA7_DefaultInterruptHandler(void) +{ + // add your IO_PA7 interrupt custom code + // or set custom function using IO_PA7_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PA2 at application runtime +*/ +void IO_PA2_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PA2_InterruptHandler = interruptHandler; +} + +void IO_PA2_DefaultInterruptHandler(void) +{ + // add your IO_PA2 interrupt custom code + // or set custom function using IO_PA2_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PA3 at application runtime +*/ +void IO_PA3_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PA3_InterruptHandler = interruptHandler; +} + +void IO_PA3_DefaultInterruptHandler(void) +{ + // add your IO_PA3 interrupt custom code + // or set custom function using IO_PA3_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD0 at application runtime +*/ +void IO_PD0_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD0_InterruptHandler = interruptHandler; +} + +void IO_PD0_DefaultInterruptHandler(void) +{ + // add your IO_PD0 interrupt custom code + // or set custom function using IO_PD0_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD1 at application runtime +*/ +void IO_PD1_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD1_InterruptHandler = interruptHandler; +} + +void IO_PD1_DefaultInterruptHandler(void) +{ + // add your IO_PD1 interrupt custom code + // or set custom function using IO_PD1_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD2 at application runtime +*/ +void IO_PD2_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD2_InterruptHandler = interruptHandler; +} + +void IO_PD2_DefaultInterruptHandler(void) +{ + // add your IO_PD2 interrupt custom code + // or set custom function using IO_PD2_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD3 at application runtime +*/ +void IO_PD3_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD3_InterruptHandler = interruptHandler; +} + +void IO_PD3_DefaultInterruptHandler(void) +{ + // add your IO_PD3 interrupt custom code + // or set custom function using IO_PD3_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD4 at application runtime +*/ +void IO_PD4_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD4_InterruptHandler = interruptHandler; +} + +void IO_PD4_DefaultInterruptHandler(void) +{ + // add your IO_PD4 interrupt custom code + // or set custom function using IO_PD4_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD5 at application runtime +*/ +void IO_PD5_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD5_InterruptHandler = interruptHandler; +} + +void IO_PD5_DefaultInterruptHandler(void) +{ + // add your IO_PD5 interrupt custom code + // or set custom function using IO_PD5_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD6 at application runtime +*/ +void IO_PD6_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD6_InterruptHandler = interruptHandler; +} + +void IO_PD6_DefaultInterruptHandler(void) +{ + // add your IO_PD6 interrupt custom code + // or set custom function using IO_PD6_SetInterruptHandler() +} +/** + Allows selecting an interrupt handler for IO_PD7 at application runtime +*/ +void IO_PD7_SetInterruptHandler(void (* interruptHandler)(void)) +{ + IO_PD7_InterruptHandler = interruptHandler; +} + +void IO_PD7_DefaultInterruptHandler(void) +{ + // add your IO_PD7 interrupt custom code + // or set custom function using IO_PD7_SetInterruptHandler() +} +ISR(PORTA_PORT_vect) +{ + // Call the interrupt handler for the callback registered at runtime + if(VPORTA.INTFLAGS & PORT_INT5_bm) + { + IO_PA5_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT4_bm) + { + IO_PA4_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT6_bm) + { + IO_PA6_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT7_bm) + { + IO_PA7_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT2_bm) + { + IO_PA2_InterruptHandler(); + } + if(VPORTA.INTFLAGS & PORT_INT3_bm) + { + IO_PA3_InterruptHandler(); + } + /* Clear interrupt flags */ + VPORTA.INTFLAGS = 0xff; +} + +ISR(PORTC_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTC.INTFLAGS = 0xff; +} + +ISR(PORTD_PORT_vect) +{ + // Call the interrupt handler for the callback registered at runtime + if(VPORTD.INTFLAGS & PORT_INT0_bm) + { + IO_PD0_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT1_bm) + { + IO_PD1_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT2_bm) + { + IO_PD2_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT3_bm) + { + IO_PD3_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT4_bm) + { + IO_PD4_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT5_bm) + { + IO_PD5_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT6_bm) + { + IO_PD6_InterruptHandler(); + } + if(VPORTD.INTFLAGS & PORT_INT7_bm) + { + IO_PD7_InterruptHandler(); + } + /* Clear interrupt flags */ + VPORTD.INTFLAGS = 0xff; +} + +ISR(PORTF_PORT_vect) +{ + /* Clear interrupt flags */ + VPORTF.INTFLAGS = 0xff; +} + +/** + End of File +*/ \ No newline at end of file diff --git a/mcc_generated_files/system/src/protected_io.S b/mcc_generated_files/system/src/protected_io.S new file mode 100644 index 0000000..4a60008 --- /dev/null +++ b/mcc_generated_files/system/src/protected_io.S @@ -0,0 +1,90 @@ +/** + * protected_io Source Code File + * + * @file protected_io.S + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated protected_io source code file for the CONFIGURATION BITS. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#include "../utils/assembler.h" + +/* + * GNU and IAR use different calling conventions. Since this is + * a very small and simple function to begin with, it's easier + * to implement it twice than to deal with the differences + * within a single implementation. + */ + + PUBLIC_FUNCTION(protected_write_io) + +#if defined(__GNUC__) + +#ifdef RAMPZ + out _SFR_IO_ADDR(RAMPZ), r1 // Clear bits 23:16 of Z +#endif + movw r30, r24 // Load addr into Z + out CCP, r22 // Start CCP handshake + st Z, r20 // Write value to I/O register + ret // Return to caller + +#elif defined(__IAR_SYSTEMS_ASM__) + +# if !defined(CONFIG_MEMORY_MODEL_TINY) && !defined(CONFIG_MEMORY_MODEL_SMALL) \ + && !defined(CONFIG_MEMORY_MODEL_LARGE) +# define CONFIG_MEMORY_MODEL_SMALL +# endif +# if defined(CONFIG_MEMORY_MODEL_LARGE) + ldi r20, 0 + out RAMPZ, r20 // Reset bits 23:16 of Z + movw r30, r16 // Load addr into Z +# elif defined(CONFIG_MEMORY_MODEL_TINY) + ldi r31, 0 // Reset bits 8:15 of Z + mov r30, r16 // Load addr into Z +# else + movw r30, r16 // Load addr into Z +# endif +# if defined(CONFIG_MEMORY_MODEL_TINY) + out CCP, r17 // Start CCP handshake + st Z, r18 // Write value to I/O register +# elif defined(CONFIG_MEMORY_MODEL_SMALL) + out CCP, r18 // Start CCP handshake + st Z, r19 // Write value to I/O register +# elif defined(CONFIG_MEMORY_MODEL_LARGE) + out CCP, r19 // Start CCP handshake + st Z, r20 // Write value to I/O register +# else +# error Unknown memory model in use, no idea how registers should be accessed +# endif + ret +#else +# error Unknown assembler +#endif + + END_FUNC(protected_write_io) + END_FILE() + diff --git a/mcc_generated_files/system/src/syscfg.c b/mcc_generated_files/system/src/syscfg.c new file mode 100644 index 0000000..ce8bc01 --- /dev/null +++ b/mcc_generated_files/system/src/syscfg.c @@ -0,0 +1,64 @@ + +/** + * SYSCFG Generated Driver File + * + * @file syscfg.c + * + * @ingroup syscfg + * + * @brief This is the generated driver implementation file for the SYSCFG driver. + * + * @version SYSCFG Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +/** + Section: Included Files +*/ + +#include "../../system/utils/compiler.h" +#include "../syscfg.h" + +/** + Section: SYSCFG APIs +*/ + +void SYSCFG_Initialize(void) +{ + SYSCFG.VUSBCTRL = (1 << SYSCFG_USBVREG_bp); // USBVREG ENABLE; +} +uint8_t SYSCFG_GetRevId(void) +{ + return SYSCFG.REVID; +} +inline void SYSCFG_UsbVregEnable(void) +{ + SYSCFG.VUSBCTRL = SYSCFG_USBVREG_bm; +} +inline void SYSCFG_UsbVregDisable(void) +{ + SYSCFG.VUSBCTRL = ~SYSCFG_USBVREG_bm; +} + +/** + End of File +*/ \ No newline at end of file diff --git a/mcc_generated_files/system/src/system.c b/mcc_generated_files/system/src/system.c new file mode 100644 index 0000000..12217fb --- /dev/null +++ b/mcc_generated_files/system/src/system.c @@ -0,0 +1,47 @@ +/** + * System Driver Source File + * + * @file system.c + * + * @ingroup systemdriver + * + * @brief This file contains the API implementation for the System driver. + * + * @version Driver Version 1.0.3 + * + * @version Package Version 4.3.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "../system.h" + +void SYSTEM_Initialize(void) +{ + CLOCK_Initialize(); + SYSCFG_Initialize(); + PIN_MANAGER_Initialize(); + SPI0_Initialize(); + USB0_Initialize(); + USBDevice_Initialize(); + CPUINT_Initialize(); +} + diff --git a/mcc_generated_files/system/syscfg.h b/mcc_generated_files/system/syscfg.h new file mode 100644 index 0000000..962333d --- /dev/null +++ b/mcc_generated_files/system/syscfg.h @@ -0,0 +1,83 @@ +/** + * SYSCFG Generated Driver API Header File + * + * @file syscfg.h + * + * @defgroup syscfg SYSCFG + * + * @brief This is the generated header file for the SYSCFG driver + * + * @version SYSCFG Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef SYSCFG_H +#define SYSCFG_H + +/** + Section: Included Files +*/ + +#include +#include + +/** + Section: SYSCFG APIs +*/ + +/** + * @ingroup syscfg + * @brief Initializes the SYSCFG driver. This routine is called only once during system initialization, before calling other APIs. + * @param None. + * @return None. + */ +void SYSCFG_Initialize(void); + +/** + * @ingroup syscfg + * @brief Returns the SYSCFG Revision ID. + * @param None. + * @return uint8_t + */ +uint8_t SYSCFG_GetRevId(void); + +/** + * @ingroup syscfg + * @brief Enables the SYSCFG USB voltage regulator. + * @param None. + * @return None. + */ + void SYSCFG_UsbVregEnable(void); + +/** + * @ingroup syscfg + * @brief Disables the SYSCFG USB voltage regulator. + * @param None. + * @return None. + */ +void SYSCFG_UsbVregDisable(void); + + +#endif // SYSCFG_H +/** + End of File +*/ diff --git a/mcc_generated_files/system/system.h b/mcc_generated_files/system/system.h new file mode 100644 index 0000000..6acf7ce --- /dev/null +++ b/mcc_generated_files/system/system.h @@ -0,0 +1,66 @@ +/** + * System Driver Header File + * + * @file system.h + * + * @defgroup systemdriver System Driver + * + * @brief This file contains the API prototype for the System Driver. + * + * @version Driver Version 1.0.3 + * + * @version Package Version 4.3.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef MCC_H +#define MCC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../system/utils/compiler.h" +#include "config_bits.h" +#include "../system/pins.h" +#include "../usb/usb0.h" +#include "../usb/usb_device.h" +#include "../system/interrupt.h" +#include "../system/clock.h" +#include "../system/syscfg.h" +#include "../spi/spi0.h" +/** + * @ingroup systemdriver + * @brief Initializes the System module. This routine is called only once during system initialization, before calling any other API. + * @param None. + * @return None. +*/ +void SYSTEM_Initialize(void); + +#ifdef __cplusplus +} +#endif +#endif /* MCC_H */ +/** + End of File +*/ \ No newline at end of file diff --git a/mcc_generated_files/system/utils/assembler.h b/mcc_generated_files/system/utils/assembler.h new file mode 100644 index 0000000..0182fcc --- /dev/null +++ b/mcc_generated_files/system/utils/assembler.h @@ -0,0 +1,49 @@ +/** + * Assembler Header File + * + * @file assembler.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the assembler header file for the configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef ASSEMBLER_H_INCLUDED +#define ASSEMBLER_H_INCLUDED + +#if !defined(__ASSEMBLER__) && !defined(__IAR_SYSTEMS_ASM__) && !defined(__DOXYGEN__) +#error This file may only be included from assembly files +#endif + +#if defined(__ASSEMBLER__) +#include "assembler/gas.h" +#include +#elif defined(__IAR_SYSTEMS_ASM__) +#include "assembler/iar.h" +#include +#endif + +#endif /* ASSEMBLER_H_INCLUDED */ diff --git a/mcc_generated_files/system/utils/assembler/gas.h b/mcc_generated_files/system/utils/assembler/gas.h new file mode 100644 index 0000000..44a0186 --- /dev/null +++ b/mcc_generated_files/system/utils/assembler/gas.h @@ -0,0 +1,120 @@ +/** + * GAS Header File + * + * @file gas.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated GAS header file for the Configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef ASSEMBLER_GAS_H_INCLUDED +#define ASSEMBLER_GAS_H_INCLUDED + +#ifndef __DOXYGEN__ + +/* clang-format off */ + + /* IAR doesn't accept dots in macro names */ + .macro ld_addr, reg, sym + lda.w \reg, \sym + .endm + + /* Define a function \a name that is either globally visible or only + * file-local. + */ + .macro gas_begin_func name, is_public + .if \is_public + .global \name + .endif + #ifdef __XC8 + .section .text.\name, code + #else + .section .text.\name, "ax", @progbits + #endif + .type \name, @function + \name : + .endm + + /* Define a function \a name that is either globally visible or only + * file-local in a given segment. + */ + .macro gas_begin_func_segm name, is_public, segment + .if \is_public + .global \name + .endif + .section .\segment, "ax", @progbits + .type \name, @function + \name : + .endm + + /* Define \a name as a weak alias for the function \a strong_name */ + .macro gas_weak_function_alias name, strong_name + .global \name + .weak \name + .type \name, @function + .set \name, \strong_name + .endm + + /* Define a weak function called \a name */ + .macro gas_weak_function name + .weak \name + gas_begin_func \name 1 + .endm + +#define REPEAT(count) .rept count +#define END_REPEAT() .endr +#define FILL_BYTES(count) .fill count +#define SET_LOC(offset) .org offset +#define L(name) .L##name +#define EXTERN_SYMBOL(name) + +#define TEXT_SECTION(name) \ + .section name, "ax", @progbits +#define RODATA_SECTION(name) \ + .section name, "a", @progbits +#define DATA_SECTION(name) \ + .section name, "aw", @progbits +#define BSS_SECTION(name) \ + .section name, "aw", @nobits + +#define FUNCTION(name) gas_begin_func name 0 +#define PUBLIC_FUNCTION(name) gas_begin_func name 1 +#define PUBLIC_FUNCTION_SEGMENT(name, segment) \ + gas_begin_func_segm name 1 segment +#define WEAK_FUNCTION(name) gas_weak_function name +#define WEAK_FUNCTION_ALIAS(name, strong_name) \ + gas_weak_function_alias name strong_name +#define END_FUNC(name) \ + .size name, . - name + +#define END_FILE() + +/* clang-format on */ + +#endif /* __DOXYGEN__ */ + +#endif /* ASSEMBLER_GAS_H_INCLUDED */ diff --git a/mcc_generated_files/system/utils/assembler/iar.h b/mcc_generated_files/system/utils/assembler/iar.h new file mode 100644 index 0000000..b2fe674 --- /dev/null +++ b/mcc_generated_files/system/utils/assembler/iar.h @@ -0,0 +1,104 @@ +/** + * IAR Header File + * + * @file iar.h + * + * @ingroup config_bitsdriver + * + * @brief This file contains the generated IAR header file for the Configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef ASSEMBLER_IAR_H_INCLUDED +#define ASSEMBLER_IAR_H_INCLUDED + +/* clang-format off */ + +ld_addr MACRO reg, sym + mov reg, LWRD sym + orh reg, HWRD sym + ENDM + +call MACRO sym + rcall sym + ENDM + +iar_begin_func MACRO name, sect, is_public, is_weak + MODULE name + RSEG CODE:CODE:NOROOT(1) + IF is_weak == 1 + PUBWEAK name + ELSEIF is_public + PUBLIC name + ENDIF +name: + ENDM + +iar_begin_func_segm MACRO name, sect, is_public, is_weak, segment + MODULE name + RSEG segment:CODE:NOROOT(1) + IF is_weak == 1 + PUBWEAK name + ELSEIF is_public + PUBLIC name + ENDIF +name: + ENDM + +iar_weak_alias MACRO name, strong_name + PUBWEAK name +name: + rjmp strong_name + ENDM + +#define lo(x) LWRD x +#define hi(x) HWRD x + +#define REPEAT(count) REPT count +#define END_REPEAT() ENDR +#define SET_LOC(offset) ORG offset +#define END_FILE() END + +#define FILL_BYTES(count) DS8 count + +#define L(name) name +#define EXTERN_SYMBOL(name) EXTERN name +#define FUNCTION(name) iar_begin_func name, text_##name, 0, 0 +#define PUBLIC_FUNCTION(name) iar_begin_func name, text_##name, 1, 0 +#define PUBLIC_FUNCTION_SEGMENT(name, segment) \ + iar_begin_func_segm name, text_##name, 1, 0, segment +#define WEAK_FUNCTION(name) iar_begin_func name, text_##name, 1, 1 +#define WEAK_FUNCTION_ALIAS(name, strong_name) \ + iar_weak_alias name, strong_name +#define END_FUNC(name) ENDMOD + +#define TEXT_SECTION(name) RSEG name:CODE:NOROOT +#define RODATA_SECTION(name) RSEG name:CONST:NOROOT +#define DATA_SECTION(name) RSEG name:DATA:NOROOT +#define BSS_SECTION(name) RSEG name:DATA:NOROOT + +/* clang-format on */ + +#endif /* ASSEMBLER_IAR_H_INCLUDED */ diff --git a/mcc_generated_files/system/utils/atomic.h b/mcc_generated_files/system/utils/atomic.h new file mode 100644 index 0000000..0878285 --- /dev/null +++ b/mcc_generated_files/system/utils/atomic.h @@ -0,0 +1,87 @@ +/** + * CONFIGURATION BITS Generated Atomic Header File + * + * @file atomic.h + * + * @defgroup doc_driver_utils_atomic Atomic memory access and critical sections + * + * @brief This file contains the atomic memory access and critical sections header file for the configuration bits driver. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef ATOMIC_H +#define ATOMIC_H + +/* clang-format off */ + +#if defined(__GNUC__) || defined (__DOXYGEN__) + +/** + * @brief Enters critical region. Saves the contents of the status register, including the Global Interrupt Enable bit, so that it can be restored upon leaving the critical region. + * Thereafter, clears the Global Interrupt Enable Bit.This macro takes a parameter P that is unused for the GCC compiler,but necessary for code compatibility with the IAR compiler. + * The IAR compiler declares a variable with the name of the parameter forholding the SREG value. + * Compilation will fail when the variable declared in the macro is not unique within the scope that the critical region is declared within. + * @param[in] UNUSED(GCC)/P(IAR) Name of variable storing SREG. + */ + +#define ENTER_CRITICAL(UNUSED) __asm__ __volatile__ ( \ + "in __tmp_reg__, __SREG__" "\n\t" \ + "cli" "\n\t" \ + "push __tmp_reg__" "\n\t" \ + ::: "memory" \ + ) + +/** + * @brief Exits a critical region. Restores the contents of the status register, including the Global Interrupt Enable bit, as it was when entering the critical region. + * This macro takes a parameter P that is unused for the GCC compiler, but necessary for code compatibility with the IAR compiler. + * The IAR compiler uses this parameter as the name of a variable that holds the SREG value. + * The parameter must be identical to the parameter used in the corresponding ENTER_CRITICAL(). + * @param[in] UNUSED(GCC)/P(IAR) Name of variable storing SREG + */ + +#define EXIT_CRITICAL(UNUSED) __asm__ __volatile__ ( \ + "pop __tmp_reg__" "\n\t" \ + "out __SREG__, __tmp_reg__" "\n\t" \ + ::: "memory" \ + ) + +#define DISABLE_INTERRUPTS() __asm__ __volatile__ ( "cli" ::: "memory") +#define ENABLE_INTERRUPTS() __asm__ __volatile__ ( "sei" ::: "memory") + +#elif defined(__ICCAVR__) + +#define ENTER_CRITICAL(P) unsigned char P = __save_interrupt();__disable_interrupt(); +#define EXIT_CRITICAL(P) __restore_interrupt(P); + +#define DISABLE_INTERRUPTS() __disable_interrupt(); +#define ENABLE_INTERRUPTS() __enable_interrupt(); + +#else +# error Unsupported compiler. +#endif + +/* clang-format on */ + +#endif /* ATOMIC_H */ diff --git a/mcc_generated_files/system/utils/compiler.h b/mcc_generated_files/system/utils/compiler.h new file mode 100644 index 0000000..5447b31 --- /dev/null +++ b/mcc_generated_files/system/utils/compiler.h @@ -0,0 +1,72 @@ +/** + * Compiler Header File + * + * @file compiler.h + * + * @defgroup doc_driver_utils_compiler Compiler abstraction + * + * @brief This file contains the compiler abstraction layer and code utilities for 8-bit AVR. This module provides various abstraction layers and utilities to make code compatible between different compilers. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + + +#ifndef UTILS_COMPILER_H +#define UTILS_COMPILER_H + +#if defined(__GNUC__) +#include +#include +#if defined(__XC8__) +#include +#endif +#elif defined(__ICCAVR__) +#define ENABLE_BIT_DEFINITIONS 1 +#include +#include + +#ifndef CCP_IOREG_gc +#define CCP_IOREG_gc 0xD8 /* CPU_CCP_IOREG_gc */ +#endif +#ifndef CCP_SPM_gc +#define CCP_SPM_gc 0x9D /* CPU_CCP_SPM_gc */ +#endif + +#else +#error Unsupported compiler. +#endif + +#include +#include +#include +#include + +#include "interrupt_avr8.h" + +/** + * @def UNUSED + * @brief Marking \a v as a unused parameter or value. + */ +#define UNUSED(v) (void)(v) + +#endif /* UTILS_COMPILER_H */ diff --git a/mcc_generated_files/system/utils/interrupt_avr8.h b/mcc_generated_files/system/utils/interrupt_avr8.h new file mode 100644 index 0000000..f5a21bb --- /dev/null +++ b/mcc_generated_files/system/utils/interrupt_avr8.h @@ -0,0 +1,88 @@ +/** + * interrupt_avr8 Header File + * + * @file interrupt_avr8.h + * + * @defgroup doc_driver_utils_interrupts ISR abstraction + * + * @brief Interrupt-related functionality. + * + * @version Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef UTILS_INTERRUPT_AVR8_H +#define UTILS_INTERRUPT_AVR8_H + +/** + * \weakgroup interrupt_group + * + * @{ + */ + +#ifdef ISR_CUSTOM_H +#include ISR_CUSTOM_H +#else + +/** + * @def ISR + * @brief Define service routine for specified interrupt vector. + * @code + ISR(FOO_vect) + { + ... + } + * @endcode + * + * @param vect Interrupt vector name as found in the device header files. + */ +#if defined(__DOXYGEN__) +#define ISR(vect) +#elif defined(__GNUC__) +#include +#elif defined(__ICCAVR__) +#define __ISR(x) _Pragma(#x) +#define ISR(vect) __ISR(vector = vect) __interrupt void handler_##vect(void) +#endif +#endif // ISR_CUSTOM_H + +#ifdef __GNUC__ +#define cpu_irq_enable() sei() +#define cpu_irq_disable() cli() +#else +#define cpu_irq_enable() __enable_interrupt() +#define cpu_irq_disable() __disable_interrupt() +#endif + +//! @} + +/** + * \weakgroup interrupt_deprecated_group + * @{ + */ +// Deprecated definitions. +#define Enable_global_interrupt() cpu_irq_enable() +#define Disable_global_interrupt() cpu_irq_disable() +#define Is_global_interrupt_enabled() cpu_irq_is_enabled() +//! @} + +#endif /* UTILS_INTERRUPT_AVR8_H */ diff --git a/mcc_generated_files/system/utils/utils.h b/mcc_generated_files/system/utils/utils.h new file mode 100644 index 0000000..37d3756 --- /dev/null +++ b/mcc_generated_files/system/utils/utils.h @@ -0,0 +1,52 @@ +/** + * utils Header File + * + * @file system.h + * + * @defgroup doc_driver_utils AVR Code utility functions + * + * @brief This file contains the compiler abstraction layer and code utilities for AVR.This module provides various abstraction layers and utilities to make code compatible between different compilers. + * + * @version Driver Version 1.0.1 + * \{ + * +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef UTILS_H_INCLUDED +#define UTILS_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Retrieve array size + */ +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + +/** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* UTILS_H_INCLUDED */ diff --git a/mcc_generated_files/system/utils/utils_assert.h b/mcc_generated_files/system/utils/utils_assert.h new file mode 100644 index 0000000..891d017 --- /dev/null +++ b/mcc_generated_files/system/utils/utils_assert.h @@ -0,0 +1,60 @@ +/** + * utils_assert Header File + * + * @file utils_assert.h + * + * @defgroup doc_driver_utils_assert Functionality for assert + * + * @brief This file contains the generated utils_assert header file for the configuration bits driver. + * + * @version Driver Version 1.0.1 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef _ASSERT_H_INCLUDED +#define _ASSERT_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * @brief Assert macro + * Macro used to throw asserts. It can be mapped to different function based on debug level. + * @param[in] condition A condition to be checked; assert is thrown if the given condition is false. + */ + +#ifdef DEBUG +#define ASSERT(condition) \ + if (!(condition)) \ + while (true) \ + ; +#else +#define ASSERT(condition) ((void)0) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* _ASSERT_H_INCLUDED */ diff --git a/mcc_generated_files/usb/src/usb0.c b/mcc_generated_files/usb/src/usb0.c new file mode 100644 index 0000000..e232dc2 --- /dev/null +++ b/mcc_generated_files/usb/src/usb0.c @@ -0,0 +1,89 @@ +/** + * USB0 Generated Driver File + * + * @file usb0.c + * + * @ingroup usb0 + * + * @brief This file contains the API implementations for the USB0 driver. + * + * @version USB0 Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include +#include "../usb0.h" +#include "../../system/syscfg.h" +#include "../../system/utils/compiler.h" + +static void USB0_DefaultTrnComplCallback(void); +static void USB0_DefaultBusEventCallback(void); +static void (*USB0_TrnCompl_isr_cb)(void) = &USB0_DefaultTrnComplCallback; +static void (*USB0_BusEvent_isr_cb)(void) = &USB0_DefaultBusEventCallback; + +void USB0_Initialize(void) +{ + // OVF enabled; RESET enabled; RESUME enabled; SOF enabled; STALLED enabled; SUSPEND enabled; UNF enabled; + USB0.INTCTRLA = 0xFE; + // GNDONE disabled; SETUP enabled; TRNCOMPL enabled; + USB0.INTCTRLB = 0x21; + SYSCFG_UsbVregDisable(); +} + +void USB0_TrnComplCallbackRegister(USB_cb_t cb) +{ + USB0_TrnCompl_isr_cb = cb; +} + +void USB0_BusEventCallbackRegister(USB_cb_t cb) +{ + USB0_BusEvent_isr_cb = cb; +} + +static void USB0_DefaultTrnComplCallback(void) +{ + // Clear the interrupt Flags + USB0.INTFLAGSB = USB_TRNCOMPL_bm | USB_GNDONE_bm | USB_SETUP_bm; +} + +static void USB0_DefaultBusEventCallback(void) +{ + // Clear the interrupt Flags + USB0.INTFLAGSA = USB_SOF_bm | USB_SUSPEND_bm | USB_RESUME_bm | USB_RESET_bm | USB_STALLED_bm | USB_UNF_bm | USB_OVF_bm; +} + +ISR(USB0_TRNCOMPL_vect) { + if (USB0_TrnCompl_isr_cb != NULL) + { + (*USB0_TrnCompl_isr_cb)(); + } +} + +ISR(USB0_BUSEVENT_vect) { + if (USB0_BusEvent_isr_cb != NULL) { + (*USB0_BusEvent_isr_cb)(); + } +} + +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb0.h b/mcc_generated_files/usb/usb0.h new file mode 100644 index 0000000..278cee7 --- /dev/null +++ b/mcc_generated_files/usb/usb0.h @@ -0,0 +1,74 @@ +/** + * USB0 Generated Driver API Header File + * + * @file usb0.h + * + * @defgroup usb0 USB0 + * + * @brief This file contains the API prototypes for the USB0 driver. + * + * @version USB0 Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef USB0_H +#define USB0_H + +/** + * @ingroup usb0 + * @typedef void *USB_cb_t + * @brief Data type for the interrupt handlers called by USB. The default value is set to NULL which means that no callback function will be used. + */ +typedef void (*USB_cb_t)(void); + +/** + Section: USB0 APIs +*/ + +/** + * @ingroup usb0 + * @brief Initializes USB0. + * @param None. + * @return None. + */ +void USB0_Initialize(void); + +/** + * @ingroup usb0 + * @brief Registers a callback function handling the Interrupt Service Routine (ISR) if a Transaction Complete interrupt flag is set. + * @param USB_cb_t cb - Callback function for a transaction complete event + * @return None. + */ +void USB0_TrnComplCallbackRegister(USB_cb_t cb); + +/** + * @ingroup usb0 + * @brief Registers a callback function handling the ISR if a Bus Event interrupt flag is set. + * @param USB_cb_t cb - Callback function for a bus event + * @return None. + */ +void USB0_BusEventCallbackRegister(USB_cb_t cb); + +#endif // USB0_H +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb_common/usb_common_elements.h b/mcc_generated_files/usb/usb_common/usb_common_elements.h new file mode 100644 index 0000000..688bdd3 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_common_elements.h @@ -0,0 +1,99 @@ +/** + * USBCOMMONELEMENTS Common Elements Header File + * @file usb_common_elements.h + * @defgroup usb_common USB Common Elements + * @ingroup usb_core + * @brief Common elements for the USB stack. + * @version USB Common Elements Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_COMMON_ELEMENTS_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_COMMON_ELEMENTS_H + +#ifndef TEST +#define STATIC static +#else +#define STATIC +#endif + +/** + * @ingroup usb_common + * @enum RETURN_CODE_enum + * @brief Describes the different function return reserved codes used by the USB stack. + */ + +typedef enum RETURN_CODE_enum +{ + UNSUPPORTED = 2, /** +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +RETURN_CODE_t USB_SetupProcess(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_REQUEST_TYPE_STANDARD == (USB_REQUEST_TYPE_t)setupRequestPtr->bmRequestType.type) + { + // Checks that an IN request actually requests data. + if ((USB_REQUEST_DIR_IN == (USB_REQUEST_DIR_t)setupRequestPtr->bmRequestType.dataPhaseTransferDirection) && (0u == setupRequestPtr->wLength)) + { + status = CONTROL_SETUP_DIRECTION_ERROR; + } + else + { + // Makes sure the data out transfer is reset before handling requests. + USB_ControlTransferDataSet(NULL, 0u); + + switch (setupRequestPtr->bmRequestType.recipient) + { + case USB_REQUEST_RECIPIENT_DEVICE: + { + status = USB_SetupProcessDeviceRequest(setupRequestPtr); + break; + } + case USB_REQUEST_RECIPIENT_ENDPOINT: + { + status = USB_SetupProcessEndpointRequest(setupRequestPtr); + break; + } + case USB_REQUEST_RECIPIENT_INTERFACE: + { + status = USB_SetupProcessInterfaceRequest(setupRequestPtr); + break; + } + case USB_REQUEST_RECIPIENT_OTHER: + { + if (NULL != event.OtherRequest) + { + status = event.OtherRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + break; + } + default: + status = UNSUPPORTED; + break; + } + } + } + else if (USB_REQUEST_TYPE_CLASS == (USB_REQUEST_TYPE_t)setupRequestPtr->bmRequestType.type) + { + if (NULL != event.ClassRequest) + { + status = event.ClassRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + } + else if (USB_REQUEST_TYPE_VENDOR == (USB_REQUEST_TYPE_t)setupRequestPtr->bmRequestType.type) + { + if (NULL != event.VendorRequest) + { + status = event.VendorRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + } + else + { + status = UNSUPPORTED; + } + + return status; +} + +RETURN_CODE_t USB_Start(void) +{ + RETURN_CODE_t status = SUCCESS; + + // Configures setup callback. + USB_ControlProcessSetupCallbackRegister(USB_SetupProcess); + + // Sets up the peripheral. + USB_PeripheralInitialize(); + + // Initializes and configures the endpoints. + USB_PIPE_t pipe = { .address = 0 }; + while (pipe.address < USB_EP_NUM) + { + if (status == SUCCESS) + { + pipe.direction = USB_EP_DIR_OUT; + status = USB_PipeReset(pipe); + } + if (status == SUCCESS) + { + pipe.direction = USB_EP_DIR_IN; + status = USB_PipeReset(pipe); + } + pipe.address++; + } + + // Initializes the control endpoints. + if (status == SUCCESS) + { + status = USB_ControlEndpointsInit(); + } + + // Attaches the device to the bus. + if (status == SUCCESS) + { + status = USB_ControlTransferReset(); + } + + if (status == SUCCESS) + { + USB_BusAttach(); + } + + return status; +} + +RETURN_CODE_t USB_Stop(void) +{ + RETURN_CODE_t status = SUCCESS; + + // Detaches from the bus and disables peripheral. + USB_BusDetach(); + USB_PeripheralDisable(); + + // Aborts any ongoing transfers. + USB_PIPE_t pipe = { .address = 0 }; + while (pipe.address < USB_EP_NUM) + { + if (status == SUCCESS) + { + pipe.direction = USB_EP_DIR_OUT; + status = USB_TransferAbort(pipe); + } + if (status == SUCCESS) + { + pipe.direction = USB_EP_DIR_IN; + status = USB_TransferAbort(pipe); + } + pipe.address++; + } + + return status; +} + +RETURN_CODE_t USB_Reset(void) +{ + RETURN_CODE_t status = UNINITIALIZED; + status = USB_Stop(); + if (status == SUCCESS) + { + status = USB_Start(); + } + return status; +} diff --git a/mcc_generated_files/usb/usb_common/usb_core.h b/mcc_generated_files/usb/usb_common/usb_core.h new file mode 100644 index 0000000..cf43dd8 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core.h @@ -0,0 +1,95 @@ +/** + * USBCORE CORE Header File + * @file usb_core.h + * @defgroup usb_core USB Core Layer + * @brief Core functionality for the USB stack. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_CORE_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_H + +#include +#include + +#include +#include +#include +#include + +/** + * @ingroup usb_core + * @brief Setup function for the Standard Device Request USB 2.0 Specification Ch 9.4. + * | bRequest | wValue | wIndex | wLength | Data | + * |-------------------|---------------------------------------|-------------------------|-------------------|-------------------------------------| + * | CLEAR_FEATURE | Feature Selector | Zero | None | | + * | CLEAR_FEATURE | Feature Selector | Interface | None | | + * | CLEAR_FEATURE | Feature Selector | Endpoint | None | | + * | GET_CONFIGURATION | Zero | Zero | One | Configuration Value | + * | GET_DESCRIPTOR | Descriptor type and Descriptor index | Zero or Language ID | Descriptor Length | Descriptor | + * | GET_INTERFACE | Zero | Interface | One | Alternate Interface | + * | GET_STATUS | Zero | Zero Interface Endpoint | Two | Device status | + * | GET_STATUS | Zero | Interface | Two | Interface Status | + * | GET_STATUS | Zero | Endpoint | Two | Endpoint Status | + * | SET_ADDRESS | Device Address | Zero | Zero | None | + * | SET_CONFIGURATION | Configuration Value | Zero | Zero | None | + * | SET_DESCRIPTOR | Descriptor type and Descriptor index | Zero or Language ID | Descriptor Length | Descriptor | + * | SET_FEATURE | Feature Selector | Zero Interface Endpoint | Zero | None | + * | SET_FEATURE | Feature Selector | Interface | Zero | | + * | SET_FEATURE | Feature Selector | Endpoint | Zero | | + * | SET_INTERFACE | Alternate Setting | Interface | Zero | None | + * | SYNCH_FRAME | Zero | Endpoint | Two | Frame Number | + * @param *setupRequestPtr - Pointer to the setup request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupProcess(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core + * @brief Starts the USB peripheral, configures the callbacks and attaches it to the bus. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_Start(void); + +/** + * @ingroup usb_core + * @brief Stops the USB peripheral and detaches it from the bus. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_Stop(void); + +/** + * @ingroup usb_core + * @brief Resets the USB peripheral. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_Reset(void); + +#endif /* USB_CORE_H */ diff --git a/mcc_generated_files/usb/usb_common/usb_core_descriptors.c b/mcc_generated_files/usb/usb_common/usb_core_descriptors.c new file mode 100644 index 0000000..1ea29db --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_descriptors.c @@ -0,0 +1,658 @@ +/** + * USBCOREDESCRIPTOR Core Descriptors Source File + * @file usb_core_descriptors.h + * @ingroup usb_core_descriptors + * @brief descriptors for the USB Core Stack. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/** + * @ingroup usb_core_descriptors + * @def USB_DEFAULT_INTERFACE + * @brief Default interface number. + */ +#define USB_DEFAULT_INTERFACE 0u + +/** + * @ingroup usb_core_descriptors + * @def USB_DEFAULT_ALTERNATE_SETTING + * @brief Default alternate setting. + */ +#define USB_DEFAULT_ALTERNATE_SETTING 0u + +/** + * @ingroup usb_core_descriptors + * @def USB_DESCRIPTOR_SEARCH_LIMIT + * @brief The number of descriptors NextDescriptorPointerGet will search through before returning an error. + */ +#define USB_DESCRIPTOR_SEARCH_LIMIT 30u + +/** + * @typedef USB_DESCRIPTOR_PTR_t + * @brief Union of a uint8_t pointer and pointers to the different descriptor types. + * @misradeviation{@advisory,19.2} Needed for the stack to parse through the configuration descriptors + * without pointer casting between the different descriptor types and uint8_t. + */ +// cppcheck-suppress misra-c2012-19.2 +typedef union USB_DESCRIPTOR_PTR_union +{ + uint8_t *bytePtr; + USB_DESCRIPTOR_HEADER_t *headerPtr; + USB_ENDPOINT_DESCRIPTOR_t *endpointPtr; + USB_INTERFACE_DESCRIPTOR_t *interfacePtr; + USB_CONFIGURATION_DESCRIPTOR_t *configurationPtr; +} USB_DESCRIPTOR_PTR_t; + + +STATIC USB_CONFIGURATION_DESCRIPTOR_t *activeConfigurationPtr = NULL; +STATIC uint8_t activeInterfaces[USB_INTERFACE_NUM]; +STATIC USB_DESCRIPTOR_POINTERS_t *applicationPointers = NULL; + +RETURN_CODE_t USB_DescriptorPointersSet(USB_DESCRIPTOR_POINTERS_t *descriptorPointersPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (NULL != descriptorPointersPtr) + { + // Checks that the device pointer is pointing to a struct with the device type. + if ((NULL == descriptorPointersPtr->devicePtr) || (USB_DESCRIPTOR_TYPE_DEVICE != (USB_DESCRIPTOR_TYPE_t)descriptorPointersPtr->devicePtr->header.bDescriptorType)) + { + status = DESCRIPTOR_POINTER_ERROR; + } + // Checks that the first configuration pointer is pointing to a struct with the configuration type. + else if ((NULL == descriptorPointersPtr->configurationsPtr) || (USB_DESCRIPTOR_TYPE_CONFIGURATION != (USB_DESCRIPTOR_TYPE_t)descriptorPointersPtr->configurationsPtr->header.bDescriptorType)) + { + status = DESCRIPTOR_POINTER_ERROR; + } + else + { + status = SUCCESS; + } + } + else + { + status = DESCRIPTOR_POINTER_ERROR; + } + + if (SUCCESS == status) + { + // Saves the pointer structure address. + applicationPointers = descriptorPointersPtr; + } + + return status; +} + +RETURN_CODE_t USB_DescriptorConfigurationEnable(uint8_t configurationValue) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Descriptor pointer to search through the different descriptors + // cppcheck-suppress misra-c2012-19.2 + USB_DESCRIPTOR_PTR_t currentDescriptor; + + if (NULL == applicationPointers) + { + status = DESCRIPTOR_POINTER_ERROR; + } + else + { + if (NULL != activeConfigurationPtr) + { + status = SUCCESS; + + // Find and disable all active interfaces in the current configuration + currentDescriptor.configurationPtr = activeConfigurationPtr; + uint8_t numInterfaces = activeConfigurationPtr->bNumInterfaces; + while ((SUCCESS == status) && (numInterfaces > 0u)) + { + status = NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_INTERFACE, ¤tDescriptor.headerPtr); + + if (SUCCESS == status) + { + if (activeInterfaces[currentDescriptor.interfacePtr->bInterfaceNumber] == currentDescriptor.interfacePtr->bAlternateSetting) + { + status = USB_DescriptorInterfaceConfigure(currentDescriptor.interfacePtr->bInterfaceNumber, USB_DEFAULT_ALTERNATE_SETTING, false); + numInterfaces--; + } + } + } + } + else + { + // No current configuration, nothing to disable + status = SUCCESS; + } + + if (SUCCESS == status) + { + if (USB_REQUEST_DEVICE_DISABLE_CONFIGURATION == configurationValue) + { + // Active configuration is disabled, so clear pointer + activeConfigurationPtr = NULL; + } + else + { + // Get new configuration pointer and enable its interfaces + status = ConfigurationPointerGet(configurationValue, &activeConfigurationPtr); + + if (SUCCESS == status) + { + // Find and enable all interfaces in the set configuration with bAlternateSetting == 0 + currentDescriptor.configurationPtr = activeConfigurationPtr; + uint8_t numInterfaces = activeConfigurationPtr->bNumInterfaces; + while ((SUCCESS == status) && (numInterfaces > 0u)) + { + status = NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_INTERFACE, ¤tDescriptor.headerPtr); + if (SUCCESS == status) + { + if (USB_DEFAULT_ALTERNATE_SETTING == currentDescriptor.interfacePtr->bAlternateSetting) + { + status = USB_DescriptorInterfaceConfigure(currentDescriptor.interfacePtr->bInterfaceNumber, USB_DEFAULT_ALTERNATE_SETTING, true); + numInterfaces--; + } + } + } + } + } + } + } + + return status; +} + +uint8_t USB_DescriptorActiveConfigurationValueGet(void) +{ + uint8_t configurationValue = USB_REQUEST_DEVICE_DISABLE_CONFIGURATION; + + if (NULL != activeConfigurationPtr) + { + configurationValue = activeConfigurationPtr->bConfigurationValue; + } + + return configurationValue; +} + +bool USB_DescriptorActiveConfigurationSelfPoweredGet(void) +{ + return (activeConfigurationPtr->bmAttributes & USB_CONFIG_ATTR_SELF_POWERED) == USB_CONFIG_ATTR_SELF_POWERED; +} + +bool USB_DescriptorActiveConfigurationRemoteWakeupGet(void) +{ + return (activeConfigurationPtr->bmAttributes & USB_CONFIG_ATTR_REMOTE_WAKEUP) == USB_CONFIG_ATTR_REMOTE_WAKEUP; +} + +RETURN_CODE_t ConfigurationPointerGet(uint8_t configurationValue, USB_CONFIGURATION_DESCRIPTOR_t **configurationPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Checks if the requested configuration is an existing configuration. + if (configurationValue > applicationPointers->devicePtr->bNumConfigurations) + { + status = DESCRIPTOR_CONFIGURATIONS_ERROR; + } + else + { + // If there is only one configuration, return the pointer to the configuration. + if (1u == applicationPointers->devicePtr->bNumConfigurations) + { + *configurationPtr = applicationPointers->configurationsPtr; + status = SUCCESS; + } + else + { + // Pointer initialized to the address of the first configuration descriptor. + // cppcheck-suppress misra-c2012-19.2 + USB_DESCRIPTOR_PTR_t currentDescriptor = { .configurationPtr = applicationPointers->configurationsPtr }; + + uint8_t i = applicationPointers->devicePtr->bNumConfigurations; + while (i-- > 0u) + { + if (currentDescriptor.configurationPtr->bConfigurationValue != configurationValue) + { + status = NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_CONFIGURATION, ¤tDescriptor.headerPtr); + } + else + { + status = SUCCESS; + + // Ends loop on success + i = 0; + } + + if (SUCCESS != status) + { + // Ends loop on error. + i = 0; + } + } + + if (SUCCESS == status) + { + if (currentDescriptor.configurationPtr->bConfigurationValue == configurationValue) + { + *configurationPtr = currentDescriptor.configurationPtr; + } + else + { + // configurationValue not found + status = DESCRIPTOR_SEARCH_ERROR; + } + } + } + } + + return status; +} + +RETURN_CODE_t NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_t descriptorType, USB_DESCRIPTOR_HEADER_t **descriptorHeaderPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // cppcheck-suppress misra-c2012-19.2 + USB_DESCRIPTOR_PTR_t currentDescriptor = { .headerPtr = *descriptorHeaderPtr }; + + uint8_t incrementCount = 0u; + while (UNINITIALIZED == status) + { + // Increments to the start of the next pointer. + if ((USB_DESCRIPTOR_TYPE_CONFIGURATION == descriptorType) && (USB_DESCRIPTOR_TYPE_CONFIGURATION == (USB_DESCRIPTOR_TYPE_t)currentDescriptor.headerPtr->bDescriptorType)) + { + // If the device is looking for the next configuration, it increments the pointer with total length of the configuration. + currentDescriptor.bytePtr = ¤tDescriptor.bytePtr[currentDescriptor.configurationPtr->wTotalLength]; + } + else + { + // Else it only increments with the descriptor length. + currentDescriptor.bytePtr = ¤tDescriptor.bytePtr[currentDescriptor.headerPtr->bLength]; + } + + // Checks whether it has found the correct descriptor type or if it needs to continue looping. + if (descriptorType == (USB_DESCRIPTOR_TYPE_t)currentDescriptor.headerPtr->bDescriptorType) + { + status = SUCCESS; + *descriptorHeaderPtr = currentDescriptor.headerPtr; + } + else + { + // If it has looped through too many descriptors, it is assumed that the descriptor structure is set up incorrectly and the loop is exited. + if (incrementCount++ > USB_DESCRIPTOR_SEARCH_LIMIT) + { + status = DESCRIPTOR_SEARCH_ERROR; + } + } + } + + return status; +} + +RETURN_CODE_t USB_DescriptorInterfaceConfigure(uint8_t interfaceNumber, uint8_t alternateSetting, bool enable) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (NULL != activeConfigurationPtr) + { + // Pointer initialized to the address of the active configuration descriptor + // cppcheck-suppress misra-c2012-19.2 + USB_DESCRIPTOR_PTR_t currentDescriptor = { .configurationPtr = activeConfigurationPtr }; + + // Limit to end of configuration to make sure the loop does not overflow + uint8_t *endOfConfiguration = ¤tDescriptor.bytePtr[currentDescriptor.configurationPtr->wTotalLength]; + + // Find first interface descriptor before entering loop + status = NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_INTERFACE, ¤tDescriptor.headerPtr); + + // Loop through all the descriptors in the current configuration + USB_INTERFACE_DESCRIPTOR_t *enableInterfacePtr = NULL; + while ((SUCCESS == status) && (currentDescriptor.bytePtr < endOfConfiguration)) + { + // Check if interface number and alternate setting correspond to the active interface before disabling endpoints + if ((interfaceNumber == currentDescriptor.interfacePtr->bInterfaceNumber) && (activeInterfaces[interfaceNumber] == currentDescriptor.interfacePtr->bAlternateSetting)) + { + // Disable endpoints for the active alternate interface + status = DescriptorEndpointsConfigure(currentDescriptor.interfacePtr, false); + if (SUCCESS == status) + { + // Reset the active alternate interface to 0 + status = ActiveAlternateSettingSet(interfaceNumber, USB_DEFAULT_ALTERNATE_SETTING); + } + } + + if (enable) + { + if (interfaceNumber == currentDescriptor.interfacePtr->bInterfaceNumber) + { + if (alternateSetting == currentDescriptor.interfacePtr->bAlternateSetting) + { + // Requested interface found + enableInterfacePtr = currentDescriptor.interfacePtr; + } + } + } + + status = NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_INTERFACE, ¤tDescriptor.headerPtr); + if (DESCRIPTOR_SEARCH_ERROR == status) + { + // Search error from NextDescriptorPointerGet means search is complete + if ((false == enable) || (NULL != enableInterfacePtr)) + { + // Search was successful, correcting status + status = SUCCESS; + + // Set byte pointer to end of config to exit loop + currentDescriptor.bytePtr = endOfConfiguration; + } + } + } + + if (SUCCESS == status) + { + if (true == enable) + { + if (NULL != enableInterfacePtr) + { + // Enable the endpoints for the activated interface + status = DescriptorEndpointsConfigure(enableInterfacePtr, true); + if (SUCCESS == status) + { + status = ActiveAlternateSettingSet(interfaceNumber, alternateSetting); + } + } + else + { + status = DESCRIPTOR_SEARCH_ERROR; + } + } + } + } + else + { + status = DESCRIPTOR_POINTER_ERROR; + } + + return status; +} + +RETURN_CODE_t ActiveAlternateSettingSet(uint8_t interfaceNumber, uint8_t alternateSetting) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (interfaceNumber < USB_INTERFACE_NUM) + { + activeInterfaces[interfaceNumber] = alternateSetting; + status = SUCCESS; + } + else + { + status = INTERFACE_SET_ERROR; + } + + return status; +} + +RETURN_CODE_t ActiveAlternateSettingGet(uint8_t interfaceNumber, uint8_t *alternateSetting) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (interfaceNumber < USB_INTERFACE_NUM) + { + *alternateSetting = activeInterfaces[interfaceNumber]; + status = SUCCESS; + } + else + { + status = INTERFACE_GET_ERROR; + } + + return status; +} + +RETURN_CODE_t DescriptorEndpointsConfigure(USB_INTERFACE_DESCRIPTOR_t *interfacePtr, bool enable) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_DESCRIPTOR_TYPE_INTERFACE == interfacePtr->header.bDescriptorType) + { + // The number of endpoints to enable/disable is found from the interface. + uint8_t numEndpoints = interfacePtr->bNumEndpoints; + if (numEndpoints > 0u) + { + // cppcheck-suppress misra-c2012-19.2 + USB_DESCRIPTOR_PTR_t currentDescriptor = { .interfacePtr = interfacePtr }; + + while (numEndpoints > 0u) + { + // Pre-increments to the next descriptor, since the initial descriptor is the interface. + currentDescriptor.bytePtr = ¤tDescriptor.bytePtr[currentDescriptor.headerPtr->bLength]; + + if (USB_DESCRIPTOR_TYPE_ENDPOINT == (USB_DESCRIPTOR_TYPE_t)currentDescriptor.headerPtr->bDescriptorType) + { + if (true == enable) + { + // Configures endpoint according to descriptor. + status + = USB_EndpointConfigure(currentDescriptor.endpointPtr->bEndpointAddress, currentDescriptor.endpointPtr->wMaxPacketSize, currentDescriptor.endpointPtr->bmAttributes.type); + } + else + { + // Aborts any ongoing transfer and disable endpoint. + status = USB_TransferAbort(currentDescriptor.endpointPtr->bEndpointAddress); + if (SUCCESS == status) + { + status = USB_EndpointDisable(currentDescriptor.endpointPtr->bEndpointAddress); + } + } + + numEndpoints--; + + if (SUCCESS != status) + { + // Exits loop immediately. + numEndpoints = 0; + } + } + } + } + else + { + // Interface has no endpoints. + status = SUCCESS; + } + } + else + { + status = DESCRIPTOR_ENDPOINT_ERROR; + } + + return status; +} + +RETURN_CODE_t USB_DescriptorPointerGet(USB_DESCRIPTOR_TYPE_t descriptor, uint8_t attribute, uint8_t **descriptorPtr, uint16_t *descriptorLength) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // cppcheck-suppress misra-c2012-19.2 + USB_DESCRIPTOR_PTR_t localDescriptorPtr; + + switch (descriptor) + { + case USB_DESCRIPTOR_TYPE_DEVICE: + // Returns pointer to device descriptor. + if (applicationPointers != NULL) + { + *descriptorPtr = (uint8_t *)applicationPointers->devicePtr; + *descriptorLength = (uint16_t)applicationPointers->devicePtr->header.bLength; + status = SUCCESS; + } + else + { + status = DESCRIPTOR_POINTER_ERROR; + } + break; + case USB_DESCRIPTOR_TYPE_CONFIGURATION:; + // Returns pointer to configuration, with the total length. + + status = ConfigurationPointerGet(attribute, &localDescriptorPtr.configurationPtr); + if (SUCCESS == status) + { + *descriptorPtr = localDescriptorPtr.bytePtr; + *descriptorLength = localDescriptorPtr.configurationPtr->wTotalLength; + } + break; + case USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER: + // Only for high-speed. + status = UNSUPPORTED; + break; + case USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION: + // Only for high-speed. + status = UNSUPPORTED; + break; + case USB_DESCRIPTOR_TYPE_BOS: + if (NULL != applicationPointers->deviceBOSptr) + { + *descriptorPtr = (uint8_t *)applicationPointers->deviceBOSptr; + *descriptorLength = (uint16_t)applicationPointers->deviceBOSptr->wTotalLength; + status = SUCCESS; + } + else + { + status = UNSUPPORTED; + } + break; + default: + // Find class or vendor descriptor types in the active configuration + if (descriptor >= USB_DESCRIPTOR_TYPE_CLASS) + { + localDescriptorPtr.configurationPtr = activeConfigurationPtr; + + // Find the first descriptor available of the current type + status = NextDescriptorPointerGet(descriptor, &localDescriptorPtr.headerPtr); + if (SUCCESS == status) + { + *descriptorPtr = (uint8_t *)localDescriptorPtr.headerPtr; + *descriptorLength = localDescriptorPtr.headerPtr->bLength; + } + } + else + { + status = DESCRIPTOR_REQUEST_ERROR; + } + + break; + } + + if (SUCCESS != status) + { + *descriptorPtr = NULL; + *descriptorLength = 0u; + } + + return status; +} + +RETURN_CODE_t USB_DescriptorStringPointerGet(uint8_t stringIndex, uint16_t langID, uint8_t **descriptorAddressPtr, uint16_t *descriptorLength) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (NULL != applicationPointers->langIDptr) + { + if (stringIndex == 0u) + { + // Index 0 is the language id index, writes pointer and length. + *descriptorAddressPtr = (uint8_t *)applicationPointers->langIDptr; + *descriptorLength = (uint16_t)applicationPointers->langIDptr->header.bLength; + status = SUCCESS; + } + else + { + // Iterates through the supported language IDs to find the index. + uint8_t langIdx = 0; + for (langIdx = 0; langIdx < LANG_ID_NUM; langIdx++) + { + if (langID == applicationPointers->langIDptr->id_array[langIdx]) + { + // Language match, langIdx found. + break; + } + } + + if (LANG_ID_NUM == langIdx) + { + // Language ID not in langID struct, returns UNSUPPORTED. + status = UNSUPPORTED; + } + else if (NULL != applicationPointers->stringPtrs[langIdx]) + { + // Iterates through string descriptors to account for different string lengths. + USB_DESCRIPTOR_HEADER_t *stringHeader = applicationPointers->stringPtrs[langIdx]; + if (1u == stringIndex) + { + status = SUCCESS; + } + else + { + for (uint8_t i = 1u; i < stringIndex; i++) + { + status = NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_STRING, &stringHeader); + } + } + + // Writes pointer and length. + if (SUCCESS == status) + { + *descriptorAddressPtr = (uint8_t *)stringHeader; + *descriptorLength = (uint16_t)stringHeader->bLength; + } + } + else + { + // stringPtrs not set up correctly, returns error. + status = DESCRIPTOR_POINTER_ERROR; + } + } + } + else + { + // langIDptr not set up, returns unsupported and stalls request. + status = UNSUPPORTED; + } + + return status; +} diff --git a/mcc_generated_files/usb/usb_common/usb_core_descriptors.h b/mcc_generated_files/usb/usb_common/usb_core_descriptors.h new file mode 100644 index 0000000..c5dd4e3 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_descriptors.h @@ -0,0 +1,181 @@ +/** + * USBCOREDESCRIPTOR Core Descriptors Header File + * @file usb_core_descriptors.h + * @defgroup usb_core_descriptors USB Descriptor Definitions + * @ingroup usb_core + * @brief In this file the active configuration and interfaces can be changed. + * The active configuration and active interface is referenced by a pointer as two global variables. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_CORE_DESCRIPTORS_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_DESCRIPTORS_H + +#include + +#include +#include + +/** + * @ingroup usb_core + * @brief Handles Descriptor pointer setup. + * Sets the address to the application descriptor pointers. + * Checks if the device pointer and a pointer to the start of the application configuration(s) are set before saving the address to the USB Core Stack. + * @param *descriptorPtr - The address of the application descriptor pointers + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DescriptorPointersSet(USB_DESCRIPTOR_POINTERS_t *descriptorPtr); + +/** + * @ingroup usb_core + * @brief Enables endpoint configuration descriptor. + * + * The USB Device Enable Endpoint function, from USB 2.0 Specification Ch. 9.6.6. + * | Offset | Field | Size | Value | Description | + * |--------|------------------|------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | 0 | bLength | 1 | Number | Size of this descriptor in bytes | + * | 1 | bDescriptorType | 1 | Constant | CONFIGURATION Descriptor Type | + * | 2 | bEndpointAddress | 1 | Endpoint | Address of the endpoint on the USB device described by this descriptor. Address is encoded by the following: Bit 3-0: The endpoint number, Bit 6-4: Reserved, reset to zero, Bit 7: Direction, ignored for control endpoint. 0 = OUT endpoint, 1 = IN endpoint | + * | 3 | bmAttributes | 1 | Bitmap | Describes the endpoint attributes when it is configured using the bConfigurationValue. Bit 1-0: Transfer type, 00=Control, 01=Isochronous, 10=Bulk, 11=Interrupt. If not isochronous endpoint, bit 5-2 are reserved and must be set to zero. If isochronous: Bit 3-2: Synchronization type, 00 = No Sync, 01 = Async, 10 = Adaptive, 11 = Sync. Bit 5-4: Usage type, 00 = Data endpoint, 01 = Feedback endpoint, 10 = Implicit feedback Data endpoint, 11 = Reserved. All other bits are reserved and must be reset to zero. Reserved bits must be ignored by the host. | + * | 4 | wMaxPacketSize | 2 | Number | Maximum packet size this endpoint is capable of RX/TX when this configuration is selected. For isochronous endpoints, this value is used to reserve bus time in the schedule. For all endpoints, bit 10-0 specify maximum packet size. For high-speed isochronous and interrupt endpoints: Bit 12-11 number of additional transaction opportunities per microframe, 00 = None (1 transaction per microframe), 01 = 1 additional, 10 = 2 additional, 11 = Reserved. Bits 15-13 are reserved and must be set to zero. | + * + * @param configurationValue - The value of the configuration to be enabled + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DescriptorConfigurationEnable(uint8_t configurationValue); + +/** + * @ingroup usb_core + * @brief Gets the Self-Powered setting from the active configuration. + * @param None. + * @retval 0 - Self-Powered is not enabled + * @retval 1 - Self-Powered is enabled + */ +bool USB_DescriptorActiveConfigurationSelfPoweredGet(void); + +/** + * @ingroup usb_core + * @brief Gets the Remote Wake-up setting from the active configuration. + * @param None. + * @retval 0 - Remote Wake-up is not enabled + * @retval 1 - Remote Wake-up is enabled + */ +bool USB_DescriptorActiveConfigurationRemoteWakeupGet(void); + +/** + * @ingroup usb_core + * @brief Gets the active configuration value. + * @param None. + * @return The active configuration value + */ +uint8_t USB_DescriptorActiveConfigurationValueGet(void); + +/** + * @ingroup usb_core + * @brief Enables or Disables an Interface Descriptor. + * + * The USB Device Enable Interface Descriptor, from USB 2.0 Specification Ch. 9.6.5. + * | Offset | Field | Size | Value | Description | + * |--------|---------------------|------|----------|---------------------------------------------------------------------------------------------------------------------------------------| + * | 2 | bInterfaceNumber | 1 | Number | Number of this interface. Zero-based value identifying the index in the array of concurrent interfaces supported by this configuration| + * | 3 | bAlternateSetting | 1 | Number | Value used to select this alternate setting for the interface identified in the prior field | + * + * @param interfaceNumber - Interface number value + * @param alternateSetting - Alternative settings value, ignored if enable is false + . @param enable - Enable or disable the interface. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DescriptorInterfaceConfigure(uint8_t interfaceNumber, uint8_t alternateSetting, bool enable); + +/** + * @ingroup usb_core + * @brief Gets the pointer to the descriptor. + * @param descriptor - Descriptor type + * @param attribute - Attribute type + * @param **descriptorPtr - Pointer to the descriptor + * @param *descriptorLength - Length of the descriptor + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DescriptorPointerGet(USB_DESCRIPTOR_TYPE_t descriptor, uint8_t attribute, uint8_t **descriptorPtr, uint16_t *descriptorLength); + +/** + * @ingroup usb_core + * @brief Gets the pointer to the string descriptor. + * @param stringIndex - Index of the string + * @param langID - Language ID + * @param **descriptorAddressPtr - Pointer to the descriptor + * @param *descriptorLength - Length of the descriptor + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DescriptorStringPointerGet(uint8_t stringIndex, uint16_t langID, uint8_t **descriptorAddressPtr, uint16_t *descriptorLength); + +/** + * @ingroup usb_core + * @brief Get the active alternate interface number for an interface. + * @param interfaceNumber - The interface number to get the alternate setting for + * @param *alternateSetting - The requested alternate setting + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t ActiveAlternateSettingGet(uint8_t interfaceNumber, uint8_t *alternateSetting); + +/** + * @ingroup usb_core + * @brief Set the active alternate interface number for an interface. + * @param interfaceNumber - The interface number to set the alternate setting for + * @param alternateSetting - The alternate setting to set + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t ActiveAlternateSettingSet(uint8_t interfaceNumber, uint8_t alternateSetting); + +/** + * @ingroup usb_core + * @brief Collects the configuration pointer. + * @param configurationValue - Value of the referenced configuration + * @param **configurationPtr - Pointer to the configuration + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t ConfigurationPointerGet(uint8_t configurationValue, USB_CONFIGURATION_DESCRIPTOR_t **configurationPtr); + +/** + * @ingroup usb_core + * @brief Configures the endpoints as given in the descriptor. + * @param *interfacePtr - Pointer to an interface + * @param enable - Boolean to enable or disable the endpoint + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t DescriptorEndpointsConfigure(USB_INTERFACE_DESCRIPTOR_t *interfacePtr, bool enable); + +/** + * @ingroup usb_core + * @brief Gets the next descriptor. + * @param descriptorType - Selected descriptor type + * @param **descriptorHeaderPtr - Pointer to the descriptor header + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t NextDescriptorPointerGet(USB_DESCRIPTOR_TYPE_t descriptorType, USB_DESCRIPTOR_HEADER_t **descriptorHeaderPtr); + +#endif /* USB_CORE_DESCRIPTORS_H */ \ No newline at end of file diff --git a/mcc_generated_files/usb/usb_common/usb_core_events.c b/mcc_generated_files/usb/usb_common/usb_core_events.c new file mode 100644 index 0000000..8fd11b9 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_events.c @@ -0,0 +1,170 @@ +/** + * USBCOREEVENTS USB Core Events Source File + * @file usb_core_events.h + * @ingroup usb_core_events + * @brief Event handling for the USB Core Stack. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +USB_EVENT_HANDLERS_t event; + +RETURN_CODE_t USB_EventHandler(void) +{ + RETURN_CODE_t status = SUCCESS; + + if (USB_EventSOFIsReceived() == true) + { + USB_EventSOFClear(); + if (NULL != event.SOFCallback) + { + event.SOFCallback(); + } + } + if (USB_EventResetIsReceived() == true) + { + USB_EventResetClear(); + if (NULL != event.ResetCallback) + { + event.ResetCallback(); + } + USB_PIPE_t pipe = { .address = 0 }; + while (pipe.address < USB_EP_NUM) + { + pipe.direction = USB_EP_DIR_IN; + if (SUCCESS == status) + { + status = USB_TransferAbort(pipe); + } + pipe.direction = USB_EP_DIR_OUT; + if (SUCCESS == status) + { + status = USB_TransferAbort(pipe); + } + pipe.address++; + } + status = USB_Reset(); + } + uint8_t eventOverUnderflow = USB_EventOverUnderflowIsReceived(); + if (0u < eventOverUnderflow) + { + USB_EventOverUnderflowClear(); + uint8_t controlOverUnderflow = USB_ControlOverUnderflowIsReceived(); + if (0u < controlOverUnderflow) + { + status = USB_ControlProcessOverUnderflow(controlOverUnderflow); + } + else + { + // Non-control overunderflows currently ignored by event handler + status = SUCCESS; + } + } + if (USB_EventSuspendIsReceived() == true) + { + USB_EventSuspendClear(); + if (NULL != event.SuspendCallback) + { + event.SuspendCallback(); + } + } + if (USB_EventResumeIsReceived() == true) + { + USB_EventResumeClear(); + if (NULL != event.ResumeCallback) + { + event.ResumeCallback(); + } + } + if (USB_EventStalledIsReceived() == true) + { + USB_EventStalledClear(); + USB_PIPE_t pipe = { .address = 0x00, .direction = USB_EP_DIR_OUT }; + status = USB_HandleEventStalled(pipe); + } + return status; +} + +void USB_SetConfigurationCallbackRegister(USB_SETUP_EVENT_CALLBACK_t callback) +{ + event.SetConfiguration = callback; +} + +void USB_SetInterfaceCallbackRegister(USB_SETUP_EVENT_CALLBACK_t callback) +{ + event.SetInterface = callback; +} + +void USB_InterfaceDisabledCallbackRegister(USB_EVENT_CALLBACK_t callback) +{ + event.InterfaceDisabled = callback; +} + +void USB_VendorRequestCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback) +{ + event.VendorRequest = callback; +} + +void USB_ClassRequestCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback) +{ + event.ClassRequest = callback; +} + +void USB_OtherRequestCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback) +{ + event.OtherRequest = callback; +} + +void USB_SOFCallbackRegister(USB_EVENT_CALLBACK_t callback) +{ + event.SOFCallback = callback; +} + +void USB_ResetCallbackRegister(USB_EVENT_CALLBACK_t callback) +{ + event.ResetCallback = callback; +} + +void USB_SuspendCallbackRegister(USB_EVENT_CALLBACK_t callback) +{ + event.SuspendCallback = callback; +} + +void USB_ResumeCallbackRegister(USB_EVENT_CALLBACK_t callback) +{ + event.ResumeCallback = callback; +} diff --git a/mcc_generated_files/usb/usb_common/usb_core_events.h b/mcc_generated_files/usb/usb_common/usb_core_events.h new file mode 100644 index 0000000..bed84e7 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_events.h @@ -0,0 +1,158 @@ +/** + * USBCOREEVENTS USB Core Events Header File + * @file usb_core_events.h + * @defgroup usb_core_events USB Core Events + * @ingroup usb_core + * @brief Event handling for the USB Core Stack. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_CORE_EVENTS_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_EVENTS_H + +#include +#include + +#include + +#include +#include +#include +#include +#include + +/** + * @ingroup usb_core + * @struct USB_EVENT_HANDLERS_struct + * @brief Represents the event callbacks, the configuration and the enumeration setups. + */ +typedef struct USB_EVENT_HANDLERS_struct +{ + USB_SETUP_EVENT_CALLBACK_t SetConfiguration; + USB_SETUP_EVENT_CALLBACK_t SetInterface; + USB_EVENT_CALLBACK_t InterfaceDisabled; + USB_SETUP_PROCESS_CALLBACK_t VendorRequest; + USB_SETUP_PROCESS_CALLBACK_t ClassRequest; + USB_SETUP_PROCESS_CALLBACK_t OtherRequest; + USB_EVENT_CALLBACK_t SOFCallback; + USB_EVENT_CALLBACK_t ResetCallback; + USB_EVENT_CALLBACK_t SuspendCallback; + USB_EVENT_CALLBACK_t ResumeCallback; +} USB_EVENT_HANDLERS_t; + +extern USB_EVENT_HANDLERS_t event; + +/** + * @ingroup usb_core + * @brief Handles the different types of events. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ + +RETURN_CODE_t USB_EventHandler(void); + +/** + * @ingroup usb_core + * @brief Registers a callback for Set Configuration requests. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_SetConfigurationCallbackRegister(USB_SETUP_EVENT_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for Set Interface requests. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_SetInterfaceCallbackRegister(USB_SETUP_EVENT_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for disabling interfaces. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_InterfaceDisabledCallbackRegister(USB_EVENT_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for vendor requests. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_VendorRequestCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for class requests. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_ClassRequestCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for other requests. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_OtherRequestCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for Start-Of-Frame (SOF) events. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_SOFCallbackRegister(USB_EVENT_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for Reset events. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_ResetCallbackRegister(USB_EVENT_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for Suspend events. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_SuspendCallbackRegister(USB_EVENT_CALLBACK_t callback); + +/** + * @ingroup usb_core + * @brief Registers a callback for Resume events. + * @param callback - Reference for the callback function + * @return None. + */ +void USB_ResumeCallbackRegister(USB_EVENT_CALLBACK_t callback); + +#endif /* USB_CORE_EVENTS_H */ diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests.c b/mcc_generated_files/usb/usb_common/usb_core_requests.c new file mode 100644 index 0000000..ebfaab4 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests.c @@ -0,0 +1,194 @@ +/** + * USBCOREREQUESTS USB Core Requests Source File + * @file usb_core_requests.c + * @ingroup usb_core_requests + * @brief USB Device Core Requests handling. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +RETURN_CODE_t USB_SetupProcessDeviceRequest(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + switch (setupRequestPtr->bRequest) + { + case USB_REQUEST_GET_STATUS: + { + status = SetupDeviceRequestGetStatus(); + break; + } + case USB_REQUEST_CLEAR_FEATURE: + { + status = SetupDeviceRequestClearFeature(setupRequestPtr); + break; + } + case USB_REQUEST_SET_FEATURE: + { + status = SetupDeviceRequestSetFeature(setupRequestPtr); + break; + } + case USB_REQUEST_SET_ADDRESS: + { + status = SetupDeviceRequestSetAddress((uint8_t)setupRequestPtr->wValue & 0xffu); + break; + } + case USB_REQUEST_GET_DESCRIPTOR: + { + status = SetupDeviceRequestGetDescriptor(setupRequestPtr); + break; + } + case USB_REQUEST_SET_DESCRIPTOR: + { + // Set Descriptor not supported, please STALL + status = UNSUPPORTED; + break; + } + case USB_REQUEST_GET_CONFIGURATION: + { + status = SetupDeviceRequestGetConfiguration(); + break; + } + case USB_REQUEST_SET_CONFIGURATION: + { + status = SetupDeviceRequestSetConfiguration((uint8_t)(setupRequestPtr->wValue & 0xffu)); + break; + } + default: + // Invalid request, please STALL + status = UNSUPPORTED; + break; + } + + return status; +} + +RETURN_CODE_t USB_SetupProcessEndpointRequest(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Gets the requested endpoint, endpoint address and its direction + USB_PIPE_t endpoint = EndpointFromRequestGet(setupRequestPtr->wIndex); + + // Checks if the request is for a valid endpoint + if (endpoint.address >= (uint8_t)USB_EP_NUM) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + // Handles the actual endpoint requests + switch (setupRequestPtr->bRequest) + { + case USB_REQUEST_GET_STATUS: + { + status = SetupEndpointRequestGetStatus(setupRequestPtr); + break; + } + case USB_REQUEST_CLEAR_FEATURE: + { + status = SetupEndpointRequestClearFeature(setupRequestPtr); + break; + } + case USB_REQUEST_SET_FEATURE: + { + status = SetupEndpointRequestSetFeature(setupRequestPtr); + break; + } + case USB_REQUEST_SYNCH_FRAME: + { + status = SetupEndpointRequestSynchFrame(); + break; + } + default: + // Invalid request, please STALL + status = UNSUPPORTED; + break; + } + } + + return status; +} + +RETURN_CODE_t USB_SetupProcessInterfaceRequest(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Gets the requested interface number + // Handles the actual interface requests + switch (setupRequestPtr->bRequest) + { + case USB_REQUEST_GET_STATUS: + { + status = USB_SetupInterfaceRequestGetStatus(); + break; + } + case USB_REQUEST_CLEAR_FEATURE: + { + // Features are not specified for USB 2 interfaces, please STALL + status = UNSUPPORTED; + break; + } + case USB_REQUEST_SET_FEATURE: + { + // Features are not specified for USB 2 interfaces, please STALL + status = UNSUPPORTED; + break; + } + case USB_REQUEST_GET_INTERFACE: + { + status = USB_SetupInterfaceRequestGetInterface(setupRequestPtr); + break; + } + case USB_REQUEST_SET_INTERFACE: + { + status = USB_SetupInterfaceRequestSetInterface(setupRequestPtr); + break; + } + case USB_REQUEST_GET_DESCRIPTOR: + { + status = USB_SetupInterfaceRequestGetDescriptor(setupRequestPtr); + break; + } + default: + // Invalid request, please STALL + status = UNSUPPORTED; + break; + } + + return status; +} diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests.h b/mcc_generated_files/usb/usb_common/usb_core_requests.h new file mode 100644 index 0000000..3cdc993 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests.h @@ -0,0 +1,105 @@ +/** + * USBCOREREQUESTS USB Core Requests Header File + * @file usb_core_requests.h + * @defgroup usb_core_requests USB Core Requests + * @ingroup usb_core + * @brief USB Device Core Requests handling. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + + +#ifndef USB_CORE_REQUESTS_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_REQUESTS_H + +#include +#include + +#include +#include +#include +#include +#include + +/** + * @ingroup usb_core_requests + * @brief Setup function for the device requests + * + * USB 2.0 Specification Ch 9.4. + * | bRequest | wValue | wIndex | wLength | Data | + * |-------------------|-------------------|------------|---------|---------------------| + * | CLEAR_FEATURE | Feature selector | Zero | Zero | None | + * | GET_CONFIGURATION | Zero | Zero | One | Config value | + * | GET_DESCRIPTOR | Type and index | Zero or ID | Length | Descriptor | + * | GET_STATUS | Zero | Endpoint | Two | Device status | + * | SET_ADDRESS | Device address | Zero | Zero | None | + * | SET_CONFIGURATION | Config value | Zero | Zero | None | + * | SET_DESCRIPTOR | Type and index | Zero or ID | Length | Descriptor | + * | SET_FEATURE | Feature selector | Zero | Zero | None | + * + * @param setupRequestPtr - Pointer to the setup request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupProcessDeviceRequest(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Setup function for the endpoint requests + * + * USB 2.0 Specification Ch. 9.4. + * | bRequest | wValue | wIndex | wLength | Data | + * |---------------|------------------|----------|---------|-----------------| + * | CLEAR_FEATURE | Feature selector | Endpoint | Zero | None | + * | GET_STATUS | Zero | Endpoint | Two | Endpoint status | + * | SET_FEATURE | Feature selector | Endpoint | Zero | None | + * | SYNCH_FRAME | Zero | Endpoint | Two | Frame number | + * + * @param *setupRequestPtr - Pointer to the request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupProcessEndpointRequest(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Setup function for the interface requests + * + * USB 2.0 Specification Ch 9.4. + * | bRequest | wValue | wIndex | wLength | Data | + * |-----------------|-------------------|-----------|---------|---------------------| + * | CLEAR_FEATURE | Feature selector | Interface | Zero | None | + * | GET_INTERFACE | Zero | Interface | One | Alternate interface | + * | GET_STATUS | Zero | Interface | Two | Interface | + * | SET_FEATURE | Feature selector | Interface | Zero | None | + * | SET_INTERFACE | Alternate setting | Interface | Zero | None | + * | GET_DESCRIPTOR | Type and index | Zero | Length | Descriptor | + * + * @param setupRequestPtr - Pointer to the setup request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupProcessInterfaceRequest(USB_SETUP_REQUEST_t *setupRequestPtr); + +#endif /* USB_CORE_REQUESTS_H */ + diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests_device.c b/mcc_generated_files/usb/usb_common/usb_core_requests_device.c new file mode 100644 index 0000000..eda9772 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests_device.c @@ -0,0 +1,181 @@ +/** + * USBCOREREQUESTSDEVICE USB Core Requests Device Core File + * @file usb_core_requests_device.c + * @ingroup usb_core_requests + * @brief USB Device Core Requests handling. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +STATIC uint8_t deviceAddress = 0; + +RETURN_CODE_t SetupDeviceRequestGetStatus(void) +{ + // Return IN transaction with Remote Wake-up and Self Powered. + uint8_t data[] = {0, 0}; + + if (USB_DescriptorActiveConfigurationSelfPoweredGet()) + { + data[0] |= USB_REQUEST_DEVICE_SELF_POWERED; + } + if (USB_DescriptorActiveConfigurationRemoteWakeupGet()) + { + data[0] |= USB_REQUEST_DEVICE_REMOTE_WAKEUP; + } + + return USB_ControlTransferDataWriteBuffer(data, sizeof(data)); +} + +RETURN_CODE_t SetupDeviceRequestClearFeature(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Clear feature for DEVICE_REMOTE_WAKEUP and TEST_MODE not yet supported + (void)setupRequestPtr; + + return status; +} + +RETURN_CODE_t SetupDeviceRequestSetFeature(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Set feature for DEVICE_REMOTE_WAKEUP and TEST_MODE not yet supported + (void)setupRequestPtr; + + return status; +} + +RETURN_CODE_t SetupDeviceRequestSetAddress(uint8_t address) +{ + // Must register the callback here since device address must be set after completion of status stage. + deviceAddress = address; + USB_ControlEndOfRequestCallbackRegister(&SetupDeviceAddressCallback); + + return SUCCESS; +} + +void SetupDeviceAddressCallback(void) +{ + USB_DeviceAddressConfigure(deviceAddress); + USB_ControlEndOfRequestCallbackRegister(NULL); +} + +RETURN_CODE_t SetupDeviceRequestGetDescriptor(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + uint8_t descriptorType = (uint8_t)(setupRequestPtr->wValue >> 8u); + uint8_t descriptorIndex = (uint8_t)(setupRequestPtr->wValue & 0xffu); + + if (USB_DESCRIPTOR_TYPE_VENDOR <= (USB_DESCRIPTOR_TYPE_t)descriptorType) + { + // Vendor Get_Descriptor Requests handled by VendorRequest callback. + if (NULL != event.VendorRequest) + { + status = event.VendorRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + } + else if (USB_DESCRIPTOR_TYPE_CLASS <= (USB_DESCRIPTOR_TYPE_t)descriptorType) + { + // Class Get_Descriptor Requests handled by ClassRequest callback. + if (NULL != event.ClassRequest) + { + status = event.ClassRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + } + else + { + uint8_t *descriptorPtr = NULL; + uint16_t descriptorLength = 0; + + if (USB_DESCRIPTOR_TYPE_STRING == (USB_DESCRIPTOR_TYPE_t)descriptorType) + { + status = USB_DescriptorStringPointerGet(descriptorIndex, setupRequestPtr->wIndex, &descriptorPtr, &descriptorLength); + } + else + { + // USB_DescriptorPointerGet will handle remaining invalid descriptorTypes. + status = USB_DescriptorPointerGet(descriptorType, descriptorIndex, &descriptorPtr, &descriptorLength); + } + + if (SUCCESS == status) + { + if (descriptorLength > setupRequestPtr->wLength) + { + descriptorLength = setupRequestPtr->wLength; + } + + status = USB_ControlTransferDataSet(descriptorPtr, descriptorLength); + } + } + + return status; +} + +RETURN_CODE_t SetupDeviceRequestGetConfiguration(void) +{ + uint8_t configurationValue = USB_DescriptorActiveConfigurationValueGet(); + + return USB_ControlTransferDataWriteBuffer(&configurationValue, sizeof(configurationValue)); +} + +RETURN_CODE_t SetupDeviceRequestSetConfiguration(uint8_t configurationValue) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((deviceAddress == 0u)) + { + status = USB_CONNECTION_ERROR; + } + else + { + // Enables configuration, clears it if configurationValue is zero. + status = USB_DescriptorConfigurationEnable(configurationValue); + } + + return status; +} diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests_device.h b/mcc_generated_files/usb/usb_common/usb_core_requests_device.h new file mode 100644 index 0000000..d04b6ea --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests_device.h @@ -0,0 +1,107 @@ +/** + * USBCOREREQUESTSDEVICE USB Core Requests Device Header File + * @file usb_core_requests_device.h + * @ingroup usb_core_requests + * @brief USB Device Core Requests handling. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_CORE_REQUESTS_DEVICE_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_REQUESTS_DEVICE_H + +#include +#include + +#include "usb_protocol_headers.h" +#include "usb_common_elements.h" + +/** + * @ingroup usb_core_requests + * @brief Returns the status of the device features. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestGetStatus(void); + +/** + * @ingroup usb_core_requests + * @brief Clears the device feature. + * @param *setupRequestPtr - Pointer to the setup request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestClearFeature(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Sets the device feature. + * @param *setupRequestPtr - Pointer to the setup request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestSetFeature(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Sets the device address. + * @param address - Address to be set + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestSetAddress(uint8_t address); + +/** + * @ingroup usb_core_requests + * @brief Callback function for the address. + * @param None. + * @return None. + */ +void SetupDeviceAddressCallback(void); + +/** + * @ingroup usb_core_requests + * @brief Gets the device descriptor. + * @param *setupRequestPtr - Pointer to the setup request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestGetDescriptor(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Gets the device configuration. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestGetConfiguration(void); + +/** + * @ingroup usb_core_requests + * @brief Sets the device configuration. + * @param configurationValue - Configuration value to be set + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupDeviceRequestSetConfiguration(uint8_t configurationValue); + +#endif /* USB_CORE_REQUESTS_DEVICE_H */ + diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c b/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c new file mode 100644 index 0000000..6e8ed3b --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c @@ -0,0 +1,137 @@ +/** + * USBCOREREQUESTSENDPOINT USB Core Requests Endpoint Source File + * @file usb_core_requests_endpoint.c + * @ingroup usb_core_requests + * @brief USB Endpoint Core Requests handling. + * @version USB Device Core Version USB 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/** + * @ingroup usb_core_requests + * @def GET_STATUS_ENDPOINT_STALLED + * @brief Mask for the endpoint stall status in the first byte of the data stage of the setup request. + */ +#define GET_STATUS_ENDPOINT_STALLED (1u << 0u) + +/** + * @ingroup usb_core_requests + * @def ENDPOINT_ADDRESS_MASK + * @brief Mask for the endpoint address in the wIndex field of the setup request. + */ +#define ENDPOINT_ADDRESS_MASK (0x7fu) + +/** + * @ingroup usb_core_requests + * @def ENDPOINT_DIRECTION_BITPOSITION + * @brief Bit position for the endpoint direction in the wIndex field of the setup request. + */ +#define ENDPOINT_DIRECTION_BITPOSITION (7u) + +USB_PIPE_t EndpointFromRequestGet(uint16_t wIndex) +{ + USB_PIPE_t endpoint; + endpoint.address = (uint8_t)wIndex & ENDPOINT_ADDRESS_MASK; + endpoint.direction = (uint8_t)wIndex >> ENDPOINT_DIRECTION_BITPOSITION; + + return endpoint; +} + +RETURN_CODE_t SetupEndpointRequestGetStatus(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + // Return IN transaction with ENDPOINT_HALT status (2 bytes) + USB_PIPE_t endpoint = EndpointFromRequestGet(setupRequestPtr->wIndex); + + uint8_t data[] = {0, 0}; + if (USB_EndpointIsStalled(endpoint) == true) + { + + data[0] |= GET_STATUS_ENDPOINT_STALLED; + } + + return USB_ControlTransferDataWriteBuffer(data, sizeof (data)); +} + +RETURN_CODE_t SetupEndpointRequestClearFeature(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Only ENDPOINT_HALT available for endpoints + if (setupRequestPtr->wValue == USB_ENDPOINT_FEATURE_HALT) + { + USB_PIPE_t endpoint = EndpointFromRequestGet(setupRequestPtr->wIndex); + + status = USB_EndpointStallClear(endpoint); + } + else + { + status = UNSUPPORTED; + } + + return status; +} + +RETURN_CODE_t SetupEndpointRequestSetFeature(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Only ENDPOINT_HALT available for endpoints + if (setupRequestPtr->wValue == USB_ENDPOINT_FEATURE_HALT) + { + USB_PIPE_t endpoint = EndpointFromRequestGet(setupRequestPtr->wIndex); + + status = USB_TransferAbort(endpoint); + if (SUCCESS == status) + { + status = USB_EndpointStall(endpoint); + } + } + else + { + status = UNSUPPORTED; + } + + return status; +} + +RETURN_CODE_t SetupEndpointRequestSynchFrame(void) +{ + uint16_t framenum = USB_FrameNumberGet(); + + return USB_ControlTransferDataWriteBuffer((uint8_t*) & framenum, sizeof (framenum)); +} diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.h b/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.h new file mode 100644 index 0000000..878b939 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.h @@ -0,0 +1,84 @@ +/** + * USBCOREREQUESTSENDPOINT USB Core Requests Endpoint Header File + * @file usb_core_requests_endpoint.h + * @ingroup usb_core_requests + * @brief USB Endpoint Core Requests handling. + * @version USB Device Core Version USB 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + + +#ifndef USB_CORE_REQUESTS_ENDPOINT_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_REQUESTS_ENDPOINT_H + +#include +#include + +#include "usb_protocol_headers.h" +#include "usb_common_elements.h" + +/** + * @ingroup usb_core_requests + * @brief Gets the endpoint status. + * @param wIndex - Endpoint address and direction + * @return A structure with the endpoint status + */ +USB_PIPE_t EndpointFromRequestGet(uint16_t wIndex); + +/** + * @ingroup usb_core_requests + * @brief Gets the endpoint status. + * @param *setupRequestPtr - Pointer to the setup request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupEndpointRequestGetStatus(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Clears the endpoint feature. + * @param *setupRequestPtr - Pointer to the setup request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupEndpointRequestClearFeature(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Sets the endpoint feature. + * @param *setupRequestPtr - Pointer to the setup request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupEndpointRequestSetFeature(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Gets the current frame number. + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t SetupEndpointRequestSynchFrame(void); + +#endif /* USB_CORE_REQUESTS_ENDPOINT_H */ + diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests_interface.c b/mcc_generated_files/usb/usb_common/usb_core_requests_interface.c new file mode 100644 index 0000000..8725b20 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests_interface.c @@ -0,0 +1,145 @@ +/** + * USBCOREREQUESTSINTERFACE USB Core Requests Interface Source File + * @file usb_core_requests_interface.c + * @ingroup usb_core_requests + * @brief USB Interface Core Requests handling. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/** + * @ingroup usb_core_requests + * @def GET_INTERFACE_REQUEST_NUMBER_MASK + * @brief Mask for the interface number in the wIndex field of the setup request. + */ +#define GET_INTERFACE_REQUEST_NUMBER_MASK (0xffu) + +/** + * @ingroup usb_core_requests + * @def GET_INTERFACE_REQUEST_WVALUE + * @brief Value for the wValue field of the setup request. + */ +#define GET_INTERFACE_REQUEST_WVALUE 0u + +/** + * @ingroup usb_core_requests + * @def GET_INTERFACE_RESPONSE_SIZE + * @brief Size of the response to the Get Interface request. + */ +#define GET_INTERFACE_RESPONSE_SIZE 1u + +RETURN_CODE_t USB_SetupInterfaceRequestGetStatus(void) +{ + uint8_t data[] = {0, 0}; + + return USB_ControlTransferDataWriteBuffer(data, sizeof (data)); +} + +RETURN_CODE_t USB_SetupInterfaceRequestGetInterface(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((GET_INTERFACE_REQUEST_WVALUE == setupRequestPtr->wValue) && (GET_INTERFACE_RESPONSE_SIZE == setupRequestPtr->wLength)) + { + uint8_t alternateSetting; + status = ActiveAlternateSettingGet((GET_INTERFACE_REQUEST_NUMBER_MASK & setupRequestPtr->wIndex), &alternateSetting); + if (SUCCESS == status) + { + status = USB_ControlTransferDataWriteBuffer(&alternateSetting, sizeof(alternateSetting)); + } + } + else + { + status = INTERFACE_GET_ERROR; + } + + return status; +} + +RETURN_CODE_t USB_SetupInterfaceRequestSetInterface(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = USB_DescriptorInterfaceConfigure(setupRequestPtr->wIndex, setupRequestPtr->wValue, true); + if (SUCCESS == status) + { + if (NULL != event.SetInterface) + { + event.SetInterface(setupRequestPtr); + } + } + + return status; +} + +RETURN_CODE_t USB_SetupInterfaceRequestGetDescriptor(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + uint8_t descriptorType = (uint8_t)(setupRequestPtr->wValue >> 8u); + + if (USB_DESCRIPTOR_TYPE_VENDOR <= (USB_DESCRIPTOR_TYPE_t)descriptorType) + { + // Vendor Get_Descriptor Requests handled by VendorRequest callback + if (NULL != event.VendorRequest) + { + status = event.VendorRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + } + else if (USB_DESCRIPTOR_TYPE_CLASS <= (USB_DESCRIPTOR_TYPE_t)descriptorType) + { + // Class Get_Descriptor Requests handled by ClassRequest callback + if (NULL != event.ClassRequest) + { + status = event.ClassRequest(setupRequestPtr); + } + else + { + status = UNSUPPORTED; + } + } + else + { + // Standard descriptor types not supported on interface requests + status = UNSUPPORTED; + } + + return status; +} \ No newline at end of file diff --git a/mcc_generated_files/usb/usb_common/usb_core_requests_interface.h b/mcc_generated_files/usb/usb_common/usb_core_requests_interface.h new file mode 100644 index 0000000..fa7487b --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_requests_interface.h @@ -0,0 +1,101 @@ +/** + * USBCOREREQUESTSINTERFACE USB Core Requests Interface Header File + * @file usb_core_requests_interface.h + * @ingroup usb_core_requests + * @brief USB Interface Core Requests handling. + * @version USB Device Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + + +#ifndef USB_CORE_REQUESTS_INTERFACE_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_REQUESTS_INTERFACE_H + +#include +#include + +#include "usb_protocol_headers.h" +#include "usb_common_elements.h" + +/** + * @ingroup usb_core_requests + * @brief Returns status for the specified interface. + * + * Get status from interface request according to USB 2.0 specification Ch. 9.4.5. + * | bRequest | wValue | wIndex | wLength | Data | + * |------------|--------|-------------|---------|-----------| + * | GET_STATUS | Zero | Interface | Two | Interface | + * + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupInterfaceRequestGetStatus(void); + +/** + * @ingroup usb_core_requests + * @brief Returns the alternate setting for the specified interface. + * + * Format for GET_INTERFACE request according to USB 2.0 specification Ch 9.4.4. + * Document: Universal Serial Bus Specification for USB 2.0. + * | bRequest | wValue | wIndex | wLength | Data | + * |---------------|--------|-----------|---------|-------------------| + * | GET_INTERFACE | Zero | Interface | One | Alternate setting | + * + * @param *setupRequestPtr - Pointer to the request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupInterfaceRequestGetInterface(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Setup function for the interface request to select the alternate setting. + * + * A request to set interface according to USB 2.0 specification Ch. 9.4.10. + * Document: Universal Serial Bus Specification for USB 2.0 + * | bRequest | wValue | wIndex | wLength | Data | + * |---------------|-------------------|-----------|---------|------| + * | SET_INTERFACE | Alternate setting | Interface | Zero | None | + * + * @param *setupRequestPtr - Pointer to the request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupInterfaceRequestSetInterface(USB_SETUP_REQUEST_t *setupRequestPtr); + +/** + * @ingroup usb_core_requests + * @brief Setup function for the interface request for class-specific descriptors. + * + * | bRequest | wValue | wIndex | wLength | Data | + * |----------------|-------------------|-----------|---------|------------| + * | GET_DESCRIPTOR | Type and index | Zero | Length | Descriptor | + * + * @param *setupRequestPtr - Pointer to the request and its data + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_SetupInterfaceRequestGetDescriptor(USB_SETUP_REQUEST_t *setupRequestPtr); + +#endif /* USB_CORE_REQUESTS_INTERFACE_H */ + diff --git a/mcc_generated_files/usb/usb_common/usb_core_transfer.c b/mcc_generated_files/usb/usb_common/usb_core_transfer.c new file mode 100644 index 0000000..8d82f24 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_transfer.c @@ -0,0 +1,175 @@ +/** + * USBCORETRANSFER USB Core Transfer Source File + * @file usb_core_transfer.c + * @ingroup usb_core_transfer + * @brief USB core layer implementation file. + * @version USB Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +RETURN_CODE_t USB_TransferWriteStart(USB_PIPE_t pipe, uint8_t *dataPtr, uint16_t dataSize, bool useZLP, USB_TRANSFER_END_CALLBACK_t callback) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_PipeStatusIsBusy(pipe) == true) + { + status = PIPE_BUSY_ERROR; + } + else + { + status = USB_PipeReset(pipe); + } + + if (status == SUCCESS) + { + USB_PipeDataPtrSet(pipe, dataPtr); + USB_PipeDataToTransferSizeSet(pipe, dataSize); + USB_PipeDataTransferredSizeReset(pipe); + if (true == useZLP) + { + USB_PipeTransferZLP_Enable(pipe); + } + USB_PipeTransferEndCallbackRegister(pipe, callback); + status = USB_InTransactionRun(pipe); + } + return status; +} + +RETURN_CODE_t USB_TransferReadStart(USB_PIPE_t pipe, uint8_t *dataPtr, uint16_t dataSize, bool useZLP, USB_TRANSFER_END_CALLBACK_t callback) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_PipeStatusIsBusy(pipe) == true) + { + status = PIPE_BUSY_ERROR; + } + else + { + status = USB_PipeReset(pipe); + } + + if (status == SUCCESS) + { + USB_PipeDataPtrSet(pipe, dataPtr); + USB_PipeDataToTransferSizeSet(pipe, dataSize); + USB_PipeDataTransferredSizeReset(pipe); + if (true == useZLP) + { + USB_PipeTransferZLP_Enable(pipe); + } + USB_PipeTransferEndCallbackRegister(pipe, callback); + status = USB_OutTransactionRun(pipe); + } + + return status; +} + +RETURN_CODE_t USB_TransferControlDataSet(uint8_t *dataPtr, uint16_t dataSize, USB_SETUP_ENDOFREQUEST_CALLBACK_t callback) +{ + USB_ControlEndOfRequestCallbackRegister(callback); + return USB_ControlTransferDataSet(dataPtr, dataSize); +} + +RETURN_CODE_t USB_TransferAbort(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // Checks if abort is needed. + if (USB_PipeStatusIsBusy(pipe) == true) + { + //Stops transfer. + status = USB_TransactionAbort(pipe); + + if (status == SUCCESS) + { + // Calls callback. + USB_PipeTransferEndCallback(pipe); + } + } + else + { + // Pipe is not busy, so no need to abort. + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_TransferHandler(void) +{ + RETURN_CODE_t status = UNINITIALIZED; + + // If it's the initial setup packet, handle that separately. + if (USB_SetupIsReceived() == true) + { + status = USB_ControlSetupReceived(); + } + // If a transaction is complete, handle that one. + else if (USB_TransactionIsCompleted() == true) + { + // Finds out which pipe has a completed transaction. + USB_PIPE_t pipe; + + status = USB_TransactionCompletedPipeGet(&pipe); + + if (status == SUCCESS) + { + // Acks the transaction. + status = USB_TransactionCompleteAck(pipe); + } + + if (status == SUCCESS) + { + // Handles control transactions separately. + if (pipe.address == 0U) + { + status = USB_ControlTransactionComplete(pipe); + } + else + { + // Regular handling of all regular endpoints. + status = USB_PipeTransactionComplete(pipe); + } + } + } + else + { + // No handling needed, return SUCCESS. + status = SUCCESS; + } + + return status; +} diff --git a/mcc_generated_files/usb/usb_common/usb_core_transfer.h b/mcc_generated_files/usb/usb_common/usb_core_transfer.h new file mode 100644 index 0000000..afa85f3 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_core_transfer.h @@ -0,0 +1,116 @@ +/** + * USBCORETRANSFER USB Core Transfer Header File + * @file usb_core_transfer.h + * @defgroup usb_core_transfer USB Core Transfer + * @ingroup usb_core + * @brief USB core layer implementation file. + * @version USB Core Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + + +#ifndef USB_CORE_TRANSFER_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_CORE_TRANSFER_H + +#include +#include + +#include +#include + +#include +#include +#include +#include + +/** + * @ingroup usb_core_transfer + * @brief Sets up the pipe for the write transfers. + * + * Sets up the pipe for the write transfers and checks to see if it is busy. If it is not busy, then the routine resets the pipe, setting it up for write transfer, then starts the transfer. + * + * @param pipe - A combination of endpoint address and direction + * @param *dataPtr - The pointer to the data to write + * @param dataSize - The size of the data to write + * @param useZLP - Enable zero-length package at the end of transfer + * @param callback - A combination of pipe, status and transferred bytes + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransferWriteStart(USB_PIPE_t pipe, uint8_t *dataPtr, uint16_t dataSize, bool useZLP, USB_TRANSFER_END_CALLBACK_t callback); + +/** + * @ingroup usb_core_transfer + * @brief Sets up the pipe for the read transfers. + * + * Sets up the pipe for the write transfers and checks to see if it is busy. If it is not busy, then the routine resets the pipe, setting it up for read transfer, then starts the transfer. + * + * @param pipe - A combination of endpoint address and direction + * @param *dataPtr - The pointer to the data to read + * @param dataSize - The size of the data to read + * @param useZLP - Enable zero-length package at the end of transfer + * @param callback - A combination of pipe, status and transferred bytes + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransferReadStart(USB_PIPE_t pipe, uint8_t *dataPtr, uint16_t dataSize, bool useZLP, USB_TRANSFER_END_CALLBACK_t callback); + +/** + * @ingroup usb_core_transfer + * @brief Sets up vendor or class control request data transfers. + * + * Sets up the pointer and size of the read or write trnasfer in the control data stage. + * + * @param *dataPtr - The pointer to the data to read or write + * @param dataSize - The size of the data to read or write + * @param callback - Pointer to a function to be called at the end of the control request + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransferControlDataSet(uint8_t *dataPtr, uint16_t dataSize, USB_SETUP_ENDOFREQUEST_CALLBACK_t callback); + +/** + * @ingroup usb_core_transfer + * @brief Aborts an ongoing transfer. + * + * Will call the pipe transferEndCallback with the abort status, if configured. + * + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransferAbort(USB_PIPE_t pipe); + +/** + * @ingroup usb_core_transfer + * @brief Handles the different types of packages received or transferred. + * + * Checks if a setup package is received or if a transaction is completed and which pipe has a completed transaction, then it handles them accordingly. + * Sends an ACK upon completed transaction confirmation. + * + * @param None. + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransferHandler(void); + +#endif /* USB_CORE_TRANSFER_H */ + diff --git a/mcc_generated_files/usb/usb_common/usb_protocol_headers.h b/mcc_generated_files/usb/usb_common/usb_protocol_headers.h new file mode 100644 index 0000000..f6b6145 --- /dev/null +++ b/mcc_generated_files/usb/usb_common/usb_protocol_headers.h @@ -0,0 +1,660 @@ +/** + * USBPROTOCOLHEADERS USB Protocol Headers Header File + * @file usb_protocol_headers.h + * @defgroup usb_protocol USB Protocol + * @ingroup usb_core + * @brief Common data structures, enumerations and macro definitons based on the USB 2.0 base protocol. + * @version USB Protocol Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_PROTOCOL_HEADERS_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_PROTOCOL_HEADERS_H + +#include "usb_common_elements.h" +#include +#include +#include + +/* + * ENDPOINT LAYER + */ + +/** + * @ingroup usb_protocol + * @def USB_EP_DIR_IN + * @brief Endpoint direction IN. + */ +#define USB_EP_DIR_IN 0x01u + +/** + * @ingroup usb_protocol + * @def USB_EP_DIR_OUT + * @brief Endpoint direction OUT. + */ +#define USB_EP_DIR_OUT 0x00u + +/** + * @ingroup usb_protocol + * @def OVERFLOW_EVENT + * @brief Overflow event for the endpoint. + */ +#define OVERFLOW_EVENT 1u + +/** + * @ingroup usb_protocol + * @def UNDERFLOW_EVENT + * @brief Underflow event for the endpoint. + */ +#define UNDERFLOW_EVENT 2u + +/** + * @ingroup usb_protocol + * @enum USB_ENDPOINT_enum + * @brief Defines labels for the different endpoint types as per the USB 2.0 base specification. + */ +typedef enum USB_ENDPOINT_enum +{ + CONTROL = 0, /** +#include + +/** + * @ingroup usb_device_stack + * @def USB_EP_NUM + * @brief Limits the size of the endpoint table and transfer array in the RAM + * to 1 + the highest endpoint address used by the application. + */ +#define USB_EP_NUM 2U + +/** + * @ingroup usb_device_stack + * @def USB_EP0_SIZE + * @brief Controls the packet size of endpoint 0 and must correspond to bMaxPacketSize0 in the device descriptor. + */ +#define USB_EP0_SIZE 64U + +/** + * @ingroup usb_device_stack + * @def LANG_ID_NUM + * @brief Controls the number of language IDs supported by the application. + */ +#define LANG_ID_NUM 1U + +/** + * @ingroup usb_device_stack + * @name USB Endpoint Addresses + * Macros for the endpoint addresses. + */ +///@{ +#define INTERFACE0ALTERNATE1_ISOCHRONOUS_EP1_IN 1U +///@} + +/** + * @ingroup usb_device_stack + * @name USB Endpoint Packet Sizes + * Macros for the endpoint packet sizes. + */ +///@{ +#define INTERFACE0ALTERNATE1_ISOCHRONOUS_EP1_IN_SIZE 64U +///@} + +/** + * @ingroup usb_device_stack + * @def USB_INTERFACE_NUM + * @brief The number of interfaces used by a configuration, excluding alternate interfaces. + */ +#define USB_INTERFACE_NUM 1U + +/** + * @ingroup usb_device_stack + * @struct USB_EP_STATIC_CONFIG_BITS_struct + * @brief Static endpoint settings. + */ +typedef struct USB_EP_STATIC_CONFIG_BITS_struct +{ + uint8_t InMultipktEnable : 1; + uint8_t InAzlpEnable : 1; + uint8_t InTrncInterruptEnable : 1; + uint8_t OutMultipktEnable : 1; + uint8_t OutAzlpEnable : 1; + uint8_t OutTrncInterruptEnable : 1; + uint8_t reserved : 2; +} USB_EP_STATIC_CONFIG_BITS_t; + +/** + * @ingroup usb_device_stack + * @struct endpointStaticConfig + * @brief Configuration of static endpoint settings. + */ +static const USB_EP_STATIC_CONFIG_BITS_t endpointStaticConfig [USB_EP_NUM] = { + [0] = {.InTrncInterruptEnable = 1, .OutTrncInterruptEnable = 1, .InMultipktEnable = 1, .InAzlpEnable = 0, .OutMultipktEnable = 1, .OutAzlpEnable = 0}, + [1] = {.InTrncInterruptEnable = 1, .OutTrncInterruptEnable = 1, .InMultipktEnable = 0, .InAzlpEnable = 0}, +}; + +#endif // USB_CONFIG_H +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb_descriptors.c b/mcc_generated_files/usb/usb_descriptors.c new file mode 100644 index 0000000..6607811 --- /dev/null +++ b/mcc_generated_files/usb/usb_descriptors.c @@ -0,0 +1,157 @@ +/** + * USB_DEVICE_STACK Generated Driver File + * + * @file usb_descriptors.c + * + * @ingroup usb_device_stack + * + * @brief Driver implementation file for example application descriptors. + * + * @version USB_DEVICE_STACK Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include +#include "usb_descriptors.h" +#include + + +static USB_DEVICE_DESCRIPTOR_t deviceDescriptor = { + .header = { + .bLength = sizeof(USB_DEVICE_DESCRIPTOR_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_DEVICE, + }, + .bcdUSB = 0x200, // USB 2.0 + .bDeviceClass = USB_VENDOR_DEVICE_CLASS, // Not defined on device level + .bDeviceSubClass = 0x00, // Not defined in Device Descriptor level + .bDeviceProtocol = 0x00, // Not defined in Device Descriptor level + .bMaxPacketSize0 = USB_EP0_SIZE, // EP0 size + .idVendor = 0x04D8, // MCHP VID + .idProduct = 0x0B0A, // PID 0x0010-0x002F reserved for testing/non-public demos + .bcdDevice = 0x0110, // 01.1.0, + .iManufacturer = 0x01, // String index 1 + .iProduct = 0x02, // String index 2 + .iSerialNumber = 0x03, // String index 3 + .bNumConfigurations = 0x01 // Number of configurations +}; + +static USB_APPLICATION_CONFIGURATION_t configurationDescriptor = { + .Config1 = + { + .Configuration = + { + .header = + { + .bLength = sizeof (USB_CONFIGURATION_DESCRIPTOR_t), + .bDescriptorType = (uint8_t)USB_DESCRIPTOR_TYPE_CONFIGURATION, + }, + .wTotalLength = sizeof (USB_APPLICATION_CONFIGURATION1_t), + .bNumInterfaces = USB_INTERFACE_NUM, + .bConfigurationValue = 1u, + .iConfiguration = 0u, + .bmAttributes = USB_CONFIG_ATTR_MUST_SET | USB_CONFIG_ATTR_SELF_POWERED, + .bMaxPower = USB_CONFIG_MAX_POWER(2), + }, + .Interface0Alternate1 = + { + .header = + { + .bLength = sizeof (USB_INTERFACE_DESCRIPTOR_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_INTERFACE, + }, + .bInterfaceNumber = 0U, + .bAlternateSetting = 1U, + .bNumEndpoints = 1U, + .bInterfaceClass = 0xFF, // Vendor + .bInterfaceSubClass = 0xFF, + .bInterfaceProtocol = 0xFF, + .iInterface = 0U, + }, + .Interface0Alternate1_Endpoint1IN = + { + .header = + { + .bLength = sizeof (USB_ENDPOINT_DESCRIPTOR_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_ENDPOINT, + }, + .bEndpointAddress = + { + .direction = USB_EP_DIR_IN, + .address = INTERFACE0ALTERNATE1_ISOCHRONOUS_EP1_IN, + }, + .bmAttributes = + { + .type = ISOCHRONOUS, + .synchronisation = 1U, // Asynchronous + .usage = 0U, // Data + }, + .wMaxPacketSize = INTERFACE0ALTERNATE1_ISOCHRONOUS_EP1_IN_SIZE, + .bInterval = 1U, + }, + }, +}; + +static USB_STRING_LANG_ID_DESCRIPTOR_t langIDDescriptor = { + .header = + { + .bLength = sizeof (USB_STRING_LANG_ID_DESCRIPTOR_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_STRING, + }, + .id_array = + {LANG_EN_US}, +}; + +static USB_APPLICATION_STRING_DESCRIPTORS_t stringDescriptors = { + .manufacturer_header = + { + .bLength = sizeof (stringDescriptors.manufacturer) + sizeof (USB_DESCRIPTOR_HEADER_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_STRING, + }, + .manufacturer = STRING_MANUFACTURER, + .product_header = + { + .bLength = sizeof (stringDescriptors.product) + sizeof (USB_DESCRIPTOR_HEADER_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_STRING, + }, + .product = STRING_PRODUCT, + .serial_header = + { + .bLength = sizeof (stringDescriptors.serial) + sizeof (USB_DESCRIPTOR_HEADER_t), + .bDescriptorType = USB_DESCRIPTOR_TYPE_STRING, + }, + .serial = STRING_SERIAL, +}; + +USB_DESCRIPTOR_POINTERS_t descriptorPointers = { + .devicePtr = (USB_DEVICE_DESCRIPTOR_t *) & deviceDescriptor, + .configurationsPtr = (USB_CONFIGURATION_DESCRIPTOR_t *) & configurationDescriptor, + .deviceBOSptr = NULL, + .langIDptr = &langIDDescriptor, + .stringPtrs = + { + &stringDescriptors.manufacturer_header, + }, +}; + +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb_descriptors.h b/mcc_generated_files/usb/usb_descriptors.h new file mode 100644 index 0000000..7b001b8 --- /dev/null +++ b/mcc_generated_files/usb/usb_descriptors.h @@ -0,0 +1,117 @@ +/** + * USB_DEVICE_STACK Generated API Header File + * + * @file usb_descriptors.h + * + * @ingroup usb_device_stack + * + * @brief Header file for example application descriptors. + * + * @version USB_DEVICE_STACK Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef USB_DESCRIPTORS_H +#define USB_DESCRIPTORS_H + +#include +#include +#include "usb_config.h" + + +/** + * @ingroup usb_device_stack + * @def LANG_EN_US + * @brief Language ID String Descriptor, for English (US). + */ +#define LANG_EN_US 0x0409U + +/** + * @ingroup usb_device_stack + * @def STRING_MANUFACTURER + * @brief Manufacturer String descriptor. + */ +#define STRING_MANUFACTURER L"Microchip Technology Inc." + +/** + * @ingroup usb_device_stack + * @def STRING_PRODUCT + * @brief Product String descriptor. + */ +#define STRING_PRODUCT L"Vendor Class Demo" + +/** + * @ingroup usb_device_stack + * @def STRING_SERIAL + * @brief Serial Number String descriptor. + */ +#define STRING_SERIAL L"1" + +/** + * @ingroup usb_device_stack + * @struct USB_APPLICATION_CONFIGURATION1_struct + * @brief USB Configuration, Interface and Endpoint descriptors for Config1. + */ +typedef struct USB_APPLICATION_CONFIGURATION1_struct +{ + USB_CONFIGURATION_DESCRIPTOR_t Configuration; + USB_INTERFACE_DESCRIPTOR_t Interface0Alternate1; + USB_ENDPOINT_DESCRIPTOR_t Interface0Alternate1_Endpoint1IN; +} USB_APPLICATION_CONFIGURATION1_t; + +/** + * @ingroup usb_device_stack + * @struct USB_APPLICATION_CONFIGURATION_struct + * @brief USB Configuration, Interface and Endpoint descriptors. + */ +typedef struct USB_APPLICATION_CONFIGURATION_struct +{ + USB_APPLICATION_CONFIGURATION1_t Config1; +} USB_APPLICATION_CONFIGURATION_t; + +/** + * @ingroup usb_device_stack + * @struct USB_APPLICATION_STRING_DESCRIPTORS_struct + * @brief USB String descriptors. + */ +typedef struct USB_APPLICATION_STRING_DESCRIPTORS_struct +{ + USB_DESCRIPTOR_HEADER_t manufacturer_header; + wchar_t manufacturer[DESCRIPTOR_STRING_LENGTH(STRING_MANUFACTURER)]; + USB_DESCRIPTOR_HEADER_t product_header; + wchar_t product[DESCRIPTOR_STRING_LENGTH(STRING_PRODUCT)]; + USB_DESCRIPTOR_HEADER_t serial_header; + wchar_t serial[DESCRIPTOR_STRING_LENGTH(STRING_SERIAL)]; +} USB_APPLICATION_STRING_DESCRIPTORS_t; + +/** + * @ingroup usb_device_stack + * @struct descriptorPointers + * @brief Pointers to the standard USB descriptors. + */ +extern USB_DESCRIPTOR_POINTERS_t descriptorPointers; + + +#endif // USB_DESCRIPTORS_H +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb_device.c b/mcc_generated_files/usb/usb_device.c new file mode 100644 index 0000000..993dc28 --- /dev/null +++ b/mcc_generated_files/usb/usb_device.c @@ -0,0 +1,95 @@ +/** + * USB_DEVICE_STACK Generated Driver File + * + * @file usb_device.c + * + * @ingroup usb_device_stack + * + * @brief Driver implementation file for the USB device setup. + * + * @version USB_DEVICE_STACK Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#include "usb_device.h" +#include "usb0.h" + +static RETURN_CODE_t usbStatus; +static void USBDevice_TransferHandler(void); +static void USBDevice_EventHandler(void); + +static void Vendor_DefaultInterfaceEnCallback(USB_SETUP_REQUEST_t *setupRequestPtr); +static RETURN_CODE_t Vendor_DefaultControlReqCallback(USB_SETUP_REQUEST_t *setupRequestPtr); +static USB_SETUP_EVENT_CALLBACK_t Vendor_InterfaceEn_cb = &Vendor_DefaultInterfaceEnCallback; +static USB_SETUP_PROCESS_CALLBACK_t Vendor_ControlReq_cb = &Vendor_DefaultControlReqCallback; + +void USBDevice_Initialize(void) +{ + USB_DescriptorPointersSet(&descriptorPointers); + + USB_VendorClassInit(Vendor_InterfaceEn_cb, Vendor_ControlReq_cb, NULL); + + USB0_TrnComplCallbackRegister(USBDevice_TransferHandler); + USB0_BusEventCallbackRegister(USBDevice_EventHandler); +} + +RETURN_CODE_t USBDevice_StatusGet(void) +{ + return usbStatus; +} + +static void USBDevice_TransferHandler(void) +{ + usbStatus = USB_TransferHandler(); +} + +static void USBDevice_EventHandler(void) +{ + usbStatus = USB_EventHandler(); +} + +void Vendor_InterfaceEnCallbackRegister(USB_SETUP_EVENT_CALLBACK_t cb) +{ + USB_SetInterfaceCallbackRegister(cb); + Vendor_InterfaceEn_cb = cb; +} + +void Vendor_ControlReqCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t cb) +{ + USB_VendorRequestCallbackRegister(cb); + Vendor_ControlReq_cb = cb; +} + +static void Vendor_DefaultInterfaceEnCallback(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + // Add routine here +} + +static RETURN_CODE_t Vendor_DefaultControlReqCallback(USB_SETUP_REQUEST_t *setupRequestPtr) +{ + // Add routine here + return usbStatus; +} + +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb_device.h b/mcc_generated_files/usb/usb_device.h new file mode 100644 index 0000000..09da2cd --- /dev/null +++ b/mcc_generated_files/usb/usb_device.h @@ -0,0 +1,75 @@ +/** + * USB_DEVICE_STACK Generated API Header File + * + * @file usb_device.h + * + * @ingroup usb_device_stack + * + * @brief Header file for the USB device setup. + * + * @version USB_DEVICE_STACK Driver Version 1.0.0 +*/ +/* +© [2025] Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip + software and any derivatives exclusively with Microchip products. + You are responsible for complying with 3rd party license terms + applicable to your use of 3rd party software (including open source + software) that may accompany Microchip software. SOFTWARE IS ?AS IS.? + NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS + SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 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 RELATED TO THE SOFTWARE WILL NOT + EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR + THIS SOFTWARE. +*/ + +#ifndef USB_DEVICE_H +#define USB_DEVICE_H + +#include +#include +#include "usb_descriptors.h" + +/** + * @ingroup usb_device_stack + * @brief Initializes the USB device. + * @param None. + * @return None. + */ +void USBDevice_Initialize(void); + +/** + * @ingroup usb_device_stack + * @brief Returns the status of the USB device. + * @param None. + * @return USB status code + */ +RETURN_CODE_t USBDevice_StatusGet(void); + +/** + * @ingroup usb_device_stack + * @brief Registers the callback for the interface enable setup request handler. + * @param USB_SETUP_EVENT_CALLBACK_t cb - Callback function for the interface enable setup request + * @return None. + */ +void Vendor_InterfaceEnCallbackRegister(USB_SETUP_EVENT_CALLBACK_t cb); + +/** + * @ingroup usb_device_stack + * @brief Registers the callback for the control request handler. + * @param USB_SETUP_PROCESS_CALLBACK_t cb - Callback function for the control request + * @return None. + */ +void Vendor_ControlReqCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t cb); + +#endif // USB_DEVICE_H +/** + End of File +*/ diff --git a/mcc_generated_files/usb/usb_peripheral/usb_peripheral.c b/mcc_generated_files/usb/usb_peripheral/usb_peripheral.c new file mode 100644 index 0000000..bdaaf92 --- /dev/null +++ b/mcc_generated_files/usb/usb_peripheral/usb_peripheral.c @@ -0,0 +1,646 @@ +/** + * USBPERIPHERAL Peripheral Source File + * @file usb_peripheral.c + * @ingroup usb_peripheral + * @brief Interface for a usb_peripheral module that needs to be implemented by a device specific USB module driver. + * @version USB Device Stack HAL Driver Version 1.0.0 + */ + +/* +(c) 2021 Microchip Technology Inc. and its subsidiaries. + +Subject to your compliance with these terms, you may use Microchip software and any +derivatives exclusively with Microchip products. It is your responsibility to comply with third party +license terms applicable to your use of third party software (including open source software) that +may accompany Microchip software. + +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. + +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. +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +STATIC USB_CONTROL_TRANSFER_t controlTransfer __attribute__((aligned(2))) = { .transferDataPtr = controlTransfer.buffer }; + +bool USB_SetupIsReceived(void) +{ + return USB_SetupInterruptIs(); +} + +bool USB_EventSOFIsReceived(void) +{ + return USB_SOFInterruptIs(); +} + +void USB_EventSOFClear(void) +{ + USB_SOFInterruptClear(); +} + +bool USB_EventResetIsReceived(void) +{ + return USB_ResetInterruptIs(); +} + +void USB_EventResetClear(void) +{ + USB_ResetInterruptClear(); +} + +uint8_t USB_EventOverUnderflowIsReceived(void) +{ + uint8_t eventOverUnderflow = 0; + if (USB_OverflowInterruptIs() == true) + { + eventOverUnderflow |= (uint8_t)OVERFLOW_EVENT; + } + if (USB_UnderflowInterruptIs() == true) + { + eventOverUnderflow |= (uint8_t)UNDERFLOW_EVENT; + } + return eventOverUnderflow; +} + +uint8_t USB_ControlOverUnderflowIsReceived(void) +{ + uint8_t eventOverUnderflow = 0; + if (USB_EndpointOutOverUnderflowIsSet(0) == true) + { + eventOverUnderflow |= (uint8_t)OVERFLOW_EVENT; + USB_EndpointOutOverUnderflowAck(0); + } + if (USB_EndpointInOverUnderflowIsSet(0) == true) + { + eventOverUnderflow |= (uint8_t)UNDERFLOW_EVENT; + USB_EndpointInOverUnderflowAck(0); + } + return eventOverUnderflow; +} + +void USB_EventOverUnderflowClear(void) +{ + USB_OverflowInterruptClear(); + USB_UnderflowInterruptClear(); +} + +bool USB_EventSuspendIsReceived(void) +{ + return USB_SuspendInterruptIs(); +} + +void USB_EventSuspendClear(void) +{ + USB_SuspendInterruptClear(); +} + +bool USB_EventResumeIsReceived(void) +{ + return USB_ResumeInterruptIs(); +} + +void USB_EventResumeClear(void) +{ + USB_ResumeInterruptClear(); +} + +bool USB_EventStalledIsReceived(void) +{ + return USB_StalledInterruptIs(); +} + +void USB_EventStalledClear(void) +{ + USB_StalledInterruptClear(); +} + +void USB_BusAttach(void) +{ + USB_ConnectionAttach(); +} + +void USB_BusDetach(void) +{ + USB_ConnectionDetach(); +} + +bool USB_IsBusAttached(void) +{ + return USB_ConnectionIsAttach(); +} + +void USB_DeviceAddressConfigure(uint8_t deviceAddress) +{ + USB_DeviceAddressSet(deviceAddress); +} + +uint16_t USB_FrameNumberGet(void) +{ + return (USB_FrameNumGet()); +} + +RETURN_CODE_t USB_ControlEndpointsInit(void) +{ + RETURN_CODE_t status = UNINITIALIZED; + + USB_PIPE_t controlPipeOut = { .address = 0, .direction = USB_EP_DIR_OUT }; + USB_PIPE_t controlPipeIn = { .address = 0, .direction = USB_EP_DIR_IN }; + + status = USB_EndpointConfigure(controlPipeOut, USB_EP0_SIZE, CONTROL); + if (SUCCESS == status) + { + status = USB_EndpointConfigure(controlPipeIn, USB_EP0_SIZE, CONTROL); + } + + if (SUCCESS == status) + { + status = EndpointBufferSet(controlPipeOut, controlTransfer.buffer); + if (SUCCESS == status) + { + status = EndpointBufferSet(controlPipeIn, controlTransfer.buffer); + } + } + + if (SUCCESS == status) + { + status = USB_DataToggleClear(controlPipeOut); + if (SUCCESS == status) + { + status = USB_DataToggleSet(controlPipeIn); + } + } + + if (SUCCESS == status) + { + controlTransfer.status = USB_CONTROL_SETUP; + } + + return status; +} + +RETURN_CODE_t USB_ControlSetupReceived(void) +{ + RETURN_CODE_t status = UNINITIALIZED; + + USB_SetupInterruptClear(); + + if (USB_CONTROL_STALL_REQ == controlTransfer.status) + { + // Stall events are handled by the EventHandler. + status = SUCCESS; + } + else + { + // Acks Setup Received on the control endpoints. + USB_EndpointOutSetupReceivedAck(0u); + USB_EndpointInSetupCompleteAck(0u); + + // Clears bytes received and sent + USB_NumberBytesToSendReset(0u); + USB_NumberBytesSentReset(0u); + USB_NumberBytesToReceiveReset(0u); + USB_NumberBytesReceivedReset(0u); + + // Copies setup packet out of buffer to make it available for a data stage. + (void)memcpy((uint8_t *)(&controlTransfer.setupRequest), controlTransfer.buffer, sizeof(USB_SETUP_REQUEST_t)); + + // The processSetupCallback is in most cases the USB_SetupProcess function in usb_core.c. + if (controlTransfer.processSetupCallback != NULL) + { + RETURN_CODE_t setup_status = controlTransfer.processSetupCallback(&controlTransfer.setupRequest); + + if (UNSUPPORTED == setup_status) + { + // Setup Request unknown or rejected, stalls the next control transaction. + controlTransfer.status = USB_CONTROL_STALL_REQ; + USB_EndpointInStall(0u); + USB_EndpointOutStall(0u); + + status = SUCCESS; + } + else if (SUCCESS == setup_status) + { + if (0u == controlTransfer.transferDataSize) + { + // Request did not contain a data stage, sends ZLP directly. + status = USB_ControlTransferZLP(USB_EP_DIR_IN); + } + else + { + // Sends or Receives data in next stage of request. + controlTransfer.totalBytesTransferred = 0; + USB_PIPE_t controlPipe = { .address = 0u, .direction = USB_EP_DIR_IN }; + if ((controlTransfer.setupRequest.bmRequestType.dataPhaseTransferDirection) == USB_REQUEST_DIR_IN) + { + controlTransfer.status = USB_CONTROL_DATA_IN; + } + else + { + // Control OUT data transactions are controlled by the IN.DATAPTR so set specifically here. + status = EndpointBufferSet(controlPipe, controlTransfer.transferDataPtr); + + controlPipe.direction = USB_EP_DIR_OUT; + controlTransfer.status = USB_CONTROL_DATA_OUT; + } + + // Sets up the pipe variables. + USB_PipeDataTransferredSizeReset(controlPipe); + USB_PipeDataPtrSet(controlPipe, controlTransfer.transferDataPtr); + USB_PipeDataToTransferSizeSet(controlPipe, controlTransfer.transferDataSize); + + // Start data stage transaction. + status = USB_ControlTransactionComplete(controlPipe); + } + } + else + { + // Forward error from setup. + status = setup_status; + } + } + else + { + // processSetupCallback missing, return error. + status = CONTROL_SETUP_CALLBACK_ERROR; + } + } + + return status; +} + +RETURN_CODE_t USB_ControlTransactionComplete(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (pipe.address != 0) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + // The data stage and the status stage must always have the data toggle bit set. + status = USB_DataToggleSet(pipe); + } + + if (SUCCESS == status) + { + switch (controlTransfer.status) + { + case USB_CONTROL_DATA_IN: + { + pipe.direction = USB_EP_DIR_IN; + + // Updates bytes sent and to be sent. + uint16_t bytesSent = USB_PipeDataTransferredSizeGet(pipe); + bytesSent += USB_NumberBytesSentGet(pipe.address); + USB_PipeDataTransferredSizeSet(pipe, bytesSent); + uint16_t transferDataSize = USB_PipeDataToTransferSizeGet(pipe); + + // Checks remaining data to send. + if (0U == (transferDataSize - bytesSent)) + { + controlTransfer.totalBytesTransferred += bytesSent; + if (controlTransfer.transferDataSize == controlTransfer.totalBytesTransferred) + { + + // Data stage is complete, sends an OUT ZLP for status stage. + status = USB_ControlTransferZLP(USB_REQUEST_DIR_OUT); + } + else + { + // Data stage is not complete, checks if we need a new buffer. + if ((controlTransfer.overUnderRunCallback != NULL) && (SUCCESS == controlTransfer.overUnderRunCallback())) + { + USB_PipeDataTransferredSizeReset(pipe); + USB_PipeDataToTransferSizeSet(pipe, controlTransfer.transferDataSize); + } + + // If no new buffer a normal in ZLP will get sent for the data stage. + status = USB_InTransactionRun(pipe); + } + } + else + { + // Starts next transaction in data stage. + status = USB_InTransactionRun(pipe); + } + + USB_EndpointInOverUnderflowAck(0); + + break; + } + case USB_CONTROL_DATA_OUT: + { + pipe.direction = USB_EP_DIR_OUT; + + // Updates bytes received and to be received. + uint16_t bytesReceived = USB_PipeDataTransferredSizeGet(pipe); + bytesReceived += USB_NumberBytesReceivedGet(pipe.address); + USB_PipeDataTransferredSizeSet(pipe, bytesReceived); + uint16_t transferDataSize = USB_PipeDataToTransferSizeGet(pipe); + + if (0U == (transferDataSize - bytesReceived)) + { + controlTransfer.totalBytesTransferred += bytesReceived; + if (controlTransfer.transferDataSize == controlTransfer.totalBytesTransferred) + { + + // Data stage is complete, sends an IN ZLP for status stage. + status = USB_ControlTransferZLP(USB_REQUEST_DIR_IN); + } + else + { + // Data stage is not complete, checks if we need a new buffer. + if ((controlTransfer.overUnderRunCallback != NULL) && (SUCCESS == controlTransfer.overUnderRunCallback())) + { + USB_PipeDataTransferredSizeReset(pipe); + USB_PipeDataToTransferSizeSet(pipe, controlTransfer.transferDataSize); + status = USB_InTransactionRun(pipe); + } + else + { + // If no new buffer the next transaction will be stalled. + controlTransfer.status = USB_CONTROL_STALL_REQ; + USB_EndpointInStall(0); + USB_EndpointOutStall(0); + + status = SUCCESS; + } + } + } + else + { + // Starts next transaction in data stage. + status = USB_OutTransactionRun(pipe); + } + + USB_EndpointOutOverUnderflowAck(0); + break; + } + case USB_CONTROL_ZLP: + { + // Valid end of setup request. + if (controlTransfer.endOfRequestCallback != NULL) + { + controlTransfer.endOfRequestCallback(); + } + + // Reinitializes control endpoint management. + status = USB_ControlTransferReset(); + break; + } + case USB_CONTROL_SETUP: + { + status = USB_ControlTransferReset(); + break; + } + default: + { + status = CONTROL_TRANSACTION_STATUS_ERROR; + break; + } + } + } + + return status; +} + +RETURN_CODE_t USB_ControlTransferZLP(uint8_t direction) +{ + RETURN_CODE_t status = UNINITIALIZED; + + USB_NumberBytesToSendReset(0); + USB_NumberBytesSentReset(0); + USB_NumberBytesToReceiveReset(0u); + USB_NumberBytesReceivedReset(0u); + + // Prepare to receive a new setup package in case the host decides to ignore the ZLP stage + USB_PipeDataPtrSet((USB_PIPE_t){ .address = 0, .direction = USB_REQUEST_DIR_OUT }, controlTransfer.buffer); + status = EndpointBufferSet((USB_PIPE_t){ .address = 0, .direction = USB_REQUEST_DIR_OUT }, controlTransfer.buffer); + + if (SUCCESS == status) + { + controlTransfer.status = USB_CONTROL_ZLP; + + // Starts the ZLP transaction + if (direction == USB_REQUEST_DIR_IN) + { + USB_EndpointInNAKClear(0); + USB_EndpointInOverUnderflowAck(0); + } + else + { + USB_EndpointOutNAKClear(0); + USB_EndpointOutOverUnderflowAck(0); + } + } + + return status; +} + +RETURN_CODE_t USB_ControlTransferReset(void) +{ + RETURN_CODE_t status = UNINITIALIZED; + USB_PIPE_t controlPipeOut = { .address = 0u, .direction = USB_EP_DIR_OUT }; + + // Aborts any ongoing transaction and resets the endpoint statuses + status = USB_TransactionAbort(controlPipeOut); + if (SUCCESS == status) + { + USB_PIPE_t controlPipeIn = { .address = 0u, .direction = USB_EP_DIR_IN }; + status = USB_TransactionAbort(controlPipeIn); + } + + if (SUCCESS == status) + { + USB_EndpointOutStatusClear(0u); + USB_EndpointInStatusClear(0u); + + // Prepare for receiving a new request packet + USB_PipeDataPtrSet(controlPipeOut, controlTransfer.buffer); + USB_PipeDataToTransferSizeSet(controlPipeOut, sizeof(USB_SETUP_REQUEST_t)); + USB_PipeDataTransferredSizeReset(controlPipeOut); + USB_PipeTransferEndCallbackRegister(controlPipeOut, NULL); + + // Clears the endpoint count registers + USB_NumberBytesToSendReset(0u); + USB_NumberBytesSentReset(0u); + USB_NumberBytesToReceiveReset(0u); + USB_NumberBytesReceivedReset(0u); + + // Resets the control transfer variables + controlTransfer.endOfRequestCallback = NULL; + controlTransfer.overUnderRunCallback = NULL; + controlTransfer.transferDataSize = 0u; + controlTransfer.status = USB_CONTROL_SETUP; + } + + return status; +} + +RETURN_CODE_t USB_ControlTransferDataSet(uint8_t *dataPtr, uint16_t dataSize) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (dataPtr == NULL) + { + controlTransfer.transferDataPtr = controlTransfer.buffer; + if (0u != dataSize) + { + status = CONTROL_SIZE_ERROR; + } + else + { + status = SUCCESS; + } + } + else + { + controlTransfer.transferDataPtr = dataPtr; + status = SUCCESS; + } + controlTransfer.transferDataSize = dataSize; + + return status; +} + +RETURN_CODE_t USB_ControlTransferDataWriteBuffer(uint8_t *dataPtr, uint8_t dataSize) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_EP0_SIZE < dataSize) + { + status = CONTROL_SIZE_ERROR; + } + else + { + (void)memcpy(controlTransfer.buffer, dataPtr, dataSize); + controlTransfer.transferDataPtr = controlTransfer.buffer; + controlTransfer.transferDataSize = dataSize; + + status = SUCCESS; + } + return status; +} + +void USB_ControlEndOfRequestCallbackRegister(USB_SETUP_ENDOFREQUEST_CALLBACK_t callback) +{ + controlTransfer.endOfRequestCallback = callback; +} + +void USB_ControlProcessSetupCallbackRegister(USB_SETUP_PROCESS_CALLBACK_t callback) +{ + controlTransfer.processSetupCallback = callback; +} + +void USB_ControlOverUnderRunCallbackRegister(USB_SETUP_OVERUNDERRUN_CALLBACK_t callback) +{ + controlTransfer.overUnderRunCallback = callback; +} + +RETURN_CODE_t USB_ControlProcessOverUnderflow(uint8_t overunderflow) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_CONTROL_DATA_IN == controlTransfer.status) + { + if (OVERFLOW_EVENT == overunderflow) + { + // Host is done with the data stage and expects an OUT ZLP + status = USB_ControlTransferZLP(USB_REQUEST_DIR_OUT); + } + else + { + // Host is too eager, let this be handled by the transfer handler + status = SUCCESS; + } + } + else if (USB_CONTROL_DATA_OUT == controlTransfer.status) + { + if (UNDERFLOW_EVENT == overunderflow) + { + // Host is done with the data stage and expects an IN ZLP + status = USB_ControlTransferZLP(USB_REQUEST_DIR_IN); + } + else + { + // Host is too eager, let this be handled by the transfer handler + status = SUCCESS; + } + } + else + { + // Remaining control statuses ignores overflow and underflow events + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_HandleEventStalled(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + USB_EndpointInStallAck(pipe.address); + USB_EndpointOutStallAck(pipe.address); + + USB_EndpointInStallClear(pipe.address); + USB_EndpointOutStallClear(pipe.address); + + if (0u == pipe.address) + { + // Reinitializes control endpoint management. + status = USB_ControlTransferReset(); + } + else + { + status = USB_TransactionAbort(pipe); + } + + return status; +} + +void USB_PeripheralInitialize(void) +{ + USB_Enable(); + USB_FrameNumEnable(); + USB_FifoEnable(); + USB_FifoReadPointerReset(); + USB_FifoWritePointerReset(); + USB_EndpointTableAddressSet(endpointTable.EP); + USB_MaxEndpointsSet(USB_EP_NUM - 1u); + USB_InterruptFlagsClear(); + // Reset endpoints table + for (uint8_t endpoint = 0; endpoint < (uint8_t)USB_EP_NUM; endpoint++) + { + endpointTable.EP[endpoint].OUT.CTRL = 0; + endpointTable.EP[endpoint].OUT.STATUS = 0; + endpointTable.EP[endpoint].IN.CTRL = 0; + endpointTable.EP[endpoint].IN.STATUS = 0; + } +} + +void USB_PeripheralDisable(void) +{ + USB_Disable(); + USB_DeviceAddressReset(); +} diff --git a/mcc_generated_files/usb/usb_peripheral/usb_peripheral.h b/mcc_generated_files/usb/usb_peripheral/usb_peripheral.h new file mode 100644 index 0000000..2957f60 --- /dev/null +++ b/mcc_generated_files/usb/usb_peripheral/usb_peripheral.h @@ -0,0 +1,336 @@ +/** + * USBPERIPHERAL Peripheral Header File + * @file usb_peripheral.h + * @defgroup usb_peripheral USB Peripheral Hardware Abstraction Layer (HAL) + * @brief Interface for a USB peripheral module that needs to be implemented by a device-specific USB module driver. + * @version USB Device Stack HAL Driver Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_PERIPHERAL_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_PERIPHERAL_H + +#include +#include + +#include +#include +#include +#include + +/** + * @ingroup usb_peripheral + * @struct USB_CONTROL_TRANSFER_t + * @brief The data structure for internally handling control transfers, either IN or OUT. + */ +typedef struct USB_CONTROL_TRANSFER_struct +{ + uint8_t buffer[64]; /** +#else // avr-gcc + #include +#endif + +#include +#include + +/** + * @ingroup usb_peripheral_avr_du + * @def ALWAYS_INLINE + * @brief Alias that makes always inline function definitions more readable. + */ +#define ALWAYS_INLINE __attribute__((always_inline)) inline + +/** + * @ingroup usb_peripheral_avr_du + * @struct USB_ENDPOINT_TABLE_struct + * @brief Represents the endpoint configuration table based on the number of endpoints in use. + * The table data structure is defined by USB_EP_TABLE_struct in the device header file, + * modified to support configuration of size from USB_EP_NUM. + */ +typedef struct USB_ENDPOINT_TABLE_struct +{ + register8_t FIFO[USB_EP_NUM * 2u]; /**> USB_MAXEP_gp); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Sets the address of the endpoint table. + * This is a device-specific function. + * @param endpointTableAddress - Address of the endpoint table + * @return None. + */ +static ALWAYS_INLINE void USB_EndpointTableAddressSet(USB_EP_PAIR_t *endpointTableAddress) +{ + USB0.EPPTR = (uint16_t)endpointTableAddress; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Sets the address of the endpoint table to 0. + * This is a device-specific function. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_EndpointTableAddressReset(void) +{ + USB0.EPPTR = 0x0000; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Gets the address of the endpoint table. + * This is a device-specific function. + * @param None. + * @return The address of the endpoint table + */ +static ALWAYS_INLINE uint16_t USB_EndpointTableAddressGet(void) +{ + return (USB0.EPPTR); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Resets the read FIFO pointer. + * This is a device-specific function. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_FifoReadPointerReset(void) +{ + USB0.FIFORP |= (USB_FIFORP_gm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Gets the read FIFO pointer. + * This is a device-specific function. + * @param None. + * @return The FIFO read pointer + */ +static ALWAYS_INLINE int8_t USB_FifoReadPointerGet(void) +{ + return (int8_t)(USB0.FIFORP); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Resets the write FIFO pointer. + * This is a device-specific function. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_FifoWritePointerReset(void) +{ + USB0.FIFOWP |= (USB_FIFOWP_gm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Gets the write FIFO pointer. + * This is a device-specific function. + * @param None. + * @return The FIFO write pointer + */ +static ALWAYS_INLINE int8_t USB_FifoWritePointerGet(void) +{ + return (int8_t)(USB0.FIFOWP); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Sets the device address. + * @param usbAddress - The device address to set + * @return None. + */ +static ALWAYS_INLINE void USB_DeviceAddressSet(uint8_t usbAddress) +{ + USB0.ADDR = ((USB0.ADDR & ~USB_ADDR_gm) | (((usbAddress) << USB_ADDR_gp) & USB_ADDR_gm)); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Resets the device address. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_DeviceAddressReset(void) +{ + USB0.ADDR &= ~(USB_ADDR_gm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Gets the device address. + * @param None. + * @return The device address + */ +static ALWAYS_INLINE uint8_t USB_DeviceAddressGet(void) +{ + return ((USB0.ADDR & USB_ADDR_gm) >> USB_ADDR_gp); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables an upstream resume to be initated. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_UpstreamResumeEnable(void) +{ + USB0.CTRLB |= USB_URESUME_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if upstream resume is enabled, but not yet initiated. + * @param None. + * @retval 0 - Upstream resume initiated or not enabled + * @retval 1 - Upstream resume enabled + */ +static ALWAYS_INLINE bool USB_UpstreamResumeIsEnable(void) +{ + return ((USB0.CTRLB & USB_URESUME_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Gets the USB bus state. + * @param None. + * @return The state of the USB bus + */ +static ALWAYS_INLINE uint8_t USB_BusStateGet(void) +{ + return (USB0.BUSSTATE); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB bus has any specific status flags set. + * @param bus_state_bm - The bitmap of the specific status flags to check + * @retval 0 - No status flags set + * @retval 1 - The bus has one or more specified status flags set + */ +static ALWAYS_INLINE bool USB_BusStateIs(uint8_t bus_state_bm) +{ + return ((USB0.BUSSTATE & (bus_state_bm)) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Start-Of-Frame interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SOFInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_SOF_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Start-Of-Frame interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SOFInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_SOF_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Start-Of-Frame Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SOFInterruptClear(void) +{ + USB0.INTFLAGSA = USB_SOF_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Start-Of-Frame interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_SOFInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_SOF_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Suspend interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SuspendInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_SUSPEND_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Suspend interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SuspendInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_SUSPEND_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Suspend Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SuspendInterruptClear(void) +{ + USB0.INTFLAGSA = USB_SUSPEND_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Suspend interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_SuspendInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_SUSPEND_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Resume interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_ResumeInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_RESUME_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Resume interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_ResumeInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_RESUME_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Resume Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_ResumeInterruptClear(void) +{ + USB0.INTFLAGSA = USB_RESUME_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Resume interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_ResumeInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_RESUME_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Reset interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_ResetInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_RESET_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Reset interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_ResetInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_RESET_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Reset Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_ResetInterruptClear(void) +{ + USB0.INTFLAGSA = USB_RESET_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Reset interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_ResetInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_RESET_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Stalled interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_StalledInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_STALLED_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Stalled interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_StalledInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_STALLED_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Stalled Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_StalledInterruptClear(void) +{ + USB0.INTFLAGSA = USB_STALLED_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Stalled interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_StalledInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_STALLED_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Underflow interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_UnderflowInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_UNF_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Underflow interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_UnderflowInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_UNF_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Underflow Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_UnderflowInterruptClear(void) +{ + USB0.INTFLAGSA = USB_UNF_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if an Underflow interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_UnderflowInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_UNF_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Overflow interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_OverflowInterruptEnable(void) +{ + USB0.INTCTRLA |= USB_OVF_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Overflow interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_OverflowInterruptDisable(void) +{ + USB0.INTCTRLA &= ~(USB_OVF_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Overflow Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_OverflowInterruptClear(void) +{ + USB0.INTFLAGSA = USB_OVF_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if an Overflow interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_OverflowInterruptIs(void) +{ + return ((USB0.INTFLAGSA & USB_OVF_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Transaction Complete interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_TransactionCompleteInterruptEnable(void) +{ + USB0.INTCTRLB |= USB_TRNCOMPL_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Transaction Complete interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_TransactionCompleteInterruptDisable(void) +{ + USB0.INTCTRLB &= ~(USB_TRNCOMPL_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Transaction Complete Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_TransactionCompleteInterruptAck(void) +{ + USB0.INTFLAGSB = USB_TRNCOMPL_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if a Transaction Complete interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_TransactionCompleteInterruptIs(void) +{ + return ((USB0.INTFLAGSB & USB_TRNCOMPL_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Read-Modify-Write Interrupt is enabled. + * @param None. + * @retval 0 - Interrupt not enabled + * @retval 1 - Interrupt enabled + */ +static ALWAYS_INLINE bool USB_ReadModifyWriteInterruptIs(void) +{ + return ((USB0.INTFLAGSB & USB_RMWBUSY_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Global NAK Done interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_GlobalNAKDoneInterruptEnable(void) +{ + USB0.INTCTRLB |= USB_GNDONE_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Global NAK Done interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_GlobalNAKDoneInterruptDisable(void) +{ + USB0.INTCTRLB &= ~(USB_GNDONE_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Global NAK Done Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_GlobalNAKDoneInterruptAck(void) +{ + USB0.INTFLAGSB = USB_GNDONE_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if the USB Global NAK Done interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_GlobalNAKDoneInterruptIs(void) +{ + return ((USB0.INTFLAGSB & USB_GNDONE_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Enables the USB Setup interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SetupInterruptEnable(void) +{ + USB0.INTCTRLB |= USB_SETUP_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Disables the USB Setup interrupt. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SetupInterruptDisable(void) +{ + USB0.INTCTRLB &= ~(USB_SETUP_bm); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears the USB Setup Interrupt flag. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_SetupInterruptClear(void) +{ + USB0.INTFLAGSB = USB_SETUP_bm; +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Checks if a USB Setup interrupt has been triggered. + * @param None. + * @retval 0 - Interrupt not triggered + * @retval 1 - Interrupt triggered + */ +static ALWAYS_INLINE bool USB_SetupInterruptIs(void) +{ + return ((USB0.INTFLAGSB & USB_SETUP_bm) != 0u); +} + +/** + * @ingroup usb_peripheral_avr_du + * @brief Clears all the USB Interrupt flags. + * @param None. + * @return None. + */ +static ALWAYS_INLINE void USB_InterruptFlagsClear(void) +{ + USB0.INTFLAGSA = 0xff; + USB0.INTFLAGSB = 0xff; +} + +#endif /* USB_PERIPHERAL_AVR_DU_H */ diff --git a/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c new file mode 100644 index 0000000..5ee9a21 --- /dev/null +++ b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c @@ -0,0 +1,510 @@ +/** + * USBPERIPHERALENDPOINT Peripheral Endpoint Source File + * @file usb_peripheral_endpoint.c + * @ingroup usb_peripheral_endpoint + * @brief API module for usb_peripheral covering endpoint related functions. + * @version USB Device Stack HAL Driver Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#if defined(USB_EP_NUM) && defined(USB_MAX_ENDPOINTS) + #if USB_EP_NUM > USB_MAX_ENDPOINTS + #error "USB_EP_NUM is too large, max is USB_MAX_ENDPOINTS" + #endif +#else + #error "USB_EP_NUM not configured" +#endif + +/** + * @ingroup usb_peripheral_endpoint + * @brief Algorithm to detect if a given number is a power of two. + * A number is a power of two if it has exactly one '1' in its binary representation. This is true if subtracting '1' from the number + * and doing an AND operation on the result with the number itself returns 0. + * @param number 8-bit unsigned integer + * @retval True - The given number is a power of two + * @retval False - The given number is not a power of two + */ +#define IsPowerOfTwo(number) ((0u != (number)) && (((number) & ((number)-1u)) == 0u)) + +/** + * @ingroup usb_peripheral_endpoint + * @brief SRAM tables for the FIFO and endpoint registers, as well as the FRAMENUM register. + * Represents the endpoint configuration table based on the number of endpoints in use. + * This line instantiates an object using the data structure type. + */ +USB_ENDPOINT_TABLE_t endpointTable __attribute__((aligned(2))); + +RETURN_CODE_t USB_EndpointConfigure(USB_PIPE_t pipe, uint16_t endpointSize, USB_ENDPOINT_t endpointType) +{ + RETURN_CODE_t status = UNINITIALIZED; + + uint8_t endpointConfiguration = 0; + if (SUCCESS != ConvertEndpointSizeToMask(endpointSize, endpointType, &endpointConfiguration)) + { + status = ENDPOINT_SIZE_ERROR; + } + else if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else if (INTERRUPT < endpointType) + { + status = ENDPOINT_TYPE_ERROR; + } + else + { + switch (endpointType) + { + case CONTROL: + endpointConfiguration |= USB_TYPE_CONTROL_gc; + break; + case ISOCHRONOUS: + endpointConfiguration |= USB_TYPE_ISO_gc; + break; + case BULK: + case INTERRUPT: + endpointConfiguration |= USB_TYPE_BULKINT_gc; + break; + default: + endpointConfiguration |= USB_TYPE_DISABLE_gc; + break; + } + + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutNAKSet(pipe.address); + USB_EndpointOutStatusClear(pipe.address); + USB_NumberBytesReceivedReset(pipe.address); + USB_EndpointOutControlSet(pipe.address, endpointConfiguration); + + // Set up the static endpoint configurations + if ((uint8_t)0x01 == endpointStaticConfig[pipe.address].OutMultipktEnable) + { + USB_EndpointOutMultipktEnable(pipe.address); + + if ((uint8_t)0x01 == endpointStaticConfig[pipe.address].OutAzlpEnable) + { + USB_EndpointOutAzlpEnable(pipe.address); + } + + status = SUCCESS; + } + else if ((uint8_t)0x01 == endpointStaticConfig[pipe.address].OutAzlpEnable) + { + // AZLP only works together with multipacket + status = ENDPOINT_AZLP_ERROR; + } + else + { + status = SUCCESS; + } + + if ((uint8_t)0x01 != endpointStaticConfig[pipe.address].OutTrncInterruptEnable) + { + USB_EndpointOutTransactionCompleteInterruptDisable(pipe.address); + } + } + else + { + USB_EndpointInNAKSet(pipe.address); + USB_EndpointInStatusClear(pipe.address); + USB_NumberBytesToSendReset(pipe.address); + USB_EndpointInControlSet(pipe.address, endpointConfiguration); + + // Set up the static endpoint configurations + if ((uint8_t)0x01 == endpointStaticConfig[pipe.address].InMultipktEnable) + { + USB_EndpointInMultipktEnable(pipe.address); + + if ((uint8_t)0x01 == endpointStaticConfig[pipe.address].InAzlpEnable) + { + USB_EndpointInAlzpEnable(pipe.address); + } + + status = SUCCESS; + } + else if ((uint8_t)0x01 == endpointStaticConfig[pipe.address].InAzlpEnable) + { + // AZLP only works together with multipacket + status = ENDPOINT_AZLP_ERROR; + } + else + { + status = SUCCESS; + } + + if ((uint8_t)0x01 != endpointStaticConfig[pipe.address].InTrncInterruptEnable) + { + USB_EndpointInTransactionCompleteDisable(pipe.address); + } + } + } + + return status; +} + +RETURN_CODE_t USB_EndpointDisable(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndPointOutDisable(pipe.address); + } + else + { + USB_EndPointInDisable(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +uint16_t USB_EndpointSizeGet(USB_PIPE_t pipe) +{ + uint8_t endpointType = 0; + uint8_t endpointSizeConfig = 0; + int16_t endpointSize = 0; + if (USB_EP_DIR_OUT == pipe.direction) + { + endpointType = USB_EndPointOutTypeConfigGet(pipe.address); + endpointSizeConfig = (USB_TYPE_ISO_gc == endpointType) ? USB_EndpointOutIsoSizeGet(pipe.address) : USB_EndpointOutDefaultSizeGet(pipe.address); + } + else + { + endpointType = USB_EndPointInTypeConfigGet(pipe.address); + endpointSizeConfig = (USB_TYPE_ISO_gc == endpointType) ? USB_EndpointInIsoSizeGet(pipe.address) : USB_EndpointInDefaultSizeGet(pipe.address); + } + if (USB_BUFSIZE_ISO_BUF1023_gc == endpointSizeConfig) + { + endpointSize = MAX_ENDPOINT_SIZE_ISO; + } + else + { + endpointSize = 8U << (uint16_t)endpointSizeConfig; + } + return endpointSize; +} + +USB_ENDPOINT_t USB_EndpointTypeGet(USB_PIPE_t pipe) +{ + USB_TYPE_t endpointConfigType; + if (USB_EP_DIR_OUT == pipe.direction) + { + endpointConfigType = USB_EndPointOutTypeConfigGet(pipe.address); + } + else // USB_EP_DIR_IN + { + endpointConfigType = USB_EndPointInTypeConfigGet(pipe.address); + } + + USB_ENDPOINT_t endpointType = DISABLED; + switch (endpointConfigType) + { + case USB_TYPE_CONTROL_gc: + endpointType = CONTROL; + break; + case USB_TYPE_BULKINT_gc: + // Peripheral does not distinguish between BULK and INTERRUPT, returning BULK + endpointType = BULK; + break; + case USB_TYPE_ISO_gc: + endpointType = ISOCHRONOUS; + break; + default: + // endpointType = DISABLED; + break; + } + + return endpointType; +} + +RETURN_CODE_t USB_EndpointStall(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutStall(pipe.address); + } + else + { + USB_EndpointInStall(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_EndpointStallClear(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutStallClear(pipe.address); + } + else + { + USB_EndpointInStallClear(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +bool USB_EndpointIsStalled(USB_PIPE_t pipe) +{ + + bool isStalled = false; + + if ((uint8_t)USB_EP_NUM > pipe.address) + { + if (USB_EP_DIR_OUT == pipe.direction) + { + isStalled = USB_EndpointOutIsStalled(pipe.address); + } + else + { + isStalled = USB_EndpointInIsStalled(pipe.address); + } + } + + return isStalled; +} + +RETURN_CODE_t USB_EndpointStalledConditionAck(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutStallAck(pipe.address); + } + else + { + USB_EndpointInStallAck(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_DataToggleSet(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutDataToggleSet(pipe.address); + } + else + { + USB_EndpointInDataToggleSet(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_DataToggleClear(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutDataToggleClear(pipe.address); + } + else + { + USB_EndpointInDataToggleClear(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_DataToggle(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + (USB_EndpointOutDataToggleIsSet(pipe.address)) ? USB_DataToggleClear(pipe) : USB_DataToggleSet(pipe); + } + else + { + (USB_EndpointInDataToggleIsSet(pipe.address)) ? USB_DataToggleClear(pipe) : USB_DataToggleSet(pipe); + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t ConvertEndpointSizeToMask(uint16_t endpointSize, USB_ENDPOINT_t endpointType, uint8_t *endpointMaskPtr) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (ISOCHRONOUS == endpointType) + { + if (((uint16_t)MAX_ENDPOINT_SIZE_ISO < endpointSize) || ((endpointSize < (uint16_t)MAX_ENDPOINT_SIZE_ISO) && !(IsPowerOfTwo(endpointSize)))) + { + status = ENDPOINT_SIZE_ERROR; + } + } + else + { + if (((uint16_t)MAX_ENDPOINT_SIZE_DEFAULT < endpointSize) || !(IsPowerOfTwo(endpointSize))) + { + status = ENDPOINT_SIZE_ERROR; + } + } + + if (UNINITIALIZED == status) + { + if ((uint16_t)MAX_ENDPOINT_SIZE_ISO == endpointSize) + { + *endpointMaskPtr = USB_BUFSIZE_ISO_BUF1023_gc; + } + else + { + uint8_t mask = 0; + uint16_t baseSize = 8; + + while (baseSize < endpointSize) + { + + mask++; + baseSize <<= 1; + } + + *endpointMaskPtr = mask << USB_BUFSIZE_DEFAULT_gp; + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t EndpointBufferSet(USB_PIPE_t pipe, uint8_t *bufAddress) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + // Errata: Out transactions must be word aligned when using multipacket + if ((1u == endpointStaticConfig[pipe.address].OutMultipktEnable) && (((uint16_t)bufAddress & 0x0001) != 0u)) + { + status = ENDPOINT_ALIGN_ERROR; + } + else + { + USB_EndpointOutBufferSet(pipe.address, bufAddress); + status = SUCCESS; + } + } + else + { + USB_EndpointInBufferSet(pipe.address, bufAddress); + status = SUCCESS; + } + } + + return status; +} diff --git a/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.h b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.h new file mode 100644 index 0000000..fa77fca --- /dev/null +++ b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.h @@ -0,0 +1,171 @@ +/** + * USBPERIPHERALENDPOINT Peripheral Endpoint Header File + * @file usb_peripheral_endpoint.h + * @defgroup usb_peripheral_endpoint USB Peripheral Endpoint + * @ingroup usb_peripheral + * @brief API module for usb_peripheral_endpoint covering endpoint-related functions. + * @version USB Device Stack HAL Driver Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_PERIPHERAL_ENDPOINT_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_PERIPHERAL_ENDPOINT_H + +#include +#include + +#include "usb_common_elements.h" +#include "usb_protocol_headers.h" + +/** + * @ingroup usb_peripheral_endpoint + * @brief Configures the endpoint with the desired settings using the Control and Status Register. + * Used to set up an endpoint before using it in an application. + * Sets up all the control register settings by looking up the usb_config.h file and clears the count registers. + * @param pipe - A combination of endpoint address and direction + * @param endpointSize - Number of bytes of data supported by the endpoint in one USB transaction + * @param endpointType - Type of USB endpoint as defined by usb_endpoint_type + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_EndpointConfigure(USB_PIPE_t pipe, uint16_t endpointSize, USB_ENDPOINT_t endpointType); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Disables the endpoint by setting the endpoint type to 0x00. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_EndpointDisable(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Helper function to return the endpoint size. + * @param pipe - A combination of endpoint address and direction + * @return The size of the endpoint + */ +uint16_t USB_EndpointSizeGet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Helper function to return the endpoint type. + * @param pipe - A combination of endpoint address and direction + * @return The endpoint type + */ +USB_ENDPOINT_t USB_EndpointTypeGet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Helps stall an endpoint when a command received from the host is invalid or unrecognizable. + * Used if the host sends data that is not supported by the device. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_EndpointStall(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Helps clear the Stall condition after the device has recovered from an unsupported command from the host. + * Used to reset stall before the next USB transfer. + * Used when the host issues a clear HALT/Feature request to reset stall. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_EndpointStallClear(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Helper function to return the endpoint Stall condition. + * @param pipe - A combination of endpoint address and direction + * @return A boolean value representing the Stall condition. If the pipe address is out of bounds, the function will always return false + */ +bool USB_EndpointIsStalled(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Acknowledges the stall status condition by clearing the Stall Status bit. + * Used to clear the Stall Status bit after a stall has been detected. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_EndpointStalledConditionAck(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Sets the Data Toggle bit on an endpoint which is used to ensure correct data sequence. + * Only used if hardware data toggling is not available. + * After a successful transaction, toggle the Data Toggle bit. + * For SETUP transactions, ensure that the SETUP stage clears the Data Toggle bit, + * while the data stage and status stage set the Data Toggle bit. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DataToggleSet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Clears the Data Toggle bit on an endpoint which is used to ensure correct data sequence. + * Only used if hardware data toggling is not available. + * After a successful transaction, toggle the Data Toggle bit. + * For SETUP transactions, ensure that the SETUP stage clears the Data Toggle bit, + * while the data stage and status stage set the Data Toggle bit. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DataToggleClear(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Toggles the Data Toggle bit on an endpoint which is used to ensure correct data sequence. + * Only used if hardware data toggling is not available. + * After a successful transaction, toggle the Data Toggle bit. + * For SETUP transactions, ensure that the SETUP stage clears the Data Toggle bit, + * while the data stage and status stage set the Data Toggle bit. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_DataToggle(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Converts an endpoint size in number of bytes into a register setting. + * Converts the endpoint size bit mask based on the EP_BUFSIZE setting of the endpoint control register. + * @param endpointSize - The size to convert + * @param endpointType - The endpoint type + * @param endpointMaskPtr - Pointer to the mask variable to write to + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t ConvertEndpointSizeToMask(uint16_t endpointSize, USB_ENDPOINT_t endpointType, uint8_t *endpointMaskPtr); + +/** + * @ingroup usb_peripheral_endpoint + * @brief Configures the endpoint data buffer to a location in RAM for the next transaction. + * @param pipe - A combination of endpoint address and direction + * @param bufAddress - The pointer to the data buffer the endpoint will use + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t EndpointBufferSet(USB_PIPE_t pipe, uint8_t *bufAddress); + +#endif /* USB_PERIPHERAL_ENDPOINT_H */ diff --git a/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c new file mode 100644 index 0000000..1d91d08 --- /dev/null +++ b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c @@ -0,0 +1,484 @@ +/** + * USBPERIPHERALREADWRITE Peripheral Read/Write Source File + * @file usb_peripheral_read_write.c + * @ingroup usb_peripheral_read_write + * @brief API module for usb_peripheral covering low level USB transaction functions. + * @version USB Device Stack HAL Driver Version 1.0.0 + */ + +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/** + * @ingroup usb_peripheral_read_write + * @def Calculates from pipe address and direction to location in a transfer array. + * @param pipe - A combination of endpoint address and direction + * @return The pipe transaction index for this pipe in pipe_transfer[] + */ +#define PipeTransferIndexGet(pipe) (((pipe).address * 2) + (pipe).direction) + +STATIC USB_PIPE_TRANSFER_t pipeTransfer[USB_EP_NUM * 2]; + +RETURN_CODE_t USB_TransactionStart(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutNAKClear(pipe.address); + } + else + { + USB_EndpointInNAKClear(pipe.address); + } + + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_TransactionAbort(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutNAKSet(pipe.address); + } + else + { + USB_EndpointInNAKSet(pipe.address); + } + + pipeTransfer[PipeTransferIndexGet(pipe)].status = USB_PIPE_TRANSFER_ABORTED; + status = SUCCESS; + } + + return status; +} + +RETURN_CODE_t USB_TransactionCompleteAck(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + if (USB_EP_DIR_OUT == pipe.direction) + { + USB_EndpointOutTransactionCompleteAck(pipe.address); + } + else + { + USB_EndpointInTransactionCompleteAck(pipe.address); + } + pipeTransfer[PipeTransferIndexGet(pipe)].status = USB_PIPE_TRANSFER_OK; + status = SUCCESS; + } + + return status; +} + +bool USB_TransactionIsCompleted(void) +{ + return USB_TransactionCompleteInterruptIs(); +} + +RETURN_CODE_t USB_TransactionCompletedPipeGet(USB_PIPE_t *pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_TransactionIsCompleted()) + { + // Finds FIFO entry by adding (subtracting) the signed read pointer to the size of the FIFO + // Reading the FIFO Read Pointer will handle the Transaction Complete Interrupt flag. + // The USB_FifoReadPointerGet is a device-specific function. + + uint8_t fifoEntry = endpointTable.FIFO[(USB_EP_NUM * 2u) + USB_FifoReadPointerGet()]; + + // The FIFO entry contains the endpoint address and direction of the endpoint to handle next. + USB_PIPE_t returnPipe = { .direction = (fifoEntry & USB_DIR_bm) >> USB_DIR_bp, .address = (fifoEntry & USB_EPNUM_gm) >> USB_EPNUM_gp }; + + if ((uint8_t)USB_EP_NUM <= returnPipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + pipe->address = returnPipe.address; + pipe->direction = returnPipe.direction; + status = SUCCESS; + } + } + else + { + // No transaction is completed. + status = PIPE_TRANSFER_ERROR; + } + + return status; +} + +RETURN_CODE_t USB_PipeReset(USB_PIPE_t pipe) +{ + RETURN_CODE_t status = UNINITIALIZED; + USB_PIPE_TRANSFER_t *pipeTransferPtr = &pipeTransfer[PipeTransferIndexGet(pipe)]; + + if ((uint8_t)USB_EP_NUM <= pipe.address) + { + status = ENDPOINT_ADDRESS_ERROR; + } + else + { + pipeTransferPtr->status = USB_PIPE_TRANSFER_OK; + pipeTransferPtr->transferDataPtr = NULL; + pipeTransferPtr->transferDataSize = 0; + pipeTransferPtr->bytesTransferred = 0; + pipeTransferPtr->transferEndCallback = NULL; + pipeTransferPtr->ZLPEnable = false; + + status = SUCCESS; + } + + return status; +} + +USB_TRANSFER_STATUS_t USB_PipeStatusGet(USB_PIPE_t pipe) +{ + + return pipeTransfer[PipeTransferIndexGet(pipe)].status; +} + +bool USB_PipeStatusIsBusy(USB_PIPE_t pipe) +{ + + return (pipeTransfer[PipeTransferIndexGet(pipe)].status == USB_PIPE_TRANSFER_BUSY); +} + +void USB_PipeDataPtrSet(USB_PIPE_t pipe, uint8_t *dataPtr) +{ + + pipeTransfer[PipeTransferIndexGet(pipe)].transferDataPtr = dataPtr; +} + +uint8_t *USB_PipeDataPtrGet(USB_PIPE_t pipe) +{ + + return pipeTransfer[PipeTransferIndexGet(pipe)].transferDataPtr; +} + +void USB_PipeDataToTransferSizeSet(USB_PIPE_t pipe, uint16_t dataSize) +{ + + pipeTransfer[PipeTransferIndexGet(pipe)].transferDataSize = dataSize; +} + +uint16_t USB_PipeDataToTransferSizeGet(USB_PIPE_t pipe) +{ + + return pipeTransfer[PipeTransferIndexGet(pipe)].transferDataSize; +} + +uint16_t USB_PipeDataTransferredSizeGet(USB_PIPE_t pipe) +{ + + return pipeTransfer[PipeTransferIndexGet(pipe)].bytesTransferred; +} + +void USB_PipeDataTransferredSizeSet(USB_PIPE_t pipe, uint16_t dataSize) +{ + + pipeTransfer[PipeTransferIndexGet(pipe)].bytesTransferred = dataSize; +} + +void USB_PipeDataTransferredSizeReset(USB_PIPE_t pipe) +{ + + pipeTransfer[PipeTransferIndexGet(pipe)].bytesTransferred = 0; +} + +void USB_PipeTransferZLP_Enable(USB_PIPE_t pipe) +{ + // Only enable manual ZLP if hardware AZLP is not enabled. + if (((USB_EP_DIR_IN == pipe.direction) && (0u == endpointStaticConfig[pipe.address].InAzlpEnable)) + || ((USB_EP_DIR_OUT == pipe.direction) && (0u == endpointStaticConfig[pipe.address].OutAzlpEnable))) + { + pipeTransfer[PipeTransferIndexGet(pipe)].ZLPEnable = true; + } +} + +void USB_PipeTransferEndCallbackRegister(USB_PIPE_t pipe, USB_TRANSFER_END_CALLBACK_t callback) +{ + pipeTransfer[PipeTransferIndexGet(pipe)].transferEndCallback = callback; +} + +void USB_PipeTransferEndCallback(USB_PIPE_t pipe) +{ + USB_PIPE_TRANSFER_t *pipeTransferPtr = &pipeTransfer[PipeTransferIndexGet(pipe)]; + + if (NULL != pipeTransferPtr->transferEndCallback) + { + pipeTransferPtr->transferEndCallback(pipe, pipeTransferPtr->status, pipeTransferPtr->bytesTransferred); + } +} + +RETURN_CODE_t USB_InTransactionRun(USB_PIPE_t pipe) +{ + USB_PIPE_TRANSFER_t *pipeTransferPtr = &pipeTransfer[PipeTransferIndexGet(pipe)]; + RETURN_CODE_t status = UNINITIALIZED; + uint16_t nextTransactionSize; + + if (USB_EP_DIR_IN != pipe.direction) + { + // Pipe is OUT, returns error code. + status = ENDPOINT_DIRECTION_ERROR; + } + else + { + // Makes sure the transfer status is busy. + pipeTransferPtr->status = USB_PIPE_TRANSFER_BUSY; + + // Calculates the size of next transaction. + nextTransactionSize = pipeTransferPtr->transferDataSize - pipeTransferPtr->bytesTransferred; + if (0U == nextTransactionSize) + { + // All data is sent, check if we need to send a manual ZLP as well. + if (true == pipeTransferPtr->ZLPEnable) + { + // Sends a zero-length package by setting bytes to send to 0. + USB_NumberBytesToSendSet(pipe.address, 0u); + USB_NumberBytesSentReset(pipe.address); + USB_EndpointInNAKClear(pipe.address); + + // Clears ZLPEnable to show it has been sent. + pipeTransferPtr->ZLPEnable = false; + } + else + { + // Everything has been sent, return transfer status to OK. + pipeTransferPtr->status = USB_PIPE_TRANSFER_OK; + } + + status = SUCCESS; + } + else + { + uint16_t endpointSize = USB_EndpointSizeGet(pipe); + if ((0u == endpointStaticConfig[pipe.address].InMultipktEnable) && (nextTransactionSize > endpointSize)) + { + // Only send endpoint size packet per transaction when MultiPacket is disabled. + nextTransactionSize = endpointSize; + } + else + { + // Check if a manual ZLP is needed after transaction, if transaction size is a multiple of endpoint size. + pipeTransferPtr->ZLPEnable = (pipeTransferPtr->ZLPEnable) && (0U == (nextTransactionSize % (uint16_t)endpointSize)); + } + + // Configure where to transfer from. + status = EndpointBufferSet(pipe, &pipeTransferPtr->transferDataPtr[pipeTransferPtr->bytesTransferred]); + + // Send transaction + if (SUCCESS == status) + { + USB_NumberBytesToSendSet(pipe.address, nextTransactionSize); + USB_NumberBytesSentReset(pipe.address); + USB_EndpointInNAKClear(pipe.address); + } + } + } + + return status; +} + +RETURN_CODE_t USB_OutTransactionRun(USB_PIPE_t pipe) +{ + USB_PIPE_TRANSFER_t *pipeTransferPtr = &pipeTransfer[PipeTransferIndexGet(pipe)]; + RETURN_CODE_t status = UNINITIALIZED; + + if (USB_EP_DIR_OUT != pipe.direction) + { + // Pipe is IN, return error code. + status = ENDPOINT_DIRECTION_ERROR; + } + else + { + // Make sure the transfer status is busy. + pipeTransferPtr->status = USB_PIPE_TRANSFER_BUSY; + + // Update the data pointer for the next transaction. + status = EndpointBufferSet(pipe, &pipeTransferPtr->transferDataPtr[pipeTransferPtr->bytesTransferred]); + + // Calculate the size of next transaction. + uint16_t endpointSize = USB_EndpointSizeGet(pipe); + uint16_t nextTransactionSize = pipeTransferPtr->transferDataSize - pipeTransferPtr->bytesTransferred; + if (0u == endpointStaticConfig[pipe.address].OutMultipktEnable) + { + if (nextTransactionSize < endpointSize) + { + // Temporarily enable MultiPacket to avoid receiving data that overflows endpoint buffer. + USB_EndpointOutMultipktEnable(pipe.address); + } + else + { + // Only expect one endpoint size packet per transaction when MultiPacket is disabled. + if (nextTransactionSize > endpointSize) + { + nextTransactionSize = endpointSize; + } + + // Disable MultiPacket in case it was enabled for previous transaction. + USB_EndpointOutMultipktDisable(pipe.address); + } + } + + if (0u == nextTransactionSize) + { + // Clear ZLPEnable to indicate that the transfer is completed and the ZLP transfer is initated. + pipeTransferPtr->ZLPEnable = false; + + // Everything has been sent, return transfer status to OK. + pipeTransferPtr->status = USB_PIPE_TRANSFER_OK; + } + else + { + // Check if a manual ZLP is needed after transaction, if transaction size is a multiple of endpoint size. + pipeTransferPtr->ZLPEnable = pipeTransferPtr->ZLPEnable && (0u == (nextTransactionSize % endpointSize)); + } + + // Start the transaction + USB_NumberBytesReceivedReset(pipe.address); + USB_NumberBytesToReceiveSet(pipe.address, nextTransactionSize); + USB_EndpointOutNAKClear(pipe.address); + } + + return status; +} + +RETURN_CODE_t USB_PipeTransactionComplete(USB_PIPE_t pipe) +{ + USB_PIPE_TRANSFER_t *pipeTransferPtr = &pipeTransfer[PipeTransferIndexGet(pipe)]; + RETURN_CODE_t status = UNINITIALIZED; + uint16_t transactionSize; + + if (USB_EP_DIR_IN == pipe.direction) + { + // Transaction complete on IN. + if (USB_EndpointInMultipktIsEnabled(pipe.address) == true) + { + // With multipacket enabled we know exactly what got transferred. + transactionSize = USB_NumberBytesSentGet(pipe.address); + } + else + { + // With multipacket disabled we know what we meant to transfer. + transactionSize = USB_NumberBytesToSendGet(pipe.address); + } + + // Check if we need to send more data, or ZLP. + pipeTransferPtr->bytesTransferred += transactionSize; + if ((pipeTransferPtr->bytesTransferred != pipeTransferPtr->transferDataSize) || (pipeTransferPtr->ZLPEnable)) + { + status = USB_InTransactionRun(pipe); + } + else + { + pipeTransferPtr->status = USB_PIPE_TRANSFER_OK; + status = SUCCESS; + } + } + else + { + // Transaction complete on OUT. + transactionSize = USB_NumberBytesReceivedGet(pipe.address); + + // Checks if we have transferred more than we wanted. + uint16_t expectedTransferRemainingSize = pipeTransferPtr->transferDataSize - pipeTransferPtr->bytesTransferred; + if (expectedTransferRemainingSize < transactionSize) + { + // We may have overflowed the receive location! + if (USB_NumberBytesToReceiveGet(pipe.address) == expectedTransferRemainingSize) + { + // Multipacket has limited what we received, even if transactionSize is larger. + transactionSize = expectedTransferRemainingSize; + } + else + { + pipeTransferPtr->status = USB_PIPE_TRANSFER_ERROR; + status = PIPE_TRANSFER_ERROR; + } + } + + if (PIPE_TRANSFER_ERROR != status) + { + // Updates bytes transfered and check if we need to run more transactions. + pipeTransferPtr->bytesTransferred += transactionSize; + + if (((pipeTransferPtr->bytesTransferred < pipeTransferPtr->transferDataSize) || pipeTransferPtr->ZLPEnable) && (0u == (transactionSize % USB_EndpointSizeGet(pipe)))) + { + status = USB_OutTransactionRun(pipe); + } + else + { + pipeTransferPtr->status = USB_PIPE_TRANSFER_OK; + status = SUCCESS; + } + } + } + + // Checks if transfer is completed and cleans up. + if (USB_PIPE_TRANSFER_BUSY != pipeTransferPtr->status) + { + USB_PipeTransferEndCallback(pipe); + } + + return status; +} diff --git a/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.h b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.h new file mode 100644 index 0000000..9c477c0 --- /dev/null +++ b/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.h @@ -0,0 +1,222 @@ +/** + * USBPERIPHERALREADWRITE Peripheral Read/Write Header File + * @file usb_peripheral_read_write.h + * @defgroup usb_peripheral_read_write USB Peripheral Read/Write + * @ingroup usb_peripheral + * @brief API module for usb_peripheral covering low-level USB transaction functions. + * @version USB Device Stack HAL Driver Version 1.0.0 + */ +/* + (c) 2021 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_PERIPHERAL_READ_WRITE_H +// cppcheck-suppress misra-c2012-2.5 +#define USB_PERIPHERAL_READ_WRITE_H + +#include +#include + +#include "usb_common_elements.h" +#include "usb_protocol_headers.h" + +/** + * @ingroup usb_peripheral_read_write + * @brief Starts sending or receiving data on an endpoint by clearing BUSNACK. + * Used as a final step while setting up a transaction on the bus. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransactionStart(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Aborts the next transaction on an endpoint by setting BUSNACK. + * Used to stop exchanging data on an endpoint. The device will start NAKing requests from the host after calling this API. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransactionAbort(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Acknowledges the Transaction Complete status condition by clearing the Transaction Complete status bit. + * Used to clear the Transaction Complete status bit after a transaction has successfully completed. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransactionCompleteAck(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Helper function to return the endpoint transaction complete condition. + * @param None. + * @retval 0 - Transaction not complete or pipe address is out of bounds + * @retval 1 - Transaction is complete + */ +bool USB_TransactionIsCompleted(void); + +/** + * @ingroup usb_peripheral_read_write + * @brief Returns the pipe address and direction for the latest completed transaction. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_TransactionCompletedPipeGet(USB_PIPE_t *pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Resets the pipe. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_PipeReset(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Gets the current status of pipe. + * @param pipe - A combination of endpoint address and direction + * @return USB_PIPE_TRANSFER_OK or an Error code according to USB_TRANSFER_STATUS_t + */ +USB_TRANSFER_STATUS_t USB_PipeStatusGet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Checks if the pipe status is busy. + * @param pipe - A combination of endpoint address and direction + * @retval 0 - Pipe status not busy + * @retval 1 - Pipe status is busy + */ +bool USB_PipeStatusIsBusy(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Configures the pointer for the data transfer in a given pipe. + * @param pipe - A combination of endpoint address and direction + * @param *dataPtr - The pointer to the data location + * @return None. + */ +void USB_PipeDataPtrSet(USB_PIPE_t pipe, uint8_t *dataPtr); + +/** + * @ingroup usb_peripheral_read_write + * @brief Gets the current data pointer for a given pipe. + * @param pipe - A combination of endpoint address and direction + * @return The pointer to the data location + */ +uint8_t *USB_PipeDataPtrGet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Sets the size of pipe data to transfer. + * @param pipe - A combination of endpoint address and direction + * @param dataSize - The size of pipe data to transfer + * @return None. + */ +void USB_PipeDataToTransferSizeSet(USB_PIPE_t pipe, uint16_t dataSize); + +/** + * @ingroup usb_peripheral_read_write + * @brief Gets the size of pipe data to transfer. + * @param pipe - A combination of endpoint address and direction + * @return The size of pipe data to transfer + */ +uint16_t USB_PipeDataToTransferSizeGet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Gets the size of the transferred pipe data. + * @param pipe - A combination of endpoint address and direction + * @return The size of transferred pipe data + */ +uint16_t USB_PipeDataTransferredSizeGet(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Sets the size of the transferred pipe data. + * @param pipe - A combination of endpoint address and direction + * @param dataSize - The size of pipe data transferred + * @return None. + */ +void USB_PipeDataTransferredSizeSet(USB_PIPE_t pipe, uint16_t dataSize); + +/** + * @ingroup usb_peripheral_read_write + * @brief Resets the size of transferred pipe data. + * @param pipe - A combination of endpoint address and direction + * @return None. + */ +void USB_PipeDataTransferredSizeReset(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Enables a ZLP on a transfer. + * It is enabled by default if the AZLP static config is enabled for the pipe. + * @param pipe - A combination of endpoint address and direction + * @return None. + */ +void USB_PipeTransferZLP_Enable(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Sets the callback for transfer end. + * @param pipe - A combination of endpoint address and direction + * @param callback - A combination of pipe, status and transferred bytes + * @return None. + */ +void USB_PipeTransferEndCallbackRegister(USB_PIPE_t pipe, USB_TRANSFER_END_CALLBACK_t callback); + +/** + * @ingroup usb_peripheral_read_write + * @brief Calls the callback for transfer end. + * @param pipe - A combination of endpoint address and direction + * @return None. + */ +void USB_PipeTransferEndCallback(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Checks the correctness of IN transactions and runs them. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_InTransactionRun(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Checks the correctness OUT transactions and runs them. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_OutTransactionRun(USB_PIPE_t pipe); + +/** + * @ingroup usb_peripheral_read_write + * @brief Handles completed IN and OUT transactions. + * Processes the completed transaction and either completes the transfer or runs the next transaction. + * Will call the pipe transferEndCallback at the end of transfer, if configured. + * @param pipe - A combination of endpoint address and direction + * @return SUCCESS or an Error code according to RETURN_CODE_t + */ +RETURN_CODE_t USB_PipeTransactionComplete(USB_PIPE_t pipe); + +#endif /* USB_PERIPHERAL_READ_WRITE_H */ diff --git a/mcc_generated_files/usb/usb_vendor/usb_vendor.c b/mcc_generated_files/usb/usb_vendor/usb_vendor.c new file mode 100644 index 0000000..139074c --- /dev/null +++ b/mcc_generated_files/usb/usb_vendor/usb_vendor.c @@ -0,0 +1,41 @@ +/** + * USBVENDOR Vendor Source File + * @file usb_vendor.c + * @ingroup usb_vendor + * @brief Contains implementation for USB Vendor drivers. + * @version USB Device Stack Driver Version 1.0.0 + */ + +/* + (c) 2023 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#include +#include +#include + +void USB_VendorClassInit(USB_SETUP_EVENT_CALLBACK_t interfaceEnabledCallback, USB_SETUP_PROCESS_CALLBACK_t vendorControlRequest, USB_EVENT_CALLBACK_t interfaceDisabledCallback) +{ + USB_SetInterfaceCallbackRegister(interfaceEnabledCallback); + USB_VendorRequestCallbackRegister(vendorControlRequest); + USB_InterfaceDisabledCallbackRegister(interfaceDisabledCallback); +}; diff --git a/mcc_generated_files/usb/usb_vendor/usb_vendor.h b/mcc_generated_files/usb/usb_vendor/usb_vendor.h new file mode 100644 index 0000000..400275c --- /dev/null +++ b/mcc_generated_files/usb/usb_vendor/usb_vendor.h @@ -0,0 +1,52 @@ +/** + * USBVENDOR Vendor Header File + * @file usb_vendor.h + * @defgroup usb_vendor USB Vendor Class + * @brief Contains the prototypes and data types for the vendor application drivers. + * @version USB Device Stack Driver Version 1.0.0 + * @{ + */ + +/* + (c) 2023 Microchip Technology Inc. and its subsidiaries. + + Subject to your compliance with these terms, you may use Microchip software and any + derivatives exclusively with Microchip products. It is your responsibility to comply with third party + license terms applicable to your use of third party software (including open source software) that + may accompany Microchip software. + + 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. + + 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. + */ + +#ifndef USB_VENDOR_H +#define USB_VENDOR_H + +#include "usb_protocol_headers.h" + +/** + * @ingroup usb_vendor + * @brief Sets up interfaces for use with the Vendor class. + * @param interfaceEnabledCallback - Callback to the interface enable function + * @param vendorControlRequest - Callback to the control request function + * @param interfaceDisabledCallback - Callback to the interface disable function + * @return None. + */ +void USB_VendorClassInit(USB_SETUP_EVENT_CALLBACK_t interfaceEnabledCallback, USB_SETUP_PROCESS_CALLBACK_t vendorControlRequest, USB_EVENT_CALLBACK_t interfaceDisabledCallback); + +/** + * @} + */ + +#endif /* USB_VENDOR_H */ \ No newline at end of file diff --git a/nbproject/Makefile-default.mk b/nbproject/Makefile-default.mk new file mode 100644 index 0000000..616b178 --- /dev/null +++ b/nbproject/Makefile-default.mk @@ -0,0 +1,430 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Include project Makefile +ifeq "${IGNORE_LOCAL}" "TRUE" +# do not include local makefile. User is passing all local related variables already +else +include Makefile +# Include makefile containing local settings +ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk" +include nbproject/Makefile-local-default.mk +endif +endif + +# Environment +MKDIR=mkdir -p +RM=rm -f +MV=mv +CP=cp + +# Macros +CND_CONF=default +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +IMAGE_TYPE=debug +OUTPUT_SUFFIX=elf +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +else +IMAGE_TYPE=production +OUTPUT_SUFFIX=hex +DEBUGGABLE_SUFFIX=elf +FINAL_IMAGE=${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} +endif + +ifeq ($(COMPARE_BUILD), true) +COMPARISON_BUILD=-mafrlcsj +else +COMPARISON_BUILD= +endif + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} + +# Distribution Directory +DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} + +# Source Files Quoted if spaced +SOURCEFILES_QUOTED_IF_SPACED=mcc_generated_files/usb/usb_vendor/usb_vendor.c mcc_generated_files/usb/usb_common/usb_core_events.c main.c mcc_generated_files/system/src/syscfg.c mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c mcc_generated_files/system/src/interrupt.c mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c mcc_generated_files/usb/usb_common/usb_core.c mcc_generated_files/usb/usb_device.c mcc_generated_files/usb/usb_common/usb_core_descriptors.c mcc_generated_files/spi/src/spi0.c mcc_generated_files/system/src/system.c mcc_generated_files/usb/usb_common/usb_core_requests.c mcc_generated_files/usb/usb_common/usb_core_transfer.c mcc_generated_files/usb/usb_common/usb_core_requests_device.c mcc_generated_files/usb/src/usb0.c mcc_generated_files/usb/usb_peripheral/usb_peripheral.c mcc_generated_files/usb/usb_descriptors.c mcc_generated_files/system/src/clock.c mcc_generated_files/system/src/pins.c mcc_generated_files/usb/usb_common/usb_core_requests_interface.c mcc_generated_files/system/src/config_bits.c mcc_generated_files/system/src/protected_io.S + +# Object Files Quoted if spaced +OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o ${OBJECTDIR}/main.o ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o ${OBJECTDIR}/mcc_generated_files/system/src/system.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o ${OBJECTDIR}/mcc_generated_files/system/src/clock.o ${OBJECTDIR}/mcc_generated_files/system/src/pins.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o +POSSIBLE_DEPFILES=${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d ${OBJECTDIR}/main.o.d ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d ${OBJECTDIR}/mcc_generated_files/system/src/system.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d ${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d ${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d + +# Object Files +OBJECTFILES=${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o ${OBJECTDIR}/main.o ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o ${OBJECTDIR}/mcc_generated_files/system/src/system.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o ${OBJECTDIR}/mcc_generated_files/system/src/clock.o ${OBJECTDIR}/mcc_generated_files/system/src/pins.o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o + +# Source Files +SOURCEFILES=mcc_generated_files/usb/usb_vendor/usb_vendor.c mcc_generated_files/usb/usb_common/usb_core_events.c main.c mcc_generated_files/system/src/syscfg.c mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c mcc_generated_files/system/src/interrupt.c mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c mcc_generated_files/usb/usb_common/usb_core.c mcc_generated_files/usb/usb_device.c mcc_generated_files/usb/usb_common/usb_core_descriptors.c mcc_generated_files/spi/src/spi0.c mcc_generated_files/system/src/system.c mcc_generated_files/usb/usb_common/usb_core_requests.c mcc_generated_files/usb/usb_common/usb_core_transfer.c mcc_generated_files/usb/usb_common/usb_core_requests_device.c mcc_generated_files/usb/src/usb0.c mcc_generated_files/usb/usb_peripheral/usb_peripheral.c mcc_generated_files/usb/usb_descriptors.c mcc_generated_files/system/src/clock.c mcc_generated_files/system/src/pins.c mcc_generated_files/usb/usb_common/usb_core_requests_interface.c mcc_generated_files/system/src/config_bits.c mcc_generated_files/system/src/protected_io.S + + + +CFLAGS= +ASFLAGS= +LDLIBSOPTIONS= + +############# Tool locations ########################################## +# If you copy a project from one host to another, the path where the # +# compiler is installed may be different. # +# If you open this project with MPLAB X in the new host, this # +# makefile will be regenerated and the paths will be corrected. # +####################################################################### +# fixDeps replaces a bunch of sed/cat/printf statements that slow down the build +FIXDEPS=fixDeps + +.build-conf: ${BUILD_SUBPROJECTS} +ifneq ($(INFORMATION_MESSAGE), ) + @echo $(INFORMATION_MESSAGE) +endif + ${MAKE} -f nbproject/Makefile-default.mk ${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} + +MP_PROCESSOR_OPTION=AVR64DU28 +# ------------------------------------------------------------------------------------ +# Rules for buildStep: compile +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o: mcc_generated_files/usb/usb_vendor/usb_vendor.c .generated_files/flags/default/13b7dbf04d4f86cc33dea191f2580790a7e4cb41 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_vendor" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o mcc_generated_files/usb/usb_vendor/usb_vendor.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o: mcc_generated_files/usb/usb_common/usb_core_events.c .generated_files/flags/default/3f72406f95220d42b2256b0f1706819179cc130d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o mcc_generated_files/usb/usb_common/usb_core_events.c + +${OBJECTDIR}/main.o: main.c .generated_files/flags/default/37635bba81897aff7ba7962b372638677124c269 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.o.d + @${RM} ${OBJECTDIR}/main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/main.o.d" -MT "${OBJECTDIR}/main.o.d" -MT ${OBJECTDIR}/main.o -o ${OBJECTDIR}/main.o main.c + +${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o: mcc_generated_files/system/src/syscfg.c .generated_files/flags/default/119ea452f4fc9dce5d9ccac4a50e055b7722276c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o -o ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o mcc_generated_files/system/src/syscfg.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o: mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c .generated_files/flags/default/969d5c011737a5133b0a0888cbaebe797f92aaff .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c + +${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o: mcc_generated_files/system/src/interrupt.c .generated_files/flags/default/aa3764a455640e0b10c311c7e12d4953b5bb688d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o -o ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o mcc_generated_files/system/src/interrupt.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o: mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c .generated_files/flags/default/f0d40d34239aa16c91e82595c054020821a4a72d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o: mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c .generated_files/flags/default/c710e5c8cbc136d90e0864e2c324e73ef551fa02 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o: mcc_generated_files/usb/usb_common/usb_core.c .generated_files/flags/default/7083d129ca9b20d8786cb84794de51a55c8c0a78 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o mcc_generated_files/usb/usb_common/usb_core.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_device.o: mcc_generated_files/usb/usb_device.c .generated_files/flags/default/49ec2b1ac283e98f46f1dd98b8a0de3dbc263e27 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o mcc_generated_files/usb/usb_device.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o: mcc_generated_files/usb/usb_common/usb_core_descriptors.c .generated_files/flags/default/d567dc75d5206a6c4c10363abac6ba0ac0647f90 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o mcc_generated_files/usb/usb_common/usb_core_descriptors.c + +${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o: mcc_generated_files/spi/src/spi0.c .generated_files/flags/default/efae0acc409a5e23086330eb57212c97f7475d07 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/spi/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d" -MT "${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d" -MT ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o -o ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o mcc_generated_files/spi/src/spi0.c + +${OBJECTDIR}/mcc_generated_files/system/src/system.o: mcc_generated_files/system/src/system.c .generated_files/flags/default/551e9106af1af7c240d53f57034d4d84585321ba .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/system.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/system.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/system.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/system.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/system.o -o ${OBJECTDIR}/mcc_generated_files/system/src/system.o mcc_generated_files/system/src/system.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o: mcc_generated_files/usb/usb_common/usb_core_requests.c .generated_files/flags/default/ef4a9549e0417a4d1a3a2c68cda4ec174b18f32c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o mcc_generated_files/usb/usb_common/usb_core_requests.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o: mcc_generated_files/usb/usb_common/usb_core_transfer.c .generated_files/flags/default/e6386dd43f082a50010aa5966a6124897c1e9af9 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o mcc_generated_files/usb/usb_common/usb_core_transfer.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o: mcc_generated_files/usb/usb_common/usb_core_requests_device.c .generated_files/flags/default/c9994122bab4a224b0693a0f0afe0999d6243bd0 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o mcc_generated_files/usb/usb_common/usb_core_requests_device.c + +${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o: mcc_generated_files/usb/src/usb0.c .generated_files/flags/default/818eb014b8680fa93937d2de23ae56cb61053707 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o -o ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o mcc_generated_files/usb/src/usb0.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o: mcc_generated_files/usb/usb_peripheral/usb_peripheral.c .generated_files/flags/default/b01dd824a4e7f84204f252f9f07942c96e5987be .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o mcc_generated_files/usb/usb_peripheral/usb_peripheral.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o: mcc_generated_files/usb/usb_descriptors.c .generated_files/flags/default/6504fa809c4ef723fb4e340ed8b1a1109ddd2d27 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o mcc_generated_files/usb/usb_descriptors.c + +${OBJECTDIR}/mcc_generated_files/system/src/clock.o: mcc_generated_files/system/src/clock.c .generated_files/flags/default/8574e5161dcc5d8072d7d143fb60eabce4586510 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/clock.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/clock.o -o ${OBJECTDIR}/mcc_generated_files/system/src/clock.o mcc_generated_files/system/src/clock.c + +${OBJECTDIR}/mcc_generated_files/system/src/pins.o: mcc_generated_files/system/src/pins.c .generated_files/flags/default/736273f779566a6251c43695ded17446451c308d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/pins.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/pins.o -o ${OBJECTDIR}/mcc_generated_files/system/src/pins.o mcc_generated_files/system/src/pins.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o: mcc_generated_files/usb/usb_common/usb_core_requests_interface.c .generated_files/flags/default/96307a5e21873e5dec6d65b3189c9c0f9723e60e .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o mcc_generated_files/usb/usb_common/usb_core_requests_interface.c + +${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o: mcc_generated_files/system/src/config_bits.c .generated_files/flags/default/aa581855220e27c90afe295422bed91ba6b09b49 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o -o ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o mcc_generated_files/system/src/config_bits.c + +else +${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o: mcc_generated_files/usb/usb_vendor/usb_vendor.c .generated_files/flags/default/b818ef71be46591872b143b73edaf5bb169cf738 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_vendor" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_vendor/usb_vendor.o mcc_generated_files/usb/usb_vendor/usb_vendor.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o: mcc_generated_files/usb/usb_common/usb_core_events.c .generated_files/flags/default/a29f9609dfbc9f6606afe35bf15b66270b264af1 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_events.o mcc_generated_files/usb/usb_common/usb_core_events.c + +${OBJECTDIR}/main.o: main.c .generated_files/flags/default/dd496a97ddf4f0751754ce8ea5e6f9f2f7e8b1fc .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}" + @${RM} ${OBJECTDIR}/main.o.d + @${RM} ${OBJECTDIR}/main.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/main.o.d" -MT "${OBJECTDIR}/main.o.d" -MT ${OBJECTDIR}/main.o -o ${OBJECTDIR}/main.o main.c + +${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o: mcc_generated_files/system/src/syscfg.c .generated_files/flags/default/447d79eece8821c8ff3d9313d70bc8ac3b644e52 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o -o ${OBJECTDIR}/mcc_generated_files/system/src/syscfg.o mcc_generated_files/system/src/syscfg.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o: mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c .generated_files/flags/default/876387dbc7da936ea49bd91733a24b9b5840cd94 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.o mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c + +${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o: mcc_generated_files/system/src/interrupt.c .generated_files/flags/default/791ebde66195b582a15b7eb765dfc5ade65855ec .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o -o ${OBJECTDIR}/mcc_generated_files/system/src/interrupt.o mcc_generated_files/system/src/interrupt.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o: mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c .generated_files/flags/default/8b3f500194eb49631e42e437bfe2c6322dbdf170 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.o mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o: mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c .generated_files/flags/default/e86907bac8944cebb9306686b49ad1e347e300e9 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.o mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o: mcc_generated_files/usb/usb_common/usb_core.c .generated_files/flags/default/fb6fb497af895f16327d3aa71d2eb1500a43cec1 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core.o mcc_generated_files/usb/usb_common/usb_core.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_device.o: mcc_generated_files/usb/usb_device.c .generated_files/flags/default/8515ad1026cc0e3e798e9dd18a5c71996f45c6d1 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_device.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_device.o mcc_generated_files/usb/usb_device.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o: mcc_generated_files/usb/usb_common/usb_core_descriptors.c .generated_files/flags/default/f7bcf8548832b05080e1f00cd1033ac0917d236 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_descriptors.o mcc_generated_files/usb/usb_common/usb_core_descriptors.c + +${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o: mcc_generated_files/spi/src/spi0.c .generated_files/flags/default/b176cd41a25c41d03119e60722de8a59de7380cd .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/spi/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d" -MT "${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o.d" -MT ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o -o ${OBJECTDIR}/mcc_generated_files/spi/src/spi0.o mcc_generated_files/spi/src/spi0.c + +${OBJECTDIR}/mcc_generated_files/system/src/system.o: mcc_generated_files/system/src/system.c .generated_files/flags/default/dd863690b2baffe7603c63f2b8b79ef250ed9284 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/system.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/system.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/system.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/system.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/system.o -o ${OBJECTDIR}/mcc_generated_files/system/src/system.o mcc_generated_files/system/src/system.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o: mcc_generated_files/usb/usb_common/usb_core_requests.c .generated_files/flags/default/58453a66b6f4b02dc2f6b71a3826d2ab15283ed5 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests.o mcc_generated_files/usb/usb_common/usb_core_requests.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o: mcc_generated_files/usb/usb_common/usb_core_transfer.c .generated_files/flags/default/e1341334b199a52d8df572a7f7e7be114c49c8ad .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_transfer.o mcc_generated_files/usb/usb_common/usb_core_transfer.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o: mcc_generated_files/usb/usb_common/usb_core_requests_device.c .generated_files/flags/default/769ec27fad26c186edfe4a4772d01fda9f2f41f4 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_device.o mcc_generated_files/usb/usb_common/usb_core_requests_device.c + +${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o: mcc_generated_files/usb/src/usb0.c .generated_files/flags/default/1f7a1067d2a8525ae9d220271878efb282359c5 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o -o ${OBJECTDIR}/mcc_generated_files/usb/src/usb0.o mcc_generated_files/usb/src/usb0.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o: mcc_generated_files/usb/usb_peripheral/usb_peripheral.c .generated_files/flags/default/d53de71f84fc736ccd92111f3145ed397a4a0c5b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_peripheral/usb_peripheral.o mcc_generated_files/usb/usb_peripheral/usb_peripheral.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o: mcc_generated_files/usb/usb_descriptors.c .generated_files/flags/default/58695d98c93e6a4a095a379402e7e446ad662866 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_descriptors.o mcc_generated_files/usb/usb_descriptors.c + +${OBJECTDIR}/mcc_generated_files/system/src/clock.o: mcc_generated_files/system/src/clock.c .generated_files/flags/default/c2b4acdf04de6d9b3090ce53f1eedb271b4521b4 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/clock.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/clock.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/clock.o -o ${OBJECTDIR}/mcc_generated_files/system/src/clock.o mcc_generated_files/system/src/clock.c + +${OBJECTDIR}/mcc_generated_files/system/src/pins.o: mcc_generated_files/system/src/pins.c .generated_files/flags/default/444664807302b43af5c2b42a24470e83cb158c7a .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/pins.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/pins.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/pins.o -o ${OBJECTDIR}/mcc_generated_files/system/src/pins.o mcc_generated_files/system/src/pins.c + +${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o: mcc_generated_files/usb/usb_common/usb_core_requests_interface.c .generated_files/flags/default/c4224de29e8af762aa3366718cf78d9f22e6a952 .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/usb/usb_common" + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d" -MT "${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o.d" -MT ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o -o ${OBJECTDIR}/mcc_generated_files/usb/usb_common/usb_core_requests_interface.o mcc_generated_files/usb/usb_common/usb_core_requests_interface.c + +${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o: mcc_generated_files/system/src/config_bits.c .generated_files/flags/default/a7b947332bceb0b23c2514f9a7902b4d4bf8787c .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o + ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o -o ${OBJECTDIR}/mcc_generated_files/system/src/config_bits.o mcc_generated_files/system/src/config_bits.c + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assemble +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +else +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: assembleWithPreprocess +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o: mcc_generated_files/system/src/protected_io.S .generated_files/flags/default/d70bc12934e602f1c0ff69877eea812361815c7b .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o + ${MP_CC} -c $(MP_EXTRA_AS_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x assembler-with-cpp -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -Wa,--defsym=__MPLAB_BUILD=1,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o -o ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o mcc_generated_files/system/src/protected_io.S + +else +${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o: mcc_generated_files/system/src/protected_io.S .generated_files/flags/default/5379a32e4c352269081cc43677c888ade78ad84d .generated_files/flags/default/da39a3ee5e6b4b0d3255bfef95601890afd80709 + @${MKDIR} "${OBJECTDIR}/mcc_generated_files/system/src" + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d + @${RM} ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o + ${MP_CC} -c $(MP_EXTRA_AS_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -x assembler-with-cpp -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -DXPRJ_default=$(CND_CONF) -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem -Wa,--defsym=__MPLAB_BUILD=1 -MD -MP -MF "${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d" -MT "${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o.d" -MT ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o -o ${OBJECTDIR}/mcc_generated_files/system/src/protected_io.o mcc_generated_files/system/src/protected_io.S + +endif + +# ------------------------------------------------------------------------------------ +# Rules for buildStep: link +ifeq ($(TYPE_IMAGE), DEBUG_RUN) +${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} ${DISTDIR} + ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.map -D__DEBUG=1 -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -gdwarf-2 -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 + @${RM} ${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.hex + + +else +${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk + @${MKDIR} ${DISTDIR} + ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.map -DXPRJ_default=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"mcc_generated_files/usb" -I"mcc_generated_files/usb/usb_common" -I"mcc_generated_files/usb/usb_peripheral" -I"mcc_generated_files/usb/usb_vendor" -I"mcc_generated_files/usb/usb_hid" -I"mcc_generated_files/usb/usb_cdc" -I"mcc_generated_files/usb/usb_cdc/circular_buffer" -Wall -gdwarf-3 -mconst-data-in-progmem -mconst-data-in-config-mapped-progmem $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group + ${MP_CC_DIR}/avr-objcopy -O ihex "${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/RSBcode.X.${IMAGE_TYPE}.hex" + +endif + + +# Subprojects +.build-subprojects: + + +# Subprojects +.clean-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${OBJECTDIR} + ${RM} -r ${DISTDIR} + +# Enable dependency checking +.dep.inc: .depcheck-impl + +DEPFILES=$(wildcard ${POSSIBLE_DEPFILES}) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/nbproject/Makefile-genesis.properties b/nbproject/Makefile-genesis.properties new file mode 100644 index 0000000..da2fef3 --- /dev/null +++ b/nbproject/Makefile-genesis.properties @@ -0,0 +1,13 @@ +# +#Sat Dec 06 13:59:17 CST 2025 +default.languagetoolchain.version=3.10 +default.Pack.dfplocation=/opt/microchip/mplabx/v6.25/packs/Microchip/AVR-Dx_DFP/2.7.321 +default.com-microchip-mplab-mdbcore-PK5Tool-PK5ToolImpl.md5=a59baeb77d86fe5cdcb7a1c5993c599f +conf.ids=default +default.languagetoolchain.dir=/opt/microchip/xc8/v3.10/bin +host.id=tig8-7xex-0 +configurations-xml=5cec7652d893c4ddc03da9cdb5698fa3 +com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=6cd85c1014597ae4d039afea70fe46c5 +default.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=9a6aba94656eb8afd334984366ea5e35 +proj.dir=/home/josh/MPLABXProjects/RSBcode.X +host.platform=linux diff --git a/nbproject/Makefile-impl.mk b/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..7ee65af --- /dev/null +++ b/nbproject/Makefile-impl.mk @@ -0,0 +1,69 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=RSBcode.X + +# Active Configuration +DEFAULTCONF=default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=default + + +# build +.build-impl: .build-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre + ${MAKE} -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .clean-conf + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default clean + + + +# all +.all-impl: .all-pre .depcheck-impl + ${MAKE} SUBPROJECTS=${SUBPROJECTS} CONF=default build + + + +# dependency checking support +.depcheck-impl: +# @echo "# This code depends on make tool being used" >.dep.inc +# @if [ -n "${MAKE_VERSION}" ]; then \ +# echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ +# echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ +# echo "include \$${DEPFILES}" >>.dep.inc; \ +# echo "endif" >>.dep.inc; \ +# else \ +# echo ".KEEP_STATE:" >>.dep.inc; \ +# echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ +# fi diff --git a/nbproject/Makefile-local-default.mk b/nbproject/Makefile-local-default.mk new file mode 100644 index 0000000..8f97c32 --- /dev/null +++ b/nbproject/Makefile-local-default.mk @@ -0,0 +1,36 @@ +# +# Generated Makefile - do not edit! +# +# +# This file contains information about the location of compilers and other tools. +# If you commmit this file into your revision control server, you will be able to +# to checkout the project and build it from the command line with make. However, +# if more than one person works on the same project, then this file might show +# conflicts since different users are bound to have compilers in different places. +# In that case you might choose to not commit this file and let MPLAB X recreate this file +# for each user. The disadvantage of not commiting this file is that you must run MPLAB X at +# least once so the file gets created and the project can be built. Finally, you can also +# avoid using this file at all if you are only building from the command line with make. +# You can invoke make with the values of the macros: +# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ... +# +PATH_TO_IDE_BIN=/opt/microchip/mplabx/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/ +# Adding MPLAB X bin directory to path. +PATH:=/opt/microchip/mplabx/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH) +# Path to java used to run MPLAB X when this makefile was created +MP_JAVA_PATH="/usr/lib/jvm/java-8-openjdk/jre/bin/" +OS_CURRENT="$(shell uname -s)" +MP_CC="/opt/microchip/xc8/v3.10/bin/xc8-cc" +# MP_CPPC is not defined +# MP_BC is not defined +MP_AS="/opt/microchip/xc8/v3.10/bin/xc8-cc" +MP_LD="/opt/microchip/xc8/v3.10/bin/xc8-cc" +MP_AR="/opt/microchip/xc8/v3.10/bin/xc8-ar" +DEP_GEN=${MP_JAVA_PATH}java -jar "/opt/microchip/mplabx/v6.25/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar" +MP_CC_DIR="/opt/microchip/xc8/v3.10/bin" +# MP_CPPC_DIR is not defined +# MP_BC_DIR is not defined +MP_AS_DIR="/opt/microchip/xc8/v3.10/bin" +MP_LD_DIR="/opt/microchip/xc8/v3.10/bin" +MP_AR_DIR="/opt/microchip/xc8/v3.10/bin" +DFP_DIR=/opt/microchip/mplabx/v6.25/packs/Microchip/AVR-Dx_DFP/2.7.321 diff --git a/nbproject/Makefile-variables.mk b/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..d2905a6 --- /dev/null +++ b/nbproject/Makefile-variables.mk @@ -0,0 +1,10 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +# default configuration +CND_ARTIFACT_DIR_default=dist/default/production +CND_ARTIFACT_NAME_default=RSBcode.X.production.hex +CND_ARTIFACT_PATH_default=dist/default/production/RSBcode.X.production.hex diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml new file mode 100644 index 0000000..36fefac --- /dev/null +++ b/nbproject/configurations.xml @@ -0,0 +1,295 @@ + + + + + + + mcc_generated_files/spi/spi_interface.h + mcc_generated_files/spi/spi_polling_types.h + mcc_generated_files/spi/spi0.h + + + + + mcc_generated_files/system/utils/assembler/gas.h + mcc_generated_files/system/utils/assembler/iar.h + + mcc_generated_files/system/utils/assembler.h + mcc_generated_files/system/utils/interrupt_avr8.h + mcc_generated_files/system/utils/utils_assert.h + mcc_generated_files/system/utils/atomic.h + mcc_generated_files/system/utils/utils.h + mcc_generated_files/system/utils/compiler.h + + mcc_generated_files/system/ccp.h + mcc_generated_files/system/syscfg.h + mcc_generated_files/system/protected_io.h + mcc_generated_files/system/config_bits.h + mcc_generated_files/system/interrupt.h + mcc_generated_files/system/system.h + mcc_generated_files/system/port.h + mcc_generated_files/system/pins.h + mcc_generated_files/system/clock.h + + + + mcc_generated_files/usb/usb_common/usb_core_events.h + mcc_generated_files/usb/usb_common/usb_protocol_headers.h + mcc_generated_files/usb/usb_common/usb_core_requests_interface.h + mcc_generated_files/usb/usb_common/usb_core_requests_device.h + mcc_generated_files/usb/usb_common/usb_common_elements.h + mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.h + mcc_generated_files/usb/usb_common/usb_core.h + mcc_generated_files/usb/usb_common/usb_core_descriptors.h + mcc_generated_files/usb/usb_common/usb_core_transfer.h + mcc_generated_files/usb/usb_common/usb_core_requests.h + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.h + mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.h + mcc_generated_files/usb/usb_peripheral/usb_peripheral_avr_du.h + mcc_generated_files/usb/usb_peripheral/usb_peripheral.h + + + mcc_generated_files/usb/usb_vendor/usb_vendor.h + + mcc_generated_files/usb/usb_config.h + mcc_generated_files/usb/usb_device.h + mcc_generated_files/usb/usb0.h + mcc_generated_files/usb/usb_descriptors.h + + + + + Makefile + RSBcode.mc3 + + + + + + + + mcc_generated_files/spi/src/spi0.c + + + + + mcc_generated_files/system/src/syscfg.c + mcc_generated_files/system/src/interrupt.c + mcc_generated_files/system/src/system.c + mcc_generated_files/system/src/clock.c + mcc_generated_files/system/src/pins.c + mcc_generated_files/system/src/config_bits.c + mcc_generated_files/system/src/protected_io.S + + + + + mcc_generated_files/usb/src/usb0.c + + + mcc_generated_files/usb/usb_common/usb_core_events.c + mcc_generated_files/usb/usb_common/usb_core_requests_endpoint.c + mcc_generated_files/usb/usb_common/usb_core.c + mcc_generated_files/usb/usb_common/usb_core_descriptors.c + mcc_generated_files/usb/usb_common/usb_core_requests.c + mcc_generated_files/usb/usb_common/usb_core_transfer.c + mcc_generated_files/usb/usb_common/usb_core_requests_device.c + mcc_generated_files/usb/usb_common/usb_core_requests_interface.c + + + mcc_generated_files/usb/usb_peripheral/usb_peripheral_endpoint.c + mcc_generated_files/usb/usb_peripheral/usb_peripheral_read_write.c + mcc_generated_files/usb/usb_peripheral/usb_peripheral.c + + + mcc_generated_files/usb/usb_vendor/usb_vendor.c + + mcc_generated_files/usb/usb_device.c + mcc_generated_files/usb/usb_descriptors.c + + + main.c + + + Makefile + + + + localhost + AVR64DU28 + + + PK5Tool + XC8 + 3.10 + 2 + + + + + + + + + + + + + + + false + false + + + + + + + false + false + + false + + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/private/configurations.xml b/nbproject/private/configurations.xml new file mode 100644 index 0000000..412480d --- /dev/null +++ b/nbproject/private/configurations.xml @@ -0,0 +1,25 @@ + + + Makefile + 0 + + + + /opt/microchip/xc8/v3.10/bin + + place holder 1 + place holder 2 + + + + + true + 0 + 0 + 0 + + + + + + diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..458d644 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,18 @@ + + + + + + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/syscfg.h + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/spi/src/spi0.c + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/ccp.h + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/pins.h + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/interrupt.h + file:/home/josh/MPLABXProjects/RSBcode.X/main.c + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/system.h + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/clock.h + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/src/system.c + file:/home/josh/MPLABXProjects/RSBcode.X/mcc_generated_files/system/config_bits.h + + + diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..23f5a22 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,23 @@ + + + com.microchip.mplab.nbide.embedded.makeproject + + + RSBcode + 1eae82ae-b208-491d-b76e-77c3791fbf2e + 0 + ISO-8859-1 + + + + + default + 2 + + + + false + + + + -- cgit v1.2.3