2
0

tmp105.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Texas Instruments TMP105 Temperature Sensor
  3. *
  4. * Browse the data sheet:
  5. *
  6. * http://www.ti.com/lit/gpn/tmp105
  7. *
  8. * Copyright (C) 2012 Alex Horn <alex.horn@cs.ox.ac.uk>
  9. * Copyright (C) 2008-2012 Andrzej Zaborowski <balrogg@gmail.com>
  10. *
  11. * This work is licensed under the terms of the GNU GPL, version 2 or
  12. * later. See the COPYING file in the top-level directory.
  13. */
  14. #ifndef QEMU_TMP105_H
  15. #define QEMU_TMP105_H
  16. #include "hw/i2c/i2c.h"
  17. #include "hw/misc/tmp105_regs.h"
  18. #include "qom/object.h"
  19. #define TYPE_TMP105 "tmp105"
  20. OBJECT_DECLARE_SIMPLE_TYPE(TMP105State, TMP105)
  21. /**
  22. * TMP105State:
  23. * @config: Bits 5 and 6 (value 32 and 64) determine the precision of the
  24. * temperature. See Table 8 in the data sheet.
  25. *
  26. * @see_also: http://www.ti.com/lit/gpn/tmp105
  27. */
  28. struct TMP105State {
  29. /*< private >*/
  30. I2CSlave i2c;
  31. /*< public >*/
  32. uint8_t len;
  33. uint8_t buf[2];
  34. qemu_irq pin;
  35. uint8_t pointer;
  36. uint8_t config;
  37. int16_t temperature;
  38. int16_t limit[2];
  39. int faults;
  40. uint8_t alarm;
  41. };
  42. #endif