Go to the documentation of this file.
40 #define ADT75_ADDR(x) (0x48 + (x))
41 #define ADT75_CONV_DELAY_MS 40
42 #define ADT75_FRAME_SIZE 3
44 #define ADT75_TEMP_VALUE_REG 0x0
45 #define ADT75_CONF_REG 0x1
46 #define ADT75_HYST_REG 0x2
47 #define ADT75_OS_REG 0x3
48 #define ADT75_ONE_SHOT_REG 0x4
50 #define ADT75_DATA_REG_MASK NO_OS_GENMASK(2, 0)
51 #define ADT75_CONFIG_REG_MASK NO_OS_GENMASK(7, 0)
53 #define ADT75_TEMP_MASK NO_OS_GENMASK(15, 4)
54 #define ADT75_SIGN_BIT 11
57 #define ADT75_SHUTDOWN_MASK NO_OS_BIT(0)
58 #define ADT75_COMP_INT_MASK NO_OS_BIT(1)
59 #define ADT75_ALERT_POL_MASK NO_OS_BIT(2)
60 #define ADT75_FAULT_QUEUE_MASK NO_OS_GENMASK(4, 3)
61 #define ADT75_ONESHOT_MASK NO_OS_BIT(5)
63 #define ADT75_HYST_MASK NO_OS_GENMASK(15, 4)
64 #define ADT75_OVER_TEMP_MASK NO_OS_GENMASK(15, 4)
67 #define ADT75_TEMP_DIV 16
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
#define ADT75_CONV_DELAY_MS
Definition: adt75.h:41
#define ADT75_FRAME_SIZE
Definition: adt75.h:42
int adt75_init(struct adt75_desc **, struct adt75_init_param *)
Initialize the device structure.
Definition: adt75.c:132
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:159
int32_t no_os_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: no_os_i2c.c:52
int adt75_reg_read(struct adt75_desc *, uint32_t, uint16_t *)
Read the raw value of a register.
Definition: adt75.c:56
int adt75_reg_read(struct adt75_desc *desc, uint32_t addr, uint16_t *val)
Read the raw value of a register.
Definition: adt75.c:56
int32_t no_os_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: no_os_i2c.c:113
int adt75_remove(struct adt75_desc *desc)
Free the device descriptor.
Definition: adt75.c:160
Header file of Delay functions.
#define MILLIDEGREE_PER_DEGREE
Definition: no_os_units.h:71
int adt75_reg_write(struct adt75_desc *desc, uint32_t addr, uint16_t val)
Write a raw value to a register.
Definition: adt75.c:88
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
#define ADT75_SIGN_BIT
Definition: adt75.h:54
#define ADT75_DATA_REG_MASK
Definition: adt75.h:50
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
int adt75_init(struct adt75_desc **desc, struct adt75_init_param *init_param)
Initialize the device structure.
Definition: adt75.c:132
int adt75_reg_write(struct adt75_desc *, uint32_t, uint16_t)
Write a raw value to a register.
Definition: adt75.c:88
int adt75_get_single_temp(struct adt75_desc *desc, int32_t *val)
Read the current temperature sample (in milliCelsius)
Definition: adt75.c:107
#define ADT75_TEMP_DIV
Definition: adt75.h:67
struct no_os_i2c_init_param comm_param
Definition: adt75.h:73
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:190
#define ADT75_TEMP_VALUE_REG
Definition: adt75.h:44
Header file of I2C Interface.
#define ADT75_TEMP_MASK
Definition: adt75.h:53
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
#define ADT75_CONF_REG
Definition: adt75.h:45
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int adt75_remove(struct adt75_desc *)
Free the device descriptor.
Definition: adt75.c:160
Header file of ADT75 Driver.
Initialization parameter for the device descriptor.
Definition: adt75.h:72
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
Header file of utility functions.
int32_t no_os_sign_extend32(uint32_t value, int index)
ADT75 device descriptor.
Definition: adt75.h:79
int adt75_get_single_temp(struct adt75_desc *, int32_t *)
Read the current temperature sample (in milliCelsius)
Definition: adt75.c:107
struct no_os_i2c_desc * comm_desc
Definition: adt75.h:80