esp_newlib.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __ESP_NEWLIB_H__
  7. #define __ESP_NEWLIB_H__
  8. #include <sys/reent.h>
  9. /*
  10. * Initialize newlib time functions
  11. */
  12. void esp_newlib_time_init(void);
  13. /**
  14. * Replacement for newlib's _REENT_INIT_PTR and __sinit.
  15. *
  16. * Called from startup code and FreeRTOS, not intended to be called from
  17. * application code.
  18. */
  19. void esp_reent_init(struct _reent* r);
  20. /**
  21. * Clean up some of lazily allocated buffers in REENT structures.
  22. */
  23. void esp_reent_cleanup(void);
  24. /**
  25. * Function which sets up newlib in ROM for use with ESP-IDF
  26. *
  27. * Includes defining the syscall table, setting up any common locks, etc.
  28. *
  29. * Called from the startup code, not intended to be called from application
  30. * code.
  31. */
  32. void esp_newlib_init(void);
  33. void esp_setup_syscall_table(void) __attribute__((deprecated("Please call esp_newlib_init() in newer code")));
  34. /**
  35. * Update current microsecond time from RTC
  36. */
  37. void esp_set_time_from_rtc(void);
  38. /*
  39. * Sync timekeeping timers, RTC and high-resolution timer. Update boot_time.
  40. */
  41. void esp_sync_timekeeping_timers(void);
  42. /* Kept for backward compatibility */
  43. #define esp_sync_counters_rtc_and_frc esp_sync_timekeeping_timers
  44. /**
  45. * Initialize newlib static locks
  46. */
  47. void esp_newlib_locks_init(void);
  48. #endif //__ESP_NEWLIB_H__