RTEMS 6.1-rc5
Loading...
Searching...
No Matches
fsl_flexio_mculcd.h
1/*
2 * Copyright (c) 2016, Freescale Semiconductor, Inc.
3 * Copyright 2016-2021, 2022 NXP
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#ifndef _FSL_FLEXIO_MCULCD_H_
10#define _FSL_FLEXIO_MCULCD_H_
11
12#include "fsl_common.h"
13#include "fsl_flexio.h"
14
20/*******************************************************************************
21 * Definitions
22 ******************************************************************************/
23
27#define FSL_FLEXIO_MCULCD_DRIVER_VERSION (MAKE_VERSION(2, 0, 7))
30#ifndef FLEXIO_MCULCD_WAIT_COMPLETE_TIME
41#define FLEXIO_MCULCD_WAIT_COMPLETE_TIME 512
42#endif
43
44#ifndef FLEXIO_MCULCD_DATA_BUS_WIDTH
48#define FLEXIO_MCULCD_DATA_BUS_WIDTH 16UL
49#endif
50
51#if (16UL != FLEXIO_MCULCD_DATA_BUS_WIDTH) && (8UL != FLEXIO_MCULCD_DATA_BUS_WIDTH)
52#error Only support data bus 8-bit or 16-bit
53#endif
54
56enum
57{
61};
62
65{
71
74{
78
81{
84};
85
88{
91};
92
95{
98};
99
101typedef void (*flexio_mculcd_pin_func_t)(bool set);
102
105{
111 uint8_t ENWRPinIndex;
112 uint8_t RDPinIndex;
117 uint8_t timerIndex;
122
125{
126 bool enable;
132 uint32_t baudRate_Bps;
134
137{
142
145{
146 uint32_t command;
151 size_t dataSize;
153
156
164 status_t status,
165 void *userData);
166
169{
173 size_t dataCount;
174 volatile size_t remainingCount;
175 volatile uint32_t state;
177 void *userData;
178};
179
180/*******************************************************************************
181 * API
182 ******************************************************************************/
183
184#if defined(__cplusplus)
185extern "C" {
186#endif /*_cplusplus*/
187
209
216
231
248
259
277
288
302static inline void FLEXIO_MCULCD_EnableTxDMA(FLEXIO_MCULCD_Type *base, bool enable)
303{
304 FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->txShifterStartIndex), enable);
305}
306
313static inline void FLEXIO_MCULCD_EnableRxDMA(FLEXIO_MCULCD_Type *base, bool enable)
314{
315 FLEXIO_EnableShifterStatusDMA(base->flexioBase, (1UL << base->rxShifterEndIndex), enable);
316}
317
327static inline uint32_t FLEXIO_MCULCD_GetTxDataRegisterAddress(FLEXIO_MCULCD_Type *base)
328{
329 return (uint32_t) & (base->flexioBase->SHIFTBUF[base->txShifterStartIndex]);
330}
331
341static inline uint32_t FLEXIO_MCULCD_GetRxDataRegisterAddress(FLEXIO_MCULCD_Type *base)
342{
343 return (uint32_t) & (base->flexioBase->SHIFTBUF[base->rxShifterStartIndex]);
344}
345
362status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz);
363
376
387
400
411
424
435
448
459
466static inline void FLEXIO_MCULCD_Enable(FLEXIO_MCULCD_Type *base, bool enable)
467{
468 if (enable)
469 {
470 FLEXIO_Enable(base->flexioBase, enable);
471 }
472}
473
501
513static inline void FLEXIO_MCULCD_WriteData(FLEXIO_MCULCD_Type *base, uint32_t data)
514{
515 base->flexioBase->SHIFTBUF[base->txShifterStartIndex] = data;
516}
517
523static inline void FLEXIO_MCULCD_StartTransfer(FLEXIO_MCULCD_Type *base)
524{
525 base->setCSPin(false);
526}
527
533static inline void FLEXIO_MCULCD_StopTransfer(FLEXIO_MCULCD_Type *base)
534{
535 base->setCSPin(true);
536}
537
547
558
568void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size);
569
580void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size);
581
594void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size);
595
627 void *userData);
628
647
656
668
676void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle);
677
680#if defined(__cplusplus)
681}
682#endif /*_cplusplus*/
685#endif /*_FSL_FLEXIO_MCULCD_H_*/
void FLEXIO_MCULCD_ClearSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base)
Clear the FLEXIO MCULCD multiple beats write mode configuration.
status_t FLEXIO_MCULCD_TransferGetCount(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, size_t *count)
Gets the data transfer status which used IRQ.
_flexio_mculcd_dma_enable
Define FlexIO MCULCD DMA mask.
Definition: fsl_flexio_mculcd.h:95
flexio_mculcd_pin_func_t setCSPin
Definition: fsl_flexio_mculcd.h:118
void FLEXIO_MCULCD_SetMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base)
Configures the FLEXIO MCULCD to multiple beats read mode.
void FLEXIO_MCULCD_TransferHandleIRQ(void *base, void *handle)
FlexIO MCULCD IRQ handler function.
_flexio_mculcd_status_flags
Define FlexIO MCULCD status mask.
Definition: fsl_flexio_mculcd.h:88
uint32_t FLEXIO_MCULCD_ReadData(FLEXIO_MCULCD_Type *base)
Read data from the FLEXIO MCULCD RX shifter buffer.
uint32_t baudRate_Bps
Definition: fsl_flexio_mculcd.h:132
struct _flexio_mculcd_config flexio_mculcd_config_t
Define FlexIO MCULCD configuration structure.
void FLEXIO_MCULCD_ClearSingleBeatReadConfig(FLEXIO_MCULCD_Type *base)
Clear the FLEXIO MCULCD multiple beats read mode configuration.
void FLEXIO_MCULCD_WaitTransmitComplete(void)
Wait for transmit data send out finished.
uint8_t txShifterEndIndex
Definition: fsl_flexio_mculcd.h:114
flexio_mculcd_transfer_mode_t mode
Definition: fsl_flexio_mculcd.h:147
uint8_t ENWRPinIndex
Definition: fsl_flexio_mculcd.h:111
void FLEXIO_MCULCD_Deinit(FLEXIO_MCULCD_Type *base)
Resets the FLEXIO_MCULCD timer and shifter configuration.
void FLEXIO_MCULCD_EnableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask)
Enables the FlexIO MCULCD interrupt.
_flexio_mculcd_transfer_mode
Transfer mode.
Definition: fsl_flexio_mculcd.h:137
void(* flexio_mculcd_transfer_callback_t)(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, status_t status, void *userData)
FlexIO MCULCD callback for finished transfer.
Definition: fsl_flexio_mculcd.h:162
void FLEXIO_MCULCD_WriteDataArrayBlocking(FLEXIO_MCULCD_Type *base, const void *data, size_t size)
Send data array in blocking way.
uint32_t FLEXIO_MCULCD_GetStatusFlags(FLEXIO_MCULCD_Type *base)
Gets FlexIO MCULCD status flags.
flexio_mculcd_pin_func_t setRSPin
Definition: fsl_flexio_mculcd.h:119
void FLEXIO_MCULCD_ClearMultiBeatsReadConfig(FLEXIO_MCULCD_Type *base)
Clear the FLEXIO MCULCD multiple beats read mode configuration.
size_t dataSize
Definition: fsl_flexio_mculcd.h:151
flexio_mculcd_pin_func_t setRDWRPin
Definition: fsl_flexio_mculcd.h:120
uint8_t dataPinStartIndex
Definition: fsl_flexio_mculcd.h:108
void FLEXIO_MCULCD_DisableInterrupts(FLEXIO_MCULCD_Type *base, uint32_t mask)
Disables the FlexIO MCULCD interrupt.
volatile size_t remainingCount
Definition: fsl_flexio_mculcd.h:174
status_t FLEXIO_MCULCD_TransferCreateHandle(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, flexio_mculcd_transfer_callback_t callback, void *userData)
Initializes the FlexIO MCULCD handle, which is used in transactional functions.
uint32_t dataAddrOrSameValue
Definition: fsl_flexio_mculcd.h:148
void FLEXIO_MCULCD_WriteCommandBlocking(FLEXIO_MCULCD_Type *base, uint32_t command)
Send command in blocking way.
bool enable
Definition: fsl_flexio_mculcd.h:126
status_t FLEXIO_MCULCD_SetBaudRate(FLEXIO_MCULCD_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
Set desired baud rate.
status_t FLEXIO_MCULCD_TransferNonBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle, flexio_mculcd_transfer_t *xfer)
Transfer data using IRQ.
enum _flexio_mculcd_pixel_format flexio_mculcd_pixel_format_t
Define FlexIO MCULCD pixel format.
size_t dataCount
Definition: fsl_flexio_mculcd.h:173
void FLEXIO_MCULCD_SetSingleBeatReadConfig(FLEXIO_MCULCD_Type *base)
Configures the FLEXIO MCULCD to multiple beats read mode.
_flexio_mculcd_pixel_format
Define FlexIO MCULCD pixel format.
Definition: fsl_flexio_mculcd.h:65
void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask)
Clears FlexIO MCULCD status flags.
flexio_mculcd_bus_t busType
Definition: fsl_flexio_mculcd.h:107
enum _flexio_mculcd_bus flexio_mculcd_bus_t
Define FlexIO MCULCD bus type.
bool enableInDebug
Definition: fsl_flexio_mculcd.h:128
void FLEXIO_MCULCD_ReadDataArrayBlocking(FLEXIO_MCULCD_Type *base, void *data, size_t size)
Read data into array in blocking way.
volatile uint32_t state
Definition: fsl_flexio_mculcd.h:175
void(* flexio_mculcd_pin_func_t)(bool set)
Function to set or clear the CS and RS pin.
Definition: fsl_flexio_mculcd.h:101
void FLEXIO_MCULCD_ClearMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base)
Clear the FLEXIO MCULCD multiple beats write mode configuration.
enum _flexio_mculcd_transfer_mode flexio_mculcd_transfer_mode_t
Transfer mode.
flexio_mculcd_transfer_callback_t completionCallback
Definition: fsl_flexio_mculcd.h:176
bool enableInDoze
Definition: fsl_flexio_mculcd.h:127
struct _flexio_mculcd_transfer flexio_mculcd_transfer_t
Define FlexIO MCULCD transfer structure.
_flexio_mculcd_interrupt_enable
Define FlexIO MCULCD interrupt mask.
Definition: fsl_flexio_mculcd.h:81
bool enableFastAccess
Definition: fsl_flexio_mculcd.h:129
uint8_t txShifterStartIndex
Definition: fsl_flexio_mculcd.h:113
uint8_t rxShifterEndIndex
Definition: fsl_flexio_mculcd.h:116
void FLEXIO_MCULCD_TransferBlocking(FLEXIO_MCULCD_Type *base, flexio_mculcd_transfer_t *xfer)
Performs a polling transfer.
void * userData
Definition: fsl_flexio_mculcd.h:177
void FLEXIO_MCULCD_SetSingleBeatWriteConfig(FLEXIO_MCULCD_Type *base)
Configures the FLEXIO MCULCD to multiple beats write mode.
struct _flexio_mculcd_type FLEXIO_MCULCD_Type
Define FlexIO MCULCD access structure typedef.
FLEXIO_Type * flexioBase
Definition: fsl_flexio_mculcd.h:106
void FLEXIO_MCULCD_GetDefaultConfig(flexio_mculcd_config_t *config)
Gets the default configuration to configure the FlexIO MCULCD.
_flexio_mculcd_bus
Define FlexIO MCULCD bus type.
Definition: fsl_flexio_mculcd.h:74
uint8_t rxShifterStartIndex
Definition: fsl_flexio_mculcd.h:115
status_t FLEXIO_MCULCD_Init(FLEXIO_MCULCD_Type *base, flexio_mculcd_config_t *config, uint32_t srcClock_Hz)
Ungates the FlexIO clock, resets the FlexIO module, configures the FlexIO MCULCD hardware,...
void FLEXIO_MCULCD_SetMultiBeatsWriteConfig(FLEXIO_MCULCD_Type *base)
Configures the FLEXIO MCULCD to multiple beats write mode.
uint8_t RDPinIndex
Definition: fsl_flexio_mculcd.h:112
uint32_t dataAddrOrSameValue
Definition: fsl_flexio_mculcd.h:170
void FLEXIO_MCULCD_WriteSameValueBlocking(FLEXIO_MCULCD_Type *base, uint32_t sameValue, size_t size)
Send the same value many times in blocking way.
void FLEXIO_MCULCD_TransferAbort(FLEXIO_MCULCD_Type *base, flexio_mculcd_handle_t *handle)
Aborts the data transfer, which used IRQ.
uint8_t timerIndex
Definition: fsl_flexio_mculcd.h:117
uint32_t command
Definition: fsl_flexio_mculcd.h:146
@ kFLEXIO_MCULCD_TxDmaEnable
Definition: fsl_flexio_mculcd.h:96
@ kFLEXIO_MCULCD_RxDmaEnable
Definition: fsl_flexio_mculcd.h:97
@ kFLEXIO_MCULCD_TxEmptyFlag
Definition: fsl_flexio_mculcd.h:89
@ kFLEXIO_MCULCD_RxFullFlag
Definition: fsl_flexio_mculcd.h:90
@ kFLEXIO_MCULCD_WriteArray
Definition: fsl_flexio_mculcd.h:139
@ kFLEXIO_MCULCD_ReadArray
Definition: fsl_flexio_mculcd.h:138
@ kFLEXIO_MCULCD_WriteSameValue
Definition: fsl_flexio_mculcd.h:140
@ kFLEXIO_MCULCD_BGR888
Definition: fsl_flexio_mculcd.h:69
@ kFLEXIO_MCULCD_BGR565
Definition: fsl_flexio_mculcd.h:67
@ kFLEXIO_MCULCD_RGB565
Definition: fsl_flexio_mculcd.h:66
@ kFLEXIO_MCULCD_RGB888
Definition: fsl_flexio_mculcd.h:68
@ kFLEXIO_MCULCD_TxEmptyInterruptEnable
Definition: fsl_flexio_mculcd.h:82
@ kFLEXIO_MCULCD_RxFullInterruptEnable
Definition: fsl_flexio_mculcd.h:83
@ kStatus_FLEXIO_MCULCD_Busy
Definition: fsl_flexio_mculcd.h:59
@ kStatus_FLEXIO_MCULCD_Idle
Definition: fsl_flexio_mculcd.h:58
@ kStatus_FLEXIO_MCULCD_Error
Definition: fsl_flexio_mculcd.h:60
@ kFLEXIO_MCULCD_8080
Definition: fsl_flexio_mculcd.h:75
@ kFLEXIO_MCULCD_6800
Definition: fsl_flexio_mculcd.h:76
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
Definition: fsl_common.h:47
@ kStatusGroup_FLEXIO_MCULCD
Definition: fsl_common.h:107
Definition: MIMXRT1052.h:20511
Define FlexIO MCULCD configuration structure.
Definition: fsl_flexio_mculcd.h:125
Define FlexIO MCULCD handle structure.
Definition: fsl_flexio_mculcd.h:169
Define FlexIO MCULCD transfer structure.
Definition: fsl_flexio_mculcd.h:145
Define FlexIO MCULCD access structure typedef.
Definition: fsl_flexio_mculcd.h:105
Definition: deflate.c:114