Go to the documentation of this file.
47 #define MAX9611_MUX_MASK NO_OS_GENMASK(2, 0)
48 #define MAX9611_MODE_MASK NO_OS_GENMASK(7, 5)
49 #define MAX9611_RAW_DATA_MASK NO_OS_GENMASK(15, 4)
51 #define MAX9611_SHDN_MASK NO_OS_BIT(3)
52 #define MAX9611_LR_MASK NO_OS_BIT(4)
53 #define MAX9611_DTIME_MASK NO_OS_BIT(3)
54 #define MAX9611_RTIME_MASK NO_OS_BIT(2)
56 #define MAX9611_CSA_MSB 0x00
57 #define MAX9611_CSA_LSB 0x01
58 #define MAX9611_RSP_MSB 0x02
59 #define MAX9611_RSP_LSB 0x03
60 #define MAX9611_OUT_MSB 0x04
61 #define MAX9611_OUT_LSB 0x05
62 #define MAX9611_SET_MSB 0x06
63 #define MAX9611_SET_LSB 0x07
64 #define MAX9611_TMP_MSB 0x08
65 #define MAX9611_TMP_LSB 0x09
66 #define MAX9611_CTR1 0x0A
67 #define MAX9611_CTR2 0x0B
69 #define MAX9611_OUT_OF_BOUNDS 0x0C
139 uint8_t bytes, uint8_t *read_data);
143 uint8_t bytes, uint8_t *write_data);
147 int update_mask,
int update_val);
#define MAX9611_RSP_MSB
Definition: max9611.h:58
int max9611_read(struct max9611_dev *dev, uint8_t addr, uint8_t bytes, uint8_t *read_data)
Reads data from device register (I2C)
Definition: max9611.c:144
int max9611_get_mux(struct max9611_dev *dev, enum max9611_mux_conf *mux)
Get the internal MUX settings.
Definition: max9611.c:304
Definition: max9611.h:116
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
#define MAX9611_DTIME_MASK
Definition: max9611.h:53
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 max9611_shutdown(struct max9611_dev *dev, bool is_shdn)
Device shutdown or power up.
Definition: max9611.c:324
int max9611_reg_update(struct max9611_dev *dev, uint8_t addr, int update_mask, int update_val)
Update selected I2C register contents.
Definition: max9611.c:206
uint8_t slave_address
Definition: no_os_i2c.h:70
int max9611_get_raw(struct max9611_dev *dev, uint16_t *raw)
Receive data from ADC (single value only).
Definition: max9611.c:448
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 max9611_write(struct max9611_dev *dev, uint8_t addr, uint8_t bytes, uint8_t *write_data)
Writes data to device register (I2C)
Definition: max9611.c:172
int max9611_read(struct max9611_dev *dev, uint8_t addr, uint8_t bytes, uint8_t *read_data)
Reads data from device register (I2C)
Definition: max9611.c:144
int max9611_set_mux(struct max9611_dev *dev, enum max9611_mux_conf mux)
Configures the internal MUX settings.
Definition: max9611.c:264
int max9611_get_lr(struct max9611_dev *dev, bool *lr)
Get LR bit value.
Definition: max9611.c:354
@ MAX9611_DATA_RSP
Definition: max9611.h:76
@ MAX9611_CONF_SENSE_8X
Definition: max9611.h:102
#define MAX9611_OUT_MSB
Definition: max9611.h:60
int max9611_get_raw(struct max9611_dev *dev, uint16_t *raw)
Receive data from ADC (single value only).
Definition: max9611.c:448
Header file of Delay functions.
@ MAX9611_COMPARATOR_MODE
Definition: max9611.h:113
int max9611_addr_gen(struct max9611_init_param *device_ip, enum max9611_addr_lvls a0, enum max9611_addr_lvls a1)
Generates slave address based on A1 and A0 pin values.
Definition: max9611.c:54
#define MAX9611_MODE_MASK
Definition: max9611.h:48
#define MAX9611_TMP_MSB
Definition: max9611.h:64
Definition: ad9361_util.h:69
@ MAX9611_50MS
Definition: max9611.h:95
int max9611_set_retry(struct max9611_dev *dev, enum max9611_retry_time rtime)
Configures MAX9611 retry time.
Definition: max9611.c:411
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
int max9611_write(struct max9611_dev *dev, uint8_t addr, uint8_t bytes, uint8_t *write_data)
Writes data to device register (I2C)
Definition: max9611.c:172
int max9611_set_mux(struct max9611_dev *dev, enum max9611_mux_conf mux)
Configures the internal MUX settings.
Definition: max9611.c:264
int max9611_init(struct max9611_dev **device, struct max9611_init_param init_param)
Initializes the communication peripheral and checks if the device is present.
Definition: max9611.c:97
bool
Definition: common.h:48
int max9611_get_mode(struct max9611_dev *dev, enum max9611_mode_conf *mode)
Get the MAX9611 operating mode.
Definition: max9611.c:244
#define MAX9611_CTR2
Definition: max9611.h:67
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
Header file of max9611 Family Driver.
int max9611_get_retry(struct max9611_dev *dev, enum max9611_retry_time *rtime)
Get MAX9611 configured retry time.
Definition: max9611.c:428
@ MAX9611_DATA_OUT
Definition: max9611.h:77
#define MAX9611_CSA_MSB
Definition: max9611.h:56
int max9611_set_delay(struct max9611_dev *dev, enum max9611_delay_time dtime)
Configures MAX9611 delay time.
Definition: max9611.c:374
@ MAX9611_DATA_TMP
Definition: max9611.h:79
@ MAX9611_CONF_OUT_ADC
Definition: max9611.h:104
@ MAX9611_DATA_SET
Definition: max9611.h:78
int max9611_set_lr(struct max9611_dev *dev, bool is_normal)
Configure LR bit operation.
Definition: max9611.c:339
#define MAX9611_SHDN_MASK
Definition: max9611.h:51
Definition: max9611.h:122
int max9611_set_mode(struct max9611_dev *dev, enum max9611_mode_conf mode)
Configures MAX9611 operating mode.
Definition: max9611.c:228
max9611_mode_conf
Definition: max9611.h:110
int max9611_set_retry(struct max9611_dev *dev, enum max9611_retry_time rtime)
Configures MAX9611 retry time.
Definition: max9611.c:411
int max9611_set_mode(struct max9611_dev *dev, enum max9611_mode_conf mode)
Configures MAX9611 operating mode.
Definition: max9611.c:228
int max9611_shutdown(struct max9611_dev *dev, bool is_shdn)
Device shutdown or power up.
Definition: max9611.c:324
int max9611_init(struct max9611_dev **device, struct max9611_init_param init_param)
Initializes the communication peripheral and checks if the device is present.
Definition: max9611.c:97
@ MAX9611_CONF_SENSE_4X
Definition: max9611.h:101
@ MAX9611_NORMAL_MODE
Definition: max9611.h:111
max9611_data
Definition: max9611.h:74
@ MAX9611_CONF_TEMP
Definition: max9611.h:106
int max9611_remove(struct max9611_dev *dev)
Free the resources allocated by max538x_init().
Definition: max9611.c:126
@ MAX9611_CONF_IN_COM_MODE
Definition: max9611.h:103
@ MAX9611_CONF_SENSE_1X
Definition: max9611.h:100
#define MAX9611_SET_MSB
Definition: max9611.h:62
@ MAX9611_FAST_MODE
Definition: max9611.h:107
@ MAX9611_OPAMP_MODE
Definition: max9611.h:112
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
@ MAX9611_66_VCC
Definition: max9611.h:85
Header file of I2C Interface.
struct no_os_i2c_desc * i2c_desc
Definition: max9611.h:117
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
@ MAX9611_CONF_SET_ADC
Definition: max9611.h:105
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 MAX9611_RTIME_MASK
Definition: max9611.h:54
@ MAX9611_ZERO_VCC
Definition: max9611.h:83
enum max9611_data capture_type
Definition: max9611.h:119
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
int max9611_get_lr(struct max9611_dev *dev, bool *lr)
Get LR bit value.
Definition: max9611.c:354
@ MAX9611_DATA_CSA
Definition: max9611.h:75
@ MAX9611_100US
Definition: max9611.h:91
#define MAX9611_RAW_DATA_MASK
Definition: max9611.h:49
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int max9611_get_delay(struct max9611_dev *dev, enum max9611_delay_time *dtime)
Get MAX9611 configured delay time.
Definition: max9611.c:391
max9611_mux_conf
Definition: max9611.h:99
#define MAX9611_OUT_OF_BOUNDS
Definition: max9611.h:69
@ MAX9611_33_VCC
Definition: max9611.h:84
int max9611_get_delay(struct max9611_dev *dev, enum max9611_delay_time *dtime)
Get MAX9611 configured delay time.
Definition: max9611.c:391
@ MAX9611_10MS
Definition: max9611.h:96
int max9611_set_delay(struct max9611_dev *dev, enum max9611_delay_time dtime)
Configures MAX9611 delay time.
Definition: max9611.c:374
@ MAX9611_1MS
Definition: max9611.h:90
int max9611_set_lr(struct max9611_dev *dev, bool is_normal)
Configure LR bit operation.
Definition: max9611.c:339
#define MAX9611_MUX_MASK
Definition: max9611.h:47
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
#define MAX9611_LR_MASK
Definition: max9611.h:52
struct no_os_i2c_init_param i2c_init
Definition: max9611.h:123
max9611_delay_time
Definition: max9611.h:89
Header file of utility functions.
max9611_addr_lvls
Definition: max9611.h:82
#define MAX9611_CTR1
Definition: max9611.h:66
int max9611_get_mode(struct max9611_dev *dev, enum max9611_mode_conf *mode)
Get the MAX9611 operating mode.
Definition: max9611.c:244
max9611_retry_time
Definition: max9611.h:94
int max9611_get_retry(struct max9611_dev *dev, enum max9611_retry_time *rtime)
Get MAX9611 configured retry time.
Definition: max9611.c:428
int max9611_remove(struct max9611_dev *dev)
Free the resources allocated by max538x_init().
Definition: max9611.c:126
int max9611_addr_gen(struct max9611_init_param *device_ip, enum max9611_addr_lvls a0, enum max9611_addr_lvls a1)
Generates slave address based on A1 and A0 pin values.
Definition: max9611.c:54
int max9611_reg_update(struct max9611_dev *dev, uint8_t addr, int update_mask, int update_val)
Update selected I2C register contents.
Definition: max9611.c:206
@ MAX9611_100_VCC
Definition: max9611.h:86
int max9611_get_mux(struct max9611_dev *dev, enum max9611_mux_conf *mux)
Get the internal MUX settings.
Definition: max9611.c:304