1 #ifndef ESPMISSINGINCLUDES_H
2 #define ESPMISSINGINCLUDES_H
4 #include <user_interface.h>
9 typedef struct espconn espconn;
11 bool wifi_station_set_hostname(
char *);
12 char *wifi_station_get_hostname(
void);
14 int atoi(
const char *nptr);
16 void ets_install_putc1(
void *routine);
17 void ets_isr_attach(
int intr,
void *handler,
void *arg);
18 void ets_isr_mask(
unsigned intr);
19 void ets_isr_unmask(
unsigned intr);
21 int ets_memcmp(
const void *s1,
const void *s2,
size_t n);
22 void *ets_memcpy(
void *dest,
const void *src,
size_t n);
23 void *ets_memset(
void *s,
int c,
size_t n);
24 int ets_sprintf(
char *str,
const char *format, ...) __attribute__ ((format (printf, 2, 3)));
25 int ets_str2macaddr(
void *,
void *);
26 int ets_strcmp(const
char *s1, const
char *s2);
27 char *ets_strcpy(
char *dest, const
char *src);
28 size_t ets_strlen(const
char *s);
29 int ets_strncmp(const
char *s1, const
char *s2,
int len);
30 char *ets_strncpy(
char *dest, const
char *src,
size_t n);
31 char *ets_strstr(const
char *haystack, const
char *needle);
33 void ets_timer_arm_new(ETSTimer *a,
int b,
int c,
int isMstimer);
34 void ets_timer_disarm(ETSTimer *a);
35 void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn,
void *parg);
37 void ets_update_cpu_frequency(
int freqmhz);
40 #define DEBUG_SDK true
42 #define DEBUG_SDK false
45 int os_snprintf(
char *str,
size_t size,
const char *format, ...) __attribute__((format(printf, 3, 4)));
46 int os_printf_plus(const
char *format, ...) __attribute__((format(printf, 1, 2)));
49 #define os_printf(format, ...) \
50 system_set_os_print(true); \
51 os_printf_plus(format, ## __VA_ARGS__); \
52 system_set_os_print(DEBUG_SDK); // int os_printf(const char *format, ...)
57 void vPortFree(
void *ptr,
char * file,
int line);
58 void *pvPortMalloc(
size_t xWantedSize,
char * file,
int line);
59 void *pvPortZalloc(
size_t,
char * file,
int line);
60 void *vPortMalloc(
size_t xWantedSize);
61 void pvPortFree(
void *ptr);
63 void uart_div_modify(
int no,
unsigned int freq);
64 uint32 system_get_time();
66 void ets_bzero(
void *s,
size_t n);
67 void ets_delay_us(
int ms);
70 #define os_timer_done ets_timer_done
71 #define os_timer_handler_isr ets_timer_handler_isr
72 #define os_timer_init ets_timer_init
75 #undef PIN_FUNC_SELECT
76 #define PIN_FUNC_SELECT(P,F) \
79 (READ_PERI_REG(P) & ~(PERIPHS_IO_MUX_FUNC<<PERIPHS_IO_MUX_FUNC_S)) \
80 |( (((F&BIT2)<<2)|(F&0x3))<<PERIPHS_IO_MUX_FUNC_S) ); \