esp_rom_regi2c.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * Espressif private functions. Not for peripherals. Don't use it in your app.
  8. */
  9. #include <stdint.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief Read internal register
  15. *
  16. * @param block Block of the register
  17. * @param host_id Host of the register
  18. * @param reg_add Address of the register
  19. * @return uint8_t Register value
  20. */
  21. uint8_t esp_rom_regi2c_read(uint8_t block, uint8_t host_id, uint8_t reg_add);
  22. /**
  23. * @brief Read internal register, in bits
  24. *
  25. * @param block Block of the register
  26. * @param host_id Host of the register
  27. * @param reg_add Address of the register
  28. * @param msb MSB of the register
  29. * @param lsb LSB of the register
  30. * @return uint8_t Register value
  31. */
  32. uint8_t esp_rom_regi2c_read_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb);
  33. /**
  34. * @brief Write internal register
  35. *
  36. * @param block Block of the register
  37. * @param host_id Host of the register
  38. * @param reg_add Address of the register
  39. * @param data Value to write
  40. */
  41. void esp_rom_regi2c_write(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t data);
  42. /**
  43. * @brief Write internal register, in bits
  44. *
  45. * @param block Block of the register
  46. * @param host_id Host of the register
  47. * @param reg_add Address of the register
  48. * @param msb MSB of the register
  49. * @param lsb LSB of the register
  50. * @param data Value to write
  51. */
  52. void esp_rom_regi2c_write_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb, uint8_t data);
  53. #ifdef __cplusplus
  54. }
  55. #endif