40 likes | 55 Views
CS-423 Dick Steflik. AVR32 USARTs. Block Diagram. Options. struct usart_options_t { unsigned long baudrate; unsigned char charlength; unsigned char paritytype; unsigned short stopbits; unsigned char channelmode; };
E N D
CS-423 Dick Steflik AVR32 USARTs
Options struct usart_options_t { unsigned long baudrate; unsigned char charlength; unsigned char paritytype; unsigned short stopbits; unsigned char channelmode; }; where: parity stop bits channelmode 0 – even 0 – 1 bit 0 – normal 1 – odd 1 – 1.5 bits 1 – auto echo 2 – space 2 – 2 bits 2 – local loopback 3 – mark 3 – timeguard 3 – remote loopback 4 – none
Driver Functions void usart_reset( volatile struct avr32_usart_t * usart); void usart_init_rs232( volatile struct avr32_usart_t * usart, struct usart_options_t * opt, long cpu_hz) int usart_send_addr(volatile struct avr32_usart_t * usart, int addr); int usart_write_char(volatile struct avr32_usart_t * usart, int c); inline void usart_bw_write_char(volatile struct avr32_usart_t * usart, int c); int usart_putchar(volatile struct avr32_usart_t * usart, int c); int usart_read_char(volatile struct avr32_usart_t * usart, int * c); int usart_getchar(volatile struct avr32_usart_t * usart); void usart_reset_status(volatile struct avr32_usart_t * usart);