esp_vfs_cdcacm.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include "esp_err.h"
  8. #include "esp_vfs.h"
  9. #include "esp_vfs_common.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief add /dev/cdcacm virtual filesystem driver
  15. *
  16. * This function is called from startup code to enable console output
  17. */
  18. esp_err_t esp_vfs_dev_cdcacm_register(void);
  19. /**
  20. * @brief Set the line endings expected to be received
  21. *
  22. * This specifies the conversion between line endings received and
  23. * newlines ('\n', LF) passed into stdin:
  24. *
  25. * - ESP_LINE_ENDINGS_CRLF: convert CRLF to LF
  26. * - ESP_LINE_ENDINGS_CR: convert CR to LF
  27. * - ESP_LINE_ENDINGS_LF: no modification
  28. *
  29. * @note this function is not thread safe w.r.t. reading
  30. *
  31. * @param mode line endings expected
  32. */
  33. void esp_vfs_dev_cdcacm_set_rx_line_endings(esp_line_endings_t mode);
  34. /**
  35. * @brief Set the line endings to sent
  36. *
  37. * This specifies the conversion between newlines ('\n', LF) on stdout and line
  38. * endings sent:
  39. *
  40. * - ESP_LINE_ENDINGS_CRLF: convert LF to CRLF
  41. * - ESP_LINE_ENDINGS_CR: convert LF to CR
  42. * - ESP_LINE_ENDINGS_LF: no modification
  43. *
  44. * @note this function is not thread safe w.r.t. writing
  45. *
  46. * @param mode line endings to send
  47. */
  48. void esp_vfs_dev_cdcacm_set_tx_line_endings(esp_line_endings_t mode);
  49. #ifdef __cplusplus
  50. }
  51. #endif