Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mmal_common.h 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. Copyright (c) 2012, Broadcom Europe Ltd
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of the copyright holder nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
  18. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. /** \file mmal_common.h
  26. * Multi-Media Abstraction Layer - Common definitions
  27. */
  28. #ifndef MMAL_COMMON_H
  29. #define MMAL_COMMON_H
  30. #include <stdlib.h>
  31. #include <string.h>
  32. #include <stddef.h>
  33. #include <assert.h>
  34. #include <vcos.h>
  35. /* C99 64bits integers */
  36. #ifndef INT64_C
  37. # define INT64_C(value) value##LL
  38. # define UINT64_C(value) value##ULL
  39. #endif
  40. #define MMAL_TSRING(s) #s
  41. #define MMAL_TO_STRING(s) MMAL_TSRING(s)
  42. #define MMAL_COUNTOF(x) (sizeof((x))/sizeof((x)[0]))
  43. #define MMAL_MIN(a,b) ((a)<(b)?(a):(b))
  44. #define MMAL_MAX(a,b) ((a)<(b)?(b):(a))
  45. /* FIXME: should be different for big endian */
  46. #define MMAL_FOURCC(a,b,c,d) ((a) | (b << 8) | (c << 16) | (d << 24))
  47. #define MMAL_PARAM_UNUSED(a) (void)(a)
  48. #define MMAL_MAGIC MMAL_FOURCC('m','m','a','l')
  49. typedef int32_t MMAL_BOOL_T;
  50. #define MMAL_FALSE 0
  51. #define MMAL_TRUE 1
  52. typedef struct MMAL_CORE_STATISTICS_T
  53. {
  54. uint32_t buffer_count; /**< Total buffer count on this port */
  55. uint32_t first_buffer_time; /**< Time (us) of first buffer seen on this port */
  56. uint32_t last_buffer_time; /**< Time (us) of most recently buffer on this port */
  57. uint32_t max_delay; /**< Max delay (us) between buffers, ignoring first few frames */
  58. } MMAL_CORE_STATISTICS_T;
  59. /** Statistics collected by the core on all ports, if enabled in the build.
  60. */
  61. typedef struct MMAL_CORE_PORT_STATISTICS_T
  62. {
  63. MMAL_CORE_STATISTICS_T rx;
  64. MMAL_CORE_STATISTICS_T tx;
  65. } MMAL_CORE_PORT_STATISTICS_T;
  66. /** Unsigned 16.16 fixed point value, also known as Q16.16 */
  67. typedef uint32_t MMAL_FIXED_16_16_T;
  68. #endif /* MMAL_COMMON_H */