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_util_params.h 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. #ifndef MMAL_UTIL_PARAMS_H
  26. #define MMAL_UTIL_PARAMS_H
  27. #include "mmal.h"
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /**
  32. * @file
  33. * Utility functions to set some common parameters.
  34. */
  35. /** Helper function to set the value of a boolean parameter.
  36. * @param port port on which to set the parameter
  37. * @param id parameter id
  38. * @param value value to set the parameter to
  39. *
  40. * @return MMAL_SUCCESS or error
  41. */
  42. MMAL_STATUS_T mmal_port_parameter_set_boolean(MMAL_PORT_T *port, uint32_t id, MMAL_BOOL_T value);
  43. /** Helper function to get the value of a boolean parameter.
  44. * @param port port on which to get the parameter
  45. * @param id parameter id
  46. * @param value pointer to where the value will be returned
  47. *
  48. * @return MMAL_SUCCESS or error
  49. */
  50. MMAL_STATUS_T mmal_port_parameter_get_boolean(MMAL_PORT_T *port, uint32_t id, MMAL_BOOL_T *value);
  51. /** Helper function to set the value of a 64 bits unsigned integer parameter.
  52. * @param port port on which to set the parameter
  53. * @param id parameter id
  54. * @param value value to set the parameter to
  55. *
  56. * @return MMAL_SUCCESS or error
  57. */
  58. MMAL_STATUS_T mmal_port_parameter_set_uint64(MMAL_PORT_T *port, uint32_t id, uint64_t value);
  59. /** Helper function to get the value of a 64 bits unsigned integer parameter.
  60. * @param port port on which to get the parameter
  61. * @param id parameter id
  62. * @param value pointer to where the value will be returned
  63. *
  64. * @return MMAL_SUCCESS or error
  65. */
  66. MMAL_STATUS_T mmal_port_parameter_get_uint64(MMAL_PORT_T *port, uint32_t id, uint64_t *value);
  67. /** Helper function to set the value of a 64 bits signed integer parameter.
  68. * @param port port on which to set the parameter
  69. * @param id parameter id
  70. * @param value value to set the parameter to
  71. *
  72. * @return MMAL_SUCCESS or error
  73. */
  74. MMAL_STATUS_T mmal_port_parameter_set_int64(MMAL_PORT_T *port, uint32_t id, int64_t value);
  75. /** Helper function to get the value of a 64 bits signed integer parameter.
  76. * @param port port on which to get the parameter
  77. * @param id parameter id
  78. * @param value pointer to where the value will be returned
  79. *
  80. * @return MMAL_SUCCESS or error
  81. */
  82. MMAL_STATUS_T mmal_port_parameter_get_int64(MMAL_PORT_T *port, uint32_t id, int64_t *value);
  83. /** Helper function to set the value of a 32 bits unsigned integer parameter.
  84. * @param port port on which to set the parameter
  85. * @param id parameter id
  86. * @param value value to set the parameter to
  87. *
  88. * @return MMAL_SUCCESS or error
  89. */
  90. MMAL_STATUS_T mmal_port_parameter_set_uint32(MMAL_PORT_T *port, uint32_t id, uint32_t value);
  91. /** Helper function to get the value of a 32 bits unsigned integer parameter.
  92. * @param port port on which to get the parameter
  93. * @param id parameter id
  94. * @param value pointer to where the value will be returned
  95. *
  96. * @return MMAL_SUCCESS or error
  97. */
  98. MMAL_STATUS_T mmal_port_parameter_get_uint32(MMAL_PORT_T *port, uint32_t id, uint32_t *value);
  99. /** Helper function to set the value of a 32 bits signed integer parameter.
  100. * @param port port on which to set the parameter
  101. * @param id parameter id
  102. * @param value value to set the parameter to
  103. *
  104. * @return MMAL_SUCCESS or error
  105. */
  106. MMAL_STATUS_T mmal_port_parameter_set_int32(MMAL_PORT_T *port, uint32_t id, int32_t value);
  107. /** Helper function to get the value of a 32 bits signed integer parameter.
  108. * @param port port on which to get the parameter
  109. * @param id parameter id
  110. * @param value pointer to where the value will be returned
  111. *
  112. * @return MMAL_SUCCESS or error
  113. */
  114. MMAL_STATUS_T mmal_port_parameter_get_int32(MMAL_PORT_T *port, uint32_t id, int32_t *value);
  115. /** Helper function to set the value of a rational parameter.
  116. * @param port port on which to set the parameter
  117. * @param id parameter id
  118. * @param value value to set the parameter to
  119. *
  120. * @return MMAL_SUCCESS or error
  121. */
  122. MMAL_STATUS_T mmal_port_parameter_set_rational(MMAL_PORT_T *port, uint32_t id, MMAL_RATIONAL_T value);
  123. /** Helper function to get the value of a rational parameter.
  124. * @param port port on which to get the parameter
  125. * @param id parameter id
  126. * @param value pointer to where the value will be returned
  127. *
  128. * @return MMAL_SUCCESS or error
  129. */
  130. MMAL_STATUS_T mmal_port_parameter_get_rational(MMAL_PORT_T *port, uint32_t id, MMAL_RATIONAL_T *value);
  131. /** Helper function to set the value of a string parameter.
  132. * @param port port on which to set the parameter
  133. * @param id parameter id
  134. * @param value null-terminated string value
  135. *
  136. * @return MMAL_SUCCESS or error
  137. */
  138. MMAL_STATUS_T mmal_port_parameter_set_string(MMAL_PORT_T *port, uint32_t id, const char *value);
  139. /** Helper function to set the value of an array of bytes parameter.
  140. * @param port port on which to set the parameter
  141. * @param id parameter id
  142. * @param data pointer to the array of bytes
  143. * @param size size of the array of bytes
  144. *
  145. * @return MMAL_SUCCESS or error
  146. */
  147. MMAL_STATUS_T mmal_port_parameter_set_bytes(MMAL_PORT_T *port, uint32_t id,
  148. const uint8_t *data, unsigned int size);
  149. /** Helper function to set a MMAL_PARAMETER_URI_T parameter on a port.
  150. * @param port port on which to set the parameter
  151. * @param uri URI string
  152. *
  153. * @return MMAL_SUCCESS or error
  154. */
  155. MMAL_STATUS_T mmal_util_port_set_uri(MMAL_PORT_T *port, const char *uri);
  156. /** Set the display region.
  157. * @param port port to configure
  158. * @param region region
  159. *
  160. * @return MMAL_SUCCESS or error
  161. */
  162. MMAL_STATUS_T mmal_util_set_display_region(MMAL_PORT_T *port,
  163. MMAL_DISPLAYREGION_T *region);
  164. /** Tell the camera to use the STC for timestamps rather than the clock.
  165. *
  166. * @param port port to configure
  167. * @param mode STC mode to use
  168. * @return MMAL_SUCCESS or error
  169. */
  170. MMAL_STATUS_T mmal_util_camera_use_stc_timestamp(MMAL_PORT_T *port, MMAL_CAMERA_STC_MODE_T mode);
  171. /** Get the MMAL core statistics for a given port.
  172. *
  173. * @param port port to query
  174. * @param dir port direction
  175. * @param reset reset the stats as well
  176. * @param stats filled in with results
  177. * @return MMAL_SUCCESS or error
  178. */
  179. MMAL_STATUS_T mmal_util_get_core_port_stats(MMAL_PORT_T *port, MMAL_CORE_STATS_DIR dir, MMAL_BOOL_T reset,
  180. MMAL_CORE_STATISTICS_T *stats);
  181. #ifdef __cplusplus
  182. }
  183. #endif
  184. #endif