Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
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.

MLX90640_I2C_Driver1.h 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. @copyright (C) 2017 Melexis N.V.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. #ifndef _MLX90640_I2C_Driver_H_
  14. #define _MLX90640_I2C_Driver_H_
  15. #include <stdint.h>
  16. //Define the size of the I2C buffer based on the platform the user has
  17. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  18. #if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
  19. //I2C_BUFFER_LENGTH is defined in Wire.H
  20. #define I2C_BUFFER_LENGTH BUFFER_LENGTH
  21. #elif defined(__SAMD21G18A__)
  22. //SAMD21 uses RingBuffer.h
  23. #define I2C_BUFFER_LENGTH SERIAL_BUFFER_SIZE
  24. #elif __MK20DX256__
  25. //Teensy 3.2
  26. #define I2C_BUFFER_LENGTH 32
  27. #else
  28. //The catch-all default is 32
  29. #define I2C_BUFFER_LENGTH 32
  30. #endif
  31. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. void MLX90640_I2CInit(void);
  33. int MLX90640_I2CRead(uint8_t slaveAddr, unsigned int startAddress, unsigned int nWordsRead, uint16_t *data);
  34. int MLX90640_I2CWrite(uint8_t slaveAddr, unsigned int writeAddress, uint16_t data);
  35. void MLX90640_I2CFreqSet(int freq);
  36. #endif