12 #include "eagle_soc.h" 43 #define ETS_SLC_INUM 1 44 #define ETS_SPI_INUM 2 45 #define ETS_GPIO_INUM 4 46 #define ETS_UART_INUM 5 47 #define ETS_UART1_INUM 5 48 #define ETS_CCOMPARE0_INUM 6 49 #define ETS_SOFT_INUM 7 50 #define ETS_WDT_INUM 8 51 #define ETS_FRC_TIMER1_INUM 9 53 #define ETS_INTR_LOCK() \ 56 #define ETS_INTR_UNLOCK() \ 59 #define ETS_INTR_ENABLE(inum) \ 60 ets_isr_unmask((1<<inum)) 62 #define ETS_INTR_DISABLE(inum) \ 63 ets_isr_mask((1<<inum)) 68 __asm__ __volatile__(
"rsr %0,ps":
"=a" (ps));
70 return ((ps & 0x0f) != 0);
76 __asm__ __volatile__(
"esync; rsr %0,intenable":
"=a" (enabled));
83 __asm__ __volatile__(
"esync; rsr %0,interrupt":
"=a" (pending));
87 #define ETS_CCOMPARE0_INTR_ATTACH(func, arg) \ 88 ets_isr_attach(ETS_CCOMPARE0_INUM, (int_handler_t)(func), (void *)(arg)) 90 #define ETS_CCOMPARE0_ENABLE() \ 91 ETS_INTR_ENABLE(ETS_CCOMPARE0_INUM) 93 #define ETS_CCOMPARE0_DISABLE() \ 94 ETS_INTR_DISABLE(ETS_CCOMPARE0_INUM) 97 #define ETS_FRC_TIMER1_INTR_ATTACH(func, arg) \ 98 ets_isr_attach(ETS_FRC_TIMER1_INUM, (int_handler_t)(func), (void *)(arg)) 100 #define ETS_FRC_TIMER1_NMI_INTR_ATTACH(func) \ 103 #define ETS_GPIO_INTR_ATTACH(func, arg) \ 104 ets_isr_attach(ETS_GPIO_INUM, (int_handler_t)(func), (void *)(arg)) 106 #define ETS_GPIO_INTR_ENABLE() \ 107 ETS_INTR_ENABLE(ETS_GPIO_INUM) 109 #define ETS_GPIO_INTR_DISABLE() \ 110 ETS_INTR_DISABLE(ETS_GPIO_INUM) 113 #define ETS_UART_INTR_ATTACH(func, arg) \ 114 ets_isr_attach(ETS_UART_INUM, (int_handler_t)(func), (void *)(arg)) 116 #define ETS_UART_INTR_ENABLE() \ 117 ETS_INTR_ENABLE(ETS_UART_INUM) 119 #define ETS_UART_INTR_DISABLE() \ 120 ETS_INTR_DISABLE(ETS_UART_INUM) 122 #define ETS_FRC1_INTR_ENABLE() \ 123 ETS_INTR_ENABLE(ETS_FRC_TIMER1_INUM) 125 #define ETS_FRC1_INTR_DISABLE() \ 126 ETS_INTR_DISABLE(ETS_FRC_TIMER1_INUM) 129 #define ETS_SPI_INTR_ATTACH(func, arg) \ 130 ets_isr_attach(ETS_SPI_INUM, (int_handler_t)(func), (void *)(arg)) 132 #define ETS_SPI_INTR_ENABLE() \ 133 ETS_INTR_ENABLE(ETS_SPI_INUM) 135 #define ETS_SPI_INTR_DISABLE() \ 136 ETS_INTR_DISABLE(ETS_SPI_INUM) 139 #define ETS_SLC_INTR_ATTACH(func, arg) \ 140 ets_isr_attach(ETS_SLC_INUM, (int_handler_t)(func), (void *)(arg)) 142 #define ETS_SLC_INTR_ENABLE() \ 143 ETS_INTR_ENABLE(ETS_SLC_INUM) 145 #define ETS_SLC_INTR_DISABLE() \ 146 ETS_INTR_DISABLE(ETS_SLC_INUM) 154 void *
ets_memcpy(
void *dest,
const void *src,
size_t n);
159 int atoi(
const char *nptr);
160 int ets_strncmp(
const char *s1,
const char *s2,
int len);
161 int ets_strcmp(
const char *s1,
const char *s2);
163 char *
ets_strcpy(
char *dest,
const char *src);
164 char *
ets_strncpy(
char *dest,
const char *src,
size_t n);
165 char *
ets_strstr(
const char *haystack,
const char *needle);
void * pvPortMalloc(size_t xWantedSize) __attribute__((malloc
void * ets_memset(void *s, int c, size_t n)
void ets_isr_unmask(int intr)
void ets_isr_attach(int intr, int_handler_t handler, void *arg)
int ets_strcmp(const char *s1, const char *s2)
cont_t g_cont __attribute__((aligned(16)))
bool ETS_INTR_WITHINISR()
void ETSTimerFunc(void *timer_arg)
uint32_t ETS_INTR_PENDING(void)
struct _ETSTIMER_ * timer_next
char * ets_strcpy(char *dest, const char *src)
int atoi(const char *nptr)
Convert ASCII string to number in base 10.
char * ets_strstr(const char *haystack, const char *needle)
uint32_t ETS_INTR_ENABLED(void)
int int int void ets_install_putc1(void *routine)
struct _ETSTIMER_ ETSTimer
void pvPortFree(void *ptr)
void(* int_handler_t)(void *)
int ets_strncmp(const char *s1, const char *s2, int len)
MEMSPACE void * malloc(size_t size)
malloc buffer POSIX function
void * vPortMalloc(size_t xWantedSize) __attribute__((malloc
void ets_isr_mask(int intr)
void * ets_memcpy(void *dest, const void *src, size_t n)
int int ets_vprintf(const char *format, va_list arg) __attribute__((format(printf
void ets_timer_disarm(ETSTimer *a)
int ets_vsnprintf(char *s, size_t n, const char *format, va_list arg) __attribute__((format(printf
void * pvPortRealloc(void *ptr, size_t xWantedSize) __attribute__((alloc_size(2)))
MEMSPACE int printf(const char *format,...)
void(* ETSTask)(ETSEvent *e)
void uart_div_modify(int no, int freq)
char * ets_strncpy(char *dest, const char *src, size_t n)
void vPortFree(void *ptr)
int ets_sprintf(char *str, const char *format,...) __attribute__((format(printf
int int int ets_printf(const char *format,...) __attribute__((format(printf
void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn, void *parg)
ETSTimerFunc * timer_func
int int os_snprintf(char *str, size_t size, const char *format,...) __attribute__((format(printf
void ets_timer_arm_new(ETSTimer *a, int b, int c, int isMstimer)
int ets_strlen(const char *s)