vibromotor4 2.0.0.0
Vibro Motor 4 Click Driver

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.
 

Detailed Description

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.

Function Documentation

◆ vibromotor4_cfg_setup()

void vibromotor4_cfg_setup ( vibromotor4_cfg_t * cfg)

Vibro Motor 4 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See vibromotor4_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ vibromotor4_default_cfg()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ vibromotor4_enable()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]pr_mode: Property mode object.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_enable_ac_coulping()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_generic_read()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_generic_write()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_get_calib_res_comp()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[out]calib_res_comp: Output contained data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_get_lra_resonance_period()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[out]lra_res: LRA resonance period data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_get_stat()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[out]status: Device status data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_get_supply_volt_val()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[out]supply_volt: Voltage on VDD pin data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_init()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_pwm_start()

err_t vibromotor4_pwm_start ( vibromotor4_t * ctx)

Vibro Motor 4 start PWM module.

This function starts the PWM moudle output.

Parameters
[out]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vibromotor4_pwm_stop()

err_t vibromotor4_pwm_stop ( vibromotor4_t * ctx)

Vibro Motor 4 stop PWM module.

This function stops the PWM moudle output.

Parameters
[out]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vibromotor4_read_byte()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_brake_factor()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]brk_fac: Available brake factors:
  • 0 - Braking disabled,
  • 1 - x1,
  • 2 - x2,
  • 3 - x3,
  • 4 - x4,
  • 6 - x6,
  • 8 - x8,
  • 16 - x16
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_brake_time_offset()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]brake_time_offset: Desired brake time offset.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_duty_cycle()

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 ] ).

Parameters
[out]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]duty_ratio: PWM duty_ratio.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ vibromotor4_set_input()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]gain: Available brake factors:
  • 0 - Analog input mode,
  • 1 - Sets PWM input mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_library()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]lib_sel: Available libraryes:
  • 0 - Empty,
  • 1 - TS2200 Library A,
  • 2 - TS2200 Library B,
  • 3 - TS2200 Library C,
  • 4 - TS2200 Library D,
  • 5 - TS2200 Library E,
  • 6 - LRA Library.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_loop_gain()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]gain: Available brake factors:
  • 0 - Low,
  • 1 - Medium,
  • 2 - High,
  • 3 - Very High.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_lra_mode()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]lra_mode: Defines the device's mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_mode()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]mode_sel: Selected mode data:
  • 0: Internal trigger - Waveforms are fired by setting the GO bit in register VIBROMOTOR4_REG_GO.
  • 1: External trigger (edge mode) - A rising edge on the IN/TRIG pin sets the GO Bit. A second rising edge on the IN/TRIG pin cancels the waveform if the second rising edge occurs before the GO bit has cleared.
  • 2: External trigger (level mode) - The GO bit follows the state of the external trigger. A rising edge on the IN/TRIG pin sets the GO bit, and a falling edge sends a cancel. If the GO bit is already in the appropriate state, no change occurs.
  • 3: PWM input and analog input - A PWM or analog signal is accepted at the IN/TRIG pin and used as the driving source. The device actively drives the actuator while in this mode. The PWM or analog input selection occurs by using the N_PWM_ANALOG bit.
  • 4: Audio-to-vibe - An AC-coupled audio signal is accepted at the IN/TRIG pin. The device converts the audio signal into meaningful haptic vibration. The AC_COUPLE and N_PWM_ANALOG bits should also be set.
  • 5: Real-time playback (RTP mode) - The device actively drives the actuator with the contents of the RTP_INPUT bits in register VIBROMOTOR4_RT_PB_IN.
  • 6: Diagnostics - Set the device in this mode to perform a diagnostic test on the actuator. The user must set the GO bit to start the test. The test is complete when the GO bit self-clears. Results are stored in the DIAG_RESULT bit in register VIBROMOTOR4_STATUS.
  • 7: Auto calibration - Set the device in this mode to auto calibrate the device for the actuator. Before starting the calibration, the user must set the all required input parameters. The user must set the GO bit to start the calibration. Calibration is complete when the GO bit self-clears.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_ovdr_offset()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]ovdr_offset: Desired overdrive offset.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_ovdrv_clamp_volt()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]ovdrv_clamp_volt: Desired brake time offset.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_rated_volt()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]rated_volt: Desired brake time offset.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_rtp_input()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]rtp_input: Desired input for RTP mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_state_hi_z()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]state: Defines the HI-Z state:
  • 0 - Disables the HI-Z state,
  • 1 - Enables the HI-Z state.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_sustain_offset_neg()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]sustain_offset_neg: Desired negative sustain offset.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_set_sustain_offset_pos()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]sustain_offset_pos: Desired positive sustain offset.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_soft_rst()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_start_motor()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]state: Defines the HI-Z state:
  • 0 - Stops moving the motor,
  • 1 - Starts moving the motor.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_stb_mode()

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.

Parameters
[in]ctx: Click context object. See vibromotor4_t object definition for detailed explanation.
[in]state: Defines the state of the standby mode.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vibromotor4_write_byte()

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.

Parameters
[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.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.