[riot-notifications] [RIOT] drivers/at30tse75x: add device driver for AT30TSE75x temperature sensor (#3755)
Peter Kietzmann
notifications at github.com
Tue Sep 29 17:44:37 CEST 2015
> +#define ENABLE_DEBUG (0)
> +#include "debug.h"
> +
> +static inline float temperature_to_float(uint16_t temp)
> +{
> + /* Integer part is 8-bit signed */
> + int8_t temp_int = (temp & AT30TSE75X_INTEGER_MASK) >>
> + AT30TSE75X_INTEGER_SHIFT;
> + /* Fractional part is multiple of 0.0625 */
> + uint8_t frac_multiplier = (temp & AT30TSE75X_FRACTIONAL_MASK) >>
> + AT30TSE75X_FRACTIONAL_SHIFT;
> +
> + return temp_int + (frac_multiplier * AT30TSE75X_FRACTIONAL_BASE);
> +}
> +
> +static int at30tse75x_get_register(at30tse75x_t* dev, uint8_t reg, uint16_t* data)
Ups, forget about it. Sorry
---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3755/files#r40689037
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150929/6b36f60a/attachment.html>
More information about the notifications
mailing list