![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
uart_m.h@57:6c968a11dce3, 2016-02-14 (annotated)
- Committer:
- igor_v
- Date:
- Sun Feb 14 10:26:37 2016 +0000
- Revision:
- 57:6c968a11dce3
- Parent:
- 55:f5115c2193d5
- Child:
- 74:f4d9c3403578
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #ifndef __UART_H |
igor_v | 0:8ad47e2b6f00 | 2 | #define __UART_H |
igor_v | 0:8ad47e2b6f00 | 3 | |
igor_v | 0:8ad47e2b6f00 | 4 | #define PortEUART0 LPC_GPIO4->FIOPIN |
igor_v | 0:8ad47e2b6f00 | 5 | #define PortDirEUART0 LPC_GPIO4->FIODIR |
igor_v | 0:8ad47e2b6f00 | 6 | #define PinEUART0 1UL << 29 |
igor_v | 0:8ad47e2b6f00 | 7 | |
igor_v | 0:8ad47e2b6f00 | 8 | #define PortEUART1 LPC_GPIO2->FIOPIN |
igor_v | 0:8ad47e2b6f00 | 9 | #define PortDirEUART1 LPC_GPIO2->FIODIR |
igor_v | 0:8ad47e2b6f00 | 10 | #define PinEUART1 1UL << 2 |
igor_v | 0:8ad47e2b6f00 | 11 | |
igor_v | 0:8ad47e2b6f00 | 12 | |
igor_v | 0:8ad47e2b6f00 | 13 | #define PortEUART2 LPC_GPIO2->FIOPIN |
igor_v | 0:8ad47e2b6f00 | 14 | #define PortDirEUART2 LPC_GPIO2->FIODIR |
igor_v | 0:8ad47e2b6f00 | 15 | #define PinEUART2 1UL << 13 |
igor_v | 0:8ad47e2b6f00 | 16 | |
igor_v | 0:8ad47e2b6f00 | 17 | #define PortEUART3 LPC_GPIO0->FIOPIN |
igor_v | 0:8ad47e2b6f00 | 18 | #define PortDirEUART3 LPC_GPIO0->FIODIR |
igor_v | 0:8ad47e2b6f00 | 19 | #define PinEUART3 1UL << 24 |
igor_v | 0:8ad47e2b6f00 | 20 | |
Diletant | 55:f5115c2193d5 | 21 | //Use typedef instead of separate data |
Diletant | 55:f5115c2193d5 | 22 | #define IOBufferSize 1024 |
igor_v | 57:6c968a11dce3 | 23 | |
Diletant | 55:f5115c2193d5 | 24 | typedef struct _IOCyclicBuffer { |
Diletant | 55:f5115c2193d5 | 25 | char buffer[IOBufferSize]; |
Diletant | 55:f5115c2193d5 | 26 | int start; //first byte position |
Diletant | 55:f5115c2193d5 | 27 | int end; //last byte position |
Diletant | 55:f5115c2193d5 | 28 | } IOCyclicBuffer; |
igor_v | 0:8ad47e2b6f00 | 29 | |
igor_v | 0:8ad47e2b6f00 | 30 | |
igor_v | 0:8ad47e2b6f00 | 31 | void UART0_Init (void); |
igor_v | 0:8ad47e2b6f00 | 32 | void UART1_Init_temp (void); |
igor_v | 0:8ad47e2b6f00 | 33 | void UART2_Init (void); |
igor_v | 0:8ad47e2b6f00 | 34 | void UART3_Init (void); |
igor_v | 0:8ad47e2b6f00 | 35 | |
igor_v | 0:8ad47e2b6f00 | 36 | void UART2_InitSet (unsigned int speed, unsigned int SetLsr); |
igor_v | 0:8ad47e2b6f00 | 37 | void UART3_InitSet (unsigned int speed, unsigned int SetLsr); |
igor_v | 0:8ad47e2b6f00 | 38 | void UART_InitSet (unsigned int Num,unsigned int Speed, unsigned int SetLsr); |
igor_v | 0:8ad47e2b6f00 | 39 | |
igor_v | 0:8ad47e2b6f00 | 40 | |
igor_v | 0:8ad47e2b6f00 | 41 | |
igor_v | 0:8ad47e2b6f00 | 42 | int UART0_SendByte (int ucData); |
igor_v | 0:8ad47e2b6f00 | 43 | |
igor_v | 0:8ad47e2b6f00 | 44 | int UART0_GetChar (void); |
igor_v | 0:8ad47e2b6f00 | 45 | int UART1_GetChar (void); |
igor_v | 0:8ad47e2b6f00 | 46 | int UART2_GetChar (void); |
igor_v | 0:8ad47e2b6f00 | 47 | int UART3_GetChar (void); |
igor_v | 0:8ad47e2b6f00 | 48 | |
igor_v | 0:8ad47e2b6f00 | 49 | |
igor_v | 0:8ad47e2b6f00 | 50 | int UART0_Chek (void); |
igor_v | 0:8ad47e2b6f00 | 51 | int UART1_Chek (void); |
igor_v | 0:8ad47e2b6f00 | 52 | int UART2_Chek (void); |
igor_v | 0:8ad47e2b6f00 | 53 | int UART3_Chek (void); |
igor_v | 0:8ad47e2b6f00 | 54 | |
igor_v | 0:8ad47e2b6f00 | 55 | void UART0_SendString (char *s); |
igor_v | 0:8ad47e2b6f00 | 56 | void UART2_SendString (char *s); |
igor_v | 0:8ad47e2b6f00 | 57 | |
igor_v | 0:8ad47e2b6f00 | 58 | |
igor_v | 0:8ad47e2b6f00 | 59 | int UART2_SendByte (int ucData); |
igor_v | 0:8ad47e2b6f00 | 60 | int UART2_SendByte_i (int ucData); |
igor_v | 0:8ad47e2b6f00 | 61 | int UART2_GetChar (void); |
igor_v | 0:8ad47e2b6f00 | 62 | int UART2_Chek (void); |
igor_v | 0:8ad47e2b6f00 | 63 | |
igor_v | 0:8ad47e2b6f00 | 64 | void Concol ( void); |
igor_v | 0:8ad47e2b6f00 | 65 | void Concol1 ( void); |
igor_v | 0:8ad47e2b6f00 | 66 | void Concol2 ( void); |
igor_v | 0:8ad47e2b6f00 | 67 | void Concol3 ( void); |
igor_v | 0:8ad47e2b6f00 | 68 | |
igor_v | 0:8ad47e2b6f00 | 69 | void WriteCon (char *s); |
igor_v | 0:8ad47e2b6f00 | 70 | void WriteCon1 (char *s); |
igor_v | 0:8ad47e2b6f00 | 71 | void WriteCon2 (char *s); |
igor_v | 0:8ad47e2b6f00 | 72 | void WriteConF (char *s, unsigned int Num); |
igor_v | 0:8ad47e2b6f00 | 73 | |
igor_v | 0:8ad47e2b6f00 | 74 | void WriteConN (char *s, unsigned int N); |
igor_v | 0:8ad47e2b6f00 | 75 | |
igor_v | 0:8ad47e2b6f00 | 76 | void WriteConByte (unsigned int In) ; |
igor_v | 0:8ad47e2b6f00 | 77 | void WriteCon2Byte (unsigned int In) ; |
igor_v | 0:8ad47e2b6f00 | 78 | void WriteCon3Byte (unsigned int In) ; |
igor_v | 0:8ad47e2b6f00 | 79 | |
igor_v | 0:8ad47e2b6f00 | 80 | |
igor_v | 0:8ad47e2b6f00 | 81 | void WriteConByteF (unsigned int In,unsigned int Num ); |
igor_v | 0:8ad47e2b6f00 | 82 | |
igor_v | 0:8ad47e2b6f00 | 83 | |
igor_v | 0:8ad47e2b6f00 | 84 | int ReadCon (char *s); |
igor_v | 0:8ad47e2b6f00 | 85 | int ReadCon1 (char *s); |
igor_v | 0:8ad47e2b6f00 | 86 | int ReadCon2 (char *s); |
igor_v | 0:8ad47e2b6f00 | 87 | int ReadCon3 (char *s); |
igor_v | 0:8ad47e2b6f00 | 88 | |
igor_v | 0:8ad47e2b6f00 | 89 | int ReadChekCon (char *s); |
igor_v | 0:8ad47e2b6f00 | 90 | int ReadChekCon2 (char *s); |
igor_v | 0:8ad47e2b6f00 | 91 | int ReadChekCon3 (char *s); |
igor_v | 0:8ad47e2b6f00 | 92 | |
igor_v | 0:8ad47e2b6f00 | 93 | int ChekInCon ( void); |
igor_v | 0:8ad47e2b6f00 | 94 | int ChekInCon1 ( void); |
igor_v | 0:8ad47e2b6f00 | 95 | int ChekInCon2 ( void); |
igor_v | 0:8ad47e2b6f00 | 96 | int ChekInCon3 ( void); |
igor_v | 0:8ad47e2b6f00 | 97 | |
igor_v | 0:8ad47e2b6f00 | 98 | int ChekOutCon ( void); |
igor_v | 0:8ad47e2b6f00 | 99 | int ChekOutCon1 ( void); |
igor_v | 0:8ad47e2b6f00 | 100 | int ChekOutCon2 ( void); |
igor_v | 0:8ad47e2b6f00 | 101 | int ChekOutCon3 ( void); |
igor_v | 0:8ad47e2b6f00 | 102 | |
igor_v | 0:8ad47e2b6f00 | 103 | |
igor_v | 0:8ad47e2b6f00 | 104 | |
igor_v | 0:8ad47e2b6f00 | 105 | void SetDeUART0 (void); |
igor_v | 0:8ad47e2b6f00 | 106 | void ClrDeUART0 (void); |
igor_v | 0:8ad47e2b6f00 | 107 | void SetDeUART1 (void); |
igor_v | 0:8ad47e2b6f00 | 108 | void ClrDeUART1 (void); |
igor_v | 0:8ad47e2b6f00 | 109 | void SetDeUART2 (void); |
igor_v | 0:8ad47e2b6f00 | 110 | void ClrDeUART2 (void); |
igor_v | 0:8ad47e2b6f00 | 111 | void SetDeUART3 (void); |
igor_v | 0:8ad47e2b6f00 | 112 | void ClrDeUART3 (void); |
igor_v | 0:8ad47e2b6f00 | 113 | |
igor_v | 0:8ad47e2b6f00 | 114 | |
igor_v | 0:8ad47e2b6f00 | 115 | |
igor_v | 0:8ad47e2b6f00 | 116 | |
igor_v | 0:8ad47e2b6f00 | 117 | extern unsigned int OutBufConCount ; |
igor_v | 0:8ad47e2b6f00 | 118 | extern unsigned int OutBufCon1Count; |
igor_v | 0:8ad47e2b6f00 | 119 | extern unsigned int OutBufCon2Count; |
igor_v | 0:8ad47e2b6f00 | 120 | extern unsigned int OutBufCon3Count; |
igor_v | 0:8ad47e2b6f00 | 121 | |
igor_v | 0:8ad47e2b6f00 | 122 | |
igor_v | 0:8ad47e2b6f00 | 123 | |
igor_v | 0:8ad47e2b6f00 | 124 | #endif |
igor_v | 0:8ad47e2b6f00 | 125 |