![]() |
no-OS
|
Header file for the ad2s1210 driver. More...
Classes | |
| struct | ad2s1210_init_param |
| struct | ad2s1210_dev |
Enumerations | |
| enum | ad2s1210_mode { MODE_POS , MODE_RESERVED , MODE_VEL , MODE_CONFIG } |
| enum | ad2s1210_res { AD2S1210_RES_10BIT , AD2S1210_RES_12BIT , AD2S1210_RES_14BIT , AD2S1210_RES_16BIT } |
| enum | ad2s1210_channel { AD2S1210_POS , AD2S1210_VEL } |
Functions | |
| int | ad2s1210_init (struct ad2s1210_dev **dev, struct ad2s1210_init_param *init_param) |
| int | ad2s1210_remove (struct ad2s1210_dev *dev) |
| Remove the driver's descriptor by freeing the associated resources. | |
| int | ad2s1210_reg_write (struct ad2s1210_dev *dev, uint8_t addr, uint8_t val) |
| int | ad2s1210_reg_read (struct ad2s1210_dev *dev, uint8_t addr, uint8_t *val) |
| int | ad2s1210_spi_single_conversion (struct ad2s1210_dev *dev, uint32_t active_mask, void *data, uint32_t size) |
| Returns the result of a conversion. | |
| int | ad2s1210_hysteresis_is_enabled (struct ad2s1210_dev *dev) |
| int | ad2s1210_set_hysteresis (struct ad2s1210_dev *dev, bool enable) |
| int | ad2s1210_reinit_excitation_frequency (struct ad2s1210_dev *dev, uint16_t fexcit) |
| int | ad2s1210_get_excitation_frequency (struct ad2s1210_dev *dev, uint16_t *fexcit) |
Header file for the ad2s1210 driver.
Copyright (c) 2023 Analog Devices, Inc. Copyright (c) 2023 BayLibre, SAS.
SPDX-License-Identifier: BSD-3-Clause
| #define AD2S1210_CONTROL_RES0_MASK NO_OS_BIT(0) |
| #define AD2S1210_CONTROL_RES1_MASK NO_OS_BIT(1) |
| #define AD2S1210_CONTROL_RES_MASK NO_OS_GENMASK(1, 0) |
| #define AD2S1210_ENABLE_HYSTERESIS NO_OS_BIT(4) |
| #define AD2S1210_MAX_CLKIN 10240000 |
| #define AD2S1210_MAX_EXCIT 20000 |
| #define AD2S1210_MAX_FCW 0x50 |
| #define AD2S1210_MIN_CLKIN 6144000 |
| #define AD2S1210_MIN_EXCIT 2000 |
| #define AD2S1210_MIN_FCW 0x4 |
| #define AD2S1210_POS_MASK NO_OS_BIT(0) |
| #define AD2S1210_REG_CONTROL 0x92 |
| #define AD2S1210_REG_DOS_MIS_THRD 0x8A |
| #define AD2S1210_REG_DOS_OVR_THRD 0x89 |
| #define AD2S1210_REG_DOS_RST_MAX_THRD 0x8B |
| #define AD2S1210_REG_DOS_RST_MIN_THRD 0x8C |
| #define AD2S1210_REG_EXCIT_FREQ 0x91 |
| #define AD2S1210_REG_FAULT 0xFF |
| #define AD2S1210_REG_LOS_THRD 0x88 |
| #define AD2S1210_REG_LOT_HIGH_THRD 0x8D |
| #define AD2S1210_REG_LOT_LOW_THRD 0x8E |
| #define AD2S1210_REG_MIN AD2S1210_REG_POSITION |
| #define AD2S1210_REG_POSITION 0x80 |
| #define AD2S1210_REG_SOFT_RESET 0xF0 |
| #define AD2S1210_REG_VELOCITY 0x82 |
| #define AD2S1210_STEP_EXCIT 250 |
| #define AD2S1210_VEL_MASK NO_OS_BIT(1) |
| enum ad2s1210_channel |
| enum ad2s1210_mode |
| enum ad2s1210_res |
| int ad2s1210_get_excitation_frequency | ( | struct ad2s1210_dev * | dev, |
| uint16_t * | fexcit ) |
| int ad2s1210_hysteresis_is_enabled | ( | struct ad2s1210_dev * | dev | ) |
| int ad2s1210_init | ( | struct ad2s1210_dev ** | dev, |
| struct ad2s1210_init_param * | init_param ) |
| int ad2s1210_reg_read | ( | struct ad2s1210_dev * | dev, |
| uint8_t | addr, | ||
| uint8_t * | val ) |
| int ad2s1210_reg_write | ( | struct ad2s1210_dev * | dev, |
| uint8_t | addr, | ||
| uint8_t | val ) |
| int ad2s1210_reinit_excitation_frequency | ( | struct ad2s1210_dev * | dev, |
| uint16_t | fexcit ) |
| int ad2s1210_remove | ( | struct ad2s1210_dev * | dev | ) |
Remove the driver's descriptor by freeing the associated resources.
| dev | - Device descriptor. |
| int ad2s1210_set_hysteresis | ( | struct ad2s1210_dev * | dev, |
| bool | enable ) |
| int ad2s1210_spi_single_conversion | ( | struct ad2s1210_dev * | dev, |
| uint32_t | active_mask, | ||
| void * | data, | ||
| uint32_t | size ) |
Returns the result of a conversion.
| dev | - The device structure. |
| active_mask | - mask of active channels angle = bit 0, velocity = bit 1 |
| data | - Buffer to store sampled register data. |
| size | - size in bytes of the data buffer |