123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #include "esp_common.h"
- #include "driver/uart.h"
- #include "driver/spi_interface.h"
- #include "gpio.h"
- #include "log/esp_log.h"
- #include "gdbstub/gdbstub.h"
- #include "hal/lsm6ds3.h"
- #include "hal/max17043.h"
- #include "hal/lps25hb.h"
- #include "user_config.h"
- static const char* TAG = "main.c";
- void wifi_handle_event_cb(System_Event_t *evt)
- {
- switch(evt->event)
- {
- case EVENT_STAMODE_CONNECTED:
- break;
- case EVENT_STAMODE_DISCONNECTED:
- break;
- case EVENT_STAMODE_AUTHMODE_CHANGE:
- break;
- case EVENT_STAMODE_GOT_IP:
- break;
- case EVENT_SOFTAPMODE_PROBEREQRECVED:
- break;
- case EVENT_SOFTAPMODE_STACONNECTED:
- break;
- case EVENT_SOFTAPMODE_STADISCONNECTED:
- break;
- default:
- break;
- }
- }
- void ICACHE_FLASH_ATTR app_init(void)
- {
- uart_init(BIT_RATE_115200, BIT_RATE_115200, DISABLE_UART1);
- ESP_LOGI(TAG, "Starting LSM6DS3 Demo\n");
- ESP_LOGI(TAG, "WiFi Testing \n");
-
- {
- LSM6DS3_Enable_I2C_Bridge(1);
- uint16_t x = max17043_getVoltage();
- ESP_LOGI(TAG, "MAX17043 Voltage %d", x);
- uint8_t y;
- LPS25HB_Get_DeviceID(&y);
- ESP_LOGI(TAG, "DEVICEID %x", y);
-
-
-
- os_delay_us(1000000);
- system_soft_wdt_feed();
- }
- {
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- void user_init(void)
- {
- wifi_set_opmode(STATION_MODE);
- wifi_station_ap_number_set(5);
- system_init_done_cb(app_init);
- }
|