vibromotor4  2.0.0.0
vibromotor4.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2020 MikroElektronika d.o.o.
3 ** Contact: https://www.mikroe.com/contact
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining a copy
6 ** of this software and associated documentation files (the "Software"), to deal
7 ** in the Software without restriction, including without limitation the rights
8 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 ** copies of the Software, and to permit persons to whom the Software is
10 ** furnished to do so, subject to the following conditions:
11 ** The above copyright notice and this permission notice shall be
12 ** included in all copies or substantial portions of the Software.
13 **
14 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16 ** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 ** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
19 ** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 ** USE OR OTHER DEALINGS IN THE SOFTWARE.
21 ****************************************************************************/
22 
28 #ifndef VIBROMOTOR4_H
29 #define VIBROMOTOR4_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
39 #ifdef PREINIT_SUPPORTED
40 #include "preinit.h"
41 #endif
42 
43 #ifdef MikroCCoreVersion
44  #if MikroCCoreVersion >= 1
45  #include "delays.h"
46  #endif
47 #endif
48 
49 #include "drv_digital_out.h"
50 #include "drv_i2c_master.h"
51 #include "drv_pwm.h"
52 
73 #define VIBROMOTOR4_STATUS 0x00
74 #define VIBROMOTOR4_MODE 0x01
75 #define VIBROMOTOR4_RT_PB_IN 0x02
76 #define VIBROMOTOR4_LIB_SEL 0x03
77 #define VIBROMOTOR4_WV_SEQ_1 0x04
78 #define VIBROMOTOR4_WV_SEQ_2 0x05
79 #define VIBROMOTOR4_WV_SEQ_3 0x06
80 #define VIBROMOTOR4_WV_SEQ_4 0x07
81 #define VIBROMOTOR4_WV_SEQ_5 0x08
82 #define VIBROMOTOR4_WV_SEQ_6 0x09
83 #define VIBROMOTOR4_WV_SEQ_7 0x0A
84 #define VIBROMOTOR4_WV_SEQ_8 0x0B
85 #define VIBROMOTOR4_REG_GO 0x0C
86 #define VIBROMOTOR4_OVERDRIVE_OFFS 0x0D
87 #define VIBROMOTOR4_SUSTAIN_P_OFFS 0x0E
88 #define VIBROMOTOR4_SUSTAIN_N_OFFS 0x0F
89 #define VIBROMOTOR4_BRAKE_OFF 0x10
90 #define VIBROMOTOR4_A_TO_V_CTRL 0x11
91 #define VIBROMOTOR4_A_TO_V_MIN_INPUT 0x12
92 #define VIBROMOTOR4_A_TO_V_MAX_INPUT 0x13
93 #define VIBROMOTOR4_A_TO_V_MIN_OUT 0x14
94 #define VIBROMOTOR4_A_TO_V_MAX_OUT 0x15
95 #define VIBROMOTOR4_RATED_VOLT 0x16
96 #define VIBROMOTOR4_OD_CLAMP_VOLT 0x17
97 #define VIBROMOTOR4_CAL_COMP 0x18
98 #define VIBROMOTOR4_CAL_BACK_EMF 0x19
99 #define VIBROMOTOR4_FEEDBACK_CTRL 0x1A
100 #define VIBROMOTOR4_CTRL1 0x1B
101 #define VIBROMOTOR4_CTRL2 0x1C
102 #define VIBROMOTOR4_CTRL3 0x1D
103 #define VIBROMOTOR4_CTRL4 0x1E
104 #define VIBROMOTOR4_CTRL5 0x1F
105 #define VIBROMOTOR4_LRA_LOOP_PERIOD 0x20
106 #define VIBROMOTOR4_VBAT_MON 0x21
107 #define VIBROMOTOR4_LRA_RES_PERIOD 0x22
108  // vibromotor4_reg
110 
125 #define VIBROMOTOR4_STARTPPBOOST 0x80
126 #define VIBROMOTOR4_BYPASSCOMP 0x40
127 #define VIBROMOTOR4_AC_COUPLE 0x20
128 #define VIBROMOTOR4_DC_COUPLE 0x00
129 #define VIBROMOTOR4_DRV_TIME_0P5M 0x00
130 #define VIBROMOTOR4_DRV_TIME_0P6M 0x01
131 #define VIBROMOTOR4_DRV_TIME_0P7M 0x02
132 #define VIBROMOTOR4_DRV_TIME_0P8M 0x03
133 #define VIBROMOTOR4_DRV_TIME_0P9M 0x04
134 #define VIBROMOTOR4_DRV_TIME_1P0M 0x05
135 #define VIBROMOTOR4_DRV_TIME_1P1M 0x06
136 #define VIBROMOTOR4_DRV_TIME_1P2M 0x07
137 #define VIBROMOTOR4_DRV_TIME_1P3M 0x08
138 #define VIBROMOTOR4_DRV_TIME_1P4M 0x09
139 #define VIBROMOTOR4_DRV_TIME_1P5M 0x0A
140 #define VIBROMOTOR4_DRV_TIME_1P6M 0x0B
141 #define VIBROMOTOR4_DRV_TIME_1P7M 0x0C
142 #define VIBROMOTOR4_DRV_TIME_1P8M 0x0D
143 #define VIBROMOTOR4_DRV_TIME_1P9M 0x0E
144 #define VIBROMOTOR4_DRV_TIME_2P0M 0x0F
145 #define VIBROMOTOR4_DRV_TIME_2P1M 0x10
146 #define VIBROMOTOR4_DRV_TIME_2P2M 0x11
147 #define VIBROMOTOR4_DRV_TIME_2P3M 0x12
148 #define VIBROMOTOR4_DRV_TIME_2P4M 0x13
149 #define VIBROMOTOR4_DRV_TIME_2P5M 0x14
150 #define VIBROMOTOR4_DRV_TIME_2P6M 0x15
151 #define VIBROMOTOR4_DRV_TIME_2P7M 0x16
152 #define VIBROMOTOR4_DRV_TIME_2P8M 0x17
153 #define VIBROMOTOR4_DRV_TIME_2P9M 0x18
154 #define VIBROMOTOR4_DRV_TIME_3P0M 0x19
155 #define VIBROMOTOR4_DRV_TIME_3P1M 0x1A
156 #define VIBROMOTOR4_DRV_TIME_3P2M 0x1B
157 #define VIBROMOTOR4_DRV_TIME_3P3M 0x1C
158 #define VIBROMOTOR4_DRV_TIME_3P4M 0x1D
159 #define VIBROMOTOR4_DRV_TIME_3P5M 0x1E
160 #define VIBROMOTOR4_DRV_TIME_3P6M 0x1F
161 #define VIBROMOTOR4_BIDIR_IN 0x80
162 #define VIBROMOTOR4_UNIDIR_IN 0x00
163 #define VIBROMOTOR4_BRK_STABIL 0x40
164 #define VIBROMOTOR4_SAMP_TIME_150US 0x00
165 #define VIBROMOTOR4_SAMP_TIME_200US 0x10
166 #define VIBROMOTOR4_SAMP_TIME_250US 0x20
167 #define VIBROMOTOR4_SAMP_TIME_300US 0x30
168 #define VIBROMOTOR4_BLANK_TIME_V_SHORT 0x00
169 #define VIBROMOTOR4_BLANK_TIME_SHORT 0x04
170 #define VIBROMOTOR4_BLANK_TIME_MEDIUM 0x08
171 #define VIBROMOTOR4_BLANK_TIME_LONG 0x0C
172 #define VIBROMOTOR4_I_DIS_TIME_V_SHORT 0x00
173 #define VIBROMOTOR4_I_DIS_TIME_SHORT 0x01
174 #define VIBROMOTOR4_I_DIS_TIME_MEDIUM 0x02
175 #define VIBROMOTOR4_I_DIS_TIME_LONG 0x03
176 #define VIBROMOTOR4_NG_THRESH_OFF 0x00
177 #define VIBROMOTOR4_NG_THRESH_2_PERC 0x40
178 #define VIBROMOTOR4_NG_THRESH_4_PERC 0x80
179 #define VIBROMOTOR4_NG_THRESH_8_PERC 0xC0
180 #define VIBROMOTOR4_ERM_CLOSED_LOOP 0x00
181 #define VIBROMOTOR4_ERM_OPEN_LOOP 0x20
182 #define VIBROMOTOR4_SUP_COMP_DIS 0x10
183 #define VIBROMOTOR4_DATA_FORM_RTP_SIG 0x00
184 #define VIBROMOTOR4_DATA_FORM_RTP_UNS 0x08
185 #define VIBROMOTOR4_LRADRV_MODE 0x04
186 #define VIBROMOTOR4_LRADRV_MODE_ONCE 0x00
187 #define VIBROMOTOR4_LRADRV_MODE_TWICE 0x04
188 #define VIBROMOTOR4_IN_MODE_PWM 0x00
189 #define VIBROMOTOR4_IN_MODE_ANALOG 0x02
190 #define VIBROMOTOR4_LRA_AUTO_RESONA 0x00
191 #define VIBROMOTOR4_LRA_OPEN_LOOP 0x01
192 #define VIBROMOTOR4_LRA_CLOSED_LOOP 0x00
193 
198 #define VIBROMOTOR4_DEV_RESRT 0x80
199 #define VIBROMOTOR4_STANDBY 0x40
200 #define VIBROMOTOR4_ACTIVE 0x00
201 #define VIBROMOTOR4_INT_TRIG 0x00
202 #define VIBROMOTOR4_EXT_TRIG_EDGE 0x01
203 #define VIBROMOTOR4_EXT_TRIG_LEVEL 0x02
204 #define VIBROMOTOR4_PWM_ANALOG 0x03
205 #define VIBROMOTOR4_AUDIO2HAPTIC 0x04
206 #define VIBROMOTOR4_RTP 0x05
207 #define VIBROMOTOR4_DIAGNOSTICS 0x06
208 #define VIBROMOTOR4_AUTO_CALIBRATION 0x07
209 
214 #define VIBROMOTOR4_HIZ 0x10
215 #define VIBROMOTOR4_RAM 0x00
216 #define VIBROMOTOR4_ROM_A 0x01
217 #define VIBROMOTOR4_ROM_B 0x02
218 #define VIBROMOTOR4_ROM_C 0x03
219 #define VIBROMOTOR4_ROM_D 0x04
220 #define VIBROMOTOR4_ROM_E 0x05
221 #define VIBROMOTOR4_ROM_LRA 0x06
222 
227 #define VIBROMOTOR4_STOP 0x00
228 #define VIBROMOTOR4_GO 0x01
229 
234 #define VIBROMOTOR4_ERM_MODE 0x00
235 #define VIBROMOTOR4_LRA_MODE 0x80
236 #define VIBROMOTOR4_FB_BRAKE_FAC_1X 0x00
237 #define VIBROMOTOR4_FB_BRAKE_FAC_2X 0x10
238 #define VIBROMOTOR4_FB_BRAKE_FAC_3X 0x20
239 #define VIBROMOTOR4_FB_BRAKE_FAC_4X 0x30
240 #define VIBROMOTOR4_FB_BRAKE_FAC_6X 0x40
241 #define VIBROMOTOR4_FB_BRAKE_FAC_8X 0x50
242 #define VIBROMOTOR4_FB_BRAKE_FAC_16X 0x60
243 #define VIBROMOTOR4_FB_BRAKE_FAC_DIS 0x70
244 #define VIBROMOTOR4_LOOP_RESP_SLOW 0x00
245 #define VIBROMOTOR4_LOOP_RESP_MEDIUM 0x04
246 #define VIBROMOTOR4_LOOP_RESP_FAST 0x08
247 #define VIBROMOTOR4_LOOP_RESP_V_FAST 0x0C
248 #define VIBROMOTOR4_BEMF_GAIN_ERM_0P3X 0x00
249 #define VIBROMOTOR4_BEMF_GAIN_ERM_1X 0x01
250 #define VIBROMOTOR4_BEMF_GAIN_ERM_1P8X 0x02
251 #define VIBROMOTOR4_BEMF_GAIN_ERM_4X 0x03
252 #define VIBROMOTOR4_BEMF_GAIN_LRA_5X 0x00
253 #define VIBROMOTOR4_BEMF_GAIN_LRA_10X 0x01
254 #define VIBROMOTOR4_BEMF_GAIN_LRA_20X 0x02
255 #define VIBROMOTOR4_BEMF_GAIN_LRA_30X 0x03
256 
261 #define VIBROMOTOR4_AUTO_CAL_TIME_150ms 0x00
262 #define VIBROMOTOR4_AUTO_CAL_TIME_250ms 0x10
263 #define VIBROMOTOR4_AUTO_CAL_TIME_500ms 0x20
264 #define VIBROMOTOR4_AUTO_CAL_TIME_1000ms 0x30
265 #define VIBROMOTOR4_OTP_PROG 0x01
266 
272 #define VIBROMOTOR4_SET_DEV_ADDR 0x5A
273 
279 #define VIBROMOTOR4_DEFAULT_FREQUENCY 175
280  // vibromotor4_set
282 
297 #define VIBROMOTOR4_MAP_MIKROBUS( cfg, mikrobus ) \
298  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
299  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
300  cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
301  cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
302  // vibromotor4_map // vibromotor4
305 
310 typedef struct
311 {
312  // Output pins
313  digital_out_t en;
315  // Modules
316  i2c_master_t i2c;
318  // I2C slave address
319  uint8_t slave_address;
321  pwm_t pwm;
322  uint32_t pwm_freq;
324 } vibromotor4_t;
325 
330 typedef struct
331 {
332  pin_name_t scl;
333  pin_name_t sda;
335  pin_name_t en;
337  uint32_t i2c_speed;
338  uint8_t i2c_address;
340  pin_name_t pwm;
341  uint32_t dev_pwm_freq;
344 
349 typedef enum
350 {
352  VIBROMOTOR4_ERROR = -1
353 
355 
360 typedef enum
361 {
364 
366 
383 
399 
414 
430 err_t vibromotor4_generic_write ( vibromotor4_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len );
431 
447 err_t vibromotor4_generic_read ( vibromotor4_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len );
448 
465 
480 err_t vibromotor4_write_byte ( vibromotor4_t *ctx, uint8_t reg, uint8_t tx_buf );
481 
496 err_t vibromotor4_read_byte ( vibromotor4_t *ctx, uint8_t reg, uint8_t *rx_buf );
497 
539 err_t vibromotor4_set_mode ( vibromotor4_t *ctx, uint8_t mode_sel );
540 
556 
572 err_t vibromotor4_stb_mode ( vibromotor4_t *ctx, uint8_t state );
573 
589 err_t vibromotor4_get_stat ( vibromotor4_t *ctx, uint8_t *status );
590 
606 err_t vibromotor4_set_rtp_input ( vibromotor4_t *ctx, uint8_t rtp_input );
607 
625 err_t vibromotor4_set_state_hi_z ( vibromotor4_t *ctx, uint8_t state );
626 
649 err_t vibromotor4_set_library ( vibromotor4_t *ctx, uint8_t lib_sel );
650 
668 err_t vibromotor4_start_motor ( vibromotor4_t *ctx, uint8_t state );
669 
685 err_t vibromotor4_set_ovdr_offset ( vibromotor4_t *ctx, uint8_t ovdr_offset );
686 
702 err_t vibromotor4_set_sustain_offset_pos ( vibromotor4_t *ctx, uint8_t sustain_offset_pos );
703 
719 err_t vibromotor4_set_sustain_offset_neg ( vibromotor4_t *ctx, uint8_t sustain_offset_neg );
720 
736 err_t vibromotor4_set_brake_time_offset ( vibromotor4_t *ctx, uint8_t brake_time_offset );
737 
753 err_t vibromotor4_set_rated_volt ( vibromotor4_t *ctx, uint8_t rated_volt );
754 
771 err_t vibromotor4_set_ovdrv_clamp_volt ( vibromotor4_t *ctx, uint8_t ovdrv_clamp_volt );
772 
789 err_t vibromotor4_get_calib_res_comp ( vibromotor4_t *ctx, uint8_t *calib_res_comp );
790 
807 err_t vibromotor4_get_supply_volt_val ( vibromotor4_t *ctx, float *supply_volt );
808 
825 
841 err_t vibromotor4_set_lra_mode ( vibromotor4_t *ctx, uint8_t lra_mode );
842 
867 err_t vibromotor4_set_brake_factor ( vibromotor4_t *ctx, uint8_t brk_fac );
868 
888 err_t vibromotor4_set_loop_gain ( vibromotor4_t *ctx, uint8_t gain );
889 
908 err_t vibromotor4_set_input ( vibromotor4_t *ctx, uint8_t state );
909 
926 
938 err_t vibromotor4_set_duty_cycle ( vibromotor4_t *ctx, float duty_cycle );
939 
951 
963 
964 #ifdef __cplusplus
965 }
966 #endif
967 #endif // VIBROMOTOR4_H
968  // vibromotor4
970 
971 // ------------------------------------------------------------------------ END
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.
vibromotor4_cfg_t
Vibro Motor 4 Click configuration object.
Definition: vibromotor4.h:331
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.
vibromotor4_pwm_start
err_t vibromotor4_pwm_start(vibromotor4_t *ctx)
Vibro Motor 4 start PWM module.
vibromotor4_init
err_t vibromotor4_init(vibromotor4_t *ctx, vibromotor4_cfg_t *cfg)
Vibro Motor 4 initialization function.
vibromotor4_cfg_t::en
pin_name_t en
Definition: vibromotor4.h:335
vibromotor4_cfg_t::dev_pwm_freq
uint32_t dev_pwm_freq
Definition: vibromotor4.h:341
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.
vibromotor4_default_cfg
err_t vibromotor4_default_cfg(vibromotor4_t *ctx)
Vibro Motor 4 default configuration function.
vibromotor4_set_ovdr_offset
err_t vibromotor4_set_ovdr_offset(vibromotor4_t *ctx, uint8_t ovdr_offset)
Vibro Motor 4 sets overdrive offset function.
vibromotor4_t::pwm
pwm_t pwm
Definition: vibromotor4.h:321
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.
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.
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.
vibromotor4_enable_ac_coulping
err_t vibromotor4_enable_ac_coulping(vibromotor4_t *ctx)
Vibro Motor 4 enable AC coulping function.
VIBROMOTOR4_PROPERTY_DISABLE
@ VIBROMOTOR4_PROPERTY_DISABLE
Definition: vibromotor4.h:362
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.
VIBROMOTOR4_ERROR
@ VIBROMOTOR4_ERROR
Definition: vibromotor4.h:352
vibromotor4_cfg_setup
void vibromotor4_cfg_setup(vibromotor4_cfg_t *cfg)
Vibro Motor 4 configuration object setup function.
vibromotor4_soft_rst
err_t vibromotor4_soft_rst(vibromotor4_t *ctx)
Vibro Motor 4 software reset function.
vibromotor4_return_value_t
vibromotor4_return_value_t
Vibro Motor 4 Click return value data.
Definition: vibromotor4.h:350
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.
vibromotor4_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: vibromotor4.h:337
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.
vibromotor4_set_loop_gain
err_t vibromotor4_set_loop_gain(vibromotor4_t *ctx, uint8_t gain)
Vibro Motor 4 selects a loop gain function.
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.
VIBROMOTOR4_PROPERTY_ENABLE
@ VIBROMOTOR4_PROPERTY_ENABLE
Definition: vibromotor4.h:363
vibromotor4_property_mode_t
vibromotor4_property_mode_t
Vibro Motor 4 Click property data.
Definition: vibromotor4.h:361
vibromotor4_start_motor
err_t vibromotor4_start_motor(vibromotor4_t *ctx, uint8_t state)
Vibro Motor 4 starts the motor function.
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.
vibromotor4_t
Vibro Motor 4 Click context object.
Definition: vibromotor4.h:311
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.
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.
vibromotor4_t::i2c
i2c_master_t i2c
Definition: vibromotor4.h:316
vibromotor4_t::slave_address
uint8_t slave_address
Definition: vibromotor4.h:319
vibromotor4_cfg_t::i2c_address
uint8_t i2c_address
Definition: vibromotor4.h:338
vibromotor4_stb_mode
err_t vibromotor4_stb_mode(vibromotor4_t *ctx, uint8_t state)
Vibro Motor 4 software standby mode function.
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.
vibromotor4_pwm_stop
err_t vibromotor4_pwm_stop(vibromotor4_t *ctx)
Vibro Motor 4 stop PWM module.
vibromotor4_t::pwm_freq
uint32_t pwm_freq
Definition: vibromotor4.h:322
VIBROMOTOR4_OK
@ VIBROMOTOR4_OK
Definition: vibromotor4.h:351
vibromotor4_cfg_t::scl
pin_name_t scl
Definition: vibromotor4.h:332
vibromotor4_set_rated_volt
err_t vibromotor4_set_rated_volt(vibromotor4_t *ctx, uint8_t rated_volt)
Vibro Motor 4 sets reference voltage function.
vibromotor4_write_byte
err_t vibromotor4_write_byte(vibromotor4_t *ctx, uint8_t reg, uint8_t tx_buf)
Vibro Motor 4 I2C writing function.
vibromotor4_set_mode
err_t vibromotor4_set_mode(vibromotor4_t *ctx, uint8_t mode_sel)
Vibro Motor 4 sets the desired mode function.
vibromotor4_set_duty_cycle
err_t vibromotor4_set_duty_cycle(vibromotor4_t *ctx, float duty_cycle)
Vibro Motor 4 sets PWM duty cycle.
vibromotor4_t::en
digital_out_t en
Definition: vibromotor4.h:313
vibromotor4_set_brake_factor
err_t vibromotor4_set_brake_factor(vibromotor4_t *ctx, uint8_t brk_fac)
Vibro Motor 4 set brake factor function.
vibromotor4_read_byte
err_t vibromotor4_read_byte(vibromotor4_t *ctx, uint8_t reg, uint8_t *rx_buf)
Vibro Motor 4 I2C reading function.
vibromotor4_cfg_t::sda
pin_name_t sda
Definition: vibromotor4.h:333
vibromotor4_enable
err_t vibromotor4_enable(vibromotor4_t *ctx, vibromotor4_property_mode_t pr_mode)
Vibro Motor 4 enable the device function.
vibromotor4_get_stat
err_t vibromotor4_get_stat(vibromotor4_t *ctx, uint8_t *status)
Vibro Motor 4 get status function.
vibromotor4_cfg_t::pwm
pin_name_t pwm
Definition: vibromotor4.h:340