boot_debuguart.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Copyright (C) 2017 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _BOOT_DEBUGUART_H_
  13. #define _BOOT_DEBUGUART_H_
  14. #include <stdint.h>
  15. #include <stdbool.h>
  16. #include <stddef.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /**
  21. * @brief initialize debuguart
  22. */
  23. void bootDebuguartInit(void);
  24. /**
  25. * @brief write to debuguart
  26. *
  27. * It is non-blocking, it will not wait fifo space available.
  28. *
  29. * @param data data to be written
  30. * @param size size of the buffer for write
  31. * @return actual written size
  32. */
  33. int bootDebuguartWrite(const void *data, size_t size);
  34. /**
  35. * @brief write and wait to debuguart
  36. *
  37. * It is blocking, it will wait fifo space available.
  38. *
  39. * @param data data to be written
  40. * @param size size of the buffer for write
  41. */
  42. void bootDebuguartWriteAll(const void *data, size_t size);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif