Go to the documentation of this file.
39 #ifndef __MAX11205_H__
40 #define __MAX11205_H__
55 #define MAX11205_VREF_MAX_MV 3600
56 #define MAX11205_DATA_SIZE_BYTES 2
57 #define MAX11205_SCALE NO_OS_GENMASK(14,0)
int max11205_get_data_raw(struct max11205_dev *dev, bool *new_data_avail, int16_t *data_raw)
Get the converted data.
Definition: max11205.c:173
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
Definition: max11205.h:79
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:165
Structure describing a callback to be registered.
Definition: no_os_irq.h:148
Header file of SPI Interface.
Header file of IRQ interface.
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:98
Definition: ad9361_util.h:75
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:60
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:130
@ NO_OS_IRQ_EDGE_FALLING
Definition: no_os_irq.h:85
struct no_os_callback_desc irq_cb
Definition: max11205.h:70
int max11205_init(struct max11205_dev **device, struct max11205_init_param init_param)
Initializes the communication peripheral.
Definition: max11205.c:91
struct no_os_spi_init_param spi_init
Definition: max11205.h:81
#define MAX11205_DATA_SIZE_BYTES
Definition: max11205.h:56
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: max11205.h:85
bool data_updated
Definition: max11205.h:76
int32_t no_os_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Unregisters a generic IRQ handling function.
Definition: no_os_irq.c:118
struct no_os_gpio_init_param * gpio_rdy
Definition: max11205.h:83
int max11205_remove(struct max11205_dev *dev)
Free memory allocated by max11205_init().
Definition: max11205.c:209
uint32_t vref_mv
Definition: max11205.h:87
int max11205_get_data_raw(struct max11205_dev *dev, bool *new_data_avail, int16_t *data_raw)
Get the converted data.
Definition: max11205.c:173
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:110
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
void(* callback)(void *context)
Definition: no_os_irq.h:150
Definition: max11205.h:62
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
struct no_os_gpio_desc * gpio_rdy
Definition: max11205.h:66
int max11205_get_data_mv(struct max11205_dev *dev, int16_t raw_data, int32_t *data_mv)
Get the converted data.
Definition: max11205.c:193
#define MAX11205_VREF_MAX_MV
Definition: max11205.h:55
int max11205_init(struct max11205_dev **device, struct max11205_init_param init_param)
Initializes the communication peripheral.
Definition: max11205.c:91
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:75
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:68
#define MAX11205_SCALE
Definition: max11205.h:57
int max11205_remove(struct max11205_dev *dev)
Free memory allocated by max11205_init().
Definition: max11205.c:209
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:122
uint32_t vref_mv
Definition: max11205.h:72
int max11205_get_data_mv(struct max11205_dev *dev, int16_t raw_data, int32_t *data_mv)
Get the converted data.
Definition: max11205.c:193
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:187
Implementation of max11205.h.
Header file of GPIO Interface.
int16_t adc_data_raw
Definition: max11205.h:74
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:91
struct no_os_spi_desc * spi_desc
Definition: max11205.h:64
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:58
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
Header file of utility functions.
int32_t no_os_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
Set interrupt trigger level.
Definition: no_os_irq.c:168
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:204
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: max11205.h:68
Definition: no_os_irq.h:129
int32_t number
Definition: no_os_gpio.h:106
Error macro definition for ARM Compiler.
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:58
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:81