The getopt functionint getopt(int argc, char * const argv[], const char *optstring);
extern char *optarg;
extern int optind, opterr, optopt;
The getopt function is used to parse command option. The parameters argc and argv are the argument count and argument array as passed to the “command”. The argument optstring is a string of recognized option characters; if a character is followed by a colon, the option takes an argument.

My USART software is based on the ATMEL application note AVR306 : Using the AVR® UART in C.

The original source code of the application note was changed to support receiver error and to support some of the capabilities of the avr UART interface databit (5..8 ), stop bit (1-2) and parity check (none, odd and even).

Before to speak about the interrupts implementation of the USART, I want to say a little bit regarding the “Interrupts” and then it will follow by a description of the usage of the USART interrupts if one of the following conditions happen: