esp_vfs_cdcacm.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "esp_err.h"
  16. #include "esp_vfs.h"
  17. #include "esp_vfs_common.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /**
  22. * @brief add /dev/cdcacm virtual filesystem driver
  23. *
  24. * This function is called from startup code to enable console output
  25. */
  26. esp_err_t esp_vfs_dev_cdcacm_register(void);
  27. /**
  28. * @brief Set the line endings expected to be received
  29. *
  30. * This specifies the conversion between line endings received and
  31. * newlines ('\n', LF) passed into stdin:
  32. *
  33. * - ESP_LINE_ENDINGS_CRLF: convert CRLF to LF
  34. * - ESP_LINE_ENDINGS_CR: convert CR to LF
  35. * - ESP_LINE_ENDINGS_LF: no modification
  36. *
  37. * @note this function is not thread safe w.r.t. reading
  38. *
  39. * @param mode line endings expected
  40. */
  41. void esp_vfs_dev_cdcacm_set_rx_line_endings(esp_line_endings_t mode);
  42. /**
  43. * @brief Set the line endings to sent
  44. *
  45. * This specifies the conversion between newlines ('\n', LF) on stdout and line
  46. * endings sent:
  47. *
  48. * - ESP_LINE_ENDINGS_CRLF: convert LF to CRLF
  49. * - ESP_LINE_ENDINGS_CR: convert LF to CR
  50. * - ESP_LINE_ENDINGS_LF: no modification
  51. *
  52. * @note this function is not thread safe w.r.t. writing
  53. *
  54. * @param mode line endings to send
  55. */
  56. void esp_vfs_dev_cdcacm_set_tx_line_endings(esp_line_endings_t mode);
  57. #ifdef __cplusplus
  58. }
  59. #endif