hpm_debug_console.h 637 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021-2024 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef _HPM_DEBUG_CONSOLE_H
  8. #define _HPM_DEBUG_CONSOLE_H
  9. #include "hpm_common.h"
  10. #define CONSOLE_TYPE_UART 0
  11. typedef struct {
  12. uint32_t type;
  13. uint32_t base;
  14. uint32_t src_freq_in_hz;
  15. uint32_t baudrate;
  16. } console_config_t;
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif /* __cplusplus */
  20. hpm_stat_t console_init(console_config_t *cfg);
  21. uint8_t console_receive_byte(void);
  22. uint8_t console_try_receive_byte(void);
  23. void console_send_byte(uint8_t c);
  24. #if defined(__cplusplus)
  25. }
  26. #endif /* __cplusplus */
  27. #endif /* _HPM_CONSOLE_H */