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
Diff: DeviceUART.h
- Revision:
- 149:abbf7663d27d
- Parent:
- 148:7ce8c1fd00f7
- Child:
- 150:29c9f7671bac
--- a/DeviceUART.h Fri Apr 29 13:53:50 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -#ifndef __DEVICE_UART_H__ -#define __DEVICE_UART_H__ - -#define IER_RBR 0x01 -#define IER_THRE 0x02 -#define IER_RLS 0x04 - -#define IIR_PEND 0x01 -#define IIR_RLS 0x03 -#define IIR_RDA 0x02 -#define IIR_CTI 0x06 -#define IIR_THRE 0x01 - -#define LSR_RDR 0x01 -#define LSR_OE 0x02 -#define LSR_PE 0x04 -#define LSR_FE 0x08 -#define LSR_BI 0x10 -#define LSR_THRE 0x20 -#define LSR_TEMT 0x40 -#define LSR_RXFE 0x80 - -typedef struct _DeviceReceiverState { - uint32_t baudRate; //Receiver baud rate -} DeviceReceiverState; - -typedef struct _DeviceTransmitterState { - uint32_t baudRate; //Transmitter baud rate - uint8_t position; //Output buffer position - uint16_t counter; //Main loop counter - uint16_t trigger; //Value of counter to send next byte -} DeviceTransmitterState; - -typedef struct _DeviceUARTState { - uint32_t status; - uint8_t TxEmpty; - DeviceTransmitterState transmitter; - - //Line Control Register. Contains controls for frame formatting and break generation. - uint8_t LCR; - - //Divisor Latch MSB. Most significant byte of the baud rate divisor value. - //The full divisor is used to generate a baud rate from the fractional rate divider. - //When DLAB = 1 - uint8_t DLM; - - //Divisor Latch LSB. Least significant byte of the baud rate divisor value. - //The full divisor is used to generate a baud rate from the fractional rate divider. - //When DLAB = 1 - uint8_t DLL; - - //FIFO Control Register. Controls FIFO usage and modes. - uint8_t FCR; -} DeviceUARTState; - - -void InitHostPort(void); -void HostPortReceive(void); -void HostPortTransmit(void); - -void InitUART1(void); -#endif /* __DEVICE_UART_H__ */ \ No newline at end of file