├── .dir-locals.el ├── .gitignore ├── .gitmodules ├── .travis.yml ├── FreeRTOS ├── License │ └── license.txt ├── Source │ ├── croutine.c │ ├── event_groups.c │ ├── include │ │ ├── FreeRTOS.h │ │ ├── FreeRTOSConfig.h │ │ ├── croutine.h │ │ ├── deprecated_definitions.h │ │ ├── event_groups.h │ │ ├── list.h │ │ ├── message_buffer.h │ │ ├── mpu_prototypes.h │ │ ├── mpu_wrappers.h │ │ ├── portable.h │ │ ├── projdefs.h │ │ ├── queue.h │ │ ├── semphr.h │ │ ├── stack_macros.h │ │ ├── stream_buffer.h │ │ ├── task.h │ │ └── timers.h │ ├── list.c │ ├── portable │ │ ├── esp8266 │ │ │ ├── port.c │ │ │ ├── portmacro.h │ │ │ ├── xtensa_context.h │ │ │ ├── xtensa_rtos.h │ │ │ ├── xtensa_timer.h │ │ │ └── xtruntime.h │ │ └── readme.txt │ ├── queue.c │ ├── readme.txt │ ├── stream_buffer.c │ ├── tasks.c │ └── timers.c └── component.mk ├── LICENSE ├── README.md ├── bootloader ├── Makefile ├── README.md ├── c_types.h ├── firmware_prebuilt │ ├── blank_config.bin │ └── rboot.bin └── rboot.h ├── code_of_conduct.md ├── common.mk ├── core ├── app_main.c ├── component.mk ├── cplusplus_operators.cpp ├── debug_dumps.c ├── esp_gpio.c ├── esp_hwrand.c ├── esp_interrupts.c ├── esp_iomux.c ├── esp_phy.c ├── esp_spi.c ├── esp_timer.c ├── exception_vectors.S ├── include │ ├── common_macros.h │ ├── debug_dumps.h │ ├── esp │ │ ├── clocks.h │ │ ├── dport_regs.h │ │ ├── gpio.h │ │ ├── gpio_regs.h │ │ ├── hwrand.h │ │ ├── i2s_regs.h │ │ ├── interrupts.h │ │ ├── iomux.h │ │ ├── iomux_regs.h │ │ ├── phy.h │ │ ├── phy_regs.h │ │ ├── registers.h │ │ ├── rom.h │ │ ├── rtc_regs.h │ │ ├── rtcmem_regs.h │ │ ├── sar_regs.h │ │ ├── slc.h │ │ ├── slc_regs.h │ │ ├── spi.h │ │ ├── spi_regs.h │ │ ├── timer.h │ │ ├── timer_regs.h │ │ ├── types.h │ │ ├── uart.h │ │ ├── uart_regs.h │ │ ├── wdev_regs.h │ │ └── wdt_regs.h │ ├── esp8266.h │ ├── flashchip.h │ ├── os_version.h │ ├── sdk_internal.h │ ├── spiflash.h │ ├── stdout_redirect.h │ ├── sysparam.h │ ├── user_exception.h │ └── xtensa_ops.h ├── led_debug.s ├── newlib_syscalls.c ├── phy_info.c ├── sdk_compat.c ├── spiflash-cache-enable.S ├── spiflash.c └── sysparam.c ├── examples ├── Makefile ├── access_point │ ├── Makefile │ └── access_point.c ├── ad770x │ ├── Makefile │ └── main.c ├── ads1115_test │ ├── Makefile │ └── main.c ├── aws_iot │ ├── Makefile │ ├── README.md │ ├── aws_iot.c │ ├── ca_cert.c │ ├── client_config.c │ ├── mbedtls │ │ └── config.h │ ├── ssl_connection.c │ └── ssl_connection.h ├── bh1750 │ ├── Makefile │ └── bh1750_example.c ├── blink │ ├── FreeRTOSConfig.h │ ├── Makefile │ └── blink.c ├── blink_timers │ ├── Makefile │ └── blink_timers.c ├── bme680 │ ├── README.md │ ├── bme680_heating_profiles │ │ ├── Makefile │ │ └── bme680_heating_profiles.c │ ├── bme680_one_sensor │ │ ├── Makefile │ │ └── bme680_one_sensor.c │ └── bme680_two_sensors │ │ ├── Makefile │ │ └── bme680_two_sensors.c ├── bmp180_i2c │ ├── Makefile │ ├── README.md │ └── bmp180_i2c.c ├── bmp280 │ ├── Makefile │ └── bmp280_example.c ├── button │ ├── Makefile │ └── button.c ├── ccs811 │ ├── README.md │ ├── ccs811_one_sensor │ │ ├── Makefile │ │ └── ccs811_one_sensor.c │ ├── ccs811_plus_sht3x │ │ ├── Makefile │ │ └── ccs811_plus_sht3x.c │ └── ccs811_temperature │ │ ├── Makefile │ │ └── ccs811_temperature.c ├── cpp_01_tasks │ ├── Makefile │ └── cpp_tasks.cpp ├── crc_example │ ├── Makefile │ ├── crc_config_perso.h │ ├── crc_config_user.h │ └── crc_main.c ├── dht_sensor │ ├── Makefile │ └── dht_sensor.c ├── ds1302_test │ ├── Makefile │ └── main.c ├── ds1307 │ ├── Makefile │ └── main.c ├── ds18b20_broadcaster │ ├── Makefile │ ├── README.md │ └── ds18b20_broadcaster.c ├── ds18b20_onewire │ ├── Makefile │ └── ds18b20_onewire.c ├── ds3231_test │ ├── Makefile │ └── ds3231_test.c ├── dsm_test │ ├── Makefile │ └── dsm_test.c ├── esphttpd │ ├── FreeRTOSConfig.h │ ├── Makefile │ ├── cgi-test.c │ ├── cgi-test.h │ ├── cgi.c │ ├── cgi.h │ ├── html │ │ ├── cats │ │ │ ├── cross-eyed-cat.jpg │ │ │ ├── junge-katze-iv.jpg │ │ │ └── kitten-loves-toy.jpg │ │ ├── flash │ │ │ ├── 140medley.min.js │ │ │ ├── index.html │ │ │ └── style.css │ │ ├── index.tpl │ │ ├── led.tpl │ │ ├── style.css │ │ ├── test │ │ │ ├── index.html │ │ │ └── test.js │ │ ├── websocket │ │ │ └── index.html │ │ └── wifi │ │ │ ├── 140medley.min.js │ │ │ ├── connecting.html │ │ │ ├── icons.png │ │ │ ├── style.css │ │ │ └── wifi.tpl │ ├── io.c │ ├── io.h │ └── user_main.c ├── experiments │ ├── timers │ │ ├── Makefile │ │ └── timers.c │ └── unaligned_load │ │ ├── Makefile │ │ └── unaligned_load.c ├── fatfs │ ├── Makefile │ └── main.c ├── fatfs_rtc │ ├── Makefile │ ├── README.md │ └── main.c ├── hd44780_lcd │ ├── Makefile │ ├── main.c │ └── schematics.png ├── hmc5883l │ ├── Makefile │ └── main.c ├── http_client_ota │ ├── Makefile │ ├── http_get.c │ └── test_file │ │ ├── blink.bin │ │ └── blink.sha256 ├── http_get │ ├── Makefile │ └── http_get.c ├── http_get_bearssl │ ├── Makefile │ └── http_get_bearssl.c ├── http_get_mbedtls │ ├── Makefile │ ├── cert.c │ ├── http_get_mbedtls.c │ └── include │ │ └── mbedtls │ │ └── config.h ├── http_server │ ├── Makefile │ ├── fsdata │ │ ├── fs │ │ │ ├── 404.html │ │ │ ├── about.html │ │ │ ├── css │ │ │ │ ├── siimple.min.css │ │ │ │ └── style.css │ │ │ ├── img │ │ │ │ └── favicon.png │ │ │ ├── index.ssi │ │ │ ├── js │ │ │ │ └── smoothie_min.js │ │ │ └── websockets.html │ │ ├── fsdata.c │ │ ├── makefsdata │ │ └── readme.txt │ └── http_server.c ├── i2c_lcd_test │ ├── Makefile │ ├── i2c_lcd.png │ └── main.c ├── i2s_audio │ ├── Makefile │ └── i2s_audio_example.c ├── ina3221_test │ ├── Makefile │ └── main.c ├── json_jsmn_simple │ ├── Makefile │ └── json_jsmn_simple.c ├── l3gd20h │ ├── Makefile │ └── l3gd20h_example.c ├── lis3dh │ ├── Makefile │ └── lis3dh_example.c ├── lis3mdl │ ├── Makefile │ └── lis3mdl_example.c ├── lsm303d │ ├── Makefile │ └── lsm303d_example.c ├── lvgl_ssd1306 │ ├── Makefile │ ├── lv_conf.h │ ├── lv_drv_conf.h │ └── main.c ├── max7219_7seg │ ├── Makefile │ └── main.c ├── mcp4725_test │ ├── Makefile │ └── main.c ├── mqtt_client │ ├── Makefile │ └── mqtt_client.c ├── ms561101ba03 │ ├── Makefile │ └── main.c ├── multipwm │ ├── Makefile │ └── multipwm_test.c ├── ota_basic │ ├── Makefile │ ├── ota_basic.c │ ├── ota_basic.def │ └── test.c ├── pca9685_pwm │ ├── Makefile │ └── main.c ├── pcf8591 │ ├── Makefile │ └── main.c ├── pwm_test │ ├── Makefile │ └── pwm_test.c ├── sdio_raw │ ├── Makefile │ ├── main.c │ └── schematics.png ├── serial_echo │ ├── Makefile │ └── serial_echo.c ├── sht3x │ ├── Makefile │ ├── README.md │ └── sht3x.c ├── simple │ ├── Makefile │ └── simple.c ├── simple_cplusplus │ ├── Makefile │ └── simple.cpp ├── sntp │ ├── Makefile │ └── sntp_example.c ├── softuart │ ├── LICENSE │ ├── Makefile │ └── main.c ├── spi_test │ ├── Makefile │ └── spi_test.c ├── spiffs │ ├── Makefile │ ├── files │ │ └── test.txt │ └── spiffs_example.c ├── ssd1306_example │ ├── Makefile │ ├── README.md │ ├── image.xbm │ └── main.c ├── ssd1306_fps │ ├── Makefile │ └── main.c ├── sysparam_editor │ ├── Makefile │ └── sysparam_editor.c ├── tcp_non_blocking │ ├── Makefile │ └── tcp_non_blocking.c ├── terminal │ ├── FreeRTOSConfig.h │ ├── Makefile │ └── terminal.c ├── tests │ └── hmac_test_vectors │ │ ├── Makefile │ │ └── hmac_test_vectors.c ├── tick_idle_hooks │ ├── FreeRTOSConfig.h │ ├── Makefile │ └── hooks_example.c ├── tls_server │ ├── Makefile │ ├── cert.c │ └── tls_server.c ├── tls_server_bearssl │ ├── Makefile │ ├── certificate.h │ ├── key.h │ └── tls_server_bearssl.c ├── tsl2561 │ ├── Makefile │ └── tsl2561_example.c ├── tsl4531 │ ├── Makefile │ └── tsl4531_example.c ├── tsoftuart │ ├── .gitignore │ ├── FreeRTOSConfig.h │ ├── Makefile │ ├── local.mk │ └── tsoftuart.c ├── uart_config │ ├── Makefile │ └── uart_config.c ├── ultrasonic │ ├── Makefile │ └── main.c ├── upnp │ ├── Makefile │ ├── README.md │ ├── httpd.c │ ├── httpd.h │ ├── lwipopts.h │ ├── upnp.c │ ├── upnp.h │ └── upnp_test.c ├── wifi_scan │ ├── Makefile │ └── main.c ├── wificfg │ ├── .gitignore │ ├── FreeRTOSConfig.h │ ├── Makefile │ ├── content │ │ └── index.html │ ├── local.mk │ └── wificfg.c ├── ws2812_i2s │ ├── Makefile │ └── ws2812_i2s_colour_loop.c └── ws2812_rainbow │ ├── Makefile │ └── ws2812_rainbow.c ├── extras ├── ad770x │ ├── ad770x.c │ ├── ad770x.h │ └── component.mk ├── ads111x │ ├── ads111x.c │ ├── ads111x.h │ └── component.mk ├── bearssl │ └── component.mk ├── bh1750 │ ├── bh1750.c │ ├── bh1750.h │ └── component.mk ├── bme680 │ ├── README.md │ ├── bme680.c │ ├── bme680.h │ ├── bme680_platform.c │ ├── bme680_platform.h │ ├── bme680_types.h │ └── component.mk ├── bmp180 │ ├── LICENSE │ ├── README.md │ ├── bmp180.c │ ├── bmp180.h │ └── component.mk ├── bmp280 │ ├── README.md │ ├── bmp280.c │ ├── bmp280.h │ └── component.mk ├── ccs811 │ ├── README.md │ ├── ccs811.c │ ├── ccs811.h │ ├── ccs811_platform.h │ └── component.mk ├── cpp_support │ ├── component.mk │ └── include │ │ ├── countdown.hpp │ │ ├── mutex.hpp │ │ ├── queue.hpp │ │ └── task.hpp ├── crc_generic │ └── component.mk ├── dhcpserver │ ├── component.mk │ ├── dhcpserver.c │ └── include │ │ └── dhcpserver.h ├── dht │ ├── component.mk │ ├── dht.c │ └── dht.h ├── ds1302 │ ├── component.mk │ ├── ds1302.c │ └── ds1302.h ├── ds1307 │ ├── component.mk │ ├── ds1307.c │ └── ds1307.h ├── ds18b20 │ ├── component.mk │ ├── ds18b20.c │ └── ds18b20.h ├── ds3231 │ ├── LICENSE │ ├── component.mk │ ├── ds3231.c │ └── ds3231.h ├── dsm │ ├── component.mk │ ├── dsm.c │ └── dsm.h ├── fatfs │ ├── README.md │ ├── component.mk │ ├── defaults.mk │ ├── diskio.c │ ├── diskio.h │ ├── ff.c │ ├── ff.h │ ├── ffconf.h │ ├── ffsystem.c │ ├── ffunicode.c │ ├── integer.h │ ├── volumes.c │ └── volumes.h ├── fonts │ ├── LICENSE │ ├── OFL.txt │ ├── component.mk │ ├── data │ │ ├── font_bitocra_4x7_ascii.h │ │ ├── font_bitocra_6x11_iso8859_1.h │ │ ├── font_bitocra_7x13_iso8859_1.h │ │ ├── font_glcd_5x7.h │ │ ├── font_roboto_10pt.h │ │ ├── font_roboto_8pt.h │ │ ├── font_terminus_10x18_iso8859_1.h │ │ ├── font_terminus_11x22_iso8859_1.h │ │ ├── font_terminus_12x24_iso8859_1.h │ │ ├── font_terminus_14x28_iso8859_1.h │ │ ├── font_terminus_14x28_koi8_r.h │ │ ├── font_terminus_16x32_iso8859_1.h │ │ ├── font_terminus_16x32_koi8_r.h │ │ ├── font_terminus_6x12_iso8859_1.h │ │ ├── font_terminus_6x12_koi8_r.h │ │ ├── font_terminus_8x14_iso8859_1.h │ │ ├── font_terminus_8x14_koi8_r.h │ │ ├── font_terminus_bold_10x18_iso8859_1.h │ │ ├── font_terminus_bold_11x22_iso8859_1.h │ │ ├── font_terminus_bold_12x24_iso8859_1.h │ │ ├── font_terminus_bold_14x28_iso8859_1.h │ │ ├── font_terminus_bold_14x28_koi8_r.h │ │ ├── font_terminus_bold_16x32_iso8859_1.h │ │ ├── font_terminus_bold_16x32_koi8_r.h │ │ ├── font_terminus_bold_8x14_iso8859_1.h │ │ └── font_terminus_bold_8x14_koi8_r.h │ ├── defaults.mk │ ├── fonts.c │ ├── fonts.h │ └── tools │ │ ├── create_font.py │ │ └── template.c ├── fram │ ├── component.mk │ ├── fram.c │ └── fram.h ├── hd44780 │ ├── README.md │ ├── component.mk │ ├── hd44780.c │ ├── hd44780.h │ └── img │ │ ├── 0801.png │ │ ├── 1601.png │ │ ├── 1602.png │ │ └── 1604.png ├── hmc5883l │ ├── component.mk │ ├── hmc5883l.c │ └── hmc5883l.h ├── http-parser │ └── component.mk ├── http_client_ota │ ├── component.mk │ ├── http_buffered_client.c │ ├── http_buffered_client.h │ ├── http_client_ota.c │ └── http_client_ota.h ├── httpd │ ├── component.mk │ ├── fs.c │ ├── fs.h │ ├── fsdata.h │ ├── httpd.c │ ├── httpd.h │ ├── httpd_structs.h │ ├── readme.txt │ ├── strcasestr.c │ └── strcasestr.h ├── i2c │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── i2c.c │ └── i2c.h ├── i2s_dma │ ├── README.md │ ├── component.mk │ ├── i2s_dma.c │ └── i2s_dma.h ├── ina3221 │ ├── component.mk │ ├── ina3221.c │ └── ina3221.h ├── jsmn │ └── component.mk ├── l3gd20h │ ├── README.md │ ├── component.mk │ ├── l3gd20h.c │ ├── l3gd20h.h │ ├── l3gd20h_platform.c │ ├── l3gd20h_platform.h │ └── l3gd20h_types.h ├── libesphttpd │ └── component.mk ├── lis3dh │ ├── README.md │ ├── component.mk │ ├── lis3dh.c │ ├── lis3dh.h │ ├── lis3dh_platform.c │ ├── lis3dh_platform.h │ └── lis3dh_types.h ├── lis3mdl │ ├── README.md │ ├── component.mk │ ├── lis3mdl.c │ ├── lis3mdl.h │ ├── lis3mdl_platform.c │ ├── lis3mdl_platform.h │ └── lis3mdl_types.h ├── lsm303d │ ├── README.md │ ├── component.mk │ ├── lsm303d.c │ ├── lsm303d.h │ ├── lsm303d_platform.c │ ├── lsm303d_platform.h │ └── lsm303d_types.h ├── mactimer │ ├── component.mk │ ├── mactimer.c │ └── mactimer.h ├── max7219 │ ├── component.mk │ ├── max7219.c │ ├── max7219.h │ └── max7219_priv.h ├── mbedtls │ ├── component.mk │ ├── hardware_entropy.c │ ├── include │ │ └── mbedtls │ │ │ └── config.h │ └── net_lwip.c ├── mcp4725 │ ├── component.mk │ ├── mcp4725.c │ └── mcp4725.h ├── mdnsresponder │ ├── component.mk │ ├── mdnsresponder.c │ └── mdnsresponder.h ├── ms561101ba03 │ ├── component.mk │ ├── ms561101ba03.c │ └── ms561101ba03.h ├── onewire │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── onewire.c │ └── onewire.h ├── paho_mqtt_c │ ├── LICENSE.txt │ ├── MQTTClient.c │ ├── MQTTClient.h │ ├── MQTTConnect.h │ ├── MQTTConnectClient.c │ ├── MQTTDeserializePublish.c │ ├── MQTTESP8266.c │ ├── MQTTESP8266.h │ ├── MQTTFormat.h │ ├── MQTTPacket.c │ ├── MQTTPacket.h │ ├── MQTTPublish.h │ ├── MQTTSerializePublish.c │ ├── MQTTSubscribe.h │ ├── MQTTSubscribeClient.c │ ├── MQTTUnsubscribe.h │ ├── MQTTUnsubscribeClient.c │ ├── StackTrace.h │ └── component.mk ├── pca9685 │ ├── component.mk │ ├── pca9685.c │ └── pca9685.h ├── pcf8574 │ ├── component.mk │ ├── pcf8574.c │ └── pcf8574.h ├── pcf8591 │ ├── component.mk │ ├── pcf8591.c │ └── pcf8591.h ├── pwm │ ├── component.mk │ ├── pwm.c │ └── pwm.h ├── rboot-ota │ ├── component.mk │ ├── license.txt │ ├── ota-tftp.c │ ├── ota-tftp.h │ ├── rboot-api.c │ ├── rboot-api.h │ ├── rboot-integration.h │ └── readme.txt ├── sdio │ ├── component.mk │ ├── sdio.c │ ├── sdio.h │ └── sdio_impl.h ├── sht3x │ ├── README.md │ ├── component.mk │ ├── sht3x.c │ ├── sht3x.h │ └── sht3x_platform.h ├── sntp │ ├── component.mk │ ├── sntp.c │ ├── sntp.h │ └── sntp_fun.c ├── softuart │ ├── LICENSE │ ├── component.mk │ ├── softuart.c │ └── softuart.h ├── spiffs │ ├── README.md │ ├── component.mk │ ├── esp_spiffs.c │ ├── esp_spiffs.h │ ├── mkspiffs │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── mkspiffs.c │ └── spiffs_config.h ├── ssd1306 │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── config.h │ ├── ssd1306.c │ └── ssd1306.h ├── stdin_uart_interrupt │ ├── README.txt │ ├── component.mk │ ├── stdin_uart_interrupt.c │ └── stdin_uart_interrupt.h ├── timekeeping │ ├── LICENSE │ ├── README.timekeeping.md │ ├── component.mk │ ├── tests │ │ ├── quick │ │ │ ├── Makefile │ │ │ └── timekeeping_quick_tests.c │ │ ├── slew │ │ │ ├── Makefile │ │ │ └── timekeeping_slew_tests.c │ │ ├── sntp-run │ │ │ ├── Makefile │ │ │ ├── lwipopts.h │ │ │ ├── sntp_impl.c │ │ │ ├── sntp_impl.h │ │ │ └── timekeeping_sntp_run.c │ │ └── wrap │ │ │ ├── Makefile │ │ │ └── timekeeping_wrap_test.c │ └── timekeeping.c ├── tsl2561 │ ├── component.mk │ ├── tsl2561.c │ └── tsl2561.h ├── tsl4531 │ ├── component.mk │ ├── tsl4531.c │ └── tsl4531.h ├── tsoftuart │ ├── component.mk │ ├── tsoftuart.c │ └── tsoftuart.h ├── ultrasonic │ ├── component.mk │ ├── ultrasonic.c │ └── ultrasonic.h ├── wificfg │ ├── component.mk │ ├── content │ │ ├── challenge.html │ │ ├── favicon.ico │ │ ├── script.js │ │ ├── style.css │ │ ├── tasks.html │ │ └── wificfg │ │ │ ├── ap.html │ │ │ ├── index.html │ │ │ └── sta.html │ ├── wificfg.c │ └── wificfg.h ├── ws2812 │ ├── component.mk │ ├── ws2812.c │ └── ws2812.h └── ws2812_i2s │ ├── README.md │ ├── component.mk │ ├── ws2812_i2s.c │ └── ws2812_i2s.h ├── include ├── .gitignore ├── espressif │ ├── esp8266 │ │ ├── eagle_soc.h │ │ ├── esp8266.h │ │ ├── ets_sys.h │ │ ├── gpio_register.h │ │ ├── pin_mux_register.h │ │ ├── spi_register.h │ │ ├── timer_register.h │ │ └── uart_register.h │ ├── esp_common.h │ ├── esp_misc.h │ ├── esp_softap.h │ ├── esp_sta.h │ ├── esp_system.h │ ├── esp_timer.h │ ├── esp_wifi.h │ ├── osapi.h │ ├── phy_info.h │ ├── queue.h │ ├── sdk_private.h │ ├── spi_flash.h │ └── user_interface.h ├── etstimer.h └── ssid_config.h ├── ld ├── program.ld └── rom.ld ├── lib ├── allsymbols.rename ├── libgcc.a ├── libgcc.remove ├── libmain.a ├── libmain.remove ├── libnet80211.a ├── libnet80211.remove ├── libphy.a ├── libphy.remove ├── libpp.a ├── libpp.remove ├── libwpa.a └── libwpa.remove ├── libc ├── README.md ├── libc.remove └── xtensa-lx106-elf │ ├── include │ ├── _ansi.h │ ├── _newlib_version.h │ ├── _syslist.h │ ├── alloca.h │ ├── ar.h │ ├── argz.h │ ├── assert.h │ ├── complex.h │ ├── config.h │ ├── cpio.h │ ├── ctype.h │ ├── devctl.h │ ├── dirent.h │ ├── elf.h │ ├── envlock.h │ ├── envz.h │ ├── errno.h │ ├── fastmath.h │ ├── fcntl.h │ ├── fenv.h │ ├── fnmatch.h │ ├── getopt.h │ ├── glob.h │ ├── grp.h │ ├── iconv.h │ ├── ieeefp.h │ ├── inttypes.h │ ├── langinfo.h │ ├── libgen.h │ ├── limits.h │ ├── locale.h │ ├── machine │ │ ├── _arc4random.h │ │ ├── _default_types.h │ │ ├── _endian.h │ │ ├── _time.h │ │ ├── _types.h │ │ ├── ansi.h │ │ ├── endian.h │ │ ├── fastmath.h │ │ ├── ieeefp.h │ │ ├── malloc.h │ │ ├── param.h │ │ ├── setjmp-dj.h │ │ ├── setjmp.h │ │ ├── stdlib.h │ │ ├── termios.h │ │ ├── time.h │ │ └── types.h │ ├── malloc.h │ ├── math.h │ ├── memory.h │ ├── newlib.h │ ├── paths.h │ ├── pthread.h │ ├── pwd.h │ ├── reent.h │ ├── regdef.h │ ├── regex.h │ ├── sched.h │ ├── search.h │ ├── setjmp.h │ ├── signal.h │ ├── spawn.h │ ├── stdatomic.h │ ├── stdint.h │ ├── stdio.h │ ├── stdio_ext.h │ ├── stdlib.h │ ├── string.h │ ├── strings.h │ ├── sys │ │ ├── _default_fcntl.h │ │ ├── _intsup.h │ │ ├── _pthreadtypes.h │ │ ├── _sigset.h │ │ ├── _stdint.h │ │ ├── _timespec.h │ │ ├── _timeval.h │ │ ├── _types.h │ │ ├── cdefs.h │ │ ├── config.h │ │ ├── custom_file.h │ │ ├── dir.h │ │ ├── dirent.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── features.h │ │ ├── file.h │ │ ├── iconvnls.h │ │ ├── lock.h │ │ ├── param.h │ │ ├── queue.h │ │ ├── reent.h │ │ ├── resource.h │ │ ├── sched.h │ │ ├── select.h │ │ ├── signal.h │ │ ├── stat.h │ │ ├── stdio.h │ │ ├── string.h │ │ ├── syslimits.h │ │ ├── time.h │ │ ├── timeb.h │ │ ├── times.h │ │ ├── timespec.h │ │ ├── tree.h │ │ ├── types.h │ │ ├── unistd.h │ │ ├── utime.h │ │ └── wait.h │ ├── tar.h │ ├── termios.h │ ├── tgmath.h │ ├── threads.h │ ├── time.h │ ├── unctrl.h │ ├── unistd.h │ ├── utime.h │ ├── utmp.h │ ├── wchar.h │ ├── wctype.h │ ├── wordexp.h │ ├── xlocale.h │ └── xtensa │ │ └── config │ │ └── core-isa.h │ └── lib │ ├── crt0.o │ ├── libc.a │ ├── libg.a │ └── libm.a ├── lvgl ├── component.mk ├── lv_conf.h └── lv_drv_conf.h ├── lwip ├── component.mk ├── esp_interface.c ├── include │ ├── arch │ │ ├── cc.h │ │ ├── perf.h │ │ └── sys_arch.h │ ├── lwipopts.h │ └── netbuf_helpers.h └── sys_arch.c ├── open_esplibs ├── README.md ├── component.mk ├── include │ ├── esplibs │ │ ├── libmain.h │ │ ├── libnet80211.h │ │ ├── libphy.h │ │ ├── libpp.h │ │ └── libwpa.h │ └── open_esplibs.h ├── libmain │ ├── ets_timer.c │ ├── misc.c │ ├── os_cpu_a.c │ ├── spi_flash.c │ ├── timers.c │ ├── uart.c │ ├── user_interface.c │ └── xtensa_context.S ├── libnet80211 │ ├── ieee80211_ets.c │ ├── ieee80211_hostap.c │ ├── ieee80211_input.c │ ├── ieee80211_sta.c │ └── wl_cnx.c ├── libphy │ ├── phy.c │ ├── phy_chip_v6.c │ └── phy_sleep.c ├── libpp │ ├── esf_buf.c │ ├── if_hwctrl.c │ ├── lmac.c │ ├── pm.c │ ├── pp.c │ └── wdev.c └── libwpa │ ├── os_xtensa.c │ └── wpa_main.c ├── parameters.mk ├── tests ├── Makefile ├── README.md ├── cases │ ├── 01_scheduler.c │ ├── 02_heap.c │ ├── 03_byte_load_flash.c │ ├── 04_wifi_basic.c │ ├── 05_spiffs.c │ ├── 06_timers.c │ ├── 07_sysparam.c │ └── 08_spiflash.c ├── include │ └── testcase.h ├── test_main.c └── test_runner.py └── utils ├── addrsource ├── filteroutput.py └── travis_build └── install_toolchain.sh /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ( 2 | (nil 3 | ) 4 | (c-mode 5 | (indent-tabs-mode . nil) 6 | (c-file-style . "bsd") 7 | (c-basic-offset . 4) 8 | ) 9 | (asm-mode 10 | (indent-tabs-mode . nil) 11 | ; this is basically a hack so asm-mode indents with spaces not tabs 12 | ; taken from http://stackoverflow.com/questions/2668563/emacs-indentation-in-asm-mode 13 | ; (moving to gas-mode may be a better choice) 14 | (tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))) 15 | (asm-comment-char . "#") 16 | ) 17 | ) 18 | 19 | ; IMPORTANT: If you want to write assembly and have indenting to not be infuriating, 20 | ; you probably also want this in your .emacs file: 21 | ; 22 | ; (add-hook 'asm-mode-hook '(lambda () (setq indent-line-function 'indent-relative))) 23 | ; 24 | ; This is not safe to set as a local variable. 25 | 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *# 3 | .#* 4 | GPATH 5 | GRTAGS 6 | GTAGS 7 | build 8 | firmware 9 | .gdb_history 10 | local.mk 11 | local.h 12 | screenlog.* 13 | *.swp 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | sudo: false 3 | env: 4 | # Target commit for https://github.com/pfalcon/esp-open-sdk/ 5 | OPENSDK_COMMIT=b069537 6 | CROSS_ROOT="${HOME}/toolchain-${OPENSDK_COMMIT}" 7 | CROSS_BINDIR="${CROSS_ROOT}/bin" 8 | CROSS="ccache xtensa-lx106-elf-" 9 | MAKE_CMD="make WARNINGS_AS_ERRORS=1 -C examples/ build-examples" 10 | PATH=${PATH}:${CROSS_BINDIR} 11 | cache: 12 | directories: 13 | - ${CROSS_ROOT} 14 | addons: 15 | apt: 16 | packages: 17 | - make 18 | - unrar 19 | - autoconf 20 | - automake 21 | - libtool 22 | - gcc 23 | - g++ 24 | - gperf 25 | - flex 26 | - bison 27 | - texinfo 28 | - gawk 29 | - libncurses5-dev 30 | - libexpat1-dev 31 | - python 32 | - python-pip 33 | - sed 34 | - git 35 | - help2man 36 | - vim-common 37 | - zlib1g-dev 38 | 39 | before_install: 40 | - pip install --user pyserial 41 | - travis_wait 30 utils/travis_build/install_toolchain.sh 42 | 43 | script: 44 | - cd ${TRAVIS_BUILD_DIR} 45 | # Remove ssid_config requirement for examples 46 | - echo -e '#define WIFI_SSID "mywifissid"\n#define WIFI_PASS "my secret password"\n' > include/private_ssid_config.h 47 | # Don't verbose-build all examples (too much output), only verbose-build errors 48 | - ( ${MAKE_CMD} ) || ( ${MAKE_CMD} V=1 ) 49 | # build bootloader 50 | - make -C bootloader/ 51 | -------------------------------------------------------------------------------- /FreeRTOS/Source/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the five sample 7 | memory allocators as described on the http://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler, where the directory name denotes the compiler 11 | specific files the directory contains. 12 | 13 | 14 | 15 | For example, if you are interested in the [compiler] port for the [architecture] 16 | microcontroller, then the port specific files are contained in 17 | FreeRTOS/Source/Portable/[compiler]/[architecture] directory. If this is the 18 | only port you are interested in then all the other directories can be 19 | ignored. 20 | 21 | -------------------------------------------------------------------------------- /FreeRTOS/Source/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /FreeRTOS/component.mk: -------------------------------------------------------------------------------- 1 | 2 | INC_DIRS += $(freertos_MAIN)include $(freertos_MAIN)portable/esp8266 3 | 4 | # args for passing into compile rule generation 5 | freertos_MAIN = $(freertos_ROOT)Source/ 6 | freertos_INC_DIR = $(freertos_MAIN)include $(freertos_MAIN)portable/esp8266 7 | freertos_SRC_DIR = $(freertos_MAIN) $(freertos_MAIN)portable/esp8266 8 | $(eval $(call component_compile_rules,freertos)) 9 | -------------------------------------------------------------------------------- /bootloader/README.md: -------------------------------------------------------------------------------- 1 | OTA Bootloader (rboot) source module and support files. 2 | 3 | rboot is an open source bootloader by Richard Burton: 4 | https://github.com/raburton/rboot 5 | 6 | Can be used to build an esp-open-rtos compatible rboot bootloader. Run 'make bootloader' in this directory to compile a new bootloader. 7 | 8 | Compiling a new bootloader is optional, there's a prebuilt one in the "firmware_prebuilt" directory that will be used if no new bootloader was compiled. 9 | 10 | It is also possible to use rboot from upstream verbatim, but *ensure that the `RBOOT_BIG_FLASH` option is enabled or images in slots other than 0 won't work correctly. 11 | 12 | See the contents of the 'rboot' directory for more information on rboot. 13 | -------------------------------------------------------------------------------- /bootloader/c_types.h: -------------------------------------------------------------------------------- 1 | /* rboot type definitions */ 2 | 3 | 4 | typedef int int32; 5 | typedef unsigned short uint16; 6 | typedef unsigned int uint32; 7 | typedef unsigned char uint8; 8 | 9 | #define TRUE 1 10 | #define FALSE 0 11 | -------------------------------------------------------------------------------- /bootloader/firmware_prebuilt/rboot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/bootloader/firmware_prebuilt/rboot.bin -------------------------------------------------------------------------------- /bootloader/rboot.h: -------------------------------------------------------------------------------- 1 | /* rboot header overrides 2 | 3 | This "wrapper" header contains default values for building rboot 4 | on/for esp-open-rtos. It gets included both when building the 5 | bootloader and when building extras/rboot-ota support. It includes 6 | the default bootloader/rboot/rboot.h header via the gcc 7 | include_next mechanism. 8 | */ 9 | #ifndef __RBOOT_H__ 10 | 11 | // Big flash support is required for esp-open-rtos (we use 8Mbit 12 | // "slots" only.) 13 | #define BOOT_BIG_FLASH 14 | 15 | // enable 2 way communication between 16 | // rBoot and the user app via the esp rtc data area 17 | #define BOOT_RTC_ENABLED 18 | 19 | // Call 'main' rboot.h to pick up defaults for other parameters 20 | #include_next "rboot.h" 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /core/component.mk: -------------------------------------------------------------------------------- 1 | INC_DIRS += $(core_ROOT)include 2 | 3 | # args for passing into compile rule generation 4 | core_SRC_DIR = $(core_ROOT) 5 | 6 | $(eval $(call component_compile_rules,core)) 7 | -------------------------------------------------------------------------------- /core/cplusplus_operators.cpp: -------------------------------------------------------------------------------- 1 | /* Part of esp-open-rtos 2 | * BSD Licensed as described in the file LICENSE 3 | */ 4 | #include 5 | #include 6 | 7 | void * __attribute__((weak)) operator new(size_t size) 8 | { 9 | return malloc(size); 10 | } 11 | 12 | void * __attribute__((weak)) operator new[](size_t size) 13 | { 14 | return malloc(size); 15 | } 16 | 17 | void __attribute__((weak)) operator delete(void * ptr) 18 | { 19 | free(ptr); 20 | } 21 | 22 | void __attribute__((weak)) operator delete[](void * ptr) 23 | { 24 | free(ptr); 25 | } 26 | -------------------------------------------------------------------------------- /core/esp_hwrand.c: -------------------------------------------------------------------------------- 1 | /* Hardware Random Number Generator Functions 2 | * 3 | * For documentation, see http://esp8266-re.foogod.com/wiki/Random_Number_Generator 4 | * 5 | * Part of esp-open-rtos 6 | * Copyright (C) 2015 Angus Gratton 7 | * BSD Licensed as described in the file LICENSE 8 | */ 9 | #include 10 | #include 11 | #include 12 | 13 | /* Return a random 32-bit number. 14 | * 15 | * This is also used as a substitute for rand() called from 16 | * lmac.a:sdk_lmacTxFrame to avoid touching the newlib reent structures within 17 | * the NMI and the NMI code needs to be in IRAM. 18 | */ 19 | uint32_t IRAM hwrand(void) 20 | { 21 | return WDEV.HWRNG; 22 | } 23 | 24 | /* Fill a variable size buffer with data from the Hardware RNG */ 25 | void hwrand_fill(uint8_t *buf, size_t len) 26 | { 27 | for(size_t i = 0; i < len; i+=4) { 28 | uint32_t random = WDEV.HWRNG; 29 | /* using memcpy here in case 'buf' is unaligned */ 30 | memcpy(buf + i, &random, (i+4 <= len) ? 4 : (len % 4)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/esp_interrupts.c: -------------------------------------------------------------------------------- 1 | /* ESP8266 Xtensa interrupt management functions 2 | * 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2015 Angus Gratton 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #include 9 | 10 | typedef struct _xt_isr_entry_ { 11 | _xt_isr handler; 12 | void *arg; 13 | } _xt_isr_entry; 14 | 15 | _xt_isr_entry isr[16]; 16 | 17 | bool esp_in_isr; 18 | 19 | void IRAM _xt_isr_attach(uint8_t i, _xt_isr func, void *arg) 20 | { 21 | isr[i].handler = func; 22 | isr[i].arg = arg; 23 | } 24 | 25 | /* Generic ISR handler. 26 | 27 | Handles all flags set for interrupts in 'intset'. 28 | */ 29 | uint16_t IRAM _xt_isr_handler(uint16_t intset) 30 | { 31 | esp_in_isr = true; 32 | 33 | /* WDT has highest priority (occasional WDT resets otherwise) */ 34 | if (intset & BIT(INUM_WDT)) { 35 | _xt_clear_ints(BIT(INUM_WDT)); 36 | isr[INUM_WDT].handler(NULL); 37 | intset -= BIT(INUM_WDT); 38 | } 39 | 40 | while (intset) { 41 | uint8_t index = __builtin_ffs(intset) - 1; 42 | uint16_t mask = BIT(index); 43 | _xt_clear_ints(mask); 44 | _xt_isr handler = isr[index].handler; 45 | if (handler) { 46 | handler(isr[index].arg); 47 | } 48 | intset -= mask; 49 | } 50 | 51 | esp_in_isr = false; 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /core/esp_iomux.c: -------------------------------------------------------------------------------- 1 | /* Compiler-level implementation for esp/iomux.h and esp/iomux_private.h 2 | * 3 | * Part of esp-open-rtos 4 | * Copyright (C) 2015 Superhouse Automation Pty Ltd 5 | * BSD Licensed as described in the file LICENSE 6 | */ 7 | #include "esp/iomux.h" 8 | #include "common_macros.h" 9 | 10 | const static IRAM_DATA uint32_t IOMUX_TO_GPIO[] = { 12, 13, 14, 15, 3, 1, 6, 7, 8, 9, 10, 11, 0, 2, 4, 5 }; 11 | const static IRAM_DATA uint32_t GPIO_TO_IOMUX[] = { 12, 5, 13, 4, 14, 15, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3 }; 12 | 13 | uint8_t IRAM gpio_to_iomux(const uint8_t gpio_number) 14 | { 15 | return GPIO_TO_IOMUX[gpio_number]; 16 | } 17 | 18 | uint8_t IRAM iomux_to_gpio(const uint8_t iomux_number) 19 | { 20 | return IOMUX_TO_GPIO[iomux_number]; 21 | } 22 | -------------------------------------------------------------------------------- /core/esp_phy.c: -------------------------------------------------------------------------------- 1 | /** esp/phy.h 2 | * 3 | * PHY hardware management functions. 4 | * 5 | * Part of esp-open-rtos 6 | * Copyright (C) 2016 ChefSteps, Inc 7 | * BSD Licensed as described in the file LICENSE 8 | */ 9 | #include 10 | #include 11 | 12 | void bt_coexist_configure(bt_coexist_mode_t mode, uint8_t bt_active_pin, uint8_t bt_priority_pin) 13 | { 14 | /* Disable coexistence entirely before changing pin assignments */ 15 | GPIO.OUT &= ~(GPIO_OUT_BT_COEXIST_MASK); 16 | uint32_t new_mask = 0; 17 | 18 | new_mask = VAL2FIELD_M(GPIO_OUT_BT_ACTIVE_PIN, bt_active_pin) + 19 | VAL2FIELD_M(GPIO_OUT_BT_PRIORITY_PIN, bt_priority_pin); 20 | 21 | if(mode == BT_COEXIST_USE_BT_ACTIVE || mode == BT_COEXIST_USE_BT_ACTIVE_PRIORITY) { 22 | gpio_enable(bt_active_pin, GPIO_INPUT); 23 | new_mask |= GPIO_OUT_BT_ACTIVE_ENABLE; 24 | } 25 | if(mode == BT_COEXIST_USE_BT_ACTIVE_PRIORITY) { 26 | gpio_enable(bt_priority_pin, GPIO_INPUT); 27 | new_mask |= GPIO_OUT_BT_PRIORITY_ENABLE; 28 | } 29 | GPIO.OUT |= new_mask; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /core/include/debug_dumps.h: -------------------------------------------------------------------------------- 1 | /* Functions for dumping status/debug output/etc, including fatal 2 | * exception handling. 3 | * 4 | * Part of esp-open-rtos 5 | * 6 | * Copyright (C) 2015-2016 Superhouse Automation Pty Ltd 7 | * BSD Licensed as described in the file LICENSE 8 | */ 9 | #ifndef _DEBUG_DUMPS_H 10 | #define _DEBUG_DUMPS_H 11 | #include 12 | 13 | /* Dump stack memory to stdout, starting from stack pointer address sp. */ 14 | void dump_stack(uint32_t *sp); 15 | 16 | /* Dump heap statistics to stdout */ 17 | void dump_heapinfo(void); 18 | 19 | /* Called from exception_vectors.S when a fatal exception occurs. 20 | 21 | Probably not useful to be called in other contexts. 22 | */ 23 | void __attribute__((noreturn)) fatal_exception_handler(uint32_t *sp, bool registers_saved_on_stack); 24 | void __attribute__((weak, alias("fatal_exception_handler"))) 25 | debug_exception_handler(uint32_t *sp, bool registers_saved_on_stack); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /core/include/esp/clocks.h: -------------------------------------------------------------------------------- 1 | /* esp/clocks.h 2 | * 3 | * ESP8266 internal clock values 4 | * 5 | * At the moment there's not a lot known about varying clock speeds 6 | * apart from doubling the CPU clock. It may be possible to set clock 7 | * domains differently somehow. 8 | * 9 | * Part of esp-open-rtos 10 | * Copyright (C) 2015 Superhouse Automation Pty Ltd 11 | * BSD Licensed as described in the file LICENSE 12 | */ 13 | #ifndef _ESP_CLOCKS_H 14 | #define _ESP_CLOCKS_H 15 | 16 | /* CPU clock, can be overclocked to 160MHz via a dport register setting */ 17 | #define CPU_CLK_FREQ 80*1000000 18 | 19 | /* Main peripheral clock 20 | 21 | This is also the master frequency for the UART and the TIMER module 22 | (before divisors applied to either.) 23 | */ 24 | #define APB_CLK_FREQ CPU_CLK_FREQ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /core/include/esp/hwrand.h: -------------------------------------------------------------------------------- 1 | /** esp/hwrand.h 2 | * 3 | * Hardware Random Number Generator functions. 4 | * 5 | * For documentation, see http://esp8266-re.foogod.com/wiki/Random_Number_Generator 6 | * 7 | * Part of esp-open-rtos 8 | * Copyright (C) 2015 Angus Gratton 9 | * BSD Licensed as described in the file LICENSE 10 | */ 11 | #ifndef _ESP_RNG_H 12 | #define _ESP_RNG_H 13 | #include 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Return a random 32-bit number */ 21 | uint32_t hwrand(void); 22 | 23 | /* Fill a variable size buffer with data from the Hardware RNG */ 24 | void hwrand_fill(uint8_t *buf, size_t len); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /core/include/esp/slc.h: -------------------------------------------------------------------------------- 1 | /* esp/slc_regs.h 2 | * 3 | * ESP8266 SLC functions 4 | */ 5 | 6 | #ifndef _ESP_SLC_H 7 | #define _ESP_SLC_H 8 | 9 | #include "esp/slc_regs.h" 10 | 11 | /* Memory layout for DMA transfer descriptors. */ 12 | 13 | struct SLCDescriptor 14 | { 15 | uint32_t flags; 16 | uint32_t buf_ptr; 17 | uint32_t next_link_ptr; 18 | }; 19 | 20 | #define SLC_DESCRIPTOR_FLAGS_BLOCKSIZE_M 0x00000fff 21 | #define SLC_DESCRIPTOR_FLAGS_BLOCKSIZE_S 0 22 | #define SLC_DESCRIPTOR_FLAGS_DATA_LENGTH_M 0x00000fff 23 | #define SLC_DESCRIPTOR_FLAGS_DATA_LENGTH_S 12 24 | #define SLC_DESCRIPTOR_FLAGS_SUB_SOF BIT(29) 25 | #define SLC_DESCRIPTOR_FLAGS_EOF BIT(30) 26 | #define SLC_DESCRIPTOR_FLAGS_OWNER BIT(31) 27 | 28 | #define SLC_DESCRIPTOR_FLAGS(blocksize,datalen,sub_sof,eof,owner) ( \ 29 | VAL2FIELD_M(SLC_DESCRIPTOR_FLAGS_BLOCKSIZE,blocksize)| \ 30 | VAL2FIELD_M(SLC_DESCRIPTOR_FLAGS_DATA_LENGTH,datalen)| \ 31 | ((sub_sof)?SLC_DESCRIPTOR_FLAGS_SUB_SOF:0)| \ 32 | ((eof)?SLC_DESCRIPTOR_FLAGS_EOF:0)| \ 33 | ((owner)?SLC_DESCRIPTOR_FLAGS_OWNER:0) \ 34 | ) 35 | 36 | 37 | #endif /* _ESP_SLC_REGS_H */ 38 | -------------------------------------------------------------------------------- /core/include/esp/types.h: -------------------------------------------------------------------------------- 1 | #ifndef _ESP_TYPES_H 2 | #define _ESP_TYPES_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | typedef volatile uint32_t *esp_reg_t; 9 | 10 | #endif /* _ESP_TYPES_H */ 11 | -------------------------------------------------------------------------------- /core/include/esp8266.h: -------------------------------------------------------------------------------- 1 | /* esp8266.h 2 | * 3 | * ESP-specific SoC-level addresses, macros, etc. 4 | * 5 | * Part of esp-open-rtos 6 | * Copyright (C) 2015 Superhouse Automation Pty Ltd 7 | * BSD Licensed as described in the file LICENSE 8 | */ 9 | #include 10 | 11 | #ifndef _ESP8266_H 12 | #define _ESP8266_H 13 | 14 | #include "common_macros.h" 15 | #include "esp/registers.h" 16 | #include "esp/interrupts.h" 17 | #include "esp/iomux.h" 18 | #include "esp/gpio.h" 19 | #include "esp/timer.h" 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /core/include/os_version.h: -------------------------------------------------------------------------------- 1 | #ifndef _VERSION_H 2 | #define _VERSION_H 3 | 4 | #define OS_VERSION_STR "0.0.1" 5 | 6 | #endif /* _VERSION_H */ 7 | -------------------------------------------------------------------------------- /core/include/stdout_redirect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Part of esp-open-rtos 3 | * Copyright (C) 2016 Oto Petrik 4 | * BSD Licensed as described in the file LICENSE 5 | */ 6 | 7 | #ifndef _STDOUT_REDIRECT_H_ 8 | #define _STDOUT_REDIRECT_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" 14 | { 15 | #endif 16 | 17 | typedef ssize_t _WriteFunction(struct _reent *r, int fd, const void *ptr, size_t len); 18 | 19 | /** Set implementation of write syscall for stdout. 20 | * 21 | * Use this function to redirect stdout for further processing (save to file, send over network). 22 | * It may be good idea to save result of `get_write_stdout()` beforehand and call 23 | * it at the end of the supplied function. 24 | * 25 | * NOTE: use NULL to reset to default implementation. 26 | * 27 | * @param[in] f New code to handle stdout output 28 | * 29 | */ 30 | void set_write_stdout(_WriteFunction *f); 31 | 32 | /** Get current implementation of write syscall for stdout. 33 | * 34 | * Save returned value before calling `set_write_stdout`, it allows for chaining 35 | * multiple independent handlers. 36 | * 37 | * @returns current stdout handler 38 | */ 39 | _WriteFunction *get_write_stdout(); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _STDOUT_REDIRECT_H_ */ 46 | -------------------------------------------------------------------------------- /core/include/user_exception.h: -------------------------------------------------------------------------------- 1 | /* Allows the user to set their own exception handler. */ 2 | 3 | #ifndef _USER_EXCEPTION_H 4 | #define _USER_EXCEPTION_H 5 | 6 | void set_user_exception_handler(void (*fn)(void)); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /core/led_debug.s: -------------------------------------------------------------------------------- 1 | /* 2 | * Useful debugging macro to .include for blinking LEDs on/off from assembler code 3 | * (aka 1 bit debugging, yay!) 4 | * 5 | * To have this work from initial reset, without needing an iomux call 6 | * first, choose a pin where iomux defaults to GPIO (ie 0,2,4,5) 7 | * 8 | * Current sets on=LOW, as the GPIO2 pin is active low 9 | */ 10 | LED_GPIO=2 11 | GPIO_DIR_SET = 0x6000030c 12 | GPIO_OUT_SET = 0x60000300 13 | GPIO_OUT_CLEAR = 0x60000308 14 | 15 | .macro led_op rega, regb, target 16 | movi \rega, GPIO_DIR_SET 17 | movi \regb, (1< 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | void IRAM *zalloc(size_t nbytes) 16 | { 17 | return calloc(1, nbytes); 18 | } 19 | 20 | /* UART RX function from Espressif SDK internals. 21 | * 22 | * Not part of published API. 23 | */ 24 | int sdk_uart_rx_one_char(char *buf) { 25 | int c = uart_getc_nowait(0); 26 | if(c < 0) 27 | return 1; 28 | *buf = (char)c; 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | EXAMPLES = $(shell find $(dir $(lastword $(MAKEFILE_LIST))) -mindepth 2 -name Makefile | sed s/Makefile//g) 2 | # Generate some dummy .dummybuild/.dummyrebuild target files 3 | EXAMPLES_BUILD = $(patsubst %,%.dummybuild,$(EXAMPLES)) 4 | EXAMPLES_REBUILD = $(patsubst %,%.dummyrebuild,$(EXAMPLES)) 5 | EXAMPLES_CLEAN = $(patsubst %,%.dummyclean,$(EXAMPLES)) 6 | 7 | warning: 8 | @echo "******************************************************" 9 | @echo "You may not want this Makefile, even though it's here!" 10 | @echo "******************************************************" 11 | @echo "" 12 | @echo "SUGGESTIONS:" 13 | @echo "Running 'make' in one of the subdirectories of examples/ will build a single example." 14 | @echo "Running 'make help' in one of the subdirectories of examples/ will print some help." 15 | @echo "" 16 | @echo "OTHERWISE:" 17 | @echo "This makefile is for building all of the examples at once, as a developer test." 18 | @echo "To use it, run 'make build-examples' or 'make rebuild-examples'" 19 | @echo 20 | 21 | build-examples: $(EXAMPLES_BUILD) 22 | 23 | rebuild-examples: $(EXAMPLES_REBUILD) 24 | 25 | clean-examples: $(EXAMPLES_CLEAN) 26 | 27 | %.dummybuild: 28 | $(MAKE) -C $(dir $@) 29 | 30 | %.dummyrebuild: 31 | $(MAKE) -C $(dir $@) rebuild 32 | 33 | %.dummyclean: 34 | $(MAKE) -C $(dir $@) clean 35 | 36 | .PHONY: warning rebuild-examples build-examples clean-examples 37 | .NOTPARALLEL: 38 | .ONESHELL: 39 | -------------------------------------------------------------------------------- /examples/access_point/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for access_point example 2 | PROGRAM=access_point 3 | EXTRA_COMPONENTS=extras/dhcpserver 4 | 5 | include ../../common.mk 6 | -------------------------------------------------------------------------------- /examples/ad770x/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = ad770x 2 | EXTRA_COMPONENTS = extras/ad770x 3 | #ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/ads1115_test/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = ads1115_test 2 | EXTRA_COMPONENTS = extras/i2c extras/ads111x 3 | #ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/aws_iot/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=aws_iot 2 | EXTRA_COMPONENTS = extras/paho_mqtt_c extras/mbedtls 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/aws_iot/client_config.c: -------------------------------------------------------------------------------- 1 | // AWS IoT client endpoint 2 | const char *client_endpoint = ".iot..amazonaws.com"; 3 | 4 | // AWS IoT device certificate (ECC) 5 | const char *client_cert = 6 | "-----BEGIN CERTIFICATE-----\r\n" 7 | "------------------ -------------------\r\n" 8 | "-----END CERTIFICATE-----\r\n"; 9 | 10 | // AWS IoT device private key (ECC) 11 | const char *client_key = 12 | "-----BEGIN EC PARAMETERS-----\r\n" 13 | "BggqhkjOPQMBBw==\r\n" 14 | "-----END EC PARAMETERS-----\r\n" 15 | "-----BEGIN EC PRIVATE KEY-----\r\n" 16 | "------------------ -------------------\r\n" 17 | "-----END EC PRIVATE KEY-----\r\n"; 18 | -------------------------------------------------------------------------------- /examples/aws_iot/ssl_connection.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSL_CONNECTION_H_ 2 | #define _SSL_CONNECTION_H_ 3 | 4 | // this must be ahead of any mbedtls header files so the local mbedtls/config.h can be properly referenced 5 | #include "mbedtls/config.h" 6 | 7 | #include "mbedtls/net_sockets.h" 8 | #include "mbedtls/debug.h" 9 | #include "mbedtls/ssl.h" 10 | #include "mbedtls/entropy.h" 11 | #include "mbedtls/ctr_drbg.h" 12 | #include "mbedtls/error.h" 13 | #include "mbedtls/certs.h" 14 | 15 | typedef struct SSLConnection { 16 | mbedtls_net_context net_ctx; 17 | mbedtls_ssl_context ssl_ctx; 18 | mbedtls_ssl_config ssl_conf; 19 | 20 | mbedtls_ctr_drbg_context drbg_ctx; 21 | mbedtls_entropy_context entropy_ctx; 22 | 23 | mbedtls_x509_crt ca_cert; 24 | mbedtls_x509_crt client_cert; 25 | mbedtls_pk_context client_key; 26 | 27 | char *ca_cert_str; 28 | char *client_cert_str; 29 | char *client_key_str; 30 | } SSLConnection; 31 | 32 | extern void ssl_init(SSLConnection* n); 33 | extern int ssl_connect(SSLConnection* n, const char* host, int port); 34 | extern int ssl_destroy(SSLConnection* n); 35 | extern int ssl_read(SSLConnection* n, unsigned char* buffer, int len, 36 | int timeout_ms); 37 | extern int ssl_write(SSLConnection* n, unsigned char* buffer, int len, 38 | int timeout_ms); 39 | 40 | #endif /* _SSL_CONNECTION_H_ */ 41 | -------------------------------------------------------------------------------- /examples/bh1750/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=bh1750_example 2 | EXTRA_COMPONENTS = extras/i2c extras/bh1750 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/bh1750/bh1750_example.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "espressif/esp_common.h" 4 | #include "esp/uart.h" 5 | 6 | #include "FreeRTOS.h" 7 | #include "task.h" 8 | 9 | #include "i2c/i2c.h" 10 | #include "bh1750/bh1750.h" 11 | 12 | #define SCL_PIN 5 13 | #define SDA_PIN 4 14 | #define I2C_BUS 0 15 | 16 | static void measure(void *pvParameters) 17 | { 18 | i2c_dev_t dev = { 19 | .addr = BH1750_ADDR_LO, 20 | .bus = I2C_BUS, 21 | }; 22 | bh1750_configure(&dev, BH1750_CONTINUOUS_MODE | BH1750_HIGH_RES_MODE); 23 | 24 | while (1) { 25 | while(1) { 26 | vTaskDelay(200 / portTICK_PERIOD_MS); 27 | printf("Lux: %d\n", bh1750_read(&dev)); 28 | } 29 | } 30 | } 31 | 32 | void user_init(void) 33 | { 34 | uart_set_baud(0, 115200); 35 | 36 | // Just some information 37 | printf("\n"); 38 | printf("SDK version : %s\n", sdk_system_get_sdk_version()); 39 | printf("GIT version : %s\n", GITSHORTREV); 40 | 41 | i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_100K); 42 | 43 | xTaskCreate(measure, "measure_task", 256, NULL, 2, NULL); 44 | } 45 | -------------------------------------------------------------------------------- /examples/blink/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* Blink FreeRTOSConfig overrides. 2 | 3 | This is intended as an example of overriding some of the default FreeRTOSConfig settings, 4 | which are otherwise found in FreeRTOS/Source/include/FreeRTOSConfig.h 5 | */ 6 | 7 | /* We sleep a lot, so cooperative multitasking is fine. */ 8 | #define configUSE_PREEMPTION 0 9 | 10 | /* Blink doesn't really need a lot of stack space! */ 11 | #define configMINIMAL_STACK_SIZE 128 12 | 13 | /* Use the defaults for everything else */ 14 | #include_next 15 | 16 | -------------------------------------------------------------------------------- /examples/blink/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=blink 2 | include ../../common.mk 3 | -------------------------------------------------------------------------------- /examples/blink_timers/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=blink_timers 2 | include ../../common.mk 3 | -------------------------------------------------------------------------------- /examples/bme680/bme680_heating_profiles/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=BME680_heating_profiles 2 | EXTRA_COMPONENTS = extras/i2c extras/bme680 3 | include ../../../common.mk 4 | -------------------------------------------------------------------------------- /examples/bme680/bme680_one_sensor/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=BME680_One_Sensor 2 | EXTRA_COMPONENTS = extras/i2c extras/bme680 3 | include ../../../common.mk 4 | -------------------------------------------------------------------------------- /examples/bme680/bme680_two_sensors/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=BME680_Tow_Sensors 2 | EXTRA_COMPONENTS = extras/i2c extras/bme680 3 | include ../../../common.mk 4 | -------------------------------------------------------------------------------- /examples/bmp180_i2c/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=BMP180_Reader 2 | EXTRA_COMPONENTS = extras/i2c extras/bmp180 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/bmp180_i2c/README.md: -------------------------------------------------------------------------------- 1 | # I2C / BMP180 Example 2 | 3 | This example references two addtional drivers [i2c](https://github.com/kanflo/esp-open-rtos-driver-i2c) and [bmp180](https://github.com/Angus71/esp-open-rtos-driver-bmp180), which are provided in the `../../extras` folder. 4 | 5 | If you plan to use one or both of this drivers in your own projects, please check the main development pages for updated versions or reported issues. 6 | 7 | To run this example connect the BMP085/BMP180 SCL to GPIO0 and SDA to GPIO2. 8 | -------------------------------------------------------------------------------- /examples/bmp280/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=BMP280_example 2 | EXTRA_COMPONENTS = extras/i2c extras/bmp280 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/button/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=button 2 | include ../../common.mk 3 | -------------------------------------------------------------------------------- /examples/ccs811/ccs811_one_sensor/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=CCS811_One_Sensor 2 | EXTRA_COMPONENTS = extras/i2c extras/ccs811 3 | include ../../../common.mk 4 | 5 | -------------------------------------------------------------------------------- /examples/ccs811/ccs811_plus_sht3x/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=CCS811_Plus_SHT3x 2 | EXTRA_COMPONENTS = extras/i2c extras/ccs811 extras/sht3x 3 | include ../../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ccs811/ccs811_temperature/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=CCS811_Temperature 2 | EXTRA_COMPONENTS = extras/i2c extras/ccs811 3 | LIBS ?= gcc hal m 4 | include ../../../common.mk 5 | -------------------------------------------------------------------------------- /examples/cpp_01_tasks/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=cpp_01_tasks 3 | EXTRA_COMPONENTS=extras/cpp_support 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/crc_example/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=crc_example 2 | EXTRA_COMPONENTS = extras/crc_generic 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/crc_example/crc_config_perso.h: -------------------------------------------------------------------------------- 1 | /* 2 | * perso_config.h 3 | * 4 | * Created on: 11 févr. 2017 5 | * Author: lilian 6 | */ 7 | 8 | #include "espressif/esp_common.h" 9 | #include "FreeRTOS.h" 10 | 11 | #define CRC_DEBUG 0 12 | #define CRC_4BYTE_SUPPORT 0 13 | /* Use the defaults for everything else */ 14 | #include_next "crc_config.h" 15 | 16 | -------------------------------------------------------------------------------- /examples/crc_example/crc_config_user.h: -------------------------------------------------------------------------------- 1 | /* 2 | * perso_config.h 3 | * 4 | * Created on: 11 févr. 2017 5 | * Author: lilian 6 | */ 7 | 8 | #ifndef CRC_CONFIG_USER_H_ 9 | #define CRC_CONFIG_USER_H_ 10 | 11 | #include "espressif/esp_common.h" 12 | #include "FreeRTOS.h" 13 | 14 | #define CRC_DEBUG 0 15 | #define CRC_1BYTE_SUPPORT 1 16 | #define CRC_4BYTE_SUPPORT 0 17 | #define CRC_8BYTE_SUPPORT 0 18 | 19 | typedef uint8_t crc_8; 20 | typedef uint16_t crc_16; 21 | typedef uint32_t crc_32; 22 | typedef uint64_t crc_64; 23 | 24 | #endif /* CRC_CONFIG_USER_H_ */ 25 | 26 | -------------------------------------------------------------------------------- /examples/dht_sensor/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = dht_sensor 2 | EXTRA_COMPONENTS = extras/dht 3 | include ../../common.mk 4 | 5 | -------------------------------------------------------------------------------- /examples/ds1302_test/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = ds1302_test 2 | EXTRA_COMPONENTS = extras/ds1302 3 | #ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/ds1302_test/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Example of using DS1302 RTC driver 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * Pavel Merzlyakov 7 | * BSD Licensed as described in the file LICENSE 8 | */ 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define CE_PIN 5 15 | #define IO_PIN 4 16 | #define SCLK_PIN 0 17 | 18 | void user_init(void) 19 | { 20 | uart_set_baud(0, 115200); 21 | printf("SDK version:%s\n", sdk_system_get_sdk_version()); 22 | 23 | struct tm time = { 24 | .tm_year = 2016, 25 | .tm_mon = 9, 26 | .tm_mday = 31, 27 | .tm_hour = 21, 28 | .tm_min = 54, 29 | .tm_sec = 10 30 | }; 31 | 32 | ds1302_init(CE_PIN, IO_PIN, SCLK_PIN); 33 | ds1302_set_write_protect(false); 34 | 35 | ds1302_set_time(&time); 36 | ds1302_start(true); 37 | 38 | while (true) 39 | { 40 | ds1302_get_time(&time); 41 | 42 | printf("%04d-%02d-%02d %02d:%02d:%02d\n", time.tm_year, time.tm_mon + 1, 43 | time.tm_mday, time.tm_hour, time.tm_min, time.tm_sec); 44 | 45 | for (uint32_t i = 0; i < 1000; i++) 46 | sdk_os_delay_us(500); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/ds1307/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = ds1307 2 | EXTRA_COMPONENTS = extras/i2c extras/ds1307 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ds1307/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Example of using DS1307 RTC driver 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define I2C_BUS 0 15 | #define SCL_PIN 5 16 | #define SDA_PIN 4 17 | 18 | void user_init(void) 19 | { 20 | uart_set_baud(0, 115200); 21 | printf("SDK version:%s\n", sdk_system_get_sdk_version()); 22 | 23 | i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_400K); 24 | i2c_dev_t dev = { 25 | .addr = DS1307_ADDR, 26 | .bus = I2C_BUS, 27 | }; 28 | ds1307_start(&dev, true); 29 | 30 | // setup datetime: 2016-10-09 13:50:10 31 | struct tm time = { 32 | .tm_year = 2016, 33 | .tm_mon = 9, // 0-based 34 | .tm_mday = 9, 35 | .tm_hour = 13, 36 | .tm_min = 50, 37 | .tm_sec = 10 38 | }; 39 | ds1307_set_time(&dev, &time); 40 | 41 | while (true) 42 | { 43 | ds1307_get_time(&dev, &time); 44 | 45 | printf("%04d-%02d-%02d %02d:%02d:%02d\n", time.tm_year, time.tm_mon + 1, 46 | time.tm_mday, time.tm_hour, time.tm_min, time.tm_sec); 47 | 48 | for (uint32_t i = 0; i < 1000; i++) 49 | sdk_os_delay_us(500); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /examples/ds18b20_broadcaster/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=ds18b20_broadcaster 2 | EXTRA_COMPONENTS = extras/onewire extras/ds18b20 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ds18b20_broadcaster/README.md: -------------------------------------------------------------------------------- 1 | # DS19B20 Broadcaster 2 | 3 | >In this example you can see how to get data from multiple 4 | >ds18b20 sensor and emit result over udb broadcaster address. 5 | 6 | As a client server, you can use this simple udp receiver, writen in python: 7 | 8 | ``` 9 | import select, socket 10 | 11 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 12 | s.bind(('', 8005)) 13 | s.setblocking(0) 14 | 15 | while True: 16 | result = select.select([s],[],[]) 17 | msg = result[0][0].recv(1024) 18 | print msg.strip() 19 | 20 | ``` -------------------------------------------------------------------------------- /examples/ds18b20_onewire/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=ds18b20_onewire 2 | EXTRA_COMPONENTS = extras/onewire extras/ds18b20 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ds3231_test/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=ds3231_test 2 | EXTRA_COMPONENTS = extras/ds3231 extras/i2c 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ds3231_test/ds3231_test.c: -------------------------------------------------------------------------------- 1 | /* Test code for DS3231 high precision RTC module 2 | * 3 | * Part of esp-open-rtos 4 | * Copyright (C) 2016 Bhuvanchandra DV 5 | * MIT Licensed as described in the file LICENSE 6 | */ 7 | #include "espressif/esp_common.h" 8 | #include "esp/uart.h" 9 | #include "FreeRTOS.h" 10 | #include "task.h" 11 | #include "i2c/i2c.h" 12 | 13 | #include "ds3231/ds3231.h" 14 | 15 | #define ADDR DS3231_ADDR 16 | #define I2C_BUS 0 17 | 18 | void task1(void *pvParameters) 19 | { 20 | struct tm time; 21 | float tempFloat; 22 | i2c_dev_t dev = { 23 | .addr = ADDR, 24 | .bus = I2C_BUS, 25 | }; 26 | while(1) { 27 | vTaskDelay(100); 28 | ds3231_getTime(&dev, &time); 29 | ds3231_getTempFloat(&dev, &tempFloat); 30 | printf("TIME:%d:%d:%d, TEMPERATURE:%.2f DegC\r\n", time.tm_hour, time.tm_min, time.tm_sec, tempFloat); 31 | } 32 | } 33 | 34 | void user_init(void) 35 | { 36 | const int scl = 5, sda = 4; 37 | 38 | uart_set_baud(0, 115200); 39 | 40 | printf("\n"); 41 | printf("SDK version : %s\n", sdk_system_get_sdk_version()); 42 | printf("GIT version : %s\n", GITSHORTREV); 43 | 44 | i2c_init(0, scl, sda, I2C_FREQ_400K); 45 | 46 | xTaskCreate(task1, "tsk1", 256, NULL, 2, NULL); 47 | } 48 | -------------------------------------------------------------------------------- /examples/dsm_test/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=dsm_test 3 | EXTRA_COMPONENTS = extras/dsm 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/esphttpd/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* FreeRTOSConfig overrides. 2 | 3 | This is intended as an example of overriding some of the default FreeRTOSConfig settings, 4 | which are otherwise found in FreeRTOS/Source/include/FreeRTOSConfig.h 5 | */ 6 | 7 | #define configUSE_RECURSIVE_MUTEXES 1 8 | 9 | /* Use the defaults for everything else */ 10 | #include_next 11 | 12 | -------------------------------------------------------------------------------- /examples/esphttpd/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = esphttpd 2 | EXTRA_COMPONENTS = extras/dhcpserver extras/rboot-ota extras/libesphttpd 3 | 4 | ESP_IP ?= 192.168.4.1 5 | 6 | #Tag for OTA images. 0-27 characters. Change to eg your projects title. 7 | LIBESPHTTPD_OTA_TAGNAME ?= generic 8 | 9 | LIBESPHTTPD_MAX_CONNECTIONS ?= 8 10 | LIBESPHTTPD_STACKSIZE ?= 2048 11 | 12 | PROGRAM_CFLAGS += -DFREERTOS -DLIBESPHTTPD_OTA_TAGNAME="\"$(LIBESPHTTPD_OTA_TAGNAME)\"" -DFLASH_SIZE=$(FLASH_SIZE) 13 | EXTRA_CFLAGS += -DMEMP_NUM_NETCONN=$(LIBESPHTTPD_MAX_CONNECTIONS) 14 | 15 | include ../../common.mk 16 | 17 | -------------------------------------------------------------------------------- /examples/esphttpd/cgi-test.h: -------------------------------------------------------------------------------- 1 | #ifndef CGI_TEST_H 2 | #define CGI_TEST_H 3 | 4 | #include 5 | 6 | int cgiTestbed(HttpdConnData *connData); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /examples/esphttpd/cgi.h: -------------------------------------------------------------------------------- 1 | #ifndef CGI_H 2 | #define CGI_H 3 | 4 | #include 5 | 6 | int cgiLed(HttpdConnData *connData); 7 | int tplLed(HttpdConnData *connData, char *token, void **arg); 8 | int tplCounter(HttpdConnData *connData, char *token, void **arg); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /examples/esphttpd/html/cats/cross-eyed-cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/esphttpd/html/cats/cross-eyed-cat.jpg -------------------------------------------------------------------------------- /examples/esphttpd/html/cats/junge-katze-iv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/esphttpd/html/cats/junge-katze-iv.jpg -------------------------------------------------------------------------------- /examples/esphttpd/html/cats/kitten-loves-toy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/esphttpd/html/cats/kitten-loves-toy.jpg -------------------------------------------------------------------------------- /examples/esphttpd/html/flash/140medley.min.js: -------------------------------------------------------------------------------- 1 | var t=function(a,b){return function(c,d){return a.replace(/#{([^}]*)}/g,function(a,f){return Function("x","with(x)return "+f).call(c,d||b||{})})}},s=function(a,b){return b?{get:function(c){return a[c]&&b.parse(a[c])},set:function(c,d){a[c]=b.stringify(d)}}:{}}(this.localStorage||{},JSON),p=function(a,b,c,d){c=c||document;d=c[b="on"+b];a=c[b]=function(e){d=d&&d(e=e||c.event);return(a=a&&b(e))?b:d};c=this},m=function(a,b,c){b=document;c=b.createElement("p");c.innerHTML=a;for(a=b.createDocumentFragment();b= 2 | c.firstChild;)a.appendChild(b);return a},$=function(a,b){a=a.match(/^(\W)?(.*)/);return(b||document)["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2])},j=function(a){for(a=0;a<4;a++)try{return a?new ActiveXObject([,"Msxml2","Msxml3","Microsoft"][a]+".XMLHTTP"):new XMLHttpRequest}catch(b){}}; 3 | -------------------------------------------------------------------------------- /examples/esphttpd/html/flash/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #404040; 4 | font-family: sans-serif; 5 | } 6 | 7 | #main { 8 | background-color: #d0d0FF; 9 | -moz-border-radius: 5px; 10 | -webkit-border-radius: 5px; 11 | border-radius: 5px; 12 | border: 2px solid #000000; 13 | width: 800px; 14 | margin: 0 auto; 15 | padding: 20px 16 | } 17 | 18 | #progressbar { 19 | margin: 10px; 20 | padding: 0; 21 | border: 1px solid #000000; 22 | height: 20px; 23 | width: 200px; 24 | background-color: #808080; 25 | } 26 | 27 | #progressbarinner { 28 | width: 10px; 29 | height: 20px; 30 | border: none; 31 | background-color: #00ff00; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /examples/esphttpd/html/index.tpl: -------------------------------------------------------------------------------- 1 | 2 | Esp8266 web server 3 | 4 | 5 | 6 |
7 |

It Works

8 |

9 | If you see this, it means the tiny li'l website in your ESP8266 does actually work. Fyi, this page has 10 | been loaded %counter% times. 11 |

    12 |
  • If you haven't connected this device to your WLAN network now, you can do so.
  • 13 |
  • You can also control the LED.
  • 14 |
  • Esphttpd now also supports websockets.
  • 15 |
  • Test esphttpd using the built-in test suite
  • 16 |
  • And because I can, here's a link to my website
17 | 18 |

19 | 20 |

And because we're on the Internets now, here are the required pictures of cats:
21 |
22 |
23 |
24 |

25 |
26 | 27 | -------------------------------------------------------------------------------- /examples/esphttpd/html/led.tpl: -------------------------------------------------------------------------------- 1 | Test 2 | 3 | 4 | 5 |
6 |

The LED

7 |

8 | If there's a LED connected to GPIO2, it's now %ledstate%. You can change that using the buttons below. 9 |

10 |
11 | 12 | 13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /examples/esphttpd/html/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #404040; 4 | font-family: sans-serif; 5 | } 6 | 7 | #main { 8 | background-color: #d0d0FF; 9 | -moz-border-radius: 5px; 10 | -webkit-border-radius: 5px; 11 | border-radius: 5px; 12 | border: 2px solid #000000; 13 | width: 800px; 14 | margin: 0 auto; 15 | padding: 20px 16 | } 17 | 18 | -------------------------------------------------------------------------------- /examples/esphttpd/html/test/index.html: -------------------------------------------------------------------------------- 1 | Webserver test 2 | 3 | 4 | 5 | 6 |
7 |
Initializing test...
8 |
9 | -------------------------------------------------------------------------------- /examples/esphttpd/html/wifi/140medley.min.js: -------------------------------------------------------------------------------- 1 | var t=function(a,b){return function(c,d){return a.replace(/#{([^}]*)}/g,function(a,f){return Function("x","with(x)return "+f).call(c,d||b||{})})}},s=function(a,b){return b?{get:function(c){return a[c]&&b.parse(a[c])},set:function(c,d){a[c]=b.stringify(d)}}:{}}(this.localStorage||{},JSON),p=function(a,b,c,d){c=c||document;d=c[b="on"+b];a=c[b]=function(e){d=d&&d(e=e||c.event);return(a=a&&b(e))?b:d};c=this},m=function(a,b,c){b=document;c=b.createElement("p");c.innerHTML=a;for(a=b.createDocumentFragment();b= 2 | c.firstChild;)a.appendChild(b);return a},$=function(a,b){a=a.match(/^(\W)?(.*)/);return(b||document)["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2])},j=function(a){for(a=0;a<4;a++)try{return a?new ActiveXObject([,"Msxml2","Msxml3","Microsoft"][a]+".XMLHTTP"):new XMLHttpRequest}catch(b){}}; 3 | -------------------------------------------------------------------------------- /examples/esphttpd/html/wifi/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/esphttpd/html/wifi/icons.png -------------------------------------------------------------------------------- /examples/esphttpd/html/wifi/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | background-color: #404040; 4 | font-family: sans-serif; 5 | } 6 | 7 | #main { 8 | background-color: #d0d0FF; 9 | -moz-border-radius: 5px; 10 | -webkit-border-radius: 5px; 11 | border-radius: 5px; 12 | border: 2px solid #000000; 13 | width: 800px; 14 | margin: 0 auto; 15 | padding: 20px 16 | } 17 | 18 | .icon { 19 | background-image: url("icons.png"); 20 | background-color: transparent; 21 | width: 32px; 22 | height: 32px; 23 | display: inline-block; 24 | } -------------------------------------------------------------------------------- /examples/esphttpd/io.h: -------------------------------------------------------------------------------- 1 | #ifndef IO_H 2 | #define IO_H 3 | 4 | void ICACHE_FLASH_ATTR ioLed(int ena); 5 | void ioInit(void); 6 | 7 | #endif -------------------------------------------------------------------------------- /examples/experiments/timers/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=timers 2 | include ../../../common.mk 3 | -------------------------------------------------------------------------------- /examples/experiments/unaligned_load/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=unaligned_load 2 | include ../../../common.mk 3 | -------------------------------------------------------------------------------- /examples/fatfs/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = fatfs 2 | EXTRA_COMPONENTS = extras/sdio extras/fatfs 3 | #ESPBAUD = 460800 4 | 5 | # FatFS parameters, see extras/fatfs/defaults.mk 6 | FATFS_CODE_PAGE = 866 7 | 8 | include ../../common.mk 9 | -------------------------------------------------------------------------------- /examples/fatfs_rtc/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = fatfs 2 | EXTRA_COMPONENTS = extras/sdio extras/fatfs extras/i2c extras/ds1307 3 | ESPBAUD = 460800 4 | 5 | # We provide uint32_t get_fattime() based on the RTC 6 | FATFS_FS_NORTC = 0 7 | 8 | include ../../common.mk 9 | -------------------------------------------------------------------------------- /examples/fatfs_rtc/README.md: -------------------------------------------------------------------------------- 1 | This example shows how to use real-time clock (e.g. ds1307) 2 | with FatFs for real timestamps on the filesystem objects. 3 | 4 | 1. Set `FATFS_FS_NORTC` to 0 (it's 1 by default) in application makefile. 5 | 2. Define function `uint32_t get_fattime()` which will return current time in 6 | timestamp format: 7 | 8 | Bits | Date part 9 | -------|---------- 10 | 0..4 | Second / 2 (0..29) 11 | 5..10 | Minute (0..59) 12 | 11..15 | Hour (0..23) 13 | 16..20 | Day (1..31) 14 | 21..24 | Month (1..12) 15 | 25..31 | Year origin from 1980 (0..127) 16 | -------------------------------------------------------------------------------- /examples/hd44780_lcd/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = hd44780_lcd 2 | EXTRA_COMPONENTS = extras/hd44780 3 | 4 | HD44780_I2C = 0 5 | 6 | include ../../common.mk 7 | -------------------------------------------------------------------------------- /examples/hd44780_lcd/schematics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/hd44780_lcd/schematics.png -------------------------------------------------------------------------------- /examples/hmc5883l/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = hmc5883l 2 | EXTRA_COMPONENTS = extras/i2c extras/hmc5883l 3 | #ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/hmc5883l/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Example of using HMC5883L driver 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define I2C_BUS 0 15 | #define SCL_PIN 5 16 | #define SDA_PIN 4 17 | 18 | void user_init(void) 19 | { 20 | uart_set_baud(0, 115200); 21 | printf("SDK version:%s\n\n", sdk_system_get_sdk_version()); 22 | 23 | i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_100K); 24 | i2c_dev_t dev = { 25 | .addr = HMC5883L_ADDR, 26 | .bus = I2C_BUS, 27 | }; 28 | 29 | while (!hmc5883l_init(&dev)) 30 | printf("Device not found\n"); 31 | 32 | hmc5883l_set_operating_mode(&dev, HMC5883L_MODE_CONTINUOUS); 33 | hmc5883l_set_samples_averaged(&dev, HMC5883L_SAMPLES_8); 34 | hmc5883l_set_data_rate(&dev, HMC5883L_DATA_RATE_07_50); 35 | hmc5883l_set_gain(&dev, HMC5883L_GAIN_1090); 36 | 37 | while (true) 38 | { 39 | hmc5883l_data_t data; 40 | hmc5883l_get_data(&dev, &data); 41 | printf("Magnetic data: X:%.2f mG, Y:%.2f mG, Z:%.2f mG\n", data.x, data.y, data.z); 42 | 43 | for (uint32_t i = 0; i < 1000; i++) 44 | sdk_os_delay_us(250); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/http_client_ota/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=http_ota 2 | EXTRA_COMPONENTS=extras/rboot-ota extras/mbedtls extras/http_client_ota 3 | 4 | include ../../common.mk -------------------------------------------------------------------------------- /examples/http_client_ota/test_file/blink.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/http_client_ota/test_file/blink.bin -------------------------------------------------------------------------------- /examples/http_client_ota/test_file/blink.sha256: -------------------------------------------------------------------------------- 1 | 57dda900027355de85f0de9e6c966e3c4c16741d8eed134d209c0fb6304cf852 2 | -------------------------------------------------------------------------------- /examples/http_get/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=http_get 2 | include ../../common.mk 3 | -------------------------------------------------------------------------------- /examples/http_get_bearssl/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=http_get_bearssl 2 | EXTRA_COMPONENTS = extras/bearssl 3 | 4 | EXTRA_CFLAGS +=-DCONFIG_EPOCH_TIME=$(shell date --utc '+%s') 5 | 6 | include ../../common.mk 7 | -------------------------------------------------------------------------------- /examples/http_get_mbedtls/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=http_get_mbedtls 2 | EXTRA_COMPONENTS = extras/mbedtls 3 | 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/http_get_mbedtls/include/mbedtls/config.h: -------------------------------------------------------------------------------- 1 | /* Special mbedTLS config file for http_get_mbedtls example, 2 | overrides supported cipher suite list. 3 | 4 | Overriding the set of cipher suites saves small amounts of ROM and 5 | RAM, and is a good practice in general if you know what server(s) 6 | you want to connect to. 7 | 8 | However it's extra important here because the howsmyssl API sends 9 | back the list of ciphers we send it as a JSON list in the, and we 10 | only have a 4096kB receive buffer. If the server supported maximum 11 | fragment length option then we wouldn't have this problem either, 12 | but we do so this is a good workaround. 13 | 14 | The ciphers chosen below are common ECDHE ciphers, the same ones 15 | Firefox uses when connecting to a TLSv1.2 server. 16 | */ 17 | #ifndef MBEDTLS_CONFIG_H 18 | 19 | /* include_next picks up default config from extras/mbedtls/include/mbedtls/config.h */ 20 | #include_next 21 | 22 | #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 23 | 24 | /* uncomment next line to include debug output from example */ 25 | //#define MBEDTLS_DEBUG_C 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /examples/http_server/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=http_server 2 | 3 | EXTRA_CFLAGS=-DLWIP_HTTPD_CGI=1 -DLWIP_HTTPD_SSI=1 -I./fsdata 4 | 5 | #Enable debugging 6 | #EXTRA_CFLAGS+=-DLWIP_DEBUG=1 -DHTTPD_DEBUG=LWIP_DBG_ON 7 | 8 | EXTRA_COMPONENTS=extras/mbedtls extras/httpd 9 | 10 | include ../../common.mk 11 | 12 | html: 13 | @echo "Generating fsdata.." 14 | cd fsdata && ./makefsdata 15 | -------------------------------------------------------------------------------- /examples/http_server/fsdata/fs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | HTTP Server 10 | 11 | 12 | 17 | 18 |
19 |

404 - Page not found

20 |
Sorry, the page you are requesting was not found on this server.
21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/http_server/fsdata/fs/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | HTTP Server 10 | 11 | 12 | 17 | 18 |
19 |

About

20 |

This server is based on httpd from LwIP.

21 |

To enable debugging compile with flags -DLWIP_DEBUG=1 -DHTTPD_DEBUG=LWIP_DBG_ON.

22 |

For more info see HTTP Server documentation.

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/http_server/fsdata/fs/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/http_server/fsdata/fs/img/favicon.png -------------------------------------------------------------------------------- /examples/http_server/fsdata/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains a script ('makefsdata') to create C code suitable for 2 | httpd for given html pages (or other files) in a directory. 3 | -------------------------------------------------------------------------------- /examples/i2c_lcd_test/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = i2c_lcd_test 2 | EXTRA_COMPONENTS = extras/i2c extras/pcf8574 extras/hd44780 3 | 4 | HD44780_I2C = 1 5 | 6 | include ../../common.mk 7 | -------------------------------------------------------------------------------- /examples/i2c_lcd_test/i2c_lcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/i2c_lcd_test/i2c_lcd.png -------------------------------------------------------------------------------- /examples/i2s_audio/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=i2s_audio_example 2 | EXTRA_COMPONENTS = extras/spiffs extras/i2s_dma 3 | FLASH_SIZE = 32 4 | 5 | # spiffs configuration 6 | SPIFFS_BASE_ADDR = 0x200000 7 | SPIFFS_SIZE = 0x100000 8 | 9 | include ../../common.mk 10 | 11 | $(eval $(call make_spiffs_image,files)) 12 | -------------------------------------------------------------------------------- /examples/ina3221_test/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=ina3221_test 2 | EXTRA_COMPONENTS = extras/i2c extras/ina3221 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/json_jsmn_simple/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=json_jsmn_simple 3 | EXTRA_COMPONENTS = extras/jsmn 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/l3gd20h/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=L3GD20H 2 | EXTRA_COMPONENTS = extras/i2c extras/l3gd20h 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/lis3dh/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=LIS3DH 2 | EXTRA_COMPONENTS = extras/i2c extras/lis3dh 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/lis3mdl/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=LIS3MDL 2 | EXTRA_COMPONENTS = extras/i2c extras/lis3mdl 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/lsm303d/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=LSM303D 2 | EXTRA_COMPONENTS = extras/i2c extras/lsm303d 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/lvgl_ssd1306/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = LVGL_SSD1306 2 | EXTRA_COMPONENTS = lvgl extras/i2c 3 | 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/max7219_7seg/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = max7219_7seg 2 | EXTRA_COMPONENTS = extras/max7219 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/mcp4725_test/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = mcp4725_test 2 | EXTRA_COMPONENTS = extras/i2c extras/mcp4725 3 | #ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/mqtt_client/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=mqtt_client 2 | EXTRA_COMPONENTS = extras/paho_mqtt_c 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ms561101ba03/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = ms561101ba03 2 | EXTRA_COMPONENTS = extras/i2c extras/ms561101ba03 3 | ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/ms561101ba03/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Example of using MS561101ba03 driver 3 | * 4 | * Copyright (C) 2016 Bernhard Guillon 5 | * 6 | * Loosely based on main.c with: 7 | * Copyright (C) 2016 Ruslan V. Uss 8 | * BSD Licensed as described in the file LICENSE 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define I2C_BUS 0 17 | #define SCL_PIN 5 18 | #define SDA_PIN 4 19 | 20 | void user_init(void) 21 | { 22 | i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_100K); 23 | 24 | uart_set_baud(0, 115200); 25 | printf("SDK version:%s\n\n", sdk_system_get_sdk_version()); 26 | 27 | ms561101ba03_t device = { 28 | .i2c_dev.bus = I2C_BUS, 29 | .i2c_dev.addr = MS561101BA03_ADDR_CSB_LOW, 30 | .osr = MS561101BA03_OSR_4096, 31 | }; 32 | 33 | while (!ms561101ba03_init(&device)) 34 | printf("Device not found\n"); 35 | 36 | while (true) 37 | { 38 | if (!ms561101ba03_get_sensor_data(&device)) 39 | printf("Error reading sensor data from device"); 40 | printf("Temperature in C * 100: %i \nPressure in mbar * 100: %i\n", device.result.temperature, device.result.pressure); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/multipwm/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for multipwm example 2 | PROGRAM=multipwm_test 3 | EXTRA_COMPONENTS = extras/multipwm 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/ota_basic/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=ota_basic 2 | EXTRA_COMPONENTS=extras/rboot-ota extras/mbedtls 3 | include ../../common.mk 4 | 5 | -------------------------------------------------------------------------------- /examples/ota_basic/ota_basic.def: -------------------------------------------------------------------------------- 1 | cpu xtensa 2 | 3 | # Show up to this many raw bytes of code/data 4 | show bytes 4 5 | 6 | # ELF file 7 | # See example.def if you want to load raw binaries instead 8 | load build/ota_basic.out elf 9 | 10 | -------------------------------------------------------------------------------- /examples/ota_basic/test.c: -------------------------------------------------------------------------------- 1 | extern void wDev_ProcessFiq(void); 2 | 3 | void call_wdev(void) 4 | { 5 | wDev_ProcessFiq(); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /examples/pca9685_pwm/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = pca9685_pwm 2 | EXTRA_COMPONENTS = extras/i2c extras/pca9685 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/pca9685_pwm/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Example of using PCA9685 PWM driver 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * Public domain 7 | */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #define ADDR PCA9685_ADDR_BASE 15 | 16 | #define I2C_BUS 0 17 | #define SCL_PIN 5 18 | #define SDA_PIN 4 19 | 20 | #define PWM_FREQ 500 21 | 22 | void user_init(void) 23 | { 24 | uart_set_baud(0, 115200); 25 | printf("SDK version:%s\n", sdk_system_get_sdk_version()); 26 | 27 | i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_100K); 28 | i2c_dev_t dev = { 29 | .addr = ADDR, 30 | .bus = I2C_BUS, 31 | }; 32 | 33 | pca9685_init(&dev); 34 | 35 | pca9685_set_pwm_frequency(&dev, 1000); 36 | printf("Freq 1000Hz, real %d\n", pca9685_get_pwm_frequency(&dev)); 37 | 38 | uint16_t val = 0; 39 | while (true) 40 | { 41 | printf("Set ch0 to %d, ch4 to %d\n", val, 4096 - val); 42 | pca9685_set_pwm_value(&dev, 0, val); 43 | pca9685_set_pwm_value(&dev, 4, 4096 - val); 44 | 45 | if (val++ == 4096) 46 | val = 0; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/pcf8591/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = pcf8591 2 | EXTRA_COMPONENTS = extras/i2c extras/pcf8591 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/pcf8591/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "espressif/esp_common.h" 4 | #include "esp/uart.h" 5 | 6 | #include "FreeRTOS.h" 7 | #include "task.h" 8 | 9 | #include "i2c/i2c.h" 10 | #include "pcf8591/pcf8591.h" 11 | 12 | #define ADDR PCF8591_DEFAULT_ADDRESS 13 | #define I2C_BUS 0 14 | #define SCL_PIN 5 15 | #define SDA_PIN 4 16 | 17 | static void measure(void *pvParameters) 18 | { 19 | i2c_dev_t dev = { 20 | .addr = ADDR, 21 | .bus = I2C_BUS, 22 | }; 23 | while (1) 24 | { 25 | vTaskDelay(1000 / portTICK_PERIOD_MS); 26 | printf("Value: %d\n", pcf8591_read(&dev, PCF8591_IC_4_SINGLES, 3)); 27 | } 28 | } 29 | 30 | void user_init(void) 31 | { 32 | uart_set_baud(0, 115200); 33 | 34 | // Just some information 35 | printf("\n"); 36 | printf("SDK version : %s\n", sdk_system_get_sdk_version()); 37 | printf("GIT version : %s\n", GITSHORTREV); 38 | 39 | i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_100K); 40 | 41 | xTaskCreate(measure, "measure_task", 256, NULL, 2, NULL); 42 | } 43 | -------------------------------------------------------------------------------- /examples/pwm_test/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=pwm_test 3 | EXTRA_COMPONENTS = extras/pwm 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/sdio_raw/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = sdio_raw 2 | EXTRA_COMPONENTS = extras/sdio 3 | #ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/sdio_raw/schematics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/examples/sdio_raw/schematics.png -------------------------------------------------------------------------------- /examples/serial_echo/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for serial_echo example 2 | PROGRAM=serial_echo 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/serial_echo/serial_echo.c: -------------------------------------------------------------------------------- 1 | /* Extremely simple example that just reads from stdin and echoes back on stdout 2 | * 3 | * Has an easter egg, which is if you type "QUACK" it'll quack 3 times back at you. 4 | * 5 | * This example code is in the public domain 6 | */ 7 | #include "espressif/esp_common.h" 8 | #include 9 | #include 10 | 11 | void user_init(void) 12 | { 13 | uart_set_baud(0, 115200); 14 | printf("SDK version:%s\n", sdk_system_get_sdk_version()); 15 | printf("Going into echo mode...\n"); 16 | 17 | while(1) { 18 | int c = getchar(); 19 | if(c != EOF) 20 | putchar(c); 21 | 22 | /* Easter egg: check for a quack! */ 23 | static int quack; 24 | if(c == "QUACK"[quack]) { 25 | quack++; 26 | if(quack == strlen("QUACK")) { 27 | printf("\nQUACK\nQUACK\n"); 28 | quack = 0; 29 | } 30 | } else { 31 | quack = 0; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/sht3x/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=SHT3x 2 | EXTRA_COMPONENTS = extras/i2c extras/sht3x 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/simple/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=simple 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/simple/simple.c: -------------------------------------------------------------------------------- 1 | /* Very basic example that just demonstrates we can run at all! 2 | */ 3 | #include "espressif/esp_common.h" 4 | #include "esp/uart.h" 5 | #include "FreeRTOS.h" 6 | #include "task.h" 7 | #include "queue.h" 8 | 9 | void task1(void *pvParameters) 10 | { 11 | QueueHandle_t *queue = (QueueHandle_t *)pvParameters; 12 | printf("Hello from task1!\r\n"); 13 | uint32_t count = 0; 14 | while(1) { 15 | vTaskDelay(100); 16 | xQueueSend(*queue, &count, 0); 17 | count++; 18 | } 19 | } 20 | 21 | void task2(void *pvParameters) 22 | { 23 | printf("Hello from task 2!\r\n"); 24 | QueueHandle_t *queue = (QueueHandle_t *)pvParameters; 25 | while(1) { 26 | uint32_t count; 27 | if(xQueueReceive(*queue, &count, 1000)) { 28 | printf("Got %u\n", count); 29 | } else { 30 | printf("No msg :(\n"); 31 | } 32 | } 33 | } 34 | 35 | static QueueHandle_t mainqueue; 36 | 37 | void user_init(void) 38 | { 39 | uart_set_baud(0, 115200); 40 | printf("SDK version:%s\n", sdk_system_get_sdk_version()); 41 | mainqueue = xQueueCreate(10, sizeof(uint32_t)); 42 | xTaskCreate(task1, "tsk1", 256, &mainqueue, 2, NULL); 43 | xTaskCreate(task2, "tsk2", 256, &mainqueue, 2, NULL); 44 | } 45 | -------------------------------------------------------------------------------- /examples/simple_cplusplus/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=simple 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/sntp/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the sntp_example program 2 | 3 | PROGRAM=sntp_example 4 | EXTRA_COMPONENTS = extras/sntp 5 | 6 | include ../../common.mk 7 | -------------------------------------------------------------------------------- /examples/softuart/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2016 Bernhard Guillon 4 | Copyright (c) 2015 plieningerweb 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /examples/softuart/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = softuart 2 | EXTRA_COMPONENTS = extras/softuart 3 | ESPBAUD = 460800 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/softuart/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Softuart example 3 | * 4 | * Copyright (C) 2017 Ruslan V. Uss 5 | * Copyright (C) 2016 Bernhard Guillon 6 | * Copyright (c) 2015 plieningerweb 7 | * 8 | * MIT Licensed as described in the file LICENSE 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | //#include 15 | //#include 16 | 17 | #include 18 | 19 | #define RX_PIN 5 20 | #define TX_PIN 4 21 | 22 | void user_init(void) 23 | { 24 | // setup real UART for now 25 | uart_set_baud(0, 115200); 26 | printf("SDK version:%s\n\n", sdk_system_get_sdk_version()); 27 | 28 | // setup software uart to 9600 8n1 29 | softuart_open(0, 9600, RX_PIN, TX_PIN); 30 | 31 | while (true) 32 | { 33 | if (!softuart_available(0)) 34 | continue; 35 | 36 | char c = softuart_read(0); 37 | printf("input: %c, 0x%02x\n", c, c); 38 | softuart_puts(0, "start\r\n"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/spi_test/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=spi_test 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/spiffs/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=spiffs_example 2 | EXTRA_COMPONENTS = extras/spiffs 3 | FLASH_SIZE = 32 4 | 5 | # spiffs configuration 6 | SPIFFS_BASE_ADDR = 0x200000 7 | SPIFFS_SIZE = 0x010000 8 | 9 | # SPIFFS_SINGLETON = 0 # for run-time configuration 10 | 11 | include ../../common.mk 12 | 13 | $(eval $(call make_spiffs_image,files)) 14 | -------------------------------------------------------------------------------- /examples/spiffs/files/test.txt: -------------------------------------------------------------------------------- 1 | This file will go to SPIFFS image. 2 | -------------------------------------------------------------------------------- /examples/ssd1306_example/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=SSD1306_Example 2 | EXTRA_COMPONENTS = extras/ssd1306 extras/i2c 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ssd1306_example/README.md: -------------------------------------------------------------------------------- 1 | # SSD1306 I2C/SPI OLED LCD Example 2 | 3 | To run this example connect the SSD1306 OLED LCD and configure protocol, display size and pins in main.c file. 4 | -------------------------------------------------------------------------------- /examples/ssd1306_fps/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = SSD1306_fps 2 | EXTRA_COMPONENTS = extras/ssd1306 extras/i2c extras/fonts 3 | 4 | # include a lot of builtin fonts 5 | 6 | FONTS_GLCD_5X7 = 1 7 | FONTS_BITOCRA_4X7 = 1 8 | FONTS_BITOCRA_6X11 = 1 9 | FONTS_BITOCRA_7X13 = 1 10 | FONTS_TERMINUS_6X12_ISO8859_1 = 1 11 | FONTS_TERMINUS_8X14_ISO8859_1 = 1 12 | FONTS_TERMINUS_BOLD_8X14_ISO8859_1 = 1 13 | FONTS_TERMINUS_10X18_ISO8859_1 = 1 14 | FONTS_TERMINUS_BOLD_10X18_ISO8859_1 = 1 15 | FONTS_TERMINUS_11X22_ISO8859_1 = 1 16 | FONTS_TERMINUS_BOLD_11X22_ISO8859_1 = 1 17 | FONTS_TERMINUS_12X24_ISO8859_1 = 1 18 | FONTS_TERMINUS_BOLD_12X24_ISO8859_1 = 1 19 | FONTS_TERMINUS_14X28_ISO8859_1 = 1 20 | FONTS_TERMINUS_BOLD_14X28_ISO8859_1 = 1 21 | FONTS_TERMINUS_16X32_ISO8859_1 = 1 22 | FONTS_TERMINUS_BOLD_16X32_ISO8859_1 = 1 23 | 24 | include ../../common.mk 25 | -------------------------------------------------------------------------------- /examples/sysparam_editor/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=sysparam_editor 2 | 3 | # Setting this to 1..3 will add extra debugging output to stdout 4 | EXTRA_CFLAGS = -DSYSPARAM_DEBUG=0 5 | 6 | # Avoid writing the wifi state to flash when using wificfg. 7 | EXTRA_CFLAGS += -DWIFI_PARAM_SAVE=0 8 | 9 | include ../../common.mk 10 | 11 | # `make dump-flash` can be used to view the current contents of the sysparam 12 | # regions in flash. 13 | dump-flash: 14 | esptool.py read_flash 0x1f7000 8192 r1.bin 15 | hexdump -C r1.bin 16 | esptool.py read_flash 0x1f9000 8192 r2.bin 17 | hexdump -C r2.bin 18 | -------------------------------------------------------------------------------- /examples/tcp_non_blocking/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for tcp_non_blocking example 2 | PROGRAM=tcp_non_blocking 3 | EXTRA_COMPONENTS=extras/dhcpserver 4 | 5 | include ../../common.mk 6 | -------------------------------------------------------------------------------- /examples/terminal/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* Terminal FreeRTOSConfig overrides. 2 | 3 | This is intended as an example of overriding some of the default FreeRTOSConfig settings, 4 | which are otherwise found in FreeRTOS/Source/include/FreeRTOSConfig.h 5 | */ 6 | 7 | /* The serial driver depends on counting semaphores */ 8 | #define configUSE_COUNTING_SEMAPHORES 1 9 | 10 | /* Use the defaults for everything else */ 11 | #include_next 12 | 13 | -------------------------------------------------------------------------------- /examples/terminal/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=terminal 2 | EXTRA_COMPONENTS=extras/stdin_uart_interrupt 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/tests/hmac_test_vectors/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=hmac_test 2 | EXTRA_COMPONENTS=extras/mbedtls 3 | include ../../../common.mk 4 | -------------------------------------------------------------------------------- /examples/tick_idle_hooks/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | Configuration overrides for FreeRTOS. 4 | 5 | **/ 6 | 7 | #define configUSE_IDLE_HOOK 1 8 | #define configUSE_TICK_HOOK 1 9 | 10 | #include_next "FreeRTOSConfig.h" -------------------------------------------------------------------------------- /examples/tick_idle_hooks/Makefile: -------------------------------------------------------------------------------- 1 | # Simple makefile for simple example 2 | PROGRAM=simple 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/tls_server/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=tls_server 2 | EXTRA_COMPONENTS = extras/mbedtls 3 | 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/tls_server_bearssl/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=tls_server_bearssl 2 | EXTRA_COMPONENTS = extras/bearssl 3 | 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/tsl2561/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=tsl2561_example 2 | EXTRA_COMPONENTS = extras/i2c extras/tsl2561 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/tsl4531/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=tsl4531_example 2 | EXTRA_COMPONENTS = extras/i2c extras/tsl4531 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/tsoftuart/.gitignore: -------------------------------------------------------------------------------- 1 | !local.mk 2 | -------------------------------------------------------------------------------- /examples/tsoftuart/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #define configUSE_TRACE_FACILITY 1 2 | #define configGENERATE_RUN_TIME_STATS 1 3 | #define portGET_RUN_TIME_COUNTER_VALUE() (RTC.COUNTER) 4 | #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() {} 5 | 6 | /* Use the defaults for everything else */ 7 | #include_next 8 | -------------------------------------------------------------------------------- /examples/tsoftuart/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for tsfotuart example 2 | PROGRAM=tsoftuart 3 | EXTRA_COMPONENTS=extras/dhcpserver extras/wificfg extras/mactimer extras/tsoftuart 4 | 5 | # For the mDNS responder included with lwip: 6 | EXTRA_CFLAGS += -DLWIP_MDNS_RESPONDER=1 -DLWIP_NUM_NETIF_CLIENT_DATA=1 -DLWIP_NETIF_EXT_STATUS_CALLBACK=1 7 | 8 | # Avoid writing the wifi state to flash when using wificfg. 9 | EXTRA_CFLAGS += -DWIFI_PARAM_SAVE=0 10 | 11 | EXTRA_CFLAGS += -DWIFICFG_CLIENT_TASK=1 -DWIFICFG_IRAM_TEST=1 12 | 13 | include ../../common.mk 14 | -------------------------------------------------------------------------------- /examples/tsoftuart/local.mk: -------------------------------------------------------------------------------- 1 | FLASH_SIZE ?= 32 2 | -------------------------------------------------------------------------------- /examples/uart_config/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=uart_config 2 | 3 | include ../../common.mk 4 | -------------------------------------------------------------------------------- /examples/ultrasonic/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = ultrasonic 2 | EXTRA_COMPONENTS = extras/ultrasonic 3 | 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/upnp/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=upnp_test 2 | OTA=1 3 | EXTRA_COMPONENTS=extras/rboot-ota 4 | 5 | include ../../common.mk 6 | -------------------------------------------------------------------------------- /examples/upnp/README.md: -------------------------------------------------------------------------------- 1 | # upnp Example 2 | 3 | This is an example to generate an upnp server and emulate a WeMo switch recognizable by Amazon echo Dot. 4 | -------------------------------------------------------------------------------- /examples/upnp/httpd.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void httpd_task(void *pvParameters); 4 | -------------------------------------------------------------------------------- /examples/upnp/lwipopts.h: -------------------------------------------------------------------------------- 1 | 2 | #define LWIP_IGMP 1 3 | 4 | /* Use the defaults for everything else */ 5 | #include_next 6 | -------------------------------------------------------------------------------- /examples/upnp/upnp.h: -------------------------------------------------------------------------------- 1 | 2 | bool upnp_server_init(void); 3 | -------------------------------------------------------------------------------- /examples/wifi_scan/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM = wifi_scan 2 | #ESPBAUD = 460800 3 | 4 | include ../../common.mk 5 | -------------------------------------------------------------------------------- /examples/wificfg/.gitignore: -------------------------------------------------------------------------------- 1 | !local.mk 2 | -------------------------------------------------------------------------------- /examples/wificfg/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | #define configUSE_TRACE_FACILITY 1 2 | #define configGENERATE_RUN_TIME_STATS 1 3 | #define portGET_RUN_TIME_COUNTER_VALUE() (RTC.COUNTER) 4 | #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() {} 5 | 6 | /* Use the defaults for everything else */ 7 | #include_next 8 | -------------------------------------------------------------------------------- /examples/wificfg/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for wificfg example 2 | PROGRAM=wificfg 3 | EXTRA_COMPONENTS=extras/dhcpserver extras/wificfg 4 | 5 | # For the mDNS responder included under extras: 6 | # EXTRA_COMPONENTS += extras/mdnsresponder 7 | # EXTRA_CFLAGS += -DEXTRAS_MDNS_RESPONDER 8 | 9 | # For the mDNS responder included with lwip: 10 | EXTRA_CFLAGS += -DLWIP_MDNS_RESPONDER=1 -DLWIP_NUM_NETIF_CLIENT_DATA=1 -DLWIP_NETIF_EXT_STATUS_CALLBACK=1 11 | 12 | # Avoid writing the wifi state to flash when using wificfg. 13 | EXTRA_CFLAGS += -DWIFI_PARAM_SAVE=0 14 | 15 | include ../../common.mk 16 | -------------------------------------------------------------------------------- /examples/wificfg/content/index.html: -------------------------------------------------------------------------------- 1 | "" 2 | "" 3 | "" 4 | "" 5 | "", 6 | "" 7 | "" 8 | "" 9 | "" 10 | "", 18 | "" 19 | -------------------------------------------------------------------------------- /examples/wificfg/local.mk: -------------------------------------------------------------------------------- 1 | FLASH_SIZE ?= 32 2 | -------------------------------------------------------------------------------- /examples/ws2812_i2s/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the ws2812_i2s example 2 | 3 | PROGRAM=ws2812_i2s_example 4 | EXTRA_COMPONENTS = extras/i2s_dma extras/ws2812_i2s 5 | 6 | include ../../common.mk 7 | -------------------------------------------------------------------------------- /examples/ws2812_rainbow/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the ws2812 Rainbow example 2 | 3 | PROGRAM=ws2812_rainbow 4 | EXTRA_COMPONENTS = extras/ws2812 5 | 6 | include ../../common.mk 7 | -------------------------------------------------------------------------------- /extras/ad770x/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ad770x (AD7705/AD7706 driver) 2 | 3 | # expected anyone using ADC driver includes it as 'ad770x/ad770x.h' 4 | INC_DIRS += $(ad770x_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ad770x_SRC_DIR = $(ad770x_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ad770x)) 10 | -------------------------------------------------------------------------------- /extras/ads111x/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ads111x 2 | 3 | # expected anyone using ADC driver includes it as 'ads111x/ads111x.h' 4 | INC_DIRS += $(ads111x_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ads111x_SRC_DIR = $(ads111x_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ads111x)) 10 | -------------------------------------------------------------------------------- /extras/bearssl/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for BearSSL 2 | 3 | BEARSSL_DIR = $(bearssl_ROOT)BearSSL/ 4 | INC_DIRS += $(BEARSSL_DIR)inc 5 | 6 | # args for passing into compile rule generation 7 | bearssl_INC_DIR = $(BEARSSL_DIR)inc $(BEARSSL_DIR)src 8 | bearssl_SRC_DIR = $(BEARSSL_DIR)src $(sort $(dir $(wildcard $(BEARSSL_DIR)src/*/))) 9 | 10 | $(eval $(call component_compile_rules,bearssl)) 11 | 12 | # Helpful error if git submodule not initialised 13 | $(BEARSSL_DIR): 14 | $(error "bearssl git submodule not installed. Please run 'git submodule update --init'") 15 | -------------------------------------------------------------------------------- /extras/bh1750/bh1750.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver for BH1750 light sensor 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2017 Andrej Krutak 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #include "bh1750.h" 9 | #include 10 | 11 | void bh1750_configure(i2c_dev_t *dev, uint8_t mode) 12 | { 13 | i2c_slave_write(dev->bus, dev->addr, NULL, &mode, 1); 14 | } 15 | 16 | uint16_t bh1750_read(i2c_dev_t *dev) 17 | { 18 | uint8_t buf[2]; 19 | uint16_t level; 20 | 21 | i2c_slave_read(dev->bus, dev->addr, NULL, buf, 2); 22 | 23 | level = buf[0] << 8 | buf[1]; 24 | level = (level * 10) / 12; // convert to LUX 25 | 26 | return level; 27 | } 28 | -------------------------------------------------------------------------------- /extras/bh1750/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/bh1750 2 | 3 | # expected anyone using RTC driver includes it as 'bh1750/bh1750.h' 4 | INC_DIRS += $(bh1750_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | bh1750_SRC_DIR = $(bh1750_ROOT) 8 | 9 | $(eval $(call component_compile_rules,bh1750)) 10 | -------------------------------------------------------------------------------- /extras/bme680/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/bme680 2 | 3 | # expected anyone using bme680 driver includes it as 'bme680/bme680.h' 4 | INC_DIRS += $(bme680_ROOT).. 5 | INC_DIRS += $(bme680_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | bme680_SRC_DIR = $(bme680_ROOT) 9 | 10 | $(eval $(call component_compile_rules,bme680)) 11 | -------------------------------------------------------------------------------- /extras/bmp180/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Frank Bargstedt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /extras/bmp180/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/bmp180 2 | 3 | # expected anyone using bmp driver includes it as 'bmp180/bmp180.h' 4 | INC_DIRS += $(bmp180_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | bmp180_SRC_DIR = $(bmp180_ROOT) 8 | 9 | $(eval $(call component_compile_rules,bmp180)) 10 | -------------------------------------------------------------------------------- /extras/bmp280/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/bmp280 2 | 3 | # expected anyone using bmp driver includes it as 'bmp280/bmp280.h' 4 | INC_DIRS += $(bmp280_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | bmp280_SRC_DIR = $(bmp280_ROOT) 8 | 9 | $(eval $(call component_compile_rules,bmp280)) 10 | -------------------------------------------------------------------------------- /extras/ccs811/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ccs811 2 | 3 | # expected anyone using ccs811 driver includes it as 'ccs811/ccs811.h' 4 | INC_DIRS += $(ccs811_ROOT).. 5 | INC_DIRS += $(ccs811_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | ccs811_SRC_DIR = $(ccs811_ROOT) 9 | 10 | $(eval $(call component_compile_rules,ccs811)) 11 | -------------------------------------------------------------------------------- /extras/cpp_support/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/cpp_support 2 | INC_DIRS += $(ROOT)extras/cpp_support/include 3 | 4 | # args for passing into compile rule generation 5 | # extras/mqtt-client_INC_DIR = $(ROOT)extras/mqtt-client 6 | # extras/mqtt-client_SRC_DIR = $(ROOT)extras/mqtt-client 7 | 8 | # $(eval $(call component_compile_rules,extras/mqtt-client)) 9 | -------------------------------------------------------------------------------- /extras/crc_generic/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/crc_generic 2 | 3 | # expected anyone using bmp driver includes it as 'crc_generic/crc_generic.h' 4 | INC_DIRS += $(crc_generic_ROOT)crc_lib/ 5 | 6 | # args for passing into compile rule generation 7 | crc_generic_SRC_DIR = $(crc_generic_ROOT)crc_lib/ 8 | 9 | $(eval $(call component_compile_rules,crc_generic)) 10 | -------------------------------------------------------------------------------- /extras/dhcpserver/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/dhcpserver 2 | 3 | INC_DIRS += $(dhcpserver_ROOT)include 4 | 5 | # args for passing into compile rule generation 6 | dhcpserver_INC_DIR = $(dhcpserver_ROOT) 7 | dhcpserver_SRC_DIR = $(dhcpserver_ROOT) 8 | 9 | $(eval $(call component_compile_rules,dhcpserver)) 10 | -------------------------------------------------------------------------------- /extras/dhcpserver/include/dhcpserver.h: -------------------------------------------------------------------------------- 1 | /* Very basic LWIP & FreeRTOS-based DHCP server 2 | * 3 | * Header file contains default configuration for the DHCP server. 4 | * 5 | * 6 | * Part of esp-open-rtos 7 | * Copyright (C) 2015 Superhouse Automation Pty Ltd 8 | * BSD Licensed as described in the file LICENSE 9 | */ 10 | #ifndef _DHCPSERVER_H 11 | #define _DHCPSERVER_H 12 | 13 | #ifndef DHCPSERVER_LEASE_TIME 14 | #define DHCPSERVER_LEASE_TIME 3600 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* Start DHCP server. 22 | 23 | Static IP of server should already be set and network interface enabled. 24 | 25 | first_client_addr is the IP address of the first lease to be handed 26 | to a client. Subsequent lease addresses are calculated by 27 | incrementing the final octet of the IPv4 address, up to max_leases. 28 | */ 29 | void dhcpserver_start(const ip4_addr_t *first_client_addr, uint8_t max_leases); 30 | 31 | void dhcpserver_get_lease(const ip4_addr_t *first_client_addr, uint8_t max_leases); 32 | 33 | /* Stop DHCP server. 34 | */ 35 | void dhcpserver_stop(void); 36 | 37 | /* Set a router address to send as an option. */ 38 | void dhcpserver_set_router(const ip4_addr_t *router); 39 | 40 | /* Set a DNS address to send as an option. */ 41 | void dhcpserver_set_dns(const ip4_addr_t *dns); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /extras/dht/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/dht 2 | 3 | # include it as 'dht/dht.h' 4 | INC_DIRS += $(dht_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | dht_SRC_DIR = $(dht_ROOT) 8 | 9 | $(eval $(call component_compile_rules,dht)) 10 | 11 | -------------------------------------------------------------------------------- /extras/dht/dht.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Part of esp-open-rtos 3 | * Copyright (C) 2016 Jonathan Hartsuiker (https://github.com/jsuiker) 4 | * BSD Licensed as described in the file LICENSE 5 | * 6 | */ 7 | 8 | #ifndef __DHT_H__ 9 | #define __DHT_H__ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | * Sensor type 20 | */ 21 | typedef enum 22 | { 23 | DHT_TYPE_DHT11 = 0, //!< DHT11 24 | DHT_TYPE_DHT22, //!< DHT22 25 | DHT_TYPE_SI7021 //!< Itead SI7021 26 | } dht_sensor_type_t; 27 | 28 | /** 29 | * Read data from sensor on specified pin. 30 | * 31 | * Humidity and temperature is returned as integers. 32 | * For example: humidity=625 is 62.5 % 33 | * temperature=24.4 is 24.4 degrees Celsius 34 | * 35 | */ 36 | bool dht_read_data(dht_sensor_type_t sensor_type, uint8_t pin, int16_t *humidity, int16_t *temperature); 37 | 38 | 39 | /** 40 | * Float version of dht_read_data. 41 | * 42 | * Return values as floating point values. 43 | */ 44 | bool dht_read_float_data(dht_sensor_type_t sensor_type, uint8_t pin, float *humidity, float *temperature); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif // __DHT_H__ 51 | -------------------------------------------------------------------------------- /extras/ds1302/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ds1302 2 | 3 | # expected anyone using RTC driver includes it as 'ds1302/ds1302.h' 4 | INC_DIRS += $(ds1302_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ds1302_SRC_DIR = $(ds1302_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ds1302)) 10 | -------------------------------------------------------------------------------- /extras/ds1307/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ds1307 2 | 3 | # expected anyone using RTC driver includes it as 'ds1307/ds1307.h' 4 | INC_DIRS += $(ds1307_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ds1307_SRC_DIR = $(ds1307_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ds1307)) 10 | -------------------------------------------------------------------------------- /extras/ds18b20/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ds18b20 2 | 3 | # expected anyone using bmp driver includes it as 'ds18b20/ds18b20.h' 4 | INC_DIRS += $(ds18b20_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ds18b20_SRC_DIR = $(ds18b20_ROOT) 8 | 9 | # users can override this setting and get console debug output 10 | DS18B20_DEBUG ?= 0 11 | ifeq ($(DS18B20_DEBUG),1) 12 | ds18b20_CFLAGS = $(CFLAGS) -DDS18B20_DEBUG 13 | endif 14 | 15 | $(eval $(call component_compile_rules,ds18b20)) 16 | -------------------------------------------------------------------------------- /extras/ds3231/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Richard A Burton 4 | Copyright (c) 2016 Bhuvanchandra DV 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /extras/ds3231/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ds3231 2 | 3 | # expected anyone using bmp driver includes it as 'ds3231/ds3231.h' 4 | INC_DIRS += $(ds3231_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ds3231_SRC_DIR = $(ds3231_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ds3231)) 10 | -------------------------------------------------------------------------------- /extras/dsm/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/dsm 2 | 3 | INC_DIRS += $(ROOT)extras/dsm 4 | 5 | # args for passing into compile rule generation 6 | extras/dsm_INC_DIR = $(ROOT)extras/dsm 7 | extras/dsm_SRC_DIR = $(ROOT)extras/dsm 8 | 9 | $(eval $(call component_compile_rules,extras/dsm)) 10 | -------------------------------------------------------------------------------- /extras/dsm/dsm.h: -------------------------------------------------------------------------------- 1 | /* Implementation of Delta-Sigma modulator support. 2 | * 3 | * Part of esp-open-rtos 4 | * Copyright (C) 2018 ourairquality (https://github.com/ourairquality) 5 | * Copyright (C) 2018 Zaltora (https://github.com/Zaltora) 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #ifndef EXTRAS_DSM_H_ 9 | #define EXTRAS_DSM_H_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #include 16 | 17 | #define MAX_DSM_PINS (8) 18 | #define DSM_DEBUG (0) 19 | 20 | /* 21 | * Freq = (80,000,000/prescale) * (target / 256) HZ (0 < target < 128) 22 | * Freq = (80,000,000/prescale) * ((256 - target) / 256) HZ (128 < target < 256) 23 | */ 24 | 25 | void dsm_init(uint8_t npins, const uint8_t* pins); 26 | void dsm_set_prescale(uint8_t prescale); 27 | void dsm_set_target(uint8_t target); 28 | 29 | void dsm_start(); 30 | void dsm_stop(); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* EXTRAS_DSM_H_ */ 37 | -------------------------------------------------------------------------------- /extras/fatfs/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/fatfs 2 | INC_DIRS += $(fatfs_ROOT).. 3 | 4 | # args for passing into compile rule generation 5 | fatfs_SRC_DIR = $(fatfs_ROOT) 6 | 7 | FATFS_DIR := $(dir $(lastword $(MAKEFILE_LIST))) 8 | 9 | # FatFs default parameters 10 | include $(FATFS_DIR)defaults.mk 11 | 12 | fatfs_CFLAGS = $(CFLAGS) \ 13 | -DFF_FS_READONLY=$(FATFS_FS_READONLY) \ 14 | -DFF_USE_STRFUNC=$(FATFS_USE_STRFUNC) \ 15 | -DFF_CODE_PAGE=$(FATFS_CODE_PAGE) \ 16 | -DFF_USE_FIND=$(FATFS_USE_FIND) \ 17 | -DFF_USE_MKFS=$(FATFS_USE_MKFS) \ 18 | -DFF_USE_FASTSEEK=$(FATFS_USE_FASTSEEK) \ 19 | -DFF_USE_EXPAND=$(FATFS_USE_EXPAND) \ 20 | -DFF_USE_CHMOD=$(FATFS_USE_CHMOD) \ 21 | -DFF_USE_LABEL=$(FATFS_USE_LABEL) \ 22 | -DFF_USE_FORWARD=$(FATFS_USE_FORWARD) \ 23 | -DFF_CODE_PAGE=$(FATFS_CODE_PAGE) \ 24 | -DFF_USE_LFN=$(FATFS_USE_LFN) \ 25 | -DFF_MAX_LFN=$(FATFS_MAX_LFN) \ 26 | -DFF_LFN_UNICODE=$(FATFS_LFN_UNICODE) \ 27 | -DFF_STRF_ENCODE=$(FATFS_STRF_ENCODE) \ 28 | -DFF_FS_RPATH=$(FATFS_FS_RPATH) \ 29 | -DFF_FS_EXFAT=$(FATFS_FS_EXFAT) \ 30 | -DFF_FS_NORTC=$(FATFS_FS_NORTC) \ 31 | -DFF_NORTC_MON=$(FATFS_NORTC_MON) \ 32 | -DFF_NORTC_MDAY=$(FATFS_NORTC_MDAY) \ 33 | -DFF_NORTC_YEAR=$(FATFS_NORTC_YEAR) \ 34 | -DFF_FS_LOCK=$(FATFS_FS_LOCK) \ 35 | -DFF_FS_TIMEOUT=$(FATFS_FS_TIMEOUT) 36 | 37 | $(eval $(call component_compile_rules,fatfs)) 38 | -------------------------------------------------------------------------------- /extras/fatfs/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef FF_INTEGER 6 | #define FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | typedef unsigned __int64 QWORD; 13 | 14 | 15 | #else /* Embedded platform */ 16 | 17 | /* These types MUST be 16-bit or 32-bit */ 18 | typedef int INT; 19 | typedef unsigned int UINT; 20 | 21 | /* This type MUST be 8-bit */ 22 | typedef unsigned char BYTE; 23 | 24 | /* These types MUST be 16-bit */ 25 | typedef short SHORT; 26 | typedef unsigned short WORD; 27 | typedef unsigned short WCHAR; 28 | 29 | /* These types MUST be 32-bit */ 30 | typedef long LONG; 31 | typedef unsigned long DWORD; 32 | 33 | /* This type MUST be 64-bit (Remove this for ANSI C (C89) compatibility) */ 34 | typedef unsigned long long QWORD; 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /extras/fatfs/volumes.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FatFs integration to esp-open-rtos 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #include "volumes.h" 9 | #include 10 | 11 | const char *volumes[] = { 12 | [0] = "3:", 13 | [1] = NULL, 14 | [2] = "4:", 15 | [3] = NULL, 16 | [4] = "2:", 17 | [5] = "1:", 18 | [6] = NULL, 19 | [7] = NULL, 20 | [8] = NULL, 21 | [9] = NULL, 22 | [10] = NULL, 23 | [11] = NULL, 24 | [12] = NULL, 25 | [13] = NULL, 26 | [14] = NULL, 27 | [15] = "0:", 28 | [16] = "5:" 29 | }; 30 | 31 | const uint8_t pins[] = { 32 | 15, 5, 4, 0, 2, 16 33 | }; 34 | 35 | const char *f_gpio_to_volume(uint8_t gpio) 36 | { 37 | return gpio > 16 ? NULL : volumes[gpio]; 38 | } 39 | 40 | uint8_t f_drv_to_gpio(uint8_t drv) 41 | { 42 | return pins[drv]; 43 | } 44 | -------------------------------------------------------------------------------- /extras/fatfs/volumes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FatFs integration to esp-open-rtos 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #ifndef _EXTRAS_FATFS_VOLUMES_H_ 9 | #define _EXTRAS_FATFS_VOLUMES_H_ 10 | 11 | #include 12 | 13 | const char *f_gpio_to_volume(uint8_t gpio); 14 | uint8_t f_drv_to_gpio(uint8_t drv); 15 | 16 | #endif /* _EXTRAS_FATFS_VOLUMES_H_ */ 17 | -------------------------------------------------------------------------------- /extras/fonts/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /extras/fonts/defaults.mk: -------------------------------------------------------------------------------- 1 | ######################################### 2 | # Default built-in fonts 3 | ######################################### 4 | 5 | # FIXME 6 | 7 | FONTS_GLCD_5X7 ?= 1 8 | 9 | FONTS_ROBOTO_8PT ?= 0 10 | FONTS_ROBOTO_10PT ?= 0 11 | 12 | # BitOCRA 13 | FONTS_BITOCRA_4X7 ?= 0 14 | FONTS_BITOCRA_6X11 ?= 0 15 | FONTS_BITOCRA_7X13 ?= 0 16 | 17 | # Terminus, ISO8859-1 (Latin-1) 18 | FONTS_TERMINUS_6X12_ISO8859_1 ?= 0 19 | FONTS_TERMINUS_8X14_ISO8859_1 ?= 0 20 | FONTS_TERMINUS_BOLD_8X14_ISO8859_1 ?= 0 21 | FONTS_TERMINUS_10X18_ISO8859_1 ?= 0 22 | FONTS_TERMINUS_BOLD_10X18_ISO8859_1 ?= 0 23 | FONTS_TERMINUS_11X22_ISO8859_1 ?= 0 24 | FONTS_TERMINUS_BOLD_11X22_ISO8859_1 ?= 0 25 | FONTS_TERMINUS_12X24_ISO8859_1 ?= 0 26 | FONTS_TERMINUS_BOLD_12X24_ISO8859_1 ?= 0 27 | FONTS_TERMINUS_14X28_ISO8859_1 ?= 0 28 | FONTS_TERMINUS_BOLD_14X28_ISO8859_1 ?= 0 29 | FONTS_TERMINUS_16X32_ISO8859_1 ?= 0 30 | FONTS_TERMINUS_BOLD_16X32_ISO8859_1 ?= 0 31 | 32 | # Terminus, KOI8-R 33 | FONTS_TERMINUS_6X12_KOI8_R ?= 0 34 | FONTS_TERMINUS_8X14_KOI8_R ?= 0 35 | FONTS_TERMINUS_BOLD_8X14_KOI8_R ?= 0 36 | FONTS_TERMINUS_14X28_KOI8_R ?= 0 37 | FONTS_TERMINUS_BOLD_14X28_KOI8_R ?= 0 38 | FONTS_TERMINUS_16X32_KOI8_R ?= 0 39 | FONTS_TERMINUS_BOLD_16X32_KOI8_R ?= 0 40 | -------------------------------------------------------------------------------- /extras/fram/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/fram 2 | 3 | # expected anyone using ADC driver includes it as 'fram/fram.h' 4 | INC_DIRS += $(fram_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | fram_SRC_DIR = $(fram_ROOT) 8 | 9 | $(eval $(call component_compile_rules,fram)) 10 | -------------------------------------------------------------------------------- /extras/hd44780/component.mk: -------------------------------------------------------------------------------- 1 | INC_DIRS += $(hd44780_ROOT).. 2 | hd44780_SRC_DIR = $(hd44780_ROOT) 3 | 4 | HD44780_I2C ?= 1 5 | 6 | hd44780_CFLAGS = -DHD44780_I2C=${HD44780_I2C} $(CFLAGS) 7 | 8 | $(eval $(call component_compile_rules,hd44780)) 9 | -------------------------------------------------------------------------------- /extras/hd44780/img/0801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/extras/hd44780/img/0801.png -------------------------------------------------------------------------------- /extras/hd44780/img/1601.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/extras/hd44780/img/1601.png -------------------------------------------------------------------------------- /extras/hd44780/img/1602.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/extras/hd44780/img/1602.png -------------------------------------------------------------------------------- /extras/hd44780/img/1604.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/extras/hd44780/img/1604.png -------------------------------------------------------------------------------- /extras/hmc5883l/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/hmc5883l 2 | 3 | # expected anyone using this driver includes it as 'hmc5883l/hmc5883l.h' 4 | INC_DIRS += $(hmc5883l_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | hmc5883l_SRC_DIR = $(hmc5883l_ROOT) 8 | 9 | $(eval $(call component_compile_rules,hmc5883l)) 10 | -------------------------------------------------------------------------------- /extras/http-parser/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/http-parser 2 | 3 | # Include it as 'http-parser/http_parser.h' 4 | INC_DIRS += $(http-parser_ROOT) 5 | 6 | # args for passing into compile rule generation 7 | http-parser_INC_DIR = 8 | http-parser_SRC_DIR = $(http-parser_ROOT)http-parser 9 | http-parser_SRC_FILES = $(http-parser_SRC_DIR)/http_parser.c 10 | 11 | $(eval $(call component_compile_rules,http-parser)) 12 | -------------------------------------------------------------------------------- /extras/http_client_ota/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/http_client_ota 2 | 3 | # Expected anyone using http_client_ota includes it as 'http_client_ota/ota' 4 | INC_DIRS += $(http_client_ota_ROOT) 5 | 6 | # args for passing into compile rule generation 7 | http_client_ota_INC_DIR = $(http_client_ota_ROOT) 8 | http_client_ota_SRC_DIR = $(http_client_ota_ROOT) 9 | 10 | $(eval $(call component_compile_rules,http_client_ota)) 11 | -------------------------------------------------------------------------------- /extras/http_client_ota/http_buffered_client.h: -------------------------------------------------------------------------------- 1 | #ifndef HTTP_BUFFERED_CLIENT 2 | #define HTTP_BUFFERED_CLIENT 3 | 4 | typedef unsigned int (*http_final_cb)(char *buff, uint16_t size); 5 | 6 | typedef enum { 7 | HTTP_DNS_LOOKUP_FALLIED = 1, 8 | HTTP_SOCKET_ALLOCATION_FALLIED = 2, 9 | HTTP_SOCKET_CONNECTION_FALLIED = 3, 10 | HTTP_SHA_DONT_MATCH = 4, 11 | HTTP_REQUEST_SEND_FALLIED = 5, 12 | HTTP_DOWLOAD_SIZE_NOT_MATCH = 6, 13 | HTTP_OK = 200, 14 | HTTP_NOTFOUND = 404, 15 | } HTTP_Client_State; 16 | 17 | typedef struct { 18 | const char * server; 19 | const char * port; 20 | const char * path; 21 | char * buffer; 22 | uint16_t buffer_size; 23 | http_final_cb buffer_full_cb; 24 | http_final_cb final_cb; 25 | } Http_client_info; 26 | 27 | HTTP_Client_State HttpClient_dowload(Http_client_info *info); 28 | 29 | #endif // ifndef HTTP_BUFFERED_CLIENT 30 | -------------------------------------------------------------------------------- /extras/httpd/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/httpd 2 | 3 | # expected anyone using httpd includes it as 'httpd/httpd.h' 4 | INC_DIRS += $(httpd_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | httpd_SRC_DIR = $(httpd_ROOT) 8 | 9 | $(eval $(call component_compile_rules,httpd)) 10 | -------------------------------------------------------------------------------- /extras/httpd/readme.txt: -------------------------------------------------------------------------------- 1 | This is a basic HTTP server with WebSockets based on httpd from LwIP. 2 | 3 | WebSockets implementation supports binary and text modes. Multiple sockets are supported. Continuation frames are not implemented. 4 | By default, a WebSocket is closed after 20 seconds of inactivity to conserve memory. This behavior can be changed by overriding `WS_TIMEOUT` option. 5 | 6 | To enable debugging extra flags `-DLWIP_DEBUG=1 -DHTTPD_DEBUG=LWIP_DBG_ON` should be passed at compile-time. 7 | 8 | This module expects your project to provide "fsdata.c" created with "makefsdata" utility. 9 | See examples/http_server. 10 | 11 | Maintained by lujji (https://github.com/lujji/esp-httpd). 12 | -------------------------------------------------------------------------------- /extras/httpd/strcasestr.h: -------------------------------------------------------------------------------- 1 | #ifndef STRCASESTR_H 2 | #define STRCASESTR_H 3 | 4 | #include 5 | 6 | char *strcasestr(const char *s, const char *find); 7 | char *strncasestr(const char *s, const char * find, size_t slen); 8 | 9 | #endif /* STRCASESTR_H */ 10 | -------------------------------------------------------------------------------- /extras/i2c/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Johan Kanflo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /extras/i2c/README.md: -------------------------------------------------------------------------------- 1 | # Yet another I2C driver for the ESP8266 2 | 3 | This time a driver for the excellent esp-open-rtos. This is a bit banging I2C driver based on the Wikipedia pesudo C code [1]. 4 | 5 | ### Basic usage 6 | 7 | ```C 8 | #include 9 | 10 | #define BUS (0) 11 | #define SCL_PIN (0) 12 | #define SDA_PIN (2) 13 | 14 | uint8_t slave_addr = 0x20; 15 | uint8_t reg_addr = 0x1f; 16 | uint8_t reg_data; 17 | 18 | i2c_init(BUS, SCL_PIN, SDA_PIN, I2C_FREQ_400K); 19 | 20 | // Write 1 byte to slave register 21 | int err = i2c_slave_write(BUS, slave_addr, ®_addr, &data, 1); 22 | if (err != 0) 23 | { 24 | // do something with error 25 | } 26 | 27 | // Issue write to slave, sending reg_addr, followed by reading 1 byte 28 | err = i2c_slave_read(BUS, slave_addr, ®_addr, ®_data, 1); 29 | 30 | ``` 31 | 32 | For details please see `extras/i2c/i2c.h`. 33 | 34 | The driver is released under the MIT license. 35 | 36 | [1] https://en.wikipedia.org/wiki/I²C#Example_of_bit-banging_the_I.C2.B2C_Master_protocol -------------------------------------------------------------------------------- /extras/i2c/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/i2c 2 | 3 | # expected anyone using i2c driver includes it as 'i2c/i2c.h' 4 | INC_DIRS += $(i2c_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | i2c_INC_DIR = 8 | i2c_SRC_DIR = $(i2c_ROOT) 9 | 10 | $(eval $(call component_compile_rules,i2c)) 11 | -------------------------------------------------------------------------------- /extras/i2s_dma/README.md: -------------------------------------------------------------------------------- 1 | # Wrapper around hardware I2S and DMA subsystems of ESP8266 2 | 3 | ESP8266 has hardware I2S bus support. I2S is a serial bus interface used for 4 | connecting digital audio devices. But can be used to produce sequence of pulses 5 | with reliable timings for example to control a strip of WS2812 leds. 6 | 7 | This library is just a wrapper around tricky I2S initialization. 8 | It sets necessary registers, enables I2S clock etc. 9 | -------------------------------------------------------------------------------- /extras/i2s_dma/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/i2s_dma 2 | 3 | # expected anyone using i2s_dma driver includes it as 'i2s_dma/i2s_dma.h' 4 | INC_DIRS += $(i2s_dma_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | i2s_dma_SRC_DIR = $(i2s_dma_ROOT) 8 | 9 | $(eval $(call component_compile_rules,i2s_dma)) 10 | -------------------------------------------------------------------------------- /extras/ina3221/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ina3221 2 | 3 | # expected anyone using this driver includes it as 'ina3221/ina3221.h' 4 | INC_DIRS += $(ina3221_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ina3221_SRC_DIR = $(ina3221_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ina3221)) 10 | -------------------------------------------------------------------------------- /extras/jsmn/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/jsmn 2 | 3 | # expected anyone using jsmn json component includes it as 'jsmn/jsmn.h' 4 | INC_DIRS += $(jsmn_ROOT)jsmn 5 | 6 | # args for passing into compile rule generation 7 | jsmn_INC_DIR = 8 | jsmn_SRC_DIR = $(jsmn_ROOT)jsmn 9 | 10 | $(eval $(call component_compile_rules,jsmn)) 11 | -------------------------------------------------------------------------------- /extras/l3gd20h/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/l3gd20h 2 | 3 | # expected anyone using L3GD20H driver includes it as 'l3gd20h/l3gd20h.h' 4 | INC_DIRS += $(l3gd20h_ROOT).. 5 | INC_DIRS += $(l3gd20h_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | l3gd20h_SRC_DIR = $(l3gd20h_ROOT) 9 | 10 | $(eval $(call component_compile_rules,l3gd20h)) 11 | -------------------------------------------------------------------------------- /extras/lis3dh/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/lis3dh 2 | 3 | # expected anyone using SHT3x driver includes it as 'lis3dh/lis3dh.h' 4 | INC_DIRS += $(lis3dh_ROOT).. 5 | INC_DIRS += $(lis3dh_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | lis3dh_SRC_DIR = $(lis3dh_ROOT) 9 | 10 | $(eval $(call component_compile_rules,lis3dh)) 11 | -------------------------------------------------------------------------------- /extras/lis3mdl/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/lis3mdl 2 | 3 | # expected anyone using LIS3MDL driver includes it as 'lis3mld/lis3mld.h' 4 | INC_DIRS += $(lis3mdl_ROOT).. 5 | INC_DIRS += $(lis3mdl_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | lis3mdl_SRC_DIR = $(lis3mdl_ROOT) 9 | 10 | $(eval $(call component_compile_rules,lis3mdl)) 11 | -------------------------------------------------------------------------------- /extras/lsm303d/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/lsm303d 2 | 3 | # expected anyone using LIS3MDL driver includes it as 'lis3mld/lis3mld.h' 4 | INC_DIRS += $(lsm303d_ROOT).. 5 | INC_DIRS += $(lsm303d_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | lsm303d_SRC_DIR = $(lsm303d_ROOT) 9 | 10 | $(eval $(call component_compile_rules,lsm303d)) 11 | -------------------------------------------------------------------------------- /extras/mactimer/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/mactimer 2 | 3 | # Expected anyone using mactimer includes it as 'mactimer/mactimer.h' 4 | INC_DIRS += $(mactimer_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | mactimer_INC_DIR = 8 | mactimer_SRC_DIR = $(mactimer_ROOT) 9 | 10 | $(eval $(call component_compile_rules,mactimer)) 11 | -------------------------------------------------------------------------------- /extras/max7219/component.mk: -------------------------------------------------------------------------------- 1 | # include it as 'max7219/max7219.h' 2 | INC_DIRS += $(max7219_ROOT).. 3 | 4 | # args for passing into compile rule generation 5 | max7219_SRC_DIR = $(max7219_ROOT) 6 | 7 | $(eval $(call component_compile_rules,max7219)) 8 | -------------------------------------------------------------------------------- /extras/mbedtls/hardware_entropy.c: -------------------------------------------------------------------------------- 1 | /* ESP8266 "Hardware RNG" (validity still being confirmed) support for ESP8266 2 | * 3 | * Based on research done by @foogod. 4 | * 5 | * Please don't rely on this too much as an entropy source, quite yet... 6 | * 7 | * Part of esp-open-rtos 8 | * Copyright (C) 2015 Angus Gratton 9 | * BSD Licensed as described in the file LICENSE 10 | */ 11 | #include 12 | #include 13 | 14 | int mbedtls_hardware_poll( void *data, 15 | unsigned char *output, size_t len, size_t *olen ) 16 | { 17 | (void)(data); 18 | hwrand_fill(output, len); 19 | if(olen) 20 | *olen = len; 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /extras/mcp4725/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/mcp4725 2 | 3 | # expected anyone using this driver includes it as 'mcp4725/mcp4725.h' 4 | INC_DIRS += $(mcp4725_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | mcp4725_SRC_DIR = $(mcp4725_ROOT) 8 | 9 | $(eval $(call component_compile_rules,mcp4725)) 10 | -------------------------------------------------------------------------------- /extras/mdnsresponder/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/mdnsresponder 2 | 3 | INC_DIRS += $(mdnsresponder_ROOT) 4 | 5 | # args for passing into compile rule generation 6 | mdnsresponder_INC_DIR = $(mdnsresponder_ROOT) 7 | mdnsresponder_SRC_DIR = $(mdnsresponder_ROOT) 8 | 9 | $(eval $(call component_compile_rules,mdnsresponder)) 10 | -------------------------------------------------------------------------------- /extras/ms561101ba03/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ms561101ba03 2 | 3 | # expected anyone using this driver includes it as 'ms561101ba03/ms561101ba03.h' 4 | INC_DIRS += $(ms561101ba03_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ms561101ba03_SRC_DIR = $(ms561101ba03_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ms561101ba03)) 10 | -------------------------------------------------------------------------------- /extras/onewire/README.md: -------------------------------------------------------------------------------- 1 | # Yet another one wire driver for the ESP8266 2 | 3 | This is a port of a bit-banging one wire driver based on the implementation 4 | from NodeMCU. 5 | 6 | This, in turn, appears to have been based on the PJRC Teensy driver 7 | (https://www.pjrc.com/teensy/td_libs_OneWire.html), by Jim Studt, Paul 8 | Stoffregen, and a host of others. 9 | 10 | The original code is licensed under the MIT license. The CRC code was taken 11 | (at least partially) from Dallas Semiconductor sample code, which was licensed 12 | under an MIT license with an additional clause (prohibiting inappropriate use 13 | of the Dallas Semiconductor name). See the accompanying LICENSE file for 14 | details. 15 | -------------------------------------------------------------------------------- /extras/onewire/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/onewire 2 | 3 | # expected anyone using onewire driver includes it as 'onewire/onewire.h' 4 | INC_DIRS += $(onewire_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | onewire_INC_DIR = 8 | onewire_SRC_DIR = $(onewire_ROOT) 9 | 10 | $(eval $(call component_compile_rules,onewire)) 11 | -------------------------------------------------------------------------------- /extras/paho_mqtt_c/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/paho_mqtt_c 2 | 3 | # expected anyone using bmp driver includes it as 'paho_mqtt_c/MQTT*.h' 4 | INC_DIRS += $(paho_mqtt_c_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | paho_mqtt_c_SRC_DIR = $(paho_mqtt_c_ROOT) 8 | 9 | $(eval $(call component_compile_rules,paho_mqtt_c)) 10 | -------------------------------------------------------------------------------- /extras/pca9685/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/pca9685 2 | 3 | # expected anyone using this driver includes it as 'pca9685/pca9685.h' 4 | INC_DIRS += $(pca9685_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | pca9685_SRC_DIR = $(pca9685_ROOT) 8 | 9 | $(eval $(call component_compile_rules,pca9685)) 10 | -------------------------------------------------------------------------------- /extras/pcf8574/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/pcf8574 2 | 3 | INC_DIRS += $(pcf8574_ROOT).. 4 | pcf8574_SRC_DIR = $(pcf8574_ROOT) 5 | 6 | $(eval $(call component_compile_rules,pcf8574)) 7 | -------------------------------------------------------------------------------- /extras/pcf8574/pcf8574.c: -------------------------------------------------------------------------------- 1 | #include "pcf8574.h" 2 | 3 | uint8_t pcf8574_port_read(i2c_dev_t *dev) 4 | { 5 | uint8_t res; 6 | if (i2c_slave_read(dev->bus, dev->addr, NULL, &res, 1)) 7 | return 0; 8 | return res; 9 | } 10 | 11 | size_t pcf8574_port_read_buf(i2c_dev_t *dev, void *buf, size_t len) 12 | { 13 | if (!len || !buf) return 0; 14 | uint8_t *_buf = (uint8_t *)buf; 15 | 16 | if (i2c_slave_read(dev->bus, dev->addr, NULL, _buf, len)) 17 | return 0; 18 | return len; 19 | } 20 | 21 | size_t pcf8574_port_write_buf(const i2c_dev_t *dev, void *buf, size_t len) 22 | { 23 | if (!len || !buf) return 0; 24 | uint8_t *_buf = (uint8_t *)buf; 25 | 26 | if (i2c_slave_write(dev->bus, dev->addr, NULL, _buf, len)) 27 | return 0; 28 | return len; 29 | } 30 | 31 | void pcf8574_port_write(const i2c_dev_t *dev, uint8_t value) 32 | { 33 | i2c_slave_write(dev->bus, dev->addr, NULL, &value, 1); 34 | } 35 | 36 | bool pcf8574_gpio_read(i2c_dev_t *dev, uint8_t num) 37 | { 38 | return (bool)((pcf8574_port_read(dev) >> num) & 1); 39 | } 40 | 41 | void pcf8574_gpio_write(i2c_dev_t *dev, uint8_t num, bool value) 42 | { 43 | uint8_t bit = (uint8_t)value << num; 44 | uint8_t mask = ~(1 << num); 45 | pcf8574_port_write(dev, (pcf8574_port_read(dev) & mask) | bit); 46 | } 47 | -------------------------------------------------------------------------------- /extras/pcf8591/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/pcf8591 2 | 3 | INC_DIRS += $(pcf8591_ROOT).. 4 | pcf8591_SRC_DIR = $(pcf8591_ROOT) 5 | 6 | $(eval $(call component_compile_rules,pcf8591)) 7 | -------------------------------------------------------------------------------- /extras/pcf8591/pcf8591.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Driver for 8-bit analog-to-digital conversion and 3 | * an 8-bit digital-to-analog conversion PCF8591 4 | * 5 | * Part of esp-open-rtos 6 | * Copyright (C) 2017 Pham Ngoc Thanh 7 | * 2017 Ruslan V. Uss 8 | * BSD Licensed as described in the file LICENSE 9 | */ 10 | #include "pcf8591.h" 11 | 12 | #include 13 | 14 | #define BV(x) (1 << (x)) 15 | 16 | #define CTRL_AD_CH_MASK 0x03 17 | 18 | #define CTRL_AD_IN_PRG 4 19 | #define CTRL_AD_IN_PRG_MASK (0x03 << CTRL_AD_IN_PRG) 20 | 21 | #define CTRL_DA_OUT_EN 6 22 | 23 | uint8_t pcf8591_read(i2c_dev_t *dev, pcf8591_input_conf_t conf, uint8_t channel) 24 | { 25 | uint8_t res = 0; 26 | uint8_t control_reg = 27 | ((conf << CTRL_AD_IN_PRG) & CTRL_AD_IN_PRG_MASK) | 28 | (channel & CTRL_AD_CH_MASK) | 29 | BV(CTRL_DA_OUT_EN); 30 | 31 | i2c_slave_read(dev->bus, dev->addr, &control_reg, &res, 1); 32 | 33 | return res; 34 | } 35 | 36 | void pcf8591_write(i2c_dev_t *dev, uint8_t value) 37 | { 38 | uint8_t buf[2] = { BV(CTRL_DA_OUT_EN), value }; 39 | 40 | i2c_slave_write(dev->bus, dev->addr, NULL, buf, 2); 41 | } 42 | -------------------------------------------------------------------------------- /extras/pwm/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/pwm 2 | 3 | INC_DIRS += $(ROOT)extras/pwm 4 | 5 | # args for passing into compile rule generation 6 | extras/pwm_INC_DIR = $(ROOT)extras/pwm 7 | extras/pwm_SRC_DIR = $(ROOT)extras/pwm 8 | 9 | $(eval $(call component_compile_rules,extras/pwm)) 10 | -------------------------------------------------------------------------------- /extras/rboot-ota/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/rboot-ota 2 | 3 | # global include directories need to find rboot.h for integration, even 4 | # when just including rboot-api.h :( 5 | INC_DIRS += $(rboot-ota_ROOT) $(ROOT)bootloader $(ROOT)bootloader/rboot 6 | 7 | rboot-ota_SRC_DIR = $(rboot-ota_ROOT) 8 | 9 | $(eval $(call component_compile_rules,rboot-ota)) 10 | 11 | -------------------------------------------------------------------------------- /extras/rboot-ota/license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Richard A Burton (richardaburton@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /extras/rboot-ota/rboot-integration.h: -------------------------------------------------------------------------------- 1 | // The rboot project provides this file for making rboot fit other projects 2 | 3 | #ifndef __RBOOT_INTEGRATION_H__ 4 | #define __RBOOT_INTEGRATION_H__ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /*************************************************** 13 | * Platform configuration definitions * 14 | ***************************************************/ 15 | 16 | #define uint8 uint8_t 17 | #define uint16 uint16_t 18 | #define uint32 uint32_t 19 | #define int32 int32_t 20 | #define ICACHE_FLASH_ATTR 21 | #define spi_flash_read sdk_spi_flash_read 22 | #define spi_flash_erase_sector sdk_spi_flash_erase_sector 23 | #define spi_flash_write sdk_spi_flash_write 24 | #define os_malloc malloc 25 | #define os_free free 26 | #define system_rtc_mem_read sdk_system_rtc_mem_read 27 | #define system_rtc_mem_write sdk_system_rtc_mem_write 28 | 29 | #if 0 30 | #define RBOOT_DEBUG(f_, ...) printf((f_), __VA_ARGS__) 31 | #else 32 | #define RBOOT_DEBUG(f_, ...) 33 | #endif 34 | 35 | /* Enable checksumming when writing out the config, 36 | so if the bootloader is built with checksumming then 37 | it will still work. 38 | */ 39 | #define BOOT_CONFIG_CHKSUM 40 | 41 | 42 | #endif // __RBOOT_INTEGRATION_H__ 43 | -------------------------------------------------------------------------------- /extras/sdio/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/sdio 2 | INC_DIRS += $(sdio_ROOT).. 3 | 4 | # args for passing into compile rule generation 5 | sdio_SRC_DIR = $(sdio_ROOT) 6 | 7 | # Workaround unsupported CMD25 for very old SD cards 8 | SDIO_CMD25_WORKAROUND ?= 0 9 | 10 | sdio_CFLAGS = $(CFLAGS) -DSDIO_CMD25_WORKAROUND=$(SDIO_CMD25_WORKAROUND) 11 | 12 | $(eval $(call component_compile_rules,sdio)) -------------------------------------------------------------------------------- /extras/sht3x/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/sht3x 2 | 3 | # expected anyone using SHT3x driver includes it as 'sht3x/sht3x.h' 4 | INC_DIRS += $(sht3x_ROOT).. 5 | INC_DIRS += $(sht3x_ROOT) 6 | 7 | # args for passing into compile rule generation 8 | sht3x_SRC_DIR = $(sht3x_ROOT) 9 | 10 | $(eval $(call component_compile_rules,sht3x)) 11 | -------------------------------------------------------------------------------- /extras/sntp/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/sntp 2 | 3 | INC_DIRS += $(sntp_ROOT) 4 | 5 | # args for passing into compile rule generation 6 | sntp_SRC_DIR = $(sntp_ROOT) 7 | 8 | # For SNTP logging, either supply own SNTP_LOGD 9 | # or define SNTP_LOGD_WITH_PRINTF (see sntp_fun.c) 10 | 11 | # sntp_CFLAGS = $(CFLAGS) -DSNTP_LOGD_WITH_PRINTF 12 | 13 | $(eval $(call component_compile_rules,sntp)) 14 | -------------------------------------------------------------------------------- /extras/softuart/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2016 Bernhard Guillon 4 | Copyright (c) 2015 plieningerweb 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /extras/softuart/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/softuart 2 | 3 | # expected anyone using this driver includes it as 'softuart/softuart.h' 4 | INC_DIRS += $(softuart_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | softuart_SRC_DIR = $(softuart_ROOT) 8 | 9 | $(eval $(call component_compile_rules,softuart)) 10 | 11 | -------------------------------------------------------------------------------- /extras/spiffs/esp_spiffs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * ESP8266 SPIFFS HAL configuration. 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (c) 2016 sheinz https://github.com/sheinz 6 | * MIT License 7 | */ 8 | #ifndef __ESP_SPIFFS_H__ 9 | #define __ESP_SPIFFS_H__ 10 | 11 | #include "spiffs.h" 12 | 13 | extern spiffs fs; 14 | 15 | #if SPIFFS_SINGLETON == 1 16 | /** 17 | * Prepare for SPIFFS mount. 18 | * 19 | * The function allocates all the necessary buffers. 20 | */ 21 | void esp_spiffs_init(); 22 | #else 23 | /** 24 | * Prepare for SPIFFS mount. 25 | * 26 | * The function allocates all the necessary buffers. 27 | * 28 | * @param addr Base address for spiffs in flash memory. 29 | * @param size File sistem size. 30 | */ 31 | void esp_spiffs_init(uint32_t addr, uint32_t size); 32 | #endif 33 | 34 | 35 | /** 36 | * Free all memory buffers that were used by SPIFFS. 37 | * 38 | * The function should be called after SPIFFS unmount if the file system is not 39 | * going to need any more. 40 | */ 41 | void esp_spiffs_deinit(); 42 | 43 | /** 44 | * Mount SPIFFS. 45 | * 46 | * esp_spiffs_init must be called first. 47 | * 48 | * Return SPIFFS return code. 49 | */ 50 | int32_t esp_spiffs_mount(); 51 | 52 | #endif // __ESP_SPIFFS_H__ 53 | -------------------------------------------------------------------------------- /extras/spiffs/mkspiffs/.gitignore: -------------------------------------------------------------------------------- 1 | /mkspiffs 2 | /*.o 3 | -------------------------------------------------------------------------------- /extras/spiffs/mkspiffs/Makefile: -------------------------------------------------------------------------------- 1 | # explicitly use gcc as in xtensa build environment it might be set to 2 | # cross compiler 3 | CC = gcc 4 | 5 | SOURCES := spiffs_hydrogen.c 6 | SOURCES += spiffs_cache.c 7 | SOURCES += spiffs_gc.c 8 | SOURCES += spiffs_check.c 9 | SOURCES += spiffs_nucleus.c 10 | SOURCES += mkspiffs.c 11 | 12 | OBJECTS := $(SOURCES:.c=.o) 13 | 14 | VPATH = ../spiffs/src 15 | 16 | CFLAGS += -I.. 17 | CFLAGS += -DSPIFFS_SINGLETON=0 18 | 19 | all: mkspiffs 20 | 21 | $(OBJECTS): $(SOURCES) 22 | 23 | $(OBJECTS): ../spiffs_config.h 24 | 25 | mkspiffs: $(OBJECTS) 26 | 27 | clean: 28 | @rm -f mkspiffs 29 | @rm -f *.o 30 | 31 | .PHONY: all clean 32 | -------------------------------------------------------------------------------- /extras/spiffs/mkspiffs/README.md: -------------------------------------------------------------------------------- 1 | # mkspiffs Create spiffs image 2 | 3 | mkspiffs is a command line utility to create an image of SPIFFS in order 4 | to write to flash. 5 | 6 | ## Usage 7 | 8 | mkspiffs will be built automatically if you include the following line in your 9 | makefile: 10 | 11 | ``` 12 | $(eval $(call make_spiffs_image,files)) 13 | ``` 14 | 15 | where *files* is the directory with files that should go into SPIFFS image. 16 | 17 | mkspiffs can be built separately. Simply run `make` in the mkspiffs directory. 18 | 19 | To manually generate SPIFFS image from a directory SPIFFS configuration must be 20 | provided as command line arguments. 21 | 22 | Arguments: 23 | * -D Directory with files that will be put in SPIFFS image. 24 | * -f SPIFFS image file name. 25 | * -s SPIFFS size. 26 | * -p Logical page size. 27 | * -b Logical block size. 28 | 29 | All arguments are mandatory. 30 | 31 | For example: 32 | 33 | ``` 34 | mkspiffs -D ./my_files -f spiffs.img -s 0x10000 -p 256 -b 8192 35 | ``` 36 | -------------------------------------------------------------------------------- /extras/ssd1306/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Frank Bargstedt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /extras/ssd1306/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ssd1306 2 | 3 | # expected anyone using ssd1306 driver includes it as 'ssd1306/ssd1306.h' 4 | INC_DIRS += $(ssd1306_ROOT).. 5 | 6 | # I2C support is on by default 7 | SSD1306_I2C_SUPPORT ?= 1 8 | # SPI4 support is on by default 9 | SSD1306_SPI4_SUPPORT ?= 1 10 | # SPI3 support is on by default 11 | SSD1306_SPI3_SUPPORT ?= 1 12 | 13 | # args for passing into compile rule generation 14 | ssd1306_SRC_DIR = $(ssd1306_ROOT) 15 | 16 | ssd1306_CFLAGS = -DSSD1306_I2C_SUPPORT=${SSD1306_I2C_SUPPORT} -DSSD1306_SPI4_SUPPORT=${SSD1306_SPI4_SUPPORT} -DSSD1306_SPI3_SUPPORT=${SSD1306_SPI3_SUPPORT} $(CFLAGS) 17 | 18 | 19 | $(eval $(call component_compile_rules,ssd1306)) 20 | -------------------------------------------------------------------------------- /extras/ssd1306/config.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXTRAS_SSD1306_CONFIG_H_ 2 | #define _EXTRAS_SSD1306_CONFIG_H_ 3 | 4 | #ifndef SSD1306_I2C_SUPPORT 5 | #define SSD1306_I2C_SUPPORT 1 6 | #endif 7 | 8 | #ifndef SSD1306_SPI4_SUPPORT 9 | #define SSD1306_SPI4_SUPPORT 1 10 | #endif 11 | 12 | #ifndef SSD1306_SPI3_SUPPORT 13 | #define SSD1306_SPI3_SUPPORT 1 14 | #endif 15 | 16 | #endif /* _EXTRAS_SSD1306_CONFIG_H_ */ 17 | -------------------------------------------------------------------------------- /extras/stdin_uart_interrupt/README.txt: -------------------------------------------------------------------------------- 1 | This module adds interrupt driven receive on UART 0. Using semaphores, a thread 2 | calling read(...) when no data is available will block in an RTOS expected 3 | manner until data arrives. 4 | 5 | This allows for a background thread running a serial terminal in your program 6 | for debugging and state inspection consuming no CPU cycles at all. Not using 7 | this module will make that thread while(1) until data arrives. 8 | 9 | No code changes are needed for adding this module, all you need to do is to add 10 | it to EXTRA_COMPONENTS and add the directive configUSE_COUNTING_SEMAPHORES from 11 | FreeRTOSConfig.h in examples/terminal to your project. -------------------------------------------------------------------------------- /extras/stdin_uart_interrupt/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/stdin_uart_interrupt 2 | # 3 | # See examples/terminal for usage. Well, actually there is no need to see it 4 | # for 'usage' as this module is a drop-in replacement for the original polled 5 | # version of reading from the UART. 6 | 7 | INC_DIRS += $(stdin_uart_interrupt_ROOT) 8 | 9 | # args for passing into compile rule generation 10 | stdin_uart_interrupt_SRC_DIR = $(stdin_uart_interrupt_ROOT) 11 | stdin_uart_interrupt_WHOLE_ARCHIVE = yes 12 | 13 | $(eval $(call component_compile_rules,stdin_uart_interrupt)) 14 | -------------------------------------------------------------------------------- /extras/timekeeping/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/timekeeping 2 | 3 | INC_DIRS += $(timekeeping_ROOT) 4 | 5 | # args for passing into compile rule generation 6 | timekeeping_SRC_DIR = $(timekeeping_ROOT) 7 | 8 | $(eval $(call component_compile_rules,timekeeping)) 9 | -------------------------------------------------------------------------------- /extras/timekeeping/tests/quick/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PROGRAM=timekeeping_quick_tests 3 | 4 | EXTRA_COMPONENTS = extras/timekeeping 5 | 6 | include ../../../../common.mk 7 | -------------------------------------------------------------------------------- /extras/timekeeping/tests/slew/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PROGRAM=timekeeping_slew_tests 3 | 4 | EXTRA_COMPONENTS = extras/timekeeping 5 | 6 | include ../../../../common.mk 7 | -------------------------------------------------------------------------------- /extras/timekeeping/tests/sntp-run/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PROGRAM=timekeeping_sntp_run 3 | 4 | # Test the use of extras/timekeeping with LWIP SNTP 5 | 6 | EXTRA_COMPONENTS = extras/timekeeping 7 | 8 | # Can work for broadcast or poll 9 | # (assuming you have NTP broadcast already configured on the network) 10 | 11 | # Broadcast / poll and hosts for poll set in timekeeping_sntp_run.c 12 | # SNTP parameters set at the top of lwipopts.h 13 | 14 | 15 | # To set then only log time difference (rather than correct the clock) 16 | # define TIMEKEEPING_SET_AND_MEASURE_ONLY 17 | 18 | # PROGRAM_CFLAGS = $(CFLAGS) -DTIMEKEEPING_SET_AND_MEASURE_ONLY 19 | 20 | include ../../../../common.mk 21 | -------------------------------------------------------------------------------- /extras/timekeeping/tests/wrap/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PROGRAM=timekeeping_wrap_test 3 | 4 | EXTRA_COMPONENTS = extras/timekeeping 5 | 6 | include ../../../../common.mk 7 | -------------------------------------------------------------------------------- /extras/tsl2561/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/tsl2561 2 | 3 | # Include the TSL2561 driver as "tsl2561/tsl2561.h" 4 | INC_DIRS += $(tsl2561_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | tsl2561_SRC_DIR = $(tsl2561_ROOT) 8 | 9 | $(eval $(call component_compile_rules,tsl2561)) 10 | -------------------------------------------------------------------------------- /extras/tsl4531/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/tsl4531 2 | 3 | # Include the TSL4531 driver as "tsl4531/tsl4531.h" 4 | INC_DIRS += $(tsl4531_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | tsl4531_SRC_DIR = $(tsl4531_ROOT) 8 | 9 | $(eval $(call component_compile_rules,tsl4531)) 10 | -------------------------------------------------------------------------------- /extras/tsoftuart/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/tsoftuart 2 | 3 | # Expected anyone using tsoftuart includes it as 'tsoftuart/tsoftuart.h' 4 | INC_DIRS += $(tsoftuart_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | tsoftuart_INC_DIR = 8 | tsoftuart_SRC_DIR = $(tsoftuart_ROOT) 9 | 10 | $(eval $(call component_compile_rules,tsoftuart)) 11 | -------------------------------------------------------------------------------- /extras/ultrasonic/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ultrasonic 2 | 3 | # expected anyone using this driver includes it as 'ultrasonic/ultrasonic.h' 4 | INC_DIRS += $(ultrasonic_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ultrasonic_SRC_DIR = $(ultrasonic_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ultrasonic)) 10 | -------------------------------------------------------------------------------- /extras/ultrasonic/ultrasonic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Driver for ultrasonic range meters, e.g. HC-SR04, HY-SRF05 and so on 3 | * 4 | * Part of esp-open-rtos 5 | * Copyright (C) 2016 Ruslan V. Uss 6 | * BSD Licensed as described in the file LICENSE 7 | */ 8 | #ifndef EXTRAS_ULTRASONIC_H_ 9 | #define EXTRAS_ULTRASONIC_H_ 10 | 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #define ULTRASONIC_ERROR_PING (-1) 18 | #define ULTRASONIC_ERROR_PING_TIMEOUT (-2) 19 | #define ULTRASONIC_ERROR_ECHO_TIMEOUT (-3) 20 | 21 | /** 22 | * Device descriptor 23 | */ 24 | typedef struct 25 | { 26 | uint8_t trigger_pin; 27 | uint8_t echo_pin; 28 | } ultrasonic_sensor_t; 29 | 30 | /** 31 | * Init ranging module 32 | * \param dev Pointer to the device descriptor 33 | */ 34 | void ultrasoinc_init(const ultrasonic_sensor_t *dev); 35 | 36 | /** 37 | * Measure distance 38 | * \param dev Pointer to the device descriptor 39 | * \param max_distance Maximal distance to measure, centimeters 40 | * \return Distance in centimeters or ULTRASONIC_ERROR_xxx if error occured 41 | */ 42 | int32_t ultrasoinc_measure_cm(const ultrasonic_sensor_t *dev, uint32_t max_distance); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* EXTRAS_ULTRASONIC_H_ */ 49 | -------------------------------------------------------------------------------- /extras/wificfg/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/wificfg 2 | 3 | # Expected anyone using wificfg includes it as 'wificfg/wificfg.h' 4 | INC_DIRS += $(wificfg_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | wificfg_INC_DIR = 8 | wificfg_SRC_DIR = $(wificfg_ROOT) 9 | 10 | $(eval $(call component_compile_rules,wificfg)) 11 | -------------------------------------------------------------------------------- /extras/wificfg/content/challenge.html: -------------------------------------------------------------------------------- 1 | "" 2 | "" 3 | "" 4 | "" 5 | "", 6 | "" 7 | "" 8 | "" 9 | "" 10 | "" 19 | "
" 20 | "
" 21 | "Unlock the configuration interface" 22 | "
" 23 | "
" 24 | "
" 26 | "
" 27 | "
" 28 | "
" 29 | "
" 30 | "" 31 | -------------------------------------------------------------------------------- /extras/wificfg/content/script.js: -------------------------------------------------------------------------------- 1 | "HTTP/1.1 200 \r\n" 2 | "Content-Type: text/javascript\r\n" 3 | "Cache-Control: max-age=900\r\n" 4 | "Transfer-Encoding: chunked\r\n" 5 | "Connection: close\r\n" 6 | "\r\n", 7 | "function myFunction() { var x = document.getElementById(\"myTopnav\");" 8 | "if (x.className === \"topnav\") { x.className += \" responsive\"; } else { x.className = \"topnav\"; } }" 9 | -------------------------------------------------------------------------------- /extras/wificfg/content/tasks.html: -------------------------------------------------------------------------------- 1 | "" 2 | "" 3 | "" 4 | "" 5 | "", 6 | "" 7 | "" 8 | "" 9 | "" 10 | "", 18 | "" 19 | -------------------------------------------------------------------------------- /extras/ws2812/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ws2812 2 | 3 | INC_DIRS += $(ws2812_ROOT) 4 | 5 | # args for passing into compile rule generation 6 | ws2812_SRC_DIR = $(ws2812_ROOT) 7 | 8 | $(eval $(call component_compile_rules,ws2812)) -------------------------------------------------------------------------------- /extras/ws2812/ws2812.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ws2812b.c 3 | * @brief ESP8266 driver for WS2812B 4 | * @author Ondřej Hruška, (c) 2016 5 | * 6 | * MIT License 7 | */ 8 | 9 | #include "espressif/esp_common.h" // sdk_os_delay_us 10 | #include "FreeRTOS.h" 11 | #include "task.h" 12 | #include 13 | 14 | #include "ws2812.h" 15 | 16 | 17 | /** Set one RGB LED color */ 18 | void ws2812_set(uint8_t gpio_num, uint32_t rgb) 19 | { 20 | ws2812_seq_start(); 21 | ws2812_seq_rgb(gpio_num, rgb); 22 | ws2812_seq_end(); 23 | } 24 | 25 | 26 | /** Set many RGBs */ 27 | void ws2812_set_many(uint8_t gpio_num, uint32_t *rgbs, size_t count) 28 | { 29 | ws2812_seq_start(); 30 | 31 | for (size_t i = 0; i < count; i++) { 32 | uint32_t rgb = *rgbs++; 33 | ws2812_seq_rgb(gpio_num, rgb); 34 | } 35 | 36 | ws2812_seq_end(); 37 | } 38 | 39 | 40 | /** Set one RGB to black (when used as indicator) */ 41 | void ws2812_off(uint8_t gpio_num) 42 | { 43 | ws2812_set(gpio_num, 0x000000); 44 | } 45 | -------------------------------------------------------------------------------- /extras/ws2812_i2s/README.md: -------------------------------------------------------------------------------- 1 | # WS2812 led driver 2 | 3 | This driver uses I2S and DMA subsystems to drive WS2812 leds. 4 | The idea to use I2S to control WS2812 leds belongs to [CNLohr](https://github.com/CNLohr). 5 | 6 | ## Pros 7 | 8 | * Not using CPU to generate pulses. 9 | * Interrupt neutral. Reliable operation even with high network load. 10 | 11 | ## Cons 12 | 13 | * Using RAM for DMA buffer. 12 bytes per pixel. 14 | * Can not change output PIN. Use I2S DATA output pin which is GPIO3. 15 | 16 | -------------------------------------------------------------------------------- /extras/ws2812_i2s/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for extras/ws2812_i2s 2 | 3 | # expected anyone using ws2812_i2s driver includes it as 'ws2812_i2s/ws2812_i2s.h' 4 | INC_DIRS += $(ws2812_i2s_ROOT).. 5 | 6 | # args for passing into compile rule generation 7 | ws2812_i2s_SRC_DIR = $(ws2812_i2s_ROOT) 8 | 9 | $(eval $(call component_compile_rules,ws2812_i2s)) 10 | -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | private_ssid_config.h 2 | -------------------------------------------------------------------------------- /include/espressif/esp8266/esp8266.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 - 2016 Espressif System 3 | * 4 | */ 5 | 6 | #ifndef __ESP8266_H__ 7 | #define __ESP8266_H__ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #include "ets_sys.h" 14 | #include "eagle_soc.h" 15 | #include "gpio_register.h" 16 | #include "pin_mux_register.h" 17 | #include "spi_register.h" 18 | #include "timer_register.h" 19 | #include "uart_register.h" 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /include/espressif/esp8266/ets_sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2008 - 2011 Espressif System 3 | * 4 | * Define user specified Event signals and Task priorities here 5 | * 6 | */ 7 | 8 | #ifndef __ETS_SYS_H__ 9 | #define __ETS_SYS_H__ 10 | 11 | /* interrupt related */ 12 | #define ETS_SPI_INUM 2 13 | #define ETS_GPIO_INUM 4 14 | #define ETS_UART_INUM 5 15 | #define ETS_MAX_INUM 6 16 | #define ETS_SOFT_INUM 7 17 | #define ETS_WDT_INUM 8 18 | #define ETS_FRC_TIMER1_INUM 9 19 | 20 | #endif /* _ETS_SYS_H */ 21 | -------------------------------------------------------------------------------- /include/espressif/esp_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 -2014 Espressif System 3 | * 4 | */ 5 | 6 | #ifndef __ESP_COMMON_H__ 7 | #define __ESP_COMMON_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "esp_misc.h" 14 | #include "esp_wifi.h" 15 | #include "esp_softap.h" 16 | #include "esp_sta.h" 17 | #include "esp_system.h" 18 | #include "esp_timer.h" 19 | 20 | #include "esp8266/esp8266.h" 21 | 22 | #include "spi_flash.h" 23 | #endif 24 | -------------------------------------------------------------------------------- /include/espressif/esp_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 -2014 Espressif System 3 | * 4 | */ 5 | 6 | #ifndef __ESP_MISC_H__ 7 | #define __ESP_MISC_H__ 8 | 9 | #include "lwip/ip_addr.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] 16 | #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" 17 | 18 | #define IP2STR(ipaddr) ip4_addr1_16(ipaddr), \ 19 | ip4_addr2_16(ipaddr), \ 20 | ip4_addr3_16(ipaddr), \ 21 | ip4_addr4_16(ipaddr) 22 | 23 | #define IPSTR "%d.%d.%d.%d" 24 | 25 | void sdk_os_delay_us(uint16_t us); 26 | 27 | void sdk_os_install_putc1(void (*p)(char c)); 28 | void sdk_os_putc(char c); 29 | 30 | void sdk_gpio_output_set(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/espressif/esp_softap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 -2014 Espressif System 3 | * 4 | */ 5 | 6 | #ifndef __ESP_SOFTAP_H__ 7 | #define __ESP_SOFTAP_H__ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | struct sdk_softap_config { 14 | uint8_t ssid[32]; 15 | uint8_t password[64]; 16 | uint8_t ssid_len; 17 | uint8_t channel; 18 | AUTH_MODE authmode; 19 | uint8_t ssid_hidden; 20 | uint8_t max_connection; 21 | uint16_t beacon_interval; 22 | }; 23 | 24 | bool sdk_wifi_softap_get_config(struct sdk_softap_config *config); 25 | bool sdk_wifi_softap_set_config(struct sdk_softap_config *config); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/espressif/esp_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 -2014 Espressif System 3 | * 4 | */ 5 | 6 | #ifndef __ESP_TIMER_H__ 7 | #define __ESP_TIMER_H__ 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /* timer related */ 14 | typedef void sdk_os_timer_func_t(void *timer_arg); 15 | 16 | typedef struct _os_timer_t { 17 | struct _os_timer_t *timer_next; 18 | void *freerots_handle; 19 | uint32_t timer_expire; 20 | uint32_t timer_period; 21 | sdk_os_timer_func_t *timer_func; 22 | bool timer_repeat_flag; 23 | void *timer_arg; 24 | } sdk_os_timer_t; 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/espressif/osapi.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSAPI_H_ 2 | #define _OSAPI_H_ 3 | 4 | void sdk_os_timer_setfn(ETSTimer *ptimer, ETSTimerFunc *pfunction, void *parg); 5 | void sdk_os_timer_arm(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag); 6 | void sdk_os_timer_disarm(ETSTimer *ptimer); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/espressif/sdk_private.h: -------------------------------------------------------------------------------- 1 | /* sdk_private.h 2 | 3 | This source file contains function prototypes for "private" but 4 | useful functions defined in the "binary blob" ESP IoT RTOS SDK libraries. 5 | 6 | For the "public" API, check the esp_common header file and the various 7 | sub-headers it includes. 8 | 9 | Function names here have the 'sdk_' prefix that is attached to all 10 | binary library symbols by the esp-open-rtos build process. 11 | 12 | This file is a part of esp-open-rtos. 13 | */ 14 | #ifndef SDK_PRIVATE_H 15 | #define SDK_PRIVATE_H 16 | 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | struct ip4_addr; 24 | 25 | /********************************************* 26 | * Defined in libmain.a 27 | ********************************************* 28 | */ 29 | 30 | /* Change UART divider without re-initialising UART. 31 | 32 | uart_no = 0 or 1 for which UART 33 | new_divisor = Calculated in the form UART_CLK_FREQ / BAUD 34 | */ 35 | void sdk_uart_div_modify(uint32_t uart_no, uint32_t new_divisor); 36 | 37 | /* Read a single character from the UART. 38 | Returns 0 on success, 1 if no character in fifo 39 | */ 40 | int sdk_uart_rx_one_char(char *buf); 41 | 42 | /* Write a single character to the UART. 43 | */ 44 | void sdk_os_putc(char c); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/espressif/user_interface.h: -------------------------------------------------------------------------------- 1 | #ifndef __USER_INTERFACE_H__ 2 | #define __USER_INTERFACE_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "espressif/esp_wifi.h" 8 | 9 | enum sdk_dhcp_status { 10 | DHCP_STOPPED, 11 | DHCP_STARTED 12 | }; 13 | 14 | uint8_t sdk_system_get_boot_version(void); 15 | uint32_t sdk_system_get_userbin_addr(void); 16 | uint8_t sdk_system_get_boot_mode(void); 17 | bool sdk_system_restart_enhance(uint8_t bin_type, uint32_t bin_addr); 18 | bool sdk_system_upgrade_userbin_set(uint8_t userbin); 19 | uint8_t sdk_system_upgrade_userbin_check(void); 20 | bool sdk_system_upgrade_flag_set(uint8_t flag); 21 | uint8_t sdk_system_upgrade_flag_check(void); 22 | bool sdk_system_upgrade_reboot(void); 23 | bool sdk_wifi_station_dhcpc_start(void); 24 | bool sdk_wifi_station_dhcpc_stop(void); 25 | enum sdk_dhcp_status sdk_wifi_station_dhcpc_status(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/ssid_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Why this file? 3 | // 4 | // We all need to add our personal SSID/password to each ESP project but we 5 | // do not want that information pushed to Github. This file solves that 6 | // problem. Create an include/private_ssid_config.h file with the following two 7 | // definitions uncommented: 8 | // 9 | // #define WIFI_SSID "mywifissid" 10 | // #define WIFI_PASS "my secret password" 11 | // 12 | 13 | #ifndef __SSID_CONFIG_H__ 14 | #define __SSID_CONFIG_H__ 15 | 16 | #include "private_ssid_config.h" 17 | 18 | #endif // __SSID_CONFIG_H__ 19 | -------------------------------------------------------------------------------- /lib/libgcc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libgcc.a -------------------------------------------------------------------------------- /lib/libgcc.remove: -------------------------------------------------------------------------------- 1 | # Object files to be removed from libgcc 2 | # These are provided by the ROM. 3 | _addsubdf3.o 4 | _addsubsf3.o 5 | _divdf3.o 6 | _divdi3.o 7 | _divsi3.o 8 | _extendsfdf2.o 9 | _fixdfsi.o 10 | _fixunssfsi.o 11 | _floatsidf.o 12 | _floatsisf.o 13 | _floatunsidf.o 14 | _floatunsisf.o 15 | _muldf3.o 16 | _muldi3.o 17 | _mulsf3.o 18 | _subdf3.o 19 | _subsf3.o 20 | _truncdfsf2.o 21 | _udivdi3.o 22 | _umoddi3.o 23 | _umodsi3.o 24 | _umulsidi3.o 25 | -------------------------------------------------------------------------------- /lib/libmain.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libmain.a -------------------------------------------------------------------------------- /lib/libmain.remove: -------------------------------------------------------------------------------- 1 | # Object files to be removed from libmain 2 | printf-stdarg.o 3 | libc.o 4 | xtensa_vectors.o 5 | app_main.o 6 | ets_timer.o 7 | -------------------------------------------------------------------------------- /lib/libnet80211.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libnet80211.a -------------------------------------------------------------------------------- /lib/libnet80211.remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libnet80211.remove -------------------------------------------------------------------------------- /lib/libphy.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libphy.a -------------------------------------------------------------------------------- /lib/libphy.remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libphy.remove -------------------------------------------------------------------------------- /lib/libpp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libpp.a -------------------------------------------------------------------------------- /lib/libpp.remove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libpp.remove -------------------------------------------------------------------------------- /lib/libwpa.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/lib/libwpa.a -------------------------------------------------------------------------------- /lib/libwpa.remove: -------------------------------------------------------------------------------- 1 | # Object files to be removed from libwpa 2 | os_xtensa.o 3 | -------------------------------------------------------------------------------- /libc/README.md: -------------------------------------------------------------------------------- 1 | Newlib from git://sourceware.org/git/newlib-cygwin.git with xtensa & locking patches see https://github.com/ourairquality/newlib and built from commit 984b749fb223daab954060c04720933290584f00 2 | 3 | The build commands were: 4 | 5 | mkdir build 6 | cd build 7 | ../configure --with-newlib --enable-multilib --disable-newlib-io-c99-formats --enable-newlib-supplied-syscalls --enable-target-optspace --program-transform-name="s&^&xtensa-lx106-elf-&" --disable-option-checking --with-target-subdir=xtensa-lx106-elf --target=xtensa-lx106-elf --enable-newlib-nano-malloc --enable-newlib-nano-formatted-io --enable-newlib-reent-small --disable-newlib-mb --enable-newlib-global-stdio-streams --prefix=/tmp/libc 8 | env CROSS_CFLAGS="-DSIGNAL_PROVIDED -DABORT_PROVIDED" make 9 | make install 10 | -------------------------------------------------------------------------------- /libc/libc.remove: -------------------------------------------------------------------------------- 1 | # Object files to remove from libc.a 2 | # These are provided by the ROM. 3 | lib_a-bzero.o 4 | lib_a-memcmp.o 5 | lib_a-memcpy.o 6 | lib_a-memmove.o 7 | lib_a-memset.o 8 | lib_a-strcmp.o 9 | lib_a-strcpy.o 10 | lib_a-strlen.o 11 | lib_a-strncmp.o 12 | lib_a-strncpy.o 13 | lib_a-strstr.o 14 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/_newlib_version.h: -------------------------------------------------------------------------------- 1 | /* _newlib_version.h. Generated from _newlib_version.hin by configure. */ 2 | /* Version macros for internal and downstream use. */ 3 | #ifndef _NEWLIB_VERSION_H__ 4 | #define _NEWLIB_VERSION_H__ 1 5 | 6 | #define _NEWLIB_VERSION "3.0.0" 7 | #define __NEWLIB__ 3 8 | #define __NEWLIB_MINOR__ 0 9 | #define __NEWLIB_PATCHLEVEL__ 0 10 | 11 | #endif /* !_NEWLIB_VERSION_H__ */ 12 | 13 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/_syslist.h: -------------------------------------------------------------------------------- 1 | /* internal use only -- mapping of "system calls" for libraries that lose 2 | and only provide C names, so that we end up in violation of ANSI */ 3 | #ifndef __SYSLIST_H 4 | #define __SYSLIST_H 5 | 6 | #ifdef MISSING_SYSCALL_NAMES 7 | #define _close close 8 | #define _execve execve 9 | #define _fcntl fcntl 10 | #define _fork fork 11 | #define _fstat fstat 12 | #define _getpid getpid 13 | #define _gettimeofday gettimeofday 14 | #define _isatty isatty 15 | #define _kill kill 16 | #define _link link 17 | #define _lseek lseek 18 | #define _mkdir mkdir 19 | #define _open open 20 | #define _read read 21 | #define _sbrk sbrk 22 | #define _stat stat 23 | #define _times times 24 | #define _unlink unlink 25 | #define _wait wait 26 | #define _write write 27 | #endif /* MISSING_SYSCALL_NAMES */ 28 | 29 | #if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR 30 | /* If the system call interface is missing opendir, readdir, and 31 | closedir, there is an implementation of these functions in 32 | libc/posix that is implemented using open, getdents, and close. 33 | Note, these functions are currently not in the libc/syscalls 34 | directory. */ 35 | #define _opendir opendir 36 | #define _readdir readdir 37 | #define _closedir closedir 38 | #endif /* MISSING_SYSCALL_NAMES || !HAVE_OPENDIR */ 39 | 40 | #endif /* !__SYSLIST_H_ */ 41 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/alloca.h: -------------------------------------------------------------------------------- 1 | /* libc/include/alloca.h - Allocate memory on stack */ 2 | 3 | /* Written 2000 by Werner Almesberger */ 4 | /* Rearranged for general inclusion by stdlib.h. 5 | 2001, Corinna Vinschen */ 6 | 7 | #ifndef _NEWLIB_ALLOCA_H 8 | #define _NEWLIB_ALLOCA_H 9 | 10 | #include "_ansi.h" 11 | #include 12 | 13 | #undef alloca 14 | 15 | #ifdef __GNUC__ 16 | #define alloca(size) __builtin_alloca(size) 17 | #else 18 | void * alloca (size_t); 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | assert.h 3 | */ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | #include "_ansi.h" 10 | 11 | #undef assert 12 | 13 | #ifdef NDEBUG /* required by ANSI standard */ 14 | # define assert(__e) ((void)0) 15 | #else 16 | # define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \ 17 | __ASSERT_FUNC, #__e)) 18 | 19 | # ifndef __ASSERT_FUNC 20 | /* Use g++'s demangled names in C++. */ 21 | # if defined __cplusplus && defined __GNUC__ 22 | # define __ASSERT_FUNC __PRETTY_FUNCTION__ 23 | 24 | /* C99 requires the use of __func__. */ 25 | # elif __STDC_VERSION__ >= 199901L 26 | # define __ASSERT_FUNC __func__ 27 | 28 | /* Older versions of gcc don't have __func__ but can use __FUNCTION__. */ 29 | # elif __GNUC__ >= 2 30 | # define __ASSERT_FUNC __FUNCTION__ 31 | 32 | /* failed to detect __func__ support. */ 33 | # else 34 | # define __ASSERT_FUNC ((char *) 0) 35 | # endif 36 | # endif /* !__ASSERT_FUNC */ 37 | #endif /* !NDEBUG */ 38 | 39 | void __assert (const char *, int, const char *) 40 | _ATTRIBUTE ((__noreturn__)); 41 | void __assert_func (const char *, int, const char *, const char *) 42 | _ATTRIBUTE ((__noreturn__)); 43 | 44 | #if __STDC_VERSION__ >= 201112L && !defined __cplusplus 45 | # define static_assert _Static_assert 46 | #endif 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/cpio.h: -------------------------------------------------------------------------------- 1 | /* POSIX.1 symbolic constants for c_mode field of cpio archive format */ 2 | 3 | #ifndef _CPIO_H 4 | #define _CPIO_H 5 | 6 | #define C_IRUSR 0000400 /* Read by owner */ 7 | #define C_IWUSR 0000200 /* Write by owner */ 8 | #define C_IXUSR 0000100 /* Execute by owner */ 9 | #define C_IRGRP 0000040 /* Read by group */ 10 | #define C_IWGRP 0000020 /* Write by group */ 11 | #define C_IXGRP 0000010 /* Execute by group */ 12 | #define C_IROTH 0000004 /* Read by others */ 13 | #define C_IWOTH 0000002 /* Write by others */ 14 | #define C_IXOTH 0000001 /* Execute by others */ 15 | #define C_ISUID 0004000 /* Set user ID */ 16 | #define C_ISGID 0002000 /* Set group ID */ 17 | #define C_ISVTX 0001000 /* On directories, restricted deletion flag */ 18 | 19 | #define C_ISDIR 0040000 /* Directory */ 20 | #define C_ISFIFO 0010000 /* FIFO */ 21 | #define C_ISREG 0100000 /* Regular file */ 22 | #define C_ISBLK 0060000 /* Block special */ 23 | #define C_ISCHR 0020000 /* Character special */ 24 | #define C_ISCTG 0110000 /* Reserved */ 25 | #define C_ISLNK 0120000 /* Symbolic link */ 26 | #define C_ISSOCK 0140000 /* Socket */ 27 | 28 | #define MAGIC "070707" 29 | 30 | #endif /* _CPIO_H */ 31 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef _DIRENT_H_ 2 | #define _DIRENT_H_ 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | #include 7 | #include 8 | 9 | #if !defined(MAXNAMLEN) && __BSD_VISIBLE 10 | #define MAXNAMLEN 1024 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | #endif /*_DIRENT_H_*/ 17 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/envlock.h: -------------------------------------------------------------------------------- 1 | /* envlock.h -- header file for env routines. */ 2 | 3 | #ifndef _INCLUDE_ENVLOCK_H_ 4 | #define _INCLUDE_ENVLOCK_H_ 5 | 6 | #include <_ansi.h> 7 | #include 8 | 9 | #define ENV_LOCK __env_lock(reent_ptr) 10 | #define ENV_UNLOCK __env_unlock(reent_ptr) 11 | 12 | void __env_lock (struct _reent *reent); 13 | void __env_unlock (struct _reent *reent); 14 | 15 | #endif /* _INCLUDE_ENVLOCK_H_ */ 16 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/envz.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. 2 | * 3 | * Permission to use, copy, modify, and distribute this software 4 | * is freely granted, provided that this notice is preserved. 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | /* The newlib implementation of these functions assumes that sizeof(char) == 1. */ 11 | char * envz_entry (const char *envz, size_t envz_len, const char *name); 12 | char * envz_get (const char *envz, size_t envz_len, const char *name); 13 | error_t envz_add (char **envz, size_t *envz_len, const char *name, const char *value); 14 | error_t envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, int override); 15 | void envz_remove(char **envz, size_t *envz_len, const char *name); 16 | void envz_strip (char **envz, size_t *envz_len); 17 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef __ERRNO_H__ 2 | #define __ERRNO_H__ 3 | 4 | #ifndef __error_t_defined 5 | typedef int error_t; 6 | #define __error_t_defined 1 7 | #endif 8 | 9 | #include 10 | 11 | #endif /* !__ERRNO_H__ */ 12 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/fastmath.h: -------------------------------------------------------------------------------- 1 | #ifndef _FASTMATH_H_ 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _FASTMATH_H_ 6 | 7 | #include 8 | #include 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | #endif /* _FASTMATH_H_ */ 14 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/fcntl.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/libgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libgen.h - defined by XPG4 3 | */ 4 | 5 | #ifndef _LIBGEN_H_ 6 | #define _LIBGEN_H_ 7 | 8 | #include "_ansi.h" 9 | #include 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /* There are two common basename variants. If you do NOT #include 17 | and you do 18 | 19 | #define _GNU_SOURCE 20 | #include 21 | 22 | you get the GNU version. Otherwise you get the POSIX versionfor which you 23 | should #include i for the function prototype. POSIX requires that 24 | #undef basename will still let you invoke the underlying function. However, 25 | this also implies that the POSIX version is used in this case. That's made 26 | sure here. */ 27 | #undef basename 28 | #define basename __xpg_basename 29 | char *basename (char *) __asm__(__ASMNAME("basename")); 30 | char *dirname (char *); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* _LIBGEN_H_ */ 37 | 38 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/_arc4random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | 17 | #include 18 | 19 | __BEGIN_DECLS 20 | 21 | void _arc4random_getentropy_fail(void); 22 | 23 | #define _ARC4RANDOM_DATA 24 | 25 | #define _ARC4RANDOM_GETENTROPY_FAIL() _arc4random_getentropy_fail() 26 | 27 | #define _ARC4RANDOM_ALLOCATE(rsp, rsxp) \ 28 | do { *rsp = malloc(sizeof(**rsp)); \ 29 | *rsxp = malloc(sizeof(**rsxp)); } \ 30 | while (0) 31 | 32 | __END_DECLS 33 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/_endian.h: -------------------------------------------------------------------------------- 1 | #ifndef __MACHINE_ENDIAN_H__ 2 | #error "must be included via " 3 | #endif /* !__MACHINE_ENDIAN_H__ */ 4 | 5 | #include 6 | 7 | #ifdef __PPC__ 8 | /* Get rid of GCC builtin defines on PowerPC */ 9 | #ifdef _BIG_ENDIAN 10 | #undef _BIG_ENDIAN 11 | #endif 12 | #ifdef _LITTLE_ENDIAN 13 | #undef _LITTLE_ENDIAN 14 | #endif 15 | #endif /* __PPC__ */ 16 | 17 | #ifndef _LITTLE_ENDIAN 18 | #define _LITTLE_ENDIAN 1234 19 | #endif 20 | 21 | #ifndef _BIG_ENDIAN 22 | #define _BIG_ENDIAN 4321 23 | #endif 24 | 25 | #ifndef _PDP_ENDIAN 26 | #define _PDP_ENDIAN 3412 27 | #endif 28 | 29 | #ifndef _BYTE_ORDER 30 | #if defined(__IEEE_LITTLE_ENDIAN) || defined(__IEEE_BYTES_LITTLE_ENDIAN) 31 | #define _BYTE_ORDER _LITTLE_ENDIAN 32 | #else 33 | #define _BYTE_ORDER _BIG_ENDIAN 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/_time.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIME_H_ 2 | #error "must be included via " 3 | #endif /* !_SYS_TIME_H_ */ 4 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | #ifndef _MACHINE__TYPES_H 6 | #define _MACHINE__TYPES_H 7 | #include 8 | #endif 9 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/ansi.h: -------------------------------------------------------------------------------- 1 | /* dummy header file to support BSD compiler */ 2 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/malloc.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHMALLOC_H_ 2 | #define _MACHMALLOC_H_ 3 | 4 | /* place holder so platforms may add malloc.h extensions */ 5 | 6 | #endif /* _MACHMALLOC_H_ */ 7 | 8 | 9 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/param.h: -------------------------------------------------------------------------------- 1 | /* Place holder for machine-specific param.h. */ 2 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/setjmp-dj.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1991 DJ Delorie 3 | * All rights reserved. 4 | * 5 | * Redistribution, modification, and use in source and binary forms is permitted 6 | * provided that the above copyright notice and following paragraph are 7 | * duplicated in all such forms. 8 | * 9 | * This file is distributed WITHOUT ANY WARRANTY; without even the implied 10 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | */ 12 | 13 | /* Modified to use SETJMP_DJ_H rather than SETJMP_H to avoid 14 | conflicting with setjmp.h. Ian Taylor, Cygnus support, April, 15 | 1993. */ 16 | 17 | #ifndef _SETJMP_DJ_H_ 18 | #define _SETJMP_DJ_H_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct { 25 | unsigned long eax; 26 | unsigned long ebx; 27 | unsigned long ecx; 28 | unsigned long edx; 29 | unsigned long esi; 30 | unsigned long edi; 31 | unsigned long ebp; 32 | unsigned long esp; 33 | unsigned long eip; 34 | } jmp_buf[1]; 35 | 36 | extern int setjmp(jmp_buf); 37 | extern void longjmp(jmp_buf, int); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHSTDLIB_H_ 2 | #define _MACHSTDLIB_H_ 3 | 4 | /* place holder so platforms may add stdlib.h extensions */ 5 | 6 | #endif /* _MACHSTDLIB_H_ */ 7 | 8 | 9 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/termios.h: -------------------------------------------------------------------------------- 1 | #define __MAX_BAUD B4000000 2 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/time.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHTIME_H_ 2 | #define _MACHTIME_H_ 3 | 4 | #if defined(__rtems__) || defined(__VISIUM__) || defined(__riscv) 5 | #define _CLOCKS_PER_SEC_ 1000000 6 | #elif defined(__aarch64__) || defined(__arm__) || defined(__thumb__) 7 | #define _CLOCKS_PER_SEC_ 100 8 | #endif 9 | 10 | #ifdef __SPU__ 11 | #include 12 | int nanosleep (const struct timespec *, struct timespec *); 13 | #endif 14 | 15 | #endif /* _MACHTIME_H_ */ 16 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/machine/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Newlib targets may provide an own version of this file in their machine 3 | * directory to add custom user types for . 4 | */ 5 | #ifndef _SYS_TYPES_H 6 | #error "must be included via " 7 | #endif /* !_SYS_TYPES_H */ 8 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/memory.h: -------------------------------------------------------------------------------- 1 | #ifndef _MEMORY_H 2 | #define _MEMORY_H 3 | #include 4 | #endif /* !_MEMORY_H */ 5 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/paths.h: -------------------------------------------------------------------------------- 1 | #ifndef _PATHS_H_ 2 | #define _PATHS_H_ 3 | 4 | #define _PATH_DEV "/dev/" 5 | #define _PATH_DEVNULL "/dev/null" 6 | #define _PATH_DEVZERO "/dev/zero" 7 | #define _PATH_BSHELL "/bin/sh" 8 | 9 | #endif /* _PATHS_H_ */ 10 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/regdef.h: -------------------------------------------------------------------------------- 1 | /* regdef.h -- define register names. */ 2 | 3 | /* This is a standard include file for MIPS targets. Other target 4 | probably don't define it, and attempts to include this file will 5 | fail. */ 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | setjmp.h 3 | stubs for future use. 4 | */ 5 | 6 | #ifndef _SETJMP_H_ 7 | #define _SETJMP_H_ 8 | 9 | #include "_ansi.h" 10 | #include 11 | 12 | _BEGIN_STD_C 13 | 14 | #ifdef __GNUC__ 15 | void longjmp (jmp_buf __jmpb, int __retval) 16 | __attribute__ ((__noreturn__)); 17 | #else 18 | void longjmp (jmp_buf __jmpb, int __retval); 19 | #endif 20 | int setjmp (jmp_buf __jmpb); 21 | 22 | _END_STD_C 23 | 24 | #endif /* _SETJMP_H_ */ 25 | 26 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/signal.h: -------------------------------------------------------------------------------- 1 | #ifndef _SIGNAL_H_ 2 | #define _SIGNAL_H_ 3 | 4 | #include "_ansi.h" 5 | #include 6 | #include 7 | 8 | _BEGIN_STD_C 9 | 10 | typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ 11 | #if __BSD_VISIBLE 12 | typedef _sig_func_ptr sig_t; /* BSD naming */ 13 | #endif 14 | #if __GNU_VISIBLE 15 | typedef _sig_func_ptr sighandler_t; /* glibc naming */ 16 | #endif 17 | 18 | #define SIG_DFL ((_sig_func_ptr)0) /* Default action */ 19 | #define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */ 20 | #define SIG_ERR ((_sig_func_ptr)-1) /* Error return */ 21 | 22 | struct _reent; 23 | 24 | _sig_func_ptr _signal_r (struct _reent *, int, _sig_func_ptr); 25 | int _raise_r (struct _reent *, int); 26 | 27 | #ifndef _REENT_ONLY 28 | _sig_func_ptr signal (int, _sig_func_ptr); 29 | int raise (int); 30 | void psignal (int, const char *); 31 | #endif 32 | 33 | _END_STD_C 34 | 35 | #endif /* _SIGNAL_H_ */ 36 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/custom_file.h: -------------------------------------------------------------------------------- 1 | #error System-specific custom_file.h is missing. 2 | 3 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/dir.h: -------------------------------------------------------------------------------- 1 | /* BSD predecessor of POSIX.1 and struct dirent */ 2 | 3 | #ifndef _SYS_DIR_H_ 4 | #define _SYS_DIR_H_ 5 | 6 | #include 7 | 8 | #define direct dirent 9 | 10 | #endif /*_SYS_DIR_H_*/ 11 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/dirent.h: -------------------------------------------------------------------------------- 1 | /* includes , which is this file. On a 2 | system which supports , this file is overridden by 3 | dirent.h in the libc/sys/.../sys directory. On a system which does 4 | not support , we will get this file which uses #error to force 5 | an error. */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | #error " not supported" 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_FCNTL_H_ 2 | #define _SYS_FCNTL_H_ 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/param.h: -------------------------------------------------------------------------------- 1 | /* This is a dummy file, not customized for any 2 | particular system. If there is a param.h in libc/sys/SYSDIR/sys, 3 | it will override this one. */ 4 | 5 | #ifndef _SYS_PARAM_H 6 | # define _SYS_PARAM_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #ifndef NBBY 14 | # define NBBY 8 /* number of bits in a byte */ 15 | #endif 16 | #ifndef HZ 17 | # define HZ (60) 18 | #endif 19 | #ifndef NOFILE 20 | # define NOFILE (60) 21 | #endif 22 | #ifndef PATHSIZE 23 | # define PATHSIZE (1024) 24 | #endif 25 | 26 | #define MAXPATHLEN PATH_MAX 27 | 28 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) 29 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) 30 | 31 | #ifndef howmany 32 | #define howmany(x, y) (((x)+((y)-1))/(y)) 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RESOURCE_H_ 2 | #define _SYS_RESOURCE_H_ 3 | 4 | #include 5 | 6 | #define RUSAGE_SELF 0 /* calling process */ 7 | #define RUSAGE_CHILDREN -1 /* terminated child processes */ 8 | 9 | struct rusage { 10 | struct timeval ru_utime; /* user time used */ 11 | struct timeval ru_stime; /* system time used */ 12 | }; 13 | 14 | int getrusage (int, struct rusage*); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef _NEWLIB_STDIO_H 2 | #define _NEWLIB_STDIO_H 3 | 4 | #include 5 | #include 6 | 7 | /* Internal locking macros, used to protect stdio functions. In the 8 | general case, expand to nothing. Use __SSTR flag in FILE _flags to 9 | detect if FILE is private to sprintf/sscanf class of functions; if 10 | set then do nothing as lock is not initialised. */ 11 | #if !defined(_flockfile) 12 | #ifndef __SINGLE_THREAD__ 13 | # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) 14 | #else 15 | # define _flockfile(fp) ((void) 0) 16 | #endif 17 | #endif 18 | 19 | #if !defined(_funlockfile) 20 | #ifndef __SINGLE_THREAD__ 21 | # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) 22 | #else 23 | # define _funlockfile(fp) ((void) 0) 24 | #endif 25 | #endif 26 | 27 | #endif /* _NEWLIB_STDIO_H */ 28 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/string.h: -------------------------------------------------------------------------------- 1 | /* This is a dummy used as a placeholder for 2 | systems that need to have a special header file. */ 3 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/timeb.h: -------------------------------------------------------------------------------- 1 | /* timeb.h -- An implementation of the standard Unix file. 2 | Written by Ian Lance Taylor 3 | Public domain; no rights reserved. 4 | 5 | declares the structure used by the ftime function, as 6 | well as the ftime function itself. Newlib does not provide an 7 | implementation of ftime. */ 8 | 9 | #ifndef _SYS_TIMEB_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #define _SYS_TIMEB_H 16 | 17 | #include <_ansi.h> 18 | #include 19 | 20 | #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED) 21 | typedef _TIME_T_ time_t; 22 | #define __time_t_defined 23 | #define _TIME_T_DECLARED 24 | #endif 25 | 26 | struct timeb 27 | { 28 | time_t time; 29 | unsigned short millitm; 30 | short timezone; 31 | short dstflag; 32 | }; 33 | 34 | extern int ftime (struct timeb *); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* ! defined (_SYS_TIMEB_H) */ 41 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/times.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_TIMES_H 2 | #ifdef __cplusplus 3 | extern "C" { 4 | #endif 5 | #define _SYS_TIMES_H 6 | 7 | #include <_ansi.h> 8 | #include 9 | 10 | #if !defined(__clock_t_defined) && !defined(_CLOCK_T_DECLARED) 11 | typedef _CLOCK_T_ clock_t; 12 | #define __clock_t_defined 13 | #define _CLOCK_T_DECLARED 14 | #endif 15 | 16 | /* Get Process Times, P1003.1b-1993, p. 92 */ 17 | struct tms { 18 | clock_t tms_utime; /* user time */ 19 | clock_t tms_stime; /* system time */ 20 | clock_t tms_cutime; /* user time, children */ 21 | clock_t tms_cstime; /* system time, children */ 22 | }; 23 | 24 | clock_t times (struct tms *); 25 | #ifdef _COMPILING_NEWLIB 26 | clock_t _times (struct tms *); 27 | #endif 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | #endif /* !_SYS_TIMES_H */ 33 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UTIME_H 2 | #define _SYS_UTIME_H 3 | 4 | /* This is a dummy file, not customized for any 5 | particular system. If there is a utime.h in libc/sys/SYSDIR/sys, 6 | it will override this one. */ 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct utimbuf 13 | { 14 | time_t actime; 15 | time_t modtime; 16 | }; 17 | 18 | #ifdef __cplusplus 19 | }; 20 | #endif 21 | 22 | #endif /* _SYS_UTIME_H */ 23 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/sys/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_WAIT_H 2 | #define _SYS_WAIT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | #define WNOHANG 1 11 | #define WUNTRACED 2 12 | 13 | /* A status looks like: 14 | <1 byte info> <1 byte code> 15 | 16 | == 0, child has exited, info is the exit value 17 | == 1..7e, child has exited, info is the signal number. 18 | == 7f, child has stopped, info was the signal number. 19 | == 80, there was a core dump. 20 | */ 21 | 22 | #define WIFEXITED(w) (((w) & 0xff) == 0) 23 | #define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) 24 | #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) 25 | #define WEXITSTATUS(w) (((w) >> 8) & 0xff) 26 | #define WTERMSIG(w) ((w) & 0x7f) 27 | #define WSTOPSIG WEXITSTATUS 28 | 29 | pid_t wait (int *); 30 | pid_t waitpid (pid_t, int *, int); 31 | 32 | #ifdef _COMPILING_NEWLIB 33 | pid_t _wait (int *); 34 | #endif 35 | 36 | /* Provide prototypes for most of the _ names that are 37 | provided in newlib for some compilers. */ 38 | pid_t _wait (int *); 39 | 40 | #ifdef __cplusplus 41 | }; 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/termios.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | #include 5 | #ifdef __cplusplus 6 | } 7 | #endif 8 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNISTD_H_ 2 | #define _UNISTD_H_ 3 | 4 | # include 5 | 6 | #ifndef L_SET 7 | /* Old BSD names for the same constants; just for compatibility. */ 8 | #define L_SET SEEK_SET 9 | #define L_INCR SEEK_CUR 10 | #define L_XTND SEEK_END 11 | #endif 12 | 13 | #endif /* _UNISTD_H_ */ 14 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/utime.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | #include <_ansi.h> 6 | 7 | /* The utime function is defined in libc/sys//sys if it exists. */ 8 | #include 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/utmp.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | #include 5 | #ifdef __cplusplus 6 | } 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/include/xlocale.h: -------------------------------------------------------------------------------- 1 | /* Definition of opaque POSIX-1.2008 type locale_t for userspace. */ 2 | 3 | #ifndef _XLOCALE_H 4 | #define _XLOCALE_H 5 | 6 | #include 7 | #include 8 | 9 | struct __locale_t; 10 | typedef struct __locale_t *locale_t; 11 | 12 | #endif /* _XLOCALE_H */ 13 | -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/lib/crt0.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/libc/xtensa-lx106-elf/lib/crt0.o -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/lib/libc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/libc/xtensa-lx106-elf/lib/libc.a -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/lib/libg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/libc/xtensa-lx106-elf/lib/libg.a -------------------------------------------------------------------------------- /libc/xtensa-lx106-elf/lib/libm.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperHouse/esp-open-rtos/503e66a500419e8863998b7ea784c5e26a7a5f7c/libc/xtensa-lx106-elf/lib/libm.a -------------------------------------------------------------------------------- /lvgl/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for lvgl/lvgl 2 | 3 | # expected anyone using this driver includes it as 'lvgl/lvgl.h' 4 | INC_DIRS += $(lvgl_ROOT) 5 | 6 | # args for passing into compile rule generation 7 | lvgl_SRC_DIR = $(lvgl_ROOT) \ 8 | $(lvgl_ROOT)/lvgl \ 9 | $(lvgl_ROOT)/lvgl/lv_core \ 10 | $(lvgl_ROOT)/lvgl/lv_draw \ 11 | $(lvgl_ROOT)/lvgl/lv_hal \ 12 | $(lvgl_ROOT)/lvgl/lv_misc \ 13 | $(lvgl_ROOT)/lvgl/lv_fonts \ 14 | $(lvgl_ROOT)/lvgl/lv_objx \ 15 | $(lvgl_ROOT)/lvgl/lv_themes \ 16 | $(lvgl_ROOT)/lv_drivers/display \ 17 | $(lvgl_ROOT)/lv_drivers/indev 18 | 19 | LVGL_DIR := $(dir $(lastword $(MAKEFILE_LIST))) 20 | 21 | #EXTRA_CFLAGS += -DLV_CONF_INCLUDE_SIMPLE=1 22 | 23 | #include $(LVGL_DIR)defaults.mk 24 | # 25 | #fonts_CFLAGS = $(CFLAGS) \ 26 | -DLV_HOR_RES=$(LV_HOR_RES) \ 27 | -DLV_VER_RES=$(LV_VER_RES) \ 28 | -DLV_DPI=$(LV_DPI) \ 29 | -DLV_VDB_SIZE=$(LV_VDB_SIZE) \ 30 | -DLV_VDB_ADR=$(LV_VDB_ADR) \ 31 | -DLV_VDB_DOUBLE=$(LV_VDB_DOUBLE) \ 32 | -DLV_VDB2_ADR=$(LV_VDB2_ADR) \ 33 | -DLV_ANTIALIAS=$(LV_ANTIALIAS) \ 34 | -DLV_FONT_ANTIALIAS=$(LV_FONT_ANTIALIAS) \ 35 | -DLV_REFR_PERIOD=$(LV_REFR_PERIOD) 36 | 37 | $(eval $(call component_compile_rules,lvgl)) 38 | -------------------------------------------------------------------------------- /lvgl/lv_conf.h: -------------------------------------------------------------------------------- 1 | 2 | /* Use the defaults for everything else */ 3 | #include_next 4 | -------------------------------------------------------------------------------- /lvgl/lv_drv_conf.h: -------------------------------------------------------------------------------- 1 | 2 | /* Use the defaults for everything else */ 3 | #include_next 4 | -------------------------------------------------------------------------------- /lwip/component.mk: -------------------------------------------------------------------------------- 1 | # Component makefile for LWIP 2 | 3 | LWIP_DIR = $(lwip_ROOT)lwip/src/ 4 | INC_DIRS += $(LWIP_DIR)include $(ROOT)lwip/include $(lwip_ROOT)include $(LWIP_DIR)include/compat/posix $(LWIP_DIR)include/ipv4 $(LWIP_DIR)include/ipv4/lwip $(LWIP_DIR)include/lwip 5 | 6 | # args for passing into compile rule generation 7 | lwip_INC_DIR = # all in INC_DIRS, needed for normal operation 8 | lwip_SRC_DIR = $(lwip_ROOT) $(LWIP_DIR)api $(LWIP_DIR)core $(LWIP_DIR)core/ipv4 $(LWIP_DIR)core/ipv6 $(LWIP_DIR)netif 9 | lwip_SRC_DIR += $(LWIP_DIR)apps/* 10 | 11 | $(eval $(call component_compile_rules,lwip)) 12 | 13 | # Helpful error if git submodule not initialised 14 | $(lwip_SRC_DIR): 15 | $(error "LWIP git submodule not installed. Please run 'git submodule init' then 'git submodule update'") 16 | 17 | -------------------------------------------------------------------------------- /lwip/include/netbuf_helpers.h: -------------------------------------------------------------------------------- 1 | /* Some netbuf helpers that should probably be rolled into a patch to lwip soon */ 2 | #ifndef _NETBUF_HELPERS_H 3 | #define _NETBUF_HELPERS_H 4 | #include "lwip/netbuf.h" 5 | 6 | /* Read a 16 bit wide unsigned integer, stored host order, from the netbuf */ 7 | inline static u16_t netbuf_read_u16_h(struct netbuf *netbuf, u16_t offs) 8 | { 9 | u16_t raw; 10 | netbuf_copy_partial(netbuf, &raw, 2, offs); 11 | return raw; 12 | } 13 | 14 | /* Read a 16 bit wide unsigned integer, stored network order, from the netbuf */ 15 | inline static u16_t netbuf_read_u16_n(struct netbuf *netbuf, u16_t offs) 16 | { 17 | return ntohs(netbuf_read_u16_h(netbuf, offs)); 18 | } 19 | 20 | /* Read an 8 bit unsigned integer from the netbuf */ 21 | inline static u8_t netbuf_read_u8(struct netbuf *netbuf, u16_t offs) 22 | { 23 | u8_t result; 24 | netbuf_copy_partial(netbuf, &result, 1, offs); 25 | return result; 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /open_esplibs/README.md: -------------------------------------------------------------------------------- 1 | # Open Espressif Libs 2 | 3 | These are functional recreations of the MIT licensed binary Espressif SDK libraries found in `lib`. They keep the same functionality as the SDK libraries (possibly with bugfixes or other minor tweaks), but are compiled from source. 4 | 5 | Most of the reverse engineering work so far has been by Alex Stewart (@foogod). 6 | 7 | See http://esp8266-re.foogod.com/wiki/ for more technical details of SDK library internals. 8 | 9 | # Disabling 10 | 11 | The open ESP libs are compiled in by default, and they automatically replace any binary SDK symbols (functions, etc.) with the same names. 12 | 13 | To compile using the binary SDK libraries only, override the COMPONENTS list in parameters.mk to remove the open_esplibs component, or add -DOPEN_ESPLIBS=0 to CPPFLAGS. 14 | 15 | To selectively replace some functionality with binary SDK functionality for debugging, edit the header file open_esplibs/include/open_esplibs.h 16 | -------------------------------------------------------------------------------- /open_esplibs/libmain/uart.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libmain uart.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBMAIN_UART 8 | // The contents of this file are only built if OPEN_LIBMAIN_UART is set to true 9 | 10 | #include "espressif/sdk_private.h" 11 | #include "esp/uart_regs.h" 12 | 13 | void sdk_uart_buff_switch(void) { 14 | /* No-Op */ 15 | } 16 | 17 | void sdk_uart_div_modify(uint32_t uart_no, uint32_t new_divisor) { 18 | UART(uart_no).CLOCK_DIVIDER = new_divisor; 19 | UART(uart_no).CONF0 |= (UART_CONF0_TXFIFO_RESET | UART_CONF0_RXFIFO_RESET); 20 | UART(uart_no).CONF0 &= ~(UART_CONF0_TXFIFO_RESET | UART_CONF0_RXFIFO_RESET); 21 | } 22 | 23 | void sdk_Uart_Init(void) { 24 | /* No-Op */ 25 | } 26 | 27 | #endif /* OPEN_LIBMAIN_UART */ 28 | -------------------------------------------------------------------------------- /open_esplibs/libnet80211/ieee80211_ets.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libnet80211 ieee80211_ets.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBNET80211_ETS 8 | // The contents of this file are only built if OPEN_LIBNET80211_ETS is set to true 9 | 10 | #endif /* OPEN_LIBNET80211_ETS */ 11 | -------------------------------------------------------------------------------- /open_esplibs/libnet80211/ieee80211_input.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libnet80211 ieee80211_input.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | 7 | #include "esplibs/libpp.h" 8 | 9 | void IRAM sdk_ieee80211_deliver_data(struct sdk_g_ic_netif_info *netif_info, struct esf_buf *esf_buf) { 10 | struct netif *netif = netif_info->netif; 11 | 12 | if (netif->flags & NETIF_FLAG_LINK_UP) { 13 | uint16_t length = esf_buf->length; 14 | struct pbuf *pbuf = pbuf_alloc_reference(esf_buf->pbuf2->payload, length, PBUF_ALLOC_FLAG_RX | PBUF_TYPE_ALLOC_SRC_MASK_ESP_RX); 15 | esf_buf->pbuf1 = pbuf; 16 | pbuf->esf_buf = (void *)esf_buf; 17 | ethernetif_input(netif, pbuf); 18 | return; 19 | } 20 | 21 | if (esf_buf) 22 | sdk_ppRecycleRxPkt(esf_buf); 23 | 24 | return; 25 | } 26 | -------------------------------------------------------------------------------- /open_esplibs/libphy/phy.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libphy phy.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBNET80211_WL_CNX 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPHY_PHY */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libphy/phy_chip_v6.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libphy phy_chip_v6.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBNET80211_WL_CNX 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_V6 is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPHY_PHY_CHIP_V6 */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libphy/phy_sleep.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libphy phy_chip_sleep.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBNET80211_WL_CNX 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPHY_PHY_CHIP_SLEEP */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libpp/esf_buf.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libpp esf_buf.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBPP_ESF_BUF 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPP_ESF_BUF */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libpp/if_hwctrl.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libpp if_hwctrl.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBPP_IF_HWCTRL 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPP_IF_HWCTRL */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libpp/lmac.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libpp lmac.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBPP_LMAC 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPP_LMAC */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libpp/pm.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libpp pm.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBPP_PM 8 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true 9 | 10 | 11 | #endif /* OPEN_LIBPP_PM */ 12 | -------------------------------------------------------------------------------- /open_esplibs/libpp/pp.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libpp pp.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #include "stdlib.h" 8 | #include "stdint.h" 9 | 10 | /* 11 | * This replaces a dynamic allocation, a call to zalloc(), from within a 12 | * critical section in the ppTask. The allocation aquired the malloc lock and 13 | * doing so withing a critical section is not safe because it might preempt 14 | * another task which is not possible from within a critical section. The data 15 | * is written to the rtc memory, and was then freed. The freeing has been 16 | * patched to be a nop. 17 | */ 18 | static const uint32_t pp_zeros[8]; 19 | void *_ppz20(size_t n) 20 | { 21 | return &pp_zeros; 22 | } 23 | 24 | #if OPEN_LIBPP_PP 25 | // The contents of this file are only built if OPEN_LIBPHY_PHY_CHIP_SLEEP is set to true 26 | 27 | 28 | #endif /* OPEN_LIBPP_PP */ 29 | -------------------------------------------------------------------------------- /open_esplibs/libpp/wdev.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libpp wdev.o contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBPP_WDEV 8 | // The contents of this file are only built if OPEN_LIBPP_WDEV is set to true 9 | 10 | // Note the SDK allocated 8000 bytes for TX buffers that appears to be 11 | // unused. Rather TX buffers appear to be allocated by upper layers. The 12 | // location of this areas is at wDevCtrl + 0x2190. The SDK has been modified 13 | // to allocate only one word (4 bytes) per buffer on initialization and even 14 | // these seem unused but to be sure avoid the first 20 bytes. So there are 15 | // 7980 bytes free starting at wDevCtrl + 0x21a4. 16 | 17 | #endif /* OPEN_LIBPP_WDEV */ 18 | -------------------------------------------------------------------------------- /open_esplibs/libwpa/os_xtensa.c: -------------------------------------------------------------------------------- 1 | /* Recreated Espressif libwpa is_xtensa.s contents. 2 | 3 | Copyright (C) 2015 Espressif Systems. Derived from MIT Licensed SDK libraries. 4 | BSD Licensed as described in the file LICENSE 5 | */ 6 | #include "open_esplibs.h" 7 | #if OPEN_LIBWPA_OS_XTENSA 8 | // The contents of this file are only built if OPEN_LIBWPA_WPA_MAIN is set to true 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | // Used by wpa_get_ntp_timestamp. 16 | int IRAM sdk_os_get_time(uint32_t time[]) { 17 | return 0; 18 | } 19 | 20 | uint32_t IRAM sdk_os_random() { 21 | return rand(); 22 | } 23 | 24 | int IRAM sdk_os_get_random(uint8_t *dst, uint32_t size) { 25 | uint32_t end = size >> 2; 26 | if (end > 0) { 27 | uint32_t i = 0; 28 | do { 29 | uint32_t n = rand(); 30 | memcpy(dst, &n, sizeof(n)); 31 | dst += 4; 32 | i++; 33 | } while (i < end); 34 | } 35 | return 0; 36 | } 37 | 38 | #endif /* OPEN_LIBWPA_OS_XTENSA */ 39 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=tests 2 | 3 | EXTRA_COMPONENTS=extras/dhcpserver extras/spiffs 4 | 5 | PROGRAM_SRC_DIR = . ./cases 6 | 7 | FLASH_SIZE = 32 8 | 9 | # spiffs configuration 10 | SPIFFS_BASE_ADDR = 0x200000 11 | SPIFFS_SIZE = 0x100000 12 | 13 | # Add unity test framework headers & core source file 14 | PROGRAM_INC_DIR = ./unity/src ./fs-test 15 | PROGRAM_EXTRA_SRC_FILES = ./unity/src/unity.c ./fs-test/fs_test.c 16 | 17 | TESTCASE_SRC_FILES = $(wildcard $(PROGRAM_DIR)cases/*.c) 18 | 19 | # Link every object in the 'program' archive, to pick up constructor functions for test cases 20 | PROGRAM_WHOLE_ARCHIVE = yes 21 | 22 | include ../common.mk 23 | -------------------------------------------------------------------------------- /tests/cases/05_spiffs.c: -------------------------------------------------------------------------------- 1 | #include "espressif/esp_common.h" 2 | #include "esp/uart.h" 3 | #include "esp/timer.h" 4 | #include "FreeRTOS.h" 5 | #include "task.h" 6 | #include "esp8266.h" 7 | #include 8 | 9 | #include "esp_spiffs.h" 10 | #include "spiffs.h" 11 | 12 | #include "fs_test.h" 13 | 14 | #include "testcase.h" 15 | 16 | DEFINE_SOLO_TESTCASE(05_spiffs) 17 | 18 | static fs_time_t get_current_time() 19 | { 20 | return timer_get_count(FRC2) / 5000; // to get roughly 1ms resolution 21 | } 22 | 23 | static void test_task(void *pvParameters) 24 | { 25 | esp_spiffs_init(); 26 | esp_spiffs_mount(); 27 | SPIFFS_unmount(&fs); // FS must be unmounted before formating 28 | if (SPIFFS_format(&fs) == SPIFFS_OK) { 29 | printf("Format complete\n"); 30 | } else { 31 | printf("Format failed\n"); 32 | } 33 | esp_spiffs_mount(); 34 | 35 | TEST_ASSERT_TRUE_MESSAGE(fs_load_test_run(100), "Load test failed"); 36 | 37 | float write_rate, read_rate; 38 | if (fs_speed_test_run(get_current_time, &write_rate, &read_rate)) { 39 | printf("Read speed: %.0f bytes/s\n", read_rate * 1000); 40 | printf("Write speed: %.0f bytes/s\n", write_rate * 1000); 41 | } else { 42 | TEST_FAIL(); 43 | } 44 | TEST_PASS(); 45 | } 46 | 47 | static void a_05_spiffs(void) 48 | { 49 | xTaskCreate(test_task, "test_task", 1024, NULL, 2, NULL); 50 | } 51 | -------------------------------------------------------------------------------- /utils/travis_build/install_toolchain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euv 3 | 4 | # Called by Travis to install a toolchain using esp-open-sdk (parts we 5 | # ne for esp-open-rtos are the GNU toolchain, libhal, and esptool.py.) 6 | 7 | if test -d ${CROSS_BINDIR}; then 8 | echo "Using cached toolchain in ${CROSS_BINDIR}" 9 | exit 0 10 | fi 11 | 12 | # Travis sets this due to "language: c", but it confuses autotools configure when cross-building 13 | unset CC 14 | 15 | git clone --recursive https://github.com/pfalcon/esp-open-sdk.git 16 | cd esp-open-sdk 17 | git reset --hard ${OPENSDK_COMMIT} 18 | git submodule update --init 19 | 20 | # this is a nasty hack as Ubuntu Precise only has autoconf 2.68 not 2.69... 21 | sed -i "s/2.69/2.68/" lx106-hal/configure.ac 22 | 23 | # build the toolchain relative to the CROSS_ROOT directory 24 | sed -r -i 's%TOOLCHAIN ?=.*%TOOLCHAIN=${CROSS_ROOT}%' Makefile 25 | 26 | # will dump log on failure 27 | echo "Building toolchain without live progress, as progress spinner fills up log..." 28 | 29 | if !( make toolchain esptool libhal STANDALONE=n 2>&1 > make.log ); then 30 | cat make.log 31 | echo "Exiting due to failed toolchain build" 32 | exit 3 33 | fi 34 | 35 | echo "Toolchain build completed in ${CROSS_ROOT}." 36 | --------------------------------------------------------------------------------