HAL_config.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * ________________________________________________________________________________________________________
  3. * Copyright (c) 2015-2015 InvenSense Inc. All rights reserved.
  4. *
  5. * This software, related documentation and any modifications thereto (collectively “Software”) is subject
  6. * to InvenSense and its licensors' intellectual property rights under U.S. and international copyright
  7. * and other intellectual property rights laws.
  8. *
  9. * InvenSense and its licensors retain all intellectual property and proprietary rights in and to the Software
  10. * and any use, reproduction, disclosure or distribution of the Software without an express license agreement
  11. * from InvenSense is strictly prohibited.
  12. *
  13. * EXCEPT AS OTHERWISE PROVIDED IN A LICENSE AGREEMENT BETWEEN THE PARTIES, THE SOFTWARE IS
  14. * PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  15. * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  16. * EXCEPT AS OTHERWISE PROVIDED IN A LICENSE AGREEMENT BETWEEN THE PARTIES, IN NO EVENT SHALL
  17. * INVENSENSE BE LIABLE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
  18. * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  19. * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  20. * OF THE SOFTWARE.
  21. * ________________________________________________________________________________________________________
  22. */
  23. /** @defgroup DataConverter Data Converter
  24. * @brief Helper functions to convert integer
  25. * @ingroup EmbUtils
  26. * @{
  27. */
  28. #ifndef _INV_DATA_CONVERTER_H_
  29. #define _INV_DATA_CONVERTER_H_
  30. #include "InvExport.h"
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #include <stdint.h>
  35. /** @brief Converts a 32-bit long to a little endian byte stream
  36. */
  37. uint8_t INV_EXPORT * inv_dc_int32_to_little8(int32_t x, uint8_t * little8);
  38. /** @brief Converts a 16-bit integer to a little endian byte stream
  39. */
  40. uint8_t INV_EXPORT * inv_dc_int16_to_little8(int16_t x, uint8_t * little8);
  41. /** @brief Converts a 32-bit long to a big endian byte stream
  42. */
  43. uint8_t INV_EXPORT * inv_dc_int32_to_big8(int32_t x, uint8_t *big8);
  44. /** @brief Converts a 16-bit long to a big endian byte stream
  45. */
  46. uint8_t INV_EXPORT * inv_dc_int16_to_big8(int16_t x, uint8_t * big8);
  47. /** @brief Converts a little endian byte stream into a 32-bit integer
  48. */
  49. int32_t INV_EXPORT inv_dc_little8_to_int32(const uint8_t * little8);
  50. /** @brief Converts a little endian byte stream into a 16-bit integer
  51. */
  52. int16_t INV_EXPORT inv_dc_le_to_int16(const uint8_t * little8);
  53. /** @brief Converts big endian on 16 bits into an unsigned short
  54. */
  55. int16_t INV_EXPORT inv_dc_big16_to_int16(uint8_t * data);
  56. /** @brief Converts an array of 32-bit signed fixed-point integers to an array of floats
  57. * @param[in] in Pointer to the first element of the array of 32-bit signed fixed-point integers
  58. * @param[in] len Length of the array
  59. * @param[in] qx Number of bits used to represent the decimal part of the fixed-point integers
  60. * @param[out] out Pointer to the memory area where the output will be stored
  61. */
  62. void INV_EXPORT inv_dc_sfix32_to_float(const int32_t * in, uint32_t len, uint8_t qx, float * out);
  63. /** @brief Converts an array of floats to an array of 32-bit signed fixed-point integers
  64. * @param[in] in Pointer to the first element of the array of floats
  65. * @param[in] len Length of the array
  66. * @param[in] qx Number of bits used to represent the decimal part of the fixed-point integers
  67. * @param[out] out Pointer to the memory area where the output will be stored
  68. */
  69. void INV_EXPORT inv_dc_float_to_sfix32(const float * in, uint32_t len, uint8_t qx, int32_t * out);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* _INV_DATA_CONVERTER_H_ */
  74. /** @} */