1 /* 2 * Copyright (c) 2016, Freescale Semiconductor, Inc. 3 * Copyright 2016-2020 NXP 4 * All rights reserved. 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 */ 8 9 #ifndef _RTE_DEVICE_H 10 #define _RTE_DEVICE_H 11 12 #include "pin_mux.h" 13 14 /* UART Select, LPUART0 - LPUART2. */ 15 /* User needs to provide the implementation of LPUARTX_GetFreq/LPUARTX_InitPins/LPUARTX_DeinitPins for the enabled 16 * LPUART instance. */ 17 #define RTE_USART0 0 18 #define RTE_USART0_DMA_EN 0 19 #define RTE_USART1 0 20 #define RTE_USART1_DMA_EN 0 21 #define RTE_USART2 0 22 #define RTE_USART2_DMA_EN 0 23 24 /* UART configuration. */ 25 #define USART_RX_BUFFER_LEN 64 26 #define USART0_RX_BUFFER_ENABLE 0 27 #define USART1_RX_BUFFER_ENABLE 0 28 #define USART2_RX_BUFFER_ENABLE 0 29 30 #define RTE_USART0_PIN_INIT LPUART0_InitPins 31 #define RTE_USART0_PIN_DEINIT LPUART0_DeinitPins 32 #define RTE_USART0_DMA_TX_CH 0 33 #define RTE_USART0_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPUART0Tx 34 #define RTE_USART0_DMA_TX_DMAMUX_BASE DMAMUX0 35 #define RTE_USART0_DMA_TX_DMA_BASE DMA0 36 #define RTE_USART0_DMA_RX_CH 1 37 #define RTE_USART0_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPUART0Rx 38 #define RTE_USART0_DMA_RX_DMAMUX_BASE DMAMUX0 39 #define RTE_USART0_DMA_RX_DMA_BASE DMA0 40 41 #define RTE_USART1_PIN_INIT LPUART1_InitPins 42 #define RTE_USART1_PIN_DEINIT LPUART1_DeinitPins 43 #define RTE_USART1_DMA_TX_CH 0 44 #define RTE_USART1_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPUART1Tx 45 #define RTE_USART1_DMA_TX_DMAMUX_BASE DMAMUX0 46 #define RTE_USART1_DMA_TX_DMA_BASE DMA0 47 #define RTE_USART1_DMA_RX_CH 1 48 #define RTE_USART1_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPUART1Rx 49 #define RTE_USART1_DMA_RX_DMAMUX_BASE DMAMUX0 50 #define RTE_USART1_DMA_RX_DMA_BASE DMA0 51 52 #define RTE_USART2_PIN_INIT LPUART2_InitPins 53 #define RTE_USART2_PIN_DEINIT LPUART2_DeinitPins 54 #define RTE_USART2_DMA_TX_CH 0 55 #define RTE_USART2_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPUART2Tx 56 #define RTE_USART2_DMA_TX_DMAMUX_BASE DMAMUX0 57 #define RTE_USART2_DMA_TX_DMA_BASE DMA0 58 #define RTE_USART2_DMA_RX_CH 1 59 #define RTE_USART2_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPUART2Rx 60 #define RTE_USART2_DMA_RX_DMAMUX_BASE DMAMUX0 61 #define RTE_USART2_DMA_RX_DMA_BASE DMA0 62 63 /* I2C Select, LPI2C0 - LPI2C2. */ 64 /* User needs to provide the implementation of LPI2CX_GetFreq/LPI2CX_InitPins/LPI2CX_DeinitPins for the enabled LPI2C 65 * instance. */ 66 #define RTE_I2C0 0 67 #define RTE_I2C0_DMA_EN 0 68 #define RTE_I2C1 0 69 #define RTE_I2C1_DMA_EN 0 70 #define RTE_I2C2 0 71 #define RTE_I2C2_DMA_EN 0 72 73 /* LPI2C configuration. */ 74 #define RTE_I2C0_PIN_INIT LPI2C0_InitPins 75 #define RTE_I2C0_PIN_DEINIT LPI2C0_DeinitPins 76 #define RTE_I2C0_DMA_TX_CH 0 77 #define RTE_I2C0_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPI2C0Tx 78 #define RTE_I2C0_DMA_TX_DMAMUX_BASE DMAMUX0 79 #define RTE_I2C0_DMA_TX_DMA_BASE DMA0 80 #define RTE_I2C0_DMA_RX_CH 1 81 #define RTE_I2C0_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPI2C0Rx 82 #define RTE_I2C0_DMA_RX_DMAMUX_BASE DMAMUX0 83 #define RTE_I2C0_DMA_RX_DMA_BASE DMA0 84 85 #define RTE_I2C1_PIN_INIT LPI2C1_InitPins 86 #define RTE_I2C1_PIN_DEINIT LPI2C1_DeinitPins 87 #define RTE_I2C1_DMA_TX_CH 0 88 #define RTE_I2C1_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPI2C1Tx 89 #define RTE_I2C1_DMA_TX_DMAMUX_BASE DMAMUX0 90 #define RTE_I2C1_DMA_TX_DMA_BASE DMA0 91 #define RTE_I2C1_DMA_RX_CH 1 92 #define RTE_I2C1_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPI2C1Rx 93 #define RTE_I2C1_DMA_RX_DMAMUX_BASE DMAMUX0 94 #define RTE_I2C1_DMA_RX_DMA_BASE DMA0 95 96 #define RTE_I2C2_PIN_INIT LPI2C2_InitPins 97 #define RTE_I2C2_PIN_DEINIT LPI2C2_DeinitPins 98 #define RTE_I2C2_DMA_TX_CH 0 99 #define RTE_I2C2_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPI2C2Tx 100 #define RTE_I2C2_DMA_TX_DMAMUX_BASE DMAMUX0 101 #define RTE_I2C2_DMA_TX_DMA_BASE DMA0 102 #define RTE_I2C2_DMA_RX_CH 1 103 #define RTE_I2C2_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPI2C2Rx 104 #define RTE_I2C2_DMA_RX_DMAMUX_BASE DMAMUX0 105 #define RTE_I2C2_DMA_RX_DMA_BASE DMA0 106 107 /*SPI Select, LPSPI0 - LPSPI2.*/ 108 /* User needs to provide the implementation of LPSPIX_GetFreq/LPSPIX_InitPins/LPSPIX_DeinitPins for the enabled LPSPI 109 * instance. */ 110 #define RTE_SPI0 0 111 #define RTE_SPI0_DMA_EN 0 112 #define RTE_SPI1 0 113 #define RTE_SPI1_DMA_EN 0 114 #define RTE_SPI2 0 115 #define RTE_SPI2_DMA_EN 0 116 117 /* SPI configuration. */ 118 #define RTE_SPI0_PCS_TO_SCK_DELAY 1000 119 #define RTE_SPI0_SCK_TO_PSC_DELAY 1000 120 #define RTE_SPI0_BETWEEN_TRANSFER_DELAY 1000 121 #define RTE_SPI0_MASTER_PCS_PIN_SEL (kLPSPI_MasterPcs0) 122 #define RTE_SPI0_SLAVE_PCS_PIN_SEL (kLPSPI_SlavePcs0) 123 #define RTE_SPI0_PIN_INIT LPSPI0_InitPins 124 #define RTE_SPI0_PIN_DEINIT LPSPI0_DeinitPins 125 #define RTE_SPI0_DMA_TX_CH 0 126 #define RTE_SPI0_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPSPI0Tx 127 #define RTE_SPI0_DMA_TX_DMAMUX_BASE DMAMUX0 128 #define RTE_SPI0_DMA_TX_DMA_BASE DMA0 129 #define RTE_SPI0_DMA_RX_CH 1 130 #define RTE_SPI0_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPSPI0Rx 131 #define RTE_SPI0_DMA_RX_DMAMUX_BASE DMAMUX0 132 #define RTE_SPI0_DMA_RX_DMA_BASE DMA0 133 134 #define RTE_SPI1_PCS_TO_SCK_DELAY 1000 135 #define RTE_SPI1_SCK_TO_PSC_DELAY 1000 136 #define RTE_SPI1_BETWEEN_TRANSFER_DELAY 1000 137 #define RTE_SPI1_MASTER_PCS_PIN_SEL (kLPSPI_MasterPcs0) 138 #define RTE_SPI1_SLAVE_PCS_PIN_SEL (kLPSPI_SlavePcs0) 139 #define RTE_SPI1_PIN_INIT LPSPI1_InitPins 140 #define RTE_SPI1_PIN_DEINIT LPSPI1_DeinitPins 141 #define RTE_SPI1_DMA_TX_CH 0 142 #define RTE_SPI1_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPSPI1Tx 143 #define RTE_SPI1_DMA_TX_DMAMUX_BASE DMAMUX0 144 #define RTE_SPI1_DMA_TX_DMA_BASE DMA0 145 #define RTE_SPI1_DMA_RX_CH 1 146 #define RTE_SPI1_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPSPI1Rx 147 #define RTE_SPI1_DMA_RX_DMAMUX_BASE DMAMUX0 148 #define RTE_SPI1_DMA_RX_DMA_BASE DMA0 149 150 #define RTE_SPI2_PCS_TO_SCK_DELAY 1000 151 #define RTE_SPI2_SCK_TO_PSC_DELAY 1000 152 #define RTE_SPI2_BETWEEN_TRANSFER_DELAY 1000 153 #define RTE_SPI2_MASTER_PCS_PIN_SEL (kLPSPI_MasterPcs0) 154 #define RTE_SPI2_SLAVE_PCS_PIN_SEL (kLPSPI_SlavePcs0) 155 #define RTE_SPI2_PIN_INIT LPSPI2_InitPins 156 #define RTE_SPI2_PIN_DEINIT LPSPI2_DeinitPins 157 #define RTE_SPI2_DMA_TX_CH 0 158 #define RTE_SPI2_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMux0LPSPI2Tx 159 #define RTE_SPI2_DMA_TX_DMAMUX_BASE DMAMUX0 160 #define RTE_SPI2_DMA_TX_DMA_BASE DMA0 161 #define RTE_SPI2_DMA_RX_CH 1 162 #define RTE_SPI2_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMux0LPSPI2Rx 163 #define RTE_SPI2_DMA_RX_DMAMUX_BASE DMAMUX0 164 #define RTE_SPI2_DMA_RX_DMA_BASE DMA0 165 166 #endif /* _RTE_DEVICE_H */ 167