Go to the documentation of this file.
33 #ifndef __MAX11205_H__
34 #define __MAX11205_H__
49 #define MAX11205_VREF_MAX_MV 3600
50 #define MAX11205_DATA_SIZE_BYTES 2
51 #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:167
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
Definition: max11205.h:73
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:159
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
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:92
Definition: ad9361_util.h:69
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
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:124
@ NO_OS_IRQ_EDGE_FALLING
Definition: no_os_irq.h:79
struct no_os_callback_desc irq_cb
Definition: max11205.h:64
int max11205_init(struct max11205_dev **device, struct max11205_init_param init_param)
Initializes the communication peripheral.
Definition: max11205.c:85
struct no_os_spi_init_param spi_init
Definition: max11205.h:75
#define MAX11205_DATA_SIZE_BYTES
Definition: max11205.h:50
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: max11205.h:79
bool data_updated
Definition: max11205.h:70
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:112
struct no_os_gpio_init_param * gpio_rdy
Definition: max11205.h:77
int max11205_remove(struct max11205_dev *dev)
Free memory allocated by max11205_init().
Definition: max11205.c:203
uint32_t vref_mv
Definition: max11205.h:81
int max11205_get_data_raw(struct max11205_dev *dev, bool *new_data_avail, int16_t *data_raw)
Get the converted data.
Definition: max11205.c:167
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:104
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
void(* callback)(void *context)
Definition: no_os_irq.h:144
Definition: max11205.h:56
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
struct no_os_gpio_desc * gpio_rdy
Definition: max11205.h:60
int max11205_get_data_mv(struct max11205_dev *dev, int16_t raw_data, int32_t *data_mv)
Get the converted data.
Definition: max11205.c:187
#define MAX11205_VREF_MAX_MV
Definition: max11205.h:49
int max11205_init(struct max11205_dev **device, struct max11205_init_param init_param)
Initializes the communication peripheral.
Definition: max11205.c:85
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
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:62
#define MAX11205_SCALE
Definition: max11205.h:51
int max11205_remove(struct max11205_dev *dev)
Free memory allocated by max11205_init().
Definition: max11205.c:203
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:116
uint32_t vref_mv
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:187
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:181
Implementation of max11205.h.
Header file of GPIO Interface.
int16_t adc_data_raw
Definition: max11205.h:68
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:85
struct no_os_spi_desc * spi_desc
Definition: max11205.h:58
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:52
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:162
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:198
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: max11205.h:62
Definition: no_os_irq.h:123
int32_t number
Definition: no_os_gpio.h:100
Error macro definition for ARM Compiler.
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
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:75