Function: Read a fixed-length string of characters from the specified USART.
Include: usart.h
Prototype: void getsUSART ( char * buffer,
unsigned char len );
void gets1USART ( char * buffer,
unsigned char len );
void gets2USART ( char * buffer,
unsigned char len );
Arguments: buffer
A pointer to the location where incoming characters are to be stored.
len
The number of characters to read from the USART.
Remarks: This function only works in 8-bit transmit/receive mode. This function
waits for and reads len number of characters out of the specified
USART. There is no time out when waiting for characters to arrive.
getsUSART should be used on parts with a single USART peripheral.
gets1USART and gets2USART should be used on parts with multiple
USART peripherals.
File Name: ugets.c
u1gets.c
u2gets.c
Code Example: char inputstr[10];
getsUSART( inputstr, 5 );
Partager