nullstreams.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file nullstreams.h
  15. * @brief Null streams structures and macros.
  16. * @addtogroup HAL_NULL_STREAMS
  17. * @{
  18. */
  19. #ifndef NULLSTREAMS_H
  20. #define NULLSTREAMS_H
  21. /*===========================================================================*/
  22. /* Driver constants. */
  23. /*===========================================================================*/
  24. /*===========================================================================*/
  25. /* Driver pre-compile time settings. */
  26. /*===========================================================================*/
  27. /*===========================================================================*/
  28. /* Derived constants and error checks. */
  29. /*===========================================================================*/
  30. /*===========================================================================*/
  31. /* Driver data structures and types. */
  32. /*===========================================================================*/
  33. /**
  34. * @brief @p NullStream specific data.
  35. */
  36. #define _null_stream_data \
  37. _base_sequential_stream_data
  38. /**
  39. * @brief @p NullStream virtual methods table.
  40. */
  41. struct NullStreamVMT {
  42. _base_sequential_stream_methods
  43. };
  44. /**
  45. * @extends BaseSequentialStream
  46. *
  47. * @brief Null stream object.
  48. */
  49. typedef struct {
  50. /** @brief Virtual Methods Table.*/
  51. const struct NullStreamVMT *vmt;
  52. _null_stream_data
  53. } NullStream;
  54. /*===========================================================================*/
  55. /* Driver macros. */
  56. /*===========================================================================*/
  57. /*===========================================================================*/
  58. /* External declarations. */
  59. /*===========================================================================*/
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. void nullObjectInit(NullStream *nsp);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* NULLSTREAMS_H */
  68. /** @} */