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 
20 /* Includes ------------------------------------------------------------------*/
21 #include "st7735_reg.h"
22 
23 /** @addtogroup BSP
24   * @{
25   */
26 
27 /** @addtogroup Components
28   * @{
29   */
30 
31 /** @addtogroup ST7735_REG
32   * @{
33   */
34 
35 /** @addtogroup ST7735_REG_Exported_Functions
36   * @{
37   */
38 
39 /**
40   * @brief  Read ST7735 register
41   * @param  ctx   Component context
42   * @param  reg   Register to read
43   * @param  pdata data to read from the register
44   * @retval Component status
45   */
st7735_read_reg(st7735_ctx_t * ctx,uint8_t reg,uint8_t * pdata)46 int32_t st7735_read_reg(st7735_ctx_t *ctx, uint8_t reg, uint8_t *pdata)
47 {
48   return ctx->ReadReg(ctx->handle, reg, pdata);
49 }
50 
51 /**
52   * @brief  Write ST7735 register
53   * @param  ctx    Component context
54   * @param  reg    Register to write
55   * @param  pdata  data to write to the register
56   * @param  length length of data to write to the register
57   * @retval Component status
58   */
st7735_write_reg(st7735_ctx_t * ctx,uint8_t reg,uint8_t * pdata,uint32_t length)59 int32_t st7735_write_reg(st7735_ctx_t *ctx, uint8_t reg, uint8_t *pdata, uint32_t length)
60 {
61   return ctx->WriteReg(ctx->handle, reg, pdata, length);
62 }
63 
64 /**
65   * @brief  Send data
66   * @param  ctx    Component context
67   * @param  pdata  data to write
68   * @param  length length of data to write
69   * @retval Component status
70   */
st7735_send_data(st7735_ctx_t * ctx,uint8_t * pdata,uint32_t length)71 int32_t st7735_send_data(st7735_ctx_t *ctx, uint8_t *pdata, uint32_t length)
72 {
73   return ctx->SendData(ctx->handle, pdata, length);
74 }
75 
76 /**
77   * @brief  Recieve data
78   * @param  ctx    Component context
79   * @param  pdata  data to read
80   * @param  length length of data to read
81   * @retval Component status
82   */
st7735_recv_data(st7735_ctx_t * ctx,uint8_t * pdata,uint32_t length)83 int32_t st7735_recv_data(st7735_ctx_t *ctx, uint8_t *pdata, uint32_t length)
84 {
85   return ctx->RecvData(ctx->handle, pdata, length);
86 }
87 
88 /**
89   * @}
90   */
91 
92 /**
93   * @}
94   */
95 
96 /**
97   * @}
98   */
99 
100 /**
101   * @}
102   */
103 
104 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
105