buffer.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /** \addtogroup hal */
  2. /** @{*/
  3. /* mbed Microcontroller Library
  4. * Copyright (c) 2014-2015 ARM Limited
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. #ifndef MBED_BUFFER_H
  19. #define MBED_BUFFER_H
  20. #include <stddef.h>
  21. /** Generic buffer structure
  22. */
  23. typedef struct buffer_s {
  24. void *buffer; /**< the pointer to a buffer */
  25. size_t length; /**< the buffer length */
  26. size_t pos; /**< actual buffer position */
  27. uint8_t width; /**< The buffer unit width (8, 16, 32, 64), used for proper *buffer casting */
  28. } buffer_t;
  29. #endif
  30. /** @}*/