LibDriver AS5600
Loading...
Searching...
No Matches
driver_as5600.h File Reference

driver as5600 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_as5600.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as5600_handle_s
 as5600 handle structure definition More...
struct  as5600_info_s
 as5600 information structure definition More...

Macros

#define DRIVER_AS5600_LINK_INIT(HANDLE, STRUCTURE)
 initialize as5600_handle_t structure
#define DRIVER_AS5600_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_AS5600_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_AS5600_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_AS5600_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_AS5600_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_AS5600_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct as5600_handle_s as5600_handle_t
 as5600 handle structure definition
typedef struct as5600_info_s as5600_info_t
 as5600 information structure definition

Enumerations

enum  as5600_bool_t { AS5600_BOOL_FALSE = 0x00 , AS5600_BOOL_TRUE = 0x01 }
 as5600 bool enumeration definition More...
enum  as5600_power_mode_t { AS5600_POWER_MODE_NOM = 0x00 , AS5600_POWER_MODE_LPM1 = 0x01 , AS5600_POWER_MODE_LPM2 = 0x02 , AS5600_POWER_MODE_LPM3 = 0x03 }
 as5600 power mode enumeration definition More...
enum  as5600_hysteresis_t { AS5600_HYSTERESIS_OFF = 0x00 , AS5600_HYSTERESIS_1LSB = 0x01 , AS5600_HYSTERESIS_2LSB = 0x02 , AS5600_HYSTERESIS_3LSB = 0x03 }
 as5600 hysteresis enumeration definition More...
enum  as5600_output_stage_t { AS5600_OUTPUT_STAGE_ANALOG_FULL = 0x00 , AS5600_OUTPUT_STAGE_ANALOG_REDUCED = 0x01 , AS5600_OUTPUT_STAGE_PWM = 0x02 }
 as5600 output stage enumeration definition More...
enum  as5600_pwm_frequency_t { AS5600_PWM_FREQUENCY_115HZ = 0x00 , AS5600_PWM_FREQUENCY_230HZ = 0x01 , AS5600_PWM_FREQUENCY_460HZ = 0x02 , AS5600_PWM_FREQUENCY_920HZ = 0x03 }
 as5600 pwm frequency enumeration definition More...
enum  as5600_slow_filter_t { AS5600_SLOW_FILTER_16X = 0x00 , AS5600_SLOW_FILTER_8X = 0x01 , AS5600_SLOW_FILTER_4X = 0x02 , AS5600_SLOW_FILTER_2X = 0x03 }
 as5600 slow filter enumeration definition More...
enum  as5600_fast_filter_threshold_t {
  AS5600_FAST_FILTER_THRESHOLD_SLOW_FILTER_ONLY = 0x00 , AS5600_FAST_FILTER_THRESHOLD_6LSB = 0x01 , AS5600_FAST_FILTER_THRESHOLD_7LSB = 0x02 , AS5600_FAST_FILTER_THRESHOLD_9LSB = 0x03 ,
  AS5600_FAST_FILTER_THRESHOLD_10LSB = 0x07 , AS5600_FAST_FILTER_THRESHOLD_18LSB = 0x04 , AS5600_FAST_FILTER_THRESHOLD_21LSB = 0x05 , AS5600_FAST_FILTER_THRESHOLD_24LSB = 0x06
}
 as5600 fast filter threshold enumeration definition More...
enum  as5600_status_t { AS5600_STATUS_MD = (1 << 5) , AS5600_STATUS_ML = (1 << 4) , AS5600_STATUS_MH = (1 << 3) }
 as5600 status enumeration definition More...
enum  as5600_burn_t {
  AS5600_BURN_CMD1 = 0x01 , AS5600_BURN_CMD2 = 0x11 , AS5600_BURN_CMD3 = 0x10 , AS5600_BURN_ANGLE = 0x80 ,
  AS5600_BURN_SETTING = 0x40
}
 as5600 burn enumeration definition More...

Functions

uint8_t as5600_info (as5600_info_t *info)
 get chip's information
uint8_t as5600_init (as5600_handle_t *handle)
 initialize the chip
uint8_t as5600_deinit (as5600_handle_t *handle)
 close the chip
uint8_t as5600_read (as5600_handle_t *handle, uint16_t *angle_raw, float *deg)
 read the magnetic angle
uint8_t as5600_angle_convert_to_register (as5600_handle_t *handle, float deg, uint16_t *reg)
 convert the angle to the register raw data
uint8_t as5600_angle_convert_to_data (as5600_handle_t *handle, uint16_t reg, float *deg)
 convert the register raw data to the angle
uint8_t as5600_set_start_position (as5600_handle_t *handle, uint16_t pos)
 set the start position
uint8_t as5600_get_start_position (as5600_handle_t *handle, uint16_t *pos)
 get the start position
uint8_t as5600_set_stop_position (as5600_handle_t *handle, uint16_t pos)
 set the stop position
uint8_t as5600_get_stop_position (as5600_handle_t *handle, uint16_t *pos)
 get the stop position
uint8_t as5600_set_max_angle (as5600_handle_t *handle, uint16_t ang)
 set the max angle
uint8_t as5600_get_max_angle (as5600_handle_t *handle, uint16_t *ang)
 get the max angle
uint8_t as5600_set_watch_dog (as5600_handle_t *handle, as5600_bool_t enable)
 enable or disable the watch dog
uint8_t as5600_get_watch_dog (as5600_handle_t *handle, as5600_bool_t *enable)
 get the watch dog status
uint8_t as5600_set_fast_filter_threshold (as5600_handle_t *handle, as5600_fast_filter_threshold_t threshold)
 set the fast filter threshold
uint8_t as5600_get_fast_filter_threshold (as5600_handle_t *handle, as5600_fast_filter_threshold_t *threshold)
 get the fast filter threshold
uint8_t as5600_set_slow_filter (as5600_handle_t *handle, as5600_slow_filter_t filter)
 set the slow filter
uint8_t as5600_get_slow_filter (as5600_handle_t *handle, as5600_slow_filter_t *filter)
 get the slow filter
uint8_t as5600_set_pwm_frequency (as5600_handle_t *handle, as5600_pwm_frequency_t freq)
 set the pwm frequency
uint8_t as5600_get_pwm_frequency (as5600_handle_t *handle, as5600_pwm_frequency_t *freq)
 get the pwm frequency
uint8_t as5600_set_output_stage (as5600_handle_t *handle, as5600_output_stage_t stage)
 set the output stage
uint8_t as5600_get_output_stage (as5600_handle_t *handle, as5600_output_stage_t *stage)
 get the output stage
uint8_t as5600_set_hysteresis (as5600_handle_t *handle, as5600_hysteresis_t hysteresis)
 set the hysteresis
uint8_t as5600_get_hysteresis (as5600_handle_t *handle, as5600_hysteresis_t *hysteresis)
 get the hysteresis
uint8_t as5600_set_power_mode (as5600_handle_t *handle, as5600_power_mode_t mode)
 set the power mode
uint8_t as5600_get_power_mode (as5600_handle_t *handle, as5600_power_mode_t *mode)
 get the power mode
uint8_t as5600_get_raw_angle (as5600_handle_t *handle, uint16_t *ang)
 get the raw angle
uint8_t as5600_get_angle (as5600_handle_t *handle, uint16_t *ang)
 get the angle
uint8_t as5600_get_status (as5600_handle_t *handle, uint8_t *status)
 get the status
uint8_t as5600_get_agc (as5600_handle_t *handle, uint8_t *agc)
 get the automatic gain control
uint8_t as5600_get_magnitude (as5600_handle_t *handle, uint16_t *magnitude)
 get the magnitude
uint8_t as5600_set_burn (as5600_handle_t *handle, as5600_burn_t burn)
 set the burn
uint8_t as5600_set_reg (as5600_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t as5600_get_reg (as5600_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver as5600 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2022-09-30

history

Date Version Author Description
2022/09/30 1.0 Shifeng Li first upload

Definition in file driver_as5600.h.