Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LG by
el_lin.h@21:bc8c1cec3da6, 2016-02-03 (annotated)
- Committer:
- igor_v
- Date:
- Wed Feb 03 07:19:30 2016 +0000
- Revision:
- 21:bc8c1cec3da6
- Parent:
- 0:8ad47e2b6f00
- Child:
- 91:a2bb81eaa183
?????????? ??????? ??????????, ???????? ??? ?????? ?????????? ??????????? ?????????.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| igor_v | 0:8ad47e2b6f00 | 1 | /**--------------File Info--------------------------------------------------------------------------------- |
| igor_v | 0:8ad47e2b6f00 | 2 | ** File name: el_lin.h |
| igor_v | 0:8ad47e2b6f00 | 3 | ** Last modified Date: 2011-08-22 |
| igor_v | 0:8ad47e2b6f00 | 4 | ** Last Version: V1.00 |
| igor_v | 21:bc8c1cec3da6 | 5 | ** Descriptions: |
| igor_v | 0:8ad47e2b6f00 | 6 | ** |
| igor_v | 0:8ad47e2b6f00 | 7 | **-------------------------------------------------------------------------------------------------------- |
| igor_v | 0:8ad47e2b6f00 | 8 | ** Created by: Electrooptika incor. |
| igor_v | 0:8ad47e2b6f00 | 9 | ** Created date: 2011-08-22 |
| igor_v | 0:8ad47e2b6f00 | 10 | ** Version: V1.00 |
| igor_v | 0:8ad47e2b6f00 | 11 | ** |
| igor_v | 21:bc8c1cec3da6 | 12 | **-------------------------------------------------------------------------------------------------------- |
| igor_v | 0:8ad47e2b6f00 | 13 | *********************************************************************************************************/ |
| igor_v | 21:bc8c1cec3da6 | 14 | #ifndef __DMA_H |
| igor_v | 0:8ad47e2b6f00 | 15 | #define __DMA_H |
| igor_v | 0:8ad47e2b6f00 | 16 | |
| igor_v | 0:8ad47e2b6f00 | 17 | |
| igor_v | 0:8ad47e2b6f00 | 18 | |
| igor_v | 21:bc8c1cec3da6 | 19 | #define STRT_ERR 0x0080 //e. error of the start bit //r. ошибка старт-бита |
| igor_v | 21:bc8c1cec3da6 | 20 | #define STOP_ERR 0x0040 //e. error of the stop bit //r. ошибка стоп-бита |
| igor_v | 21:bc8c1cec3da6 | 21 | #define SIZE_ERR 0x0004 //e. size of the received data packet mismatches the agreement //r. размер принятого пакета не соответствует соглашению |
| igor_v | 21:bc8c1cec3da6 | 22 | #define LCC_ERR 0x0002 //e. checksum has not coincided //r. не совпала контрольная сумма |
| igor_v | 21:bc8c1cec3da6 | 23 | #define NO_CMD_ERR 0x0100 //e. in the received packet there is no attribute of command //r. в принятом пакете нет признака команды |
| igor_v | 21:bc8c1cec3da6 | 24 | #define CODE_ERR 0x0200 //e. unknown code of a command //r. неизвестный код команды |
| igor_v | 21:bc8c1cec3da6 | 25 | #define MODE_ERR 0x0400 //e. code of a command mismatches a current mode //r. код команды не соответствует текущему режиму |
| igor_v | 21:bc8c1cec3da6 | 26 | #define PARAM_ERR 0x0800 //e. parameters of a command was set incorrectly //r. неверно заданные параметры команды |
| igor_v | 21:bc8c1cec3da6 | 27 | #define MAXSIZE_ERR 0x1000 //e. receiver buffer overflow //r. переполнение буфера приемника |
| igor_v | 21:bc8c1cec3da6 | 28 | #define ADDR_ERR 0x2000 //e. incorrect address of the device //r. неверный адрес устройства |
| igor_v | 21:bc8c1cec3da6 | 29 | #define READ_ERR 0x4000 //e. stop of link because of untimely data read //r. останов связи несвоевременным чтением данных |
| igor_v | 21:bc8c1cec3da6 | 30 | #define WASQ_ERR 0x8000 //e. error of waiting of authentic answer //r. ошибка ожидания достоверного ответа |
| igor_v | 0:8ad47e2b6f00 | 31 | |
| igor_v | 21:bc8c1cec3da6 | 32 | #define Trm_En_Rd 0x0080 //e. a mask of permission/readiness of transmitter of the 2 line //r. маска разрешения/готовности передатчика линии 2 |
| igor_v | 21:bc8c1cec3da6 | 33 | #define Rcv_Rdy 0x0040 //e. a mask of the readiness bit of the receiver //r. маска бита готовности приемника |
| igor_v | 21:bc8c1cec3da6 | 34 | #define Rcv_Ferr 0x0020 //e. a mask of the "format error" bit //r. маска бита "ошибка формата" |
| igor_v | 21:bc8c1cec3da6 | 35 | #define Rcv_Tout 0x0010 //e. a mask of the "time-out" bit //r. маска бита "тайм-аут" |
| igor_v | 21:bc8c1cec3da6 | 36 | #define Rcv_Rful 0x0008 //e. a mask of the "stack is full" bit //r. маска бита "стек полон" |
| igor_v | 0:8ad47e2b6f00 | 37 | |
| igor_v | 0:8ad47e2b6f00 | 38 | |
| igor_v | 0:8ad47e2b6f00 | 39 | #define FIFOs_En 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 40 | #define RX_FIFO_Reset 0x00000002 |
| igor_v | 0:8ad47e2b6f00 | 41 | #define TX_FIFO_Reset 0x00000004 |
| igor_v | 0:8ad47e2b6f00 | 42 | #define DMA_Mode_UART 0x00000008 |
| igor_v | 0:8ad47e2b6f00 | 43 | #define RX_TrigLvl_1 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 44 | #define RX_TrigLvl_4 0x00000040 |
| igor_v | 0:8ad47e2b6f00 | 45 | #define RX_TrigLvl_8 0x00000080 |
| igor_v | 0:8ad47e2b6f00 | 46 | #define RX_TrigLvl_14 0x000000C0 |
| igor_v | 0:8ad47e2b6f00 | 47 | |
| igor_v | 0:8ad47e2b6f00 | 48 | #define word_length_8 0x00000003 |
| igor_v | 0:8ad47e2b6f00 | 49 | |
| igor_v | 0:8ad47e2b6f00 | 50 | #define one_stop_bit 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 51 | |
| igor_v | 0:8ad47e2b6f00 | 52 | #define no_parity 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 53 | |
| igor_v | 0:8ad47e2b6f00 | 54 | #define back_trans_dis 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 55 | |
| igor_v | 0:8ad47e2b6f00 | 56 | #define DLAB_access 0x00000080 |
| igor_v | 0:8ad47e2b6f00 | 57 | |
| igor_v | 0:8ad47e2b6f00 | 58 | #define TRANS_SHIFT_BUF_EMPTY 0x00000040 |
| igor_v | 0:8ad47e2b6f00 | 59 | #define DMA_BUSY 0x00020000 |
| igor_v | 0:8ad47e2b6f00 | 60 | #define RecievBufEmpty 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 61 | #define DIS_ALL_INT 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 62 | #define RBR_IntEnabl 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 63 | /* Second half of the second RAM is used for GPDMA operation. */ |
| igor_v | 0:8ad47e2b6f00 | 64 | |
| igor_v | 0:8ad47e2b6f00 | 65 | #define DMA_UART0_TX 8 |
| igor_v | 0:8ad47e2b6f00 | 66 | #define DMA_UART0_RX 9 |
| igor_v | 0:8ad47e2b6f00 | 67 | #define DMA_UART1_TX 10 |
| igor_v | 0:8ad47e2b6f00 | 68 | #define DMA_UART1_RX 11 |
| igor_v | 0:8ad47e2b6f00 | 69 | #define DMA_UART2_TX 12 |
| igor_v | 0:8ad47e2b6f00 | 70 | #define DMA_UART2_RX 13 |
| igor_v | 0:8ad47e2b6f00 | 71 | #define DMA_UART3_TX 14 |
| igor_v | 0:8ad47e2b6f00 | 72 | #define DMA_UART3_RX 15 |
| igor_v | 0:8ad47e2b6f00 | 73 | |
| igor_v | 0:8ad47e2b6f00 | 74 | #define DMA_MEMORY 0 |
| igor_v | 0:8ad47e2b6f00 | 75 | #define SrcDMA_UART0_RX DMA_UART0_RX << 1 |
| igor_v | 0:8ad47e2b6f00 | 76 | #define SrcDMA_UART0_TX DMA_UART0_TX << 1 |
| igor_v | 0:8ad47e2b6f00 | 77 | #define SrcDMA_UART1_TX DMA_UART1_TX << 1 |
| igor_v | 0:8ad47e2b6f00 | 78 | #define DstDMA_UART0_TX DMA_UART0_TX << 6 |
| igor_v | 0:8ad47e2b6f00 | 79 | #define DstDMA_UART1_TX DMA_UART1_TX << 6 |
| igor_v | 0:8ad47e2b6f00 | 80 | #define DstDMA_UART0_RX DMA_UART0_RX << 6 |
| igor_v | 0:8ad47e2b6f00 | 81 | #define SrcDMA_UART1_RX DMA_UART1_RX << 1 |
| igor_v | 0:8ad47e2b6f00 | 82 | #define DstDMA_UART1_RX DMA_UART1_RX << 6 |
| igor_v | 0:8ad47e2b6f00 | 83 | |
| igor_v | 0:8ad47e2b6f00 | 84 | /* UART0 TX and RX */ |
| igor_v | 0:8ad47e2b6f00 | 85 | #define UART0_DMA_TX_SRC 0x2007C800 /* starting addr of DATA register in UART0 */ |
| igor_v | 0:8ad47e2b6f00 | 86 | #define UART0_DMA_TX_DST LPC_UART0_BASE |
| igor_v | 0:8ad47e2b6f00 | 87 | #define UART0_DMA_RX_SRC LPC_UART0_BASE |
| igor_v | 0:8ad47e2b6f00 | 88 | #define UART0_DMA_RX_DST 0x2007C900 |
| igor_v | 0:8ad47e2b6f00 | 89 | |
| igor_v | 0:8ad47e2b6f00 | 90 | #define UART2_DMA_TX_DST LPC_UART2_BASE |
| igor_v | 0:8ad47e2b6f00 | 91 | #define UART1_DMA_TX_DST LPC_UART1_BASE |
| igor_v | 0:8ad47e2b6f00 | 92 | |
| igor_v | 0:8ad47e2b6f00 | 93 | #define GPDMA_POWER_ON 0x20000000 |
| igor_v | 0:8ad47e2b6f00 | 94 | |
| igor_v | 0:8ad47e2b6f00 | 95 | #define UART_REQ 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 96 | |
| igor_v | 0:8ad47e2b6f00 | 97 | //To clear particular DMA TC-interrupts |
| igor_v | 0:8ad47e2b6f00 | 98 | #define DMA0_IntTCClear 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 99 | #define DMA1_IntTCClear 0x00000002 |
| igor_v | 0:8ad47e2b6f00 | 100 | #define DMA2_IntTCClear 0x00000004 |
| igor_v | 0:8ad47e2b6f00 | 101 | #define DMA3_IntTCClear 0x00000008 |
| igor_v | 0:8ad47e2b6f00 | 102 | #define DMA4_IntTCClear 0x00000010 |
| igor_v | 0:8ad47e2b6f00 | 103 | #define DMA5_IntTCClear 0x00000020 |
| igor_v | 0:8ad47e2b6f00 | 104 | #define DMA6_IntTCClear 0x00000040 |
| igor_v | 0:8ad47e2b6f00 | 105 | #define DMA7_IntTCClear 0x00000080 |
| igor_v | 0:8ad47e2b6f00 | 106 | |
| igor_v | 0:8ad47e2b6f00 | 107 | //To clear particular DMA Error-interrupts |
| igor_v | 0:8ad47e2b6f00 | 108 | #define DMA0_IntErrClear 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 109 | #define DMA1_IntErrClear 0x00000002 |
| igor_v | 0:8ad47e2b6f00 | 110 | #define DMA2_IntErrClear 0x00000004 |
| igor_v | 0:8ad47e2b6f00 | 111 | #define DMA3_IntErrClear 0x00000008 |
| igor_v | 0:8ad47e2b6f00 | 112 | #define DMA4_IntErrClear 0x00000010 |
| igor_v | 0:8ad47e2b6f00 | 113 | #define DMA5_IntErrClear 0x00000020 |
| igor_v | 0:8ad47e2b6f00 | 114 | #define DMA6_IntErrClear 0x00000040 |
| igor_v | 0:8ad47e2b6f00 | 115 | #define DMA7_IntErrClear 0x00000080 |
| igor_v | 0:8ad47e2b6f00 | 116 | #define DMACH1_IntTCPend 0x00000002 |
| igor_v | 0:8ad47e2b6f00 | 117 | |
| igor_v | 0:8ad47e2b6f00 | 118 | #define DMA_ControllerEn 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 119 | |
| igor_v | 0:8ad47e2b6f00 | 120 | #define DMA_AHB_Little 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 121 | #define DMA_AHB_Big 0x00000002 |
| igor_v | 0:8ad47e2b6f00 | 122 | |
| igor_v | 0:8ad47e2b6f00 | 123 | #define SrcBSize_1 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 124 | #define SrcBSize_4 0x00001000 |
| igor_v | 0:8ad47e2b6f00 | 125 | #define SrcBSize_8 0x00002000 |
| igor_v | 0:8ad47e2b6f00 | 126 | #define SrcBSize_16 0x00003000 |
| igor_v | 0:8ad47e2b6f00 | 127 | #define SrcBSize_32 0x00004000 |
| igor_v | 0:8ad47e2b6f00 | 128 | #define SrcBSize_64 0x00005000 |
| igor_v | 0:8ad47e2b6f00 | 129 | #define SrcBSize_128 0x00006000 |
| igor_v | 0:8ad47e2b6f00 | 130 | #define SrcBSize_256 0x00007000 |
| igor_v | 0:8ad47e2b6f00 | 131 | |
| igor_v | 0:8ad47e2b6f00 | 132 | #define DstBSize_1 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 133 | #define DstBSize_4 0x00008000 |
| igor_v | 0:8ad47e2b6f00 | 134 | #define DstBSize_8 0x00010000 |
| igor_v | 0:8ad47e2b6f00 | 135 | #define DstBSize_16 0x00018000 |
| igor_v | 0:8ad47e2b6f00 | 136 | #define DstBSize_32 0x00020000 |
| igor_v | 0:8ad47e2b6f00 | 137 | #define DstBSize_64 0x00028000 |
| igor_v | 0:8ad47e2b6f00 | 138 | #define DstBSize_128 0x00030000 |
| igor_v | 0:8ad47e2b6f00 | 139 | #define DstBSize_256 0x00038000 |
| igor_v | 0:8ad47e2b6f00 | 140 | |
| igor_v | 0:8ad47e2b6f00 | 141 | #define SrcWidth_8b 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 142 | #define SrcWidth_16b 0x00020000 |
| igor_v | 0:8ad47e2b6f00 | 143 | #define SrcWidth_32b 0x00040000 |
| igor_v | 0:8ad47e2b6f00 | 144 | |
| igor_v | 0:8ad47e2b6f00 | 145 | #define DstWidth_8b 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 146 | #define DstWidth_16b 0x00200000 |
| igor_v | 0:8ad47e2b6f00 | 147 | #define DstWidth_32b 0x00400000 |
| igor_v | 0:8ad47e2b6f00 | 148 | |
| igor_v | 0:8ad47e2b6f00 | 149 | #define SrcInc 0x04000000 |
| igor_v | 0:8ad47e2b6f00 | 150 | #define SrcFixed 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 151 | |
| igor_v | 0:8ad47e2b6f00 | 152 | #define DstInc 0x08000000 |
| igor_v | 0:8ad47e2b6f00 | 153 | #define DstFixed 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 154 | |
| igor_v | 0:8ad47e2b6f00 | 155 | #define TCIntEnabl 0x80000000 |
| igor_v | 21:bc8c1cec3da6 | 156 | #define TCIntDisabl 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 157 | |
| igor_v | 0:8ad47e2b6f00 | 158 | #define DMAChannelEn 0x00000001 |
| igor_v | 0:8ad47e2b6f00 | 159 | #define DMAChannelDis 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 160 | |
| igor_v | 0:8ad47e2b6f00 | 161 | #define CH2_ENABLED 0x00000004 |
| igor_v | 0:8ad47e2b6f00 | 162 | |
| igor_v | 0:8ad47e2b6f00 | 163 | #define DONtMaskTCInt 0x00008000 |
| igor_v | 0:8ad47e2b6f00 | 164 | #define MaskTCInt 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 165 | #define DONtMaskErrInt 0x00004000 |
| igor_v | 0:8ad47e2b6f00 | 166 | #define MaskErrInt 0x00000000 |
| igor_v | 0:8ad47e2b6f00 | 167 | |
| igor_v | 0:8ad47e2b6f00 | 168 | #define INT_DMA_Disabl 0x04000000 |
| igor_v | 0:8ad47e2b6f00 | 169 | /* DMA mode */ |
| igor_v | 0:8ad47e2b6f00 | 170 | #define M2M 0x00 |
| igor_v | 0:8ad47e2b6f00 | 171 | #define M2P 0x01 |
| igor_v | 0:8ad47e2b6f00 | 172 | #define P2M 0x02 |
| igor_v | 0:8ad47e2b6f00 | 173 | #define P2P 0x03 |
| igor_v | 0:8ad47e2b6f00 | 174 | |
| igor_v | 0:8ad47e2b6f00 | 175 | #define Sp38400 0x00000 |
| igor_v | 0:8ad47e2b6f00 | 176 | #define Sp115200 0x00010 |
| igor_v | 0:8ad47e2b6f00 | 177 | #define Sp460800 0x00020 |
| igor_v | 0:8ad47e2b6f00 | 178 | #define Sp921600 0x00030 |
| igor_v | 0:8ad47e2b6f00 | 179 | |
| igor_v | 0:8ad47e2b6f00 | 180 | extern unsigned int trm_num_byt; |
| igor_v | 0:8ad47e2b6f00 | 181 | extern unsigned int rcv_num_byt; |
| igor_v | 0:8ad47e2b6f00 | 182 | extern unsigned int rcv_Rdy; |
| igor_v | 0:8ad47e2b6f00 | 183 | extern char trm_buf[64]; |
| igor_v | 0:8ad47e2b6f00 | 184 | extern char rcv_buf[64]; |
| igor_v | 0:8ad47e2b6f00 | 185 | extern char rcv_copy[64]; |
| igor_v | 0:8ad47e2b6f00 | 186 | extern unsigned int trm_cycl; |
| igor_v | 0:8ad47e2b6f00 | 187 | extern unsigned int num_of_par; |
| igor_v | 0:8ad47e2b6f00 | 188 | extern void* addr_param[16]; |
| igor_v | 0:8ad47e2b6f00 | 189 | extern unsigned int size_param[16]; |
| igor_v | 0:8ad47e2b6f00 | 190 | extern unsigned int trm_rate; |
| igor_v | 0:8ad47e2b6f00 | 191 | extern unsigned int trm_cycl; |
| igor_v | 0:8ad47e2b6f00 | 192 | extern unsigned int rcv_num_byt_old; |
| igor_v | 0:8ad47e2b6f00 | 193 | extern int rcv_byt_copy; |
| igor_v | 0:8ad47e2b6f00 | 194 | extern unsigned int trm_ena; |
| igor_v | 0:8ad47e2b6f00 | 195 | extern int cycl_phase; |
| igor_v | 0:8ad47e2b6f00 | 196 | extern unsigned int line_err; |
| igor_v | 0:8ad47e2b6f00 | 197 | extern unsigned int line_sts; |
| igor_v | 0:8ad47e2b6f00 | 198 | extern int rx_buf_copy; |
| igor_v | 0:8ad47e2b6f00 | 199 | extern char zeros; |
| igor_v | 21:bc8c1cec3da6 | 200 | extern unsigned int SystemCoreClock; |
| igor_v | 0:8ad47e2b6f00 | 201 | |
| igor_v | 0:8ad47e2b6f00 | 202 | extern void DMA_Init(void); |
| igor_v | 0:8ad47e2b6f00 | 203 | extern void transm_DAT(void); |
| igor_v | 0:8ad47e2b6f00 | 204 | extern void Line_1_Rcv(void); |
| igor_v | 0:8ad47e2b6f00 | 205 | |
| igor_v | 0:8ad47e2b6f00 | 206 | extern void UARTInit(void); |
| igor_v | 0:8ad47e2b6f00 | 207 | extern void UART1_Init(void); |
| igor_v | 0:8ad47e2b6f00 | 208 | //extern int UART0_SendByte(int); |
| igor_v | 0:8ad47e2b6f00 | 209 | extern int UART1_SendByte(int); |
| igor_v | 0:8ad47e2b6f00 | 210 | extern void UART_SwitchSpeed(unsigned); |
| igor_v | 0:8ad47e2b6f00 | 211 | extern void UART_DMA_Init(void); |
| igor_v | 21:bc8c1cec3da6 | 212 | extern void SystemCoreClockUpdate (void); |
| igor_v | 0:8ad47e2b6f00 | 213 | |
| igor_v | 0:8ad47e2b6f00 | 214 | #endif /* end __DMA_H */ |
| igor_v | 0:8ad47e2b6f00 | 215 |
