![]() |
no-OS
|
Source file of MAX22017 Driver. More...
#include <stdlib.h>#include <string.h>#include "max22017.h"#include "no_os_error.h"#include "no_os_util.h"#include "no_os_alloc.h"#include "no_os_crc8.h"Functions | |
| NO_OS_DECLARE_CRC8_TABLE (table) | |
| int32_t | max22017_gpio_get (struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param) |
| Obtain the GPIO decriptor. | |
| int32_t | max22017_gpio_remove (struct no_os_gpio_desc *desc) |
| Free the resources allocated by no_os_gpio_get(). | |
| int32_t | max22017_gpio_direction_input (struct no_os_gpio_desc *desc) |
| Enable the input direction of the specified GPIO. | |
| int32_t | max22017_gpio_direction_output (struct no_os_gpio_desc *desc, uint8_t value) |
| Enable the output direction of the specified GPIO. | |
| int32_t | max22017_gpio_get_direction (struct no_os_gpio_desc *desc, uint8_t *direction) |
| Get the direction of the specified GPIO. | |
| int32_t | max22017_gpio_set_value (struct no_os_gpio_desc *desc, uint8_t value) |
| Set the value of the specified GPIO. | |
| int32_t | max22017_gpio_get_value (struct no_os_gpio_desc *desc, uint8_t *value) |
| Get the value of the specified GPIO. | |
| int | max22017_set_timeout (struct max22017_desc *desc, bool timeout_cnfg, bool timeout_en, enum max22017_timeout_sel timeout) |
| Set timeout settings for MAX22017 device. | |
| int | max22017_set_data (struct max22017_desc *desc, enum max22017_channel ch, int32_t data) |
| Set data of the selected channel. | |
| int | max22017_get_data (struct max22017_desc *desc, enum max22017_channel ch, int32_t *data) |
| Get data from requestec channel. | |
| int | max22017_slew_rate (struct max22017_desc *desc, enum max22017_channel ch, enum max22017_sr_step_size step_size, enum max22017_sr_update_rate update_rate, bool enable, bool hart) |
| Set slew rate settings for requested channels. | |
| int | max22017_offset_calib (struct max22017_desc *desc, enum max22017_channel ch, int16_t offset) |
| Set offset value for output calibration. | |
| int | max22017_gain_calib (struct max22017_desc *desc, enum max22017_channel ch, uint16_t gain) |
| Set gain value for calibration of requested channel. | |
| int | max22017_op_mode (struct max22017_desc *desc, enum max22017_channel ch, enum max22017_op_mode op_mode) |
| Set operation mode for requested channel. | |
| int | max22017_config (struct max22017_desc *desc, enum max22017_channel ch, enum max22017_out_mode uni, enum max22017_cm_sense cm_sense, bool ldac) |
| Set AO configuration. | |
| int | max22017_soft_reset (struct max22017_desc *desc, enum max22017_channel ch, bool coeff_only) |
| Soft reset requested channel. | |
| int | max22017_reg_read (struct max22017_desc *desc, uint32_t addr, uint32_t *val) |
| Read the value of a device register. | |
| int | max22017_reg_write (struct max22017_desc *desc, uint32_t addr, uint32_t val) |
| Write the value of a device register. | |
| int | max22017_reg_update (struct max22017_desc *desc, uint32_t addr, uint32_t mask, uint32_t val) |
| Update the value of a device register (read/write sequence). | |
| int | max22017_init (struct max22017_desc **desc, struct max22017_init_param *param) |
| Initialize and configure the MAX22017 device. | |
| int | max22017_remove (struct max22017_desc *desc) |
| Free the resources allocated during init and perform a soft reset. | |
Variables | |
| const struct no_os_gpio_platform_ops | max22017_gpio_ops |
Source file of MAX22017 Driver.
Copyright 2024(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int max22017_config | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| enum max22017_out_mode | uni, | ||
| enum max22017_cm_sense | cm_sense, | ||
| bool | ldac ) |
Set AO configuration.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| uni | - Polarity type : false - bipolar true - unipolar |
| cm_sense | - CM sense resistor value, affects OW value as well |
| ldac | - Enable/Disable LDAC function, takes effect only if LDAC GPIO is set with load_control API. |
| int max22017_gain_calib | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| uint16_t | gain ) |
Set gain value for calibration of requested channel.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| gain | - Gain value |
| int max22017_get_data | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| int32_t * | data ) |
Get data from requestec channel.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| data | - Received data from channel |
| int32_t max22017_gpio_direction_input | ( | struct no_os_gpio_desc * | desc | ) |
Enable the input direction of the specified GPIO.
| desc | - The GPIO descriptor. |
| int32_t max22017_gpio_direction_output | ( | struct no_os_gpio_desc * | desc, |
| uint8_t | value ) |
Enable the output direction of the specified GPIO.
| desc | - The GPIO descriptor. |
| value | - The value. Example: NO_OS_GPIO_HIGH NO_OS_GPIO_LOW |
| int32_t max22017_gpio_get | ( | struct no_os_gpio_desc ** | desc, |
| const struct no_os_gpio_init_param * | param ) |
Obtain the GPIO decriptor.
| desc | - The GPIO descriptor. |
| param | - GPIO initialization parameters |
| int32_t max22017_gpio_get_direction | ( | struct no_os_gpio_desc * | desc, |
| uint8_t * | direction ) |
Get the direction of the specified GPIO.
| desc | - The GPIO descriptor. |
| direction | - The direction. Example: NO_OS_GPIO_OUT NO_OS_GPIO_IN |
| int32_t max22017_gpio_get_value | ( | struct no_os_gpio_desc * | desc, |
| uint8_t * | value ) |
Get the value of the specified GPIO.
| desc | - The GPIO descriptor. |
| value | - The value. Example: NO_OS_GPIO_HIGH NO_OS_GPIO_LOW |
| int32_t max22017_gpio_remove | ( | struct no_os_gpio_desc * | desc | ) |
Free the resources allocated by no_os_gpio_get().
| desc | - The GPIO descriptor. |
| int32_t max22017_gpio_set_value | ( | struct no_os_gpio_desc * | desc, |
| uint8_t | value ) |
Set the value of the specified GPIO.
| desc | - The GPIO descriptor. |
| value | - The value. Example: NO_OS_GPIO_HIGH NO_OS_GPIO_LOW |
| int max22017_init | ( | struct max22017_desc ** | desc, |
| struct max22017_init_param * | param ) |
Initialize and configure the MAX22017 device.
| desc | - device descriptor for the MAX22017 that will be initialized. |
| param | - initialization parameter for the device. |
| int max22017_offset_calib | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| int16_t | offset ) |
Set offset value for output calibration.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| offset | - Offset value |
| int max22017_op_mode | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| enum max22017_op_mode | op_mode ) |
Set operation mode for requested channel.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| op_mode | - Operation mode |
| int max22017_reg_read | ( | struct max22017_desc * | desc, |
| uint32_t | addr, | ||
| uint32_t * | val ) |
Read the value of a device register.
| desc | - device descriptor for the MAX22017 |
| addr | - address of the register |
| val | - value of the register |
| int max22017_reg_update | ( | struct max22017_desc * | desc, |
| uint32_t | addr, | ||
| uint32_t | mask, | ||
| uint32_t | val ) |
Update the value of a device register (read/write sequence).
| desc | - device descriptor for the MAX22017 |
| addr | - address of the register |
| mask | - bit mask of the field to be updated |
| val | - value of the masked field. Should be bit shifted by using no_os_field_prep(mask, val) |
| int max22017_reg_write | ( | struct max22017_desc * | desc, |
| uint32_t | addr, | ||
| uint32_t | val ) |
Write the value of a device register.
| desc | - device descriptor for the MAX22017 |
| addr | - address of the register |
| val | - value of the register |
| int max22017_remove | ( | struct max22017_desc * | desc | ) |
Free the resources allocated during init and perform a soft reset.
| desc | - device descriptor for the MAX22017 that will be initialized. |
| int max22017_set_data | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| int32_t | data ) |
Set data of the selected channel.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| data | - Data to be set. |
| int max22017_set_timeout | ( | struct max22017_desc * | desc, |
| bool | timeout_cnfg, | ||
| bool | timeout_en, | ||
| enum max22017_timeout_sel | timeout ) |
Set timeout settings for MAX22017 device.
| desc | - MAX22017 device descriptor |
| timeout_cnfg | - Timeout configuration : false - A timeout will only assert TMOUT_INT bit in Interrupts Register true - A timeout will also reset AO_EN, AI_EN and GPIO_EN pair of bits. |
| timeout_en | - Enable/disable timeout |
| timeout | - Timeout time value |
| int max22017_slew_rate | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| enum max22017_sr_step_size | step_size, | ||
| enum max22017_sr_update_rate | update_rate, | ||
| bool | enable, | ||
| bool | hart ) |
Set slew rate settings for requested channels.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| step_size | - Step size value |
| update_rate | - Update rate value |
| enable | - Enable/disable slew rate control |
| hart | - true - Slew rate times for HART applications false - Slew rate times for inductive load applications |
| int max22017_soft_reset | ( | struct max22017_desc * | desc, |
| enum max22017_channel | ch, | ||
| bool | coeff_only ) |
Soft reset requested channel.
| desc | - MAX22017 device descriptor |
| ch | - Selected channel |
| coeff_only | - Coefficient only reset enable/disable |
| NO_OS_DECLARE_CRC8_TABLE | ( | table | ) |
| const struct no_os_gpio_platform_ops max22017_gpio_ops |