Download EMMA Mobile1 Application Note UART Interface
Transcript
Chapter 3 Example of UART Operation 39/78 3.4.2 Operation Detail (1). Initialize the GIO85 and GIO86. The process calls the “em1_uart_port_gio()” function. The “em1_uart_port_gio()” function finishes the following functions for UART0: Change the URT0_RTSB to GIO_P86; Set the GIO_P86 output mode; Set the GIO_P86 output high level; Change the URT0_CTSB to GIO_P85; Set the GIO_P85 input mode; Enable the GIO_P85 input; (2). Set the UART configure. This process is the same to process (1) of “Chapter 3.2.2 Operation Detail” of this document. (3). Clear the receive error. This process is the same to process (4) of “Chapter 3.2.2 Operation Detail” of this document. (4). UART send and receive. The process calls the “em1_uart_gio_recv()” function. The “em1_uart_gio_recv()” function finishes the following functions for UART0: Output low level from GIO86; Check whether receive a character; Read the received character; Output high level from GIO86; The process calls the “em1_uart_gio_send()” function. The “em1_uart_gio_send()” function finishes the following functions for UART0: Check if GIO85 is high or low; Check if there is a space for a character; Write the character to be send; About the GIO details, please refer to the ASMU/GIO user’s manual and 1 chip user’s manual. About the UART details, please refer to the process (5) of “Chapter 3.2.2 Operation Detail” o this document. Application Note S19893EJ1V0AN00