HandBooks Professional Java-C-Scrip-SQL part 204

Tham khảo tài liệu 'handbooks professional java-c-scrip-sql part 204', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | int getchar char gets char s private int channel CircBuf pTxQueue Transmit Buffer CircBuf pRxQueue Receive Buffer Note the private data members channel pTxQueue and pRxQueue. These are initialized within the constructor and used to interface to the hardware-specific part of the serial driver described in the next section. I ll have more to say about this interface shortly but for now just be aware that the SerialPort class does not contain any code that is specific to a particular Serial Controller. All of that is hidden inside the SCC class that it references. Let s take a look at the SerialPort constructor. This routine is responsible for initializing the three private data members and configuring the requested data channel within the SCC hardware include static SCC scc Method SerialPort Description Default constructor for the serial port class. Notes Returns None defined. SerialPort SerialPort int port unsigned long baudRate unsigned int txQueueSize unsigned int rxQueueSize Initialize the logical device. switch port case PORTA channel 0 break case PORTB channel 1 break default channel -1 break Create input and output FIFOs. pTxQueue new CircBuf txQueueSize pRxQueue new CircBuf rxQueueSize Initialize the hardware device. channel channel baudRate pTxQueue pRxQueue SerialPort Once a SerialPort object has been created the aforementioned methods for sending and receiving data can be used. For example in the helloWorld function shown earlier puts Hello World is the statement that sends the text string to serial port A . SCC channel 0 . The data is sent over the serial channel at a rate of 19 200 bits per second as selected by the baudRate parameter to the SerialPort constructor. The send and receive methods rely on the circular buffers pointed to by pTxQueue and pRxQueue respectively. pTxQueue is a transmit buffer that provides overflow memory in case the rate at which characters are sent by the application exceeds the baud rate of the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU LIÊN QUAN
5    176    1
5    255    1
5    106    0
5    121    1
6    103    1
6    107    1
6    121    1
6    103    0
6    140    0
TÀI LIỆU MỚI ĐĂNG
1    95    2    01-07-2024
3    71    2    01-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.