|
HP85 GPIB Disk Emulator
1.0
HP85GPIBDiskEmulator
|
RS232 Driver AVR8. More...
Go to the source code of this file.
Functions | |
| void | uart_rx_flush (uint8_t uart) |
| Flush receive ring buffer for specified uart. More... | |
| int | uart0_getchar (void *f __attribute__((unused))) |
| UART receive character function using avr-libc. More... | |
| int | uart0_putchar (int c, void *f __attribute__((unused))) |
| UART transmit character function using avr-libc. More... | |
| uint16_t | uart_ubr (uint32_t baud, int *u2x, uint32_t *actual) |
| UART baud rate caluculation We compute the best values of baud rate register and prescale. More... | |
| uint32_t | uart_init (uint8_t uart, uint32_t baud) |
| UART initialization function that works with avr-libc functions. More... | |
| ISR (USART0_RX_vect) | |
| UART 0 Receive Interrupt runction. More... | |
| void | uart_rx_interrupt (uint8_t uart, uint8_t data) |
| UART Receive Interrupt task. More... | |
| int | uart_peek_tail (uint8_t uart) |
| Return character waiting in ring buffer without removing it. More... | |
| int | uart_get_tail (uint8_t uart) |
| Return next character from ring buffer. More... | |
| int | uart_rx_count (uint8_t uart) |
| return count of character count waiting in UART ring buffer. More... | |
| int | uart_rx_byte (uint8_t uart) |
| Recive character character from uart. More... | |
| int | uart_getchar (uint8_t uart) |
| Receive character from uart with option CR/LF conversion. More... | |
| int | uart_tx_byte (int c, uint8_t uart) |
| Transmit 1 byte on uart. More... | |
| int | uart_putchar (int c, int uart) |
| Transmit 1 byte on uart. More... | |
| int | uart_keyhit (uint8_t uart) |
| Do we have receive characters waiting ?. More... | |
| int | uart_put (int c) |
| Transmit a character on UART 0. More... | |
| int | uart_get (void) |
| Receive a character from UART 0. More... | |
| int | get_line (char *buff, int len) |
| Get a line from UART 0 up to a maximum of len bytes. More... | |
Variables | |
| struct _uart | uarts [UARTS] |
| Uart ring buffers. More... | |
RS232 Driver AVR8.
Definition in file rs232.c.
| int get_line | ( | char * | buff, |
| int | len | ||
| ) |
| ISR | ( | USART0_RX_vect | ) |
UART 0 Receive Interrupt runction.
| int uart0_getchar | ( | void *f | __attribute__(unused) | ) |
UART receive character function using avr-libc.
| [in] | f | unused FILE *stream pointer. |
Definition at line 45 of file rs232.c.
Referenced by uart_get(), and uart_init().
| int uart0_putchar | ( | int | c, |
| void *f | __attribute__(unused) | ||
| ) |
UART transmit character function using avr-libc.
| [in] | c | character to send. |
| [in] | f | unused FILE *stream pointer. |
Definition at line 58 of file rs232.c.
Referenced by uart_init(), and uart_put().
| int uart_get | ( | void | ) |
Receive a character from UART 0.
Definition at line 411 of file rs232.c.
Referenced by get_line().
| int uart_get_tail | ( | uint8_t | uart | ) |
Return next character from ring buffer.
| [in] | uart | uart number to read. |
Definition at line 249 of file rs232.c.
Referenced by uart_rx_byte().
| int uart_getchar | ( | uint8_t | uart | ) |
Receive character from uart with option CR/LF conversion.
| [in] | uart | uart number. |
Definition at line 312 of file rs232.c.
Referenced by uart0_getchar().
| uint32_t uart_init | ( | uint8_t | uart, |
| uint32_t | baud | ||
| ) |
UART initialization function that works with avr-libc functions.
| [in] | uart | UART number. |
| [in] | baud | Baud Rate in HZ. |
actual baud rate
Definition at line 117 of file rs232.c.
Referenced by main().
| int uart_keyhit | ( | uint8_t | uart | ) |
Do we have receive characters waiting ?.
| [in] | uart | uart number. |
Definition at line 394 of file rs232.c.
Referenced by gpib_detect_PP(), gpib_error_test(), gpib_read_byte(), gpib_trace_task(), and gpib_write_byte().
| int uart_peek_tail | ( | uint8_t | uart | ) |
| int uart_put | ( | int | c | ) |
Transmit a character on UART 0.
| [in] | c | character to write |
Definition at line 403 of file rs232.c.
Referenced by get_line().
| int uart_putchar | ( | int | c, |
| int | uart | ||
| ) |
Transmit 1 byte on uart.
| [in] | c | transmit character. |
| [in] | uart | uart number. |
Definition at line 376 of file rs232.c.
Referenced by uart0_putchar().
| int uart_rx_byte | ( | uint8_t | uart | ) |
Recive character character from uart.
| [in] | uart | uart number. |
Definition at line 299 of file rs232.c.
Referenced by uart_getchar().
| int uart_rx_count | ( | uint8_t | uart | ) |
return count of character count waiting in UART ring buffer.
| [in] | uart | uart number to check count for. |
Definition at line 277 of file rs232.c.
Referenced by uart_get_tail(), and uart_keyhit().
| void uart_rx_flush | ( | uint8_t | uart | ) |
Flush receive ring buffer for specified uart.
Definition at line 22 of file rs232.c.
Referenced by uart_init(), and user_task().
| void uart_rx_interrupt | ( | uint8_t | uart, |
| uint8_t | data | ||
| ) |
| int uart_tx_byte | ( | int | c, |
| uint8_t | uart | ||
| ) |
Transmit 1 byte on uart.
| [in] | c | transmit character. |
| [in] | uart | uart number. |
Definition at line 347 of file rs232.c.
Referenced by uart_getchar(), and uart_putchar().
| uint16_t uart_ubr | ( | uint32_t | baud, |
| int * | u2x, | ||
| uint32_t * | actual | ||
| ) |
UART baud rate caluculation We compute the best values of baud rate register and prescale.
| [in] | uart | desired baud rate in HZ |
| [in] | *u2x | computed prescale 1 = divide by 8, 0 = divide by 16 |
| [in] | *actual | Actual computed baud rate, closest we could get with register settings |
Use 8 prescale as a default
Use 16 prescale f we have a low baud rate
Definition at line 73 of file rs232.c.
Referenced by uart_init().
Uart ring buffers.
Definition at line 17 of file rs232.c.
Referenced by uart_get_tail(), uart_peek_tail(), uart_rx_count(), uart_rx_flush(), and uart_rx_interrupt().
1.8.17