hal_iic_host.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * BSD 2-Clause License
  3. * Copyright (c) 2022, LiteEMF
  4. * All rights reserved.
  5. * This software component is licensed by LiteEMF under BSD 2-Clause license,
  6. * the "License"; You may not use this file except in compliance with the
  7. * License. You may obtain a copy of the License at:
  8. * opensource.org/licenses/BSD-2-Clause
  9. *
  10. */
  11. /************************************************************************************************************
  12. ** Description:
  13. ************************************************************************************************************/
  14. #include "hw_config.h"
  15. #include "hw_board.h"
  16. #ifdef HW_IIC_MAP
  17. #include "api/api_iic_host.h"
  18. #include "api/api_gpio.h"
  19. /******************************************************************************************************
  20. ** Defined
  21. *******************************************************************************************************/
  22. /******************************************************************************************************
  23. ** static Parameters
  24. *******************************************************************************************************/
  25. /******************************************************************************************************
  26. ** public Parameters
  27. *******************************************************************************************************/
  28. /*****************************************************************************************************
  29. ** static Function
  30. ******************************************************************************************************/
  31. /*****************************************************************************************************
  32. ** Function
  33. ******************************************************************************************************/
  34. /*******************************************************************
  35. ** Parameters:
  36. ** Returns:
  37. ** Description: 需要使用硬件iic扫描外设时才需要适配该接口
  38. *******************************************************************/
  39. bool hal_iic_scan_addr(uint8_t id,uint8_t dev_addr)
  40. {
  41. uint8_t ret = false;
  42. // start
  43. // tx byte
  44. // stop
  45. UNUSED_PARAMETER(id);
  46. UNUSED_PARAMETER(dev_addr);
  47. return ret;
  48. }
  49. /*******************************************************************
  50. ** Parameters:
  51. ** Returns:
  52. ** Description:
  53. *******************************************************************/
  54. bool hal_iic_write(uint8_t id,uint8_t dev_addr,uint16_t addr, uint8_t const *buf, uint16_t len)
  55. {
  56. UNUSED_PARAMETER(id);
  57. UNUSED_PARAMETER(dev_addr);
  58. UNUSED_PARAMETER(addr);
  59. UNUSED_PARAMETER(buf);
  60. UNUSED_PARAMETER(len);
  61. return false;
  62. }
  63. bool hal_iic_read(uint8_t id,uint8_t dev_addr,uint16_t addr, uint8_t* buf, uint16_t len)
  64. {
  65. UNUSED_PARAMETER(id);
  66. UNUSED_PARAMETER(dev_addr);
  67. UNUSED_PARAMETER(addr);
  68. UNUSED_PARAMETER(buf);
  69. UNUSED_PARAMETER(len);
  70. return false;
  71. }
  72. bool hal_iic_isr_write(uint8_t id,uint8_t dev_addr,uint16_t addr, uint8_t const *buf, uint16_t len)
  73. {
  74. UNUSED_PARAMETER(id);
  75. UNUSED_PARAMETER(dev_addr);
  76. UNUSED_PARAMETER(addr);
  77. UNUSED_PARAMETER(buf);
  78. UNUSED_PARAMETER(len);
  79. return false;
  80. }
  81. bool hal_iic_isr_read(uint8_t id,uint8_t dev_addr,uint16_t addr, uint8_t* buf, uint16_t len)
  82. {
  83. UNUSED_PARAMETER(id);
  84. UNUSED_PARAMETER(dev_addr);
  85. UNUSED_PARAMETER(addr);
  86. UNUSED_PARAMETER(buf);
  87. UNUSED_PARAMETER(len);
  88. return false;
  89. }
  90. bool hal_iic_init(uint8_t id)
  91. {
  92. UNUSED_PARAMETER(id);
  93. return false;
  94. }
  95. bool hal_iic_deinit(uint8_t id)
  96. {
  97. UNUSED_PARAMETER(id);
  98. return false;
  99. }
  100. #endif