haptic 2.0.0.0
|
Functions | |
void | haptic_cfg_setup (haptic_cfg_t *cfg) |
Config Object Initialization function. | |
HAPTIC_RETVAL | haptic_init (haptic_t *ctx, haptic_cfg_t *cfg) |
Initialization function. | |
void | haptic_generic_write (haptic_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | haptic_generic_read (haptic_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | haptic_enable (haptic_t *ctx) |
Enable the device function. | |
void | haptic_disable (haptic_t *ctx) |
Disable the device function. | |
void | haptic_write_byte (haptic_t *ctx, uint8_t reg_address, uint8_t write_data) |
Generic write the byte of data function. | |
uint8_t | haptic_read_byte (haptic_t *ctx, uint8_t reg_address) |
Generic read the byte of data function. | |
void | haptic_set_mode (haptic_t *ctx, uint8_t sel_mode) |
Sets the Haptic click to desired mode function. | |
void | haptic_soft_reset (haptic_t *ctx) |
Resets all the registers function. | |
uint8_t | haptic_get_status (haptic_t *ctx) |
Get status register value function. | |
void | haptic_set_rtp_input (haptic_t *ctx, uint8_t input) |
Sets the desired input for RTP mode function. | |
void | haptic_set_state_hi (haptic_t *ctx) |
Generic read function. | |
uint8_t | haptic_set_library (haptic_t *ctx, uint8_t library) |
Sets the desired library of vibrating patterns to read function. | |
void | haptic_start_motor (haptic_t *ctx) |
Starts moving the motor function. | |
void | haptic_set_overdrive_offset (haptic_t *ctx, uint8_t temp_data) |
Sets overdrive offset function. | |
void | haptic_set_sustain_offset_positive (haptic_t *ctx, uint8_t temp_data) |
Sets desired sustain offset - positive function. | |
void | haptic_set_sustain_offset_negative (haptic_t *ctx, uint8_t temp_data) |
Sets desired sustain offset - negative function. | |
void | haptic_set_brake_time_offset (haptic_t *ctx, uint8_t temp_data) |
Sets desired brake time offset function. | |
void | haptic_set_audio_minimum_input (haptic_t *ctx, uint8_t temp_data) |
Sets minimum input for audio to vibe mode function. | |
void | haptic_set_audio_maximum_input (haptic_t *ctx, uint8_t temp_data) |
Sets maximum input for audio to vibe mode function. | |
void | haptic_set_audio_minimum_output (haptic_t *ctx, uint8_t temp_data) |
Sets minimum output for audio to vibe mode function. | |
void | haptic_set_audio_maximum_output (haptic_t *ctx, uint8_t temp_data) |
Sets maximum output for audio to vibe mode function. | |
void | haptic_set_rated_voltage (haptic_t *ctx, uint8_t temp_data) |
Sets the reference voltage function. | |
void | haptic_set_overdrive_clamp_voltage (haptic_t *ctx, uint8_t temp_data) |
Sets a clamp function. | |
uint8_t | haptic_set_audio_peak_time (haptic_t *ctx, uint8_t temp_data) |
Sets the peak detection time function. | |
uint8_t | haptic_set_audio_low_pass_filter (haptic_t *ctx, uint8_t temp_data) |
Sets the low-pass filter frequency function. | |
uint8_t | haptic_get_calibration_result_comp (haptic_t *ctx) |
Reads the voltage-compensation function. | |
uint8_t | haptic_get_calibration_result_emf (haptic_t *ctx) |
Reads the rated back - EMF function. | |
uint8_t | haptic_get_supply_voltage_value (haptic_t *ctx) |
Reading of the supply voltage function. | |
uint8_t | haptic_get_lra_resonance_period (haptic_t *ctx) |
Reads the measurement of the LRA resonance period function. | |
void | haptic_set_to_erm_mode (haptic_t *ctx) |
Sets the Haptic click in ERM mode function. | |
void | haptic_set_to_lra_mode (haptic_t *ctx) |
Sets the Haptic click in LRA mode function. | |
uint8_t | haptic_setBrakeFactor (haptic_t *ctx, uint8_t brake_factor) |
Sets the feedback gain ratio function. | |
uint8_t | haptic_set_loop_gain (haptic_t *ctx, uint8_t gain) |
Selects a loop gain function. | |
void | haptic_set_input_to_analog (haptic_t *ctx) |
Sets the input to analog function. | |
void | haptic_set_input_to_pwm (haptic_t *ctx) |
Sets the input for PWM control function. | |
void | haptic_set_sequence (haptic_t *ctx, uint8_t temp_data) |
Sets the waveform identifier function. | |
void | haptic_enable_ac_coulping (haptic_t *ctx) |
Applies a 0.9-V common mode voltage function. | |
void | haptic_set_duty_cycle (haptic_t *ctx, float duty_cycle) |
Generic sets PWM duty cycle. | |
void | haptic_pwm_stop (haptic_t *ctx) |
Stop PWM module. | |
void | haptic_pwm_start (haptic_t *ctx) |
Start PWM module. | |
void haptic_cfg_setup | ( | haptic_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void haptic_disable | ( | haptic_t * | ctx | ) |
Disable the device function.
ctx | Click object. |
@description Function disable the device function on the DRV2605 chip by clear RST pin ( low ) on Haptic Click board.
void haptic_enable | ( | haptic_t * | ctx | ) |
Enable the device function.
ctx | Click object. |
@description Function enable the device on the DRV2605 chip by set RST pin ( high ) on Haptic Click board.
void haptic_enable_ac_coulping | ( | haptic_t * | ctx | ) |
Applies a 0.9-V common mode voltage function.
ctx | Click object. |
@description Function applies a 0.9-V common mode voltage to the IN/TRIG pin by write value of 0xB3 to control 1 register address of DRV2605 chip on Haptic Click board.
void haptic_generic_read | ( | haptic_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void haptic_generic_write | ( | haptic_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
uint8_t haptic_get_calibration_result_comp | ( | haptic_t * | ctx | ) |
Reads the voltage-compensation function.
ctx | Click object. |
@description Function get the voltage-compensation result after execution of auto calibration by read value from the target register address of DRV2605 chip on Haptic Click board.
uint8_t haptic_get_calibration_result_emf | ( | haptic_t * | ctx | ) |
Reads the rated back - EMF function.
ctx | Click object. |
@description Function get the rated back - EMF result after execution of auto calibration by read value from the target register address of DRV2605 chip on Haptic Click board.
uint8_t haptic_get_lra_resonance_period | ( | haptic_t * | ctx | ) |
Reads the measurement of the LRA resonance period function.
ctx | Click object. |
@description Function gets the measurement of the LRA resonance period by read value from the LRA resonance register of DRV2605 chip on Haptic Click board.
uint8_t haptic_get_status | ( | haptic_t * | ctx | ) |
Get status register value function.
ctx | Click object. |
@description Function reads the value from the status register of DRV2605 chip on Haptic Click board.
uint8_t haptic_get_supply_voltage_value | ( | haptic_t * | ctx | ) |
Reading of the supply voltage function.
ctx | Click object. |
@description Function does a real-time reading of the supply voltage at the VDD pin of DRV2605 chip on Haptic Click board.
HAPTIC_RETVAL haptic_init | ( | haptic_t * | ctx, |
haptic_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void haptic_pwm_start | ( | haptic_t * | ctx | ) |
Start PWM module.
ctx | Click object. |
@description This function starts PWM module.
void haptic_pwm_stop | ( | haptic_t * | ctx | ) |
Stop PWM module.
ctx | Click object. |
@description This function stops PWM module.
uint8_t haptic_read_byte | ( | haptic_t * | ctx, |
uint8_t | reg_address ) |
Generic read the byte of data function.
ctx | Click object. |
reg_address | 8-bit register address. |
@description Function read the byte of data from given 8-bit register address of DRV2605 chip on Haptic Click board.
uint8_t haptic_set_audio_low_pass_filter | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets the low-pass filter frequency function.
ctx | Click object. |
temp_data | 8-bit desired value. |
@description Function sets the low-pass filter frequency for the audio-to-vibe signal path by write desired value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_audio_maximum_input | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets maximum input for audio to vibe mode function.
ctx | Click object. |
temp_data | 8-bit desired maximum input. |
@description Function sets maximum input for audio to vibe mode by write desired maximum input value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_audio_maximum_output | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets maximum output for audio to vibe mode function.
ctx | Click object. |
temp_data | 8-bit desired maximum output |
@description Function sets maximum output for audio to vibe mode by write desired maximum output value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_audio_minimum_input | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets minimum input for audio to vibe mode function.
ctx | Click object. |
temp_data | 8-bit desired minimum input |
@description Function sets minimum input for audio to vibe mode by write desired minimum input value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_audio_minimum_output | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets minimum output for audio to vibe mode function.
ctx | Click object. |
temp_data | 8-bit desired minimum output. |
@description Function sets minimum output for audio to vibe mode by write desired minimum output value to address of the target register of DRV2605 chip on Haptic Click board.
uint8_t haptic_set_audio_peak_time | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets the peak detection time function.
ctx | Click object. |
temp_data | 8-bit desired value. |
@description Function sets the peak detection time for the audio-to-vibe signal path by write desired value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_brake_time_offset | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets desired brake time offset function.
ctx | Click object. |
temp_data | 8-bit desired brake time offset. |
@description Function sets desired brake time offset by write desired brake time value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_duty_cycle | ( | haptic_t * | ctx, |
float | duty_cycle ) |
Generic sets PWM duty cycle.
ctx | Click object. |
duty_cycle | Duty cycle. |
@description This function sets the PWM duty cycle.
void haptic_set_input_to_analog | ( | haptic_t * | ctx | ) |
Sets the input to analog function.
ctx | Click object. |
@description Function sets the input of the Haptic click to analog by set second lowest bit of control 3 register of DRV2605 chip on Haptic Click board.
void haptic_set_input_to_pwm | ( | haptic_t * | ctx | ) |
Sets the input for PWM control function.
ctx | Click object. |
@description Function sets the input for PWM control of the motor by clear second lowest bit of control 3 register of DRV2605 chip on Haptic Click board.
uint8_t haptic_set_library | ( | haptic_t * | ctx, |
uint8_t | library ) |
Sets the desired library of vibrating patterns to read function.
ctx | Click object. |
library | 8-bit desired pattern library for reading. |
@description Function sets the desired library of vibrating patterns to read register of DRV2605 chip on Haptic Click board.
uint8_t haptic_set_loop_gain | ( | haptic_t * | ctx, |
uint8_t | gain ) |
Selects a loop gain function.
ctx | Click object. |
gain | 8-bit desired gain |
@description Function selects a loop gain for the feedback control of DRV2605 chip on Haptic Click board.
void haptic_set_mode | ( | haptic_t * | ctx, |
uint8_t | sel_mode ) |
Sets the Haptic click to desired mode function.
ctx | Click object. |
sel_mode | Select mode. |
@description Function sets the desired mode by write mode register of the DRV2605 chip on Haptic Click board.
void haptic_set_overdrive_clamp_voltage | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets a clamp function.
ctx | Click object. |
temp_data | 8-bit desired value. |
@description Function sets a clamp so that the automatic overdrive is bounded by write desired value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_overdrive_offset | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets overdrive offset function.
ctx | Click object. |
temp_data | 8-bit desired overdrive offset. |
@description Function sets overdrive offset by write desired overdrive value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_rated_voltage | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets the reference voltage function.
ctx | Click object. |
temp_data | 8-bit desired value. |
@description Function sets the reference voltage for full-scale output during closed-loop by write desired value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_rtp_input | ( | haptic_t * | ctx, |
uint8_t | input ) |
Sets the desired input for RTP mode function.
ctx | Click object. |
input | 8-bit desired input for RTP mode. |
@description Function sets the desired input for RTP mode of DRV2605 chip on Haptic Click board.
void haptic_set_sequence | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets the waveform identifier function.
ctx | Click object. |
temp_data | 8-bit desired waveform. |
@description Function sets the waveform identifier of the waveform to be played of DRV2605 chip on Haptic Click board. A waveform identifier is an integer value referring to the index position of a waveform in a ROM library. Playback begins at register address 0x04 when the user asserts the GO bit ( register 0x0C ). When playback of that waveform ends, the waveform sequencer plays the next waveform identifier held in register 0x05
void haptic_set_state_hi | ( | haptic_t * | ctx | ) |
Generic read function.
ctx | Click object. |
@description Function sets the device in HI state of DRV2605 chip on Haptic Click board.
void haptic_set_sustain_offset_negative | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets desired sustain offset - negative function.
ctx | Click object. |
temp_data | 8-bit desired negative sustain offset. |
@description Function sets desired sustain offset - negative by write desired negative sustain value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_sustain_offset_positive | ( | haptic_t * | ctx, |
uint8_t | temp_data ) |
Sets desired sustain offset - positive function.
ctx | Click object. |
temp_data | 8-bit desired positive sustain offset. |
@description Function sets desired sustain offset - positive by write desired positive sustain value to address of the target register of DRV2605 chip on Haptic Click board.
void haptic_set_to_erm_mode | ( | haptic_t * | ctx | ) |
Sets the Haptic click in ERM mode function.
ctx | Click object. |
@description Function sets the Haptic click in ERM mode by write clear highest bit of feedback register of DRV2605 chip on Haptic Click board.
void haptic_set_to_lra_mode | ( | haptic_t * | ctx | ) |
Sets the Haptic click in LRA mode function.
ctx | Click object. |
@description Function sets the Haptic click in LRA mode by write set highest bit of feedback register of DRV2605 chip on Haptic Click board.
uint8_t haptic_setBrakeFactor | ( | haptic_t * | ctx, |
uint8_t | brake_factor ) |
Sets the feedback gain ratio function.
ctx | Click object. |
brake_factor | 8-bit desired brake factor |
@description Function sets the feedback gain ratio between braking gain and driving gain. In general, adding additional feedback gain while braking is desirable so that the actuator brakes as quickly as possible. Large ratios provide less-stable operation than lower ones.
void haptic_soft_reset | ( | haptic_t * | ctx | ) |
Resets all the registers function.
ctx | Click object. |
@description Function resets all the registers by set highest bit of mode registe of the DRV2605 chip on Haptic Click board.
void haptic_start_motor | ( | haptic_t * | ctx | ) |
Starts moving the motor function.
ctx | Click object. |
@description Function starts reading the desired pattern and moving the motor by set lowest bit of go register of DRV2605 chip on Haptic Click board.
void haptic_write_byte | ( | haptic_t * | ctx, |
uint8_t | reg_address, | ||
uint8_t | write_data ) |
Generic write the byte of data function.
ctx | Click object. |
reg_address | 8-bit register address. |
write_data | 8-bit data to write to given address. |
@description Function write the byte of data to given 8-bit register address of DRV2605 chip on Haptic Click board.