├── .gitignore ├── FreeRTOS ├── include │ ├── FreeRTOS.h │ ├── FreeRTOSConfig_template.h │ ├── StackMacros.h │ ├── cmsis_os.h │ ├── croutine.h │ ├── deprecated_definitions.h │ ├── event_groups.h │ ├── list.h │ ├── mpu_prototypes.h │ ├── mpu_wrappers.h │ ├── osapi.h │ ├── portable.h │ ├── portmacro.h │ ├── projdefs.h │ ├── queue.h │ ├── semphr.h │ ├── task.h │ └── timers.h ├── library.json ├── readme.txt ├── src │ ├── cmsis_os.c │ ├── croutine.c │ ├── event_groups.c │ ├── heap_4.c │ ├── list.c │ ├── port.c │ ├── port1.c │ ├── queue.c │ ├── tasks.c │ └── timers.c └── st_readme.txt ├── GNSS ├── library.json └── rtk_api.h ├── INS ├── ins_interface_API.h ├── libINS.a └── library.json ├── LWIP ├── arch │ ├── cc.h │ ├── cpu.h │ ├── perf.h │ ├── sys_arch.c │ └── sys_arch.h ├── library.json ├── lwip-1.4.1 │ ├── CHANGELOG │ ├── COPYING │ ├── FILES │ ├── README │ ├── UPGRADING │ ├── doc │ │ ├── FILES │ │ ├── contrib.txt │ │ ├── rawapi.txt │ │ ├── savannah.txt │ │ ├── snmp_agent.txt │ │ └── sys_arch.txt │ └── src │ │ ├── FILES │ │ ├── api │ │ ├── api_lib.c │ │ ├── api_msg.c │ │ ├── err.c │ │ ├── netbuf.c │ │ ├── netdb.c │ │ ├── netifapi.c │ │ ├── sockets.c │ │ └── tcpip.c │ │ ├── core │ │ ├── def.c │ │ ├── dhcp.c │ │ ├── dns.c │ │ ├── init.c │ │ ├── ipv4 │ │ │ ├── autoip.c │ │ │ ├── icmp.c │ │ │ ├── igmp.c │ │ │ ├── inet.c │ │ │ ├── inet_chksum.c │ │ │ ├── ip.c │ │ │ ├── ip_addr.c │ │ │ └── ip_frag.c │ │ ├── mem.c │ │ ├── memp.c │ │ ├── netif.c │ │ ├── pbuf.c │ │ ├── raw.c │ │ ├── stats.c │ │ ├── sys.c │ │ ├── tcp.c │ │ ├── tcp_in.c │ │ ├── tcp_out.c │ │ ├── timers.c │ │ └── udp.c │ │ ├── include │ │ ├── ipv4 │ │ │ └── lwip │ │ │ │ ├── autoip.h │ │ │ │ ├── icmp.h │ │ │ │ ├── igmp.h │ │ │ │ ├── inet.h │ │ │ │ ├── inet_chksum.h │ │ │ │ ├── ip.h │ │ │ │ ├── ip_addr.h │ │ │ │ └── ip_frag.h │ │ ├── lwip │ │ │ ├── api.h │ │ │ ├── api_msg.h │ │ │ ├── arch.h │ │ │ ├── debug.h │ │ │ ├── def.h │ │ │ ├── dhcp.h │ │ │ ├── dns.h │ │ │ ├── err.h │ │ │ ├── init.h │ │ │ ├── mem.h │ │ │ ├── memp.h │ │ │ ├── memp_std.h │ │ │ ├── netbuf.h │ │ │ ├── netdb.h │ │ │ ├── netif.h │ │ │ ├── netifapi.h │ │ │ ├── opt.h │ │ │ ├── pbuf.h │ │ │ ├── raw.h │ │ │ ├── sio.h │ │ │ ├── snmp.h │ │ │ ├── snmp_asn1.h │ │ │ ├── snmp_msg.h │ │ │ ├── snmp_structs.h │ │ │ ├── sockets.h │ │ │ ├── stats.h │ │ │ ├── sys.h │ │ │ ├── tcp.h │ │ │ ├── tcp_impl.h │ │ │ ├── tcpip.h │ │ │ ├── timers.h │ │ │ └── udp.h │ │ └── netif │ │ │ ├── etharp.h │ │ │ ├── ethernetif.h │ │ │ ├── ppp_oe.h │ │ │ └── slipif.h │ │ └── netif │ │ ├── FILES │ │ ├── etharp.c │ │ ├── ethernetif.c │ │ └── slipif.c └── lwip_app │ ├── driver_tcp │ ├── tcp_driver.c │ └── tcp_driver.h │ ├── station │ ├── inc │ │ ├── ntrip_client.h │ │ ├── ntrip_server.h │ │ └── station_tcp.h │ └── src │ │ ├── ntrip_client.c │ │ ├── ntrip_server.c │ │ └── station_tcp.c │ ├── user │ ├── inc │ │ ├── lwip_comm.h │ │ ├── lwipopts.h │ │ ├── netbios.h │ │ ├── netconn.h │ │ └── tls_tcp.h │ └── src │ │ ├── lwip_comm.c │ │ ├── netbios.c │ │ ├── netconn.c │ │ └── tls_tcp.c │ └── webserver │ ├── inc │ ├── fs.h │ ├── fsdata.h │ ├── fsdatah.h │ ├── httpd.h │ └── httpd_structs.h │ └── src │ ├── fs.c │ ├── httpd.c │ └── httpd_handler.c ├── OpenARC ├── aceinna_client_api.h ├── libOpenARC.a └── library.json ├── Platform ├── Board │ ├── include │ │ ├── boardDefinition.h │ │ ├── bsp.h │ │ ├── configureGPIO.h │ │ ├── stm32f4xx_hal_conf.h │ │ ├── stm32f4xx_it.h │ │ └── system_stm32f4xx.h │ └── src │ │ ├── bsp.c │ │ ├── configureGPIO.c │ │ ├── stm32f4xx_hal_msp.c │ │ ├── stm32f4xx_it.c │ │ └── system_stm32f4xx.c ├── CAN │ ├── include │ │ ├── can.h │ │ ├── car_data.h │ │ ├── sae_j1939.h │ │ ├── taskCanCommunicationJ1939.h │ │ └── user_message_can.h │ └── src │ │ ├── can.c │ │ ├── car_data.c │ │ ├── sae_j1939.c │ │ ├── sae_j1939_slave.c │ │ ├── taskCANcommunicationJ1939.c │ │ └── user_message_can.c ├── Driver │ ├── include │ │ ├── driver.h │ │ ├── exit.h │ │ ├── led.h │ │ ├── rng.h │ │ ├── spi.h │ │ ├── timer.h │ │ └── uart.h │ └── src │ │ ├── exit.c │ │ ├── led.c │ │ ├── rng.c │ │ ├── spi.c │ │ ├── timer.c │ │ └── uart.c ├── Filter │ ├── include │ │ ├── filter.h │ │ └── lowpass_filter.h │ └── src │ │ ├── filter.c │ │ └── lowpass_filter.c ├── bluetooth │ ├── include │ │ ├── bt_packet.h │ │ └── json_parse.h │ └── src │ │ ├── bt_packet.c │ │ └── json_parse.c ├── cJSON │ ├── inc │ │ └── cJSON.h │ └── src │ │ └── cJSON.c ├── commAPI.h ├── common │ ├── include │ │ ├── Indices.h │ │ ├── constants.h │ │ ├── nav_math.h │ │ ├── scaling.h │ │ └── utils.h │ └── src │ │ ├── nav_math.c │ │ ├── platform.c │ │ └── utils.c ├── config │ ├── include │ │ └── configuration.h │ └── src │ │ └── configuration.c ├── configurationAPI.h ├── crc │ ├── include │ │ ├── crc.h │ │ └── crc16.h │ └── src │ │ ├── crc.c │ │ └── crc16.c ├── gnss_data │ ├── include │ │ ├── rtcm.h │ │ └── rtklib_core.h │ └── src │ │ └── rtcm.c ├── gnss_data_api.h ├── hwAPI.h ├── library.json ├── platformAPI.h ├── platform_version.h └── serial │ ├── include │ ├── serial_port.h │ └── ucb_packet.h │ └── src │ ├── handle_packet.c │ ├── send_packet.c │ ├── serial_port.c │ └── ucb_packet.c ├── README.md ├── STM32F469 ├── CMSIS │ ├── cmsis_gcc.h │ ├── core_cm4.h │ ├── core_cmFunc.h │ ├── core_cmInstr.h │ ├── core_cmSimd.h │ ├── startup_stm32f469xx.s │ ├── stm32f469xx.h │ └── stm32f4xx.h ├── HAL │ ├── Inc │ │ ├── Legacy │ │ │ ├── stm32_hal_legacy.h │ │ │ └── stm32f4xx_hal_can_legacy.h │ │ ├── stm32_assert_template.h │ │ ├── stm32f4xx_hal.h │ │ ├── stm32f4xx_hal_adc.h │ │ ├── stm32f4xx_hal_adc_ex.h │ │ ├── stm32f4xx_hal_can.h │ │ ├── stm32f4xx_hal_cec.h │ │ ├── stm32f4xx_hal_conf_template.h │ │ ├── stm32f4xx_hal_cortex.h │ │ ├── stm32f4xx_hal_crc.h │ │ ├── stm32f4xx_hal_cryp.h │ │ ├── stm32f4xx_hal_cryp_ex.h │ │ ├── stm32f4xx_hal_dac.h │ │ ├── stm32f4xx_hal_dac_ex.h │ │ ├── stm32f4xx_hal_dcmi.h │ │ ├── stm32f4xx_hal_dcmi_ex.h │ │ ├── stm32f4xx_hal_def.h │ │ ├── stm32f4xx_hal_dfsdm.h │ │ ├── stm32f4xx_hal_dma.h │ │ ├── stm32f4xx_hal_dma2d.h │ │ ├── stm32f4xx_hal_dma_ex.h │ │ ├── stm32f4xx_hal_dsi.h │ │ ├── stm32f4xx_hal_eth.h │ │ ├── stm32f4xx_hal_flash.h │ │ ├── stm32f4xx_hal_flash_ex.h │ │ ├── stm32f4xx_hal_flash_ramfunc.h │ │ ├── stm32f4xx_hal_fmpi2c.h │ │ ├── stm32f4xx_hal_fmpi2c_ex.h │ │ ├── stm32f4xx_hal_gpio.h │ │ ├── stm32f4xx_hal_gpio_ex.h │ │ ├── stm32f4xx_hal_hash.h │ │ ├── stm32f4xx_hal_hash_ex.h │ │ ├── stm32f4xx_hal_hcd.h │ │ ├── stm32f4xx_hal_i2c.h │ │ ├── stm32f4xx_hal_i2c_ex.h │ │ ├── stm32f4xx_hal_i2s.h │ │ ├── stm32f4xx_hal_i2s_ex.h │ │ ├── stm32f4xx_hal_irda.h │ │ ├── stm32f4xx_hal_iwdg.h │ │ ├── stm32f4xx_hal_lptim.h │ │ ├── stm32f4xx_hal_ltdc.h │ │ ├── stm32f4xx_hal_ltdc_ex.h │ │ ├── stm32f4xx_hal_mmc.h │ │ ├── stm32f4xx_hal_nand.h │ │ ├── stm32f4xx_hal_nor.h │ │ ├── stm32f4xx_hal_pccard.h │ │ ├── stm32f4xx_hal_pcd.h │ │ ├── stm32f4xx_hal_pcd_ex.h │ │ ├── stm32f4xx_hal_pwr.h │ │ ├── stm32f4xx_hal_pwr_ex.h │ │ ├── stm32f4xx_hal_qspi.h │ │ ├── stm32f4xx_hal_rcc.h │ │ ├── stm32f4xx_hal_rcc_ex.h │ │ ├── stm32f4xx_hal_rng.h │ │ ├── stm32f4xx_hal_rtc.h │ │ ├── stm32f4xx_hal_rtc_ex.h │ │ ├── stm32f4xx_hal_sai.h │ │ ├── stm32f4xx_hal_sai_ex.h │ │ ├── stm32f4xx_hal_sd.h │ │ ├── stm32f4xx_hal_sdram.h │ │ ├── stm32f4xx_hal_smartcard.h │ │ ├── stm32f4xx_hal_spdifrx.h │ │ ├── stm32f4xx_hal_spi.h │ │ ├── stm32f4xx_hal_sram.h │ │ ├── stm32f4xx_hal_tim.h │ │ ├── stm32f4xx_hal_tim_ex.h │ │ ├── stm32f4xx_hal_uart.h │ │ ├── stm32f4xx_hal_usart.h │ │ ├── stm32f4xx_hal_wwdg.h │ │ ├── stm32f4xx_ll_adc.h │ │ ├── stm32f4xx_ll_bus.h │ │ ├── stm32f4xx_ll_cortex.h │ │ ├── stm32f4xx_ll_crc.h │ │ ├── stm32f4xx_ll_dac.h │ │ ├── stm32f4xx_ll_dma.h │ │ ├── stm32f4xx_ll_dma2d.h │ │ ├── stm32f4xx_ll_exti.h │ │ ├── stm32f4xx_ll_fmc.h │ │ ├── stm32f4xx_ll_fsmc.h │ │ ├── stm32f4xx_ll_gpio.h │ │ ├── stm32f4xx_ll_i2c.h │ │ ├── stm32f4xx_ll_iwdg.h │ │ ├── stm32f4xx_ll_lptim.h │ │ ├── stm32f4xx_ll_pwr.h │ │ ├── stm32f4xx_ll_rcc.h │ │ ├── stm32f4xx_ll_rng.h │ │ ├── stm32f4xx_ll_rtc.h │ │ ├── stm32f4xx_ll_sdmmc.h │ │ ├── stm32f4xx_ll_spi.h │ │ ├── stm32f4xx_ll_system.h │ │ ├── stm32f4xx_ll_tim.h │ │ ├── stm32f4xx_ll_usart.h │ │ ├── stm32f4xx_ll_usb.h │ │ ├── stm32f4xx_ll_utils.h │ │ └── stm32f4xx_ll_wwdg.h │ └── Src │ │ ├── hal.h │ │ ├── stm32f4xx_hal.c │ │ ├── stm32f4xx_hal_adc.c │ │ ├── stm32f4xx_hal_adc_ex.c │ │ ├── stm32f4xx_hal_can.c │ │ ├── stm32f4xx_hal_cec.c │ │ ├── stm32f4xx_hal_cortex.c │ │ ├── stm32f4xx_hal_crc.c │ │ ├── stm32f4xx_hal_cryp.c │ │ ├── stm32f4xx_hal_cryp_ex.c │ │ ├── stm32f4xx_hal_dac.c │ │ ├── stm32f4xx_hal_dac_ex.c │ │ ├── stm32f4xx_hal_dcmi.c │ │ ├── stm32f4xx_hal_dcmi_ex.c │ │ ├── stm32f4xx_hal_dfsdm.c │ │ ├── stm32f4xx_hal_dma.c │ │ ├── stm32f4xx_hal_dma2d.c │ │ ├── stm32f4xx_hal_dma_ex.c │ │ ├── stm32f4xx_hal_dsi.c │ │ ├── stm32f4xx_hal_eth.c │ │ ├── stm32f4xx_hal_flash.c │ │ ├── stm32f4xx_hal_flash_ex.c │ │ ├── stm32f4xx_hal_flash_ramfunc.c │ │ ├── stm32f4xx_hal_fmpi2c.c │ │ ├── stm32f4xx_hal_fmpi2c_ex.c │ │ ├── stm32f4xx_hal_gpio.c │ │ ├── stm32f4xx_hal_hash.c │ │ ├── stm32f4xx_hal_hash_ex.c │ │ ├── stm32f4xx_hal_hcd.c │ │ ├── stm32f4xx_hal_i2c.c │ │ ├── stm32f4xx_hal_i2c_ex.c │ │ ├── stm32f4xx_hal_i2s.c │ │ ├── stm32f4xx_hal_i2s_ex.c │ │ ├── stm32f4xx_hal_irda.c │ │ ├── stm32f4xx_hal_iwdg.c │ │ ├── stm32f4xx_hal_lptim.c │ │ ├── stm32f4xx_hal_ltdc.c │ │ ├── stm32f4xx_hal_ltdc_ex.c │ │ ├── stm32f4xx_hal_mmc.c │ │ ├── stm32f4xx_hal_nand.c │ │ ├── stm32f4xx_hal_nor.c │ │ ├── stm32f4xx_hal_pccard.c │ │ ├── stm32f4xx_hal_pcd.c │ │ ├── stm32f4xx_hal_pcd_ex.c │ │ ├── stm32f4xx_hal_pwr.c │ │ ├── stm32f4xx_hal_pwr_ex.c │ │ ├── stm32f4xx_hal_qspi.c │ │ ├── stm32f4xx_hal_rcc.c │ │ ├── stm32f4xx_hal_rcc_ex.c │ │ ├── stm32f4xx_hal_rng.c │ │ ├── stm32f4xx_hal_rtc.c │ │ ├── stm32f4xx_hal_rtc_ex.c │ │ ├── stm32f4xx_hal_sai.c │ │ ├── stm32f4xx_hal_sai_ex.c │ │ ├── stm32f4xx_hal_sd.c │ │ ├── stm32f4xx_hal_sdram.c │ │ ├── stm32f4xx_hal_smartcard.c │ │ ├── stm32f4xx_hal_spdifrx.c │ │ ├── stm32f4xx_hal_spi.c │ │ ├── stm32f4xx_hal_sram.c │ │ ├── stm32f4xx_hal_tim.c │ │ ├── stm32f4xx_hal_tim_ex.c │ │ ├── stm32f4xx_hal_uart.c │ │ ├── stm32f4xx_hal_usart.c │ │ ├── stm32f4xx_hal_wwdg.c │ │ ├── stm32f4xx_ll_adc.c │ │ ├── stm32f4xx_ll_crc.c │ │ ├── stm32f4xx_ll_dac.c │ │ ├── stm32f4xx_ll_dma.c │ │ ├── stm32f4xx_ll_dma2d.c │ │ ├── stm32f4xx_ll_exti.c │ │ ├── stm32f4xx_ll_fmc.c │ │ ├── stm32f4xx_ll_fsmc.c │ │ ├── stm32f4xx_ll_gpio.c │ │ ├── stm32f4xx_ll_i2c.c │ │ ├── stm32f4xx_ll_lptim.c │ │ ├── stm32f4xx_ll_pwr.c │ │ ├── stm32f4xx_ll_rcc.c │ │ ├── stm32f4xx_ll_rng.c │ │ ├── stm32f4xx_ll_rtc.c │ │ ├── stm32f4xx_ll_sdmmc.c │ │ ├── stm32f4xx_ll_spi.c │ │ ├── stm32f4xx_ll_tim.c │ │ ├── stm32f4xx_ll_usart.c │ │ ├── stm32f4xx_ll_usb.c │ │ └── stm32f4xx_ll_utils.c └── library.json ├── Sensors ├── calibrationAPI.h ├── eepromAPI.h ├── libSensors.a ├── library.json └── sensorsAPI.h ├── library.json └── mbedTLS ├── app ├── inc │ └── mbedtls_config.h └── src │ ├── hardware_rng.c │ └── net_socket.c ├── lib ├── include │ ├── CMakeLists.txt │ └── mbedtls │ │ ├── aes.h │ │ ├── aesni.h │ │ ├── arc4.h │ │ ├── asn1.h │ │ ├── asn1write.h │ │ ├── base64.h │ │ ├── bignum.h │ │ ├── blowfish.h │ │ ├── bn_mul.h │ │ ├── camellia.h │ │ ├── ccm.h │ │ ├── certs.h │ │ ├── check_config.h │ │ ├── cipher.h │ │ ├── cipher_internal.h │ │ ├── cmac.h │ │ ├── compat-1.3.h │ │ ├── config.h │ │ ├── ctr_drbg.h │ │ ├── debug.h │ │ ├── des.h │ │ ├── dhm.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── ecjpake.h │ │ ├── ecp.h │ │ ├── ecp_internal.h │ │ ├── entropy.h │ │ ├── entropy_poll.h │ │ ├── error.h │ │ ├── gcm.h │ │ ├── havege.h │ │ ├── hmac_drbg.h │ │ ├── md.h │ │ ├── md2.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── md_internal.h │ │ ├── memory_buffer_alloc.h │ │ ├── net.h │ │ ├── net_sockets.h │ │ ├── oid.h │ │ ├── padlock.h │ │ ├── pem.h │ │ ├── pk.h │ │ ├── pk_internal.h │ │ ├── pkcs11.h │ │ ├── pkcs12.h │ │ ├── pkcs5.h │ │ ├── platform.h │ │ ├── platform_time.h │ │ ├── ripemd160.h │ │ ├── rsa.h │ │ ├── sha1.h │ │ ├── sha256.h │ │ ├── sha512.h │ │ ├── ssl.h │ │ ├── ssl_cache.h │ │ ├── ssl_ciphersuites.h │ │ ├── ssl_cookie.h │ │ ├── ssl_internal.h │ │ ├── ssl_ticket.h │ │ ├── threading.h │ │ ├── timing.h │ │ ├── version.h │ │ ├── x509.h │ │ ├── x509_crl.h │ │ ├── x509_crt.h │ │ ├── x509_csr.h │ │ └── xtea.h └── src │ ├── CMakeLists.txt │ ├── Makefile │ ├── aes.c │ ├── aesni.c │ ├── arc4.c │ ├── asn1parse.c │ ├── asn1write.c │ ├── base64.c │ ├── bignum.c │ ├── blowfish.c │ ├── camellia.c │ ├── ccm.c │ ├── certs.c │ ├── cipher.c │ ├── cipher_wrap.c │ ├── cmac.c │ ├── ctr_drbg.c │ ├── debug.c │ ├── des.c │ ├── dhm.c │ ├── ecdh.c │ ├── ecdsa.c │ ├── ecjpake.c │ ├── ecp.c │ ├── ecp_curves.c │ ├── entropy.c │ ├── entropy_poll.c │ ├── error.c │ ├── gcm.c │ ├── havege.c │ ├── hmac_drbg.c │ ├── md.c │ ├── md2.c │ ├── md4.c │ ├── md5.c │ ├── md_wrap.c │ ├── memory_buffer_alloc.c │ ├── oid.c │ ├── padlock.c │ ├── pem.c │ ├── pk.c │ ├── pk_wrap.c │ ├── pkcs11.c │ ├── pkcs12.c │ ├── pkcs5.c │ ├── pkparse.c │ ├── pkwrite.c │ ├── platform.c │ ├── ripemd160.c │ ├── rsa.c │ ├── sha1.c │ ├── sha256.c │ ├── sha512.c │ ├── ssl_cache.c │ ├── ssl_ciphersuites.c │ ├── ssl_cli.c │ ├── ssl_cookie.c │ ├── ssl_srv.c │ ├── ssl_ticket.c │ ├── ssl_tls.c │ ├── threading.c │ ├── timing.c │ ├── version.c │ ├── version_features.c │ ├── x509.c │ ├── x509_create.c │ ├── x509_crl.c │ ├── x509_crt.c │ ├── x509_csr.c │ ├── x509write_crt.c │ ├── x509write_csr.c │ └── xtea.c └── library.json /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | #Ignore thumbnails created by Windows 3 | Thumbs.db 4 | #Ignore files built by Visual Studio 5 | *.obj 6 | *.exe 7 | *.pdb 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.cache 20 | *.ilk 21 | *.log 22 | [Bb]in 23 | [Dd]ebug*/ 24 | *.lib 25 | *.sbr 26 | obj/ 27 | [Rr]elease*/ 28 | _ReSharper*/ 29 | [Tt]est[Rr]esult* 30 | .vs/ 31 | #Nuget packages folder 32 | packages/ 33 | .vscode/ -------------------------------------------------------------------------------- /FreeRTOS/include/osapi.h: -------------------------------------------------------------------------------- 1 | #ifndef _OS_API_H 2 | #define _OS_API_H 3 | #include "cmsis_os.h" 4 | #include "portmacro.h" 5 | #include 6 | #include "osapi.h" 7 | #define OSEnterISR() volatile int ulDummy = portSET_INTERRUPT_MASK_FROM_ISR() 8 | #define OSExitISR() portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy ) 9 | 10 | extern void OSDisableHook(); 11 | extern void OSEnableHook(); 12 | extern void OS_Delay(uint32_t msec); 13 | extern void OSDisableHookIfNotInIsr(); 14 | extern void OSEnableHookIfNotInIsr(); 15 | extern int gIsrDisableCount; 16 | 17 | #define getSystemTime() osKernelSysTick() 18 | #define getSystemTimeAsDouble() (double)osKernelSysTick()/configTICK_RATE_HZ; 19 | #define timeElapsed(since) (osKernelSysTick() - since) 20 | 21 | 22 | #define OS_INFINITE_TIMEOUT portMAX_DELAY 23 | #define OS_NO_TIMEOUT 0 24 | 25 | 26 | // #define OSEnterISR() do{ gIsrDisableCount++; __ASM ("cpsid i");} while(0) 27 | // #define OSExitISR() do{ gIsrDisableCount--; if (gIsrDisableCount == 0) { __ASM ("cpsie i"); }}while(0) 28 | 29 | #define ENTER_CRITICAL() do{ gIsrDisableCount++; __ASM ("cpsid i");} while(0) 30 | #define EXIT_CRITICAL() do{ gIsrDisableCount--; if (gIsrDisableCount == 0) { __ASM ("cpsie i"); }}while(0) 31 | 32 | extern uint32_t SysTimer; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /FreeRTOS/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FreeRTOS", 3 | "version": "1.0.3", 4 | "description": "Open Source FreeRTOS library", 5 | "build": { 6 | "flags": [ 7 | "-I include", 8 | "-I ." 9 | ], 10 | "libArchive": true, 11 | "platforms": "aceinna_imu" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /FreeRTOS/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. -------------------------------------------------------------------------------- /FreeRTOS/src/port1.c: -------------------------------------------------------------------------------- 1 | #include "osapi.h" 2 | 3 | 4 | void OSDisableHook() 5 | { 6 | portENTER_CRITICAL(); 7 | } 8 | 9 | void OSEnableHook() 10 | { 11 | portEXIT_CRITICAL(); 12 | } 13 | 14 | void OS_Delay(uint32_t msec) 15 | { 16 | osDelay (msec); 17 | } 18 | 19 | inline void OSDisableHookIfNotInIsr() 20 | { 21 | if(!inHandlerMode()){ 22 | portENTER_CRITICAL(); 23 | } 24 | } 25 | 26 | inline void OSEnableHookIfNotInIsr() 27 | { 28 | if(!inHandlerMode()){ 29 | portEXIT_CRITICAL(); 30 | } 31 | } -------------------------------------------------------------------------------- /FreeRTOS/st_readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aceinna/openRTK330-lib/3023995e0766aba636a2e9f7f68a1ab9fc4562a5/FreeRTOS/st_readme.txt -------------------------------------------------------------------------------- /GNSS/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GNSS", 3 | "version": "1.0.0", 4 | "description": "OpenRTK330LI GNSS RTK/PPP position engine", 5 | "build": { 6 | "flags": [ 7 | "-I ./" 8 | ], 9 | "libArchive": true, 10 | "platforms": "aceinna_imu" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /GNSS/rtk_api.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file rtk_api.h GNSS RTK algorithm and solution API 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | *****************************************************************************/ 9 | /******************************************************************************* 10 | Copyright 2020 ACEINNA, INC 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. 23 | *******************************************************************************/ 24 | 25 | 26 | #ifndef _RTK_API_H 27 | #define _RTK_API_H 28 | 29 | #include 30 | #include "gnss_data_api.h" 31 | 32 | extern void rtk_algorithm(void); 33 | 34 | extern gnss_solution_t *g_ptr_gnss_sol; 35 | extern gnss_solution_t g_gnss_sol; 36 | 37 | #endif -------------------------------------------------------------------------------- /INS/libINS.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aceinna/openRTK330-lib/3023995e0766aba636a2e9f7f68a1ab9fc4562a5/INS/libINS.a -------------------------------------------------------------------------------- /INS/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "INS", 3 | "version": "0.0.1", 4 | "description": "GNSS/INS library", 5 | "build": { 6 | "flags": [ 7 | "-I include", 8 | "-I ." 9 | ], 10 | "libArchive": true, 11 | "platforms": "aceinna_imu" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /LWIP/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #define BYTE_ORDER_LOCAL LITTLE_ENDIAN // little endian 36 | 37 | #endif /* __CPU_H__ */ 38 | -------------------------------------------------------------------------------- /LWIP/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START 36 | #define PERF_STOP(x) 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /LWIP/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __ARCH_SYS_ARCH_H__ 33 | #define __ARCH_SYS_ARCH_H__ 34 | 35 | #include "arch/cc.h" 36 | #include "cmsis_os.h" 37 | 38 | #define SYS_MBOX_NULL (osMessageQId)0 39 | #define SYS_SEM_NULL (osSemaphoreId)0 40 | 41 | typedef osSemaphoreId sys_sem_t; 42 | typedef osSemaphoreId sys_mutex_t; 43 | typedef osMessageQId sys_mbox_t; 44 | typedef osThreadId sys_thread_t; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /LWIP/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LWIP", 3 | "version": "1.0.0", 4 | "description": "LWIP", 5 | "build": { 6 | "flags": [ 7 | "-I arch", 8 | "-I lwip-1.4.1/src/include", 9 | "-I lwip-1.4.1/src/include/ipv4", 10 | "-I lwip-1.4.1/src/include/netif", 11 | "-I lwip_app/user/inc", 12 | "-I lwip_app/webserver/inc", 13 | "-I lwip_app/station/inc" , 14 | "-I ." 15 | ], 16 | "libArchive": true, 17 | "platforms": "aceinna_imu" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/README: -------------------------------------------------------------------------------- 1 | INTRODUCTION 2 | 3 | lwIP is a small independent implementation of the TCP/IP protocol 4 | suite that has been developed by Adam Dunkels at the Computer and 5 | Networks Architectures (CNA) lab at the Swedish Institute of Computer 6 | Science (SICS). 7 | 8 | The focus of the lwIP TCP/IP implementation is to reduce the RAM usage 9 | while still having a full scale TCP. This making lwIP suitable for use 10 | in embedded systems with tens of kilobytes of free RAM and room for 11 | around 40 kilobytes of code ROM. 12 | 13 | FEATURES 14 | 15 | * IP (Internet Protocol) including packet forwarding over multiple network 16 | interfaces 17 | * ICMP (Internet Control Message Protocol) for network maintenance and debugging 18 | * IGMP (Internet Group Management Protocol) for multicast traffic management 19 | * UDP (User Datagram Protocol) including experimental UDP-lite extensions 20 | * TCP (Transmission Control Protocol) with congestion control, RTT estimation 21 | and fast recovery/fast retransmit 22 | * Specialized raw/native API for enhanced performance 23 | * Optional Berkeley-like socket API 24 | * DNS (Domain names resolver) 25 | * SNMP (Simple Network Management Protocol) 26 | * DHCP (Dynamic Host Configuration Protocol) 27 | * AUTOIP (for IPv4, conform with RFC 3927) 28 | * PPP (Point-to-Point Protocol) 29 | * ARP (Address Resolution Protocol) for Ethernet 30 | 31 | LICENSE 32 | 33 | lwIP is freely available under a BSD license. 34 | 35 | DEVELOPMENT 36 | 37 | lwIP has grown into an excellent TCP/IP stack for embedded devices, 38 | and developers using the stack often submit bug fixes, improvements, 39 | and additions to the stack to further increase its usefulness. 40 | 41 | Development of lwIP is hosted on Savannah, a central point for 42 | software development, maintenance and distribution. Everyone can 43 | help improve lwIP by use of Savannah's interface, CVS and the 44 | mailing list. A core team of developers will commit changes to the 45 | CVS source tree. 46 | 47 | The lwIP TCP/IP stack is maintained in the 'lwip' CVS module and 48 | contributions (such as platform ports) are in the 'contrib' module. 49 | 50 | See doc/savannah.txt for details on CVS server access for users and 51 | developers. 52 | 53 | Last night's CVS tar ball can be downloaded from: 54 | http://savannah.gnu.org/cvs.backups/lwip.tar.gz [CHANGED - NEEDS FIXING] 55 | 56 | The current CVS trees are web-browsable: 57 | http://savannah.nongnu.org/cgi-bin/viewcvs/lwip/lwip/ 58 | http://savannah.nongnu.org/cgi-bin/viewcvs/lwip/contrib/ 59 | 60 | Submit patches and bugs via the lwIP project page: 61 | http://savannah.nongnu.org/projects/lwip/ 62 | 63 | 64 | DOCUMENTATION 65 | 66 | The original out-dated homepage of lwIP and Adam Dunkels' papers on 67 | lwIP are at the official lwIP home page: 68 | http://www.sics.se/~adam/lwip/ 69 | 70 | Self documentation of the source code is regularly extracted from the 71 | current CVS sources and is available from this web page: 72 | http://www.nongnu.org/lwip/ 73 | 74 | There is now a constantly growin wiki about lwIP at 75 | http://lwip.wikia.com/wiki/LwIP_Wiki 76 | 77 | Also, there are mailing lists you can subscribe at 78 | http://savannah.nongnu.org/mail/?group=lwip 79 | plus searchable archives: 80 | http://lists.nongnu.org/archive/html/lwip-users/ 81 | http://lists.nongnu.org/archive/html/lwip-devel/ 82 | 83 | Reading Adam's papers, the files in docs/, browsing the source code 84 | documentation and browsing the mailing list archives is a good way to 85 | become familiar with the design of lwIP. 86 | 87 | Adam Dunkels 88 | Leon Woestenberg 89 | 90 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/doc/contrib.txt: -------------------------------------------------------------------------------- 1 | 1 Introduction 2 | 3 | This document describes some guidelines for people participating 4 | in lwIP development. 5 | 6 | 2 How to contribute to lwIP 7 | 8 | Here is a short list of suggestions to anybody working with lwIP and 9 | trying to contribute bug reports, fixes, enhancements, platform ports etc. 10 | First of all as you may already know lwIP is a volunteer project so feedback 11 | to fixes or questions might often come late. Hopefully the bug and patch tracking 12 | features of Savannah help us not lose users' input. 13 | 14 | 2.1 Source code style: 15 | 16 | 1. do not use tabs. 17 | 2. indentation is two spaces per level (i.e. per tab). 18 | 3. end debug messages with a trailing newline (\n). 19 | 4. one space between keyword and opening bracket. 20 | 5. no space between function and opening bracket. 21 | 6. one space and no newline before opening curly braces of a block. 22 | 7. closing curly brace on a single line. 23 | 8. spaces surrounding assignment and comparisons. 24 | 9. don't initialize static and/or global variables to zero, the compiler takes care of that. 25 | 10. use current source code style as further reference. 26 | 27 | 2.2 Source code documentation style: 28 | 29 | 1. JavaDoc compliant and Doxygen compatible. 30 | 2. Function documentation above functions in .c files, not .h files. 31 | (This forces you to synchronize documentation and implementation.) 32 | 3. Use current documentation style as further reference. 33 | 34 | 2.3 Bug reports and patches: 35 | 36 | 1. Make sure you are reporting bugs or send patches against the latest 37 | sources. (From the latest release and/or the current CVS sources.) 38 | 2. If you think you found a bug make sure it's not already filed in the 39 | bugtracker at Savannah. 40 | 3. If you have a fix put the patch on Savannah. If it is a patch that affects 41 | both core and arch specific stuff please separate them so that the core can 42 | be applied separately while leaving the other patch 'open'. The prefered way 43 | is to NOT touch archs you can't test and let maintainers take care of them. 44 | This is a good way to see if they are used at all - the same goes for unix 45 | netifs except tapif. 46 | 4. Do not file a bug and post a fix to it to the patch area. Either a bug report 47 | or a patch will be enough. 48 | If you correct an existing bug then attach the patch to the bug rather than creating a new entry in the patch area. 49 | 5. Trivial patches (compiler warning, indentation and spelling fixes or anything obvious which takes a line or two) 50 | can go to the lwip-users list. This is still the fastest way of interaction and the list is not so crowded 51 | as to allow for loss of fixes. Putting bugs on Savannah and subsequently closing them is too much an overhead 52 | for reporting a compiler warning fix. 53 | 6. Patches should be specific to a single change or to related changes.Do not mix bugfixes with spelling and other 54 | trivial fixes unless the bugfix is trivial too.Do not reorganize code and rename identifiers in the same patch you 55 | change behaviour if not necessary.A patch is easier to read and understand if it's to the point and short than 56 | if it's not to the point and long :) so the chances for it to be applied are greater. 57 | 58 | 2.4 Platform porters: 59 | 60 | 1. If you have ported lwIP to a platform (an OS, a uC/processor or a combination of these) and 61 | you think it could benefit others[1] you might want discuss this on the mailing list. You 62 | can also ask for CVS access to submit and maintain your port in the contrib CVS module. 63 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/api/err.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Error Management module 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/err.h" 40 | 41 | #ifdef LWIP_DEBUG 42 | 43 | static const char *err_strerr[] = { 44 | "Ok.", /* ERR_OK 0 */ 45 | "Out of memory error.", /* ERR_MEM -1 */ 46 | "Buffer error.", /* ERR_BUF -2 */ 47 | "Timeout.", /* ERR_TIMEOUT -3 */ 48 | "Routing problem.", /* ERR_RTE -4 */ 49 | "Operation in progress.", /* ERR_INPROGRESS -5 */ 50 | "Illegal value.", /* ERR_VAL -6 */ 51 | "Operation would block.", /* ERR_WOULDBLOCK -7 */ 52 | "Address in use.", /* ERR_USE -8 */ 53 | "Already connected.", /* ERR_ISCONN -9 */ 54 | "Connection aborted.", /* ERR_ABRT -10 */ 55 | "Connection reset.", /* ERR_RST -11 */ 56 | "Connection closed.", /* ERR_CLSD -12 */ 57 | "Not connected.", /* ERR_CONN -13 */ 58 | "Illegal argument.", /* ERR_ARG -14 */ 59 | "Low-level netif error.", /* ERR_IF -15 */ 60 | }; 61 | 62 | /** 63 | * Convert an lwip internal error to a string representation. 64 | * 65 | * @param err an lwip internal err_t 66 | * @return a string representation for err 67 | */ 68 | const char * 69 | lwip_strerr(err_t err) 70 | { 71 | return err_strerr[-err]; 72 | 73 | } 74 | 75 | #endif /* LWIP_DEBUG */ 76 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/core/def.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Common functions used throughout the stack. 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Simon Goldschmidt 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | #include "lwip/def.h" 41 | 42 | /** 43 | * These are reference implementations of the byte swapping functions. 44 | * Again with the aim of being simple, correct and fully portable. 45 | * Byte swapping is the second thing you would want to optimize. You will 46 | * need to port it to your architecture and in your cc.h: 47 | * 48 | * #define LWIP_PLATFORM_BYTESWAP 1 49 | * #define LWIP_PLATFORM_HTONS(x) 50 | * #define LWIP_PLATFORM_HTONL(x) 51 | * 52 | * Note ntohs() and ntohl() are merely references to the htonx counterparts. 53 | */ 54 | 55 | #if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER_LOCAL == LITTLE_ENDIAN) 56 | 57 | /** 58 | * Convert an u16_t from host- to network byte order. 59 | * 60 | * @param n u16_t in host byte order 61 | * @return n in network byte order 62 | */ 63 | u16_t 64 | lwip_htons(u16_t n) 65 | { 66 | return ((n & 0xff) << 8) | ((n & 0xff00) >> 8); 67 | } 68 | 69 | /** 70 | * Convert an u16_t from network- to host byte order. 71 | * 72 | * @param n u16_t in network byte order 73 | * @return n in host byte order 74 | */ 75 | u16_t 76 | lwip_ntohs(u16_t n) 77 | { 78 | return lwip_htons(n); 79 | } 80 | 81 | /** 82 | * Convert an u32_t from host- to network byte order. 83 | * 84 | * @param n u32_t in host byte order 85 | * @return n in network byte order 86 | */ 87 | u32_t 88 | lwip_htonl(u32_t n) 89 | { 90 | return ((n & 0xff) << 24) | 91 | ((n & 0xff00) << 8) | 92 | ((n & 0xff0000UL) >> 8) | 93 | ((n & 0xff000000UL) >> 24); 94 | } 95 | 96 | /** 97 | * Convert an u32_t from network- to host byte order. 98 | * 99 | * @param n u32_t in network byte order 100 | * @return n in host byte order 101 | */ 102 | u32_t 103 | lwip_ntohl(u32_t n) 104 | { 105 | return lwip_htonl(n); 106 | } 107 | 108 | #endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER_LOCAL == LITTLE_ENDIAN) */ 109 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/core/ipv4/inet.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Functions common to all TCP/IPv4 modules, such as the byte order functions. 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/inet.h" 42 | 43 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/core/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Operating System abstraction 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/sys.h" 42 | 43 | /* Most of the functions defined in sys.h must be implemented in the 44 | * architecture-dependent file sys_arch.c */ 45 | 46 | #if !NO_SYS 47 | 48 | #ifndef sys_msleep 49 | /** 50 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 51 | * 52 | * @param ms number of milliseconds to sleep 53 | */ 54 | void 55 | sys_msleep(u32_t ms) 56 | { 57 | if (ms > 0) { 58 | sys_sem_t delaysem; 59 | err_t err = sys_sem_new(&delaysem, 0); 60 | if (err == ERR_OK) { 61 | sys_arch_sem_wait(&delaysem, ms); 62 | sys_sem_free(&delaysem); 63 | } 64 | } 65 | } 66 | #endif /* sys_msleep */ 67 | 68 | #endif /* !NO_SYS */ 69 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/ipv4/lwip/inet_chksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_CHKSUM_H__ 33 | #define __LWIP_INET_CHKSUM_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #include "lwip/pbuf.h" 38 | #include "lwip/ip_addr.h" 39 | 40 | /** Swap the bytes in an u16_t: much like htons() for little-endian */ 41 | #ifndef SWAP_BYTES_IN_WORD 42 | #if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER_LOCAL == LITTLE_ENDIAN) 43 | /* little endian and PLATFORM_BYTESWAP defined */ 44 | #define SWAP_BYTES_IN_WORD(w) LWIP_PLATFORM_HTONS(w) 45 | #else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER_LOCAL == LITTLE_ENDIAN) */ 46 | /* can't use htons on big endian (or PLATFORM_BYTESWAP not defined)... */ 47 | #define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) 48 | #endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER_LOCAL == LITTLE_ENDIAN)*/ 49 | #endif /* SWAP_BYTES_IN_WORD */ 50 | 51 | /** Split an u32_t in two u16_ts and add them up */ 52 | #ifndef FOLD_U32T 53 | #define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) 54 | #endif 55 | 56 | #if LWIP_CHECKSUM_ON_COPY 57 | /** Function-like macro: same as MEMCPY but returns the checksum of copied data 58 | as u16_t */ 59 | #ifndef LWIP_CHKSUM_COPY 60 | #define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) 61 | #ifndef LWIP_CHKSUM_COPY_ALGORITHM 62 | #define LWIP_CHKSUM_COPY_ALGORITHM 1 63 | #endif /* LWIP_CHKSUM_COPY_ALGORITHM */ 64 | #endif /* LWIP_CHKSUM_COPY */ 65 | #else /* LWIP_CHECKSUM_ON_COPY */ 66 | #define LWIP_CHKSUM_COPY_ALGORITHM 0 67 | #endif /* LWIP_CHECKSUM_ON_COPY */ 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | u16_t inet_chksum(void *dataptr, u16_t len); 74 | u16_t inet_chksum_pbuf(struct pbuf *p); 75 | u16_t inet_chksum_pseudo(struct pbuf *p, 76 | ip_addr_t *src, ip_addr_t *dest, 77 | u8_t proto, u16_t proto_len); 78 | u16_t inet_chksum_pseudo_partial(struct pbuf *p, 79 | ip_addr_t *src, ip_addr_t *dest, 80 | u8_t proto, u16_t proto_len, u16_t chksum_len); 81 | #if LWIP_CHKSUM_COPY_ALGORITHM 82 | u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len); 83 | #endif /* LWIP_CHKSUM_COPY_ALGORITHM */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* __LWIP_INET_H__ */ 90 | 91 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/ipv4/lwip/ip_frag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Jani Monoses 30 | * 31 | */ 32 | 33 | #ifndef __LWIP_IP_FRAG_H__ 34 | #define __LWIP_IP_FRAG_H__ 35 | 36 | #include "lwip/opt.h" 37 | #include "lwip/err.h" 38 | #include "lwip/pbuf.h" 39 | #include "lwip/netif.h" 40 | #include "lwip/ip_addr.h" 41 | #include "lwip/ip.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | #if IP_REASSEMBLY 48 | /* The IP reassembly timer interval in milliseconds. */ 49 | #define IP_TMR_INTERVAL 1000 50 | 51 | /* IP reassembly helper struct. 52 | * This is exported because memp needs to know the size. 53 | */ 54 | struct ip_reassdata { 55 | struct ip_reassdata *next; 56 | struct pbuf *p; 57 | struct ip_hdr iphdr; 58 | u16_t datagram_len; 59 | u8_t flags; 60 | u8_t timer; 61 | }; 62 | 63 | void ip_reass_init(void); 64 | void ip_reass_tmr(void); 65 | struct pbuf * ip_reass(struct pbuf *p); 66 | #endif /* IP_REASSEMBLY */ 67 | 68 | #if IP_FRAG 69 | #if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF 70 | /** A custom pbuf that holds a reference to another pbuf, which is freed 71 | * when this custom pbuf is freed. This is used to create a custom PBUF_REF 72 | * that points into the original pbuf. */ 73 | struct pbuf_custom_ref { 74 | /** 'base class' */ 75 | struct pbuf_custom pc; 76 | /** pointer to the original pbuf that is referenced */ 77 | struct pbuf *original; 78 | }; 79 | #endif /* !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */ 80 | 81 | err_t ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest); 82 | #endif /* IP_FRAG */ 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif /* __LWIP_IP_FRAG_H__ */ 89 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/lwip/err.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_ERR_H__ 33 | #define __LWIP_ERR_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/arch.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** Define LWIP_ERR_T in cc.h if you want to use 43 | * a different type for your platform (must be signed). */ 44 | #ifdef LWIP_ERR_T 45 | typedef LWIP_ERR_T err_t; 46 | #else /* LWIP_ERR_T */ 47 | typedef s8_t err_t; 48 | #endif /* LWIP_ERR_T*/ 49 | 50 | /* Definitions for error constants. */ 51 | 52 | #define ERR_OK 0 /* No error, everything OK. */ 53 | #define ERR_MEM -1 /* Out of memory error. */ 54 | #define ERR_BUF -2 /* Buffer error. */ 55 | #define ERR_TIMEOUT -3 /* Timeout. */ 56 | #define ERR_RTE -4 /* Routing problem. */ 57 | #define ERR_INPROGRESS -5 /* Operation in progress */ 58 | #define ERR_VAL -6 /* Illegal value. */ 59 | #define ERR_WOULDBLOCK -7 /* Operation would block. */ 60 | #define ERR_USE -8 /* Address in use. */ 61 | #define ERR_ISCONN -9 /* Already connected. */ 62 | 63 | #define ERR_IS_FATAL(e) ((e) < ERR_ISCONN) 64 | 65 | #define ERR_ABRT -10 /* Connection aborted. */ 66 | #define ERR_RST -11 /* Connection reset. */ 67 | #define ERR_CLSD -12 /* Connection closed. */ 68 | #define ERR_CONN -13 /* Not connected. */ 69 | 70 | #define ERR_ARG -14 /* Illegal argument. */ 71 | 72 | #define ERR_IF -15 /* Low-level netif error */ 73 | 74 | 75 | #ifdef LWIP_DEBUG 76 | extern const char *lwip_strerr(err_t err); 77 | #else 78 | #define lwip_strerr(x) "" 79 | #endif /* LWIP_DEBUG */ 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* __LWIP_ERR_H__ */ 86 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/lwip/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INIT_H__ 33 | #define __LWIP_INIT_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /** X.x.x: Major version of the stack */ 42 | #define LWIP_VERSION_MAJOR 1U 43 | /** x.X.x: Minor version of the stack */ 44 | #define LWIP_VERSION_MINOR 4U 45 | /** x.x.X: Revision of the stack */ 46 | #define LWIP_VERSION_REVISION 1U 47 | /** For release candidates, this is set to 1..254 48 | * For official releases, this is set to 255 (LWIP_RC_RELEASE) 49 | * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */ 50 | #define LWIP_VERSION_RC 255U 51 | 52 | /** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ 53 | #define LWIP_RC_RELEASE 255U 54 | /** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */ 55 | #define LWIP_RC_DEVELOPMENT 0U 56 | 57 | #define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) 58 | #define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) 59 | #define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) 60 | 61 | /** Provides the version of the stack */ 62 | #define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \ 63 | LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC) 64 | 65 | /* Modules initialization */ 66 | void lwip_init(void); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* __LWIP_INIT_H__ */ 73 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/lwip/raw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_RAW_H__ 33 | #define __LWIP_RAW_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ 38 | 39 | #include "lwip/pbuf.h" 40 | #include "lwip/def.h" 41 | #include "lwip/ip.h" 42 | #include "lwip/ip_addr.h" 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | struct raw_pcb; 49 | 50 | /** Function prototype for raw pcb receive callback functions. 51 | * @param arg user supplied argument (raw_pcb.recv_arg) 52 | * @param pcb the raw_pcb which received data 53 | * @param p the packet buffer that was received 54 | * @param addr the remote IP address from which the packet was received 55 | * @return 1 if the packet was 'eaten' (aka. deleted), 56 | * 0 if the packet lives on 57 | * If returning 1, the callback is responsible for freeing the pbuf 58 | * if it's not used any more. 59 | */ 60 | typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p, 61 | ip_addr_t *addr); 62 | 63 | struct raw_pcb { 64 | /* Common members of all PCB types */ 65 | IP_PCB; 66 | 67 | struct raw_pcb *next; 68 | 69 | u8_t protocol; 70 | 71 | /** receive callback function */ 72 | raw_recv_fn recv; 73 | /* user-supplied argument for the recv callback */ 74 | void *recv_arg; 75 | }; 76 | 77 | /* The following functions is the application layer interface to the 78 | RAW code. */ 79 | struct raw_pcb * raw_new (u8_t proto); 80 | void raw_remove (struct raw_pcb *pcb); 81 | err_t raw_bind (struct raw_pcb *pcb, ip_addr_t *ipaddr); 82 | err_t raw_connect (struct raw_pcb *pcb, ip_addr_t *ipaddr); 83 | 84 | void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg); 85 | err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr); 86 | err_t raw_send (struct raw_pcb *pcb, struct pbuf *p); 87 | 88 | /* The following functions are the lower layer interface to RAW. */ 89 | u8_t raw_input (struct pbuf *p, struct netif *inp); 90 | #define raw_init() /* Compatibility define, not init needed. */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* LWIP_RAW */ 97 | 98 | #endif /* __LWIP_RAW_H__ */ 99 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/lwip/timers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * Simon Goldschmidt 31 | * 32 | */ 33 | #ifndef __LWIP_TIMERS_H__ 34 | #define __LWIP_TIMERS_H__ 35 | 36 | #include "lwip/opt.h" 37 | 38 | /* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */ 39 | #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) 40 | 41 | #if LWIP_TIMERS 42 | 43 | #include "lwip/err.h" 44 | #if !NO_SYS 45 | #include "lwip/sys.h" 46 | #endif 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | #ifndef LWIP_DEBUG_TIMERNAMES 53 | #ifdef LWIP_DEBUG 54 | #define LWIP_DEBUG_TIMERNAMES SYS_DEBUG 55 | #else /* LWIP_DEBUG */ 56 | #define LWIP_DEBUG_TIMERNAMES 0 57 | #endif /* LWIP_DEBUG*/ 58 | #endif 59 | 60 | /** Function prototype for a timeout callback function. Register such a function 61 | * using sys_timeout(). 62 | * 63 | * @param arg Additional argument to pass to the function - set up by sys_timeout() 64 | */ 65 | typedef void (* sys_timeout_handler)(void *arg); 66 | 67 | struct sys_timeo { 68 | struct sys_timeo *next; 69 | u32_t time; 70 | sys_timeout_handler h; 71 | void *arg; 72 | #if LWIP_DEBUG_TIMERNAMES 73 | const char* handler_name; 74 | #endif /* LWIP_DEBUG_TIMERNAMES */ 75 | }; 76 | 77 | void sys_timeouts_init(void); 78 | 79 | #if LWIP_DEBUG_TIMERNAMES 80 | void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name); 81 | #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) 82 | #else /* LWIP_DEBUG_TIMERNAMES */ 83 | void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg); 84 | #endif /* LWIP_DEBUG_TIMERNAMES */ 85 | 86 | void sys_untimeout(sys_timeout_handler handler, void *arg); 87 | #if NO_SYS 88 | void sys_check_timeouts(void); 89 | void sys_restart_timeouts(void); 90 | #else /* NO_SYS */ 91 | void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); 92 | #endif /* NO_SYS */ 93 | 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* LWIP_TIMERS */ 100 | #endif /* __LWIP_TIMERS_H__ */ 101 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/netif/ethernetif.h: -------------------------------------------------------------------------------- 1 | #ifndef __ETHERNETIF_H__ 2 | #define __ETHERNETIF_H__ 3 | #include "lwip/err.h" 4 | #include "lwip/netif.h" 5 | #include "sys_arch.h" 6 | #include "stm32f4xx_hal.h" 7 | 8 | #define IFNAME0 'a' 9 | #define IFNAME1 'c' 10 | 11 | #define HOSTNAME "OpenRTK330" 12 | 13 | #define INTERFACE_THREAD_STACK_SIZE ( 512 ) 14 | 15 | extern ETH_HandleTypeDef EthHandle; 16 | 17 | extern sys_sem_t s_xSemaphore; 18 | 19 | void KSZ8041NL_reset_port_init(void); 20 | void KSZ8041NL_reset(void); 21 | 22 | void ethernetif_input(void const *argument); 23 | err_t ethernetif_init(struct netif *netif); 24 | 25 | void ethernetif_link_state_check(struct netif *netif); 26 | void ethernetif_update_config(struct netif *netif); 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __NETIF_SLIPIF_H__ 35 | #define __NETIF_SLIPIF_H__ 36 | 37 | #include "lwip/opt.h" 38 | #include "lwip/netif.h" 39 | 40 | /** Set this to 1 to start a thread that blocks reading on the serial line 41 | * (using sio_read()). 42 | */ 43 | #ifndef SLIP_USE_RX_THREAD 44 | #define SLIP_USE_RX_THREAD !NO_SYS 45 | #endif 46 | 47 | /** Set this to 1 to enable functions to pass in RX bytes from ISR context. 48 | * If enabled, slipif_received_byte[s]() process incoming bytes and put assembled 49 | * packets on a queue, which is fed into lwIP from slipif_poll(). 50 | * If disabled, slipif_poll() polls the serila line (using sio_tryread()). 51 | */ 52 | #ifndef SLIP_RX_FROM_ISR 53 | #define SLIP_RX_FROM_ISR 0 54 | #endif 55 | 56 | /** Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets 57 | * received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. 58 | * If disabled, packets will be dropped if more than one packet is received. 59 | */ 60 | #ifndef SLIP_RX_QUEUE 61 | #define SLIP_RX_QUEUE SLIP_RX_FROM_ISR 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | err_t slipif_init(struct netif * netif); 69 | void slipif_poll(struct netif *netif); 70 | #if SLIP_RX_FROM_ISR 71 | void slipif_process_rxqueue(struct netif *netif); 72 | void slipif_received_byte(struct netif *netif, u8_t data); 73 | void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); 74 | #endif /* SLIP_RX_FROM_ISR */ 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | 82 | -------------------------------------------------------------------------------- /LWIP/lwip-1.4.1/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | The PPP stack has been ported from ucip (http://ucip.sourceforge.net). 27 | It matches quite well to pppd 2.3.1 (http://ppp.samba.org), although 28 | compared to that, it has some modifications for embedded systems and 29 | the source code has been reordered a bit. -------------------------------------------------------------------------------- /LWIP/lwip_app/driver_tcp/tcp_driver.h: -------------------------------------------------------------------------------- 1 | #ifndef _TCP_DRIVER_H_ 2 | #define _TCP_DRIVER_H_ 3 | 4 | #include 5 | 6 | #include "lwip/err.h" 7 | #include "lwip/api.h" 8 | #include "lwip/opt.h" 9 | #include "lwip_comm.h" 10 | #include "lwip/sys.h" 11 | #include "lwip/api.h" 12 | #include "utils.h" 13 | 14 | #define driver_server_ip "192.168.1.1" 15 | 16 | #define driver_client_port 2203 17 | #define driver_data_client_port 2204 18 | 19 | #define DRIVER_TX_BUFSIZE (4*1024) 20 | #define DRIVER_RX_BUFSIZE 500 21 | 22 | 23 | typedef enum 24 | { 25 | CLIENT_STATE_OFF = 0, 26 | CLIENT_STATE_CONNECT = 1, 27 | CLIENT_STATE_REQUEST = 2, 28 | CLIENT_STATE_INTERACTIVE = 3, 29 | CLIENT_STATE_TIMEOUT = 4, 30 | CLIENT_STATE_LINK_DOWN = 5 31 | } driver_client_state_enum_t; 32 | 33 | 34 | typedef struct CLIENT_S_ 35 | { 36 | struct netconn *client; 37 | uint8_t client_state; 38 | fifo_type client_tx_fifo; 39 | fifo_type client_rx_fifo; 40 | osMutexId tx_fifo_mutex; 41 | } client_s; 42 | 43 | void driver_interface(void); 44 | void driver_output_data_interface(void); 45 | err_t client_read_data(client_s* client, uint8_t *rx_buf, uint16_t *rx_len); 46 | void tcp_driver_fifo_init(); 47 | void tcp_driver_data_fifo_init(); 48 | uint8_t get_tcp_driver_state(); 49 | uint8_t get_tcp_data_driver_state(); 50 | uint8_t driver_data_push(uint8_t* buf, uint16_t len); 51 | uint8_t driver_push(uint8_t* buf, uint16_t len); 52 | err_t client_write_data(client_s* client, const uint8_t *tx_buf, uint16_t tx_len, uint8_t apiflags); 53 | void set_server_ip(ip_addr_t* value); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /LWIP/lwip_app/station/inc/ntrip_client.h: -------------------------------------------------------------------------------- 1 | #ifndef _NTRIP_CLIENT_H_ 2 | #define _NTRIP_CLIENT_H_ 3 | 4 | #include 5 | #include "netconn.h" 6 | 7 | int32_t ntrip_client_request(struct netconn *conn, NETCONN_STATE *state, uint8_t *buf, uint16_t size); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /LWIP/lwip_app/station/inc/ntrip_server.h: -------------------------------------------------------------------------------- 1 | #ifndef _NTRIP_SERVER_H_ 2 | #define _NTRIP_SERVER_H_ 3 | 4 | #include 5 | #include "netconn.h" 6 | 7 | void base_station_run_update(void); 8 | uint8_t base_station_get_run_status(void); 9 | uint8_t station_position_calc(double lat, double lon, double height, uint8_t mode); 10 | double get_station_pos_lat(void); 11 | double get_station_pos_lon(void); 12 | double get_station_pos_height(void); 13 | 14 | int32_t ntrip_server_request(struct netconn *conn, NETCONN_STATE *state, uint8_t *buf, uint16_t size); 15 | void ntrip_server_send_pos(struct netconn *conn, NETCONN_STATE *state); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /LWIP/lwip_app/station/inc/station_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef _STATION_TCP_H_ 2 | #define _STATION_TCP_H_ 3 | 4 | #include 5 | #include "utils.h" 6 | #include "netconn.h" 7 | #include "tls_tcp.h" 8 | 9 | // #define STATION_TCP_DEBUG 10 | 11 | #define STATION_TCP_STREAM_MAX_TIMEOUT 30 12 | 13 | typedef enum 14 | { 15 | STA_WORK_NONE = 0, 16 | STA_WORK_NTRIP_CLIENT = 1, 17 | STA_WORK_ACEINNA_CLIENT = 2, 18 | STA_WORK_NTRIP_SERVER = 3, 19 | STA_WORK_MAX = 4 20 | } STATION_WORK_MODE; 21 | 22 | #pragma pack(4) 23 | 24 | typedef struct { 25 | struct netconn *p_netconn; 26 | NETCONN_STATE state; 27 | 28 | uint32_t timeout; 29 | fifo_type tx_fifo; 30 | fifo_type rx_fifo; 31 | uint8_t run; 32 | 33 | TLS_TCP tls_tcp; 34 | TLS_TCP_STATE tls_state; 35 | } STATION_TCP; 36 | 37 | #pragma pack() 38 | 39 | extern int32_t sta_status; 40 | 41 | extern STATION_TCP *p_sta_tcp; 42 | 43 | #define STA_TCP_TXBUF_SIZE 2048 44 | #define STA_TCP_RXBUF_SIZE 2048 45 | extern uint8_t sta_tcp_txbuf[STA_TCP_TXBUF_SIZE]; 46 | extern uint8_t sta_tcp_rxbuf[STA_TCP_RXBUF_SIZE]; 47 | 48 | #define STA_TCP_SEND_BUFFER_SIZE 1024 49 | extern uint8_t sta_tcp_send_buffer[STA_TCP_SEND_BUFFER_SIZE]; 50 | 51 | uint8_t station_tcp_is_interactive(void); 52 | uint8_t station_tcp_is_stream_available(void); 53 | void station_tcp_add_stream_timeout(void); 54 | void station_tcp_clear_stream_timeout(void); 55 | void station_tcp_stop(void); 56 | void station_tcp_send_data(uint8_t* buf, uint16_t len); 57 | uint16_t station_tcp_get_data(uint8_t* buf, uint16_t len); 58 | 59 | void station_tcp_interface(void); 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /LWIP/lwip_app/station/src/ntrip_client.c: -------------------------------------------------------------------------------- 1 | #include "ntrip_client.h" 2 | #include "station_tcp.h" 3 | #include "string.h" 4 | #include "osapi.h" 5 | #include "calibrationAPI.h" 6 | #include "platformAPI.h" 7 | #include "compat-1.3.h" 8 | #include "base64.h" 9 | 10 | /** *************************************************************************** 11 | * @name fill_ntrip_client_request_payload() 12 | * @brief local rtk 13 | * @param *payload point to buffer 14 | * *payloadLen point to buffer length 15 | * @retval N/A 16 | ******************************************************************************/ 17 | static void fill_ntrip_client_request_payload(uint8_t *payload, uint16_t *payloadLen) 18 | { 19 | uint8_t temp[25]; 20 | uint8_t key[100]; 21 | uint8_t base64_buf[128]; 22 | 23 | strcpy((char *)payload, "GET /"); 24 | strcat((char *)payload, (const char *)get_ntrip_client_mount_point()); 25 | strcat((char *)payload, " HTTP/1.1\r\n"); 26 | strcat((char *)payload, "User-Agent: NTRIP Aceinna/0.1\r\n"); 27 | 28 | strcat((char *)payload, "Ntrip-Sn:"); 29 | sprintf((char *)temp, "%ld", GetUnitSerialNum()); 30 | strcat((char *)payload, (const char *)temp); 31 | strcat((char *)payload, "\r\n"); 32 | 33 | strcat((char *)payload, "Ntrip-Pn:"); 34 | strcpy((char *)temp, (const char *)platformBuildInfo()); 35 | for (uint8_t i = 0; i < strlen((const char*)temp); i++) { 36 | if (temp[i] == ' ') { 37 | temp[i] = 0; 38 | break; 39 | } 40 | } 41 | strcat((char *)payload, (const char *)temp); 42 | strcat((char *)payload, "\r\n"); 43 | 44 | strcat((char *)payload, "Authorization: Basic "); 45 | 46 | strcpy((char *)key, (const char *)get_ntrip_client_username()); 47 | strcat((char *)key, ":"); 48 | strcat((char *)key, (const char *)get_ntrip_client_password()); 49 | 50 | size_t len = strlen((const char*)key); 51 | base64_encode(base64_buf, sizeof(base64_buf), &len, key, len); 52 | strcat((char *)payload, (const char *)base64_buf); 53 | strcat((char *)payload, "\r\n\r\n"); 54 | 55 | *payloadLen = strlen((const char *)payload); 56 | } 57 | 58 | int32_t ntrip_client_request(struct netconn *conn, NETCONN_STATE *state, uint8_t *buf, uint16_t size) 59 | { 60 | int32_t res = -1; 61 | uint16_t len = 0; 62 | err_t err = ERR_OK; 63 | 64 | memset(buf, 0, size); 65 | fill_ntrip_client_request_payload(buf, &len); 66 | err = netconn_write(conn, buf, len, NETCONN_COPY); 67 | if (!err) { 68 | OS_Delay(1500); 69 | err = netconn_read(conn, buf, &len, size-1); 70 | if (!err) { 71 | buf[len] = 0; 72 | if (len && strstr((char *)buf, "ICY 200 OK") != NULL) { 73 | res = 0; 74 | } else { 75 | #ifdef STATION_TCP_DEBUG 76 | printf("NTRIP-CLIENT: request fail %s\r\n", buf); 77 | #endif 78 | } 79 | } 80 | } 81 | 82 | netconn_check_ret(err, state); 83 | 84 | return res; 85 | } 86 | -------------------------------------------------------------------------------- /LWIP/lwip_app/user/inc/lwip_comm.h: -------------------------------------------------------------------------------- 1 | #ifndef _LWIP_COMM_H 2 | #define _LWIP_COMM_H 3 | 4 | #include 5 | #include "lwipopts.h" 6 | #include "lwip/ip_addr.h" 7 | #include "lwip/err.h" 8 | #include "user_config.h" 9 | 10 | #define ETH_LINK_DOWN 0 11 | #define ETH_LINK_UP 1 12 | 13 | #define MAX_DHCP_TRIES 5 14 | 15 | typedef enum 16 | { 17 | DHCP_STATE_OFF = 0, 18 | DHCP_STATE_START = 1, 19 | DHCP_STATE_WAIT_ADDRESS = 2, 20 | DHCP_STATE_ADDRESS_ASSIGNED = 3, 21 | DHCP_STATE_TIMEOUT = 4, 22 | DHCP_STATE_LINK_DOWN = 5 23 | } dhcp_state_enum_t; 24 | 25 | extern struct netif gnetif; 26 | extern uint8_t eth_link_state; 27 | extern uint8_t eth_dhcp_state; 28 | 29 | void ethernet_init(void); 30 | 31 | uint8_t dhcp_supplied_address(const struct netif *netif); 32 | void user_notification(struct netif *netif); 33 | void ethernetif_notify_conn_changed(struct netif *netif); 34 | 35 | void set_eth_link_up(void); 36 | void set_eth_link_down(void); 37 | uint8_t is_eth_link_down(void); 38 | 39 | void netif_ethernet_config_changed(void); 40 | void netif_station_tcp_config_changed(void); 41 | void netif_set_static_ip(struct netif *netif); 42 | void dhcp_link_down(void); 43 | uint8_t is_dhcp_address_assigned(void); 44 | 45 | uint8_t* get_netif_ip(void); 46 | uint8_t* get_netif_netmask(void); 47 | uint8_t* get_netif_gateway(void); 48 | 49 | void dhcp_thread(void const *argument); 50 | 51 | err_t get_ip_by_host(const char *host, ip_addr_t *ip); 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /LWIP/lwip_app/user/inc/netbios.h: -------------------------------------------------------------------------------- 1 | #ifndef __NETBIOS_H__ 2 | #define __NETBIOS_H__ 3 | 4 | void netbios_init(void); 5 | 6 | #define NETBIOS_LWIP_NAME "OPENRTK" 7 | 8 | // #define USER_SN_WEB_NAME 9 | 10 | #endif /* __NETBIOS_H__ */ 11 | -------------------------------------------------------------------------------- /LWIP/lwip_app/user/inc/netconn.h: -------------------------------------------------------------------------------- 1 | #ifndef _NETCONN_H_ 2 | #define _NETCONN_H_ 3 | 4 | #include 5 | #include "lwip/err.h" 6 | #include "lwip/api.h" 7 | #include "lwip/opt.h" 8 | #include "lwip_comm.h" 9 | #include "lwip/sys.h" 10 | #include "lwip/api.h" 11 | #include "utils.h" 12 | 13 | // netconn client state 14 | typedef enum 15 | { 16 | NETCONN_STATE_OFF = 0, 17 | NETCONN_STATE_CONNECT = 1, 18 | NETCONN_STATE_REQUEST = 2, 19 | NETCONN_STATE_INTERACTIVE = 3, 20 | NETCONN_STATE_TIMEOUT = 4, 21 | NETCONN_STATE_LINK_DOWN = 5 22 | } NETCONN_STATE; 23 | 24 | err_t netconn_read(struct netconn *conn, uint8_t *buf, uint16_t *len, uint16_t max_length); 25 | err_t netconn_push_rx_data(struct netconn *conn, fifo_type *rx_fifo); 26 | 27 | uint8_t netconn_push_tx_data(NETCONN_STATE *state, fifo_type *tx_fifo, uint8_t *buf, uint16_t len); 28 | uint16_t netconn_get_rx_data(NETCONN_STATE *state, fifo_type *rx_fifo, uint8_t *buf, uint16_t len); 29 | 30 | void netconn_check_ret(err_t err, NETCONN_STATE *state); 31 | void netconn_link_down(NETCONN_STATE *state); 32 | uint8_t netconn_is_interactive(NETCONN_STATE *state); 33 | 34 | #endif /* _TCP_NETCONN_H_ */ 35 | -------------------------------------------------------------------------------- /LWIP/lwip_app/user/inc/tls_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef _TLS_TCP_H_ 2 | #define _TLS_TCP_H_ 3 | 4 | #include 5 | #include "lwip/err.h" 6 | #include "lwip/api.h" 7 | #include "lwip/opt.h" 8 | #include "lwip_comm.h" 9 | #include "lwip/sys.h" 10 | #include "lwip/api.h" 11 | #include "utils.h" 12 | #include "mbedtls_config.h" 13 | #include "mbedtls/platform.h" 14 | #include "mbedtls/net_sockets.h" 15 | #include "mbedtls/debug.h" 16 | #include "mbedtls/ssl.h" 17 | #include "mbedtls/entropy.h" 18 | #include "mbedtls/ctr_drbg.h" 19 | #include "mbedtls/error.h" 20 | #include "mbedtls/certs.h" 21 | #include "mbedtls/memory_buffer_alloc.h" 22 | 23 | typedef enum 24 | { 25 | TLS_TCP_OFF = 0, 26 | TLS_TCP_CONNECT = 1, 27 | TLS_TCP_HANDSHAKE = 2, 28 | TLS_TCP_REQUEST = 3, 29 | TLS_TCP_INTERACTIVE = 4, 30 | TLS_TCP_LINK_DOWN = 5 31 | } TLS_TCP_STATE; 32 | 33 | typedef struct { 34 | mbedtls_net_context server_fd; 35 | mbedtls_entropy_context entropy; 36 | mbedtls_ctr_drbg_context ctr_drbg; 37 | mbedtls_ssl_context ssl; 38 | mbedtls_ssl_config conf; 39 | } TLS_TCP; 40 | 41 | 42 | void tls_tcp_link_down(TLS_TCP_STATE *state); 43 | uint8_t tls_tcp_is_interactive(TLS_TCP_STATE *state); 44 | 45 | int32_t tls_tcp_write(mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len); 46 | int32_t tls_tcp_push_rx_data(mbedtls_ssl_context *ssl, uint8_t *buf, uint16_t size, fifo_type *rx_fifo); 47 | uint8_t tls_tcp_push_tx_data(TLS_TCP_STATE *state, fifo_type *tx_fifo, uint8_t *buf, uint16_t len); 48 | uint16_t tls_tcp_get_rx_data(TLS_TCP_STATE *state, fifo_type *rx_fifo, uint8_t* buf, uint16_t len); 49 | 50 | #endif /* _TLS_TCP_H_ */ 51 | -------------------------------------------------------------------------------- /LWIP/lwip_app/user/src/tls_tcp.c: -------------------------------------------------------------------------------- 1 | #include "tls_tcp.h" 2 | #include "station_tcp.h" 3 | 4 | void tls_tcp_link_down(TLS_TCP_STATE *state) 5 | { 6 | if (*state >= TLS_TCP_CONNECT && *state <= TLS_TCP_INTERACTIVE) { 7 | *state = TLS_TCP_LINK_DOWN; 8 | } 9 | } 10 | 11 | uint8_t tls_tcp_is_interactive(TLS_TCP_STATE *state) 12 | { 13 | return (*state == TLS_TCP_INTERACTIVE); 14 | } 15 | 16 | 17 | int32_t tls_tcp_write(mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len) 18 | { 19 | int32_t ret; 20 | 21 | while ((ret = mbedtls_ssl_write(ssl, buf, len)) <= 0) 22 | { 23 | if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) 24 | { 25 | return -1; 26 | } 27 | } 28 | return 0; 29 | } 30 | 31 | int32_t tls_tcp_push_rx_data(mbedtls_ssl_context *ssl, uint8_t *buf, uint16_t size, fifo_type *rx_fifo) 32 | { 33 | int32_t ret; 34 | uint16_t len = 0; 35 | 36 | ret = mbedtls_ssl_read(ssl, buf, size); 37 | 38 | if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) { 39 | return ret; 40 | } 41 | 42 | if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) { 43 | return ret; 44 | } 45 | 46 | if (ret < 0) { // mbedtls_ssl_read failed 47 | return ret; 48 | } 49 | 50 | if (ret == 0) { // EOF 51 | return ret; 52 | } 53 | 54 | taskENTER_CRITICAL(); 55 | 56 | fifo_push(rx_fifo, buf, ret); 57 | 58 | taskEXIT_CRITICAL(); 59 | 60 | return ret; 61 | } 62 | 63 | uint8_t tls_tcp_push_tx_data(TLS_TCP_STATE *state, fifo_type *tx_fifo, uint8_t *buf, uint16_t len) 64 | { 65 | if (tls_tcp_is_interactive(state)) { 66 | taskENTER_CRITICAL(); 67 | fifo_push(tx_fifo, buf, len); 68 | taskEXIT_CRITICAL(); 69 | return 1; 70 | } 71 | return 0; 72 | } 73 | 74 | uint16_t tls_tcp_get_rx_data(TLS_TCP_STATE *state, fifo_type *rx_fifo, uint8_t* buf, uint16_t len) 75 | { 76 | if (tls_tcp_is_interactive(state)) { 77 | return fifo_get(rx_fifo, buf, len); 78 | } 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /LWIP/lwip_app/webserver/inc/fsdatah.h: -------------------------------------------------------------------------------- 1 | #ifndef __FSDATAH_H__ 2 | #define __FSDATAH_H__ 3 | 4 | #include "lwip/opt.h" 5 | #include "fs.h" 6 | 7 | struct fsdata_file { 8 | const struct fsdata_file *next; 9 | const unsigned char *name; 10 | const unsigned char *data; 11 | int len; 12 | u8_t http_header_included; 13 | #if HTTPD_PRECALCULATED_CHECKSUM 14 | u16_t chksum_count; 15 | const struct fsdata_chksum *chksum; 16 | #endif /* HTTPD_PRECALCULATED_CHECKSUM */ 17 | }; 18 | 19 | #endif /* __FSDATA_H__ */ -------------------------------------------------------------------------------- /OpenARC/aceinna_client_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _ACEINNA_CLIENT_API_H_ 2 | #define _ACEINNA_CLIENT_API_H_ 3 | 4 | #include 5 | 6 | void aceinna_client_init(uint32_t uid); 7 | void aceinna_client_thread(void); 8 | int32_t is_aceinna_client_tls(void); 9 | int32_t aceinna_client_push_nmea(char* buf, uint16_t len); 10 | uint16_t aceinna_client_po_lla_message(int32_t lat, int32_t lon, int32_t alt, uint8_t *buf); 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /OpenARC/libOpenARC.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aceinna/openRTK330-lib/3023995e0766aba636a2e9f7f68a1ab9fc4562a5/OpenARC/libOpenARC.a -------------------------------------------------------------------------------- /OpenARC/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OpenARC", 3 | "version": "1.0.0", 4 | "description": "Aceinna OpenARC library", 5 | "build": { 6 | "flags": [ 7 | "-I ." 8 | ], 9 | "libArchive": true, 10 | "platforms": "aceinna_imu" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Platform/Board/include/configureGPIO.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file configureGPIO.h BSP call to set up GPIO pins 3 | * 4 | *****************************************************************************/ 5 | /******************************************************************************* 6 | Copyright 2020 ACEINNA, INC 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); 9 | you may not use this file except in compliance with the License. 10 | You may obtain a copy of the License at 11 | 12 | http://www.apache.org/licenses/LICENSE-2.0 13 | 14 | Unless required by applicable law or agreed to in writing, software 15 | distributed under the License is distributed on an "AS IS" BASIS, 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | See the License for the specific language governing permissions and 18 | limitations under the License. 19 | *******************************************************************************/ 20 | 21 | #ifndef _CONFIGURE_IO_H_ 22 | #define _CONFIGURE_IO_H_ 23 | 24 | #include 25 | 26 | #include "stm32f4xx.h" 27 | #include "boardDefinition.h" 28 | 29 | void ResetSTIForNormalMode(void); 30 | void ResetSTIForBootMode(void); 31 | 32 | 33 | #endif -------------------------------------------------------------------------------- /Platform/Board/include/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.h 4 | * @brief This file contains the headers of the interrupt handlers. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2019 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | 34 | /* Define to prevent recursive inclusion -------------------------------------*/ 35 | #ifndef __STM32F4xx_IT_H 36 | #define __STM32F4xx_IT_H 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* Includes ------------------------------------------------------------------*/ 43 | #include "stm32f4xx_hal.h" 44 | #include "main.h" 45 | /* Exported types ------------------------------------------------------------*/ 46 | /* Exported constants --------------------------------------------------------*/ 47 | /* Exported macro ------------------------------------------------------------*/ 48 | /* Exported functions ------------------------------------------------------- */ 49 | 50 | void NMI_Handler(void); 51 | void HardFault_Handler(void); 52 | void MemManage_Handler(void); 53 | void BusFault_Handler(void); 54 | void UsageFault_Handler(void); 55 | void SVC_Handler(void); 56 | void DebugMon_Handler(void); 57 | void PendSV_Handler(void); 58 | void SysTick_Handler(void); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* __STM32F4xx_IT_H */ 65 | 66 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 67 | -------------------------------------------------------------------------------- /Platform/Board/src/configureGPIO.c: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file configureGPIO.c, Initialize the GPIO pins to output for the OpenRTK330 3 | * board 4 | * @date September, 2020 5 | * @brief Copyright (c) 2020, 6 | * 7 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 8 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 10 | * PARTICULAR PURPOSE. 11 | * 12 | ******************************************************************************/ 13 | #include "configureGPIO.h" 14 | #include "constants.h" 15 | #include "stm32f4xx_hal_conf.h" 16 | #include "bsp.h" 17 | 18 | void ResetSTIForNormalMode() 19 | { 20 | HAL_GPIO_WritePin(ST_RESET_PORT,ST_RESET_PIN,GPIO_PIN_RESET); 21 | HAL_GPIO_WritePin(ST_BOOT_PORT,ST_BOOT_PIN,GPIO_PIN_RESET); 22 | DelayMs(10); 23 | HAL_GPIO_WritePin(ST_RESET_PORT,ST_RESET_PIN,GPIO_PIN_SET); 24 | DelayMs(10); 25 | } 26 | 27 | void SetBufCtr(uint8_t state) 28 | { 29 | if(state) 30 | HAL_GPIO_WritePin(ST_PROG_BUF_CTL_PORT, ST_PROG_BUF_CTL_PIN, GPIO_PIN_SET); 31 | else 32 | HAL_GPIO_WritePin(ST_PROG_BUF_CTL_PORT, ST_PROG_BUF_CTL_PIN, GPIO_PIN_RESET); 33 | } 34 | 35 | void ResetSTIForBootMode() 36 | { 37 | // SetBufCtr(GPIO_PIN_SET); 38 | SetBufCtr(GPIO_PIN_RESET); 39 | // GPIOC->BSRRH = ST_RESET_PIN; // Set nRST low 40 | HAL_GPIO_WritePin(ST_RESET_PORT,ST_RESET_PIN,GPIO_PIN_RESET); 41 | DelayMs(10); 42 | HAL_GPIO_WritePin(ST_BOOT_PORT ,ST_BOOT_PIN ,GPIO_PIN_SET); 43 | // GPIOB->BSRRL = ST_BOOT_PIN; // Set BOOT pin high 44 | DelayMs(10); 45 | // GPIOC->BSRRL = ST_RESET_PIN; // Set nRST high 46 | HAL_GPIO_WritePin(ST_RESET_PORT,ST_RESET_PIN,GPIO_PIN_SET); 47 | DelayMs(10); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Platform/CAN/include/can.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : can.h 3 | * Author : ymj 4 | * Revision : 1.0 5 | * Date : 3/31/2020 6 | * Description : can.h 7 | * 8 | * HISTORY*********************************************************************** 9 | * 3/31/2020 | | ymj 10 | * Description: create 11 | *******************************************************************************/ 12 | 13 | #ifndef _CAN_H_ 14 | #define _CAN_H_ 15 | 16 | #include 17 | #include "constants.h" 18 | #include "stm32f4xx_hal.h" 19 | 20 | // supported baud rate 21 | typedef enum { 22 | _ECU_125K = 0, // 125kbps 23 | _ECU_250K = 1, // 250kbps 24 | _ECU_500K = 2, // 500kbps 25 | _ECU_1000K = 3 // 1000kbps 26 | } _ECU_BAUD_RATE; 27 | 28 | // MTLT's state machine 29 | typedef enum { 30 | DESC_IDLE = 0, // ready for being used 31 | DESC_OCCUPIED = 1, // unavailable 32 | DESC_PENDING = 2 // in queue 33 | } DESC_STATE; 34 | 35 | // MTLT's ODR on CAN 36 | enum { 37 | CAN_PACKET_RATE_0 = 0, //quiet 38 | CAN_PACKET_RATE_2 = 2, // 2Hz 39 | CAN_PACKET_RATE_5 = 5, // 5Hz 40 | CAN_PACKET_RATE_10 = 10, // 10Hz 41 | CAN_PACKET_RATE_20 = 20, // 20Hz 42 | CAN_PACKET_RATE_25 = 25, // 25Hz 43 | CAN_PACKET_RATE_50 = 50, // 50Hz 44 | CAN_PACKET_RATE_100 = 100, // 100Hz 45 | }; 46 | 47 | typedef struct 48 | { 49 | CAN_TxHeaderTypeDef tx_header; 50 | uint8_t data[8]; 51 | } CanTxMsg; 52 | 53 | typedef struct 54 | { 55 | CAN_RxHeaderTypeDef rx_header; 56 | uint8_t data[8]; 57 | } CanRxMsg; 58 | 59 | #define CAN_ERROR -1 60 | #define CAN_NO_ERROR 1 61 | 62 | #define USER_CAN_IDE 1 63 | #define USER_CAN_RTR 0 64 | 65 | #define CAN_BAUD_RATE_RETRY 4 // retry times for baud rate auto detection 66 | #define CAN_DETECT_TIME 3000 // ms, listening period at each of channels 67 | 68 | extern uint32_t canRxIntCounter, canStartDetectRxIntCounter; 69 | extern uint32_t filterNum; 70 | 71 | void can_config(uint8_t mode, int baudRate); 72 | void can_config_filter_mask_message(uint32_t baseID, uint32_t baseMask); 73 | void can_config_filter_list_message(uint32_t ID1, uint32_t ID2); 74 | void can_config_filter_clear(void); 75 | void can_rtx_fun_config(void (*callback1)(void), void(*callback2)(void)); 76 | BOOL can_transmit(CanTxMsg* canTxMsg); 77 | BOOL can_detect_baudrate(_ECU_BAUD_RATE *rate); 78 | 79 | 80 | #endif -------------------------------------------------------------------------------- /Platform/CAN/include/car_data.h: -------------------------------------------------------------------------------- 1 | #ifndef _CAR_DATA_H_ 2 | #define _CAR_DATA_H_ 3 | 4 | #include 5 | #include "constants.h" 6 | #include "timer.h" 7 | 8 | #define CAR_CAN_ID_WHEEL_SPEED 0xAA 9 | 10 | typedef struct { 11 | uint32_t update; 12 | uint32_t week; 13 | double timestamp; 14 | float speed_FR; 15 | float speed_FL; 16 | float speed_RR; 17 | float speed_RL; 18 | float speed_combined; 19 | uint8_t fwd; 20 | } WHEEL_SPEED_STRUCT; 21 | 22 | void car_can_initialize(void); 23 | void can_config_filter_car(void); 24 | void car_can_data_process(uint32_t stdId, uint8_t* data); 25 | uint8_t car_get_wheel_speed(double *car_speed, uint8_t *fwd, uint32_t *week, double *timestamp); 26 | 27 | 28 | 29 | #endif /* _CAR_DATA_H_ */ 30 | -------------------------------------------------------------------------------- /Platform/CAN/include/taskCanCommunicationJ1939.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file taskCANCommunicationDBC.h 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | * 9 | * sensor data acquisition task runs at 100Hz, gets the data for each sensor 10 | * and applies available calibration 11 | ******************************************************************************/ 12 | /******************************************************************************* 13 | Copyright 2018 ACEINNA, INC 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | *******************************************************************************/ 27 | 28 | #ifndef _TASK_CAN_H_ 29 | #define _TASK_CAN_H_ 30 | 31 | #include "stdint.h" 32 | #include "constants.h" 33 | 34 | void TaskCANCommunicationJ1939(void const *argument); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Platform/CAN/include/user_message_can.h: -------------------------------------------------------------------------------- 1 | #ifndef USER_MESSAGING_CAN_H 2 | #define USER_MESSAGING_CAN_H 3 | 4 | #include 5 | #include "constants.h" 6 | 7 | void process_request_packet(void *dsc); 8 | void process_data_packet(void *dsc); 9 | 10 | void enqeue_periodic_packets(void); 11 | void process_ecu_commands(void * command, uint8_t ps, uint8_t addr); 12 | 13 | void can_config_filter_j1939(void); 14 | 15 | #endif /* USER_CONFIGURATION_H */ 16 | -------------------------------------------------------------------------------- /Platform/Driver/include/driver.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : driver.h 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 10/10/2019 6 | * Description : drive head file 7 | * 8 | * HISTORY*********************************************************************** 9 | * 10/10/2019 | | Daich 10 | * HISTORY*********************************************************************** 11 | * 16/12/2019 | | Daich 12 | * Description: add return type RTK_JSON 13 | * 06/01/2020 | | Daich 14 | * Description: add BT_CMD BT_BASE function 15 | *******************************************************************************/ 16 | #ifndef _DRIVER_H_ 17 | #define _DRIVER_H_ 18 | //#pragma once 19 | #include "constants.h" 20 | 21 | typedef enum rtk_ret_e_ 22 | { 23 | RTK_FAIL = 0, 24 | RTK_OK = 1, 25 | RTK_SEM_OK = 2, 26 | UART_ERR = 10, 27 | RTK_JSON = 100, 28 | BT_CMD = 101, 29 | BT_BASE = 102, 30 | }rtk_ret_e; 31 | 32 | //typedef int bool; 33 | 34 | #endif -------------------------------------------------------------------------------- /Platform/Driver/include/exit.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : exit.h 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 18/10/2019 6 | * Description : exit.h 7 | * 8 | * HISTORY*********************************************************************** 9 | * 18/10/2019 | | Daich 10 | * Description: create 11 | *******************************************************************************/ 12 | #ifndef _EXIT_H_ 13 | #define _EXIT_H_ 14 | //#pragma once 15 | void pps_exit_init(void); 16 | extern uint8_t get_gnss_signal_flag(); 17 | void PULSE_IRQ(); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Platform/Driver/include/led.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : led.h 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 11/10/2019 6 | * Description : led drive head file 7 | * 8 | * HISTORY*********************************************************************** 9 | * 11/10/2019 | | Daich 10 | * Description: create 11 | * HISTORY*********************************************************************** 12 | * 11/10/2019 | | Daich 13 | * Description: modift LED_ON LED_OFF LED(x,y) 14 | *******************************************************************************/ 15 | #ifndef _LED_H_ 16 | #define _LED_H_ 17 | #include "driver.h" 18 | #include "boardDefinition.h" 19 | 20 | #define ON GPIO_PIN_SET 21 | #define OFF GPIO_PIN_RESET 22 | #define TOOGLE 2 23 | 24 | 25 | 26 | #define LED_STATUS_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 27 | #define LED_RTCM_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 28 | #define LED_PPS_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 29 | 30 | 31 | 32 | #define LED_STATUS_PORT LED1_PORT 33 | #define LED_STATUS_PIN LED1_PIN 34 | 35 | #define LED_RTCM_PORT LED2_PORT 36 | #define LED_RTCM_PIN LED2_PIN 37 | 38 | #define LED_PPS_PORT LED3_PORT 39 | #define LED_PPS_PIN LED3_PIN 40 | 41 | #define LED_STATUS_ON (HAL_GPIO_WritePin(LED_STATUS_PORT, LED_STATUS_PIN, GPIO_PIN_RESET)) 42 | #define LED_STATUS_OFF (HAL_GPIO_WritePin(LED_STATUS_PORT, LED_STATUS_PIN, GPIO_PIN_SET)) 43 | #define LED_STATUS_TOOGLE() (HAL_GPIO_TogglePin(LED_STATUS_PORT, LED_STATUS_PIN)) 44 | #define LED_STATUS(x) ((x) ? HAL_GPIO_WritePin(LED_STATUS_PORT, LED_STATUS_PIN, GPIO_PIN_RESET) : \ 45 | HAL_GPIO_WritePin(LED_STATUS_PORT, LED_STATUS_PIN, GPIO_PIN_SET)) 46 | 47 | #define LED_PPS_ON (HAL_GPIO_WritePin(LED_PPS_PORT, LED_PPS_PIN, GPIO_PIN_RESET)) 48 | #define LED_PPS_OFF (HAL_GPIO_WritePin(LED_PPS_PORT, LED_PPS_PIN, GPIO_PIN_SET)) 49 | #define LED_PPS_TOOGLE() (HAL_GPIO_TogglePin(LED_PPS_PORT, LED_PPS_PIN)) 50 | #define LED_PPS(x) ((x) ? HAL_GPIO_WritePin(LED_PPS_PORT, LED_PPS_PIN, GPIO_PIN_RESET) : \ 51 | HAL_GPIO_WritePin(LED_PPS_PORT, LED_PPS_PIN, GPIO_PIN_SET)) 52 | 53 | 54 | #define LED_RTCM_ON (HAL_GPIO_WritePin(LED_RTCM_PORT, LED_RTCM_PIN, GPIO_PIN_RESET)) 55 | #define LED_RTCM_OFF (HAL_GPIO_WritePin(LED_RTCM_PORT, LED_RTCM_PIN, GPIO_PIN_SET)) 56 | #define LED_RTCM_TOOGLE() (HAL_GPIO_TogglePin(LED_RTCM_PORT, LED_RTCM_PIN)) 57 | #define LED_RTCM(x) ((x) ? HAL_GPIO_WritePin(LED_RTCM_PORT, LED_RTCM_PIN, GPIO_PIN_RESET) : \ 58 | HAL_GPIO_WritePin(LED_RTCM_PORT, LED_RTCM_PIN, GPIO_PIN_SET)) 59 | 60 | #define LED(x,y) ((y) ? ((y==2)?x ##_TOOGLE():x ##_ON): x ##_OFF) 61 | 62 | rtk_ret_e led_driver_install(); 63 | void LED1_On(void); 64 | void LED2_On(void); 65 | void LED3_On(void); 66 | void LED1_Off(void); 67 | void LED2_Off(void); 68 | void LED3_Off(void); 69 | void LED1_Toggle(void); 70 | void LED2_Toggle(void); 71 | void LED3_Toggle(void); 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /Platform/Driver/include/rng.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNG_H_ 2 | #define _RNG_H_ 3 | 4 | #include 5 | 6 | void RNG_Init(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Platform/Driver/include/spi.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : spi.h 3 | * Author : yundong 4 | * Revision : 1.0 5 | * Date : 2020/03/23 6 | * Description : spi drive head file 7 | *******************************************************************************/ 8 | #ifndef _SPI_H_ 9 | #define _SPI_H_ 10 | 11 | #include "stm32f4xx_hal.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #define SPI_BUF_SIZE (434) 18 | 19 | 20 | extern SPI_HandleTypeDef hspi5; 21 | void MX_SPI5_Init(void); 22 | 23 | extern uint8_t spi_buff[SPI_BUF_SIZE]; 24 | extern uint8_t spi_ready_flag; 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif -------------------------------------------------------------------------------- /Platform/Driver/include/timer.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : timer.h 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 10/10/2019 6 | * Description : timer.h 7 | * 8 | * HISTORY*********************************************************************** 9 | * 18/10/2019 | | Daich 10 | * Description: create 11 | * 18/10/2019 | | Daich 12 | * Description: //#define UART_BLOCK to save memory 13 | * 25/10/2019 | | Neil 14 | * Description: modify double get_time_of_msec(),Otherwise, a data overflow will occur 15 | *******************************************************************************/ 16 | #ifndef _TIMER_H_ 17 | #define _TIMER_H_ 18 | //#pragma once 19 | #include 20 | #include "cmsis_os.h" 21 | typedef struct mcu_time_base_t_ 22 | { 23 | time_t time; 24 | time_t msec; 25 | } mcu_time_base_t; 26 | 27 | extern volatile mcu_time_base_t g_MCU_time; 28 | 29 | void MX_TIM1_Init(void); 30 | void MX_TIM_SENSOR_Init(void); 31 | time_t get_time_of_msec(); 32 | volatile mcu_time_base_t *get_mcu_time(); 33 | 34 | void release_sem(osSemaphoreId sem); 35 | double get_gnss_time(); 36 | #endif 37 | -------------------------------------------------------------------------------- /Platform/Driver/include/uart.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : uart.h 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 10/10/2019 6 | * Description : uart drive head file 7 | * 8 | * HISTORY*********************************************************************** 9 | * 10/10/2019 | | Daich 10 | * Description: create 11 | * 16/10/2019 | | Daich 12 | * Description: //#define UART_BLOCK to save memory 13 | *******************************************************************************/ 14 | #ifndef _UART_H_ 15 | #define _UART_H_ 16 | //#pragma once 17 | #include "driver.h" 18 | #include "utils.h" 19 | #include 20 | #include "osapi.h" 21 | 22 | #include "stm32f4xx_hal.h" 23 | //#define OFFLINE_DEBUG 24 | 25 | #if 0 26 | #define UART_USER_BASE USART1 27 | #define UART_BT_BASE USART2 28 | #define UART_GPS_BASE USART3 29 | #define UART_DEBUG_BASE UART5 30 | #endif 31 | #define UART_USER_BASE UART5 //TODO: 32 | #define UART_BT_BASE USART2 33 | #define UART_GPS_BASE USART3 34 | #define UART_DEBUG_BASE USART1 35 | 36 | extern UART_HandleTypeDef huart_debug; 37 | extern UART_HandleTypeDef huart_user; 38 | extern UART_HandleTypeDef huart_bt; 39 | extern UART_HandleTypeDef huart_gps; 40 | extern DMA_HandleTypeDef hdma_usart_user_rx; 41 | extern DMA_HandleTypeDef hdma_usart_user_tx; 42 | extern DMA_HandleTypeDef hdma_uart_debug_rx; 43 | extern DMA_HandleTypeDef hdma_uart_debug_tx; 44 | extern DMA_HandleTypeDef hdma_usart_gps_rx; 45 | extern DMA_HandleTypeDef hdma_usart_gps_tx; 46 | extern DMA_HandleTypeDef hdma_usart_bt_rx; 47 | extern DMA_HandleTypeDef hdma_usart_bt_tx; 48 | 49 | extern fifo_type uart_gps_rx_fifo; 50 | extern fifo_type uart_debug_rx_fifo; 51 | extern fifo_type uart_bt_rx_fifo; 52 | extern fifo_type uart_user_rx_fifo; 53 | 54 | #define USER_UART_DMA_FIFO 55 | #define DEBUG_UART_DMA_FIFO 56 | 57 | #ifdef USER_UART_DMA_FIFO 58 | #define UART_TX_FIFO_MANAGE_NUM 1 59 | 60 | #define DMA_TX_FIFO_BUF_SIZE 2048 61 | #define DEBUG_DMA_TX_FIFO_BUF_SIZE (1024*4) 62 | typedef struct _uart_tx_fifo 63 | { 64 | fifo_type uart_tx_fifo; 65 | uint32_t frame_num; 66 | uint32_t data_total_num; 67 | uint32_t is_data_available; 68 | uint8_t is_dma_busy; //TODO: 69 | } uart_tx_dma_fifo_s; 70 | #endif 71 | 72 | //#define UART_BLOCK 73 | typedef enum 74 | { 75 | UART_USER = 0x00, 76 | UART_BT = 0x01, 77 | UART_GPS = 0x02, 78 | UART_DEBUG = 0x03, 79 | UART_MAX, 80 | } uart_port_e; 81 | 82 | struct uart_config_t 83 | { 84 | int uart_base_addr; 85 | uint32_t rec_buff_size; 86 | uint8_t *rec_buff; 87 | DMA_HandleTypeDef *hdma_usart_rx; 88 | DMA_HandleTypeDef *hdma_usart_tx; 89 | }; 90 | 91 | typedef struct 92 | { 93 | uart_port_e uart_num; 94 | int baudrate; 95 | #ifdef UART_BLOCK 96 | osSemaphoreId rx_sem; 97 | osSemaphoreId tx_sem; 98 | #endif 99 | osSemaphoreId uart_idle_sem; 100 | bool init_flag; 101 | fifo_type *uart_rx_fifo; 102 | UART_HandleTypeDef *huart; 103 | DMA_HandleTypeDef *hdma_usart_rx; 104 | DMA_HandleTypeDef *hdma_usart_tx; 105 | } uart_obj_t; 106 | 107 | int uart_read_bytes(uart_port_e uart_num, uint8_t *buf, uint32_t len, TickType_t ticks_to_wait); 108 | int uart_driver_install(uart_port_e uart_num, fifo_type *uart_rx_fifo, UART_HandleTypeDef *huart, int baudrate); 109 | rtk_ret_e uart_driver_delete(uart_port_e uart_num); 110 | int uart_write_bytes(uart_port_e uart_num, const char *src, size_t size, bool is_wait); 111 | void update_fifo_in(uart_port_e uart_num); 112 | rtk_ret_e uart_sem_wait(uart_port_e uart_num, uint32_t millisec); 113 | #endif -------------------------------------------------------------------------------- /Platform/Driver/src/exit.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : exit.c 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 18/10/2019 6 | * Description : exit.c 7 | * 8 | * HISTORY*********************************************************************** 9 | * 18/10/2019 | | Daich 10 | * Description: create 11 | *******************************************************************************/ 12 | #include "stm32f4xx_hal.h" 13 | #include "boardDefinition.h" 14 | #include "exit.h" 15 | #include "timer.h" 16 | #include "gnss_data_api.h" 17 | #include "led.h" 18 | #include "bsp.h" 19 | #include "uart.h" 20 | #include "osapi.h" 21 | #include "string.h" 22 | #include "app_version.h" 23 | #include "ins_interface_API.h" 24 | 25 | volatile mcu_time_base_t g_obs_rcv_time; 26 | 27 | 28 | __weak uint8_t get_gnss_signal_flag() 29 | { 30 | return 0; 31 | } 32 | __weak time_t get_obs_time() 33 | { 34 | return 0; 35 | } 36 | 37 | 38 | void pps_exit_init(void) 39 | { 40 | // pps 41 | GPIO_InitTypeDef GPIO_InitStruct; 42 | GPIO_InitStruct.Pin = ST_PPS_PIN; 43 | GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; 44 | GPIO_InitStruct.Pull = GPIO_PULLUP; 45 | HAL_GPIO_Init(ST_PPS_PORT, &GPIO_InitStruct); 46 | /* EXTI interrupt init*/ 47 | HAL_NVIC_SetPriority(ST_PPS_IRQn, 2, 0); 48 | HAL_NVIC_EnableIRQ(ST_PPS_IRQn); 49 | } 50 | 51 | 52 | extern volatile mcu_time_base_t g_MCU_time; 53 | uint8_t g_pps_flag = 0; 54 | extern uint32_t usCnt; 55 | extern TIM_HandleTypeDef htim_sensor; 56 | void ST_PPS_IRQ(void) 57 | { 58 | OSEnterISR(); 59 | LED_PPS_TOOGLE(); 60 | 61 | g_pps_flag = 1; 62 | uint8_t PPSstate = HAL_GPIO_ReadPin(ST_PPS_PORT,ST_PPS_PIN); 63 | if (PPSstate == 0) 64 | { 65 | if (g_MCU_time.msec < 500) 66 | { 67 | g_MCU_time.msec = 499; 68 | htim_sensor.Instance->CNT = 44960; 69 | } 70 | else if(g_MCU_time.msec > 500) 71 | { 72 | g_MCU_time.msec = 500; 73 | htim_sensor.Instance->CNT = 1; 74 | } 75 | 76 | if (strstr((char *)APP_VERSION_STRING, "RAWDATA")) 77 | { 78 | if(get_gnss_signal_flag() && (g_MCU_time.msec - g_obs_rcv_time.msec) >= 0 && (g_MCU_time.time == g_obs_rcv_time.time)) 79 | g_MCU_time.time = get_obs_time(); 80 | } 81 | 82 | 83 | } 84 | HAL_GPIO_EXTI_IRQHandler(ST_PPS_PIN); 85 | OSExitISR(); 86 | } 87 | 88 | 89 | void PULSE_IRQ() 90 | { 91 | add_wheel_tick_count(); 92 | set_wheel_tick_fwd(HAL_GPIO_ReadPin(FWD_PORT,FWD_PIN)); 93 | HAL_GPIO_EXTI_IRQHandler(PULSE_PIN); 94 | } 95 | 96 | -------------------------------------------------------------------------------- /Platform/Driver/src/led.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : led.c 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 11/10/2019 6 | * Description : led drive source file 7 | * 8 | * HISTORY*********************************************************************** 9 | * 11/10/2019 | | Daich 10 | * Description: create 11 | *******************************************************************************/ 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include "stm32f4xx_hal.h" 17 | #include "led.h" 18 | #include "driver.h" 19 | 20 | 21 | rtk_ret_e led_driver_install() 22 | { 23 | GPIO_InitTypeDef gpio_init_structure; 24 | 25 | LED_STATUS_CLK_ENABLE(); 26 | LED_RTCM_CLK_ENABLE(); 27 | LED_PPS_CLK_ENABLE(); 28 | 29 | // Configure the GPIO_LED pins 30 | gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP; 31 | gpio_init_structure.Pull = GPIO_PULLUP; 32 | gpio_init_structure.Speed = GPIO_SPEED_HIGH; 33 | // LED1 34 | gpio_init_structure.Pin = LED_STATUS_PIN; 35 | HAL_GPIO_Init(LED_STATUS_PORT, &gpio_init_structure); 36 | HAL_GPIO_WritePin(LED_STATUS_PORT, LED_STATUS_PIN, GPIO_PIN_SET); 37 | 38 | // LED2 39 | gpio_init_structure.Pin = LED_RTCM_PIN; 40 | HAL_GPIO_Init(LED_RTCM_PORT, &gpio_init_structure); 41 | // By default, turn off LED by setting a high level on corresponding GPIO 42 | HAL_GPIO_WritePin(LED_RTCM_PORT, LED_RTCM_PIN, GPIO_PIN_SET); 43 | 44 | // LED3 45 | gpio_init_structure.Pin = LED_PPS_PIN; 46 | HAL_GPIO_Init(LED_PPS_PORT, &gpio_init_structure); 47 | // By default, turn off LED by setting a high level on corresponding GPIO 48 | HAL_GPIO_WritePin(LED_PPS_PORT, LED_PPS_PIN, GPIO_PIN_SET); 49 | return RTK_OK; 50 | } 51 | 52 | 53 | void LED1_On(void) 54 | { 55 | HAL_GPIO_WritePin(LED1_PORT, LED1_PIN, GPIO_PIN_RESET); 56 | } 57 | 58 | void LED2_On(void) 59 | { 60 | HAL_GPIO_WritePin(LED2_PORT, LED2_PIN, GPIO_PIN_RESET); 61 | } 62 | 63 | void LED3_On(void) 64 | { 65 | HAL_GPIO_WritePin(LED3_PORT, LED3_PIN, GPIO_PIN_RESET); 66 | } 67 | 68 | void LED1_Off(void) 69 | { 70 | HAL_GPIO_WritePin(LED1_PORT, LED1_PIN, GPIO_PIN_SET); 71 | } 72 | 73 | void LED2_Off(void) 74 | { 75 | HAL_GPIO_WritePin(LED2_PORT, LED2_PIN, GPIO_PIN_SET); 76 | } 77 | 78 | void LED3_Off(void) 79 | { 80 | HAL_GPIO_WritePin(LED3_PORT, LED3_PIN, GPIO_PIN_SET); 81 | } 82 | 83 | void LED1_Toggle(void) 84 | { 85 | HAL_GPIO_TogglePin(LED1_PORT, LED1_PIN); 86 | } 87 | 88 | void LED2_Toggle(void) 89 | { 90 | HAL_GPIO_TogglePin(LED2_PORT, LED2_PIN); 91 | } 92 | 93 | void LED3_Toggle(void) 94 | { 95 | HAL_GPIO_TogglePin(LED3_PORT, LED3_PIN); 96 | } -------------------------------------------------------------------------------- /Platform/Driver/src/rng.c: -------------------------------------------------------------------------------- 1 | #include "rng.h" 2 | #include "stm32f4xx_hal.h" 3 | 4 | RNG_HandleTypeDef RngHandle; 5 | /** *************************************************************************** 6 | * @name RNG_Init 7 | * @brief N/A 8 | * @retval N/A 9 | ******************************************************************************/ 10 | void RNG_Init(void) 11 | { 12 | RngHandle.Instance = RNG; 13 | if (HAL_RNG_Init(&RngHandle) != HAL_OK) 14 | { 15 | Error_Handler(); 16 | } 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /Platform/Filter/include/lowpass_filter.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file lowpass_filter.h 3 | * @Author 4 | * @date March, 2017 5 | * @brief Copyright (c) 2017 All Rights Reserved. 6 | * 7 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 8 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 10 | * PARTICULAR PURPOSE. 11 | * 12 | * generic accelerometer interface, it should be implemented 13 | * by whichever accelerometer is in use 14 | *****************************************************************************/ 15 | #ifndef LOWPASS_FILTER_H 16 | #define LOWPASS_FILTER_H 17 | 18 | #define BWF_LOWPASS_3RD_2 0 19 | #define BWF_LOWPASS_3RD_5 1 20 | #define BWF_LOWPASS_3RD_10 2 21 | #define BWF_LOWPASS_3RD_20 3 22 | #define BWF_LOWPASS_3RD_25 4 23 | #define BWF_LOWPASS_3RD_40 5 24 | #define BWF_LOWPASS_3RD_50 6 25 | #define BWF_LOWPASS_3RD_INF 7 26 | 27 | #define BWF_LOWPASS_DATA_RATE_400 0 28 | #define BWF_LOWPASS_DATA_RATE_800 1 29 | 30 | #define LPF_100HZ 100 31 | #define LPF_50HZ 50 32 | #define LPF_40HZ 40 33 | #define LPF_25HZ 25 34 | #define LPF_20HZ 20 35 | #define LPF_10HZ 10 36 | #define LPF_5HZ 5 37 | #define LPF_UNFIL 0 38 | 39 | 40 | 41 | extern uint8_t _rateFilt_3rdOrderBWF_LowPass_Axis(uint8_t, int16_t, int32_t *, uint8_t, uint8_t); 42 | extern uint8_t _accelFilt_3rdOrderBWF_LowPass_Axis(uint8_t, int16_t, int32_t *, uint8_t, uint8_t); 43 | 44 | extern uint8_t _rateFilt_4thOrderBWF_LowPass_Axis_cascaded2nd(uint8_t, uint8_t, int16_t, int32_t *, uint8_t, uint8_t); 45 | extern uint8_t _accelFilt_4thOrderBWF_LowPass_Axis_cascaded2nd(uint8_t, uint8_t, int16_t, int32_t *, uint8_t, uint8_t); 46 | 47 | extern uint8_t _rateFilt_3rdOrderBWF_LowPass_Axis_cascaded1st(uint8_t chip, uint8_t, int16_t, int32_t *, uint8_t, uint8_t); 48 | extern uint8_t _accelFilt_3rdOrderBWF_LowPass_Axis_cascaded1st(uint8_t chip, uint8_t, int16_t, int32_t *, uint8_t, uint8_t); 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /Platform/bluetooth/include/bt_packet.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | #ifndef _BT_PACKET_H_ 3 | #define _BT_PACKET_H_ 4 | 5 | #include 6 | 7 | #define BT_CMD_NUM 2 8 | #define CMD_MAX_LEN 20 9 | 10 | 11 | enum BT_CMD_TYPE 12 | { 13 | RTK_MES_CMD = 0, 14 | RTK_SN_CMD, 15 | BT_CMD_MAX 16 | }; 17 | 18 | int bt_uart_parse(uint8_t* bt_buff); 19 | 20 | #endif 21 | #else 22 | /******************************************************************************* 23 | * File Name : bt_packet.h 24 | * Author : daich 25 | * Revision : 1.0 26 | * Date : 27 | * Description : bt_packet.h 28 | * 29 | * HISTORY*********************************************************************** 30 | * 24/04/2020 | | Daich 31 | * Description: created 32 | *******************************************************************************/ 33 | 34 | #ifndef _BT_INTERFACE_H_ 35 | #define _BT_INTERFACE_H_ 36 | #include "stdint.h" 37 | #include "constants.h" 38 | #include "stdio.h" 39 | 40 | 41 | #define BT_CMD_NUM 2 42 | #define CMD_MAX_LEN 20 43 | enum BT_CMD_TYPE 44 | { 45 | RTK_MES_CMD = 0, 46 | RTK_SN_CMD, 47 | BT_CMD_MAX 48 | }; 49 | 50 | #define SHELL_ENABLE false 51 | #define SHELL_TASK false 52 | #define SHELL_RX_MAX (256+32) 53 | #define SHELL_TX_MAX (512) 54 | 55 | bool is_cmd_right(void * buffer,void * cmd); 56 | void shell_service(void); 57 | void debug_uart_handle(void); 58 | void ConsoleTask(void const *argument); 59 | void parse_debug_cmd(); 60 | int bt_uart_parse(uint8_t* bt_buff); 61 | #endif 62 | #endif -------------------------------------------------------------------------------- /Platform/bluetooth/include/json_parse.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * File Name : json_parse.h 3 | * Author : Daich 4 | * Revision : 1.0 5 | * Date : 29/09/2019 6 | * Description : json_parse.h 7 | * 8 | * HISTORY*********************************************************************** 9 | * 29/09/2019 | | Daich 10 | * 06/01/2020 | | Daich 11 | * Description: add send_rtk_json_message function to send openrtk board message 12 | *******************************************************************************/ 13 | #ifndef _JSON_PARSE_H_ 14 | #define _JSON_PARSE_H_ 15 | #include "cJSON.h" 16 | 17 | #define json_true 1 18 | #define json_false -1 19 | 20 | int json_create(); 21 | int change_item(char *text,char* json_to_write,char* key,char* value); 22 | void create_json_object(cJSON** json); 23 | void send_rtk_json_message(cJSON* root); 24 | char* get_rtk_json_item_value(cJSON *json,char* key); 25 | void send_rtk_json_to_esp32(); 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /Platform/commAPI.h: -------------------------------------------------------------------------------- 1 | /** ****************************************************************************** 2 | * @file commAPI.h API for referencing serial communication functions 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | * 9 | *****************************************************************************/ 10 | /******************************************************************************* 11 | Copyright 2020 ACEINNA, INC 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | *******************************************************************************/ 25 | 26 | 27 | #ifndef _COMM_API_H 28 | #define _COMM_API_H 29 | 30 | extern uint8_t odospeed_packet_rate; 31 | extern uint8_t odospeed_packet_divide; 32 | 33 | extern void ProcessUserCommands(void); 34 | extern void send_continuous_packet(void); 35 | extern void debug_com_process(void); 36 | extern void send_ins_to_bt(void); 37 | extern void handle_tcp_commands(void); 38 | #endif 39 | -------------------------------------------------------------------------------- /Platform/common/include/Indices.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File: Indices.h 3 | * Author: joemotyka 4 | * 5 | * Created on April 10, 2016, 10:12 PM 6 | *******************************************************************************/ 7 | /******************************************************************************* 8 | Copyright 2020 ACEINNA, INC 9 | 10 | Licensed under the Apache License, Version 2.0 (the "License"); 11 | you may not use this file except in compliance with the License. 12 | You may obtain a copy of the License at 13 | 14 | http://www.apache.org/licenses/LICENSE-2.0 15 | 16 | Unless required by applicable law or agreed to in writing, software 17 | distributed under the License is distributed on an "AS IS" BASIS, 18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | See the License for the specific language governing permissions and 20 | limitations under the License. 21 | *******************************************************************************/ 22 | 23 | #ifndef INDICES_H 24 | #define INDICES_H 25 | 26 | #include 27 | 28 | #define X_AXIS 0 29 | #define Y_AXIS 1 30 | #define Z_AXIS 2 31 | #define NUM_AXIS 3 32 | 33 | #define ROLL 0 34 | #define PITCH 1 35 | #define YAW 2 36 | 37 | #define ACCEL_SENSOR 1 38 | #define RATE_SENSOR 2 39 | #define MAG_SENSOR 3 40 | 41 | #define NUM_SENSOR_CHIPS 3 42 | #define NUM_SENSORS 3 43 | 44 | /* sensors order in raw and scaled sensors data structures */ 45 | enum rawSensor_e 46 | { 47 | XACCEL = 0, 48 | YACCEL = 1, 49 | ZACCEL = 2, 50 | XRATE = 3, 51 | YRATE = 4, 52 | ZRATE = 5, 53 | XMAG = 6, 54 | CHIP_TEMP = 6, 55 | YMAG = 7, 56 | ZMAG = 8, 57 | XATEMP = 9, 58 | YATEMP = 10, 59 | ZATEMP = 11, 60 | XRTEMP = 12, 61 | YRTEMP = 13, 62 | ZRTEMP = 14, 63 | BTEMP = 15, 64 | N_RAW_SENS = 16 // size 65 | }; 66 | 67 | /// raw sensor order (from dmu.h) 68 | enum eSensorOrder 69 | { 70 | ACCEL_START = 0, 71 | RATE_START = 3, 72 | MAG_START = 6, 73 | NUM_SENSOR_IN_AXIS = 9, 74 | TEMP_START = 9, 75 | GYRO_TEMP = 9, 76 | TEMP_SENSOR = 10, 77 | NUM_SENSOR_READINGS = 11 78 | }; 79 | #define NUM_SENSOR_CHIPS 3 80 | #define NUM_SENSORS 3 // from dmu.h 81 | 82 | #define Q0 0 83 | #define Q1 1 84 | #define Q2 2 85 | #define Q3 3 86 | 87 | #define LAT 0 88 | #define LON 1 89 | #define ALT 2 90 | 91 | enum NED_Index 92 | { 93 | GPS_NORTH = 0, 94 | GPS_EAST = 1, 95 | GPS_DOWN = 2 96 | }; 97 | 98 | #endif /* INDICES_H */ 99 | -------------------------------------------------------------------------------- /Platform/common/include/nav_math.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _NAV_MATH_H 3 | #define _NAV_MATH_H 4 | 5 | #include 6 | 7 | void mat_vec_mult3d(const double* M, const double* v, double* mv); 8 | void matmulvec3x1(const double M[3][3], const double *v, double *mv); 9 | 10 | void ecef2pos(const double *r, double *pos); 11 | void deg2dms(double deg, double *dms, int ndec); 12 | void blh2C_en(const double *blh, double C_en[3][3]); 13 | void ecef2ned(const double *xyz, double *ned); 14 | void pos2ecef(const double *pos, double *r); 15 | 16 | #endif /* _NAV_MATH_H */ -------------------------------------------------------------------------------- /Platform/common/include/scaling.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file scaling.h 3 | * @Author 4 | * @date September, 2008 5 | * @brief Copyright (c) 2013, 2014 All Rights Reserved. 6 | * 7 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 8 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 10 | * PARTICULAR PURPOSE. 11 | * 12 | * macros to define various power of 2, fixed point and constant scalsing 13 | ******************************************************************************/ 14 | #ifndef SCALING_H 15 | #define SCALING_H 16 | 17 | 18 | /// pre-computed values 19 | #define SCALE_BY_8(value) ( (value) * 8.0 ) 20 | #define SCALE_BY_2POW16_OVER_2PI(value) ( (value) * 10430.37835047045 ) // 65536 / (2.0 * PI) 21 | #define SCALE_BY_2POW16_OVER_7PI(value) ( (value) * 2980.108100134415 ) // 65536 / (7.0 * PI) 22 | #define SCALE_BY_2POW16_OVER_2(value) ( (value) * 32768.0 ) // 65536 / 2 23 | #define SCALE_BY_2POW16_OVER_16(value) ( (value) * 4096.0 ) // 5536 / 16 24 | #define SCALE_BY_2POW16_OVER_20(value) ( (value) * 3276.8 ) // 65536 / 20 25 | #define SCALE_BY_2POW16_OVER_64(value) ( (value) * 1024.0 ) // 65536 / 64 26 | #define SCALE_BY_2POW16_OVER_128(value) ( (value) * 512.0 ) // 65536 / 128 27 | #define SCALE_BY_2POW16_OVER_200(value) ( (value) * 327.68 ) // 65536 / 200 28 | #define SCALE_BY_2POW16_OVER_512(value) ( (value) * 128.0 ) // 65536 / 512 29 | 30 | #define SCALE_BY_2POW32_OVER_2PI(value) ( (value) * 683565287.23678304) // 4294967296 / 2 * PI 31 | #define SCALE_BY_2POW16_OVER_2POW14(value) ( (value) * 4.0 ) // 65536 / 16384 32 | 33 | #define TWO_OVER_TWO_POW16_q30 32768 34 | #define TWENTY_OVER_TWO_POW16_q30 327680 35 | #define TWOPI_OVER_MAXINT16_q30 205894 36 | 37 | #define TWO_POW16_OVER_7PI_q19 1562434916 // floor( 2^16/( 7*pi ) * 2^19 ) 38 | #define TWO_POW16_OVER_20_q19 1717986918 // floor( 2^16/20 * 2^19 ) 39 | #define TWO_POW16_OVER_2_q15 1073741824 // floor( 2^16/2 * 2^15 ) 40 | #define TWO_POW16_OVER_200_q22 1374389534 // floor( 2^16/200 * 2^22 ) 41 | //#define TWO_POW16_OVER_20_q19 1717986918 // floor( 2^16/20 * 2^19 ) 42 | #define TWO_POW16_TIMES_100_OVER_7PI_q12 298011 // floor( 2^16/( 7*pi ) * 2^12 ) 43 | 44 | #define TWO_POW16_OVER_128_q21 1073741824 // floor( 2^16/200 * 2^22 ) 45 | #define TWO_POW16_OVER_512_q23 128 46 | 47 | #define TWO_POW16_OVER_2PI_q17 1367130551 48 | #define TWO_POW19_OVER_7PI_q16 23841 49 | 50 | #define MAXUINT16_OVER_2PI 10430.21919552736 51 | #define DEGREES_TO_RADS 0.017453292519943 52 | #define RADS_TO_DEGREES 57.29577951308232 53 | #define ITAR_RATE_LIMIT 7.15585 // 410 dps * DEGREES_TO_RADS 54 | 55 | #define MAXINT16_OVER_2PI 5215.030020292134 //( MAXINT16 / TWOPI) 56 | #define MAXUINT16_OVER_512 127.9980468750000 // ( MAXUINT16 / 512.0) 57 | #define MAXUINT16_OVER_2 32768.0 //( MAXUINT16 / 2.0) 58 | 59 | // For magCal() 60 | #define MAXINT16_OVER_2PI_q18 1367088830 61 | 62 | #define MAXINT32_20BIT_OVER131072M 8 // 2^20/(2^17) 63 | 64 | /// INT32_TO_MISALIGN_SCALING = 1/2^( 32 - 5 ) as per the definition of misalign 65 | /// in DMU Serial Interface Spec 66 | #define INT32_TO_MISALIGN_SCALING 7.450580596923828e-09 67 | 68 | /// BOARD_TEMP_SCALE_FACTOR = 1/256 = 0.00390625 from the TMP102 datasheet 69 | /// ( shift 4-bits due to buffer and 4-bits for scaling) 70 | #define BOARD_TEMP_SCALE_FACTOR 0.00390625 71 | #define BOARD_TEMP_SCALE_FACTOR_q30 419430 72 | 73 | /// GYRO_TEMP_SCALE_FACTOR = 1/256 = 0.00390625 from the Maxim21000 datasheet 74 | #define MAXIM21000_TEMP_SCALE_FACTOR 0.00390625 75 | #define BMI160_TEMP_SCALE_FACTOR 0.001953125 76 | #define BMI160_TEMP_OFFSET 23.0 77 | #endif 78 | 79 | -------------------------------------------------------------------------------- /Platform/common/include/utils.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * @file: utils.h 3 | *******************************************************************************/ 4 | /******************************************************************************* 5 | Copyright 2020 ACEINNA, INC 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | *******************************************************************************/ 19 | 20 | 21 | #ifndef _UTILS_H 22 | #define _UTILS_H 23 | 24 | #include 25 | 26 | #include "gnss_data_api.h" 27 | 28 | #define GPS_BUFF_SIZE (2000) 29 | #define IMU_BUFF_SIZE (2000) 30 | #define DEBUG_BUFF_SIZE (2000) 31 | 32 | 33 | typedef struct 34 | { 35 | uint8_t* buffer; 36 | uint16_t in; 37 | uint16_t out; 38 | uint16_t size; 39 | } fifo_type; 40 | 41 | 42 | void fifo_init(fifo_type* fifo, uint8_t* buffer, uint16_t size); 43 | uint16_t fifo_get(fifo_type* fifo, uint8_t* buffer, uint16_t len); 44 | uint16_t fifo_status(fifo_type* fifo); 45 | void fifo_push(fifo_type* fifo, uint8_t* buffer, uint16_t size); 46 | 47 | char *i2a(int num, char *str, int radix); 48 | void float2arr(double data, char *a, unsigned char id, unsigned char dd); 49 | 50 | int print_nmea_gga(double *ep, double *xyz, int nsat, int type, double dop, 51 | double age, char *buff); 52 | int print_pos_gga(gtime_t time, double *pos, int num_of_sat, int fixID, 53 | double hdop, double age, char *gga); 54 | 55 | 56 | #endif /* _UTILS_H */ 57 | 58 | 59 | -------------------------------------------------------------------------------- /Platform/common/src/nav_math.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "constants.h" 4 | #include "nav_math.h" 5 | 6 | #define matrix_at(A, x, y, rownum) ((A)[(x) + (rownum) * (y)]) 7 | 8 | void mat_vec_mult3d(const double* M, const double* v, double* mv) 9 | { 10 | for (int32_t i = 0; i < 3; i++) { 11 | mv[i] = 0.0; 12 | for (int32_t j = 0; j < 3; j++) { 13 | mv[i] += matrix_at(M, i, j, 3) * v[j]; 14 | } 15 | } 16 | } 17 | 18 | void matmulvec3x1(const double M[3][3], const double *v, double *mv) 19 | { 20 | mv[0] = M[0][0] * v[0] + M[1][0] * v[1] + M[2][0] * v[2]; 21 | mv[1] = M[0][1] * v[0] + M[1][1] * v[1] + M[2][1] * v[2]; 22 | mv[2] = M[0][2] * v[0] + M[1][2] * v[1] + M[2][2] * v[2]; 23 | } 24 | 25 | void ecef2pos(const double *r, double *pos) 26 | { 27 | double e2 = FE_WGS84 * (2.0 - FE_WGS84), r2 = r[0] * r[0] + r[1] * r[1]; 28 | double z, zk, v = RE_WGS84, sinp; 29 | 30 | for (z = r[2], zk = 0.0; fabs(z - zk) >= 1E-4;) 31 | { 32 | zk = z; 33 | sinp = z / sqrt(r2 + z * z); 34 | v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp); 35 | z = r[2] + v * e2 * sinp; 36 | } 37 | pos[0] = r2 > 1E-12 ? atan(z / sqrt(r2)) : (r[2] > 0.0 ? PI / 2.0 : -PI / 2.0); 38 | pos[1] = r2 > 1E-12 ? atan2(r[1], r[0]) : 0.0; 39 | pos[2] = sqrt(r2 + z * z) - v; 40 | } 41 | 42 | void deg2dms(double deg, double *dms, int ndec) 43 | { 44 | double sign = deg < 0.0 ? -1.0 : 1.0, a = fabs(deg); 45 | double unit = pow(0.1, ndec); 46 | dms[0] = floor(a); 47 | a = (a - dms[0]) * 60.0; 48 | dms[1] = floor(a); 49 | a = (a - dms[1]) * 60.0; 50 | dms[2] = floor(a / unit + 0.5) * unit; 51 | if (dms[2] >= 60.0) 52 | { 53 | dms[2] = 0.0; 54 | dms[1] += 1.0; 55 | if (dms[1] >= 60.0) 56 | { 57 | dms[1] = 0.0; 58 | dms[0] += 1.0; 59 | } 60 | } 61 | dms[0] *= sign; 62 | } 63 | 64 | void blh2C_en(const double *blh, double C_en[3][3]) 65 | { 66 | /* blh => C_en */ 67 | double lat = blh[0], lon = blh[1]; /*, ht = blh[2];*/ 68 | C_en[0][0] = -sin(lat) * cos(lon); 69 | C_en[1][0] = -sin(lat) * sin(lon); 70 | C_en[2][0] = cos(lat); 71 | C_en[0][1] = -sin(lon); 72 | C_en[1][1] = cos(lon); 73 | C_en[2][1] = 0.0; 74 | C_en[0][2] = -cos(lat) * cos(lon); 75 | C_en[1][2] = -cos(lat) * sin(lon); 76 | C_en[2][2] = -sin(lat); 77 | return; 78 | } 79 | 80 | void ecef2ned(const double *xyz, double *ned) 81 | { 82 | double C_en[3][3]; 83 | double blh[3] = {0.0}; 84 | 85 | ecef2pos(xyz, blh); 86 | blh2C_en(blh, C_en); 87 | 88 | ned[0] = C_en[0][0] * xyz[0] + C_en[1][0] * xyz[1] + C_en[2][0] * xyz[2]; 89 | ned[1] = C_en[0][1] * xyz[0] + C_en[1][1] * xyz[1] + C_en[2][1] * xyz[2]; 90 | ned[2] = C_en[0][2] * xyz[0] + C_en[1][2] * xyz[1] + C_en[2][2] * xyz[2]; 91 | } 92 | 93 | /* transform geodetic to ecef position ----------------------------------------- 94 | * transform geodetic position to ecef position 95 | * args : double *pos I geodetic position {lat,lon,h} (rad,m) 96 | * double *r O ecef position {x,y,z} (m) 97 | * return : none 98 | * notes : WGS84, ellipsoidal height 99 | *-----------------------------------------------------------------------------*/ 100 | void pos2ecef(const double *pos, double *r) 101 | { 102 | double sinp = sin(pos[0]), cosp = cos(pos[0]), sinl = sin(pos[1]); 103 | double cosl = cos(pos[1]); 104 | double e2 = FE_WGS84 * (2.0 - FE_WGS84); 105 | double v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp); 106 | 107 | r[0] = (v + pos[2]) * cosp * cosl; 108 | r[1] = (v + pos[2]) * cosp * sinl; 109 | r[2] = (v * (1.0 - e2) + pos[2]) * sinp; 110 | } -------------------------------------------------------------------------------- /Platform/common/src/platform.c: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file xbowsp_init.c Initialization for UCB's Comm. and Cal. 3 | * @Author dan 4 | * @date 2011-02-09 22:02:39 -0800 (Wed, 09 Feb 2011) 5 | * @brief Copyright (c) 2013, 2014 All Rights Reserved. 6 | * @rev 17479 7 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 8 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 10 | * PARTICULAR PURPOSE. 11 | * @version 12 | * DKH 10.02.14 set sensor range based on EEPROM config 13 | *****************************************************************************/ 14 | #include 15 | #include 16 | 17 | //***************************** 18 | // #include "BitStatus.h" 19 | #include "platform_version.h" 20 | #include "constants.h" 21 | 22 | int userSerialChan; 23 | int gpsSerialChan; 24 | int debugSerialChan; 25 | 26 | BOOL fSPI = FALSE; 27 | BOOL fUART = FALSE; 28 | 29 | // BITStatusStruct gBitStatus; 30 | 31 | 32 | BOOL platformHasMag() 33 | { 34 | return FALSE; 35 | } 36 | 37 | 38 | BOOL _useExtSync = FALSE; 39 | 40 | BOOL platformIsExtSyncUsed(void) 41 | { 42 | return _useExtSync; 43 | } 44 | 45 | void platformEnableExtSync(BOOL enable) 46 | { 47 | _useExtSync = enable; 48 | } 49 | 50 | char *platformBuildInfo() 51 | { 52 | return SOFTWARE_PART; 53 | } 54 | 55 | uint32_t _commType = UART_COMM; 56 | 57 | uint32_t platformGetUnitCommunicationType() 58 | { 59 | return _commType; 60 | } 61 | 62 | void platformSetUserCommunicationType(uint32_t type) 63 | { 64 | if(type != UART_COMM && type != SPI_COMM && type != CAN_BUS){ 65 | return; 66 | } 67 | _commType = type; 68 | } 69 | 70 | int platformGetSysRange() 71 | { 72 | return _400_DPS_RANGE; 73 | } 74 | 75 | 76 | BOOL bootMode = FALSE; 77 | 78 | BOOL platformIsInBootMode() 79 | { 80 | return bootMode; 81 | } 82 | 83 | void platformSetMode(BOOL isBoot) 84 | { 85 | bootMode = isBoot; 86 | } 87 | 88 | void platformGetVersionBytes(uint8_t *bytes) 89 | { 90 | bytes[0] = (uint8_t)VERSION_MAJOR_NUM; 91 | bytes[1] = (uint8_t)VERSION_MINOR_NUM; 92 | bytes[2] = (uint8_t)VERSION_PATCH_NUM; 93 | bytes[3] = (uint8_t)VERSION_STAGE_NUM; 94 | bytes[4] = (uint8_t)VERSION_BUILD_NUM; 95 | } 96 | 97 | /*end void initConfigureUnit(void) */ 98 | -------------------------------------------------------------------------------- /Platform/configurationAPI.h: -------------------------------------------------------------------------------- 1 | /** ****************************************************************************** 2 | * @file configurationAPI.h API functions for Interfacing with unit configurationb parameters 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | * 9 | *****************************************************************************/ 10 | /******************************************************************************* 11 | Copyright 2020 ACEINNA, INC 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | *******************************************************************************/ 25 | 26 | 27 | #ifndef _CONFIG_API_H 28 | #define _GONFIG_API_H 29 | #include 30 | 31 | #include "constants.h" 32 | 33 | // IMU related functions 34 | uint16_t configGetSensorFilterTypeForSPI(); 35 | int configGetAccelLfpFreq(); 36 | int configGetRateLfpFreq(); 37 | uint16_t configGetPrefilterFreq(); 38 | uint16_t configGetUsedChips(void); 39 | uint16_t configGetActiveChips(void); 40 | uint16_t configGetUsedSensors(int chipIdx); 41 | void configSetUsedSensors(int idx, uint8_t mask); 42 | void configSetUsedChips(uint8_t mask); 43 | 44 | void ApplyFactoryConfiguration(); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /Platform/crc/include/crc.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | * File name: crc.h 3 | * 4 | * File description: 5 | * - header file for CRC functions 6 | * 7 | *********************************************************************************/ 8 | 9 | #ifndef CRC_H 10 | #define CRC_H 11 | #include 12 | 13 | typedef uint16_t CrcCcittType; 14 | typedef uint32_t Crc32Type; 15 | 16 | #define CRC_CCITT_LENGTH 2 17 | #define CRC_32_LENGTH 4 18 | 19 | #define CRC_CCITT_INITIAL_SEED 0x1d0f 20 | #define CRC_32_INITIAL_SEED 0xffffffff 21 | 22 | extern CrcCcittType CrcCcitt (const uint8_t data [], uint16_t length, const CrcCcittType seed); 23 | extern Crc32Type Crc32 (const uint8_t data [], uint16_t length, const Crc32Type seed); 24 | extern void CrcCcittTypeToBytes (CrcCcittType type, uint8_t bytes []); 25 | extern CrcCcittType BytesToCrcCcittType (const uint8_t bytes []); 26 | extern void Crc32TypeToBytes (Crc32Type type, uint8_t bytes []); 27 | extern Crc32Type BytesToCrc32Type (const uint8_t bytes []); 28 | uint16_t initCRC_16bit (uint16_t v, uint16_t seed); 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /Platform/crc/include/crc16.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRC16_H 2 | #define __CRC16_H 3 | 4 | uint16_t CalculateCRC (uint8_t *buf, uint16_t length); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /Platform/crc/src/crc16.c: -------------------------------------------------------------------------------- 1 | #include "stdint.h" 2 | #include "crc16.h" 3 | 4 | 5 | uint16_t CalculateCRC (uint8_t *buf, uint16_t length) 6 | { 7 | uint16_t crc = 0x1D0F; //non-augmented inital value equivalent to the augmented initial value 0xFFFF 8 | 9 | for (int i=0; i < length; i++) { 10 | crc ^= buf[i] << 8; 11 | 12 | for (int j=0; j<8; j++) { 13 | if (crc & 0x8000) { 14 | crc = (crc << 1) ^ 0x1021; 15 | } 16 | else { 17 | crc = crc << 1; 18 | } 19 | } 20 | } 21 | 22 | return ((crc << 8 ) & 0xFF00) | ((crc >> 8) & 0xFF); 23 | } 24 | -------------------------------------------------------------------------------- /Platform/gnss_data_api.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file gnss_data_api.h GNSS data API for algorithm and I/O layer 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | *****************************************************************************/ 9 | /******************************************************************************* 10 | Copyright 2020 ACEINNA, INC 11 | 12 | Licensed under the Apache License, Version 2.0 (the "License"); 13 | you may not use this file except in compliance with the License. 14 | You may obtain a copy of the License at 15 | 16 | http://www.apache.org/licenses/LICENSE-2.0 17 | 18 | Unless required by applicable law or agreed to in writing, software 19 | distributed under the License is distributed on an "AS IS" BASIS, 20 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | See the License for the specific language governing permissions and 22 | limitations under the License. 23 | *******************************************************************************/ 24 | 25 | #ifndef _GNSS_DATA_API_H 26 | #define _GNSS_DATA_API_H 27 | 28 | #include 29 | 30 | #include "constants.h" 31 | #include "rtcm.h" 32 | #include "timer.h" 33 | 34 | #pragma pack(1) 35 | 36 | typedef struct { 37 | uint8_t satelliteId; 38 | uint8_t systemId; 39 | uint8_t antennaId; 40 | uint8_t l1cn0; 41 | uint8_t l2cn0; 42 | float azimuth; 43 | float elevation; 44 | float snr; 45 | } satellite_struct; 46 | 47 | typedef struct { 48 | uint16_t gps_week; 49 | uint32_t gps_tow; // gps Time Of Week, miliseconds 50 | 51 | uint8_t gnss_fix_type; // 1 if data is valid 52 | uint8_t vel_mode; 53 | uint8_t gnss_update; // 1 if contains new data 54 | uint8_t num_sats; // num of satellites in the solution 55 | 56 | double latitude; // latitude , degrees 57 | double longitude; // longitude, degrees 58 | double height; // above mean sea level [m] 59 | double pos_ecef[3]; 60 | float vel_ned[3]; // velocities, m/s NED (North East Down) x, y, z 61 | float heading; // [deg] 62 | 63 | float dops[5]; 64 | float sol_age; 65 | 66 | float std_lat; //!< latitude standard deviation (m) 67 | float std_lon; //!< longitude standard deviation (m) 68 | float std_hgt; //!< height standard deviation (m) 69 | float std_vn; 70 | float std_ve; 71 | float std_vd; 72 | 73 | uint8_t rov_n; 74 | satellite_struct rov_satellite[MAXOBS]; 75 | } gnss_solution_t; 76 | 77 | typedef struct { 78 | uint8_t rov_n; 79 | satellite_struct rov_satellite[MAXOBS]; 80 | } sky_view_t; 81 | #pragma pack() 82 | 83 | extern gnss_solution_t g_gnss_sol; 84 | extern gnss_solution_t* g_ptr_gnss_sol; 85 | 86 | 87 | typedef struct { /* rtcm data struct */ 88 | gnss_rtcm_t rtcm; /* store RTCM data struct for RTK and PPP */ 89 | 90 | /* for algorithm */ 91 | obs_t rov; 92 | obs_t ref; 93 | nav_t nav; 94 | } gnss_raw_data_t; 95 | extern gnss_raw_data_t *g_ptr_gnss_data; 96 | 97 | extern uint8_t rtcm_decode_completion; 98 | extern uint32_t rtcm_decode_length; 99 | 100 | extern int input_rtcm3_data(rtcm_t *rtcm, unsigned char data, obs_t *obs, nav_t *nav); 101 | extern int input_rtcm3(unsigned char data, unsigned int stnID, gnss_rtcm_t *gnss); 102 | 103 | #endif /* _GNSS_DATA_API_H */ 104 | -------------------------------------------------------------------------------- /Platform/hwAPI.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file hwAPI.h 4 | ****************************************************************************** 5 | */ 6 | #ifndef __HW_API_H 7 | #define __HW_API_H 8 | 9 | #include "stdint.h" 10 | #include "constants.h" 11 | 12 | 13 | // GPIO - related fucntions 14 | void HW_SetTestMode(BOOL fOn); 15 | BOOL HW_IsTestOK(); 16 | 17 | // system related functions 18 | void HW_SystemReset(void); 19 | BOOL HW_IsBootModeEnforced(); 20 | void HW_EnforceBootMode(); 21 | BOOL HW_IsAppModeEnforced(); 22 | void HW_EnforceAppMode(); 23 | void HW_HDTestMode(); 24 | void HW_ClearBootSignature(); 25 | bool IsNeedToHardwareTest(); 26 | BOOL IsNeedToUpdateApp(); 27 | 28 | extern BOOL fSPI; 29 | extern BOOL fUART; 30 | 31 | 32 | #endif //__UART_H -------------------------------------------------------------------------------- /Platform/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Platform", 3 | "version": "1.0.5", 4 | "description": "OpenRTK platform library", 5 | "build": { 6 | "flags": [ 7 | "-I .", 8 | "-I CAN/include", 9 | "-I Board/include", 10 | "-I Filter/include", 11 | "-I BT/include", 12 | "-I Driver/inc" 13 | ], 14 | "libArchive": true, 15 | "platforms": "aceinna_imu" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Platform/platformAPI.h: -------------------------------------------------------------------------------- 1 | /** ****************************************************************************** 2 | * @file platformAPI.h API functions for Interfacing with xbow library funcctions 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | * 9 | *****************************************************************************/ 10 | /******************************************************************************* 11 | Copyright 2020 ACEINNA, INC 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); 14 | you may not use this file except in compliance with the License. 15 | You may obtain a copy of the License at 16 | 17 | http://www.apache.org/licenses/LICENSE-2.0 18 | 19 | Unless required by applicable law or agreed to in writing, software 20 | distributed under the License is distributed on an "AS IS" BASIS, 21 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | See the License for the specific language governing permissions and 23 | limitations under the License. 24 | *******************************************************************************/ 25 | 26 | 27 | #ifndef _PLATFORM_API_H 28 | #define _PLATFORM_API_H 29 | 30 | 31 | #include 32 | 33 | #include "constants.h" 34 | 35 | BOOL eepromLocked(void); 36 | BOOL lockEeprom(void); 37 | BOOL unlockEeprom(void); 38 | BOOL userApplicationActive(void); 39 | BOOL platformHasMag(); 40 | int platformGetSysRange(); 41 | int platformGetUnitCommunicationType(void); 42 | BOOL platformSetUnitCommunicationType(int type); 43 | void platformEnableMag(BOOL enable); 44 | extern char *unitVersionString(void); 45 | extern uint32_t unitSerialNumber(void); 46 | extern uint8_t unitSpiSwVersion(void); 47 | extern char *platformBuildInfo(void); 48 | void platormReset(); 49 | BOOL platformCanBaudRateDetectEnabled(); 50 | BOOL platformCanTermResistorEnabled(); 51 | void markEEPROMUnlocked(); 52 | void markEEPROMLocked(); 53 | BOOL readFlash(uint32_t addr, uint8_t *buf, uint16_t len); 54 | void platformUnassignSerialChannels(); 55 | BOOL platformAssignPortTypeToSerialChannel(int portType, int channel); 56 | int platformGetSerialChannel(int portType); 57 | void platformRegisterRxSerialSemaphoreID(int portType, void *semId); 58 | void platformGetVersionBytes(uint8_t *bytes); 59 | BOOL platformApplyOrientation(uint16_t input); 60 | int platformGetSensToPpsDelay(); 61 | int platformGetPpsToDrdyDelay(); 62 | uint64_t platformGetCurrTimeStamp(); 63 | uint64_t platformGetDacqTimeStamp(); 64 | void platformPerformSelfTest(); 65 | void platformSetDacqTimeStamp(uint64_t tstamp); 66 | int platformEnableExtSync(BOOL enable); 67 | void platformSetMode(BOOL isBoot); 68 | BOOL platformIsInBootMode(); 69 | 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /Platform/platform_version.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * @file platform_version.h 3 | * 4 | * @brief Platfor version definition 5 | ******************************************************************************/ 6 | #ifndef _PLATFORM_VERSION_H 7 | #define _PLATFORM_VERSION_H 8 | 9 | // DO NOT CHANGE THESE NUMBERS FROM ZERO! CAUSES A CONFLICT WITH 10 | // IMUTest RESULTING IN ACCELEROMETER VALUES THAT ARE FLIPPED (WHAT 11 | // SHOULD BE POSITIVE BECOMES NEGATIVE). 12 | #define VERSION_MAJOR 0 13 | #define VERSION_MINOR 0 14 | #define VERSION_PATCH 0 15 | #define VERSION_STAGE 0 16 | #define VERSION_BUILD 0 17 | 18 | #define VERSION_MAJOR_NUM 19 19 | #define VERSION_MINOR_NUM 1 20 | #define VERSION_PATCH_NUM 1 21 | #define VERSION_STAGE_NUM 0 22 | #define VERSION_BUILD_NUM 3 23 | 24 | /// Software-version/part-number 25 | // changing the version number changes the CRC for the EEPROM memory so to avoid 26 | // BIT failure the CRC must be updated if the version number is incremented 27 | // Note: if the part number is changed before calibration the cal calculates 28 | // and sets the CRC in EEPROM 29 | // 30 | // 1 2 31 | // 12345678901234567890 32 | 33 | #define SOFTWARE_PART "5020-3021-01 23.00" // openrtk330 34 | 35 | 36 | #define SOFTWARE_PART_LEN 50 37 | #define VERSION_STR SOFTWARE_PART 38 | #define N_VERSION_STR 128 39 | 40 | #endif /* _PLATFORM_VERSION_H */ 41 | -------------------------------------------------------------------------------- /Platform/serial/include/serial_port.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file extern_port.h functions for general external port interface 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | * 9 | * @brief UCB (Unified Code Base) external serial interface 10 | * external communication port structures 11 | *****************************************************************************/ 12 | /******************************************************************************* 13 | Copyright 2020 ACEINNA, INC 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | *******************************************************************************/ 27 | 28 | #ifndef EXTERN_PORT_H 29 | #define EXTERN_PORT_H 30 | 31 | #include 32 | #include "constants.h" 33 | #include "ucb_packet.h" 34 | 35 | extern BOOL HandleUcbRx (UcbPacketStruct *ptrUcbPacket); 36 | extern void HandleUcbTx (int port, UcbPacketStruct *ptrUcbPacket); 37 | extern void reset_user_packet_divide(void); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Platform/serial/include/ucb_packet.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file ucb_packet.h utility functions for interfacing with Memsic proprietary 3 | * UCB (unified code base) packets. UCB packet structure 4 | * @Author rhilles 5 | * @date 2010-08-03 10:20:52 -0700 (Tue, 03 Aug 2010) 6 | * @rev 15924 7 | * @brief Copyright (c) 2013, 2014 All Rights Reserved. 8 | * 9 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY O ANY 10 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 11 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 12 | * PARTICULAR PURPOSE. 13 | * 14 | * @brief these are in ucb_packet_types.def on the 440 these were in 15 | * xbowProtocol.h 16 | *****************************************************************************/ 17 | #ifndef UCB_PACKET_H 18 | #define UCB_PACKET_H 19 | 20 | #include "stdio.h" 21 | #include "constants.h" 22 | 23 | #define UCB_SYNC_LENGTH 2 24 | #define UCB_PACKET_TYPE_LENGTH 2 25 | #define UCB_PAYLOAD_LENGTH_LENGTH 1 26 | #define UCB_CRC_LENGTH 2 27 | 28 | #define UCB_SYNC_INDEX 0 29 | #define UCB_PACKET_TYPE_INDEX (UCB_SYNC_INDEX + UCB_SYNC_LENGTH) 30 | #define UCB_PAYLOAD_LENGTH_INDEX (UCB_PACKET_TYPE_INDEX + UCB_PACKET_TYPE_LENGTH) 31 | 32 | 33 | #define UCB_MAX_PAYLOAD_LENGTH 255 34 | #define UCB_USER_IN 200 35 | #define UCB_USER_OUT 201 36 | #define UCB_ERROR_INVALID_TYPE 202 37 | 38 | 39 | typedef struct { 40 | uint16_t packetType; 41 | uint16_t packetCode; 42 | }ucb_packet_t; 43 | 44 | typedef struct { 45 | uint16_t packetType; 46 | uint8_t packetCode[2]; 47 | }usr_packet_t; 48 | 49 | 50 | typedef struct { 51 | uint8_t packetType; // 0 52 | uint8_t sync_MSB; // 3 53 | uint8_t sync_LSB; // 4 54 | uint8_t code_MSB; // 5 55 | uint8_t code_LSB; // 6 56 | uint8_t payloadLength; // 7 57 | uint8_t payload[UCB_MAX_PAYLOAD_LENGTH + 3]; // aligned to 4 bytes 58 | } UcbPacketStruct; 59 | 60 | // NEEDS TO BE CHECKED 61 | // Xbow Packet Code 62 | typedef enum 63 | { 64 | UCB_PING, // 0 PK 0x504B input packets 65 | UCB_SOFTWARE_RESET, // 11 SR 0x5352 66 | UCB_WRITE_APP, // 14 WA 0x5743 67 | UCB_J2BOOT, // 15 JB 0x4A42 68 | UCB_J2IAP, // 16 JI 0x4A49 69 | UCB_J2APP, // 17 JA 0x4A41 70 | UCB_INPUT_PACKET_MAX, 71 | //************************************************** 72 | UCB_IDENTIFICATION, // 18 ID 0x4944 output packets 73 | UCB_VERSION_DATA, // 19 VR 0x4652 74 | UCB_VERSION_ALL_DATA, // 20 VA 0x5641 75 | //************************************************** 76 | UCB_PKT_NONE, // 27 marker after last valid packet 77 | UCB_NAK, // 28 78 | } UcbPacketType; 79 | 80 | 81 | #define UCB_IDENTIFICATION_LENGTH 69 82 | #define UCB_VERSION_DATA_LENGTH 5 83 | #define UCB_VERSION_ALL_DATA_LENGTH 15 84 | 85 | 86 | /// UCB packet-specific utility functions ucb_packet.c 87 | extern UcbPacketType ucbpacket_bytes_to_type (const uint8_t bytes []); 88 | extern BOOL ucbpacket_type_to_bytes (UcbPacketType type, uint8_t bytes []); 89 | extern BOOL UcbPacketIsAnOutputPacket(UcbPacketType type); 90 | 91 | // send_packet.c 92 | extern void SendUcbPacket(uint16_t port, UcbPacketStruct *ptrUcbPacket); 93 | // handle packet.c 94 | extern void HandleUcbPacket(UcbPacketStruct *ptrUcbPacket); 95 | 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Aceinna OpenRTK330L Module Open Source Firmware Library 2 | 3 | 4 | 5 | ## Introduction 6 | 7 | Aceinna's OpenRTK330L is a GNSS/IMU integrated high-precision positioning module that is targeted for vehicular applications, for example autonomous-driving. The module's base firmware library is open-sourced for user to play with raw IMU data generation, data I/O customization and so on. Note the Aceinna's proprietary GNSS/INS algorithm library is NOT open-sourced but provided in the form of a static library. 8 | 9 | ## Usage 10 | 11 | This library repo is designed to work with the open-sourced IMU platform, i.e. the Github repo "platform_aceinna-imu" under the same organization. Please clone the "platform_aceinna-imu" repo and go to "example" subfolder to build the various "Apps" inside. These Apps automatically clones this base library repo for a complete project. 12 | 13 | ### Release notes 14 | 15 | **v1.0.8**, Nov. 25, 2020 16 | 17 | - New support to configure OpenRTK330LI EVK as a light-weight GNSS base station broadcasting RTCM raw data to user configurable NTRIP server 18 | - Version numbering changed to v23.00 (Aceinna company wide unification) 19 | - Corrections and code clean-up to previous release version v1.0.7 20 | 21 | **v1.0.7**, Oct. 19, 2020 22 | 23 | - Updated for "RTK_INS" App v2.0.0 24 | - Added CAN interface for data I/O 25 | - Speed measurement input from car CAN bus, for GNSS/INS/Odometer integrated positioning 26 | - Standard J1939 CAN message output 27 | - Added wheel-tick speed interface for GNSS/INS/Odometer integrated positioning -------------------------------------------------------------------------------- /STM32F469/CMSIS/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /STM32F469/CMSIS/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /STM32F469/CMSIS/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /STM32F469/CMSIS/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aceinna/openRTK330-lib/3023995e0766aba636a2e9f7f68a1ab9fc4562a5/STM32F469/CMSIS/stm32f4xx.h -------------------------------------------------------------------------------- /STM32F469/HAL/Inc/stm32_assert_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32_assert.h 4 | * @author MCD Application Team 5 | * @brief STM32 assert template file. 6 | * This file should be copied to the application folder and renamed 7 | * to stm32_assert.h. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT(c) 2017 STMicroelectronics

12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | ****************************************************************************** 36 | */ 37 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ 39 | #ifndef __STM32_ASSERT_H 40 | #define __STM32_ASSERT_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /* Exported types ------------------------------------------------------------*/ 47 | /* Exported constants --------------------------------------------------------*/ 48 | /* Includes ------------------------------------------------------------------*/ 49 | /* Exported macro ------------------------------------------------------------*/ 50 | #ifdef USE_FULL_ASSERT 51 | /** 52 | * @brief The assert_param macro is used for function's parameters check. 53 | * @param expr If expr is false, it calls assert_failed function 54 | * which reports the name of the source file and the source 55 | * line number of the call that failed. 56 | * If expr is true, it returns no value. 57 | * @retval None 58 | */ 59 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) 60 | /* Exported functions ------------------------------------------------------- */ 61 | void assert_failed(uint8_t* file, uint32_t line); 62 | #else 63 | #define assert_param(expr) ((void)0U) 64 | #endif /* USE_FULL_ASSERT */ 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __STM32_ASSERT_H */ 71 | 72 | 73 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 74 | -------------------------------------------------------------------------------- /STM32F469/HAL/Src/hal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __HAL_H 3 | #define __HAL_H 4 | 5 | #include "stm32f4xx_hal.h" 6 | #define HAL_431 431 7 | 8 | #endif /* __HAL_H */ 9 | -------------------------------------------------------------------------------- /STM32F469/HAL/Src/stm32f4xx_hal_ltdc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aceinna/openRTK330-lib/3023995e0766aba636a2e9f7f68a1ab9fc4562a5/STM32F469/HAL/Src/stm32f4xx_hal_ltdc.c -------------------------------------------------------------------------------- /STM32F469/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "STM32F469", 3 | "version": "1.0.1", 4 | "description": "STM32F469 MCU Low Level Library", 5 | "build": { 6 | "flags": [ 7 | "-I CMSIS", 8 | "-I HAL/Inc", 9 | "-I HAL/Inc/Legacy", 10 | "-I HAL/Src", 11 | "-I ." 12 | ], 13 | "libArchive": true, 14 | "platforms": "aceinna_imu" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sensors/calibrationAPI.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file calibrationAPI.h 3 | * 4 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 5 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 6 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 7 | * PARTICULAR PURPOSE. 8 | * 9 | *****************************************************************************/ 10 | #ifndef __CALIBRATION_API_H 11 | #define __CALIBRATION_API_H 12 | #include 13 | 14 | void compare_sensors_result(); 15 | void InitFactoryCalibration(void); 16 | void ApplyFactoryCalibration(void); 17 | uint32_t GetUnitSerialNum(); 18 | uint8_t* GetUnitVersion(); 19 | int CalibrationTableValid(int idx) ; 20 | uint16_t GetProductConfiguration(); 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /Sensors/eepromAPI.h: -------------------------------------------------------------------------------- 1 | /** *************************************************************************** 2 | * @file eepromAPI.h 3 | * @Author 4 | * 5 | * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 6 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 7 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 8 | * PARTICULAR PURPOSE. 9 | * 10 | *****************************************************************************/ 11 | #ifndef _EEPROM_API_H 12 | #define _EEPROM_API_H 13 | 14 | #include 15 | #include "constants.h" 16 | 17 | #define EEPROM_CAL_ADDR1 0x080Ed000 18 | #define EEPROM_CAL_ADDR2 0x080Ee000 19 | #define EEPROM_CAL_ADDR3 0x080Ef000 20 | #define EEPROM_CONFIG_ADDR 0x080Ec800 21 | #define CAL_PARTITION_SIZE 4096 // 4K 22 | #define CAL_CRC_OFFSET 4092 23 | #define EEPROM_USER_ADDR 0x080C0000 24 | #define EEPROM_PAGE_SIZE 0x800 25 | #define BOOT_SIGNATURE_ADDR 0x2004ff10 26 | #define APP_START_ADDR 0x08010000 27 | #define APP_SIGNATURE_ADDR 0x080A0000 28 | 29 | extern void EEPROM_ReadWords(uint16_t addr, uint16_t num, void *destination) ; 30 | extern BOOL EEPROM_WriteWords(uint16_t addr, uint16_t num, void *source) ; 31 | extern void EEPROM_ReadByte(uint16_t addr, uint16_t num, void *destination) ; 32 | extern BOOL EEPROM_WriteByte(uint16_t addr, uint16_t num, void *source) ; 33 | extern void EEPROM_ReadSerialNumber(void *destination) ; 34 | extern void EEPROM_ReadProdConfig(void *destination) ; 35 | extern void EEPROM_ReadCalibration(int idx, void* destination); 36 | extern void EEPROM_ReadFactoryConfiguration(void* destination); 37 | extern BOOL EEPROM_ReadFromCalPartition( uint16_t offset, uint16_t num, void *destination); 38 | extern BOOL EEPROM_WriteToCalPartition(uint16_t offset, uint16_t num, void *source); 39 | extern uint8_t *EEPROM_GetCalTabPtr(int idx); 40 | extern BOOL EEPROM_WriteApp(uint32_t addr,uint8_t *buf, uint16_t len); 41 | 42 | #endif /* S_EEPROM_H */ 43 | 44 | 45 | -------------------------------------------------------------------------------- /Sensors/libSensors.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aceinna/openRTK330-lib/3023995e0766aba636a2e9f7f68a1ab9fc4562a5/Sensors/libSensors.a -------------------------------------------------------------------------------- /Sensors/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Sensors", 3 | "version": "1.0.4", 4 | "description": "OpenIMU330 sensors and storage library", 5 | "build": { 6 | "flags": [ 7 | 8 | "-I ." 9 | ], 10 | "libArchive": true, 11 | "platforms": "aceinna_imu" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OpenRTK-base-library", 3 | "version": "1.0.9", 4 | "description": "OpenRTK Base Library", 5 | "keywords": "sensors, RTK, INS, AI, automotive, navigation", 6 | "repository": 7 | { 8 | "type": "git", 9 | "url": "https://github.com/Aceinna/openRTK330-lib.git", 10 | "branch": "master" 11 | }, 12 | "build": { 13 | "flags": [ 14 | "-I STM32F469/include", 15 | "-I STM32F469/CMSIS", 16 | "-I STM32F469/HAL/Inc", 17 | "-I STM32F469/HAL/Inc/Legacy", 18 | "-I STM32F469/HAL/Src", 19 | "-I STM32F469/OS/Inc", 20 | "-I STM32F469/", 21 | 22 | "-I LWIP/arch", 23 | "-I LWIP/lwip-1.4.1/src/include", 24 | "-I LWIP/lwip-1.4.1/src/include/ipv4", 25 | "-I LWIP/lwip-1.4.1/src/include/netif", 26 | "-I LWIP/lwip_app/user/inc", 27 | "-I LWIP/lwip_app/webserver/inc", 28 | "-I LWIP/lwip_app/ntrip/inc" , 29 | "-I LWIP/lwip_app/station/inc" , 30 | "-I LWIP/lwip_app/driver_tcp/inc" , 31 | "-I LWIP/lwip_app/driver_tcp" , 32 | "-I LWIP/", 33 | 34 | "-I mbedTLS/lib/include", 35 | "-I mbedTLS/lib/include/mbedtls", 36 | "-I mbedTLS/app/inc", 37 | "-I mbedTLS/", 38 | 39 | "-I Platform/", 40 | "-I Platform/board/include", 41 | "-I Platform/filter/include", 42 | "-I Platform/driver/include", 43 | "-I Platform/cjson/inc", 44 | "-I Platform/gnss_data/include", 45 | "-I Platform/common/include", 46 | "-I Platform/can/include", 47 | "-I Platform/bluetooth/include", 48 | "-I Platform/crc/include", 49 | "-I Platform/serial/include", 50 | "-I Platform/config/include", 51 | "-I FreeRTOS/include", 52 | "-I FreeRTOS/", 53 | 54 | "-I Sensors", 55 | "-L Sensors/", 56 | "-l libSensors.a", 57 | 58 | "-I INS", 59 | "-L INS/", 60 | "-l libINS.a", 61 | 62 | "-I OpenARC", 63 | "-L OpenARC/", 64 | "-l libOpenARC.a", 65 | 66 | "-I GNSS" 67 | 68 | ], 69 | "libArchive": false, 70 | "platforms": "aceinna_imu" 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /mbedTLS/app/src/hardware_rng.c: -------------------------------------------------------------------------------- 1 | #include "mbedtls_config.h" 2 | 3 | #ifdef MBEDTLS_ENTROPY_HARDWARE_ALT 4 | 5 | #include "main.h" 6 | #include 7 | 8 | #include "mbedtls/entropy_poll.h" 9 | 10 | #include "stm32f4xx_hal.h" 11 | 12 | extern RNG_HandleTypeDef RngHandle; 13 | 14 | int mbedtls_hardware_poll(void *Data, unsigned char *Output, size_t Len, size_t *oLen) 15 | { 16 | uint32_t index; 17 | uint32_t randomValue; 18 | 19 | for (index = 0; index < Len / 4; index++) 20 | { 21 | if (HAL_RNG_GenerateRandomNumber(&RngHandle, &randomValue) == HAL_OK) 22 | { 23 | *oLen += 4; 24 | memset(&(Output[index * 4]), (int)randomValue, 4); 25 | } 26 | else 27 | { 28 | Error_Handler(); 29 | } 30 | } 31 | 32 | return 0; 33 | } 34 | 35 | #endif /*MBEDTLS_ENTROPY_HARDWARE_ALT*/ 36 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) 2 | 3 | if(INSTALL_MBEDTLS_HEADERS) 4 | 5 | file(GLOB headers "mbedtls/*.h") 6 | 7 | install(FILES ${headers} 8 | DESTINATION include/mbedtls 9 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) 10 | 11 | endif(INSTALL_MBEDTLS_HEADERS) 12 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/arc4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file arc4.h 3 | * 4 | * \brief The ARCFOUR stream cipher 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ARC4_H 24 | #define MBEDTLS_ARC4_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #include 33 | 34 | #if !defined(MBEDTLS_ARC4_ALT) 35 | // Regular implementation 36 | // 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * \brief ARC4 context structure 44 | */ 45 | typedef struct 46 | { 47 | int x; /*!< permutation index */ 48 | int y; /*!< permutation index */ 49 | unsigned char m[256]; /*!< permutation table */ 50 | } 51 | mbedtls_arc4_context; 52 | 53 | /** 54 | * \brief Initialize ARC4 context 55 | * 56 | * \param ctx ARC4 context to be initialized 57 | */ 58 | void mbedtls_arc4_init( mbedtls_arc4_context *ctx ); 59 | 60 | /** 61 | * \brief Clear ARC4 context 62 | * 63 | * \param ctx ARC4 context to be cleared 64 | */ 65 | void mbedtls_arc4_free( mbedtls_arc4_context *ctx ); 66 | 67 | /** 68 | * \brief ARC4 key schedule 69 | * 70 | * \param ctx ARC4 context to be setup 71 | * \param key the secret key 72 | * \param keylen length of the key, in bytes 73 | */ 74 | void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, 75 | unsigned int keylen ); 76 | 77 | /** 78 | * \brief ARC4 cipher function 79 | * 80 | * \param ctx ARC4 context 81 | * \param length length of the input data 82 | * \param input buffer holding the input data 83 | * \param output buffer for the output data 84 | * 85 | * \return 0 if successful 86 | */ 87 | int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, 88 | unsigned char *output ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #else /* MBEDTLS_ARC4_ALT */ 95 | #include "arc4_alt.h" 96 | #endif /* MBEDTLS_ARC4_ALT */ 97 | 98 | #ifdef __cplusplus 99 | extern "C" { 100 | #endif 101 | 102 | /** 103 | * \brief Checkup routine 104 | * 105 | * \return 0 if successful, or 1 if the test failed 106 | */ 107 | int mbedtls_arc4_self_test( int verbose ); 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /* arc4.h */ 114 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file base64.h 3 | * 4 | * \brief RFC 1521 base64 encoding/decoding 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_BASE64_H 24 | #define MBEDTLS_BASE64_H 25 | 26 | #include 27 | 28 | #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ 29 | #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /** 36 | * \brief Encode a buffer into base64 format 37 | * 38 | * \param dst destination buffer 39 | * \param dlen size of the destination buffer 40 | * \param olen number of bytes written 41 | * \param src source buffer 42 | * \param slen amount of data to be encoded 43 | * 44 | * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL. 45 | * *olen is always updated to reflect the amount 46 | * of data that has (or would have) been written. 47 | * If that length cannot be represented, then no data is 48 | * written to the buffer and *olen is set to the maximum 49 | * length representable as a size_t. 50 | * 51 | * \note Call this function with dlen = 0 to obtain the 52 | * required buffer size in *olen 53 | */ 54 | int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, 55 | const unsigned char *src, size_t slen ); 56 | 57 | /** 58 | * \brief Decode a base64-formatted buffer 59 | * 60 | * \param dst destination buffer (can be NULL for checking size) 61 | * \param dlen size of the destination buffer 62 | * \param olen number of bytes written 63 | * \param src source buffer 64 | * \param slen amount of data to be decoded 65 | * 66 | * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or 67 | * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is 68 | * not correct. *olen is always updated to reflect the amount 69 | * of data that has (or would have) been written. 70 | * 71 | * \note Call this function with *dst = NULL or dlen = 0 to obtain 72 | * the required buffer size in *olen 73 | */ 74 | int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, 75 | const unsigned char *src, size_t slen ); 76 | 77 | /** 78 | * \brief Checkup routine 79 | * 80 | * \return 0 if successful, or 1 if the test failed 81 | */ 82 | int mbedtls_base64_self_test( int verbose ); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif /* base64.h */ 89 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/certs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file certs.h 3 | * 4 | * \brief Sample certificates and DHM parameters for testing 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_CERTS_H 24 | #define MBEDTLS_CERTS_H 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #if defined(MBEDTLS_PEM_PARSE_C) 33 | /* Concatenation of all CA certificates in PEM format if available */ 34 | extern const char mbedtls_test_cas_pem[]; 35 | extern const size_t mbedtls_test_cas_pem_len; 36 | #endif 37 | 38 | /* List of all CA certificates, terminated by NULL */ 39 | extern const char * mbedtls_test_cas[]; 40 | extern const size_t mbedtls_test_cas_len[]; 41 | 42 | /* 43 | * Convenience for users who just want a certificate: 44 | * RSA by default, or ECDSA if RSA is not available 45 | */ 46 | extern const char * mbedtls_test_ca_crt; 47 | extern const size_t mbedtls_test_ca_crt_len; 48 | extern const char * mbedtls_test_ca_key; 49 | extern const size_t mbedtls_test_ca_key_len; 50 | extern const char * mbedtls_test_ca_pwd; 51 | extern const size_t mbedtls_test_ca_pwd_len; 52 | extern const char * mbedtls_test_srv_crt; 53 | extern const size_t mbedtls_test_srv_crt_len; 54 | extern const char * mbedtls_test_srv_key; 55 | extern const size_t mbedtls_test_srv_key_len; 56 | extern const char * mbedtls_test_cli_crt; 57 | extern const size_t mbedtls_test_cli_crt_len; 58 | extern const char * mbedtls_test_cli_key; 59 | extern const size_t mbedtls_test_cli_key_len; 60 | 61 | #if defined(MBEDTLS_ECDSA_C) 62 | extern const char mbedtls_test_ca_crt_ec[]; 63 | extern const size_t mbedtls_test_ca_crt_ec_len; 64 | extern const char mbedtls_test_ca_key_ec[]; 65 | extern const size_t mbedtls_test_ca_key_ec_len; 66 | extern const char mbedtls_test_ca_pwd_ec[]; 67 | extern const size_t mbedtls_test_ca_pwd_ec_len; 68 | extern const char mbedtls_test_srv_crt_ec[]; 69 | extern const size_t mbedtls_test_srv_crt_ec_len; 70 | extern const char mbedtls_test_srv_key_ec[]; 71 | extern const size_t mbedtls_test_srv_key_ec_len; 72 | extern const char mbedtls_test_cli_crt_ec[]; 73 | extern const size_t mbedtls_test_cli_crt_ec_len; 74 | extern const char mbedtls_test_cli_key_ec[]; 75 | extern const size_t mbedtls_test_cli_key_ec_len; 76 | #endif 77 | 78 | #if defined(MBEDTLS_RSA_C) 79 | extern const char mbedtls_test_ca_crt_rsa[]; 80 | extern const size_t mbedtls_test_ca_crt_rsa_len; 81 | extern const char mbedtls_test_ca_key_rsa[]; 82 | extern const size_t mbedtls_test_ca_key_rsa_len; 83 | extern const char mbedtls_test_ca_pwd_rsa[]; 84 | extern const size_t mbedtls_test_ca_pwd_rsa_len; 85 | extern const char mbedtls_test_srv_crt_rsa[]; 86 | extern const size_t mbedtls_test_srv_crt_rsa_len; 87 | extern const char mbedtls_test_srv_key_rsa[]; 88 | extern const size_t mbedtls_test_srv_key_rsa_len; 89 | extern const char mbedtls_test_cli_crt_rsa[]; 90 | extern const size_t mbedtls_test_cli_crt_rsa_len; 91 | extern const char mbedtls_test_cli_key_rsa[]; 92 | extern const size_t mbedtls_test_cli_key_rsa_len; 93 | #endif 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* certs.h */ 100 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/cipher_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file cipher_internal.h 3 | * 4 | * \brief Cipher wrappers. 5 | * 6 | * \author Adriaan de Jong 7 | * 8 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 9 | * SPDX-License-Identifier: Apache-2.0 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 12 | * not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | * This file is part of mbed TLS (https://tls.mbed.org) 24 | */ 25 | #ifndef MBEDTLS_CIPHER_WRAP_H 26 | #define MBEDTLS_CIPHER_WRAP_H 27 | 28 | #if !defined(MBEDTLS_CONFIG_FILE) 29 | #include "config.h" 30 | #else 31 | #include MBEDTLS_CONFIG_FILE 32 | #endif 33 | 34 | #include "cipher.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * Base cipher information. The non-mode specific functions and values. 42 | */ 43 | struct mbedtls_cipher_base_t 44 | { 45 | /** Base Cipher type (e.g. MBEDTLS_CIPHER_ID_AES) */ 46 | mbedtls_cipher_id_t cipher; 47 | 48 | /** Encrypt using ECB */ 49 | int (*ecb_func)( void *ctx, mbedtls_operation_t mode, 50 | const unsigned char *input, unsigned char *output ); 51 | 52 | #if defined(MBEDTLS_CIPHER_MODE_CBC) 53 | /** Encrypt using CBC */ 54 | int (*cbc_func)( void *ctx, mbedtls_operation_t mode, size_t length, 55 | unsigned char *iv, const unsigned char *input, 56 | unsigned char *output ); 57 | #endif 58 | 59 | #if defined(MBEDTLS_CIPHER_MODE_CFB) 60 | /** Encrypt using CFB (Full length) */ 61 | int (*cfb_func)( void *ctx, mbedtls_operation_t mode, size_t length, size_t *iv_off, 62 | unsigned char *iv, const unsigned char *input, 63 | unsigned char *output ); 64 | #endif 65 | 66 | #if defined(MBEDTLS_CIPHER_MODE_CTR) 67 | /** Encrypt using CTR */ 68 | int (*ctr_func)( void *ctx, size_t length, size_t *nc_off, 69 | unsigned char *nonce_counter, unsigned char *stream_block, 70 | const unsigned char *input, unsigned char *output ); 71 | #endif 72 | 73 | #if defined(MBEDTLS_CIPHER_MODE_STREAM) 74 | /** Encrypt using STREAM */ 75 | int (*stream_func)( void *ctx, size_t length, 76 | const unsigned char *input, unsigned char *output ); 77 | #endif 78 | 79 | /** Set key for encryption purposes */ 80 | int (*setkey_enc_func)( void *ctx, const unsigned char *key, 81 | unsigned int key_bitlen ); 82 | 83 | /** Set key for decryption purposes */ 84 | int (*setkey_dec_func)( void *ctx, const unsigned char *key, 85 | unsigned int key_bitlen); 86 | 87 | /** Allocate a new context */ 88 | void * (*ctx_alloc_func)( void ); 89 | 90 | /** Free the given context */ 91 | void (*ctx_free_func)( void *ctx ); 92 | 93 | }; 94 | 95 | typedef struct 96 | { 97 | mbedtls_cipher_type_t type; 98 | const mbedtls_cipher_info_t *info; 99 | } mbedtls_cipher_definition_t; 100 | 101 | extern const mbedtls_cipher_definition_t mbedtls_cipher_definitions[]; 102 | 103 | extern int mbedtls_cipher_supported[]; 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* MBEDTLS_CIPHER_WRAP_H */ 110 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/entropy_poll.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file entropy_poll.h 3 | * 4 | * \brief Platform-specific and custom entropy polling functions 5 | * 6 | * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ENTROPY_POLL_H 24 | #define MBEDTLS_ENTROPY_POLL_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /* 39 | * Default thresholds for built-in sources, in bytes 40 | */ 41 | #define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */ 42 | #define MBEDTLS_ENTROPY_MIN_HAVEGE 32 /**< Minimum for HAVEGE */ 43 | #define MBEDTLS_ENTROPY_MIN_HARDCLOCK 4 /**< Minimum for mbedtls_timing_hardclock() */ 44 | #if !defined(MBEDTLS_ENTROPY_MIN_HARDWARE) 45 | #define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */ 46 | #endif 47 | 48 | /** 49 | * \brief Entropy poll callback that provides 0 entropy. 50 | */ 51 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) 52 | int mbedtls_null_entropy_poll( void *data, 53 | unsigned char *output, size_t len, size_t *olen ); 54 | #endif 55 | 56 | #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) 57 | /** 58 | * \brief Platform-specific entropy poll callback 59 | */ 60 | int mbedtls_platform_entropy_poll( void *data, 61 | unsigned char *output, size_t len, size_t *olen ); 62 | #endif 63 | 64 | #if defined(MBEDTLS_HAVEGE_C) 65 | /** 66 | * \brief HAVEGE based entropy poll callback 67 | * 68 | * Requires an HAVEGE state as its data pointer. 69 | */ 70 | int mbedtls_havege_poll( void *data, 71 | unsigned char *output, size_t len, size_t *olen ); 72 | #endif 73 | 74 | #if defined(MBEDTLS_TIMING_C) 75 | /** 76 | * \brief mbedtls_timing_hardclock-based entropy poll callback 77 | */ 78 | int mbedtls_hardclock_poll( void *data, 79 | unsigned char *output, size_t len, size_t *olen ); 80 | #endif 81 | 82 | #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) 83 | /** 84 | * \brief Entropy poll callback for a hardware source 85 | * 86 | * \warning This is not provided by mbed TLS! 87 | * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h. 88 | * 89 | * \note This must accept NULL as its first argument. 90 | */ 91 | int mbedtls_hardware_poll( void *data, 92 | unsigned char *output, size_t len, size_t *olen ); 93 | #endif 94 | 95 | #if defined(MBEDTLS_ENTROPY_NV_SEED) 96 | /** 97 | * \brief Entropy poll callback for a non-volatile seed file 98 | * 99 | * \note This must accept NULL as its first argument. 100 | */ 101 | int mbedtls_nv_seed_poll( void *data, 102 | unsigned char *output, size_t len, size_t *olen ); 103 | #endif 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* entropy_poll.h */ 110 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/error.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file error.h 3 | * 4 | * \brief Error to string translation 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_ERROR_H 24 | #define MBEDTLS_ERROR_H 25 | 26 | #include 27 | 28 | /** 29 | * Error code layout. 30 | * 31 | * Currently we try to keep all error codes within the negative space of 16 32 | * bits signed integers to support all platforms (-0x0001 - -0x7FFF). In 33 | * addition we'd like to give two layers of information on the error if 34 | * possible. 35 | * 36 | * For that purpose the error codes are segmented in the following manner: 37 | * 38 | * 16 bit error code bit-segmentation 39 | * 40 | * 1 bit - Unused (sign bit) 41 | * 3 bits - High level module ID 42 | * 5 bits - Module-dependent error code 43 | * 7 bits - Low level module errors 44 | * 45 | * For historical reasons, low-level error codes are divided in even and odd, 46 | * even codes were assigned first, and -1 is reserved for other errors. 47 | * 48 | * Low-level module errors (0x0002-0x007E, 0x0003-0x007F) 49 | * 50 | * Module Nr Codes assigned 51 | * MPI 7 0x0002-0x0010 52 | * GCM 2 0x0012-0x0014 53 | * BLOWFISH 2 0x0016-0x0018 54 | * THREADING 3 0x001A-0x001E 55 | * AES 2 0x0020-0x0022 56 | * CAMELLIA 2 0x0024-0x0026 57 | * XTEA 1 0x0028-0x0028 58 | * BASE64 2 0x002A-0x002C 59 | * OID 1 0x002E-0x002E 0x000B-0x000B 60 | * PADLOCK 1 0x0030-0x0030 61 | * DES 1 0x0032-0x0032 62 | * CTR_DBRG 4 0x0034-0x003A 63 | * ENTROPY 3 0x003C-0x0040 0x003D-0x003F 64 | * NET 11 0x0042-0x0052 0x0043-0x0045 65 | * ASN1 7 0x0060-0x006C 66 | * PBKDF2 1 0x007C-0x007C 67 | * HMAC_DRBG 4 0x0003-0x0009 68 | * CCM 2 0x000D-0x000F 69 | * 70 | * High-level module nr (3 bits - 0x0...-0x7...) 71 | * Name ID Nr of Errors 72 | * PEM 1 9 73 | * PKCS#12 1 4 (Started from top) 74 | * X509 2 20 75 | * PKCS5 2 4 (Started from top) 76 | * DHM 3 9 77 | * PK 3 14 (Started from top) 78 | * RSA 4 9 79 | * ECP 4 8 (Started from top) 80 | * MD 5 4 81 | * CIPHER 6 6 82 | * SSL 6 17 (Started from top) 83 | * SSL 7 31 84 | * 85 | * Module dependent error code (5 bits 0x.00.-0x.F8.) 86 | */ 87 | 88 | #ifdef __cplusplus 89 | extern "C" { 90 | #endif 91 | 92 | /** 93 | * \brief Translate a mbed TLS error code into a string representation, 94 | * Result is truncated if necessary and always includes a terminating 95 | * null byte. 96 | * 97 | * \param errnum error code 98 | * \param buffer buffer to place representation in 99 | * \param buflen length of the buffer 100 | */ 101 | void mbedtls_strerror( int errnum, char *buffer, size_t buflen ); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | 107 | #endif /* error.h */ 108 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/havege.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file havege.h 3 | * 4 | * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_HAVEGE_H 24 | #define MBEDTLS_HAVEGE_H 25 | 26 | #include 27 | 28 | #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * \brief HAVEGE state structure 36 | */ 37 | typedef struct 38 | { 39 | int PT1, PT2, offset[2]; 40 | int pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; 41 | int WALK[8192]; 42 | } 43 | mbedtls_havege_state; 44 | 45 | /** 46 | * \brief HAVEGE initialization 47 | * 48 | * \param hs HAVEGE state to be initialized 49 | */ 50 | void mbedtls_havege_init( mbedtls_havege_state *hs ); 51 | 52 | /** 53 | * \brief Clear HAVEGE state 54 | * 55 | * \param hs HAVEGE state to be cleared 56 | */ 57 | void mbedtls_havege_free( mbedtls_havege_state *hs ); 58 | 59 | /** 60 | * \brief HAVEGE rand function 61 | * 62 | * \param p_rng A HAVEGE state 63 | * \param output Buffer to fill 64 | * \param len Length of buffer 65 | * 66 | * \return 0 67 | */ 68 | int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* havege.h */ 75 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/md_internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file md_internal.h 3 | * 4 | * \brief Message digest wrappers. 5 | * 6 | * \warning This in an internal header. Do not include directly. 7 | * 8 | * \author Adriaan de Jong 9 | * 10 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 11 | * SPDX-License-Identifier: Apache-2.0 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 14 | * not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 21 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * This file is part of mbed TLS (https://tls.mbed.org) 26 | */ 27 | #ifndef MBEDTLS_MD_WRAP_H 28 | #define MBEDTLS_MD_WRAP_H 29 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include MBEDTLS_CONFIG_FILE 34 | #endif 35 | 36 | #include "md.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * Message digest information. 44 | * Allows message digest functions to be called in a generic way. 45 | */ 46 | struct mbedtls_md_info_t 47 | { 48 | /** Digest identifier */ 49 | mbedtls_md_type_t type; 50 | 51 | /** Name of the message digest */ 52 | const char * name; 53 | 54 | /** Output length of the digest function in bytes */ 55 | int size; 56 | 57 | /** Block length of the digest function in bytes */ 58 | int block_size; 59 | 60 | /** Digest initialisation function */ 61 | void (*starts_func)( void *ctx ); 62 | 63 | /** Digest update function */ 64 | void (*update_func)( void *ctx, const unsigned char *input, size_t ilen ); 65 | 66 | /** Digest finalisation function */ 67 | void (*finish_func)( void *ctx, unsigned char *output ); 68 | 69 | /** Generic digest function */ 70 | void (*digest_func)( const unsigned char *input, size_t ilen, 71 | unsigned char *output ); 72 | 73 | /** Allocate a new context */ 74 | void * (*ctx_alloc_func)( void ); 75 | 76 | /** Free the given context */ 77 | void (*ctx_free_func)( void *ctx ); 78 | 79 | /** Clone state from a context */ 80 | void (*clone_func)( void *dst, const void *src ); 81 | 82 | /** Internal use only */ 83 | void (*process_func)( void *ctx, const unsigned char *input ); 84 | }; 85 | 86 | #if defined(MBEDTLS_MD2_C) 87 | extern const mbedtls_md_info_t mbedtls_md2_info; 88 | #endif 89 | #if defined(MBEDTLS_MD4_C) 90 | extern const mbedtls_md_info_t mbedtls_md4_info; 91 | #endif 92 | #if defined(MBEDTLS_MD5_C) 93 | extern const mbedtls_md_info_t mbedtls_md5_info; 94 | #endif 95 | #if defined(MBEDTLS_RIPEMD160_C) 96 | extern const mbedtls_md_info_t mbedtls_ripemd160_info; 97 | #endif 98 | #if defined(MBEDTLS_SHA1_C) 99 | extern const mbedtls_md_info_t mbedtls_sha1_info; 100 | #endif 101 | #if defined(MBEDTLS_SHA256_C) 102 | extern const mbedtls_md_info_t mbedtls_sha224_info; 103 | extern const mbedtls_md_info_t mbedtls_sha256_info; 104 | #endif 105 | #if defined(MBEDTLS_SHA512_C) 106 | extern const mbedtls_md_info_t mbedtls_sha384_info; 107 | extern const mbedtls_md_info_t mbedtls_sha512_info; 108 | #endif 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* MBEDTLS_MD_WRAP_H */ 115 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/net.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file net.h 3 | * 4 | * \brief Deprecated header file that includes mbedtls/net_sockets.h 5 | * 6 | * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | * 23 | * \deprecated Superseded by mbedtls/net_sockets.h 24 | */ 25 | 26 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) 27 | #include "mbedtls/net_sockets.h" 28 | #if defined(MBEDTLS_DEPRECATED_WARNING) 29 | #warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" 30 | #endif /* MBEDTLS_DEPRECATED_WARNING */ 31 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ 32 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/padlock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file padlock.h 3 | * 4 | * \brief VIA PadLock ACE for HW encryption/decryption supported by some 5 | * processors 6 | * 7 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | * 22 | * This file is part of mbed TLS (https://tls.mbed.org) 23 | */ 24 | #ifndef MBEDTLS_PADLOCK_H 25 | #define MBEDTLS_PADLOCK_H 26 | 27 | #include "aes.h" 28 | 29 | #define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ 30 | 31 | #if defined(__has_feature) 32 | #if __has_feature(address_sanitizer) 33 | #define MBEDTLS_HAVE_ASAN 34 | #endif 35 | #endif 36 | 37 | /* Some versions of ASan result in errors about not enough registers */ 38 | #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ 39 | !defined(MBEDTLS_HAVE_ASAN) 40 | 41 | #ifndef MBEDTLS_HAVE_X86 42 | #define MBEDTLS_HAVE_X86 43 | #endif 44 | 45 | #include 46 | 47 | #define MBEDTLS_PADLOCK_RNG 0x000C 48 | #define MBEDTLS_PADLOCK_ACE 0x00C0 49 | #define MBEDTLS_PADLOCK_PHE 0x0C00 50 | #define MBEDTLS_PADLOCK_PMM 0x3000 51 | 52 | #define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) x & ~15)) 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | /** 59 | * \brief PadLock detection routine 60 | * 61 | * \param feature The feature to detect 62 | * 63 | * \return 1 if CPU has support for the feature, 0 otherwise 64 | */ 65 | int mbedtls_padlock_has_support( int feature ); 66 | 67 | /** 68 | * \brief PadLock AES-ECB block en(de)cryption 69 | * 70 | * \param ctx AES context 71 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT 72 | * \param input 16-byte input block 73 | * \param output 16-byte output block 74 | * 75 | * \return 0 if success, 1 if operation failed 76 | */ 77 | int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx, 78 | int mode, 79 | const unsigned char input[16], 80 | unsigned char output[16] ); 81 | 82 | /** 83 | * \brief PadLock AES-CBC buffer en(de)cryption 84 | * 85 | * \param ctx AES context 86 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT 87 | * \param length length of the input data 88 | * \param iv initialization vector (updated after use) 89 | * \param input buffer holding the input data 90 | * \param output buffer holding the output data 91 | * 92 | * \return 0 if success, 1 if operation failed 93 | */ 94 | int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx, 95 | int mode, 96 | size_t length, 97 | unsigned char iv[16], 98 | const unsigned char *input, 99 | unsigned char *output ); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* HAVE_X86 */ 106 | 107 | #endif /* padlock.h */ 108 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/pkcs5.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file pkcs5.h 3 | * 4 | * \brief PKCS#5 functions 5 | * 6 | * \author Mathias Olsson 7 | * 8 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 9 | * SPDX-License-Identifier: Apache-2.0 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 12 | * not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 19 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | * This file is part of mbed TLS (https://tls.mbed.org) 24 | */ 25 | #ifndef MBEDTLS_PKCS5_H 26 | #define MBEDTLS_PKCS5_H 27 | 28 | #include "asn1.h" 29 | #include "md.h" 30 | 31 | #include 32 | #include 33 | 34 | #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ 35 | #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ 36 | #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */ 37 | #define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00 /**< Given private key password does not allow for correct decryption. */ 38 | 39 | #define MBEDTLS_PKCS5_DECRYPT 0 40 | #define MBEDTLS_PKCS5_ENCRYPT 1 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** 47 | * \brief PKCS#5 PBES2 function 48 | * 49 | * \param pbe_params the ASN.1 algorithm parameters 50 | * \param mode either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT 51 | * \param pwd password to use when generating key 52 | * \param pwdlen length of password 53 | * \param data data to process 54 | * \param datalen length of data 55 | * \param output output buffer 56 | * 57 | * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. 58 | */ 59 | int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode, 60 | const unsigned char *pwd, size_t pwdlen, 61 | const unsigned char *data, size_t datalen, 62 | unsigned char *output ); 63 | 64 | /** 65 | * \brief PKCS#5 PBKDF2 using HMAC 66 | * 67 | * \param ctx Generic HMAC context 68 | * \param password Password to use when generating key 69 | * \param plen Length of password 70 | * \param salt Salt to use when generating key 71 | * \param slen Length of salt 72 | * \param iteration_count Iteration count 73 | * \param key_length Length of generated key in bytes 74 | * \param output Generated key. Must be at least as big as key_length 75 | * 76 | * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. 77 | */ 78 | int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password, 79 | size_t plen, const unsigned char *salt, size_t slen, 80 | unsigned int iteration_count, 81 | uint32_t key_length, unsigned char *output ); 82 | 83 | /** 84 | * \brief Checkup routine 85 | * 86 | * \return 0 if successful, or 1 if the test failed 87 | */ 88 | int mbedtls_pkcs5_self_test( int verbose ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* pkcs5.h */ 95 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/platform_time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file platform_time.h 3 | * 4 | * \brief mbed TLS Platform time abstraction 5 | * 6 | * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_PLATFORM_TIME_H 24 | #define MBEDTLS_PLATFORM_TIME_H 25 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) 27 | #include "config.h" 28 | #else 29 | #include MBEDTLS_CONFIG_FILE 30 | #endif 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /** 37 | * \name SECTION: Module settings 38 | * 39 | * The configuration options you can set for this module are in this section. 40 | * Either change them in config.h or define them on the compiler command line. 41 | * \{ 42 | */ 43 | 44 | /* 45 | * The time_t datatype 46 | */ 47 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) 48 | typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t; 49 | #else 50 | /* For time_t */ 51 | #include 52 | typedef time_t mbedtls_time_t; 53 | #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ 54 | 55 | /* 56 | * The function pointers for time 57 | */ 58 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) 59 | extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time ); 60 | 61 | /** 62 | * \brief Set your own time function pointer 63 | * 64 | * \param time_func the time function implementation 65 | * 66 | * \return 0 67 | */ 68 | int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) ); 69 | #else 70 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) 71 | #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO 72 | #else 73 | #define mbedtls_time time 74 | #endif /* MBEDTLS_PLATFORM_TIME_MACRO */ 75 | #endif /* MBEDTLS_PLATFORM_TIME_ALT */ 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* platform_time.h */ 82 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/ssl_cookie.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file ssl_cookie.h 3 | * 4 | * \brief DTLS cookie callbacks implementation 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | #ifndef MBEDTLS_SSL_COOKIE_H 24 | #define MBEDTLS_SSL_COOKIE_H 25 | 26 | #include "ssl.h" 27 | 28 | #if defined(MBEDTLS_THREADING_C) 29 | #include "threading.h" 30 | #endif 31 | 32 | /** 33 | * \name SECTION: Module settings 34 | * 35 | * The configuration options you can set for this module are in this section. 36 | * Either change them in config.h or define them on the compiler command line. 37 | * \{ 38 | */ 39 | #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT 40 | #define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ 41 | #endif 42 | 43 | /* \} name SECTION: Module settings */ 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Context for the default cookie functions. 51 | */ 52 | typedef struct 53 | { 54 | mbedtls_md_context_t hmac_ctx; /*!< context for the HMAC portion */ 55 | #if !defined(MBEDTLS_HAVE_TIME) 56 | unsigned long serial; /*!< serial number for expiration */ 57 | #endif 58 | unsigned long timeout; /*!< timeout delay, in seconds if HAVE_TIME, 59 | or in number of tickets issued */ 60 | 61 | #if defined(MBEDTLS_THREADING_C) 62 | mbedtls_threading_mutex_t mutex; 63 | #endif 64 | } mbedtls_ssl_cookie_ctx; 65 | 66 | /** 67 | * \brief Initialize cookie context 68 | */ 69 | void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ); 70 | 71 | /** 72 | * \brief Setup cookie context (generate keys) 73 | */ 74 | int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, 75 | int (*f_rng)(void *, unsigned char *, size_t), 76 | void *p_rng ); 77 | 78 | /** 79 | * \brief Set expiration delay for cookies 80 | * (Default MBEDTLS_SSL_COOKIE_TIMEOUT) 81 | * 82 | * \param ctx Cookie contex 83 | * \param delay Delay, in seconds if HAVE_TIME, or in number of cookies 84 | * issued in the meantime. 85 | * 0 to disable expiration (NOT recommended) 86 | */ 87 | void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay ); 88 | 89 | /** 90 | * \brief Free cookie context 91 | */ 92 | void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ); 93 | 94 | /** 95 | * \brief Generate cookie, see \c mbedtls_ssl_cookie_write_t 96 | */ 97 | mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write; 98 | 99 | /** 100 | * \brief Verify cookie, see \c mbedtls_ssl_cookie_write_t 101 | */ 102 | mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check; 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif /* ssl_cookie.h */ 109 | -------------------------------------------------------------------------------- /mbedTLS/lib/include/mbedtls/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file version.h 3 | * 4 | * \brief Run-time version information 5 | * 6 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 7 | * SPDX-License-Identifier: Apache-2.0 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 10 | * not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * 21 | * This file is part of mbed TLS (https://tls.mbed.org) 22 | */ 23 | /* 24 | * This set of compile-time defines and run-time variables can be used to 25 | * determine the version number of the mbed TLS library used. 26 | */ 27 | #ifndef MBEDTLS_VERSION_H 28 | #define MBEDTLS_VERSION_H 29 | 30 | #if !defined(MBEDTLS_CONFIG_FILE) 31 | #include "config.h" 32 | #else 33 | #include MBEDTLS_CONFIG_FILE 34 | #endif 35 | 36 | /** 37 | * The version number x.y.z is split into three parts. 38 | * Major, Minor, Patchlevel 39 | */ 40 | #define MBEDTLS_VERSION_MAJOR 2 41 | #define MBEDTLS_VERSION_MINOR 6 42 | #define MBEDTLS_VERSION_PATCH 1 43 | 44 | /** 45 | * The single version number has the following structure: 46 | * MMNNPP00 47 | * Major version | Minor version | Patch version 48 | */ 49 | #define MBEDTLS_VERSION_NUMBER 0x02060100 50 | #define MBEDTLS_VERSION_STRING "2.6.1" 51 | #define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.6.1" 52 | 53 | #if defined(MBEDTLS_VERSION_C) 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | /** 60 | * Get the version number. 61 | * 62 | * \return The constructed version number in the format 63 | * MMNNPP00 (Major, Minor, Patch). 64 | */ 65 | unsigned int mbedtls_version_get_number( void ); 66 | 67 | /** 68 | * Get the version string ("x.y.z"). 69 | * 70 | * \param string The string that will receive the value. 71 | * (Should be at least 9 bytes in size) 72 | */ 73 | void mbedtls_version_get_string( char *string ); 74 | 75 | /** 76 | * Get the full version string ("mbed TLS x.y.z"). 77 | * 78 | * \param string The string that will receive the value. The mbed TLS version 79 | * string will use 18 bytes AT MOST including a terminating 80 | * null byte. 81 | * (So the buffer should be at least 18 bytes to receive this 82 | * version string). 83 | */ 84 | void mbedtls_version_get_string_full( char *string ); 85 | 86 | /** 87 | * \brief Check if support for a feature was compiled into this 88 | * mbed TLS binary. This allows you to see at runtime if the 89 | * library was for instance compiled with or without 90 | * Multi-threading support. 91 | * 92 | * \note only checks against defines in the sections "System 93 | * support", "mbed TLS modules" and "mbed TLS feature 94 | * support" in config.h 95 | * 96 | * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C") 97 | * 98 | * \return 0 if the feature is present, 99 | * -1 if the feature is not present and 100 | * -2 if support for feature checking as a whole was not 101 | * compiled in. 102 | */ 103 | int mbedtls_version_check_feature( const char *feature ); 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | #endif /* MBEDTLS_VERSION_C */ 110 | 111 | #endif /* version.h */ 112 | -------------------------------------------------------------------------------- /mbedTLS/lib/src/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Version information 3 | * 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 5 | * SPDX-License-Identifier: Apache-2.0 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may 8 | * not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * This file is part of mbed TLS (https://tls.mbed.org) 20 | */ 21 | 22 | #if !defined(MBEDTLS_CONFIG_FILE) 23 | #include "mbedtls/config.h" 24 | #else 25 | #include MBEDTLS_CONFIG_FILE 26 | #endif 27 | 28 | #if defined(MBEDTLS_VERSION_C) 29 | 30 | #include "mbedtls/version.h" 31 | #include 32 | 33 | unsigned int mbedtls_version_get_number() 34 | { 35 | return( MBEDTLS_VERSION_NUMBER ); 36 | } 37 | 38 | void mbedtls_version_get_string( char *string ) 39 | { 40 | memcpy( string, MBEDTLS_VERSION_STRING, 41 | sizeof( MBEDTLS_VERSION_STRING ) ); 42 | } 43 | 44 | void mbedtls_version_get_string_full( char *string ) 45 | { 46 | memcpy( string, MBEDTLS_VERSION_STRING_FULL, 47 | sizeof( MBEDTLS_VERSION_STRING_FULL ) ); 48 | } 49 | 50 | #endif /* MBEDTLS_VERSION_C */ 51 | -------------------------------------------------------------------------------- /mbedTLS/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TLS", 3 | "version": "2.6.1", 4 | "description": "mbedTLS", 5 | "build": { 6 | "flags": [ 7 | "-I lib/include", 8 | "-I lib/include/mbedtls", 9 | "-I app/inc", 10 | "-I ." 11 | ], 12 | "libArchive": true, 13 | "platforms": "aceinna_imu" 14 | } 15 | } 16 | --------------------------------------------------------------------------------