├── .gitmodules ├── ZTLambdaJITR └── lambda_function.py ├── aws_interact_gui.py ├── aws_kit_common.py ├── aws_register_signer.py ├── ca_create_root.py ├── ca_create_signer.py ├── ca_create_signer_csr.py ├── cert2certdef.py ├── cloud-formation-templates ├── aws-zero-touch-admin-setup-cn.yaml ├── aws-zero-touch-admin-setup.yaml ├── aws-zero-touch-full-setup-cn.yaml ├── aws-zero-touch-full-setup.yaml └── readme.md ├── firmware └── SAMG55 │ ├── AWS_IoT_Zero_Touch_SAMG55.atsln │ └── AWS_IoT_Zero_Touch_SAMG55 │ ├── AWS_IoT_Zero_Touch_SAMG55.componentinfo.xml │ ├── AWS_IoT_Zero_Touch_SAMG55.cproj │ ├── readme.md │ └── src │ ├── ASF │ ├── common │ │ ├── boards │ │ │ └── board.h │ │ ├── components │ │ │ ├── display │ │ │ │ └── ssd1306 │ │ │ │ │ ├── font.c │ │ │ │ │ ├── font.h │ │ │ │ │ ├── ssd1306.c │ │ │ │ │ └── ssd1306.h │ │ │ └── wifi │ │ │ │ └── winc1500 │ │ │ │ ├── WINC1500_SW_API.chm │ │ │ │ ├── bsp │ │ │ │ ├── include │ │ │ │ │ ├── nm_bsp.h │ │ │ │ │ ├── nm_bsp_internal.h │ │ │ │ │ └── nm_bsp_samg55.h │ │ │ │ └── source │ │ │ │ │ └── nm_bsp_samg55.c │ │ │ │ ├── bus_wrapper │ │ │ │ ├── include │ │ │ │ │ └── nm_bus_wrapper.h │ │ │ │ └── source │ │ │ │ │ └── nm_bus_wrapper_samg55.c │ │ │ │ ├── common │ │ │ │ ├── include │ │ │ │ │ ├── nm_common.h │ │ │ │ │ └── nm_debug.h │ │ │ │ └── source │ │ │ │ │ └── nm_common.c │ │ │ │ ├── driver │ │ │ │ ├── include │ │ │ │ │ ├── ecc_types.h │ │ │ │ │ ├── m2m_ate_mode.h │ │ │ │ │ ├── m2m_crypto.h │ │ │ │ │ ├── m2m_ota.h │ │ │ │ │ ├── m2m_periph.h │ │ │ │ │ ├── m2m_ssl.h │ │ │ │ │ ├── m2m_types.h │ │ │ │ │ └── m2m_wifi.h │ │ │ │ └── source │ │ │ │ │ ├── m2m_ate_mode.c │ │ │ │ │ ├── m2m_crypto.c │ │ │ │ │ ├── m2m_hif.c │ │ │ │ │ ├── m2m_hif.h │ │ │ │ │ ├── m2m_ota.c │ │ │ │ │ ├── m2m_periph.c │ │ │ │ │ ├── m2m_ssl.c │ │ │ │ │ ├── m2m_wifi.c │ │ │ │ │ ├── nmasic.c │ │ │ │ │ ├── nmasic.h │ │ │ │ │ ├── nmbus.c │ │ │ │ │ ├── nmbus.h │ │ │ │ │ ├── nmdrv.c │ │ │ │ │ ├── nmdrv.h │ │ │ │ │ ├── nmi2c.c │ │ │ │ │ ├── nmi2c.h │ │ │ │ │ ├── nmspi.c │ │ │ │ │ ├── nmspi.h │ │ │ │ │ ├── nmuart.c │ │ │ │ │ └── nmuart.h │ │ │ │ ├── programmer │ │ │ │ ├── programmer.h │ │ │ │ └── programmer_apis.h │ │ │ │ ├── socket │ │ │ │ ├── include │ │ │ │ │ ├── m2m_socket_host_if.h │ │ │ │ │ └── socket.h │ │ │ │ └── source │ │ │ │ │ ├── socket.c │ │ │ │ │ └── socket_internal.h │ │ │ │ └── spi_flash │ │ │ │ ├── include │ │ │ │ ├── spi_flash.h │ │ │ │ └── spi_flash_map.h │ │ │ │ └── source │ │ │ │ └── spi_flash.c │ │ ├── services │ │ │ ├── clock │ │ │ │ ├── genclk.h │ │ │ │ ├── osc.h │ │ │ │ ├── pll.h │ │ │ │ ├── samg │ │ │ │ │ ├── genclk.h │ │ │ │ │ ├── osc.h │ │ │ │ │ ├── pll.h │ │ │ │ │ ├── sysclk.c │ │ │ │ │ └── sysclk.h │ │ │ │ └── sysclk.h │ │ │ ├── delay │ │ │ │ ├── delay.h │ │ │ │ └── sam │ │ │ │ │ ├── cycle_counter.c │ │ │ │ │ └── cycle_counter.h │ │ │ ├── ioport │ │ │ │ ├── ioport.h │ │ │ │ └── sam │ │ │ │ │ └── ioport_pio.h │ │ │ ├── serial │ │ │ │ ├── sam_uart │ │ │ │ │ └── uart_serial.h │ │ │ │ ├── serial.h │ │ │ │ └── usart_serial.c │ │ │ ├── sleepmgr │ │ │ │ ├── sam │ │ │ │ │ ├── sleepmgr.c │ │ │ │ │ └── sleepmgr.h │ │ │ │ └── sleepmgr.h │ │ │ ├── spi │ │ │ │ ├── sam_spi │ │ │ │ │ ├── spi_master.c │ │ │ │ │ └── spi_master.h │ │ │ │ └── spi_master.h │ │ │ ├── twi │ │ │ │ ├── sam_twi │ │ │ │ │ ├── twi_master.h │ │ │ │ │ └── twi_slave.h │ │ │ │ ├── twi_master.h │ │ │ │ └── twi_slave.h │ │ │ └── usb │ │ │ │ ├── class │ │ │ │ └── hid │ │ │ │ │ ├── device │ │ │ │ │ ├── generic │ │ │ │ │ │ ├── udi_hid_generic.c │ │ │ │ │ │ ├── udi_hid_generic.h │ │ │ │ │ │ ├── udi_hid_generic_conf.h │ │ │ │ │ │ └── udi_hid_generic_desc.c │ │ │ │ │ ├── udi_hid.c │ │ │ │ │ └── udi_hid.h │ │ │ │ │ └── usb_protocol_hid.h │ │ │ │ ├── udc │ │ │ │ ├── udc.c │ │ │ │ ├── udc.h │ │ │ │ ├── udc_desc.h │ │ │ │ ├── udd.h │ │ │ │ └── udi.h │ │ │ │ ├── usb_atmel.h │ │ │ │ └── usb_protocol.h │ │ └── utils │ │ │ ├── interrupt.h │ │ │ ├── interrupt │ │ │ ├── interrupt_sam_nvic.c │ │ │ └── interrupt_sam_nvic.h │ │ │ ├── parts.h │ │ │ └── stdio │ │ │ ├── read.c │ │ │ ├── stdio_serial │ │ │ └── stdio_serial.h │ │ │ └── write.c │ ├── sam │ │ ├── boards │ │ │ └── samg55_xplained_pro │ │ │ │ ├── board_init.c │ │ │ │ ├── led.h │ │ │ │ └── samg55_xplained_pro.h │ │ ├── drivers │ │ │ ├── efc │ │ │ │ ├── efc.c │ │ │ │ └── efc.h │ │ │ ├── flexcom │ │ │ │ ├── flexcom.c │ │ │ │ └── flexcom.h │ │ │ ├── matrix │ │ │ │ ├── matrix.c │ │ │ │ └── matrix.h │ │ │ ├── pdc │ │ │ │ ├── pdc.c │ │ │ │ ├── pdc.h │ │ │ │ └── pdc_uart_example │ │ │ │ │ └── pdc_uart_example.h │ │ │ ├── pio │ │ │ │ ├── pio.c │ │ │ │ ├── pio.h │ │ │ │ ├── pio_handler.c │ │ │ │ └── pio_handler.h │ │ │ ├── pmc │ │ │ │ ├── pmc.c │ │ │ │ ├── pmc.h │ │ │ │ ├── sleep.c │ │ │ │ └── sleep.h │ │ │ ├── rtt │ │ │ │ ├── rtt.c │ │ │ │ └── rtt.h │ │ │ ├── spi │ │ │ │ ├── spi.c │ │ │ │ └── spi.h │ │ │ ├── supc │ │ │ │ ├── supc.c │ │ │ │ └── supc.h │ │ │ ├── twi │ │ │ │ ├── twi.c │ │ │ │ └── twi.h │ │ │ ├── udp │ │ │ │ ├── udp_device.c │ │ │ │ └── udp_device.h │ │ │ └── usart │ │ │ │ ├── usart.c │ │ │ │ └── usart.h │ │ └── utils │ │ │ ├── cmsis │ │ │ └── samg │ │ │ │ └── samg55 │ │ │ │ ├── include │ │ │ │ ├── component │ │ │ │ │ ├── adc.h │ │ │ │ │ ├── chipid.h │ │ │ │ │ ├── cmcc.h │ │ │ │ │ ├── crccu.h │ │ │ │ │ ├── efc.h │ │ │ │ │ ├── flexcom.h │ │ │ │ │ ├── gpbr.h │ │ │ │ │ ├── i2sc.h │ │ │ │ │ ├── matrix.h │ │ │ │ │ ├── mem2mem.h │ │ │ │ │ ├── pdc.h │ │ │ │ │ ├── pdmic.h │ │ │ │ │ ├── pio.h │ │ │ │ │ ├── pmc.h │ │ │ │ │ ├── rstc.h │ │ │ │ │ ├── rtc.h │ │ │ │ │ ├── rtt.h │ │ │ │ │ ├── spi.h │ │ │ │ │ ├── supc.h │ │ │ │ │ ├── tc.h │ │ │ │ │ ├── twi.h │ │ │ │ │ ├── udp.h │ │ │ │ │ ├── uhp.h │ │ │ │ │ ├── usart.h │ │ │ │ │ └── wdt.h │ │ │ │ ├── instance │ │ │ │ │ ├── adc.h │ │ │ │ │ ├── chipid.h │ │ │ │ │ ├── cmcc.h │ │ │ │ │ ├── crccu.h │ │ │ │ │ ├── efc.h │ │ │ │ │ ├── flexcom0.h │ │ │ │ │ ├── flexcom1.h │ │ │ │ │ ├── flexcom2.h │ │ │ │ │ ├── flexcom3.h │ │ │ │ │ ├── flexcom4.h │ │ │ │ │ ├── flexcom5.h │ │ │ │ │ ├── flexcom6.h │ │ │ │ │ ├── flexcom7.h │ │ │ │ │ ├── gpbr.h │ │ │ │ │ ├── i2sc0.h │ │ │ │ │ ├── i2sc1.h │ │ │ │ │ ├── matrix.h │ │ │ │ │ ├── mem2mem.h │ │ │ │ │ ├── pdmic0.h │ │ │ │ │ ├── pdmic1.h │ │ │ │ │ ├── pioa.h │ │ │ │ │ ├── piob.h │ │ │ │ │ ├── pmc.h │ │ │ │ │ ├── rstc.h │ │ │ │ │ ├── rtc.h │ │ │ │ │ ├── rtt.h │ │ │ │ │ ├── spi0.h │ │ │ │ │ ├── spi1.h │ │ │ │ │ ├── spi2.h │ │ │ │ │ ├── spi3.h │ │ │ │ │ ├── spi4.h │ │ │ │ │ ├── spi5.h │ │ │ │ │ ├── spi6.h │ │ │ │ │ ├── spi7.h │ │ │ │ │ ├── supc.h │ │ │ │ │ ├── tc0.h │ │ │ │ │ ├── tc1.h │ │ │ │ │ ├── twi0.h │ │ │ │ │ ├── twi1.h │ │ │ │ │ ├── twi2.h │ │ │ │ │ ├── twi3.h │ │ │ │ │ ├── twi4.h │ │ │ │ │ ├── twi5.h │ │ │ │ │ ├── twi6.h │ │ │ │ │ ├── twi7.h │ │ │ │ │ ├── udp.h │ │ │ │ │ ├── uhp.h │ │ │ │ │ ├── usart0.h │ │ │ │ │ ├── usart1.h │ │ │ │ │ ├── usart2.h │ │ │ │ │ ├── usart3.h │ │ │ │ │ ├── usart4.h │ │ │ │ │ ├── usart5.h │ │ │ │ │ ├── usart6.h │ │ │ │ │ ├── usart7.h │ │ │ │ │ └── wdt.h │ │ │ │ ├── pio │ │ │ │ │ ├── samg55g18.h │ │ │ │ │ ├── samg55g19.h │ │ │ │ │ ├── samg55j18.h │ │ │ │ │ ├── samg55j19.h │ │ │ │ │ └── samg55n19.h │ │ │ │ ├── samg55.h │ │ │ │ ├── samg55g18.h │ │ │ │ ├── samg55g19.h │ │ │ │ ├── samg55j18.h │ │ │ │ ├── samg55j19.h │ │ │ │ ├── samg55n19.h │ │ │ │ └── system_samg55.h │ │ │ │ └── source │ │ │ │ └── templates │ │ │ │ ├── gcc │ │ │ │ └── startup_samg55.c │ │ │ │ └── system_samg55.c │ │ │ ├── compiler.h │ │ │ ├── fpu │ │ │ └── fpu.h │ │ │ ├── header_files │ │ │ └── io.h │ │ │ ├── linker_scripts │ │ │ └── samg │ │ │ │ └── samg55j19 │ │ │ │ └── gcc │ │ │ │ └── flash.ld │ │ │ ├── make │ │ │ └── Makefile.sam.in │ │ │ ├── preprocessor │ │ │ ├── mrepeat.h │ │ │ ├── preprocessor.h │ │ │ ├── stringz.h │ │ │ └── tpaste.h │ │ │ ├── status_codes.h │ │ │ └── syscalls │ │ │ └── gcc │ │ │ └── syscalls.c │ └── thirdparty │ │ ├── CMSIS │ │ ├── ATMEL-disclaimer.txt │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf │ │ ├── Include │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ └── core_cmSimd.h │ │ ├── Lib │ │ │ ├── GCC │ │ │ │ ├── libarm_cortexM4lf_math.a │ │ │ │ └── libarm_cortexM4lf_math_softfp.a │ │ │ └── license.txt │ │ └── README.txt │ │ └── freertos │ │ └── freertos-8.0.1 │ │ ├── Source │ │ ├── croutine.c │ │ ├── event_groups.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── StackMacros.h │ │ │ ├── croutine.h │ │ │ ├── event_groups.h │ │ │ ├── list.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── task.h │ │ │ └── timers.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ └── ARM_CM4F │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ ├── MemMang │ │ │ │ └── heap_1.c │ │ │ └── readme.txt │ │ ├── queue.c │ │ ├── readme.txt │ │ ├── tasks.c │ │ └── timers.c │ │ └── readme.txt │ ├── asf.h │ ├── aws_status.c │ ├── aws_status.h │ ├── aws_wifi_task.c │ ├── aws_wifi_task.h │ ├── cert_def_1_signer.c │ ├── cert_def_1_signer.h │ ├── cert_def_2_device.c │ ├── cert_def_2_device.h │ ├── cert_def_3_device_csr.c │ ├── cert_def_3_device_csr.h │ ├── config │ ├── FreeRTOSConfig.h │ ├── conf_board.h │ ├── conf_clock.h │ ├── conf_sleepmgr.h │ ├── conf_spi_master.h │ ├── conf_ssd1306.h │ ├── conf_uart_serial.h │ ├── conf_usb.h │ └── conf_winc.h │ ├── console.c │ ├── console.h │ ├── ecc_configure.c │ ├── ecc_configure.h │ ├── kit_protocol │ ├── kit_protocol_api.h │ ├── kit_protocol_interpreter.c │ ├── kit_protocol_interpreter.h │ ├── kit_protocol_status.c │ ├── kit_protocol_status.h │ ├── kit_protocol_utilities.c │ └── kit_protocol_utilities.h │ ├── led.c │ ├── led.h │ ├── main.c │ ├── oled1.c │ ├── oled1.h │ ├── paho_mqtt_embedded_c │ ├── CONTRIBUTING.md │ ├── MQTTClient-C │ │ ├── MQTTClient.c │ │ └── MQTTClient.h │ ├── MQTTPacket │ │ ├── MQTTConnect.h │ │ ├── MQTTConnectClient.c │ │ ├── MQTTConnectServer.c │ │ ├── MQTTDeserializePublish.c │ │ ├── MQTTFormat.c │ │ ├── MQTTFormat.h │ │ ├── MQTTMessage.h │ │ ├── MQTTPacket.c │ │ ├── MQTTPacket.h │ │ ├── MQTTPublish.h │ │ ├── MQTTReturnCodes.h │ │ ├── MQTTSerializePublish.c │ │ ├── MQTTSubscribe.h │ │ ├── MQTTSubscribeClient.c │ │ ├── MQTTSubscribeServer.c │ │ ├── MQTTUnsubscribe.h │ │ ├── MQTTUnsubscribeClient.c │ │ ├── MQTTUnsubscribeServer.c │ │ └── StackTrace.h │ ├── Makefile │ ├── README.md │ ├── about.html │ ├── edl-v10 │ ├── epl-v10 │ ├── notice.html │ └── platform │ │ ├── network_interface.c │ │ ├── network_interface.h │ │ ├── timer_interface.c │ │ └── timer_interface.h │ ├── parson_json │ ├── Parson JSON License.txt │ ├── parson.c │ └── parson.h │ ├── provisioning_task.c │ ├── provisioning_task.h │ ├── usb_hid.c │ ├── usb_hid.h │ ├── utilities │ ├── hex_dump.c │ └── hex_dump.h │ └── version.h ├── kit_provision.py ├── kit_reset.py ├── kit_set_wifi.py ├── license.txt ├── mchp_aws_zt_kit.py ├── readme.md ├── requirements.txt └── sim_hid_device.py /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/cryptoauthlib"] 2 | path = firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/cryptoauthlib 3 | url = https://github.com/MicrochipTech/cryptoauthlib.git 4 | -------------------------------------------------------------------------------- /ca_create_root.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime, timezone, timedelta 2 | from cryptography import x509 3 | from cryptography.hazmat.primitives import hashes, serialization 4 | from aws_kit_common import * 5 | 6 | 7 | def ca_create_root(root_ca_key_path=ROOT_CA_KEY_FILENAME, root_ca_cert_path=ROOT_CA_CERT_FILENAME): 8 | # Create or load a root CA key pair 9 | print('\nLoading root CA key') 10 | root_ca_priv_key = load_or_create_key(root_ca_key_path) 11 | 12 | # Create root CA certificate 13 | print('\nGenerating self-signed root CA certificate') 14 | builder = x509.CertificateBuilder() 15 | builder = builder.serial_number(random_cert_sn(16)) 16 | # Please note that the name of the root CA is also part of the signer certificate and thus, it's 17 | # part of certificate definition in the SAMG55 firmware (g_cert_elements_1_signer). If this name is 18 | # changed, it will also need to be changed in the firmware. The cert2certdef.py utility script can 19 | # help with regenerating the cert_def_1_signer.c file after making changes. 20 | builder = builder.issuer_name(x509.Name([ 21 | x509.NameAttribute(x509.oid.NameOID.ORGANIZATION_NAME, u'Example Inc'), 22 | x509.NameAttribute(x509.oid.NameOID.COMMON_NAME, u'Example Root CA')])) 23 | builder = builder.not_valid_before(datetime.utcnow().replace(tzinfo=timezone.utc)) 24 | builder = builder.not_valid_after(builder._not_valid_before + timedelta(days=365*25)) 25 | builder = builder.subject_name(builder._issuer_name) 26 | builder = builder.public_key(root_ca_priv_key.public_key()) 27 | builder = builder.add_extension( 28 | x509.SubjectKeyIdentifier.from_public_key(root_ca_priv_key.public_key()), 29 | critical=False) 30 | builder = builder.add_extension( 31 | x509.BasicConstraints(ca=True, path_length=None), 32 | critical=True) 33 | # Self-sign certificate 34 | root_ca_cert = builder.sign( 35 | private_key=root_ca_priv_key, 36 | algorithm=hashes.SHA256(), 37 | backend=crypto_be) 38 | 39 | # Write root CA certificate to file 40 | with open(root_ca_cert_path, 'wb') as f: 41 | print(' Saving to ' + f.name) 42 | f.write(root_ca_cert.public_bytes(encoding=serialization.Encoding.PEM)) 43 | 44 | print('\nDone') 45 | 46 | 47 | if __name__ == '__main__': 48 | try: 49 | ca_create_root() 50 | except AWSZTKitError as e: 51 | # Print kit errors without a stack trace 52 | print(e) 53 | -------------------------------------------------------------------------------- /ca_create_signer_csr.py: -------------------------------------------------------------------------------- 1 | from cryptography import x509 2 | from cryptography.hazmat.primitives import hashes, serialization 3 | from aws_kit_common import * 4 | 5 | 6 | def ca_create_signer_csr(signer_ca_key_path=SIGNER_CA_KEY_FILENAME, signer_ca_csr_path=SIGNER_CA_CSR_FILENAME): 7 | # Load or create a signer CA key pair 8 | print('\nLoading signer CA key') 9 | signer_ca_priv_key = load_or_create_key(signer_ca_key_path) 10 | 11 | print('\nGenerating signer CA CSR') 12 | builder = x509.CertificateSigningRequestBuilder() 13 | # Please note that the name of the signer is part of certificate definition in the SAMG55 firmware 14 | # (g_cert_elements_1_signer). If this name is changed, it will also need to be changed in the firmware. 15 | # The cert2certdef.py utility script can help with regenerating the cert_def_1_signer.c file after making changes. 16 | builder = builder.subject_name(x509.Name([ 17 | x509.NameAttribute(x509.oid.NameOID.ORGANIZATION_NAME, u'Example Inc'), 18 | x509.NameAttribute(x509.oid.NameOID.COMMON_NAME, u'Example Signer FFFF')])) 19 | builder = add_signer_extensions( 20 | builder=builder, 21 | public_key=signer_ca_priv_key.public_key()) 22 | signer_ca_csr = builder.sign( 23 | private_key=signer_ca_priv_key, 24 | algorithm=hashes.SHA256(), 25 | backend=crypto_be) 26 | 27 | # Save CSR 28 | with open(signer_ca_csr_path, 'wb') as f: 29 | print(' Saving to ' + f.name) 30 | f.write(signer_ca_csr.public_bytes(encoding=serialization.Encoding.PEM)) 31 | 32 | print('\nDone') 33 | 34 | 35 | def add_signer_extensions(builder, public_key=None, authority_cert=None): 36 | if public_key == None: 37 | public_key = builder._public_key # Public key not specified, assume its in the builder (cert builder) 38 | 39 | builder = builder.add_extension( 40 | x509.BasicConstraints(ca=True, path_length=0), 41 | critical=True) 42 | 43 | builder = builder.add_extension( 44 | x509.KeyUsage( 45 | digital_signature=True, 46 | content_commitment=False, 47 | key_encipherment=False, 48 | data_encipherment=False, 49 | key_agreement=False, 50 | key_cert_sign=True, 51 | crl_sign=True, 52 | encipher_only=False, 53 | decipher_only=False), 54 | critical=True) 55 | 56 | builder = builder.add_extension( 57 | x509.SubjectKeyIdentifier.from_public_key(public_key), 58 | critical=False) 59 | subj_key_id_ext = builder._extensions[-1] # Save newly created subj key id extension 60 | 61 | if authority_cert: 62 | # We have an authority certificate, use its subject key id 63 | builder = builder.add_extension( 64 | x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier( 65 | authority_cert.extensions.get_extension_for_class(x509.SubjectKeyIdentifier).value), 66 | critical=False) 67 | else: 68 | # No authority cert, assume this is a CSR and just use its own subject key id 69 | builder = builder.add_extension( 70 | x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier(subj_key_id_ext.value), 71 | critical=False) 72 | 73 | return builder 74 | 75 | 76 | if __name__ == '__main__': 77 | try: 78 | ca_create_signer_csr() 79 | except AWSZTKitError as e: 80 | # Print kit errors without a stack trace 81 | print(e) 82 | -------------------------------------------------------------------------------- /cloud-formation-templates/aws-zero-touch-admin-setup-cn.yaml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | UserName: 3 | Type: String 4 | Description: Username of the account the kit will be run from. 5 | Default: ZTUser 6 | UserPassword: 7 | Type: String 8 | Description: Password of the account the kit will be run from. 9 | MinLength: 4 10 | 11 | Resources: 12 | KitUser: 13 | Type: AWS::IAM::User 14 | Properties: 15 | Path: "/" 16 | UserName: !Ref UserName 17 | LoginProfile: 18 | Password: !Ref UserPassword 19 | ManagedPolicyArns: 20 | - arn:aws-cn:iam::aws:policy/AWSLambdaFullAccess 21 | - arn:aws-cn:iam::aws:policy/AWSIoTFullAccess 22 | 23 | KitUserKeyPair: 24 | Type: "AWS::IAM::AccessKey" 25 | Properties: 26 | UserName: 27 | !Ref KitUser 28 | 29 | ZTLambdaJITRRole: 30 | Type: "AWS::IAM::Role" 31 | Properties: 32 | AssumeRolePolicyDocument: 33 | Version: "2012-10-17" 34 | Statement: 35 | - Effect: "Allow" 36 | Principal: 37 | Service: 38 | - "lambda.amazonaws.com" 39 | Action: 40 | - "sts:AssumeRole" 41 | ManagedPolicyArns: 42 | - arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole 43 | Path: "/" 44 | Policies: 45 | - PolicyName: "ZTLambdaJITRPolicy" 46 | PolicyDocument: 47 | Version: "2012-10-17" 48 | Statement: 49 | - Effect: "Allow" 50 | Action: 51 | - "iot:UpdateCertificate" 52 | - "iot:CreatePolicy" 53 | - "iot:AttachPrincipalPolicy" 54 | - "iot:CreateThing" 55 | - "iot:CreateThingType" 56 | - "iot:DescribeCertificate" 57 | - "iot:DescribeCaCertificate" 58 | - "iot:DescribeThing" 59 | - "iot:DescribeThingType" 60 | - "iot:GetPolicy" 61 | Resource: "*" 62 | RoleName: ZTLambdaJITRRole 63 | 64 | Outputs: 65 | UserName: 66 | Value: !Ref UserName 67 | UserPassword: 68 | Value: !Ref UserPassword 69 | AccessKey: 70 | Value: !Ref KitUserKeyPair 71 | SecretAccessKey: 72 | Value: !GetAtt KitUserKeyPair.SecretAccessKey -------------------------------------------------------------------------------- /cloud-formation-templates/aws-zero-touch-admin-setup.yaml: -------------------------------------------------------------------------------- 1 | Parameters: 2 | UserName: 3 | Type: String 4 | Description: Username of the account the kit will be run from. 5 | Default: ZTUser 6 | UserPassword: 7 | Type: String 8 | Description: Password of the account the kit will be run from. 9 | MinLength: 4 10 | 11 | Resources: 12 | KitUser: 13 | Type: AWS::IAM::User 14 | Properties: 15 | Path: "/" 16 | UserName: !Ref UserName 17 | LoginProfile: 18 | Password: !Ref UserPassword 19 | ManagedPolicyArns: 20 | - arn:aws:iam::aws:policy/AWSLambdaFullAccess 21 | - arn:aws:iam::aws:policy/AWSIoTFullAccess 22 | 23 | KitUserKeyPair: 24 | Type: "AWS::IAM::AccessKey" 25 | Properties: 26 | UserName: 27 | !Ref KitUser 28 | 29 | ZTLambdaJITRRole: 30 | Type: "AWS::IAM::Role" 31 | Properties: 32 | AssumeRolePolicyDocument: 33 | Version: "2012-10-17" 34 | Statement: 35 | - Effect: "Allow" 36 | Principal: 37 | Service: 38 | - "lambda.amazonaws.com" 39 | Action: 40 | - "sts:AssumeRole" 41 | ManagedPolicyArns: 42 | - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole 43 | - arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess 44 | Path: "/" 45 | Policies: 46 | - PolicyName: "ZTLambdaJITRPolicy" 47 | PolicyDocument: 48 | Version: "2012-10-17" 49 | Statement: 50 | - Effect: "Allow" 51 | Action: 52 | - "iot:UpdateCertificate" 53 | - "iot:CreatePolicy" 54 | - "iot:AttachPrincipalPolicy" 55 | - "iot:CreateThing" 56 | - "iot:CreateThingType" 57 | - "iot:DescribeCertificate" 58 | - "iot:DescribeCaCertificate" 59 | - "iot:DescribeThing" 60 | - "iot:DescribeThingType" 61 | - "iot:GetPolicy" 62 | Resource: "*" 63 | RoleName: ZTLambdaJITRRole 64 | 65 | Outputs: 66 | UserName: 67 | Value: !Ref UserName 68 | UserPassword: 69 | Value: !Ref UserPassword 70 | AccessKey: 71 | Value: !Ref KitUserKeyPair 72 | SecretAccessKey: 73 | Value: !GetAtt KitUserKeyPair.SecretAccessKey -------------------------------------------------------------------------------- /cloud-formation-templates/readme.md: -------------------------------------------------------------------------------- 1 | # AWS Zero-touch Kit CloudFormation Templates 2 | 3 | These [CloudFormation](https://aws.amazon.com/cloudformation/) templates 4 | provide an automated way to create the AWS resources required to demonstrate 5 | the kit. 6 | 7 | While the user manual gives instructions for creating these resources manually 8 | using the AWS console, these automate the process for when you want to get it 9 | running quicker. 10 | 11 | These templates are typically deployed from an AWS account with administrative 12 | privileges. 13 | 14 | ## aws-zero-touch-admin-setup.yaml 15 | 16 | This script sets up the administrative resources (kit IAM user and lambda 17 | role), but leaves the actual lambda function and IoT rules engine rule up to 18 | the user. 19 | 20 | ## aws-zero-touch-full-setup.yaml 21 | 22 | This script sets up all the resources required to demonstrate the kit. 23 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "AWS_IoT_Zero_Touch_SAMG55", "AWS_IoT_Zero_Touch_SAMG55\AWS_IoT_Zero_Touch_SAMG55.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|ARM = Debug|ARM 11 | Release|ARM = Release|ARM 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM 15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM 16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM 17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/AWS_IoT_Zero_Touch_SAMG55.componentinfo.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/readme.md: -------------------------------------------------------------------------------- 1 | # Zero Touch Provisioning kit for AWS IoT Release B Firmware 2 | 3 | This is the firmware for the Zero Touch Provisioning Kit for AWS IoT Release B 4 | (AT88CKECC-AWS-XSTK-B). More information and the latest firmware can be found 5 | at the following web pages: 6 | 7 | http://www.microchip.com/developmenttools/productdetails.aspx?partno=at88ckecc-aws-xstk-b 8 | https://github.com/MicrochipTech/aws-iot-zero-touch-secure-provisioning-kit 9 | 10 | ## Change Log 11 | 12 | ### 2.2.5 (2019-6-21) 13 | 14 | - Updated CryptoAuthLib to 20190517 15 | - Updated ASF to 3.40.0 16 | - Minor bugs fixes around USB communication 17 | 18 | ### 2.2.4 19 | 20 | - Added unconfigured device auto-detection and pre-configuration. Also brought 21 | in support for the ATECC608A. 22 | 23 | ### 2.2.3 24 | 25 | - Fixed memory leak when parsing json from shadow update delta topic 26 | 27 | ### 2.2.2 (2017-9-26) 28 | 29 | - Resolved DNS lookup happening too soon 30 | 31 | ### 2.2.1 (2017-9-18) 32 | 33 | - Now reports LED status to AWS shadow 34 | - Added support for open WiFi access points 35 | 36 | ### 2.2.0 (2017-7-10) 37 | 38 | - Initial release of firmware for AT88CKECC-AWS-XSTK-B 39 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/WINC1500_SW_API.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/aws-iot-zero-touch-secure-provisioning-kit/af71d071a7b034dcebec555529439484026d460b/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/WINC1500_SW_API.chm -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/bsp/include/nm_bsp_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief This module contains NMC1500 BSP APIs declarations. 6 | * 7 | * Copyright (c) 2016 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | * POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | * \asf_license_stop 39 | * 40 | */ 41 | /**@defgroup BSPDefine Defines 42 | * @ingroup nm_bsp 43 | * @{ 44 | */ 45 | #ifndef _NM_BSP_INTERNAL_H_ 46 | #define _NM_BSP_INTERNAL_H_ 47 | 48 | 49 | 50 | #ifdef WIN32 51 | #include "nm_bsp_win32.h" 52 | #endif 53 | 54 | #ifdef __K20D50M__ 55 | #include "nm_bsp_k20d50m.h" 56 | #endif 57 | 58 | #ifdef __MSP430FR5739__ 59 | #include "bsp_msp430fr5739.h" 60 | #endif 61 | 62 | #ifdef _FREESCALE_MCF51CN128_ 63 | #include "bsp/include/nm_bsp_mcf51cn128.h" 64 | #endif 65 | 66 | #ifdef __MCF964548__ 67 | #include "bsp/include/nm_bsp_mc96f4548.h" 68 | #endif 69 | 70 | #ifdef __APP_APS3_CORTUS__ 71 | #include "nm_bsp_aps3_cortus.h" 72 | #endif 73 | 74 | #if (defined __SAMR21G18A__) 75 | #include "bsp/include/nm_bsp_samr21.h" 76 | #endif 77 | 78 | #if (defined __SAML21J18A__) || (defined __SAML21J18B__) 79 | #include "bsp/include/nm_bsp_saml21.h" 80 | #endif 81 | 82 | #if (defined __SAML22N18A__) 83 | #include "bsp/include/nm_bsp_saml22.h" 84 | #endif 85 | 86 | #if (defined __SAMD21J18A__) || (defined __SAMD21G18A__) 87 | #include "bsp/include/nm_bsp_samd21.h" 88 | #endif 89 | 90 | #if (defined __SAM4S16C__) || (defined __SAM4SD32C__) 91 | #include "bsp/include/nm_bsp_sam4s.h" 92 | #endif 93 | 94 | #ifdef __SAMG53N19__ 95 | #include "bsp/include/nm_bsp_samg53.h" 96 | #endif 97 | 98 | #ifdef __SAMG55J19__ 99 | #include "bsp/include/nm_bsp_samg55.h" 100 | #endif 101 | 102 | #if (defined __SAME70Q21__) || (defined __SAMV71Q21__) 103 | #include "bsp/include/nm_bsp_same70.h" 104 | #endif 105 | 106 | #ifdef CORTUS_APP 107 | #include "crt_iface.h" 108 | #endif 109 | 110 | #ifdef NRF51 111 | #include "nm_bsp_nrf51822.h" 112 | #endif 113 | 114 | #ifdef _ARDUINO_UNO_ 115 | #include "bsp/include/nm_bsp_arduino_uno.h" 116 | #endif 117 | 118 | 119 | #endif //_NM_BSP_INTERNAL_H_ -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/bsp/include/nm_bsp_samg55.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief This module contains SAMG55 BSP APIs declarations. 6 | * 7 | * Copyright (c) 2016 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | * POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | * \asf_license_stop 39 | * 40 | */ 41 | 42 | #ifndef _NM_BSP_SAMG55_H_ 43 | #define _NM_BSP_SAMG55_H_ 44 | 45 | #include "conf_winc.h" 46 | 47 | #define NM_EDGE_INTERRUPT (1) 48 | 49 | #define NM_DEBUG CONF_WINC_DEBUG 50 | #define NM_BSP_PRINTF CONF_WINC_PRINTF 51 | 52 | #endif /* _NM_BSP_SAMG55_H_ */ 53 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/common/include/nm_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief This module contains debug APIs declarations. 6 | * 7 | * Copyright (c) 2016-2017 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | * POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | * \asf_license_stop 39 | * 40 | */ 41 | 42 | #ifndef _NM_DEBUG_H_ 43 | #define _NM_DEBUG_H_ 44 | 45 | #include "bsp/include/nm_bsp.h" 46 | #include "bsp/include/nm_bsp_internal.h" 47 | 48 | /**@defgroup DebugDefines DebugDefines 49 | * @ingroup WlanDefines 50 | */ 51 | /**@{*/ 52 | 53 | 54 | #define M2M_LOG_NONE 0 55 | #define M2M_LOG_ERROR 1 56 | #define M2M_LOG_INFO 2 57 | #define M2M_LOG_REQ 3 58 | #define M2M_LOG_DBG 4 59 | 60 | #if (defined __APS3_CORTUS__) 61 | #define M2M_LOG_LEVEL M2M_LOG_INFO 62 | #else 63 | #define M2M_LOG_LEVEL M2M_LOG_REQ 64 | #endif 65 | 66 | 67 | #define M2M_ERR(...) 68 | #define M2M_INFO(...) 69 | #define M2M_REQ(...) 70 | #define M2M_DBG(...) 71 | #define M2M_PRINT(...) 72 | 73 | #if (CONF_WINC_DEBUG == 1) 74 | #undef M2M_PRINT 75 | #define M2M_PRINT(...) do{CONF_WINC_PRINTF(__VA_ARGS__);CONF_WINC_PRINTF("\r");}while(0) 76 | #if (M2M_LOG_LEVEL >= M2M_LOG_ERROR) 77 | #undef M2M_ERR 78 | #define M2M_ERR(...) do{CONF_WINC_PRINTF("(APP)(ERR)[%s][%d]",__FUNCTION__,__LINE__); CONF_WINC_PRINTF(__VA_ARGS__);CONF_WINC_PRINTF("\r");}while(0) 79 | #if (M2M_LOG_LEVEL >= M2M_LOG_INFO) 80 | #undef M2M_INFO 81 | #define M2M_INFO(...) do{CONF_WINC_PRINTF("(APP)(INFO)"); CONF_WINC_PRINTF(__VA_ARGS__);CONF_WINC_PRINTF("\r");}while(0) 82 | #if (M2M_LOG_LEVEL >= M2M_LOG_REQ) 83 | #undef M2M_REQ 84 | #define M2M_REQ(...) do{CONF_WINC_PRINTF("(APP)(R)"); CONF_WINC_PRINTF(__VA_ARGS__);CONF_WINC_PRINTF("\r");}while(0) 85 | #if (M2M_LOG_LEVEL >= M2M_LOG_DBG) 86 | #undef M2M_DBG 87 | #define M2M_DBG(...) do{CONF_WINC_PRINTF("(APP)(DBG)[%s][%d]",__FUNCTION__,__LINE__); CONF_WINC_PRINTF(__VA_ARGS__);CONF_WINC_PRINTF("\r");}while(0) 88 | #endif /*M2M_LOG_DBG*/ 89 | #endif /*M2M_LOG_REQ*/ 90 | #endif /*M2M_LOG_INFO*/ 91 | #endif /*M2M_LOG_ERROR*/ 92 | #endif /*CONF_WINC_DEBUG */ 93 | 94 | /**@}*/ 95 | #endif /* _NM_DEBUG_H_ */ 96 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/programmer/programmer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief WINC Peripherals Application Interface. 6 | * 7 | * Copyright (c) 2016-2017 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | * POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | * \asf_license_stop 39 | * 40 | */ 41 | 42 | #ifndef __PROGRAMMER_H__ 43 | #define __PROGRAMMER_H__ 44 | 45 | /** 46 | * Include 47 | */ 48 | #include "spi_flash/include/spi_flash_map.h" 49 | #include "spi_flash/include/spi_flash.h" 50 | 51 | 52 | #define ROOT_CERT_SIZE M2M_TLS_ROOTCER_FLASH_SIZE 53 | 54 | #define programmer_get_flash_size() (((spi_flash_get_size()*1024)/8)*1024) 55 | #define programmer_write(pu8Buf, u32Offset, u32Sz) spi_flash_write(pu8Buf, u32Offset, u32Sz) 56 | #define programmer_erase(u32Offset, u32Sz) spi_flash_erase(u32Offset, u32Sz) 57 | #define programmer_eraseall() programmer_erase(0, programmer_get_flash_size()) 58 | #define programmer_read(pu8Buf, u32Offset, u32Sz) spi_flash_read(pu8Buf, u32Offset, u32Sz) 59 | 60 | 61 | #define programmer_write_root_cert(buff) programmer_write((uint8*)buff, M2M_TLS_ROOTCER_FLASH_OFFSET, M2M_TLS_ROOTCER_FLASH_SIZE) 62 | #define programmer_read_root_cert(buff) programmer_read((uint8*)buff, M2M_TLS_ROOTCER_FLASH_OFFSET, M2M_TLS_ROOTCER_FLASH_SIZE) 63 | #define programmer_erase_root_cert() programmer_erase(M2M_TLS_ROOTCER_FLASH_OFFSET, M2M_TLS_ROOTCER_FLASH_SIZE) 64 | 65 | #define programmer_write_tls_cert_store(buff) programmer_write((uint8*)buff, M2M_TLS_SERVER_FLASH_OFFSET, M2M_TLS_SERVER_FLASH_SIZE) 66 | #define programmer_read_tls_cert_store(buff) programmer_read((uint8*)buff, M2M_TLS_SERVER_FLASH_OFFSET, M2M_TLS_SERVER_FLASH_SIZE) 67 | #define programmer_erase_tls_cert_store() programmer_erase(M2M_TLS_SERVER_FLASH_OFFSET, M2M_TLS_SERVER_FLASH_SIZE) 68 | 69 | #endif /* __PROGRAMMER_H__ */ -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/programmer/programmer_apis.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief Programmer APIs. 6 | * 7 | * Copyright (c) 2016-2017 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | * POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | * \asf_license_stop 39 | * 40 | */ 41 | 42 | #ifndef FIRMWARE_PROGRAMMER_APIS_H_INCLUDED 43 | #define FIRMWARE_PROGRAMMER_APIS_H_INCLUDED 44 | 45 | #include "common/include/nm_common.h" 46 | #include "programmer/programmer.h" 47 | #include "spi_flash/include/spi_flash_map.h" 48 | 49 | #define programmer_write_cert_image(buff) programmer_write((uint8*)buff, M2M_TLS_FLASH_ROOTCERT_CACHE_OFFSET, M2M_TLS_FLASH_ROOTCERT_CACHE_SIZE) 50 | #define programmer_read_cert_image(buff) programmer_read((uint8*)buff, M2M_TLS_FLASH_ROOTCERT_CACHE_OFFSET, M2M_TLS_FLASH_ROOTCERT_CACHE_SIZE) 51 | #define programmer_erase_cert_image() programmer_erase(M2M_TLS_FLASH_ROOTCERT_CACHE_OFFSET, M2M_TLS_FLASH_ROOTCERT_CACHE_SIZE) 52 | 53 | #define programmer_write_firmware_image(buff,offSet,sz) programmer_write((uint8*)buff, offSet, sz) 54 | #define programmer_read_firmware_image(buff,offSet,sz) programmer_read((uint8*)buff, offSet, sz) 55 | 56 | #define programmer_erase_all() programmer_erase(0, programmer_get_flash_size()) 57 | 58 | #endif /* FIRMWARE_PROGRAMMER_APIS_H_INCLUDED */ 59 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/components/wifi/winc1500/socket/source/socket_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief BSD compatible socket interface internal types. 6 | * 7 | * Copyright (c) 2016-2017 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | * POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | * \asf_license_stop 39 | * 40 | */ 41 | #ifndef __SOCKET_INTERNAL_H__ 42 | #define __SOCKET_INTERNAL_H__ 43 | 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* 50 | INCLUDES 51 | *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ 52 | 53 | #include "socket/include/socket.h" 54 | #include "socket/include/m2m_socket_host_if.h" 55 | 56 | 57 | /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* 58 | FUNCTION PROTOTYPES 59 | *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ 60 | 61 | NMI_API void Socket_ReadSocketData(SOCKET sock, tstrSocketRecvMsg *pstrRecv,uint8 u8SocketMsg, 62 | uint32 u32StartAddress,uint16 u16ReadCount); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif /* __cplusplus */ 67 | 68 | #endif /* __SOCKET_H__ */ 69 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/delay/sam/cycle_counter.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief ARM functions for busy-wait delay loops 5 | * 6 | * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | /* 44 | * Support and FAQ: visit Atmel Support 45 | */ 46 | 47 | #include "cycle_counter.h" 48 | 49 | // Delay loop is put to SRAM so that FWS will not affect delay time 50 | OPTIMIZE_HIGH 51 | RAMFUNC 52 | void portable_delay_cycles(unsigned long n) 53 | { 54 | UNUSED(n); 55 | 56 | __asm ( 57 | "loop: DMB \n" 58 | "SUBS R0, R0, #1 \n" 59 | "BNE.N loop " 60 | ); 61 | } 62 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/serial/usart_serial.c: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief USART Serial driver functions. 6 | * 7 | * 8 | * Copyright (c) 2010-2015 Atmel Corporation. All rights reserved. 9 | * 10 | * \asf_license_start 11 | * 12 | * \page License 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions are met: 16 | * 17 | * 1. Redistributions of source code must retain the above copyright notice, 18 | * this list of conditions and the following disclaimer. 19 | * 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 24 | * 3. The name of Atmel may not be used to endorse or promote products derived 25 | * from this software without specific prior written permission. 26 | * 27 | * 4. This software may only be redistributed and used in connection with an 28 | * Atmel microcontroller product. 29 | * 30 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 31 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 32 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 33 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 34 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 38 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * 42 | * \asf_license_stop 43 | * 44 | */ 45 | /* 46 | * Support and FAQ: visit Atmel Support 47 | */ 48 | #include "serial.h" 49 | 50 | /** 51 | * \brief Send a sequence of bytes to USART device 52 | * 53 | * \param usart Base address of the USART instance. 54 | * \param data Data buffer to read 55 | * \param len Length of data 56 | * 57 | */ 58 | status_code_t usart_serial_write_packet(usart_if usart, const uint8_t *data, 59 | size_t len) 60 | { 61 | while (len) { 62 | usart_serial_putchar(usart, *data); 63 | len--; 64 | data++; 65 | } 66 | return STATUS_OK; 67 | } 68 | 69 | 70 | /** 71 | * \brief Receive a sequence of bytes from USART device 72 | * 73 | * \param usart Base address of the USART instance. 74 | * \param data Data buffer to write 75 | * \param len Length of data 76 | * 77 | */ 78 | status_code_t usart_serial_read_packet(usart_if usart, uint8_t *data, 79 | size_t len) 80 | { 81 | while (len) { 82 | usart_serial_getchar(usart, data); 83 | len--; 84 | data++; 85 | } 86 | return STATUS_OK; 87 | } 88 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/sleepmgr/sam/sleepmgr.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SAM3/SAM4 Sleep manager implementation. 5 | * 6 | * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | /* 44 | * Support and FAQ: visit Atmel Support 45 | */ 46 | 47 | #include 48 | #include 49 | 50 | #if defined(CONFIG_SLEEPMGR_ENABLE) || defined(__DOXYGEN__) 51 | 52 | uint8_t sleepmgr_locks[SLEEPMGR_NR_OF_MODES]; 53 | 54 | #endif /* CONFIG_SLEEPMGR_ENABLE */ 55 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/twi/sam_twi/twi_master.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief TWI Master driver for SAM. 5 | * 6 | * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef _TWI_MASTER_H_ 38 | #define _TWI_MASTER_H_ 39 | 40 | #include "twi.h" 41 | #include "sysclk.h" 42 | 43 | typedef Twi *twi_master_t; 44 | typedef twi_options_t twi_master_options_t; 45 | typedef twi_packet_t twi_package_t; 46 | 47 | static inline uint32_t twi_master_setup(twi_master_t p_twi, 48 | twi_master_options_t *p_opt) 49 | { 50 | p_opt->master_clk = sysclk_get_peripheral_hz(); 51 | p_opt->smbus = 0; 52 | #if SAMG55 53 | if (p_twi == TWI0) { 54 | sysclk_enable_peripheral_clock(ID_FLEXCOM0); 55 | } else if (p_twi == TWI1) { 56 | sysclk_enable_peripheral_clock(ID_FLEXCOM1); 57 | } else if (p_twi == TWI2) { 58 | sysclk_enable_peripheral_clock(ID_FLEXCOM2); 59 | } else if (p_twi == TWI3) { 60 | sysclk_enable_peripheral_clock(ID_FLEXCOM3); 61 | } else if (p_twi == TWI4) { 62 | sysclk_enable_peripheral_clock(ID_FLEXCOM4); 63 | } else if (p_twi == TWI5) { 64 | sysclk_enable_peripheral_clock(ID_FLEXCOM5); 65 | } else if (p_twi == TWI6) { 66 | sysclk_enable_peripheral_clock(ID_FLEXCOM6); 67 | #ifdef _SAMG55_FLEXCOM7_INSTANCE_ 68 | } else if (p_twi == TWI7) { 69 | sysclk_enable_peripheral_clock(ID_FLEXCOM7); 70 | #endif /* _SAMG55_FLEXCOM7_INSTANCE_*/ 71 | } else { 72 | // Do Nothing 73 | } 74 | #else 75 | #if (!(SAMG51 || SAMG53 || SAMG54)) 76 | if (p_twi == TWI0) { 77 | sysclk_enable_peripheral_clock(ID_TWI0); 78 | } else 79 | #endif 80 | if (p_twi == TWI1) { 81 | sysclk_enable_peripheral_clock(ID_TWI1); 82 | #if (SAM4N || SAMG) 83 | } else if (p_twi == TWI2) { 84 | sysclk_enable_peripheral_clock(ID_TWI2); 85 | #endif 86 | } else { 87 | // Do Nothing 88 | } 89 | #endif 90 | 91 | return (twi_master_init(p_twi, p_opt)); 92 | } 93 | 94 | #define twi_master_enable(p_twi) twi_enable_master_mode(p_twi) 95 | #define twi_master_disable(p_twi) twi_disable_master_mode(p_twi) 96 | 97 | #endif // _TWI_MASTER_H_ 98 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/twi/sam_twi/twi_slave.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief TWI Slave driver for SAM. 5 | * 6 | * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef _TWI_SLAVE_H_ 38 | #define _TWI_SLAVE_H_ 39 | 40 | #include "twi.h" 41 | #include "sysclk.h" 42 | 43 | typedef Twi *twi_slave_t; 44 | 45 | static inline void twi_slave_setup(twi_slave_t p_twi, uint32_t dw_device_addr) 46 | { 47 | #if SAMG55 48 | if (p_twi == TWI0) { 49 | sysclk_enable_peripheral_clock(ID_FLEXCOM0); 50 | } else if (p_twi == TWI1) { 51 | sysclk_enable_peripheral_clock(ID_FLEXCOM1); 52 | } else if (p_twi == TWI2) { 53 | sysclk_enable_peripheral_clock(ID_FLEXCOM2); 54 | } else if (p_twi == TWI3) { 55 | sysclk_enable_peripheral_clock(ID_FLEXCOM3); 56 | } else if (p_twi == TWI4) { 57 | sysclk_enable_peripheral_clock(ID_FLEXCOM4); 58 | } else if (p_twi == TWI5) { 59 | sysclk_enable_peripheral_clock(ID_FLEXCOM5); 60 | } else if (p_twi == TWI6) { 61 | sysclk_enable_peripheral_clock(ID_FLEXCOM6); 62 | #ifdef _SAMG55_FLEXCOM7_INSTANCE_ 63 | } else if (p_twi == TWI7) { 64 | sysclk_enable_peripheral_clock(ID_FLEXCOM7); 65 | #endif /* _SAMG55_FLEXCOM7_INSTANCE_*/ 66 | } else { 67 | // Do Nothing 68 | } 69 | #else 70 | #if (!(SAMG51 || SAMG53 || SAMG54)) 71 | if (p_twi == TWI0) { 72 | sysclk_enable_peripheral_clock(ID_TWI0); 73 | } else 74 | #endif 75 | if (p_twi == TWI1) { 76 | sysclk_enable_peripheral_clock(ID_TWI1); 77 | #if (SAM4N || SAMG) 78 | } else if (p_twi == TWI2) { 79 | sysclk_enable_peripheral_clock(ID_TWI2); 80 | #endif 81 | } else { 82 | // Do Nothing 83 | } 84 | #endif 85 | 86 | twi_slave_init(p_twi, dw_device_addr); 87 | } 88 | 89 | #define twi_slave_enable(p_twi) twi_enable_slave_mode(p_twi) 90 | 91 | #define twi_slave_disable(p_twi) twi_disable_slave_mode(p_twi) 92 | 93 | #endif // _TWI_SLAVE_H_ 94 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/twi/twi_slave.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief TWI Slave Mode management 5 | * 6 | * Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | #ifndef TWI_SLAVE_H_INCLUDED 37 | #define TWI_SLAVE_H_INCLUDED 38 | 39 | #include 40 | #include 41 | 42 | #if (SAM3S || SAM3U || SAM3N || SAM3XA || SAM4S || SAM4E || SAM4N || SAM4C || SAM4CM || SAMG || SAM4CP) 43 | # include "sam_twi/twi_slave.h" 44 | #elif XMEGA 45 | # include "xmega_twi/twi_slave.h" 46 | #elif MEGA_RF 47 | # include "megarf_twi/twi_slave.h" 48 | #elif (defined(__GNUC__) && defined(__AVR32__)) || (defined(__ICCAVR32__) || defined(__AAVR32__)) 49 | #if (defined AVR32_TWI) 50 | #error Not supported. 51 | #endif 52 | #else 53 | # error Unsupported chip type 54 | #endif 55 | 56 | /** 57 | * 58 | * \defgroup twi_group Two Wire-interface(TWI) 59 | * 60 | * This is the common API for TWIs. Additional features are available 61 | * in the documentation of the specific modules. 62 | * 63 | * \section twi_group_platform Platform Dependencies 64 | * 65 | * The twi API is partially chip- or platform-specific. While all 66 | * platforms provide mostly the same functionality, there are some 67 | * variations around how different bus types and clock tree structures 68 | * are handled. 69 | * 70 | * The following functions are available on all platforms, but there may 71 | * be variations in the function signature (i.e. parameters) and 72 | * behaviour. These functions are typically called by platform-specific 73 | * parts of drivers, and applications that aren't intended to be 74 | * portable: 75 | * - twi_slave_setup() 76 | * - twi_slave_enable() 77 | * - twi_slave_disable() 78 | * - twi_slave_read() 79 | * - twi_slave_write() 80 | * 81 | * @{ 82 | */ 83 | 84 | /** 85 | * \typedef twi_slave_t 86 | * This type can be used independently to refer to TWI slave module for the 87 | * architecture used. It refers to the correct type definition for the 88 | * architecture, ie. TWI_t* for XMEGA or avr32_twi_t* for UC3 89 | */ 90 | 91 | //! @} 92 | 93 | #endif /* TWI_SLAVE_H_INCLUDED */ 94 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/usb/class/hid/device/generic/udi_hid_generic_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Default HID generic configuration for a USB Device 5 | * with a single interface HID 6 | * 7 | * Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Subject to your compliance with these terms, you may use Microchip 14 | * software and any derivatives exclusively with Microchip products. 15 | * It is your responsibility to comply with third party license terms applicable 16 | * to your use of third party software (including open source software) that 17 | * may accompany Microchip software. 18 | * 19 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 20 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 21 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 22 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 23 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 24 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 25 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 26 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 27 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 28 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 29 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 30 | * 31 | * \asf_license_stop 32 | * 33 | */ 34 | /* 35 | * Support and FAQ: visit Microchip Support 36 | */ 37 | 38 | #ifndef _UDI_HID_GENERIC_CONF_H_ 39 | #define _UDI_HID_GENERIC_CONF_H_ 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \addtogroup udi_hid_generic_group_single_desc 47 | * @{ 48 | */ 49 | 50 | //! Control endpoint size 51 | #ifdef USB_DEVICE_HS_SUPPORT 52 | # define USB_DEVICE_EP_CTRL_SIZE 64 53 | #else 54 | # define USB_DEVICE_EP_CTRL_SIZE 8 55 | #endif 56 | 57 | //! Endpoint number used by HID generic interface 58 | #define UDI_HID_GENERIC_EP_OUT (2 | USB_EP_DIR_OUT) 59 | #define UDI_HID_GENERIC_EP_IN (1 | USB_EP_DIR_IN) 60 | 61 | //! Interface number 62 | #define UDI_HID_GENERIC_IFACE_NUMBER 0 63 | 64 | 65 | /** 66 | * \name UDD Configuration 67 | */ 68 | //@{ 69 | //! 2 endpoints used by HID generic standard interface 70 | #undef USB_DEVICE_MAX_EP // undefine this definition in header file 71 | #define USB_DEVICE_MAX_EP 2 72 | //@} 73 | 74 | //@} 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #include "udi_hid_generic.h" 81 | 82 | #endif // _UDI_HID_GENERIC_CONF_H_ 83 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/services/usb/class/hid/device/udi_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief USB Device Human Interface Device (HID) interface definitions. 5 | * 6 | * Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef _UDI_HID_H_ 38 | #define _UDI_HID_H_ 39 | 40 | #include "conf_usb.h" 41 | #include "usb_protocol.h" 42 | #include "usb_protocol_hid.h" 43 | #include "udd.h" 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \ingroup udi_group 51 | * \defgroup udi_hid_group USB Device Interface (UDI) for Human Interface Device (HID) 52 | * 53 | * Common library for all Human Interface Device (HID) implementation. 54 | * 55 | * @{ 56 | */ 57 | 58 | /** 59 | * \brief Decode HID setup request 60 | * 61 | * \param rate Pointer on rate of current HID interface 62 | * \param protocol Pointer on protocol of current HID interface 63 | * \param report_desc Pointer on report descriptor of current HID interface 64 | * \param set_report Pointer on set_report callback of current HID interface 65 | * 66 | * \return \c 1 if function was successfully done, otherwise \c 0. 67 | */ 68 | bool udi_hid_setup( uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool (*setup_report)(void) ); 69 | 70 | //@} 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #endif // _UDI_HID_H_ 76 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/common/utils/interrupt/interrupt_sam_nvic.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Global interrupt management for SAM D20, SAM3 and SAM4 (NVIC based) 5 | * 6 | * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #include "interrupt_sam_nvic.h" 38 | 39 | #if !defined(__DOXYGEN__) 40 | /* Deprecated - global flag to determine the global interrupt state. Required by 41 | * QTouch library, however new applications should use cpu_irq_is_enabled() 42 | * which probes the true global interrupt state from the CPU special registers. 43 | */ 44 | volatile bool g_interrupt_enabled = true; 45 | #endif 46 | 47 | void cpu_irq_enter_critical(void) 48 | { 49 | if (cpu_irq_critical_section_counter == 0) { 50 | if (cpu_irq_is_enabled()) { 51 | cpu_irq_disable(); 52 | cpu_irq_prev_interrupt_state = true; 53 | } else { 54 | /* Make sure the to save the prev state as false */ 55 | cpu_irq_prev_interrupt_state = false; 56 | } 57 | 58 | } 59 | 60 | cpu_irq_critical_section_counter++; 61 | } 62 | 63 | void cpu_irq_leave_critical(void) 64 | { 65 | /* Check if the user is trying to leave a critical section when not in a critical section */ 66 | Assert(cpu_irq_critical_section_counter > 0); 67 | 68 | cpu_irq_critical_section_counter--; 69 | 70 | /* Only enable global interrupts when the counter reaches 0 and the state of the global interrupt flag 71 | was enabled when entering critical state */ 72 | if ((cpu_irq_critical_section_counter == 0) && (cpu_irq_prev_interrupt_state)) { 73 | cpu_irq_enable(); 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/boards/samg55_xplained_pro/led.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SAMG55-XPLAINED-PRO LEDs support package. 5 | * 6 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef LED_H_INCLUDED 38 | #define LED_H_INCLUDED 39 | 40 | #include "compiler.h" 41 | #include "ioport.h" 42 | 43 | /** 44 | * \brief Turns off the specified LEDs. 45 | * 46 | * \param led LED to turn off (LEDx_GPIO). 47 | * 48 | * \note The pins of the specified LEDs are set to GPIO output mode. 49 | */ 50 | #define LED_Off(led) ioport_set_pin_level(led##_GPIO, led##_INACTIVE_LEVEL) 51 | 52 | /** 53 | * \brief Turns on the specified LEDs. 54 | * 55 | * \param led LED to turn on (LEDx_GPIO). 56 | * 57 | * \note The pins of the specified LEDs are set to GPIO output mode. 58 | */ 59 | #define LED_On(led) ioport_set_pin_level(led##_GPIO, led##_ACTIVE_LEVEL) 60 | 61 | /** 62 | * \brief Toggles the specified LEDs. 63 | * 64 | * \param led LED to toggle (LEDx_GPIO). 65 | * 66 | * \note The pins of the specified LEDs are set to GPIO output mode. 67 | */ 68 | #define LED_Toggle(led) ioport_toggle_pin_level(led##_GPIO) 69 | 70 | 71 | #endif // LED_H_INCLUDED 72 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/drivers/pdc/pdc_uart_example/pdc_uart_example.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SAM Peripheral DMA Controller Example. 5 | * 6 | * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | /* 44 | * Support and FAQ: visit Atmel Support 45 | */ 46 | 47 | #ifndef PDC_UART_EXAMPLE_H_INCLUDED 48 | #define PDC_UART_EXAMPLE_H_INCLUDED 49 | 50 | /** 51 | * \page asfdoc_sam_drivers_pdc_example Peripheral DMA Controller Example 52 | * 53 | * \section asfdoc_sam_drivers_pdc_example_purpose Purpose 54 | * 55 | * The pdc_uart example demonstrates how to use PDC driver to receive/send 56 | * data from/to the UART. 57 | * 58 | * \section asfdoc_sam_drivers_pdc_example_requirements Requirements 59 | * 60 | * This example can be used on any SAM3/4 boards. 61 | * 62 | * \section asfdoc_sam_drivers_pdc_example_description Description 63 | * 64 | * The SAM controller waits for BUFFER_SIZE data to receive from the UART. 65 | * As soon as the expected amount of data is received, the whole buffer is 66 | * sent back to the terminal. 67 | * 68 | * \section asfdoc_sam_drivers_pdc_example_usage Usage 69 | * 70 | * -# Build the program and download it into the evaluation board. 71 | * -# On the computer, open, and configure a terminal application 72 | * (e.g., HyperTerminal on Microsoft® Windows®) with these settings: 73 | * - 115200 baud 74 | * - 8 bits of data 75 | * - No parity 76 | * - 1 stop bit 77 | * - No flow control 78 | * -# In the terminal window, the following text should appear (values depend 79 | * on the board and chip used): 80 | \verbatim 81 | -- PDC Uart Example xxx -- 82 | -- xxxxxx-xx 83 | -- Compiled: xxx xx xxxx xx:xx:xx -- 84 | \endverbatim 85 | * -# The sent text should appear. 86 | */ 87 | 88 | #endif /* PDC_UART_EXAMPLE_H_INCLUDED */ 89 | 90 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/drivers/pio/pio_handler.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Parallel Input/Output (PIO) interrupt handler for SAM. 5 | * 6 | * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | /* 44 | * Support and FAQ: visit Atmel Support 45 | */ 46 | 47 | #ifndef PIO_HANDLER_H_INCLUDED 48 | #define PIO_HANDLER_H_INCLUDED 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | void pio_handler_process(Pio *p_pio, uint32_t ul_id); 55 | void pio_handler_set_priority(Pio *p_pio, IRQn_Type ul_irqn, uint32_t ul_priority); 56 | uint32_t pio_handler_set(Pio *p_pio, uint32_t ul_id, uint32_t ul_mask, 57 | uint32_t ul_attr, void (*p_handler) (uint32_t, uint32_t)); 58 | uint32_t pio_handler_set_pin(uint32_t ul_pin, uint32_t ul_flag, 59 | void (*p_handler) (uint32_t, uint32_t)); 60 | 61 | #if (SAM3S || SAM4S || SAM4E) 62 | void pio_capture_handler_set(void (*p_handler)(Pio *)); 63 | #endif 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* PIO_HANDLER_H_INCLUDED */ 70 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/drivers/rtt/rtt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Real-time Timer (RTT) driver for SAM. 5 | * 6 | * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef RTT_H_INCLUDED 38 | #define RTT_H_INCLUDED 39 | 40 | #include "compiler.h" 41 | 42 | /// @cond 0 43 | /**INDENT-OFF**/ 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | /**INDENT-ON**/ 48 | /// @endcond 49 | 50 | uint32_t rtt_init(Rtt *p_rtt, uint16_t us_prescaler); 51 | #if (SAM4N || SAM4S || SAM4E || SAM4C || SAMG || SAM4CP || SAM4CM || SAMV71 || SAMV70 || SAME70 || SAMS70) 52 | void rtt_sel_source(Rtt *p_rtt, bool is_rtc_sel); 53 | void rtt_enable(Rtt *p_rtt); 54 | void rtt_disable(Rtt *p_rtt); 55 | #endif 56 | void rtt_enable_interrupt(Rtt *p_rtt, uint32_t ul_sources); 57 | void rtt_disable_interrupt(Rtt *p_rtt, uint32_t ul_sources); 58 | uint32_t rtt_read_timer_value(Rtt *p_rtt); 59 | uint32_t rtt_get_status(Rtt *p_rtt); 60 | uint32_t rtt_write_alarm_time(Rtt *p_rtt, uint32_t ul_alarm_time); 61 | 62 | /// @cond 0 63 | /**INDENT-OFF**/ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | /**INDENT-ON**/ 68 | /// @endcond 69 | 70 | #endif /* RTT_H_INCLUDED */ 71 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/component/gpbr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_GPBR_COMPONENT_ 36 | #define _SAMG55_GPBR_COMPONENT_ 37 | 38 | /* ============================================================================= */ 39 | /** SOFTWARE API DEFINITION FOR General Purpose Backup Registers */ 40 | /* ============================================================================= */ 41 | /** \addtogroup SAMG55_GPBR General Purpose Backup Registers */ 42 | /*@{*/ 43 | 44 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 45 | /** \brief Gpbr hardware registers */ 46 | typedef struct { 47 | __IO uint32_t SYS_GPBR[8]; /**< \brief (Gpbr Offset: 0x0) General Purpose Backup Register */ 48 | } Gpbr; 49 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 50 | /* -------- SYS_GPBR[8] : (GPBR Offset: 0x0) General Purpose Backup Register -------- */ 51 | #define SYS_GPBR_GPBR_VALUE_Pos 0 52 | #define SYS_GPBR_GPBR_VALUE_Msk (0xffffffffu << SYS_GPBR_GPBR_VALUE_Pos) /**< \brief (SYS_GPBR[8]) Value of GPBR x */ 53 | #define SYS_GPBR_GPBR_VALUE(value) ((SYS_GPBR_GPBR_VALUE_Msk & ((value) << SYS_GPBR_GPBR_VALUE_Pos))) 54 | 55 | /*@}*/ 56 | 57 | 58 | #endif /* _SAMG55_GPBR_COMPONENT_ */ 59 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/chipid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_CHIPID_INSTANCE_ 36 | #define _SAMG55_CHIPID_INSTANCE_ 37 | 38 | /* ========== Register definition for CHIPID peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_CHIPID_CIDR (0x400E0740U) /**< \brief (CHIPID) Chip ID Register */ 41 | #define REG_CHIPID_EXID (0x400E0744U) /**< \brief (CHIPID) Chip ID Extension Register */ 42 | #else 43 | #define REG_CHIPID_CIDR (*(__I uint32_t*)0x400E0740U) /**< \brief (CHIPID) Chip ID Register */ 44 | #define REG_CHIPID_EXID (*(__I uint32_t*)0x400E0744U) /**< \brief (CHIPID) Chip ID Extension Register */ 45 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 46 | 47 | #endif /* _SAMG55_CHIPID_INSTANCE_ */ 48 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/efc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_EFC_INSTANCE_ 36 | #define _SAMG55_EFC_INSTANCE_ 37 | 38 | /* ========== Register definition for EFC peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_EFC_FMR (0x400E0A00U) /**< \brief (EFC) EEFC Flash Mode Register */ 41 | #define REG_EFC_FCR (0x400E0A04U) /**< \brief (EFC) EEFC Flash Command Register */ 42 | #define REG_EFC_FSR (0x400E0A08U) /**< \brief (EFC) EEFC Flash Status Register */ 43 | #define REG_EFC_FRR (0x400E0A0CU) /**< \brief (EFC) EEFC Flash Result Register */ 44 | #define REG_EFC_WPMR (0x400E0AE4U) /**< \brief (EFC) Write Protection Mode Register */ 45 | #else 46 | #define REG_EFC_FMR (*(__IO uint32_t*)0x400E0A00U) /**< \brief (EFC) EEFC Flash Mode Register */ 47 | #define REG_EFC_FCR (*(__O uint32_t*)0x400E0A04U) /**< \brief (EFC) EEFC Flash Command Register */ 48 | #define REG_EFC_FSR (*(__I uint32_t*)0x400E0A08U) /**< \brief (EFC) EEFC Flash Status Register */ 49 | #define REG_EFC_FRR (*(__I uint32_t*)0x400E0A0CU) /**< \brief (EFC) EEFC Flash Result Register */ 50 | #define REG_EFC_WPMR (*(__IO uint32_t*)0x400E0AE4U) /**< \brief (EFC) Write Protection Mode Register */ 51 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 52 | 53 | #endif /* _SAMG55_EFC_INSTANCE_ */ 54 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom0.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM0_INSTANCE_ 36 | #define _SAMG55_FLEXCOM0_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM0 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM0_MR (0x4000C000U) /**< \brief (FLEXCOM0) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM0_RHR (0x4000C010U) /**< \brief (FLEXCOM0) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM0_THR (0x4000C020U) /**< \brief (FLEXCOM0) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM0_MR (*(__IO uint32_t*)0x4000C000U) /**< \brief (FLEXCOM0) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM0_RHR (*(__I uint32_t*)0x4000C010U) /**< \brief (FLEXCOM0) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM0_THR (*(__IO uint32_t*)0x4000C020U) /**< \brief (FLEXCOM0) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM0_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM1_INSTANCE_ 36 | #define _SAMG55_FLEXCOM1_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM1 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM1_MR (0x40020000U) /**< \brief (FLEXCOM1) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM1_RHR (0x40020010U) /**< \brief (FLEXCOM1) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM1_THR (0x40020020U) /**< \brief (FLEXCOM1) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM1_MR (*(__IO uint32_t*)0x40020000U) /**< \brief (FLEXCOM1) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM1_RHR (*(__I uint32_t*)0x40020010U) /**< \brief (FLEXCOM1) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM1_THR (*(__IO uint32_t*)0x40020020U) /**< \brief (FLEXCOM1) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM1_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM2_INSTANCE_ 36 | #define _SAMG55_FLEXCOM2_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM2 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM2_MR (0x40024000U) /**< \brief (FLEXCOM2) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM2_RHR (0x40024010U) /**< \brief (FLEXCOM2) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM2_THR (0x40024020U) /**< \brief (FLEXCOM2) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM2_MR (*(__IO uint32_t*)0x40024000U) /**< \brief (FLEXCOM2) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM2_RHR (*(__I uint32_t*)0x40024010U) /**< \brief (FLEXCOM2) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM2_THR (*(__IO uint32_t*)0x40024020U) /**< \brief (FLEXCOM2) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM2_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom3.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM3_INSTANCE_ 36 | #define _SAMG55_FLEXCOM3_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM3 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM3_MR (0x40018000U) /**< \brief (FLEXCOM3) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM3_RHR (0x40018010U) /**< \brief (FLEXCOM3) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM3_THR (0x40018020U) /**< \brief (FLEXCOM3) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM3_MR (*(__IO uint32_t*)0x40018000U) /**< \brief (FLEXCOM3) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM3_RHR (*(__I uint32_t*)0x40018010U) /**< \brief (FLEXCOM3) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM3_THR (*(__IO uint32_t*)0x40018020U) /**< \brief (FLEXCOM3) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM3_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM4_INSTANCE_ 36 | #define _SAMG55_FLEXCOM4_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM4 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM4_MR (0x4001C000U) /**< \brief (FLEXCOM4) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM4_RHR (0x4001C010U) /**< \brief (FLEXCOM4) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM4_THR (0x4001C020U) /**< \brief (FLEXCOM4) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM4_MR (*(__IO uint32_t*)0x4001C000U) /**< \brief (FLEXCOM4) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM4_RHR (*(__I uint32_t*)0x4001C010U) /**< \brief (FLEXCOM4) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM4_THR (*(__IO uint32_t*)0x4001C020U) /**< \brief (FLEXCOM4) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM4_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom5.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM5_INSTANCE_ 36 | #define _SAMG55_FLEXCOM5_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM5 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM5_MR (0x40008000U) /**< \brief (FLEXCOM5) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM5_RHR (0x40008010U) /**< \brief (FLEXCOM5) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM5_THR (0x40008020U) /**< \brief (FLEXCOM5) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM5_MR (*(__IO uint32_t*)0x40008000U) /**< \brief (FLEXCOM5) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM5_RHR (*(__I uint32_t*)0x40008010U) /**< \brief (FLEXCOM5) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM5_THR (*(__IO uint32_t*)0x40008020U) /**< \brief (FLEXCOM5) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM5_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM6_INSTANCE_ 36 | #define _SAMG55_FLEXCOM6_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM6 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM6_MR (0x40040000U) /**< \brief (FLEXCOM6) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM6_RHR (0x40040010U) /**< \brief (FLEXCOM6) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM6_THR (0x40040020U) /**< \brief (FLEXCOM6) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM6_MR (*(__IO uint32_t*)0x40040000U) /**< \brief (FLEXCOM6) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM6_RHR (*(__I uint32_t*)0x40040010U) /**< \brief (FLEXCOM6) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM6_THR (*(__IO uint32_t*)0x40040020U) /**< \brief (FLEXCOM6) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM6_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/flexcom7.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_FLEXCOM7_INSTANCE_ 36 | #define _SAMG55_FLEXCOM7_INSTANCE_ 37 | 38 | /* ========== Register definition for FLEXCOM7 peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_FLEXCOM7_MR (0x40034000U) /**< \brief (FLEXCOM7) FLEXCOM Mode register */ 41 | #define REG_FLEXCOM7_RHR (0x40034010U) /**< \brief (FLEXCOM7) FLEXCOM Receive Holding Register */ 42 | #define REG_FLEXCOM7_THR (0x40034020U) /**< \brief (FLEXCOM7) FLEXCOM Transmit Holding Register */ 43 | #else 44 | #define REG_FLEXCOM7_MR (*(__IO uint32_t*)0x40034000U) /**< \brief (FLEXCOM7) FLEXCOM Mode register */ 45 | #define REG_FLEXCOM7_RHR (*(__I uint32_t*)0x40034010U) /**< \brief (FLEXCOM7) FLEXCOM Receive Holding Register */ 46 | #define REG_FLEXCOM7_THR (*(__IO uint32_t*)0x40034020U) /**< \brief (FLEXCOM7) FLEXCOM Transmit Holding Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_FLEXCOM7_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/gpbr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_GPBR_INSTANCE_ 36 | #define _SAMG55_GPBR_INSTANCE_ 37 | 38 | /* ========== Register definition for GPBR peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_GPBR_GPBR (0x400E1490U) /**< \brief (GPBR) General Purpose Backup Register */ 41 | #else 42 | #define REG_GPBR_GPBR (*(__IO uint32_t*)0x400E1490U) /**< \brief (GPBR) General Purpose Backup Register */ 43 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 44 | 45 | #endif /* _SAMG55_GPBR_INSTANCE_ */ 46 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/rstc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_RSTC_INSTANCE_ 36 | #define _SAMG55_RSTC_INSTANCE_ 37 | 38 | /* ========== Register definition for RSTC peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_RSTC_CR (0x400E1400U) /**< \brief (RSTC) Control Register */ 41 | #define REG_RSTC_SR (0x400E1404U) /**< \brief (RSTC) Status Register */ 42 | #define REG_RSTC_MR (0x400E1408U) /**< \brief (RSTC) Mode Register */ 43 | #else 44 | #define REG_RSTC_CR (*(__O uint32_t*)0x400E1400U) /**< \brief (RSTC) Control Register */ 45 | #define REG_RSTC_SR (*(__I uint32_t*)0x400E1404U) /**< \brief (RSTC) Status Register */ 46 | #define REG_RSTC_MR (*(__IO uint32_t*)0x400E1408U) /**< \brief (RSTC) Mode Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_RSTC_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/rtt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_RTT_INSTANCE_ 36 | #define _SAMG55_RTT_INSTANCE_ 37 | 38 | /* ========== Register definition for RTT peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_RTT_MR (0x400E1430U) /**< \brief (RTT) Mode Register */ 41 | #define REG_RTT_AR (0x400E1434U) /**< \brief (RTT) Alarm Register */ 42 | #define REG_RTT_VR (0x400E1438U) /**< \brief (RTT) Value Register */ 43 | #define REG_RTT_SR (0x400E143CU) /**< \brief (RTT) Status Register */ 44 | #define REG_RTT_MODR (0x400E1440U) /**< \brief (RTT) Modulo Selection Register */ 45 | #else 46 | #define REG_RTT_MR (*(__IO uint32_t*)0x400E1430U) /**< \brief (RTT) Mode Register */ 47 | #define REG_RTT_AR (*(__IO uint32_t*)0x400E1434U) /**< \brief (RTT) Alarm Register */ 48 | #define REG_RTT_VR (*(__I uint32_t*)0x400E1438U) /**< \brief (RTT) Value Register */ 49 | #define REG_RTT_SR (*(__I uint32_t*)0x400E143CU) /**< \brief (RTT) Status Register */ 50 | #define REG_RTT_MODR (*(__IO uint32_t*)0x400E1440U) /**< \brief (RTT) Modulo Selection Register */ 51 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 52 | 53 | #endif /* _SAMG55_RTT_INSTANCE_ */ 54 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/supc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_SUPC_INSTANCE_ 36 | #define _SAMG55_SUPC_INSTANCE_ 37 | 38 | /* ========== Register definition for SUPC peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_SUPC_CR (0x400E1410U) /**< \brief (SUPC) Supply Controller Control Register */ 41 | #define REG_SUPC_SMMR (0x400E1414U) /**< \brief (SUPC) Supply Controller Supply Monitor Mode Register */ 42 | #define REG_SUPC_MR (0x400E1418U) /**< \brief (SUPC) Supply Controller Mode Register */ 43 | #define REG_SUPC_WUMR (0x400E141CU) /**< \brief (SUPC) Supply Controller Wake-up Mode Register */ 44 | #define REG_SUPC_WUIR (0x400E1420U) /**< \brief (SUPC) Supply Controller Wake-up Inputs Register */ 45 | #define REG_SUPC_SR (0x400E1424U) /**< \brief (SUPC) Supply Controller Status Register */ 46 | #define REG_SUPC_PWMR (0x400E142CU) /**< \brief (SUPC) Supply Controller Power Mode Register */ 47 | #else 48 | #define REG_SUPC_CR (*(__O uint32_t*)0x400E1410U) /**< \brief (SUPC) Supply Controller Control Register */ 49 | #define REG_SUPC_SMMR (*(__IO uint32_t*)0x400E1414U) /**< \brief (SUPC) Supply Controller Supply Monitor Mode Register */ 50 | #define REG_SUPC_MR (*(__IO uint32_t*)0x400E1418U) /**< \brief (SUPC) Supply Controller Mode Register */ 51 | #define REG_SUPC_WUMR (*(__IO uint32_t*)0x400E141CU) /**< \brief (SUPC) Supply Controller Wake-up Mode Register */ 52 | #define REG_SUPC_WUIR (*(__IO uint32_t*)0x400E1420U) /**< \brief (SUPC) Supply Controller Wake-up Inputs Register */ 53 | #define REG_SUPC_SR (*(__I uint32_t*)0x400E1424U) /**< \brief (SUPC) Supply Controller Status Register */ 54 | #define REG_SUPC_PWMR (*(__IO uint32_t*)0x400E142CU) /**< \brief (SUPC) Supply Controller Power Mode Register */ 55 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 56 | 57 | #endif /* _SAMG55_SUPC_INSTANCE_ */ 58 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/instance/wdt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef _SAMG55_WDT_INSTANCE_ 36 | #define _SAMG55_WDT_INSTANCE_ 37 | 38 | /* ========== Register definition for WDT peripheral ========== */ 39 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 40 | #define REG_WDT_CR (0x400E1450U) /**< \brief (WDT) Control Register */ 41 | #define REG_WDT_MR (0x400E1454U) /**< \brief (WDT) Mode Register */ 42 | #define REG_WDT_SR (0x400E1458U) /**< \brief (WDT) Status Register */ 43 | #else 44 | #define REG_WDT_CR (*(__O uint32_t*)0x400E1450U) /**< \brief (WDT) Control Register */ 45 | #define REG_WDT_MR (*(__IO uint32_t*)0x400E1454U) /**< \brief (WDT) Mode Register */ 46 | #define REG_WDT_SR (*(__I uint32_t*)0x400E1458U) /**< \brief (WDT) Status Register */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | #endif /* _SAMG55_WDT_INSTANCE_ */ 50 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/samg55.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | #ifndef _SAMG55_ 35 | #define _SAMG55_ 36 | 37 | #if defined (__SAMG55G18__) 38 | #include "samg55g18.h" 39 | #elif defined (__SAMG55G19__) 40 | #include "samg55g19.h" 41 | #elif defined (__SAMG55J18__) 42 | #include "samg55j18.h" 43 | #elif defined (__SAMG55J19__) 44 | #include "samg55j19.h" 45 | #elif defined (__SAMG55N19__) 46 | #include "samg55n19.h" 47 | #else 48 | #error Library does not support the specified device. 49 | #endif 50 | 51 | #endif /* _SAMG55_ */ 52 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/cmsis/samg/samg55/include/system_samg55.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 5 | * 6 | * \asf_license_start 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip 11 | * software and any derivatives exclusively with Microchip products. 12 | * It is your responsibility to comply with third party license terms applicable 13 | * to your use of third party software (including open source software) that 14 | * may accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 17 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 18 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 19 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 20 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 21 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 22 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 23 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 24 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 25 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 26 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 27 | * 28 | * \asf_license_stop 29 | * 30 | */ 31 | /* 32 | * Support and FAQ: visit Microchip Support 33 | */ 34 | 35 | #ifndef SYSTEM_SAMG55_H_INCLUDED 36 | #define SYSTEM_SAMG55_H_INCLUDED 37 | 38 | /* @cond 0 */ 39 | /**INDENT-OFF**/ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | /**INDENT-ON**/ 44 | /* @endcond */ 45 | 46 | #include 47 | 48 | extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */ 49 | 50 | /** 51 | * @brief Setup the microcontroller system. 52 | * Initialize the System and update the SystemCoreClock variable. 53 | */ 54 | void SystemInit(void); 55 | 56 | /** 57 | * @brief Updates the SystemCoreClock with current core Clock 58 | * retrieved from cpu registers. 59 | */ 60 | void SystemCoreClockUpdate(void); 61 | 62 | /** 63 | * Initialize flash. 64 | */ 65 | void system_init_flash(uint32_t dw_clk); 66 | 67 | /* @cond 0 */ 68 | /**INDENT-OFF**/ 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | /**INDENT-ON**/ 73 | /* @endcond */ 74 | 75 | #endif /* SYSTEM_SAMG55_H_INCLUDED */ 76 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/fpu/fpu.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief FPU support for SAM. 5 | * 6 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef _FPU_H_INCLUDED_ 38 | #define _FPU_H_INCLUDED_ 39 | 40 | #include 41 | 42 | /** Address for ARM CPACR */ 43 | #define ADDR_CPACR 0xE000ED88 44 | 45 | /** CPACR Register */ 46 | #define REG_CPACR (*((volatile uint32_t *)ADDR_CPACR)) 47 | 48 | /** 49 | * \brief Enable FPU 50 | */ 51 | __always_inline static void fpu_enable(void) 52 | { 53 | irqflags_t flags; 54 | flags = cpu_irq_save(); 55 | REG_CPACR |= (0xFu << 20); 56 | __DSB(); 57 | __ISB(); 58 | cpu_irq_restore(flags); 59 | } 60 | 61 | /** 62 | * \brief Disable FPU 63 | */ 64 | __always_inline static void fpu_disable(void) 65 | { 66 | irqflags_t flags; 67 | flags = cpu_irq_save(); 68 | REG_CPACR &= ~(0xFu << 20); 69 | __DSB(); 70 | __ISB(); 71 | cpu_irq_restore(flags); 72 | } 73 | 74 | /** 75 | * \brief Check if FPU is enabled 76 | * 77 | * \return Return ture if FPU is enabled, otherwise return false. 78 | */ 79 | __always_inline static bool fpu_is_enabled(void) 80 | { 81 | return (REG_CPACR & (0xFu << 20)); 82 | } 83 | 84 | #endif /* _FPU_H_INCLUDED_ */ 85 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/preprocessor/preprocessor.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Preprocessor utils. 5 | * 6 | * Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef _PREPROCESSOR_H_ 38 | #define _PREPROCESSOR_H_ 39 | 40 | #include "tpaste.h" 41 | #include "stringz.h" 42 | #include "mrepeat.h" 43 | 44 | 45 | #endif // _PREPROCESSOR_H_ 46 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/preprocessor/stringz.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Preprocessor stringizing utils. 5 | * 6 | * Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef _STRINGZ_H_ 38 | #define _STRINGZ_H_ 39 | 40 | /** 41 | * \defgroup group_sam_utils_stringz Preprocessor - Stringize 42 | * 43 | * \ingroup group_sam_utils 44 | * 45 | * \{ 46 | */ 47 | 48 | /*! \brief Stringize. 49 | * 50 | * Stringize a preprocessing token, this token being allowed to be \#defined. 51 | * 52 | * May be used only within macros with the token passed as an argument if the token is \#defined. 53 | * 54 | * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) 55 | * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to 56 | * writing "A0". 57 | */ 58 | #define STRINGZ(x) #x 59 | 60 | /*! \brief Absolute stringize. 61 | * 62 | * Stringize a preprocessing token, this token being allowed to be \#defined. 63 | * 64 | * No restriction of use if the token is \#defined. 65 | * 66 | * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is 67 | * equivalent to writing "A0". 68 | */ 69 | #define ASTRINGZ(x) STRINGZ(x) 70 | 71 | /** 72 | * \} 73 | */ 74 | 75 | #endif // _STRINGZ_H_ 76 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/sam/utils/syscalls/gcc/syscalls.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Syscalls for SAM (GCC). 5 | * 6 | * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | /// @cond 0 43 | /**INDENT-OFF**/ 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | /**INDENT-ON**/ 48 | /// @endcond 49 | 50 | #undef errno 51 | extern int errno; 52 | extern int _end; 53 | extern int __ram_end__; 54 | 55 | extern caddr_t _sbrk(int incr); 56 | extern int link(char *old, char *new); 57 | extern int _close(int file); 58 | extern int _fstat(int file, struct stat *st); 59 | extern int _isatty(int file); 60 | extern int _lseek(int file, int ptr, int dir); 61 | extern void _exit(int status); 62 | extern void _kill(int pid, int sig); 63 | extern int _getpid(void); 64 | 65 | extern caddr_t _sbrk(int incr) 66 | { 67 | static unsigned char *heap = NULL; 68 | unsigned char *prev_heap; 69 | int ramend = (int)&__ram_end__; 70 | 71 | if (heap == NULL) { 72 | heap = (unsigned char *)&_end; 73 | } 74 | prev_heap = heap; 75 | 76 | if (((int)prev_heap + incr) > ramend) { 77 | return (caddr_t) -1; 78 | } 79 | 80 | heap += incr; 81 | 82 | return (caddr_t) prev_heap; 83 | } 84 | 85 | extern int link(char *old, char *new) 86 | { 87 | return -1; 88 | } 89 | 90 | extern int _close(int file) 91 | { 92 | return -1; 93 | } 94 | 95 | extern int _fstat(int file, struct stat *st) 96 | { 97 | st->st_mode = S_IFCHR; 98 | 99 | return 0; 100 | } 101 | 102 | extern int _isatty(int file) 103 | { 104 | return 1; 105 | } 106 | 107 | extern int _lseek(int file, int ptr, int dir) 108 | { 109 | return 0; 110 | } 111 | 112 | extern void _exit(int status) 113 | { 114 | asm("BKPT #0"); 115 | for (;;); 116 | } 117 | 118 | extern void _kill(int pid, int sig) 119 | { 120 | return; 121 | } 122 | 123 | extern int _getpid(void) 124 | { 125 | return -1; 126 | } 127 | 128 | /// @cond 0 129 | /**INDENT-OFF**/ 130 | #ifdef __cplusplus 131 | } 132 | #endif 133 | /**INDENT-ON**/ 134 | /// @endcond 135 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/ATMEL-disclaimer.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Only the CMSIS required parts for ASF are included here, go to the below 3 | * address for the full package: 4 | * http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php 5 | * 6 | * The library file thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math_softfp.a was generated by ATMEL, which 7 | * is support -mfloat-abi=softfp compiler flag, and this is also the default selection for device that 8 | * have FPU module and enabled. 9 | * If customer want to use -mfloat-abi=hard compiler flag, the project compile/link flag and link library 10 | * should be manual modified. The library thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a is used for 11 | * -mfloat-abi=hard configration. 12 | * 13 | * __CORTEX_SC is not defined for cortex-m0+, and may cause compiler warning, so the include file 14 | * thirdparty/CMSIS/Include/core_cmInstr.h was modified to void such warning. 15 | * Modified from: 16 | * #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300) 17 | * to: 18 | * #if (__CORTEX_M >= 0x03) || ((defined(__CORTEX_SC)) && (__CORTEX_SC >= 300)) 19 | * 20 | */ 21 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/aws-iot-zero-touch-secure-provisioning-kit/af71d071a7b034dcebec555529439484026d460b/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/aws-iot-zero-touch-secure-provisioning-kit/af71d071a7b034dcebec555529439484026d460b/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math_softfp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrochipTech/aws-iot-zero-touch-secure-provisioning-kit/af71d071a7b034dcebec555529439484026d460b/firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math_softfp.a -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/Lib/license.txt: -------------------------------------------------------------------------------- 1 | All pre-build libraries contained in the folders "ARM" and "GCC" 2 | are guided by the following license: 3 | 4 | Copyright (C) 2009-2014 ARM Limited. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | - Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | - Neither the name of ARM nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/CMSIS/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011-2014 ARM Limited. All rights reserved. 3 | * 4 | * Date: 17 February 2014 5 | * Revision: V4.00 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS_END_USER_LICENCE_AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Libraries. 34 | 35 | RTOS - CMSIS RTOS API template header file. 36 | 37 | Driver - CMSIS Peripheral Driver Interface. 38 | 39 | Pack - CMSIS Software Packs. 40 | Mechanism to install software, device support, APIs, and example projects. 41 | 42 | SVD - CMSIS SVD Schema files and Conversion Utility. 43 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/freertos/freertos-8.0.1/Source/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the three sample 7 | memory allocators as described on the http://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler. 11 | 12 | 13 | 14 | For example, if you are interested in the GCC port for the ATMega323 15 | microcontroller then the port specific files are contained in 16 | FreeRTOS/Source/Portable/GCC/ATMega323 directory. If this is the only 17 | port you are interested in then all the other directories can be 18 | ignored. 19 | 20 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/freertos/freertos-8.0.1/Source/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ASF/thirdparty/freertos/freertos-8.0.1/readme.txt: -------------------------------------------------------------------------------- 1 | Directories: 2 | 3 | + The FreeRTOS/Source directory contains the FreeRTOS source code, and contains 4 | its own readme file. 5 | 6 | + The FreeRTOS/Demo directory contains a demo application for every official 7 | FreeRTOS port, and contains its own readme file. 8 | 9 | + See http://www.freertos.org/a00017.html for full details of the directory 10 | structure and information on locating the files you require. 11 | 12 | The easiest way to use FreeRTOS is to start with one of the pre-configured demo 13 | application projects (found in the FreeRTOS/Demo directory). That way you will 14 | have the correct FreeRTOS source files included, and the correct include paths 15 | configured. Once a demo application is building and executing you can remove 16 | the demo application file, and start to add in your own application source 17 | files. 18 | 19 | See also - 20 | http://www.freertos.org/FreeRTOS-quick-start-guide.html 21 | http://www.freertos.org/FAQHelp.html 22 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/aws_status.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief AWS status functions 4 | * 5 | * \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #include 29 | 30 | #include "aws_status.h" 31 | 32 | // Global variables 33 | static struct aws_iot_status g_aws_iot_status; 34 | 35 | /** 36 | * \brief Clears the global AWS IoT status information 37 | */ 38 | void aws_iot_clear_status(void) 39 | { 40 | g_aws_iot_status.aws_state = AWS_STATE_UNKNOWN; 41 | g_aws_iot_status.aws_status = AWS_STATUS_SUCCESS; 42 | 43 | memset(&g_aws_iot_status.aws_message[0], 0, sizeof(g_aws_iot_status.aws_message)); 44 | } 45 | 46 | /** 47 | * \brief Gets the global AWS IoT status information 48 | * 49 | * \note Do not free the pointer returned from this function 50 | */ 51 | struct aws_iot_status * aws_iot_get_status(void) 52 | { 53 | return &g_aws_iot_status; 54 | } 55 | 56 | /** 57 | * \brief Sets the global AWS IoT status information 58 | * 59 | * param[in] state The AWS IoT error state 60 | * param[in] status The AWS IoT error status 61 | * param[in] message The AWS IoT error message 62 | */ 63 | void aws_iot_set_status(uint32_t state, uint32_t status, const char *message) 64 | { 65 | g_aws_iot_status.aws_state = state; 66 | g_aws_iot_status.aws_status = status; 67 | 68 | memset(&g_aws_iot_status.aws_message[0], 0, 69 | sizeof(g_aws_iot_status.aws_message)); 70 | strncpy(&g_aws_iot_status.aws_message[0], &message[0], 71 | sizeof(g_aws_iot_status.aws_message)); 72 | } 73 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/aws_wifi_task.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief AWS WIFI FreeRTOS Task Functions 4 | * 5 | * \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef AWS_WIFI_TASK_H 29 | #define AWS_WIFI_TASK_H 30 | 31 | #include 32 | 33 | #include "aws_status.h" 34 | #include "bsp/include/nm_bsp.h" 35 | #include "oled1.h" 36 | #include "socket/include/socket.h" 37 | 38 | enum wifi_status 39 | { 40 | WIFI_STATUS_UNKNOWN = 0, 41 | WIFI_STATUS_MESSAGE_RECEIVED = 1, 42 | WIFI_STATUS_MESSAGE_SENT = 2, 43 | WIFI_STATUS_TIMEOUT = 3, 44 | WIFI_STATUS_ERROR = 4 45 | }; 46 | 47 | struct socket_connection 48 | { 49 | SOCKET socket; 50 | uint32 address; 51 | uint16 port; 52 | }; 53 | 54 | void aws_wifi_set_state(enum aws_iot_state state); 55 | enum aws_iot_state aws_wifi_get_state(void); 56 | 57 | int aws_wifi_read_data(uint8_t *read_buffer, uint32_t read_length, 58 | uint32_t timeout_ms); 59 | int aws_wifi_send_data(uint8_t *send_buffer, uint32_t send_length, 60 | uint32_t timeout_ms); 61 | 62 | void aws_wifi_publish_shadow_update_message(struct demo_button_state state); 63 | 64 | void aws_wifi_task(void *params); 65 | 66 | #endif // AWS_WIFI_TASK_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/cert_def_1_signer.h: -------------------------------------------------------------------------------- 1 | #ifndef CERT_DEF_1_SIGNER_H 2 | #define CERT_DEF_1_SIGNER_H 3 | 4 | #include "atcacert/atcacert_def.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | extern uint8_t g_signer_1_ca_public_key[]; 11 | extern const atcacert_def_t g_cert_def_1_signer; 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif // CERT_DEF_1_SIGNER_H 18 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/cert_def_2_device.h: -------------------------------------------------------------------------------- 1 | #ifndef CERT_DEF_2_DEVICE_H 2 | #define CERT_DEF_2_DEVICE_H 3 | 4 | #include "atcacert/atcacert_def.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | extern const atcacert_def_t g_cert_def_2_device; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif // CERT_DEF_2_DEVICE_H 17 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/cert_def_3_device_csr.h: -------------------------------------------------------------------------------- 1 | #ifndef CERT_DEF_3_DEVICE_CSR_H 2 | #define CERT_DEF_3_DEVICE_CSR_H 3 | 4 | #include "atcacert/atcacert_def.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | extern const atcacert_def_t g_csr_def_3_device; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif // CERT_DEF_3_DEVICE_CSR_H 17 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/config/conf_board.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SAMG55 Xplained Pro board configuration 5 | * 6 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | 34 | #ifndef CONF_BOARD_H_INCLUDED 35 | #define CONF_BOARD_H_INCLUDED 36 | 37 | #define CONF_BOARD_UART_CONSOLE 38 | 39 | /** Configure SPI5 pins */ 40 | #define CONF_BOARD_SPI 41 | #define CONF_BOARD_SPI_NPCS0 42 | 43 | #define BOARD_FLEXCOM_SPI FLEXCOM5 44 | 45 | 46 | /** Definition of TWI interrupt ID on board. */ 47 | #define BOARD_TWI_IRQn TWI4_IRQn 48 | #define BOARD_TWI_Handler TWI4_Handler 49 | 50 | /** Configure TWI4 pins */ 51 | #define CONF_BOARD_TWI4 52 | 53 | #define BOARD_FLEXCOM_TWI FLEXCOM4 54 | 55 | #endif /* CONF_BOARD_H_INCLUDED */ 56 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/config/conf_sleepmgr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Chip-specific sleep manager configuration 5 | * 6 | * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | #ifndef CONF_SLEEPMGR_H 37 | #define CONF_SLEEPMGR_H 38 | 39 | // Sleep manager options 40 | #define CONFIG_SLEEPMGR_ENABLE 41 | 42 | #endif /* CONF_SLEEPMGR_H */ 43 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/config/conf_spi_master.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Spi Master configuration. 5 | * 6 | * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef CONF_SPI_MASTER_H_INCLUDED 38 | #define CONF_SPI_MASTER_H_INCLUDED 39 | 40 | /* Possibility to change low-level configurations here */ 41 | 42 | //! Default Config Spi Master Delay BCS 43 | #define CONFIG_SPI_MASTER_DELAY_BCS 0 44 | 45 | //! Default Config Spi Master Bits per Transfer Definition 46 | #define CONFIG_SPI_MASTER_BITS_PER_TRANSFER 8 47 | 48 | //! Default Config Spi Master Delay BCT 49 | #define CONFIG_SPI_MASTER_DELAY_BCT 0 50 | 51 | //! Default Config Spi Master Delay BS 52 | #define CONFIG_SPI_MASTER_DELAY_BS 0 53 | 54 | //! Default Config Spi Master Dummy Field 55 | #define CONFIG_SPI_MASTER_DUMMY 0xFF 56 | 57 | #endif /* CONF_SPI_MASTER_H_INCLUDED */ 58 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/config/conf_ssd1306.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SSD1306 display controller driver configuration file. 5 | * 6 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | #ifndef CONF_SSD1306_H_INCLUDED 37 | #define CONF_SSD1306_H_INCLUDED 38 | 39 | #include 40 | 41 | #if (BOARD == XMEGA_C3_XPLAINED) || (BOARD == XMEGA_E5_XPLAINED) 42 | // Interface configuration for XMEGA-C3 Xplained 43 | 44 | # define SSD1306_USART_SPI_INTERFACE 45 | # define SSD1306_USART_SPI UG_2832HSWEG04_SPI 46 | 47 | # define SSD1306_DC_PIN UG_2832HSWEG04_DATA_CMD 48 | # define SSD1306_RES_PIN UG_2832HSWEG04_RESET 49 | # define SSD1306_CS_PIN UG_2832HSWEG04_SS 50 | 51 | #else 52 | // Interface configuration for other boards 53 | 54 | // Interface possibilities: 55 | // 1) Regular SPI interface 56 | // #define SSD1306_SPI_INTERFACE 57 | // #define SSD1306_SPI &SPID 58 | 59 | // 2) USART SPI interface 60 | // #define SSD1306_USART_SPI_INTERFACE 61 | // #define SSD1306_USART_SPI &USARTD0 62 | 63 | // Pin mapping: 64 | // - Register select 65 | // #define SSD1306_DC_PIN 0 66 | // - Chip select 67 | // #define SSD1306_CS_PIN 1 68 | // - Reset 69 | // #define SSD1306_RES_PIN 2 70 | 71 | 72 | // Placeholder setup 73 | 74 | # define SSD1306_SPI_INTERFACE 75 | # define SSD1306_SPI SPI5 76 | 77 | # define SSD1306_DC_PIN UG_2832HSWEG04_DATA_CMD_GPIO 78 | # define SSD1306_CS_PIN UG_2832HSWEG04_SS 79 | # define SSD1306_RES_PIN UG_2832HSWEG04_RESET_GPIO 80 | #endif // BOARD 81 | 82 | // Board independent configuration 83 | 84 | // Minimum clock period is 50ns@3.3V -> max frequency is 20MHz 85 | #define SSD1306_CLOCK_SPEED UG_2832HSWEG04_BAUDRATE 86 | #define SSD1306_DISPLAY_CONTRAST_MAX 40 87 | #define SSD1306_DISPLAY_CONTRAST_MIN 30 88 | 89 | #endif /* CONF_SSD1306_H_INCLUDED */ 90 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/config/conf_uart_serial.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Serial USART service configuration. 5 | * 6 | * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Subject to your compliance with these terms, you may use Microchip 13 | * software and any derivatives exclusively with Microchip products. 14 | * It is your responsibility to comply with third party license terms applicable 15 | * to your use of third party software (including open source software) that 16 | * may accompany Microchip software. 17 | * 18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, 19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, 20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, 21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE 22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL 23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE 24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE 25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT 26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY 27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, 28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. 29 | * 30 | * \asf_license_stop 31 | * 32 | */ 33 | /* 34 | * Support and FAQ: visit Microchip Support 35 | */ 36 | 37 | #ifndef CONF_USART_SERIAL_H 38 | #define CONF_USART_SERIAL_H 39 | 40 | /* A reference setting for UART */ 41 | /** UART Interface */ 42 | #define CONF_UART CONSOLE_UART 43 | /** Baudrate setting */ 44 | #define CONF_UART_BAUDRATE 115200 45 | /** Parity setting */ 46 | //#define CONF_UART_PARITY UART_MR_PAR_NO 47 | 48 | 49 | /* A reference setting for USART */ 50 | /** USART Interface */ 51 | //#define CONF_UART USART1 52 | /** Baudrate setting */ 53 | //#define CONF_UART_BAUDRATE 115200 54 | /** Character length setting */ 55 | #define CONF_UART_CHAR_LENGTH US_MR_CHRL_8_BIT 56 | /** Parity setting */ 57 | #define CONF_UART_PARITY US_MR_PAR_NO 58 | /** Stop bits setting */ 59 | #define CONF_UART_STOP_BITS US_MR_NBSTOP_1_BIT 60 | 61 | #endif/* CONF_USART_SERIAL_H_INCLUDED */ 62 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/console.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Console UART Functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef CONSOLE_H 29 | #define CONSOLE_H 30 | 31 | #include 32 | 33 | #include "aws_status.h" 34 | #include "FreeRTOS.h" 35 | #include "semphr.h" 36 | 37 | // Extern 38 | extern SemaphoreHandle_t g_console_mutex; //! FreeRTOS console mutex 39 | 40 | 41 | void console_init(void); 42 | 43 | void console_print_message(const char *message); 44 | void console_print_success_message(const char *message); 45 | void console_print_error_message(const char *message); 46 | void console_print_warning_message(const char *message); 47 | 48 | void console_print_hex_dump(const void *buffer, size_t length); 49 | 50 | void console_print_aws_message(const char *message, const void *buffer, size_t length); 51 | void console_print_aws_status(const char *message, const struct aws_iot_status *status); 52 | void console_print_kit_protocol_message(const char *message, const void *buffer, size_t length); 53 | 54 | void console_print_winc_version(void); 55 | void console_print_version(void); 56 | 57 | #endif // CONSOLE_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/ecc_configure.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Functions to detect which devices are attached to the host MCU and 4 | * pre-configure their corresponding crypto device. 5 | * 6 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 7 | * 8 | * \page License 9 | * 10 | * Subject to your compliance with these terms, you may use Microchip software 11 | * and any derivatives exclusively with Microchip products. It is your 12 | * responsibility to comply with third party license terms applicable to your 13 | * use of third party software (including open source software) that may 14 | * accompany Microchip software. 15 | * 16 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 17 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 18 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 19 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 20 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 21 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 22 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 23 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 24 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 25 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 26 | * THIS SOFTWARE. 27 | */ 28 | 29 | 30 | #ifndef ECC_CONFIGURE_H 31 | #define ECC_CONFIGURE_H 32 | 33 | 34 | #include "provisioning_task.h" 35 | 36 | 37 | #define DEV_UNCONF 0 38 | #define DEV_INVALID 1 39 | #define DEV_CRYPTO 2 40 | 41 | // Byte offsets for configuration settings 42 | #define SLOTCONFIG_OFFSET 20 43 | #define KEYCONFIG_OFFSET 96 44 | 45 | // ! Mutable device description object 46 | extern ATCAIfaceCfg g_crypto_device; 47 | 48 | // Function Prototypes 49 | ATCA_STATUS preconfigure_crypto_device(void); 50 | ATCA_STATUS detect_crypto_device(void); 51 | bool check_config_compatibility(void); 52 | 53 | 54 | #endif /* ECC_CONFIGURE_H */ -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/kit_protocol/kit_protocol_api.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Kit Protocol API Interface 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef KIT_PROTOCOL_API_H 29 | #define KIT_PROTOCOL_API_H 30 | 31 | #include 32 | #include 33 | 34 | #include "kit_protocol_status.h" 35 | 36 | // Set the packing alignment for the structure members 37 | #pragma pack(push, 1) 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif // __cplusplus 42 | 43 | #define KIT_LAYER_DELIMITER ':' 44 | #define KIT_DATA_BEGIN_DELIMITER '(' 45 | #define KIT_DATA_END_DELIMITER ')' 46 | #define KIT_MESSAGE_DELIMITER '\n' 47 | 48 | /** 49 | * \brief The Kit Protocol maximum message size. 50 | * \note 51 | * Send: :(optional hex bytes to send)\n 52 | * Receive: (optional hex bytes of response)\n 53 | */ 54 | #ifdef KIT_PROTOCOL_MESSAGE_MAX 55 | #define KIT_MESSAGE_SIZE_MAX KIT_PROTOCOL_MESSAGE_MAX 56 | #else 57 | #define KIT_MESSAGE_SIZE_MAX (64) 58 | #endif // KIT_PROTOCOL_MESSAGE_MAX 59 | 60 | #define KIT_SECTION_NAME_SIZE_MAX KIT_MESSAGE_SIZE_MAX //! The maximum message section size 61 | 62 | #define KIT_VERSION_SIZE_MAX (32) //! The maximum Kit Protocol version size 63 | #define KIT_FIRMWARE_SIZE_MAX (32) //! The maximum Kit Protocol firmware size 64 | 65 | 66 | enum kit_device_id 67 | { 68 | KIT_DEVICE_ID_UNKNOWN = 0x00, 69 | KIT_DEVICE_ID_ATAES132 = 0x01, 70 | KIT_DEVICE_ID_ATSHA204 = 0x02, 71 | KIT_DEVICE_ID_ATSHA204A = 0x03, 72 | KIT_DEVICE_ID_ATECC108 = 0x04, 73 | KIT_DEVICE_ID_ATECC108A = 0x05, 74 | KIT_DEVICE_ID_ATECC508A = 0x06, 75 | KIT_DEVICE_ID_ATECC608A = 0x07 76 | }; 77 | 78 | enum kit_device_protocol 79 | { 80 | KIT_DEVICE_TWI = 0x00, 81 | KIT_DEVICE_SWI = 0x01, 82 | KIT_DEVICE_SPI = 0x02 83 | }; 84 | 85 | struct kit_device { 86 | enum kit_device_id device_id; 87 | enum kit_device_protocol protocol; 88 | uint8_t address; 89 | }; 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif // __cplusplus 94 | 95 | // unset the packing alignment for the structure members 96 | #pragma pack(pop) 97 | 98 | #endif // KIT_PROTOCOL_API_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/kit_protocol/kit_protocol_status.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Kit Protocol Status Interface and Functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #include 29 | 30 | #include "kit_protocol_status.h" 31 | 32 | static struct kit_protocol_error g_kit_error; 33 | 34 | 35 | void kit_clear_last_error(void) 36 | { 37 | g_kit_error.kit_error_program = 0; 38 | g_kit_error.kit_error_location = 0; 39 | g_kit_error.kit_error_status = 0; 40 | 41 | memset(&g_kit_error.kit_error_message[0], 0, sizeof(g_kit_error.kit_error_message)); 42 | } 43 | 44 | struct kit_protocol_error * kit_get_last_error(void) 45 | { 46 | return &g_kit_error; 47 | } 48 | 49 | void kit_set_last_error(uint32_t program, uint32_t location, 50 | uint32_t status, char *message) 51 | { 52 | g_kit_error.kit_error_program = program; 53 | g_kit_error.kit_error_location = location; 54 | g_kit_error.kit_error_status = status; 55 | 56 | memset(&g_kit_error.kit_error_message[0], 0, sizeof(g_kit_error.kit_error_message)); 57 | strncpy(&g_kit_error.kit_error_message[0], &message[0], sizeof(g_kit_error.kit_error_message)); 58 | } -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/kit_protocol/kit_protocol_status.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Kit Protocol Status Interface and Functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef KIT_PROTOCOL_STATUS_H 29 | #define KIT_PROTOCOL_STATUS_H 30 | 31 | #include 32 | 33 | // Set the packing alignment for the structure members 34 | #pragma pack(push, 1) 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif // __cplusplus 39 | 40 | 41 | #define KIT_ERROR_MESSAGE_SIZE (64) 42 | 43 | 44 | enum kit_protocol_program { 45 | KIT_PROGRAM_API = 0x00, 46 | KIT_PROGRAM_INTERPRETER = 0x01 47 | }; 48 | 49 | enum kit_protocol_location { 50 | KIT_LOCATION_API_PARSE = 0x00, 51 | KIT_LOCATION_API_SERIALIZE = 0x01, 52 | KIT_LOCATION_INTERPRETER_PARSE = 0x10, 53 | KIT_LOCATION_INTERPRETER_SERIALIZE = 0x11, 54 | }; 55 | 56 | enum kit_protocol_status { 57 | KIT_STATUS_SUCCESS = 0x00, 58 | KIT_STATUS_FAILURE = 0x01, 59 | KIT_STATUS_COMMAND_NOT_VALID = 0x03, 60 | KIT_STATUS_COMMAND_NOT_SUPPORTED = 0x04, 61 | KIT_STATUS_INVALID_PARAM = 0xE2, 62 | KIT_STATUS_INVALID_ID = 0xE3, 63 | KIT_STATUS_INVALID_SIZE = 0xE4, 64 | KIT_STATUS_COMM_FAIL = 0xF0 65 | }; 66 | 67 | struct kit_protocol_error { 68 | uint32_t kit_error_program; 69 | uint32_t kit_error_location; 70 | uint32_t kit_error_status; 71 | char kit_error_message[KIT_ERROR_MESSAGE_SIZE]; 72 | }; 73 | 74 | void kit_clear_last_error(void); 75 | 76 | struct kit_protocol_error * kit_get_last_error(void); 77 | void kit_set_last_error(uint32_t program, uint32_t location, 78 | uint32_t status, char *message); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif // __cplusplus 83 | 84 | // unset the packing alignment for the structure members 85 | #pragma pack(pop) 86 | 87 | #endif // KIT_PROTOCOL_STATUS_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/led.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief LED functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #include "asf.h" 29 | #include "led.h" 30 | 31 | /** 32 | * \brief Initializes the processing LED. 33 | */ 34 | void led_init(void) 35 | { 36 | // Set the pin direction of the processing LED 37 | ioport_set_pin_dir(LED_0_PIN, IOPORT_DIR_OUTPUT); 38 | 39 | // Set the state of the processing LED to off 40 | led_set_processing_state(PROCESSING_LED_OFF); 41 | } 42 | 43 | /** 44 | * \brief Flashes the processing LED. 45 | * 46 | * \param[in] flashes The number of flashes 47 | */ 48 | void led_flash_processing_led(uint8_t flashes) 49 | { 50 | for (uint8_t index = 0; index < flashes; index++) 51 | { 52 | led_set_processing_state(PROCESSING_LED_ON); 53 | delay_ms(500); 54 | led_set_processing_state(PROCESSING_LED_OFF); 55 | delay_ms(500); 56 | } 57 | } 58 | 59 | /** 60 | * \brief Sets the state of the processing LED. 61 | * 62 | * \note Processing LED States: 63 | * PROCESSING_LED_ON - Turns the processing LED on 64 | * PROCESSING_LED_OFF - Turns the processing LED off 65 | * PROCESSING_LED_TOGGLE - Toggles the current state 66 | * 67 | * \param[in] state The processing LED state 68 | */ 69 | void led_set_processing_state(enum processing_led_state state) 70 | { 71 | switch(state) 72 | { 73 | case PROCESSING_LED_ON: 74 | ioport_set_pin_level(LED_0_PIN, LED_0_ACTIVE); 75 | break; 76 | 77 | case PROCESSING_LED_OFF: 78 | ioport_set_pin_level(LED_0_PIN, LED_0_INACTIVE); 79 | break; 80 | 81 | case PROCESSING_LED_TOGGLE: 82 | ioport_toggle_pin_level(LED_0_PIN); 83 | break; 84 | 85 | default: 86 | ioport_set_pin_level(LED_0_PIN, LED_0_INACTIVE); 87 | break; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/led.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief LED functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef LED_H 29 | #define LED_H 30 | 31 | enum processing_led_state 32 | { 33 | PROCESSING_LED_ON = 0, 34 | PROCESSING_LED_OFF = 1, 35 | PROCESSING_LED_TOGGLE = 2 36 | }; 37 | 38 | void led_init(void); 39 | 40 | void led_flash_processing_led(uint8_t flashes); 41 | 42 | void led_set_processing_state(enum processing_led_state state); 43 | 44 | #endif // LED_H 45 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/oled1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief OLED1 functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef OLED1_H 29 | #define OLED1_H 30 | 31 | #include 32 | #include 33 | 34 | #include "asf.h" 35 | 36 | // Set the packing alignment for the structure members 37 | #pragma pack(push, 1) 38 | 39 | // Defines 40 | #define OLED1_LED1 OLED1_LED1_PIN 41 | #define OLED1_LED2 OLED1_LED2_PIN 42 | #define OLED1_LED3 OLED1_LED3_PIN 43 | 44 | enum oled1_pushbutton_id 45 | { 46 | OLED1_PUSHBUTTON_ID_UNKNOWN = 0, 47 | OLED1_PUSHBUTTON_ID_1 = 1, 48 | OLED1_PUSHBUTTON_ID_2 = 2, 49 | OLED1_PUSHBUTTON_ID_3 = 3 50 | }; 51 | 52 | enum oled1_led_state 53 | { 54 | OLED1_LED_ON = 0, 55 | OLED1_LED_OFF = 1, 56 | OLED1_LED_TOGGLE = 2 57 | }; 58 | 59 | // Extern 60 | enum oled1_pushbutton_id g_selected_pushbutton; 61 | 62 | struct demo_button_state 63 | { 64 | uint8_t button_1; 65 | uint8_t button_2; 66 | uint8_t button_3; 67 | }; 68 | 69 | void oled1_init(void); 70 | 71 | void oled1_led_set_state(ioport_pin_t pin, enum oled1_led_state state); 72 | bool oled1_led_is_active(ioport_pin_t pin); 73 | 74 | // Unset the packing alignment for the structure members 75 | #pragma pack(pop) 76 | 77 | #endif // OLED1_H 78 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTFormat.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #if !defined(MQTTFORMAT_H) 18 | #define MQTTFORMAT_H 19 | 20 | #include "StackTrace.h" 21 | #include "MQTTPacket.h" 22 | 23 | const char* MQTTPacket_getName(unsigned short packetid); 24 | int MQTTStringFormat_connect(char* strbuf, int strbuflen, MQTTPacket_connectData* data); 25 | int MQTTStringFormat_connack(char* strbuf, int strbuflen, unsigned char connack_rc, unsigned char sessionPresent); 26 | int MQTTStringFormat_publish(char* strbuf, int strbuflen, unsigned char dup, int qos, unsigned char retained, 27 | unsigned short packetid, MQTTString topicName, unsigned char* payload, int payloadlen); 28 | int MQTTStringFormat_ack(char* strbuf, int strbuflen, unsigned char packettype, unsigned char dup, unsigned short packetid); 29 | int MQTTStringFormat_subscribe(char* strbuf, int strbuflen, unsigned char dup, unsigned short packetid, int count, 30 | MQTTString topicFilters[], int requestedQoSs[]); 31 | int MQTTStringFormat_suback(char* strbuf, int strbuflen, unsigned short packetid, int count, int* grantedQoSs); 32 | int MQTTStringFormat_unsubscribe(char* strbuf, int strbuflen, unsigned char dup, unsigned short packetid, 33 | int count, MQTTString topicFilters[]); 34 | char* MQTTFormat_toClientString(char* strbuf, int strbuflen, unsigned char* buf, int buflen); 35 | char* MQTTFormat_toServerString(char* strbuf, int strbuflen, unsigned char* buf, int buflen); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTMessage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | 16 | /** 17 | * @file MQTTMessage.h 18 | * @brief Definition of Messages for the MQTT Client 19 | */ 20 | 21 | #ifndef __MQTT_MESSAGE_H 22 | #define __MQTT_MESSAGE_H 23 | 24 | /* Enum order should match the packet ids array defined in MQTTFormat.c */ 25 | typedef enum msgTypes { 26 | UNKNOWN = -1, 27 | CONNECT = 1, 28 | CONNACK = 2, 29 | PUBLISH = 3, 30 | PUBACK = 4, 31 | PUBREC = 5, 32 | PUBREL = 6, 33 | PUBCOMP = 7, 34 | SUBSCRIBE = 8, 35 | SUBACK = 9, 36 | UNSUBSCRIBE = 10, 37 | UNSUBACK = 11, 38 | PINGREQ = 12, 39 | PINGRESP = 13, 40 | DISCONNECT = 14 41 | }MessageTypes; 42 | 43 | typedef enum QoS { 44 | QOS0 = 0, 45 | QOS1 = 1, 46 | QOS2 = 2 47 | }QoS; 48 | 49 | typedef struct { 50 | QoS qos; 51 | uint8_t retained; 52 | uint8_t dup; 53 | uint16_t id; 54 | void *payload; 55 | size_t payloadlen; 56 | }MQTTMessage; 57 | 58 | #endif //__MQTT_MESSAGE_H 59 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTPublish.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Xiang Rong - 442039 Add makefile to Embedded C client 16 | *******************************************************************************/ 17 | 18 | #ifndef MQTTPUBLISH_H_ 19 | #define MQTTPUBLISH_H_ 20 | 21 | #if !defined(DLLImport) 22 | #define DLLImport 23 | #endif 24 | #if !defined(DLLExport) 25 | #define DLLExport 26 | #endif 27 | 28 | DLLExport int MQTTSerialize_publish(unsigned char* buf, int buflen, unsigned char dup, int qos, unsigned char retained, unsigned short packetid, 29 | MQTTString topicName, unsigned char* payload, int payloadlen); 30 | 31 | DLLExport int MQTTDeserialize_publish(unsigned char* dup, int* qos, unsigned char* retained, unsigned short* packetid, MQTTString* topicName, 32 | unsigned char** payload, int* payloadlen, unsigned char* buf, int len); 33 | 34 | DLLExport int MQTTSerialize_puback(unsigned char* buf, int buflen, unsigned short packetid); 35 | DLLExport int MQTTSerialize_pubrel(unsigned char* buf, int buflen, unsigned char dup, unsigned short packetid); 36 | DLLExport int MQTTSerialize_pubcomp(unsigned char* buf, int buflen, unsigned short packetid); 37 | 38 | #endif /* MQTTPUBLISH_H_ */ 39 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTReturnCodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). 5 | * You may not use this file except in compliance with the License. 6 | * A copy of the License is located at 7 | * 8 | * http://aws.amazon.com/apache2.0 9 | * 10 | * or in the "license" file accompanying this file. This file is distributed 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 | * express or implied. See the License for the specific language governing 13 | * permissions and limitations under the License. 14 | */ 15 | 16 | /** 17 | * @file MQTTErrorCodes.h 18 | * @brief Definition of error types for the MQTT Client 19 | */ 20 | 21 | #ifndef __MQTT_ERRORCODES_H 22 | #define __MQTT_ERRORCODES_H 23 | 24 | /* all failure return codes must be negative */ 25 | typedef enum { 26 | MQTT_NETWORK_MANUALLY_DISCONNECTED = 5, 27 | MQTT_CONNACK_CONNECTION_ACCEPTED = 4, 28 | MQTT_ATTEMPTING_RECONNECT = 3, 29 | MQTT_NOTHING_TO_READ = 2, 30 | MQTT_NETWORK_RECONNECTED = 1, 31 | SUCCESS = 0, 32 | FAILURE = -1, 33 | BUFFER_OVERFLOW = -2, 34 | MQTT_UNKNOWN_ERROR = -3, 35 | MQTT_NETWORK_DISCONNECTED_ERROR = -4, 36 | MQTT_NETWORK_ALREADY_CONNECTED_ERROR = -5, 37 | MQTT_NULL_VALUE_ERROR = -6, 38 | MQTT_MAX_SUBSCRIPTIONS_REACHED_ERROR = -7, 39 | MQTT_RECONNECT_TIMED_OUT = -8, 40 | MQTTPACKET_BUFFER_TOO_SHORT = -9, 41 | MQTTPACKET_READ_ERROR = -10, 42 | MQTTPACKET_READ_COMPLETE = -11, 43 | MQTT_CONNACK_UNKNOWN_ERROR = -12, 44 | MQTT_CONANCK_UNACCEPTABLE_PROTOCOL_VERSION_ERROR = -13, 45 | MQTT_CONNACK_IDENTIFIER_REJECTED_ERROR = -14, 46 | MQTT_CONNACK_SERVER_UNAVAILABLE_ERROR = -15, 47 | MQTT_CONNACK_BAD_USERDATA_ERROR = -16, 48 | MQTT_CONNACK_NOT_AUTHORIZED_ERROR = -17, 49 | MQTT_BUFFER_RX_MESSAGE_INVALID = -18 50 | }MQTTReturnCode; 51 | 52 | #endif //__MQTT_ERRORCODES_H 53 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTSubscribe.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Xiang Rong - 442039 Add makefile to Embedded C client 16 | *******************************************************************************/ 17 | 18 | #ifndef MQTTSUBSCRIBE_H_ 19 | #define MQTTSUBSCRIBE_H_ 20 | 21 | #if !defined(DLLImport) 22 | #define DLLImport 23 | #endif 24 | #if !defined(DLLExport) 25 | #define DLLExport 26 | #endif 27 | 28 | DLLExport int MQTTSerialize_subscribe(unsigned char* buf, int buflen, unsigned char dup, unsigned short packetid, 29 | int count, MQTTString topicFilters[], int requestedQoSs[]); 30 | 31 | DLLExport int MQTTDeserialize_subscribe(unsigned char* dup, unsigned short* packetid, 32 | int maxcount, int* count, MQTTString topicFilters[], int requestedQoSs[], unsigned char* buf, int len); 33 | 34 | DLLExport int MQTTSerialize_suback(unsigned char* buf, int buflen, unsigned short packetid, int count, int* grantedQoSs); 35 | 36 | DLLExport int MQTTDeserialize_suback(unsigned short* packetid, int maxcount, int* count, int grantedQoSs[], unsigned char* buf, int len); 37 | 38 | 39 | #endif /* MQTTSUBSCRIBE_H_ */ 40 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTUnsubscribe.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Xiang Rong - 442039 Add makefile to Embedded C client 16 | *******************************************************************************/ 17 | 18 | #ifndef MQTTUNSUBSCRIBE_H_ 19 | #define MQTTUNSUBSCRIBE_H_ 20 | 21 | #if !defined(DLLImport) 22 | #define DLLImport 23 | #endif 24 | #if !defined(DLLExport) 25 | #define DLLExport 26 | #endif 27 | 28 | DLLExport int MQTTSerialize_unsubscribe(unsigned char* buf, int buflen, unsigned char dup, unsigned short packetid, 29 | int count, MQTTString topicFilters[]); 30 | 31 | DLLExport int MQTTDeserialize_unsubscribe(unsigned char* dup, unsigned short* packetid, int max_count, int* count, MQTTString topicFilters[], 32 | unsigned char* buf, int len); 33 | 34 | DLLExport int MQTTSerialize_unsuback(unsigned char* buf, int buflen, unsigned short packetid); 35 | 36 | DLLExport int MQTTDeserialize_unsuback(unsigned short* packetid, unsigned char* buf, int len); 37 | 38 | #endif /* MQTTUNSUBSCRIBE_H_ */ 39 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/MQTTUnsubscribeServer.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | *******************************************************************************/ 16 | 17 | #include "MQTTPacket.h" 18 | #include "StackTrace.h" 19 | 20 | #include 21 | 22 | 23 | /** 24 | * Deserializes the supplied (wire) buffer into unsubscribe data 25 | * @param dup integer returned - the MQTT dup flag 26 | * @param packetid integer returned - the MQTT packet identifier 27 | * @param maxcount - the maximum number of members allowed in the topicFilters and requestedQoSs arrays 28 | * @param count - number of members in the topicFilters and requestedQoSs arrays 29 | * @param topicFilters - array of topic filter names 30 | * @param buf the raw buffer data, of the correct length determined by the remaining length field 31 | * @param buflen the length in bytes of the data in the supplied buffer 32 | * @return the length of the serialized data. <= 0 indicates error 33 | */ 34 | int MQTTDeserialize_unsubscribe(unsigned char* dup, unsigned short* packetid, int maxcount, int* count, MQTTString topicFilters[], 35 | unsigned char* buf, int len) 36 | { 37 | MQTTHeader header = {0}; 38 | unsigned char* curdata = buf; 39 | unsigned char* enddata = NULL; 40 | int rc = 0; 41 | int mylen = 0; 42 | 43 | FUNC_ENTRY; 44 | header.byte = readChar(&curdata); 45 | if (header.bits.type != UNSUBSCRIBE) 46 | goto exit; 47 | *dup = header.bits.dup; 48 | 49 | curdata += (rc = MQTTPacket_decodeBuf(curdata, &mylen)); /* read remaining length */ 50 | enddata = curdata + mylen; 51 | 52 | *packetid = readInt(&curdata); 53 | 54 | *count = 0; 55 | while (curdata < enddata) 56 | { 57 | if (!readMQTTLenString(&topicFilters[*count], &curdata, enddata)) 58 | goto exit; 59 | (*count)++; 60 | } 61 | 62 | rc = 1; 63 | exit: 64 | FUNC_EXIT_RC(rc); 65 | return rc; 66 | } 67 | 68 | 69 | /** 70 | * Serializes the supplied unsuback data into the supplied buffer, ready for sending 71 | * @param buf the buffer into which the packet will be serialized 72 | * @param buflen the length in bytes of the supplied buffer 73 | * @param packetid integer - the MQTT packet identifier 74 | * @return the length of the serialized data. <= 0 indicates error 75 | */ 76 | int MQTTSerialize_unsuback(unsigned char* buf, int buflen, unsigned short packetid) 77 | { 78 | MQTTHeader header = {0}; 79 | int rc = 0; 80 | unsigned char *ptr = buf; 81 | 82 | FUNC_ENTRY; 83 | if (buflen < 2) 84 | { 85 | rc = MQTTPACKET_BUFFER_TOO_SHORT; 86 | goto exit; 87 | } 88 | header.byte = 0; 89 | header.bits.type = UNSUBACK; 90 | writeChar(&ptr, header.byte); /* write header */ 91 | 92 | ptr += MQTTPacket_encode(ptr, 2); /* write remaining length */ 93 | 94 | writeInt(&ptr, packetid); 95 | 96 | rc = ptr - buf; 97 | exit: 98 | FUNC_EXIT_RC(rc); 99 | return rc; 100 | } 101 | 102 | 103 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/MQTTPacket/StackTrace.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2014 IBM Corp. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. 7 | * 8 | * The Eclipse Public License is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | * and the Eclipse Distribution License is available at 11 | * http://www.eclipse.org/org/documents/edl-v10.php. 12 | * 13 | * Contributors: 14 | * Ian Craggs - initial API and implementation and/or initial documentation 15 | * Ian Craggs - fix for bug #434081 16 | *******************************************************************************/ 17 | 18 | #ifndef STACKTRACE_H_ 19 | #define STACKTRACE_H_ 20 | 21 | #include 22 | #define NOSTACKTRACE 1 23 | 24 | #if defined(NOSTACKTRACE) 25 | #define FUNC_ENTRY 26 | #define FUNC_ENTRY_NOLOG 27 | #define FUNC_ENTRY_MED 28 | #define FUNC_ENTRY_MAX 29 | #define FUNC_EXIT 30 | #define FUNC_EXIT_NOLOG 31 | #define FUNC_EXIT_MED 32 | #define FUNC_EXIT_MAX 33 | #define FUNC_EXIT_RC(x) 34 | #define FUNC_EXIT_MED_RC(x) 35 | #define FUNC_EXIT_MAX_RC(x) 36 | 37 | #else 38 | 39 | #if defined(WIN32) 40 | #define inline __inline 41 | #define FUNC_ENTRY StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MINIMUM) 42 | #define FUNC_ENTRY_NOLOG StackTrace_entry(__FUNCTION__, __LINE__, -1) 43 | #define FUNC_ENTRY_MED StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MEDIUM) 44 | #define FUNC_ENTRY_MAX StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MAXIMUM) 45 | #define FUNC_EXIT StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MINIMUM) 46 | #define FUNC_EXIT_NOLOG StackTrace_exit(__FUNCTION__, __LINE__, -1) 47 | #define FUNC_EXIT_MED StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MEDIUM) 48 | #define FUNC_EXIT_MAX StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MAXIMUM) 49 | #define FUNC_EXIT_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MINIMUM) 50 | #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MEDIUM) 51 | #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MAXIMUM) 52 | #else 53 | #define FUNC_ENTRY StackTrace_entry(__func__, __LINE__, TRACE_MINIMUM) 54 | #define FUNC_ENTRY_NOLOG StackTrace_entry(__func__, __LINE__, -1) 55 | #define FUNC_ENTRY_MED StackTrace_entry(__func__, __LINE__, TRACE_MEDIUM) 56 | #define FUNC_ENTRY_MAX StackTrace_entry(__func__, __LINE__, TRACE_MAXIMUM) 57 | #define FUNC_EXIT StackTrace_exit(__func__, __LINE__, NULL, TRACE_MINIMUM) 58 | #define FUNC_EXIT_NOLOG StackTrace_exit(__func__, __LINE__, NULL, -1) 59 | #define FUNC_EXIT_MED StackTrace_exit(__func__, __LINE__, NULL, TRACE_MEDIUM) 60 | #define FUNC_EXIT_MAX StackTrace_exit(__func__, __LINE__, NULL, TRACE_MAXIMUM) 61 | #define FUNC_EXIT_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MINIMUM) 62 | #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MEDIUM) 63 | #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MAXIMUM) 64 | 65 | void StackTrace_entry(const char* name, int line, int trace); 66 | void StackTrace_exit(const char* name, int line, void* return_value, int trace); 67 | 68 | void StackTrace_printStack(FILE* dest); 69 | char* StackTrace_get(unsigned long); 70 | 71 | #endif 72 | 73 | #endif 74 | 75 | 76 | 77 | 78 | #endif /* STACKTRACE_H_ */ 79 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/README.md: -------------------------------------------------------------------------------- 1 | # Eclipse Paho MQTT C/C++ client for Embedded platforms 2 | 3 | This repository contains the source code for the [Eclipse Paho](http://eclipse.org/paho) MQTT C/C++ client library for Embedded platorms. 4 | 5 | It is dual licensed under the EPL and EDL (see about.html and notice.html for more details). You can choose which of these licenses you want to use the code under. The EDL allows you to embed the code into your application, and distribute your application in binary or source form without contributing any of your code, or any changes you make back to Paho. See the EDL for the exact conditions. 6 | 7 | The MQTTPacket directory contains the lowest level C library with the smallest requirements. This supplies simple serialization 8 | and deserialization routines. It is mainly up to you to write and read to and from the network. 9 | 10 | The MQTTClient directory contains the next level C++ library. This still avoids most networking code so that you can plugin the 11 | network of your choice. 12 | 13 | ## Build requirements / compilation 14 | 15 | There are helper scripts (build...) in various directories. The client library is a set of building blocks which you pick and choose from, so that the smallest MQTT application can be built. 16 | 17 | ## Usage and API 18 | 19 | See the samples directory for examples of intended use. 20 | 21 | 22 | ## Runtime tracing 23 | 24 | As yet, there is no tracing. For the smallest client, should we have tracing? 25 | 26 | 27 | ## Reporting bugs 28 | 29 | This project uses GitHub Issues here: [github.com/eclipse/paho.mqtt.embedded-c/issues](https://github.com/eclipse/paho.mqtt.embedded-c/issues) to track ongoing development and issues. 30 | 31 | ## More information 32 | 33 | Discussion of the Paho clients takes place on the [Eclipse paho-dev mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev). 34 | 35 | General questions about the MQTT protocol are discussed in the [MQTT Google Group](https://groups.google.com/forum/?hl=en-US&fromgroups#!forum/mqtt). 36 | 37 | There is much more information available via the [MQTT community site](http://mqtt.org). 38 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 |

About This Content

8 | 9 |

December 9, 2013

10 |

License

11 | 12 |

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise 13 | indicated below, the Content is provided to you under the terms and conditions of the 14 | Eclipse Public License Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0 ("EDL"). 15 | A copy of the EPL is available at 16 | http://www.eclipse.org/legal/epl-v10.html 17 | and a copy of the EDL is available at 18 | http://www.eclipse.org/org/documents/edl-v10.php. 19 | For purposes of the EPL, "Program" will mean the Content.

20 | 21 |

If you did not receive this Content directly from the Eclipse Foundation, the Content is 22 | being redistributed by another party ("Redistributor") and different terms and conditions may 23 | apply to your use of any object code in the Content. Check the Redistributor's license that was 24 | provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise 25 | indicated below, the terms and conditions of the EPL still apply to any source code in the Content 26 | and such source code may be obtained at http://www.eclipse.org.

27 | 28 | 29 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/edl-v10: -------------------------------------------------------------------------------- 1 | 2 | Eclipse Distribution License - v 1.0 3 | 4 | Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. 5 | 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 12 | Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | 16 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/platform/network_interface.c: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief Platform network interface 6 | * 7 | * Copyright (c) 2014-2016 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * 4. This software may only be redistributed and used in connection with an 27 | * Atmel microcontroller product. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | * \asf_license_stop 42 | * 43 | */ 44 | 45 | #include "asf.h" 46 | #include "aws_wifi_task.h" 47 | #include "MQTTReturnCodes.h" 48 | #include "network_interface.h" 49 | 50 | /** 51 | * \brief Reads data from the WINC1500 module. 52 | * 53 | * \param network[in] The Eclipse Paho MQTT network information 54 | * \param read_buffer[in] The buffer 55 | * \param length[in] The buffer length 56 | * \param timeout_ms[in] The timeout 57 | * 58 | * \return The MQTT status 59 | */ 60 | int mqtt_packet_read(Network *network, unsigned char *read_buffer, int length, int timeout_ms) 61 | { 62 | return aws_wifi_read_data(read_buffer, length, timeout_ms); 63 | } 64 | 65 | /** 66 | * \brief Writes data to the WINC1500 module. 67 | * 68 | * \param network[in] The Eclipse Paho MQTT network information 69 | * \param send_buffer[in] The buffer 70 | * \param length[in] The buffer length 71 | * \param timeout_ms[in] The timeout 72 | * 73 | * \return The MQTT status 74 | */ 75 | int mqtt_packet_write(Network *network, unsigned char *send_buffer, int length, int timeout_ms) 76 | { 77 | return aws_wifi_send_data(send_buffer, length, timeout_ms); 78 | } 79 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/paho_mqtt_embedded_c/platform/network_interface.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \file 4 | * 5 | * \brief Platform network interface 6 | * 7 | * Copyright (c) 2014-2016 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * 4. This software may only be redistributed and used in connection with an 27 | * Atmel microcontroller product. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | * \asf_license_stop 42 | * 43 | */ 44 | 45 | #ifndef MQTT_NETWORK_INTERFACE_H 46 | #define MQTT_NETWORK_INTERFACE_H 47 | 48 | #include 49 | 50 | typedef struct mqtt_network { 51 | int (*mqttread)(struct mqtt_network *network, unsigned char *read_buffer, int length, int timeout_ms); 52 | int (*mqttwrite)(struct mqtt_network *network, unsigned char *send_buffer, int length, int timeout_ms); 53 | } Network; 54 | 55 | int mqtt_packet_read(Network *network, unsigned char *read_buffer, int length, int timeout_ms); 56 | int mqtt_packet_write(Network *network, unsigned char *send_buffer, int length, int timeout_ms); 57 | 58 | #endif // MQTT_NETWORK_INTERFACE_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/parson_json/Parson JSON License.txt: -------------------------------------------------------------------------------- 1 | Parson ( http://kgabis.github.com/parson/ ) 2 | Copyright (c) 2012 - 2015 Krzysztof Gabis 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/usb_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief USB HID functions 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef USB_HID_H 29 | #define USB_HID_H 30 | 31 | #include 32 | #include 33 | 34 | #include "kit_protocol_api.h" 35 | 36 | extern uint8_t g_usb_message_buffer[KIT_MESSAGE_SIZE_MAX]; //! The USB message buffer 37 | extern uint16_t g_usb_message_buffer_length; //! The USB message buffer length 38 | extern bool g_usb_message_received; //! Whether the USB message was received 39 | 40 | 41 | void usb_hid_init(void); 42 | 43 | bool usb_send_response_message(uint8_t *response, uint16_t response_length); 44 | 45 | bool usb_hid_enable_callback(void); 46 | void usb_hid_disable_callback(void); 47 | 48 | void usb_hid_wakeup_callback(void); 49 | 50 | void usb_hid_report_out_callback(uint8_t *report); 51 | void usb_hid_set_feature_callback(uint8_t *report); 52 | 53 | #endif // USB_HID_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/utilities/hex_dump.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief Print hex dump utility function 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef HEX_DUMP_H 29 | #define HEX_DUMP_H 30 | 31 | #include 32 | #include 33 | 34 | void print_hex_dump(const void *buffer, size_t length, bool display_address, 35 | bool display_ascii, size_t bytes_line); 36 | 37 | #endif // HEX_DUMP_H -------------------------------------------------------------------------------- /firmware/SAMG55/AWS_IoT_Zero_Touch_SAMG55/src/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * \brief AWS IoT Zero Touch Demo Version Information 4 | * 5 | * \copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries. 6 | * 7 | * \page License 8 | * 9 | * Subject to your compliance with these terms, you may use Microchip software 10 | * and any derivatives exclusively with Microchip products. It is your 11 | * responsibility to comply with third party license terms applicable to your 12 | * use of third party software (including open source software) that may 13 | * accompany Microchip software. 14 | * 15 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 16 | * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED 17 | * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A 18 | * PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, 19 | * SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE 20 | * OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF 21 | * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE 22 | * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL 23 | * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED 24 | * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR 25 | * THIS SOFTWARE. 26 | */ 27 | 28 | #ifndef VERSION_H 29 | #define VERSION_H 30 | 31 | #define MAJOR_VERSION 2 //! AWS IoT Zero Touch major version number 32 | #define API_VERSION 2 //! AWS IoT Zero Touch API version number 33 | #define PATCH_VERSION 5 //! AWS IoT Zero Touch patch version number 34 | 35 | #define STRING2(x) #x 36 | #define STRING(x) STRING2(x) 37 | 38 | //! AWS IoT Zero Touch version string (Example: "1.0.0") 39 | #define VERSION_STRING STRING(MAJOR_VERSION) "." \ 40 | STRING(API_VERSION) "." \ 41 | STRING(PATCH_VERSION) 42 | 43 | //! AWS IoT Zero Touch long version string (Example: "AWS IoT Zero Touch Demo v1.0.0") 44 | #define VERSION_STRING_LONG "AWS IoT Zero Touch Demo v" VERSION_STRING 45 | 46 | #endif // VERSION_H -------------------------------------------------------------------------------- /kit_reset.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | import hid 3 | from mchp_aws_zt_kit import MchpAwsZTKitDevice 4 | from sim_hid_device import SimMchpAwsZTHidDevice 5 | from aws_kit_common import * 6 | 7 | 8 | def kit_reset(is_sim=False): 9 | print('\nOpening AWS Zero-touch Kit Device') 10 | if not is_sim: 11 | device = MchpAwsZTKitDevice(hid.device()) 12 | else: 13 | device = MchpAwsZTKitDevice(SimMchpAwsZTHidDevice()) 14 | device.open() 15 | 16 | print('\nInitializing Kit') 17 | resp = device.init() 18 | print(' ATECCx08A SN: %s' % resp['deviceSn']) 19 | 20 | print('\nResetting Device') 21 | device.reset_kit() 22 | 23 | print('\nDone') 24 | 25 | 26 | if __name__ == '__main__': 27 | # Create argument parser to document script use 28 | parser = ArgumentParser(description='Reset the board to an unprovisioned state') 29 | parser.add_argument( 30 | '--sim', 31 | help='Use a simulated device instead.', 32 | action='store_true' 33 | ) 34 | args = parser.parse_args() 35 | 36 | try: 37 | kit_reset(is_sim=args.sim) 38 | except AWSZTKitError as e: 39 | # Print kit errors without a stack trace 40 | print(e) 41 | -------------------------------------------------------------------------------- /kit_set_wifi.py: -------------------------------------------------------------------------------- 1 | from argparse import ArgumentParser 2 | import hid 3 | from mchp_aws_zt_kit import MchpAwsZTKitDevice 4 | from sim_hid_device import SimMchpAwsZTHidDevice 5 | from aws_kit_common import * 6 | 7 | 8 | def kit_set_wifi(ssid, password, is_sim=False): 9 | print('\nOpening AWS Zero-touch Kit Device') 10 | if not is_sim: 11 | device = MchpAwsZTKitDevice(hid.device()) 12 | else: 13 | device = MchpAwsZTKitDevice(SimMchpAwsZTHidDevice()) 14 | device.open() 15 | 16 | print('\nInitializing Kit') 17 | resp = device.init() 18 | print(' ATECCx08A SN: %s' % resp['deviceSn']) 19 | 20 | print('\nSetting WiFi Information') 21 | device.set_wifi(ssid=ssid, psk=password) 22 | 23 | kit_info = read_kit_info() 24 | kit_info['wifi_ssid'] = ssid 25 | kit_info['wifi_password'] = password 26 | save_kit_info(kit_info) 27 | 28 | print('\nDone') 29 | 30 | 31 | if __name__ == '__main__': 32 | # Create argument parser to document script use 33 | parser = ArgumentParser(description='Set the WiFi connection settings on the demo board.') 34 | parser.add_argument( 35 | '--ssid', 36 | dest='ssid', 37 | required=True, 38 | metavar='name', 39 | help='WiFi network name' 40 | ) 41 | parser.add_argument( 42 | '--password', 43 | dest='password', 44 | default=None, 45 | metavar='pw', 46 | help='WiFi network password' 47 | ) 48 | parser.add_argument( 49 | '--sim', 50 | help='Use a simulated device instead.', 51 | action='store_true' 52 | ) 53 | args = parser.parse_args() 54 | 55 | try: 56 | kit_set_wifi(ssid=args.ssid, password=args.password, is_sim=args.sim) 57 | except AWSZTKitError as e: 58 | # Print kit errors without a stack trace 59 | print(e) 60 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | cryptography>=2.7 2 | boto3 3 | hidapi 4 | pyasn1_modules==0.1.5 5 | requests_aws4auth --------------------------------------------------------------------------------