Question: Embedded System Programming You have register addresses defined #define UART_STATUS (*((volatile u32*)(0xE0001000U + 0x002CU))) #define UART_BAUD (*((volatile u32*)(0xE0001000U + 0x0018U))) #define RX (*((volatile u32*)(0xE0001000U +0x0030U)))

Embedded System Programming

You have register addresses defined

#define UART_STATUS (*((volatile u32*)(0xE0001000U + 0x002CU)))

#define UART_BAUD (*((volatile u32*)(0xE0001000U + 0x0018U)))

#define RX (*((volatile u32*)(0xE0001000U +0x0030U)))

and you have bits from bit0 to bit16 in usart status register where the second bit (bit1, RXEMPTY) is set if the receive buffer RX_FIFO is empty. RX_FIFO is eight bit wide value (bits [0:7] in RX)

#define TNFUL 0x00004000U /**< TX FIFO Nearly Full Status */

#define TTRIG 0x00002000U /**< TX FIFO Trigger Status */

#define FLOWDEL 0x00001000U /**< RX FIFO fill over flow delay */

#define TACTIVE 0x00000800U /**< TX active */

#define RACTIVE 0x00000400U /**< RX active */

#define TXFULL 0x00000010U /**< TX FIFO full */

#define TXEMPTY 0x00000008U /**< TX FIFO empty */

#define RXFULL 0x00000004U /**< RX FIFO full */

#define RXEMPTY 0x00000002U /**< RX FIFO empty */

#define RXOVR 0x00000001U /**< RX FIFO fill over trigger */

Construct a function that checks if FIFO is not empty, and if not save the contents in your own receive buffer. Fill buffer until you get a character q to RX_buffer.

Construct preferably macro to check RXEMPTY bit in UART_STATUS or if you cannot use directly in code bit manipulation.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!