Implementation of max11205.h.
More...
#include <stdint.h>
#include <stdbool.h>
#include "no_os_gpio.h"
#include "no_os_irq.h"
#include "no_os_spi.h"
#include "no_os_util.h"
Implementation of max11205.h.
- Author
- RBolboac (ramon.nosp@m.a.bo.nosp@m.lboac.nosp@m.a@an.nosp@m.alog..nosp@m.com)
Copyright 2022(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ MAX11205_DATA_SIZE_BYTES
| #define MAX11205_DATA_SIZE_BYTES 2 |
◆ MAX11205_SCALE
◆ MAX11205_VREF_MAX_MV
| #define MAX11205_VREF_MAX_MV 3600 |
◆ max11205_get_data_mv()
| int max11205_get_data_mv |
( |
struct max11205_dev * | dev, |
|
|
int16_t | raw_data, |
|
|
int32_t * | data_mv ) |
Get the converted data.
- Parameters
-
| dev | - Device handler. |
| raw_data | - ADC raw data to be converted to millivolts. |
| data_mv | - Pointer to adc value measured in millivolts. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max11205_get_data_raw()
| int max11205_get_data_raw |
( |
struct max11205_dev * | dev, |
|
|
bool * | new_data_avail, |
|
|
int16_t * | data_raw ) |
Get the converted data.
- Parameters
-
| dev | - Device handler. |
| new_data_avail | - True if data has been updated since last read, false if same data is read again. |
| data_raw | - Pointer to raw adc value. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max11205_init()
Initializes the communication peripheral.
- Parameters
-
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max11205_remove()
Free memory allocated by max11205_init().
- Parameters
-
- Returns
- 0 in case of success, negative error code otherwise.