![]() Test whether the opened file descriptor is terminal device or not. Get the status of the UART, make sure whether the mode is blocked or not. Open the UART by calling the function Open(), the returned value is the file descriptor. O_NDELAY: It means we don't care the status of the UART's DCD signal. O_NOCTTY: It means we have opened one terminal device, the program will not become the controlling terminal of this port, if this parameter is not used, any input will affect the process of the system. ![]() dev/ttyS0, /dev/ttyS1, /dev/ttyS2) 2.2 optionsĬall the Open() function to open the UART device, we need to use the parameter "O_NOCTTY" when opening the UART device. In linux, the UART device is accessed through the device file of UART device, which means we access the UART device by accessing the device files(e.g. ![]() Since the UART is treated as file, we must open the file before any other operation is done on the file. Steps about the UART programming in Linux As we all know, most of the devices are treated as files in Linux, so is the UART for which I will give some introduction about the programming, the operations on UART are the same as the operations on files.
0 Comments
Leave a Reply. |