![]() |
|
|||
File indexing completed on 2025-05-11 08:22:59
0001 /* 0002 * Copyright 2019, 2021 NXP 0003 * All rights reserved. 0004 * 0005 * SPDX-License-Identifier: BSD-3-Clause 0006 */ 0007 0008 #ifndef _FSL_FLEXIO_MCULCD_SMARTDMA_H_ 0009 #define _FSL_FLEXIO_MCULCD_SMARTDMA_H_ 0010 0011 #include "fsl_smartdma.h" 0012 #include "fsl_flexio_mculcd.h" 0013 0014 /*! 0015 * @addtogroup flexio_smartdma_mculcd 0016 * @{ 0017 */ 0018 0019 /******************************************************************************* 0020 * Definitions 0021 ******************************************************************************/ 0022 0023 /*@{*/ 0024 /*! @brief FlexIO MCULCD SMARTDMA driver version. */ 0025 #define FSL_FLEXIO_MCULCD_SMARTDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) 0026 /*@}*/ 0027 0028 /*! @brief SMARTDMA transfer size should be multiple of 64 bytes. */ 0029 #define FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN 64U 0030 0031 /*! @brief SMARTDMA transfer memory address should be 4 byte aligned. */ 0032 #define FLEXIO_MCULCD_SMARTDMA_TX_ADDR_ALIGN 4U 0033 0034 /*! @brief typedef for flexio_mculcd_smartdma_handle_t in advance. */ 0035 typedef struct _flexio_mculcd_smartdma_handle flexio_mculcd_smartdma_handle_t; 0036 0037 /*! @brief FlexIO MCULCD master callback for transfer complete. 0038 * 0039 * When transfer finished, the callback function is called and returns the 0040 * @p status as kStatus_FLEXIO_MCULCD_Idle. 0041 */ 0042 typedef void (*flexio_mculcd_smartdma_transfer_callback_t)(FLEXIO_MCULCD_Type *base, 0043 flexio_mculcd_smartdma_handle_t *handle, 0044 status_t status, 0045 void *userData); 0046 0047 /*! @brief FlexIO MCULCD SMARTDMA transfer handle, users should not touch the 0048 * content of the handle.*/ 0049 struct _flexio_mculcd_smartdma_handle 0050 { 0051 FLEXIO_MCULCD_Type *base; /*!< Pointer to the FLEXIO_MCULCD_Type. */ 0052 size_t dataCount; /*!< Total count to be transferred. */ 0053 uint32_t dataAddrOrSameValue; /*!< When sending the same value for many times, 0054 this is the value to send. When writing or reading array, 0055 this is the address of the data array. */ 0056 size_t dataCountUsingEzh; /*!< Data transfered using SMARTDMA. */ 0057 volatile size_t remainingCount; /*!< Remaining count to transfer. */ 0058 volatile uint32_t state; /*!< FlexIO MCULCD driver internal state. */ 0059 uint8_t smartdmaApi; /*!< The SMARTDMA API used during transfer. */ 0060 bool needColorConvert; /*!< Need color convert or not. */ 0061 uint8_t blockingXferBuffer[FLEXIO_MCULCD_SMARTDMA_TX_LEN_ALIGN * 3 / 0062 2]; /*!< Used for blocking method color space convet. */ 0063 flexio_mculcd_smartdma_transfer_callback_t completionCallback; /*!< Callback for MCULCD SMARTDMA transfer */ 0064 void *userData; /*!< User Data for MCULCD SMARTDMA callback */ 0065 smartdma_flexio_mculcd_param_t smartdmaParam; /*!< SMARTDMA function parameters. */ 0066 uint32_t smartdmaStack[1]; /*!< SMARTDMA function stack. */ 0067 }; 0068 0069 /*! @brief FlexIO MCULCD SMARTDMA configuration. */ 0070 typedef struct _flexio_mculcd_smartdma_config 0071 { 0072 flexio_mculcd_pixel_format_t inputPixelFormat; /*!< The pixel format in the frame buffer. */ 0073 flexio_mculcd_pixel_format_t outputPixelFormat; /*!< The pixel format on the 8080/68k bus. */ 0074 } flexio_mculcd_smartdma_config_t; 0075 0076 /******************************************************************************* 0077 * APIs 0078 ******************************************************************************/ 0079 #if defined(__cplusplus) 0080 extern "C" { 0081 #endif 0082 0083 /*! 0084 * @name SMARTDMA Transactional 0085 * @{ 0086 */ 0087 0088 /*! 0089 * @brief Initializes the FLEXO MCULCD master SMARTDMA handle. 0090 * 0091 * This function initializes the FLEXO MCULCD master SMARTDMA handle which can be 0092 * used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD 0093 * instance, call this API once to get the initialized handle. 0094 * 0095 * @param base Pointer to FLEXIO_MCULCD_Type structure. 0096 * @param handle Pointer to flexio_mculcd_smartdma_handle_t structure to store the 0097 * transfer state. 0098 * @param config Pointer to the configuration. 0099 * @param callback MCULCD transfer complete callback, NULL means no callback. 0100 * @param userData callback function parameter. 0101 * @retval kStatus_Success Successfully create the handle. 0102 */ 0103 status_t FLEXIO_MCULCD_TransferCreateHandleSMARTDMA(FLEXIO_MCULCD_Type *base, 0104 flexio_mculcd_smartdma_handle_t *handle, 0105 const flexio_mculcd_smartdma_config_t *config, 0106 flexio_mculcd_smartdma_transfer_callback_t callback, 0107 void *userData); 0108 0109 /*! 0110 * @brief Performs a non-blocking FlexIO MCULCD transfer using SMARTDMA. 0111 * 0112 * This function returns immediately after transfer initiates. Use the callback 0113 * function to check whether the transfer is completed. 0114 * 0115 * @param base pointer to FLEXIO_MCULCD_Type structure. 0116 * @param handle pointer to flexio_mculcd_smartdma_handle_t structure to store the 0117 * transfer state. 0118 * @param xfer Pointer to FlexIO MCULCD transfer structure. 0119 * @retval kStatus_Success Successfully start a transfer. 0120 * @retval kStatus_InvalidArgument Input argument is invalid. 0121 * @retval kStatus_FLEXIO_MCULCD_Busy FlexIO MCULCD is not idle, it is running another 0122 * transfer. 0123 */ 0124 status_t FLEXIO_MCULCD_TransferSMARTDMA(FLEXIO_MCULCD_Type *base, 0125 flexio_mculcd_smartdma_handle_t *handle, 0126 flexio_mculcd_transfer_t *xfer); 0127 0128 /*! 0129 * @brief Aborts a FlexIO MCULCD transfer using SMARTDMA. 0130 * 0131 * @param base pointer to FLEXIO_MCULCD_Type structure. 0132 * @param handle FlexIO MCULCD SMARTDMA handle pointer. 0133 */ 0134 void FLEXIO_MCULCD_TransferAbortSMARTDMA(FLEXIO_MCULCD_Type *base, flexio_mculcd_smartdma_handle_t *handle); 0135 0136 /*! 0137 * @brief Gets the remaining bytes for FlexIO MCULCD SMARTDMA transfer. 0138 * 0139 * @param base pointer to FLEXIO_MCULCD_Type structure. 0140 * @param handle FlexIO MCULCD SMARTDMA handle pointer. 0141 * @param count Number of count transferred so far by the SMARTDMA transaction. 0142 * @retval kStatus_Success Get the transferred count Successfully. 0143 * @retval kStatus_NoTransferInProgress No transfer in process. 0144 */ 0145 status_t FLEXIO_MCULCD_TransferGetCountSMARTDMA(FLEXIO_MCULCD_Type *base, 0146 flexio_mculcd_smartdma_handle_t *handle, 0147 size_t *count); 0148 0149 /*! @} */ 0150 0151 #if defined(__cplusplus) 0152 } 0153 #endif 0154 0155 /*! 0156 * @} 0157 */ 0158 #endif /* _FSL_FLEXIO_MCULCD_SMARTDMA_H_ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |