uart.h 711 B

12345678910111213141516171819202122232425262728293031
  1. #include "usart_driver.h"
  2. #include "avr_compiler.h"
  3. //Init UART0, set to baud rate as defined in header file
  4. void init_uart0
  5. (
  6. void
  7. );
  8. //Input a char on UART0 and store it to data, however if no char is recieved
  9. //within timeout, then abort and return TIMEOUT, otherwise return BYTE_REC
  10. //(note: timeout is NOT a reliable value, as it uses a simple C loop that
  11. //will change with different compiler settings likely
  12. unsigned char input_ch_w_timeout_0
  13. (
  14. char * data,
  15. unsigned int timeout
  16. );
  17. //wait forever for a char on UART 0 and return it
  18. char input_ch_0
  19. (
  20. void
  21. );
  22. //output char data on UART0
  23. void output_ch_0
  24. (
  25. char data
  26. );