1
0

termios-baud.h 3.0 KB

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