esp_vfs_semihost.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2019 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_vfs.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * @brief add virtual filesystem semihosting driver
  21. *
  22. * @param base_path VFS path to mount host directory
  23. * @param host_path host path to mount; if NULL default dirctory will be used (see OpenOCD configuration)
  24. * @return
  25. * - ESP_OK on success
  26. * - ESP_ERR_INVALID_ARG if esp_vfs_semihost_register was already called for specified VFS path
  27. * - ESP_ERR_NO_MEM if there are no slots to register new mount point
  28. */
  29. esp_err_t esp_vfs_semihost_register(const char* base_path, const char* host_path);
  30. /**
  31. * @brief Un-register semihosting driver from VFS
  32. *
  33. * @return
  34. * - ESP_OK on success
  35. * - ESP_ERR_INVALID_ARG if semihosting driver is not registered in VFS at that path
  36. */
  37. esp_err_t esp_vfs_semihost_unregister(const char* base_path);
  38. #ifdef __cplusplus
  39. }
  40. #endif