ets.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #ifndef DOXYGEN
20 
21 #include <stdarg.h>
22 #include <stddef.h>
23 #include <stdint.h>
24 
25 #include "rom/ets_sys.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /* interrupts that are not defined in rom/ets_sys.h */
32 #define ETS_WDEV_INUM 0 /* WDEV process FIQ interrupt */
33 #define ETS_RTC_INUM 3 /* RTC interrupt */
34 #define ETS_CCOM_INUM 6 /* CCOMPARE0 match interrupt */
35 #define ETS_FRC2_INUM 10 /* SDK FRC2 timer interrupt */
36 
37 /*
38  * The following functions are mappings or dummies for source code
39  * compatibility of NONOS-SDK and RTOS-SDK version
40  */
41 
42 #include "xtensa/xtensa_api.h"
43 
44 #define ets_isr_mask(x) xt_ints_off(x)
45 #define ets_isr_unmask(x) xt_ints_on(x)
46 #define ets_isr_attach(i,f,a) xt_set_interrupt_handler(i,f,a)
47 
48 #define ETS_INTR_ENABLE(inum) ets_isr_unmask((1<<inum))
49 #define ETS_INTR_DISABLE(inum) ets_isr_mask((1<<inum))
50 
51 #define _xtos_set_exception_handler(n,f) xt_set_exception_handler(n,f)
52 
53 extern uint8_t ets_get_cpu_frequency(void);
54 extern void ets_update_cpu_frequency(uint8_t);
55 
56 extern int ets_vprintf(const char *fmt, va_list ap);
57 extern int ets_printf(const char *fmt, ...);
58 extern int ets_putc(int c);
59 extern void ets_install_putc1(void (*p)(char c));
60 
61 extern void *ets_memcpy(void *dst, const void *src, size_t size);
62 
63 extern void ets_wdt_disable(void);
64 extern void ets_wdt_enable (void);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* DOXYGEN */