1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
/*
* Copyright 2019 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _FSL_DBI_H_
#define _FSL_DBI_H_
#include "fsl_common.h"
/*!
* @addtogroup dbi
* @{
*/
/*******************************************************************************
* Definitions
******************************************************************************/
/*!
* @brief Callback function when the writeMemory or readMemory finished.
*
* If transfer done successfully, the @p status is kStatus_Success.
*/
typedef void (*dbi_mem_done_callback_t)(status_t status, void *userData);
/*!
* @brief DBI interface (MCU LCD) transfer operation.
*
* The API @ref writeCommand and @ref writeData are blocking method, they returns
* only when transfer finished. They are usually used to transfer small data, for
* example, sending the cofigurations.
*
* The API @ref writeMemory and @ref readMemory are non-blocking method, they are
* used to write or read the LCD contoller video memory. These APIs start transfer
* and return directly, upper layer could be notified by callback when transfer
* done. The callback function is set by @ref setMemoryDoneCallback.
*/
typedef struct _dbi_xfer_ops
{
status_t (*writeCommand)(void *dbiXferHandle, uint32_t command); /*!< Write command. */
status_t (*writeData)(void *dbiXferHandle, void *data, uint32_t len_byte); /*!< Write data. */
status_t (*writeMemory)(void *dbiXferHandle,
uint32_t command,
const void *data,
uint32_t len_byte); /*!< Write to the memory. */
status_t (*readMemory)(void *dbiXferHandle,
uint32_t command,
void *data,
uint32_t len_byte); /*!< Read from the memory. */
void (*setMemoryDoneCallback)(void *dbiXferHandle,
dbi_mem_done_callback_t callback,
void *userData); /*!< Set the memory access done callback. */
} dbi_xfer_ops_t;
/*******************************************************************************
* API
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
}
#endif
/*! @} */
#endif /* _FSL_DBI_H_ */
|