uart.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* sd2iec - SD/MMC to Commodore serial bus interface/controller
  2. Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
  3. Inspiration and low-level SD/MMC access based on code from MMC2IEC
  4. by Lars Pontoppidan et al., see sdcard.c|h and config.h.
  5. FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; version 2 of the License only.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. uart.h: Definitions for the UART access routines
  17. */
  18. #ifndef UART_H
  19. #define UART_H
  20. #ifdef CONFIG_UART_DEBUG
  21. #include <avr/pgmspace.h>
  22. void uart_init(void);
  23. unsigned char uart_getc(void);
  24. void uart_putc(char c);
  25. void uart_puthex(uint8_t num);
  26. void uart_trace(void *ptr, uint16_t start, uint16_t len);
  27. void uart_flush(void);
  28. void uart_puts_P(prog_char *text);
  29. void uart_putcrlf(void);
  30. #include <stdio.h>
  31. #define dprintf(str,...) printf_P(PSTR(str), ##__VA_ARGS__)
  32. #else
  33. #define uart_init() do {} while(0)
  34. #define uart_getc() 0
  35. #define uart_putc(x) do {} while(0)
  36. #define uart_puthex(x) do {} while(0)
  37. #define uart_flush() do {} while(0)
  38. #define uart_puts_P(x) do {} while(0)
  39. #define uart_putcrlf() do {} while(0)
  40. #define uart_trace(a,b,c) do {} while(0)
  41. #endif
  42. #endif