dv-bfin_uart.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* Blackfin Universal Asynchronous Receiver/Transmitter (UART) model.
  2. For "old style" UARTs on BF53x/etc... parts.
  3. Copyright (C) 2010-2022 Free Software Foundation, Inc.
  4. Contributed by Analog Devices, Inc.
  5. This file is part of simulators.
  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; either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  16. #ifndef DV_BFIN_UART_H
  17. #define DV_BFIN_UART_H
  18. struct bfin_uart;
  19. bu16 bfin_uart_get_next_byte (struct hw *, bu16, bu16, bool *fresh);
  20. bu16 bfin_uart_write_byte (struct hw *, bu16, bu16);
  21. bu16 bfin_uart_get_status (struct hw *);
  22. unsigned bfin_uart_write_buffer (struct hw *, const unsigned char *, unsigned);
  23. unsigned bfin_uart_read_buffer (struct hw *, unsigned char *, unsigned);
  24. void bfin_uart_reschedule (struct hw *);
  25. /* UART_LCR */
  26. #define DLAB (1 << 7)
  27. /* UART_LSR */
  28. #define TFI (1 << 7)
  29. #define TEMT (1 << 6)
  30. #define THRE (1 << 5)
  31. #define BI (1 << 4)
  32. #define FE (1 << 3)
  33. #define PE (1 << 2)
  34. #define OE (1 << 1)
  35. #define DR (1 << 0)
  36. /* UART_IER */
  37. #define ERBFI (1 << 0)
  38. #define ETBEI (1 << 1)
  39. #define ELSI (1 << 2)
  40. /* UART_MCR */
  41. #define XOFF (1 << 0)
  42. #define MRTS (1 << 1)
  43. #define RFIT (1 << 2)
  44. #define RFRT (1 << 3)
  45. #define LOOP_ENA (1 << 4)
  46. #define FCPOL (1 << 5)
  47. #define ARTS (1 << 6)
  48. #define ACTS (1 << 7)
  49. #endif