vibromotor4 2.0.0.0
|
API for configuring and manipulating Vibro Motor 4 Click driver. More...
Topics | |
Vibro Motor 4 Registers List | |
List of registers of Vibro Motor 4 Click driver. | |
Vibro Motor 4 Registers Settings | |
Settings for registers of Vibro Motor 4 Click driver. | |
Vibro Motor 4 MikroBUS Map | |
MikroBUS pin mapping of Vibro Motor 4 Click driver. | |
Functions | |
void | vibromotor4_cfg_setup (vibromotor4_cfg_t *cfg) |
Vibro Motor 4 configuration object setup function. | |
err_t | vibromotor4_init (vibromotor4_t *ctx, vibromotor4_cfg_t *cfg) |
Vibro Motor 4 initialization function. | |
err_t | vibromotor4_default_cfg (vibromotor4_t *ctx) |
Vibro Motor 4 default configuration function. | |
err_t | vibromotor4_generic_write (vibromotor4_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Vibro Motor 4 I2C writing function. | |
err_t | vibromotor4_generic_read (vibromotor4_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Vibro Motor 4 I2C reading function. | |
err_t | vibromotor4_enable (vibromotor4_t *ctx, vibromotor4_property_mode_t pr_mode) |
Vibro Motor 4 enable the device function. | |
err_t | vibromotor4_write_byte (vibromotor4_t *ctx, uint8_t reg, uint8_t tx_buf) |
Vibro Motor 4 I2C writing function. | |
err_t | vibromotor4_read_byte (vibromotor4_t *ctx, uint8_t reg, uint8_t *rx_buf) |
Vibro Motor 4 I2C reading function. | |
err_t | vibromotor4_set_mode (vibromotor4_t *ctx, uint8_t mode_sel) |
Vibro Motor 4 sets the desired mode function. | |
err_t | vibromotor4_soft_rst (vibromotor4_t *ctx) |
Vibro Motor 4 software reset function. | |
err_t | vibromotor4_stb_mode (vibromotor4_t *ctx, uint8_t state) |
Vibro Motor 4 software standby mode function. | |
err_t | vibromotor4_get_stat (vibromotor4_t *ctx, uint8_t *status) |
Vibro Motor 4 get status function. | |
err_t | vibromotor4_set_rtp_input (vibromotor4_t *ctx, uint8_t rtp_input) |
Vibro Motor 4 sets the desired input for RTP mode function. | |
err_t | vibromotor4_set_state_hi_z (vibromotor4_t *ctx, uint8_t state) |
Vibro Motor 4 sets the devices in HI-Z state function. | |
err_t | vibromotor4_set_library (vibromotor4_t *ctx, uint8_t lib_sel) |
Vibro Motor 4 sets the desired vibrating patterns library function. | |
err_t | vibromotor4_start_motor (vibromotor4_t *ctx, uint8_t state) |
Vibro Motor 4 starts the motor function. | |
err_t | vibromotor4_set_ovdr_offset (vibromotor4_t *ctx, uint8_t ovdr_offset) |
Vibro Motor 4 sets overdrive offset function. | |
err_t | vibromotor4_set_sustain_offset_pos (vibromotor4_t *ctx, uint8_t sustain_offset_pos) |
Vibro Motor 4 sets sustain offset - positive function. | |
err_t | vibromotor4_set_sustain_offset_neg (vibromotor4_t *ctx, uint8_t sustain_offset_neg) |
Vibro Motor 4 sets sustain offset - negative function. | |
err_t | vibromotor4_set_brake_time_offset (vibromotor4_t *ctx, uint8_t brake_time_offset) |
Vibro Motor 4 sets brake time offset function. | |
err_t | vibromotor4_set_rated_volt (vibromotor4_t *ctx, uint8_t rated_volt) |
Vibro Motor 4 sets reference voltage function. | |
err_t | vibromotor4_set_ovdrv_clamp_volt (vibromotor4_t *ctx, uint8_t ovdrv_clamp_volt) |
Vibro Motor 4 sets a clamp function. | |
err_t | vibromotor4_get_calib_res_comp (vibromotor4_t *ctx, uint8_t *calib_res_comp) |
Vibro Motor 4 get voltage-compensation function. | |
err_t | vibromotor4_get_supply_volt_val (vibromotor4_t *ctx, float *supply_volt) |
Vibro Motor 4 get the supply voltage function. | |
err_t | vibromotor4_get_lra_resonance_period (vibromotor4_t *ctx, float *lra_res) |
Vibro Motor 4 get the measurement of the LRA resonance period function. | |
err_t | vibromotor4_set_lra_mode (vibromotor4_t *ctx, uint8_t lra_mode) |
Vibro Motor 4 sets the device in LRA mode function. | |
err_t | vibromotor4_set_brake_factor (vibromotor4_t *ctx, uint8_t brk_fac) |
Vibro Motor 4 set brake factor function. | |
err_t | vibromotor4_set_loop_gain (vibromotor4_t *ctx, uint8_t gain) |
Vibro Motor 4 selects a loop gain function. | |
err_t | vibromotor4_set_input (vibromotor4_t *ctx, uint8_t state) |
Vibro Motor 4 sets the input to PWM or analog function. | |
err_t | vibromotor4_enable_ac_coulping (vibromotor4_t *ctx) |
Vibro Motor 4 enable AC coulping function. | |
err_t | vibromotor4_set_duty_cycle (vibromotor4_t *ctx, float duty_cycle) |
Vibro Motor 4 sets PWM duty cycle. | |
err_t | vibromotor4_pwm_stop (vibromotor4_t *ctx) |
Vibro Motor 4 stop PWM module. | |
err_t | vibromotor4_pwm_start (vibromotor4_t *ctx) |
Vibro Motor 4 start PWM module. | |
API for configuring and manipulating Vibro Motor 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void vibromotor4_cfg_setup | ( | vibromotor4_cfg_t * | cfg | ) |
Vibro Motor 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See vibromotor4_cfg_t object definition for detailed explanation. |
err_t vibromotor4_default_cfg | ( | vibromotor4_t * | ctx | ) |
Vibro Motor 4 default configuration function.
This function executes a default configuration of Vibro Motor 4 click board.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t vibromotor4_enable | ( | vibromotor4_t * | ctx, |
vibromotor4_property_mode_t | pr_mode ) |
Vibro Motor 4 enable the device function.
This function is used to enable or disable the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | pr_mode | : Property mode object. |
0
- Success, -1
- Error.err_t vibromotor4_enable_ac_coulping | ( | vibromotor4_t * | ctx | ) |
Vibro Motor 4 enable AC coulping function.
This function applies a 0.9-V common mode voltage to the IN/TRIG pin of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t vibromotor4_generic_read | ( | vibromotor4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Vibro Motor 4 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t vibromotor4_generic_write | ( | vibromotor4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Vibro Motor 4 I2C writing function.
This function writes a desired number of data bytes starting to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t vibromotor4_get_calib_res_comp | ( | vibromotor4_t * | ctx, |
uint8_t * | calib_res_comp ) |
Vibro Motor 4 get voltage-compensation function.
This function is used to gets the voltage-compensation result after execution of auto calibration of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[out] | calib_res_comp | : Output contained data. |
0
- Success, -1
- Error.err_t vibromotor4_get_lra_resonance_period | ( | vibromotor4_t * | ctx, |
float * | lra_res ) |
Vibro Motor 4 get the measurement of the LRA resonance period function.
This function gets the measurement of the LRA resonance period of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[out] | lra_res | : LRA resonance period data. |
0
- Success, -1
- Error.err_t vibromotor4_get_stat | ( | vibromotor4_t * | ctx, |
uint8_t * | status ) |
Vibro Motor 4 get status function.
This function is used to read the status data of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[out] | status | : Device status data. |
0
- Success, -1
- Error.err_t vibromotor4_get_supply_volt_val | ( | vibromotor4_t * | ctx, |
float * | supply_volt ) |
Vibro Motor 4 get the supply voltage function.
This function does a real-time reading of the supply voltage at the VDD pin of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[out] | supply_volt | : Voltage on VDD pin data. |
0
- Success, -1
- Error.err_t vibromotor4_init | ( | vibromotor4_t * | ctx, |
vibromotor4_cfg_t * | cfg ) |
Vibro Motor 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See vibromotor4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t vibromotor4_pwm_start | ( | vibromotor4_t * | ctx | ) |
Vibro Motor 4 start PWM module.
This function starts the PWM moudle output.
[out] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t vibromotor4_pwm_stop | ( | vibromotor4_t * | ctx | ) |
Vibro Motor 4 stop PWM module.
This function stops the PWM moudle output.
[out] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t vibromotor4_read_byte | ( | vibromotor4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf ) |
Vibro Motor 4 I2C reading function.
This function reads a byte of the data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
0
- Success, -1
- Error.err_t vibromotor4_set_brake_factor | ( | vibromotor4_t * | ctx, |
uint8_t | brk_fac ) |
Vibro Motor 4 set brake factor function.
This function selects the feedback gain ratio between braking gain and driving gain of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | brk_fac | : Available brake factors:
|
0
- Success, -1
- Error.err_t vibromotor4_set_brake_time_offset | ( | vibromotor4_t * | ctx, |
uint8_t | brake_time_offset ) |
Vibro Motor 4 sets brake time offset function.
This function is used to sets the desired brake time offset of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | brake_time_offset | : Desired brake time offset. |
0
- Success, -1
- Error.err_t vibromotor4_set_duty_cycle | ( | vibromotor4_t * | ctx, |
float | duty_cycle ) |
Vibro Motor 4 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | duty_ratio | : PWM duty_ratio. |
0
- Success, -1
- Error.err_t vibromotor4_set_input | ( | vibromotor4_t * | ctx, |
uint8_t | state ) |
Vibro Motor 4 sets the input to PWM or analog function.
This function is used to select the input mode for the IN/TRIG(PWM) pin of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | gain | : Available brake factors:
|
0
- Success, -1
- Error.err_t vibromotor4_set_library | ( | vibromotor4_t * | ctx, |
uint8_t | lib_sel ) |
Vibro Motor 4 sets the desired vibrating patterns library function.
This function is used to set waveform library selection of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | lib_sel | : Available libraryes:
|
0
- Success, -1
- Error.err_t vibromotor4_set_loop_gain | ( | vibromotor4_t * | ctx, |
uint8_t | gain ) |
Vibro Motor 4 selects a loop gain function.
This function selects a loop gain for the feedback control of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | gain | : Available brake factors:
|
0
- Success, -1
- Error.err_t vibromotor4_set_lra_mode | ( | vibromotor4_t * | ctx, |
uint8_t | lra_mode ) |
Vibro Motor 4 sets the device in LRA mode function.
This function is used to sets the device in LRA mode of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | lra_mode | : Defines the device's mode. |
0
- Success, -1
- Error.err_t vibromotor4_set_mode | ( | vibromotor4_t * | ctx, |
uint8_t | mode_sel ) |
Vibro Motor 4 sets the desired mode function.
This function is used to apply the desired mode of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | mode_sel | : Selected mode data:
|
0
- Success, -1
- Error.err_t vibromotor4_set_ovdr_offset | ( | vibromotor4_t * | ctx, |
uint8_t | ovdr_offset ) |
Vibro Motor 4 sets overdrive offset function.
This function is used to sets the desired overdrive offset of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | ovdr_offset | : Desired overdrive offset. |
0
- Success, -1
- Error.err_t vibromotor4_set_ovdrv_clamp_volt | ( | vibromotor4_t * | ctx, |
uint8_t | ovdrv_clamp_volt ) |
Vibro Motor 4 sets a clamp function.
This function is used to sets a clamp so that the automatic overdrive is bounded the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | ovdrv_clamp_volt | : Desired brake time offset. |
0
- Success, -1
- Error.err_t vibromotor4_set_rated_volt | ( | vibromotor4_t * | ctx, |
uint8_t | rated_volt ) |
Vibro Motor 4 sets reference voltage function.
This function is used to sets the desired reference voltage of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | rated_volt | : Desired brake time offset. |
0
- Success, -1
- Error.err_t vibromotor4_set_rtp_input | ( | vibromotor4_t * | ctx, |
uint8_t | rtp_input ) |
Vibro Motor 4 sets the desired input for RTP mode function.
This function is used to sets the desired Real-Time Playback Input of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | rtp_input | : Desired input for RTP mode. |
0
- Success, -1
- Error.err_t vibromotor4_set_state_hi_z | ( | vibromotor4_t * | ctx, |
uint8_t | state ) |
Vibro Motor 4 sets the devices in HI-Z state function.
This function is used to enable or disable the HI-Z state of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | state | : Defines the HI-Z state:
|
0
- Success, -1
- Error.err_t vibromotor4_set_sustain_offset_neg | ( | vibromotor4_t * | ctx, |
uint8_t | sustain_offset_neg ) |
Vibro Motor 4 sets sustain offset - negative function.
This function is used to sets the desired sustain offset - negative of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | sustain_offset_neg | : Desired negative sustain offset. |
0
- Success, -1
- Error.err_t vibromotor4_set_sustain_offset_pos | ( | vibromotor4_t * | ctx, |
uint8_t | sustain_offset_pos ) |
Vibro Motor 4 sets sustain offset - positive function.
This function is used to sets the desired sustain offset - positive of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | sustain_offset_pos | : Desired positive sustain offset. |
0
- Success, -1
- Error.err_t vibromotor4_soft_rst | ( | vibromotor4_t * | ctx | ) |
Vibro Motor 4 software reset function.
This function is used to perform software reset of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t vibromotor4_start_motor | ( | vibromotor4_t * | ctx, |
uint8_t | state ) |
Vibro Motor 4 starts the motor function.
This function is used to start or stop the motor using of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | state | : Defines the HI-Z state:
|
0
- Success, -1
- Error.err_t vibromotor4_stb_mode | ( | vibromotor4_t * | ctx, |
uint8_t | state ) |
Vibro Motor 4 software standby mode function.
This function is used to enable or disable the standby mode of the DRV2605L, 2- to 5.2-V Haptic Driver for LRA and ERM with Effect Library and Smart-Loop Architecture on the Vibro Motor 4 click board™. the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | state | : Defines the state of the standby mode. |
0
- Success, -1
- Error.err_t vibromotor4_write_byte | ( | vibromotor4_t * | ctx, |
uint8_t | reg, | ||
uint8_t | tx_buf ) |
Vibro Motor 4 I2C writing function.
This function writes a byte of the data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See vibromotor4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
0
- Success, -1
- Error.