st7735_reg.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. ******************************************************************************
  3. * @file st7735_reg.c
  4. * @author MCD Application Team
  5. * @brief This file includes the LCD driver for st7735 LCD.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "st7735_reg.h"
  21. /** @addtogroup BSP
  22. * @{
  23. */
  24. /** @addtogroup Components
  25. * @{
  26. */
  27. /** @addtogroup ST7735_REG
  28. * @{
  29. */
  30. /** @addtogroup ST7735_REG_Exported_Functions
  31. * @{
  32. */
  33. /**
  34. * @brief Read ST7735 register
  35. * @param ctx Component context
  36. * @param reg Register to read
  37. * @param pdata data to read from the register
  38. * @retval Component status
  39. */
  40. int32_t st7735_read_reg(st7735_ctx_t *ctx, uint8_t reg, uint8_t *pdata)
  41. {
  42. return ctx->ReadReg(ctx->handle, reg, pdata);
  43. }
  44. /**
  45. * @brief Write ST7735 register
  46. * @param ctx Component context
  47. * @param reg Register to write
  48. * @param pdata data to write to the register
  49. * @param length length of data to write to the register
  50. * @retval Component status
  51. */
  52. int32_t st7735_write_reg(st7735_ctx_t *ctx, uint8_t reg, uint8_t *pdata, uint32_t length)
  53. {
  54. return ctx->WriteReg(ctx->handle, reg, pdata, length);
  55. }
  56. /**
  57. * @brief Send data
  58. * @param ctx Component context
  59. * @param pdata data to write
  60. * @param length length of data to write
  61. * @retval Component status
  62. */
  63. int32_t st7735_send_data(st7735_ctx_t *ctx, uint8_t *pdata, uint32_t length)
  64. {
  65. return ctx->SendData(ctx->handle, pdata, length);
  66. }
  67. /**
  68. * @brief Recieve data
  69. * @param ctx Component context
  70. * @param pdata data to read
  71. * @param length length of data to read
  72. * @retval Component status
  73. */
  74. int32_t st7735_recv_data(st7735_ctx_t *ctx, uint8_t *pdata, uint32_t length)
  75. {
  76. return ctx->RecvData(ctx->handle, pdata, length);
  77. }
  78. /**
  79. * @}
  80. */
  81. /**
  82. * @}
  83. */
  84. /**
  85. * @}
  86. */
  87. /**
  88. * @}
  89. */
  90. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/