![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
host/Source/App/uart.h@23:12e6183f04d4, 2016-02-03 (annotated)
- Committer:
- Kovalev_D
- Date:
- Wed Feb 03 10:44:42 2016 +0300
- Revision:
- 23:12e6183f04d4
[thyz
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kovalev_D |
23:12e6183f04d4 | 1 | /**************************************************************************** |
Kovalev_D |
23:12e6183f04d4 | 2 | * $Id:: uart.h 5751 2010-11-30 23:56:11Z usb00423 $ |
Kovalev_D |
23:12e6183f04d4 | 3 | * Project: NXP LPC17xx UART example |
Kovalev_D |
23:12e6183f04d4 | 4 | * |
Kovalev_D |
23:12e6183f04d4 | 5 | * Description: |
Kovalev_D |
23:12e6183f04d4 | 6 | * This file contains UART code header definition. |
Kovalev_D |
23:12e6183f04d4 | 7 | * |
Kovalev_D |
23:12e6183f04d4 | 8 | **************************************************************************** |
Kovalev_D |
23:12e6183f04d4 | 9 | * Software that is described herein is for illustrative purposes only |
Kovalev_D |
23:12e6183f04d4 | 10 | * which provides customers with programming information regarding the |
Kovalev_D |
23:12e6183f04d4 | 11 | * products. This software is supplied "AS IS" without any warranties. |
Kovalev_D |
23:12e6183f04d4 | 12 | * NXP Semiconductors assumes no responsibility or liability for the |
Kovalev_D |
23:12e6183f04d4 | 13 | * use of the software, conveys no license or title under any patent, |
Kovalev_D |
23:12e6183f04d4 | 14 | * copyright, or mask work right to the product. NXP Semiconductors |
Kovalev_D |
23:12e6183f04d4 | 15 | * reserves the right to make changes in the software without |
Kovalev_D |
23:12e6183f04d4 | 16 | * notification. NXP Semiconductors also make no representation or |
Kovalev_D |
23:12e6183f04d4 | 17 | * warranty that such application will be suitable for the specified |
Kovalev_D |
23:12e6183f04d4 | 18 | * use without further testing or modification. |
Kovalev_D |
23:12e6183f04d4 | 19 | ****************************************************************************/ |
Kovalev_D |
23:12e6183f04d4 | 20 | #ifndef __UART_H |
Kovalev_D |
23:12e6183f04d4 | 21 | #define __UART_H |
Kovalev_D |
23:12e6183f04d4 | 22 | |
Kovalev_D |
23:12e6183f04d4 | 23 | #define SIMPLEUARTRX |
Kovalev_D |
23:12e6183f04d4 | 24 | |
Kovalev_D |
23:12e6183f04d4 | 25 | /* State-machine variable to control application functionality */ |
Kovalev_D |
23:12e6183f04d4 | 26 | enum state_machine { |
Kovalev_D |
23:12e6183f04d4 | 27 | UNKNOWN_COMMAND, |
Kovalev_D |
23:12e6183f04d4 | 28 | WRITE4SECTOR = 101, // actions with flash: erase |
Kovalev_D |
23:12e6183f04d4 | 29 | WAIT_ENTRANCE, // waiting for bootloader entrance |
Kovalev_D |
23:12e6183f04d4 | 30 | WAIT_FLASHACTION = 113, // waiting for an action with flash |
Kovalev_D |
23:12e6183f04d4 | 31 | READ_FLASH = 114, // actions with flash: read |
Kovalev_D |
23:12e6183f04d4 | 32 | WRITE_FLASH = 119 // actions with flash: write |
Kovalev_D |
23:12e6183f04d4 | 33 | |
Kovalev_D |
23:12e6183f04d4 | 34 | }; |
Kovalev_D |
23:12e6183f04d4 | 35 | #define IER_RBR 0x01 |
Kovalev_D |
23:12e6183f04d4 | 36 | #define IER_THRE 0x02 |
Kovalev_D |
23:12e6183f04d4 | 37 | #define IER_RLS 0x04 |
Kovalev_D |
23:12e6183f04d4 | 38 | |
Kovalev_D |
23:12e6183f04d4 | 39 | #define IIR_PEND 0x01 |
Kovalev_D |
23:12e6183f04d4 | 40 | #define IIR_RLS 0x03 |
Kovalev_D |
23:12e6183f04d4 | 41 | #define IIR_RDA 0x02 |
Kovalev_D |
23:12e6183f04d4 | 42 | #define IIR_CTI 0x06 |
Kovalev_D |
23:12e6183f04d4 | 43 | #define IIR_THRE 0x01 |
Kovalev_D |
23:12e6183f04d4 | 44 | |
Kovalev_D |
23:12e6183f04d4 | 45 | #define LSR_RDR 0x01 |
Kovalev_D |
23:12e6183f04d4 | 46 | #define LSR_OE 0x02 |
Kovalev_D |
23:12e6183f04d4 | 47 | #define LSR_PE 0x04 |
Kovalev_D |
23:12e6183f04d4 | 48 | #define LSR_FE 0x08 |
Kovalev_D |
23:12e6183f04d4 | 49 | #define LSR_BI 0x10 |
Kovalev_D |
23:12e6183f04d4 | 50 | #define LSR_THRE 0x20 |
Kovalev_D |
23:12e6183f04d4 | 51 | #define LSR_TEMT 0x40 |
Kovalev_D |
23:12e6183f04d4 | 52 | #define LSR_RXFE 0x80 |
Kovalev_D |
23:12e6183f04d4 | 53 | |
Kovalev_D |
23:12e6183f04d4 | 54 | #define BUFSIZE 0x40 |
Kovalev_D |
23:12e6183f04d4 | 55 | #define FIFOs_En 0x00000001 |
Kovalev_D |
23:12e6183f04d4 | 56 | #define RX_FIFO_Reset 0x00000002 |
Kovalev_D |
23:12e6183f04d4 | 57 | #define TX_FIFO_Reset 0x00000004 |
Kovalev_D |
23:12e6183f04d4 | 58 | #define DMA_Mode_UART 0x00000008 |
Kovalev_D |
23:12e6183f04d4 | 59 | #define RX_TrigLvl_1 0x00000000 |
Kovalev_D |
23:12e6183f04d4 | 60 | #define RX_TrigLvl_4 0x00000040 |
Kovalev_D |
23:12e6183f04d4 | 61 | #define RX_TrigLvl_8 0x00000080 |
Kovalev_D |
23:12e6183f04d4 | 62 | #define RX_TrigLvl_14 0x000000C0 |
Kovalev_D |
23:12e6183f04d4 | 63 | |
Kovalev_D |
23:12e6183f04d4 | 64 | #define word_length_8 0x00000003 |
Kovalev_D |
23:12e6183f04d4 | 65 | |
Kovalev_D |
23:12e6183f04d4 | 66 | #define one_stop_bit 0x00000000 |
Kovalev_D |
23:12e6183f04d4 | 67 | |
Kovalev_D |
23:12e6183f04d4 | 68 | #define no_parity 0x00000000 |
Kovalev_D |
23:12e6183f04d4 | 69 | |
Kovalev_D |
23:12e6183f04d4 | 70 | #define back_trans_dis 0x00000000 |
Kovalev_D |
23:12e6183f04d4 | 71 | |
Kovalev_D |
23:12e6183f04d4 | 72 | #define DLAB_access 0x00000080 |
Kovalev_D |
23:12e6183f04d4 | 73 | |
Kovalev_D |
23:12e6183f04d4 | 74 | #define TRANS_SHIFT_BUF_EMPTY 0x00000040 |
Kovalev_D |
23:12e6183f04d4 | 75 | #define RecievBufNOTEmpty 0x00000001 |
Kovalev_D |
23:12e6183f04d4 | 76 | #define DIS_ALL_INT 0x00000000 |
Kovalev_D |
23:12e6183f04d4 | 77 | #define RBR_IntEnabl 0x00000001 |
Kovalev_D |
23:12e6183f04d4 | 78 | |
Kovalev_D |
23:12e6183f04d4 | 79 | void UART2_Init(void); |
Kovalev_D |
23:12e6183f04d4 | 80 | |
Kovalev_D |
23:12e6183f04d4 | 81 | int UART2_SendByte (int ucData); |
Kovalev_D |
23:12e6183f04d4 | 82 | |
Kovalev_D |
23:12e6183f04d4 | 83 | |
Kovalev_D |
23:12e6183f04d4 | 84 | |
Kovalev_D |
23:12e6183f04d4 | 85 | #endif /* end __UART_H */ |
Kovalev_D |
23:12e6183f04d4 | 86 | /***************************************************************************** |
Kovalev_D |
23:12e6183f04d4 | 87 | ** End Of File |
Kovalev_D |
23:12e6183f04d4 | 88 | ******************************************************************************/ |