termios-baud.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* termios baud rate selection definitions. Universal version for sane speed_t.
  2. Copyright (C) 2019-2026 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library. If not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _TERMIOS_H
  16. # error "Never include <bits/termios-baud.h> directly; use <termios.h> instead."
  17. #endif
  18. /* POSIX required baud rates */
  19. #define B0 0U /* Hang up or ispeed == ospeed */
  20. #define B50 50U
  21. #define B75 75U
  22. #define B110 110U
  23. #define B134 134U /* Really 134.5 baud by POSIX spec */
  24. #define B150 150U
  25. #define B200 200U
  26. #define B300 300U
  27. #define B600 600U
  28. #define B1200 1200U
  29. #define B1800 1800U
  30. #define B2400 2400U
  31. #define B4800 4800U
  32. #define B9600 9600U
  33. #define B19200 19200U
  34. #define B38400 38400U
  35. #ifdef __USE_MISC
  36. # define EXTA B19200
  37. # define EXTB B38400
  38. #endif
  39. /* Other baud rates, "nonstandard" but known to be used */
  40. #define B7200 7200U
  41. #define B14400 14400U
  42. #define B28800 28800U
  43. #define B33600 33600U
  44. #define B57600 57600U
  45. #define B76800 76800U
  46. #define B115200 115200U
  47. #define B153600 153600U
  48. #define B230400 230400U
  49. #define B307200 307200U
  50. #define B460800 460800U
  51. #define B500000 500000U
  52. #define B576000 576000U
  53. #define B614400 614400U
  54. #define B921600 921600U
  55. #define B1000000 1000000U
  56. #define B1152000 1152000U
  57. #define B1500000 1500000U
  58. #define B2000000 2000000U
  59. #define B2500000 2500000U
  60. #define B3000000 3000000U
  61. #define B3500000 3500000U
  62. #define B4000000 4000000U
  63. #define B5000000 5000000U
  64. #define B10000000 10000000U
  65. #ifdef __USE_GNU
  66. #define SPEED_MAX 4294967295U /* maximum valid speed_t value */
  67. #endif
  68. #define __MAX_BAUD 4294967295U /* legacy alias for SPEED_MAX */