Go to the documentation of this file.
42 #define AD2S1210_REG_POSITION 0x80
43 #define AD2S1210_REG_VELOCITY 0x82
44 #define AD2S1210_REG_LOS_THRD 0x88
45 #define AD2S1210_REG_DOS_OVR_THRD 0x89
46 #define AD2S1210_REG_DOS_MIS_THRD 0x8A
47 #define AD2S1210_REG_DOS_RST_MAX_THRD 0x8B
48 #define AD2S1210_REG_DOS_RST_MIN_THRD 0x8C
49 #define AD2S1210_REG_LOT_HIGH_THRD 0x8D
50 #define AD2S1210_REG_LOT_LOW_THRD 0x8E
51 #define AD2S1210_REG_EXCIT_FREQ 0x91
52 #define AD2S1210_REG_CONTROL 0x92
53 #define AD2S1210_CONTROL_RES_MASK NO_OS_GENMASK(1, 0)
54 #define AD2S1210_CONTROL_RES0_MASK NO_OS_BIT(0)
55 #define AD2S1210_CONTROL_RES1_MASK NO_OS_BIT(1)
56 #define AD2S1210_ENABLE_HYSTERESIS NO_OS_BIT(4)
58 #define AD2S1210_REG_SOFT_RESET 0xF0
59 #define AD2S1210_REG_FAULT 0xFF
61 #define AD2S1210_REG_MIN AD2S1210_REG_POSITION
63 #define AD2S1210_MIN_CLKIN 6144000
64 #define AD2S1210_MAX_CLKIN 10240000
65 #define AD2S1210_MIN_EXCIT 2000
66 #define AD2S1210_MAX_EXCIT 20000
67 #define AD2S1210_STEP_EXCIT 250
68 #define AD2S1210_MIN_FCW 0x4
69 #define AD2S1210_MAX_FCW 0x50
71 #define AD2S1210_POS_MASK NO_OS_BIT(0)
72 #define AD2S1210_VEL_MASK NO_OS_BIT(1)
127 uint32_t active_mask,
128 void *data, uint32_t size);
struct no_os_gpio_init_param gpio_res1
Definition: ad2s1210.h:98
ad2s1210_res
Definition: ad2s1210.h:81
#define AD2S1210_REG_POSITION
Definition: ad2s1210.h:42
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
@ AD2S1210_POS
Definition: ad2s1210.h:89
#define AD2S1210_REG_SOFT_RESET
Definition: ad2s1210.h:58
#define AD2S1210_POS_MASK
Definition: ad2s1210.h:71
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
ad2s1210_mode
Definition: ad2s1210.h:74
Header file of SPI Interface.
#define AD2S1210_REG_CONTROL
Definition: ad2s1210.h:52
#define AD2S1210_REG_EXCIT_FREQ
Definition: ad2s1210.h:51
int ad2s1210_reg_read(struct ad2s1210_dev *dev, uint8_t addr, uint8_t *val)
Definition: ad2s1210.c:84
const char * name
Definition: ad2s1210.h:105
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
bool have_resolution_pins
Definition: ad2s1210.h:107
int ad2s1210_reg_write(struct ad2s1210_dev *dev, uint8_t addr, uint8_t val)
Definition: ad2s1210.c:54
Header file of Delay functions.
@ MODE_RESERVED
Definition: ad2s1210.h:76
int8_t resolution
Definition: ad2s1210.h:100
int ad2s1210_init(struct ad2s1210_dev **dev, struct ad2s1210_init_param *init_param)
Definition: ad2s1210.c:303
int ad2s1210_reg_write(struct ad2s1210_dev *dev, uint8_t addr, uint8_t val)
Definition: ad2s1210.c:54
#define AD2S1210_CONTROL_RES1_MASK
Definition: ad2s1210.h:55
struct no_os_gpio_desc * gpio_sample
Definition: ad2s1210.h:115
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
#define AD2S1210_REG_VELOCITY
Definition: ad2s1210.h:43
struct no_os_gpio_desc * gpio_a1
Definition: ad2s1210.h:111
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
#define AD2S1210_MIN_CLKIN
Definition: ad2s1210.h:63
int ad2s1210_reinit_excitation_frequency(struct ad2s1210_dev *dev, uint16_t fexcit)
Definition: ad2s1210.c:124
@ MODE_CONFIG
Definition: ad2s1210.h:78
@ AD2S1210_RES_12BIT
Definition: ad2s1210.h:83
struct no_os_gpio_desc * gpio_a0
Definition: ad2s1210.h:112
ad2s1210_channel
Definition: ad2s1210.h:88
int ad2s1210_set_hysteresis(struct ad2s1210_dev *dev, bool enable)
Definition: ad2s1210.c:197
@ AD2S1210_RES_16BIT
Definition: ad2s1210.h:85
struct no_os_gpio_init_param gpio_a1
Definition: ad2s1210.h:96
bool have_mode_pins
Definition: ad2s1210.h:106
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
struct no_os_gpio_desc * gpio_res1
Definition: ad2s1210.h:114
enum ad2s1210_mode mode
Definition: ad2s1210.h:108
#define AD2S1210_VEL_MASK
Definition: ad2s1210.h:72
struct no_os_spi_init_param spi_init
Definition: ad2s1210.h:94
enum ad2s1210_res resolution
Definition: ad2s1210.h:109
struct no_os_gpio_desc * gpio_res0
Definition: ad2s1210.h:113
int ad2s1210_get_excitation_frequency(struct ad2s1210_dev *dev, uint16_t *fexcit)
Definition: ad2s1210.c:153
@ AD2S1210_RES_14BIT
Definition: ad2s1210.h:84
int ad2s1210_init(struct ad2s1210_dev **dev, struct ad2s1210_init_param *init_param)
Definition: ad2s1210.c:303
int ad2s1210_spi_single_conversion(struct ad2s1210_dev *dev, uint32_t active_mask, void *data, uint32_t size)
Returns the result of a conversion.
Definition: ad2s1210.c:449
@ AD2S1210_RES_10BIT
Definition: ad2s1210.h:82
@ AD2S1210_VEL
Definition: ad2s1210.h:90
int ad2s1210_hysteresis_is_enabled(struct ad2s1210_dev *dev)
Definition: ad2s1210.c:174
#define AD2S1210_REG_MIN
Definition: ad2s1210.h:61
uint32_t clkin_hz
Definition: ad2s1210.h:116
#define AD2S1210_MAX_CLKIN
Definition: ad2s1210.h:64
struct no_os_gpio_init_param gpio_a0
Definition: ad2s1210.h:95
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
int ad2s1210_reg_read(struct ad2s1210_dev *dev, uint8_t addr, uint8_t *val)
Definition: ad2s1210.c:84
struct no_os_spi_desc * spi_desc
Definition: ad2s1210.h:110
int ad2s1210_remove(struct ad2s1210_dev *dev)
Remove the driver's descriptor by freeing the associated resources.
Definition: ad2s1210.c:495
#define AD2S1210_MAX_FCW
Definition: ad2s1210.h:69
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
Definition: ad2s1210.h:93
uint32_t clkin_hz
Definition: ad2s1210.h:101
#define AD2S1210_CONTROL_RES0_MASK
Definition: ad2s1210.h:54
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
#define AD2S1210_CONTROL_RES_MASK
Definition: ad2s1210.h:53
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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 no_os_gpio_init_param gpio_sample
Definition: ad2s1210.h:99
struct no_os_gpio_init_param gpio_res0
Definition: ad2s1210.h:97
int ad2s1210_set_hysteresis(struct ad2s1210_dev *dev, bool enable)
Definition: ad2s1210.c:197
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ MODE_POS
Definition: ad2s1210.h:75
Definition: ad2s1210.h:104
int ad2s1210_remove(struct ad2s1210_dev *dev)
Remove the driver's descriptor by freeing the associated resources.
Definition: ad2s1210.c:495
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
Header file of GPIO Interface.
int ad2s1210_spi_single_conversion(struct ad2s1210_dev *dev, uint32_t active_mask, void *data, uint32_t size)
Returns the result of a conversion.
Definition: ad2s1210.c:449
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
Header file of utility functions.
#define AD2S1210_ENABLE_HYSTERESIS
Definition: ad2s1210.h:56
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
int ad2s1210_reinit_excitation_frequency(struct ad2s1210_dev *dev, uint16_t fexcit)
Definition: ad2s1210.c:124
@ MODE_VEL
Definition: ad2s1210.h:77
Header file for the ad2s1210 driver.
int ad2s1210_hysteresis_is_enabled(struct ad2s1210_dev *dev)
Definition: ad2s1210.c:174
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int ad2s1210_get_excitation_frequency(struct ad2s1210_dev *dev, uint16_t *fexcit)
Definition: ad2s1210.c:153
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