no-OS
iio_adt7420.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_ADT7420_H
34 #define IIO_ADT7420_H
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include <stdlib.h>
41 #include "iio.h"
42 
43 /******************************************************************************/
44 /*************************** Types Declarations *******************************/
45 /******************************************************************************/
52  struct iio_dev *iio_dev;
53  uint32_t active_channels;
55 };
56 
63 };
64 
65 /******************************************************************************/
66 /************************ Functions Declarations ******************************/
67 /******************************************************************************/
68 int adt7420_iio_init(struct adt7420_iio_dev **iio_dev,
70 
71 int adt7420_iio_remove(struct adt7420_iio_dev *desc);
72 
73 #endif
adt7420_remove
int32_t adt7420_remove(struct adt7420_dev *dev)
Free the resources allocated by adt7420_init().
Definition: adt7420.c:264
adt7420_iio_dev::active_channels
uint32_t active_channels
Definition: iio_adt7420.h:53
adt7420_init
int32_t adt7420_init(struct adt7420_dev **device, struct adt7420_init_param init_param)
Initializes the communication peripheral and checks if the device is present.
Definition: adt7420.c:202
ADT7420_13BIT_DIV
#define ADT7420_13BIT_DIV
Definition: adt7420.h:101
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ADT7420_REG_T_CRIT_LSB
#define ADT7420_REG_T_CRIT_LSB
Definition: adt7420.h:80
adt7420_iio_init_param::adt7420_dev_init
struct adt7420_init_param * adt7420_dev_init
Definition: iio_adt7420.h:62
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
scan_type::sign
char sign
Definition: iio_types.h:153
ADT7420_REG_T_CRIT_MSB
#define ADT7420_REG_T_CRIT_MSB
Definition: adt7420.h:79
adt7420_iio_dev
iio device descriptor.
Definition: iio_adt7420.h:50
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
ADT7320_REG_T_HIGH
#define ADT7320_REG_T_HIGH
Definition: adt7420.h:63
adt7420_get_temperature
float adt7420_get_temperature(struct adt7420_dev *dev)
Reads the temperature data and converts it to Celsius degrees.
Definition: adt7420.c:370
adt7420_iio_init_param
Configuration structure.
Definition: iio_adt7420.h:61
adt7420_iio_remove
int adt7420_iio_remove(struct adt7420_iio_dev *desc)
Free the resources allocated by adt7420_iio_init().
Definition: iio_adt7420.c:171
adt7420_dev::resolution_setting
uint8_t resolution_setting
Definition: adt7420.h:147
ADT7420_REG_T_HIGH_LSB
#define ADT7420_REG_T_HIGH_LSB
Definition: adt7420.h:76
ADT7420_16BIT_NEG
#define ADT7420_16BIT_NEG
Definition: adt7420.h:96
adt7420_reset
int32_t adt7420_reset(struct adt7420_dev *dev)
Resets the SPI or I2C inteface for the ADT7420/ADT7320.
Definition: adt7420.c:340
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:172
no_os_calloc
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
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
adt7420_iio_dev::iio_dev
struct iio_dev * iio_dev
Definition: iio_adt7420.h:52
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:131
ADT7420_16BIT_DIV
#define ADT7420_16BIT_DIV
Definition: adt7420.h:98
ADT7320_REG_T_LOW
#define ADT7320_REG_T_LOW
Definition: adt7420.h:64
ADT7420_REG_T_LOW_MSB
#define ADT7420_REG_T_LOW_MSB
Definition: adt7420.h:77
adt7420_iio_dev::no_active_channels
uint8_t no_active_channels
Definition: iio_adt7420.h:54
ADT7420_REG_HIST
#define ADT7420_REG_HIST
Definition: adt7420.h:81
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
adt7420_iio_init
int adt7420_iio_init(struct adt7420_iio_dev **iio_dev, struct adt7420_iio_init_param *init_param)
Initializes the adt7420 IIO driver.
Definition: iio_adt7420.c:135
ADT7420_13BIT_NEG
#define ADT7420_13BIT_NEG
Definition: adt7420.h:99
ADT7320_REG_T_CRIT
#define ADT7320_REG_T_CRIT
Definition: adt7420.h:61
adt7420_iio_dev::adt7420_dev
struct adt7420_dev * adt7420_dev
Definition: iio_adt7420.h:51
ADT7420_REG_T_LOW_LSB
#define ADT7420_REG_T_LOW_LSB
Definition: adt7420.h:78
adt7420_init_param
Definition: adt7420.h:151
adt7420_iio_init
int adt7420_iio_init(struct adt7420_iio_dev **iio_dev, struct adt7420_iio_init_param *init_param)
Initializes the adt7420 IIO driver.
Definition: iio_adt7420.c:135
no_os_i2c.h
Header file of I2C Interface.
iio_format_value
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:661
ADT7420_REG_T_HIGH_MSB
#define ADT7420_REG_T_HIGH_MSB
Definition: adt7420.h:75
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
no_os_free
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
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
no_os_hweight8
unsigned int no_os_hweight8(uint8_t word)
adt7420_reg_read
int adt7420_reg_read(struct adt7420_dev *dev, uint16_t register_address, uint16_t *data)
Reads the value of a register.
Definition: adt7420.c:75
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
adt7420_dev
Definition: adt7420.h:139
adt7420_iio_remove
int adt7420_iio_remove(struct adt7420_iio_dev *desc)
Free the resources allocated by adt7420_iio_init().
Definition: iio_adt7420.c:171
scan_type
Definition: iio_types.h:151
ADT7320_REG_HIST
#define ADT7320_REG_HIST
Definition: adt7420.h:62
iio_adt7420.h
Header file of IIO ADT7420 Driver.
no_os_util.h
Header file of utility functions.
adt7420_reg_write
int adt7420_reg_write(struct adt7420_dev *dev, uint16_t register_address, uint32_t data)
Sets the value of a register SPI/I2C.
Definition: adt7420.c:178
ADT7420_16BIT_SIGN
#define ADT7420_16BIT_SIGN
Definition: adt7420.h:97
ADT7420_13BIT_SIGN
#define ADT7420_13BIT_SIGN
Definition: adt7420.h:100
adt7420_is_spi
bool adt7420_is_spi(struct adt7420_dev *dev)
Check if the interface of the selected device is SPI.
Definition: adt7420.c:477
adt7420.h
Header file of ADT7420 Driver.