Project

General

Profile

Actions

Bug #2195

closed

Bug #1450: Illumos should be buildable with GCC4

lm75 ignores the half degree bit in writes

Added by Rich Lowe over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2012-02-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

lm75(7D) allows setting of various temperatures, in a somewhat annoying format:
See http://www.datasheetcatalog.org/datasheet/nationalsemiconductor/DS012658.PDF section 1.4.

Basically, we have 16bits: bit 15 is sign, bits 14-6 are temperature, bits 5-0 are ignored.
The temperature encoding doesn't actually matter, but the one bit of temperature in the 2nd byte is half a degree.

When we come to do this we do:

    i2c_tran_pointer->i2c_wbuf[1] = (temp16 >> 1);
    i2c_tran_pointer->i2c_wbuf[2] = ((temp16 & 0xFE) << 7);

The mask on the second line removes the only bit we actually care about, losing us half a degree of temperature.

Actions #1

Updated by Rich Lowe over 9 years ago

  • Parent task set to #1450
Actions #2

Updated by Rich Lowe over 9 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100

Resolved in r13632 commit:ab0e9bcbdf3e

Actions

Also available in: Atom PDF