Mostly updated header files for use in C++
This commit is contained in:
		
							parent
							
								
									3eee1a9845
								
							
						
					
					
						commit
						da6b5f74bb
					
				
					 13 changed files with 97 additions and 8 deletions
				
			
		|  | @ -6,6 +6,10 @@ | |||
| #ifndef __ESP8266_H__ | ||||
| #define __ESP8266_H__ | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| #include "ets_sys.h" | ||||
| #include "eagle_soc.h" | ||||
| #include "gpio_register.h" | ||||
|  | @ -14,5 +18,9 @@ | |||
| #include "timer_register.h" | ||||
| #include "uart_register.h" | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
|  |  | |||
|  | @ -8,6 +8,10 @@ | |||
| 
 | ||||
| #include "lwip/ip_addr.h" | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] | ||||
| #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" | ||||
| 
 | ||||
|  | @ -23,4 +27,8 @@ void sdk_os_delay_us(uint16_t us); | |||
| void sdk_os_install_putc1(void (*p)(char c)); | ||||
| void sdk_os_putc(char c); | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -6,6 +6,10 @@ | |||
| #ifndef __ESP_SOFTAP_H__ | ||||
| #define __ESP_SOFTAP_H__ | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| struct sdk_softap_config { | ||||
|     uint8_t ssid[32]; | ||||
|     uint8_t password[64]; | ||||
|  | @ -20,4 +24,8 @@ struct sdk_softap_config { | |||
| bool sdk_wifi_softap_get_config(struct sdk_softap_config *config); | ||||
| bool sdk_wifi_softap_set_config(struct sdk_softap_config *config); | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -10,6 +10,10 @@ | |||
| 
 | ||||
| #include "queue.h" | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| struct sdk_station_config { | ||||
|     uint8_t ssid[32]; | ||||
|     uint8_t password[64]; | ||||
|  | @ -68,4 +72,8 @@ enum { | |||
| 
 | ||||
| uint8_t sdk_wifi_station_get_connect_status(void); | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -6,6 +6,10 @@ | |||
| #ifndef __ESP_SYSTEM_H__ | ||||
| #define __ESP_SYSTEM_H__ | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| enum sdk_rst_reason { | ||||
| 	DEFAULT_RST	  = 0, | ||||
| 	WDT_RST	      = 1, | ||||
|  | @ -54,4 +58,8 @@ bool sdk_system_rtc_mem_write(uint8_t dst, const void *src, uint16_t n); | |||
| 
 | ||||
| void sdk_system_uart_swap(void); | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -6,6 +6,10 @@ | |||
| #ifndef __ESP_TIMER_H__ | ||||
| #define __ESP_TIMER_H__ | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| /* timer related */ | ||||
| typedef void sdk_os_timer_func_t(void *timer_arg); | ||||
| 
 | ||||
|  | @ -19,4 +23,8 @@ typedef struct _os_timer_t { | |||
|     void               *timer_arg; | ||||
| } sdk_os_timer_t; | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -9,6 +9,10 @@ | |||
| #ifndef __ESP_WIFI_H__ | ||||
| #define __ESP_WIFI_H__ | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| enum { | ||||
| 	NULL_MODE = 0, | ||||
| 	STATION_MODE, | ||||
|  | @ -63,7 +67,11 @@ enum sdk_phy_mode { | |||
| 	PHY_MODE_11N    = 3 | ||||
| }; | ||||
| 
 | ||||
| enum phy_mode sdk_wifi_get_phy_mode(void); | ||||
| enum sdk_phy_mode sdk_wifi_get_phy_mode(void); | ||||
| bool sdk_wifi_set_phy_mode(enum sdk_phy_mode mode); | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -15,6 +15,11 @@ | |||
| #define SDK_PRIVATE_H | ||||
| 
 | ||||
| #include <stdint.h> | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| struct ip_addr; | ||||
| 
 | ||||
| /*********************************************
 | ||||
|  | @ -49,4 +54,8 @@ void sdk_system_station_got_ip_set(struct ip_addr *ip_addr, struct ip_addr *sn_m | |||
|  */ | ||||
| void sdk_system_pp_recycle_rx_pkt(void *eb); | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -6,6 +6,10 @@ | |||
| #ifndef __SPI_FLASH_H__ | ||||
| #define __SPI_FLASH_H__ | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| typedef enum { | ||||
|     SPI_FLASH_RESULT_OK, | ||||
|     SPI_FLASH_RESULT_ERR, | ||||
|  | @ -21,6 +25,7 @@ sdk_SpiFlashOpResult sdk_spi_flash_erase_sector(uint16_t sec); | |||
| sdk_SpiFlashOpResult sdk_spi_flash_write(uint32_t des_addr, uint32_t *src_addr, uint32_t size); | ||||
| sdk_SpiFlashOpResult sdk_spi_flash_read(uint32_t src_addr, uint32_t *des_addr, uint32_t size); | ||||
| 
 | ||||
|      | ||||
| /* SDK uses this structure internally to account for flash size.
 | ||||
| 
 | ||||
|    chip_size field is initialised during startup from the flash size | ||||
|  | @ -42,4 +47,9 @@ typedef struct { | |||
| 
 | ||||
| extern sdk_flashchip_t sdk_flashchip; | ||||
| 
 | ||||
| 
 | ||||
| #ifdef	__cplusplus | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue