serial_comm.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright 2020 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. */
  15. #pragma once
  16. #include <stdint.h>
  17. #include <stdbool.h>
  18. #include "esp_loader.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. esp_loader_error_t loader_flash_begin_cmd(uint32_t offset, uint32_t erase_size, uint32_t block_size, uint32_t blocks_to_write, bool encryption);
  23. esp_loader_error_t loader_flash_data_cmd(const uint8_t *data, uint32_t size);
  24. esp_loader_error_t loader_flash_end_cmd(bool stay_in_loader);
  25. esp_loader_error_t loader_write_reg_cmd(uint32_t address, uint32_t value, uint32_t mask, uint32_t delay_us);
  26. esp_loader_error_t loader_read_reg_cmd(uint32_t address, uint32_t *reg);
  27. esp_loader_error_t loader_sync_cmd(void);
  28. esp_loader_error_t loader_spi_attach_cmd(uint32_t config);
  29. esp_loader_error_t loader_change_baudrate_cmd(uint32_t baudrate);
  30. esp_loader_error_t loader_md5_cmd(uint32_t address, uint32_t size, uint8_t *md5_out);
  31. esp_loader_error_t loader_spi_parameters(uint32_t total_size);
  32. #ifdef __cplusplus
  33. }
  34. #endif