MLX90640_API.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. * @copyright (C) 2017 Melexis N.V.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. #ifndef _MLX640_API_H_
  18. #define _MLX640_API_H_
  19. #define SCALEALPHA 0.000001
  20. typedef struct
  21. {
  22. int16_t kVdd;
  23. int16_t vdd25;
  24. float KvPTAT;
  25. float KtPTAT;
  26. uint16_t vPTAT25;
  27. float alphaPTAT;
  28. int16_t gainEE;
  29. float tgc;
  30. float cpKv;
  31. float cpKta;
  32. uint8_t resolutionEE;
  33. uint8_t calibrationModeEE;
  34. float KsTa;
  35. float ksTo[5];
  36. int16_t ct[5];
  37. uint16_t alpha[768];
  38. uint8_t alphaScale;
  39. int16_t offset[768];
  40. int8_t kta[768];
  41. uint8_t ktaScale;
  42. int8_t kv[768];
  43. uint8_t kvScale;
  44. float cpAlpha[2];
  45. int16_t cpOffset[2];
  46. float ilChessC[3];
  47. uint16_t brokenPixels[5];
  48. uint16_t outlierPixels[5];
  49. } paramsMLX90640;
  50. int MLX90640_DumpEE(uint8_t slaveAddr, uint16_t *eeData);
  51. int MLX90640_GetFrameData(uint8_t slaveAddr, uint16_t *frameData);
  52. int MLX90640_ExtractParameters(uint16_t *eeData, paramsMLX90640 *mlx90640);
  53. float MLX90640_GetVdd(uint16_t *frameData, const paramsMLX90640 *params);
  54. float MLX90640_GetTa(uint16_t *frameData, const paramsMLX90640 *params);
  55. void MLX90640_GetImage(uint16_t *frameData, const paramsMLX90640 *params, float *result);
  56. void MLX90640_CalculateTo(uint16_t *frameData, const paramsMLX90640 *params, float emissivity, float tr, float *result);
  57. int MLX90640_SetResolution(uint8_t slaveAddr, uint8_t resolution);
  58. int MLX90640_GetCurResolution(uint8_t slaveAddr);
  59. int MLX90640_SetRefreshRate(uint8_t slaveAddr, uint8_t refreshRate);
  60. int MLX90640_GetRefreshRate(uint8_t slaveAddr);
  61. int MLX90640_GetSubPageNumber(uint16_t *frameData);
  62. int MLX90640_GetCurMode(uint8_t slaveAddr);
  63. int MLX90640_SetInterleavedMode(uint8_t slaveAddr);
  64. int MLX90640_SetChessMode(uint8_t slaveAddr);
  65. void MLX90640_BadPixelsCorrection(uint16_t *pixels, float *to, int mode, paramsMLX90640 *params);
  66. #endif