dcmotor22  2.0.0.0
dcmotor22.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 DCMOTOR22_H
29 #define DCMOTOR22_H
30 
31 #ifdef __cplusplus
32 extern "C"{
33 #endif
34 
35 #include "mikrosdk_version.h"
36 
37 #ifdef __GNUC__
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
40 #else
41 #include "delays.h"
42 #endif
43 #endif
44 
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_uart.h"
48 #include "drv_i2c_master.h"
49 
70 #define DCMOTOR22_REG_GCONF 0x00
71 #define DCMOTOR22_REG_GSTAT 0x01
72 #define DCMOTOR22_REG_IFCNT 0x02
73 #define DCMOTOR22_REG_SLAVECONF 0x03
74 #define DCMOTOR22_REG_IOIN 0x06
75 #define DCMOTOR22_REG_CURRENT_LIMIT 0x10
76 #define DCMOTOR22_REG_PWM_AB 0x22
77 #define DCMOTOR22_REG_CHOPCONF 0x6C
78 #define DCMOTOR22_REG_DRV_STATUS 0x6F
79 #define DCMOTOR22_REG_PWMCONF 0x70
80 
87 #define DCMOTOR22_SYNC_BYTE 0x05
88 #define DCMOTOR22_READ_WRITE_BIT 0x80
89 #define DCMOTOR22_RETRY_SEND_TIMEOUT 100
90 #define DCMOTOR22_READ_TIMEOUT 1000
91 
96 #define DCMOTOR22_GCONF_PWM_DIRECT ( 0x01ul )
97 #define DCMOTOR22_GCONF_EXTCAP_AVAILABLE ( 0x02ul )
98 #define DCMOTOR22_GCONF_PAR_MODE_DUAL_MOTOR ( 0x00ul )
99 #define DCMOTOR22_GCONF_PAR_MODE_SINGLE_MOTOR ( 0x04ul )
100 #define DCMOTOR22_GCONF_TEST_MODE ( 0x08ul )
101 
106 #define DCMOTOR22_GSTAT_RESET ( 0x01ul )
107 #define DCMOTOR22_GSTAT_DRV_ERR ( 0x02ul )
108 #define DCMOTOR22_GSTAT_UNDER_3V5 ( 0x04ul )
109 #define DCMOTOR22_GSTAT_CLEAR_ALL ( 0x07ul )
110 
115 #define DCMOTOR22_SLAVECONF_SENDDELAY_8BIT ( 0x0000ul )
116 #define DCMOTOR22_SLAVECONF_SENDDELAY_24BIT ( 0x0200ul )
117 #define DCMOTOR22_SLAVECONF_SENDDELAY_40BIT ( 0x0400ul )
118 #define DCMOTOR22_SLAVECONF_SENDDELAY_56BIT ( 0x0600ul )
119 #define DCMOTOR22_SLAVECONF_SENDDELAY_72BIT ( 0x0800ul )
120 #define DCMOTOR22_SLAVECONF_SENDDELAY_88BIT ( 0x0A00ul )
121 #define DCMOTOR22_SLAVECONF_SENDDELAY_104BIT ( 0x0C00ul )
122 #define DCMOTOR22_SLAVECONF_SENDDELAY_120BIT ( 0x0E00ul )
123 
128 #define DCMOTOR22_IOIN_EN ( 0x01ul )
129 #define DCMOTOR22_IOIN_NSTDBY ( 0x02ul )
130 #define DCMOTOR22_IOIN_AD0 ( 0x04ul )
131 #define DCMOTOR22_IOIN_AD1 ( 0x08ul )
132 #define DCMOTOR22_IOIN_DIAG ( 0x10ul )
133 #define DCMOTOR22_IOIN_UART_ON ( 0x20ul )
134 #define DCMOTOR22_IOIN_UART_IN ( 0x40ul )
135 #define DCMOTOR22_IOIN_MODE_IN ( 0x80ul )
136 #define DCMOTOR22_IOIN_A2 ( 0x0100ul )
137 #define DCMOTOR22_IOIN_A1 ( 0x0200ul )
138 #define DCMOTOR22_IOIN_COMP_A1A2 ( 0x0400ul )
139 #define DCMOTOR22_IOIN_COMP_B1B2 ( 0x0800ul )
140 #define DCMOTOR22_IOIN_VERSION ( 0x40000000ul )
141 #define DCMOTOR22_IOIN_VERSION_MASK ( 0xFF000000ul )
142 
147 #define DCMOTOR22_CURRENT_LIMIT_EN_FREEWHEELING ( 0x01ul )
148 #define DCMOTOR22_CURRENT_LIMIT_IRUN_1_32 ( 0x0000ul )
149 #define DCMOTOR22_CURRENT_LIMIT_IRUN_2_32 ( 0x0100ul )
150 #define DCMOTOR22_CURRENT_LIMIT_IRUN_3_32 ( 0x0200ul )
151 #define DCMOTOR22_CURRENT_LIMIT_IRUN_4_32 ( 0x0300ul )
152 #define DCMOTOR22_CURRENT_LIMIT_IRUN_5_32 ( 0x0400ul )
153 #define DCMOTOR22_CURRENT_LIMIT_IRUN_6_32 ( 0x0500ul )
154 #define DCMOTOR22_CURRENT_LIMIT_IRUN_7_32 ( 0x0600ul )
155 #define DCMOTOR22_CURRENT_LIMIT_IRUN_8_32 ( 0x0700ul )
156 #define DCMOTOR22_CURRENT_LIMIT_IRUN_9_32 ( 0x0800ul )
157 #define DCMOTOR22_CURRENT_LIMIT_IRUN_10_32 ( 0x0900ul )
158 #define DCMOTOR22_CURRENT_LIMIT_IRUN_11_32 ( 0x0A00ul )
159 #define DCMOTOR22_CURRENT_LIMIT_IRUN_12_32 ( 0x0B00ul )
160 #define DCMOTOR22_CURRENT_LIMIT_IRUN_13_32 ( 0x0C00ul )
161 #define DCMOTOR22_CURRENT_LIMIT_IRUN_14_32 ( 0x0D00ul )
162 #define DCMOTOR22_CURRENT_LIMIT_IRUN_15_32 ( 0x0E00ul )
163 #define DCMOTOR22_CURRENT_LIMIT_IRUN_16_32 ( 0x0F00ul )
164 #define DCMOTOR22_CURRENT_LIMIT_IRUN_17_32 ( 0x1000ul )
165 #define DCMOTOR22_CURRENT_LIMIT_IRUN_18_32 ( 0x1100ul )
166 #define DCMOTOR22_CURRENT_LIMIT_IRUN_19_32 ( 0x1200ul )
167 #define DCMOTOR22_CURRENT_LIMIT_IRUN_20_32 ( 0x1300ul )
168 #define DCMOTOR22_CURRENT_LIMIT_IRUN_21_32 ( 0x1400ul )
169 #define DCMOTOR22_CURRENT_LIMIT_IRUN_22_32 ( 0x1500ul )
170 #define DCMOTOR22_CURRENT_LIMIT_IRUN_23_32 ( 0x1600ul )
171 #define DCMOTOR22_CURRENT_LIMIT_IRUN_24_32 ( 0x1700ul )
172 #define DCMOTOR22_CURRENT_LIMIT_IRUN_25_32 ( 0x1800ul )
173 #define DCMOTOR22_CURRENT_LIMIT_IRUN_26_32 ( 0x1900ul )
174 #define DCMOTOR22_CURRENT_LIMIT_IRUN_27_32 ( 0x1A00ul )
175 #define DCMOTOR22_CURRENT_LIMIT_IRUN_28_32 ( 0x1B00ul )
176 #define DCMOTOR22_CURRENT_LIMIT_IRUN_29_32 ( 0x1C00ul )
177 #define DCMOTOR22_CURRENT_LIMIT_IRUN_30_32 ( 0x1D00ul )
178 #define DCMOTOR22_CURRENT_LIMIT_IRUN_31_32 ( 0x1E00ul )
179 #define DCMOTOR22_CURRENT_LIMIT_IRUN_32_32 ( 0x1F00ul )
180 
185 #define DCMOTOR22_MAX_PWM 255
186 #define DCMOTOR22_MIN_PWM ( -255 )
187 #define DCMOTOR22_PWM_RES 0x01FF
188 #define DCMOTOR22_PWM_DUTY_0 ( 0x00ul )
189 
194 #define DCMOTOR22_CHOPCONF_DISS2VS ( 0x80000000ul )
195 #define DCMOTOR22_CHOPCONF_DISS2G ( 0x40000000ul )
196 #define DCMOTOR22_CHOPCONF_TBL_0 ( 0x00000000ul )
197 #define DCMOTOR22_CHOPCONF_TBL_1 ( 0x00008000ul )
198 #define DCMOTOR22_CHOPCONF_TBL_2 ( 0x00010000ul )
199 #define DCMOTOR22_CHOPCONF_TBL_3 ( 0x00018000ul )
200 #define DCMOTOR22_CHOPCONF_ENABLEDRV ( 0x00000001ul )
201 
206 #define DCMOTOR22_PWMCONF_FREEWHEEL_NORMAL_OP ( 0x00000000ul )
207 #define DCMOTOR22_PWMCONF_FREEWHEEL_FREEWHEELING ( 0x00100000ul )
208 #define DCMOTOR22_PWMCONF_FREEWHEEL_LS_SHORTED ( 0x00200000ul )
209 #define DCMOTOR22_PWMCONF_FREEWHEEL_HS_SHORTED ( 0x00300000ul )
210 #define DCMOTOR22_PWMCONF_PWM_FREQ_2_1024 ( 0x00000000ul )
211 #define DCMOTOR22_PWMCONF_PWM_FREQ_2_683 ( 0x00010000ul )
212 #define DCMOTOR22_PWMCONF_PWM_FREQ_2_512 ( 0x00020000ul )
213 #define DCMOTOR22_PWMCONF_PWM_FREQ_2_410 ( 0x00030000ul )
214 
219 #define DCMOTOR22_MOTOR_A 0x00
220 #define DCMOTOR22_MOTOR_B 0x01
221 
226 #define DCMOTOR22_NUM_CONVERSIONS 100
227 #define DCMOTOR22_RSENSE 0.1
228 
233 #define DCMOTOR22_ADC_REG_SETUP 0x80
234 #define DCMOTOR22_ADC_SETUP_VREF_VDD_REF_NC_OFF 0x00
235 #define DCMOTOR22_ADC_SETUP_VREF_EXT_REF_IN_OFF 0x20
236 #define DCMOTOR22_ADC_SETUP_VREF_INT_REF_NC_OFF 0x40
237 #define DCMOTOR22_ADC_SETUP_VREF_INT_REF_NC_ON 0x50
238 #define DCMOTOR22_ADC_SETUP_VREF_INT_REF_OUT_OFF 0x60
239 #define DCMOTOR22_ADC_SETUP_VREF_INT_REF_OUT_ON 0x70
240 #define DCMOTOR22_ADC_SETUP_CLK_INT 0x00
241 #define DCMOTOR22_ADC_SETUP_CLK_EXT 0x08
242 #define DCMOTOR22_ADC_SETUP_UNIPOLAR 0x00
243 #define DCMOTOR22_ADC_SETUP_BIPOLAR 0x04
244 #define DCMOTOR22_ADC_SETUP_RST_RESET 0x00
245 #define DCMOTOR22_ADC_SETUP_RST_NO_ACTION 0x02
246 
251 #define DCMOTOR22_ADC_REG_CONFIG 0x00
252 #define DCMOTOR22_ADC_CONFIG_SCAN_AIN0_TO_CS0 0x00
253 #define DCMOTOR22_ADC_CONFIG_SCAN_CS0_8_TIMES 0x20
254 #define DCMOTOR22_ADC_CONFIG_SCAN_CS0 0x60
255 #define DCMOTOR22_ADC_CONFIG_CS0_AIN0 0x00
256 #define DCMOTOR22_ADC_CONFIG_CS0_AIN1 0x02
257 #define DCMOTOR22_ADC_CONFIG_DIFFERENTIAL 0x00
258 #define DCMOTOR22_ADC_CONFIG_SINGLE_ENDED 0x01
259 
264 #define DCMOTOR22_ADC_REG_BIT_MASK 0x80
265 #define DCMOTOR22_ADC_SETUP_VREF_BIT_MASK 0x70
266 #define DCMOTOR22_ADC_SETUP_CLK_BIT_MASK 0x08
267 #define DCMOTOR22_ADC_SETUP_UNI_BIP_BIT_MASK 0x04
268 #define DCMOTOR22_ADC_SETUP_RST_BIT_MASK 0x02
269 #define DCMOTOR22_ADC_CONFIG_SCAN_BIT_MASK 0x60
270 #define DCMOTOR22_ADC_CONFIG_CS0_BIT_MASK 0x02
271 #define DCMOTOR22_ADC_CONFIG_SGL_DIF_BIT_MASK 0x01
272 
277 #define DCMOTOR22_ADC_CHANNEL_0 0
278 #define DCMOTOR22_ADC_CHANNEL_1 1
279 
284 #define DCMOTOR22_ADC_RESOLUTION 0x0FFF
285 #define DCMOTOR22_ADC_VREF 2.048
286 
292 #define DCMOTOR22_ADC_DEVICE_ADDRESS 0x36
293 #define DCMOTOR22_UART_DEVICE_ADDRESS_0 0x00
294 #define DCMOTOR22_UART_DEVICE_ADDRESS_1 0x01
295 #define DCMOTOR22_UART_DEVICE_ADDRESS_2 0x02
296 #define DCMOTOR22_UART_DEVICE_ADDRESS_3 0x03
297 #define DCMOTOR22_UART_DEVICE_ADDRESS_MASK 0x03
298 
304 #define DRV_BUFFER_SIZE 200
305  // dcmotor22_cmd
307 
322 #define DCMOTOR22_MAP_MIKROBUS( cfg, mikrobus ) \
323  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
324  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
325  cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
326  cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
327  cfg.a0 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
328  cfg.a1 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
329  cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
330  cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
331  // dcmotor22_map // dcmotor22
334 
339 typedef struct
340 {
341  // Output pins
342  digital_out_t a0;
343  digital_out_t a1;
344  digital_out_t en;
346  // Input pins
347  digital_in_t int_pin;
349  // Modules
350  i2c_master_t i2c;
351  uart_t uart;
356  char uart_rx_buffer[ DRV_BUFFER_SIZE ];
357  char uart_tx_buffer[ DRV_BUFFER_SIZE ];
359  uint8_t adc_setup_byte;
360  uint8_t adc_config_byte;
361  uint32_t pwm_ab;
363 } dcmotor22_t;
364 
369 typedef struct
370 {
371  // Communication gpio pins
372  pin_name_t rx_pin;
373  pin_name_t tx_pin;
374  pin_name_t scl;
375  pin_name_t sda;
377  // Additional gpio pins
378  pin_name_t a0;
379  pin_name_t a1;
380  pin_name_t en;
381  pin_name_t int_pin;
383  // Static variable
384  uint32_t baud_rate;
386  uart_data_bits_t data_bit;
387  uart_parity_t parity_bit;
388  uart_stop_bits_t stop_bit;
390  uint32_t i2c_speed;
391  uint8_t i2c_address;
394 
399 typedef enum
400 {
402  DCMOTOR22_ERROR = -1
403 
405 
422 
437 
451 
464 err_t dcmotor22_write_register ( dcmotor22_t *ctx, uint8_t reg, uint32_t data_in );
465 
478 err_t dcmotor22_read_register ( dcmotor22_t *ctx, uint8_t reg, uint32_t *data_out );
479 
491 err_t dcmotor22_adc_write_setup_byte ( dcmotor22_t *ctx, uint8_t setup_byte );
492 
504 err_t dcmotor22_adc_write_config_byte ( dcmotor22_t *ctx, uint8_t config_byte );
505 
517 err_t dcmotor22_adc_set_channel ( dcmotor22_t *ctx, uint8_t channel );
518 
531 err_t dcmotor22_adc_get_voltage ( dcmotor22_t *ctx, float *voltage );
532 
546 err_t dcmotor22_get_motor_current ( dcmotor22_t *ctx, uint8_t motor_sel, float *current );
547 
561 err_t dcmotor22_set_motor_pwm ( dcmotor22_t *ctx, uint8_t motor_sel, int16_t pwm_duty );
562 
572 
582 
592 
602 void dcmotor22_set_device_address ( dcmotor22_t *ctx, uint8_t addr );
603 
613 
614 #ifdef __cplusplus
615 }
616 #endif
617 #endif // DCMOTOR22_H
618  // dcmotor22
620 
621 // ------------------------------------------------------------------------ END
dcmotor22_return_value_t
dcmotor22_return_value_t
DC Motor 22 Click return value data.
Definition: dcmotor22.h:400
dcmotor22_t::adc_config_byte
uint8_t adc_config_byte
Definition: dcmotor22.h:360
dcmotor22_adc_write_setup_byte
err_t dcmotor22_adc_write_setup_byte(dcmotor22_t *ctx, uint8_t setup_byte)
DC Motor 22 ADC write setup byte function.
DCMOTOR22_OK
@ DCMOTOR22_OK
Definition: dcmotor22.h:401
dcmotor22_cfg_t::scl
pin_name_t scl
Definition: dcmotor22.h:374
dcmotor22_cfg_t::rx_pin
pin_name_t rx_pin
Definition: dcmotor22.h:372
dcmotor22_t::a1
digital_out_t a1
Definition: dcmotor22.h:343
DRV_BUFFER_SIZE
#define DRV_BUFFER_SIZE
DC Motor 22 driver buffer size.
Definition: dcmotor22.h:304
dcmotor22_default_cfg
err_t dcmotor22_default_cfg(dcmotor22_t *ctx)
DC Motor 22 default configuration function.
dcmotor22_t::i2c_slave_address
uint8_t i2c_slave_address
Definition: dcmotor22.h:354
dcmotor22_cfg_t::en
pin_name_t en
Definition: dcmotor22.h:380
dcmotor22_get_motor_current
err_t dcmotor22_get_motor_current(dcmotor22_t *ctx, uint8_t motor_sel, float *current)
DC Motor 22 get motor current function.
dcmotor22_cfg_setup
void dcmotor22_cfg_setup(dcmotor22_cfg_t *cfg)
DC Motor 22 configuration object setup function.
dcmotor22_t::a0
digital_out_t a0
Definition: dcmotor22.h:342
dcmotor22_t::int_pin
digital_in_t int_pin
Definition: dcmotor22.h:347
dcmotor22_cfg_t::sda
pin_name_t sda
Definition: dcmotor22.h:375
dcmotor22_disable_device
void dcmotor22_disable_device(dcmotor22_t *ctx)
DC Motor 22 disable device function.
dcmotor22_adc_set_channel
err_t dcmotor22_adc_set_channel(dcmotor22_t *ctx, uint8_t channel)
DC Motor 22 ADC set channel function.
dcmotor22_t::adc_setup_byte
uint8_t adc_setup_byte
Definition: dcmotor22.h:359
dcmotor22_cfg_t::a1
pin_name_t a1
Definition: dcmotor22.h:379
dcmotor22_t::i2c
i2c_master_t i2c
Definition: dcmotor22.h:350
dcmotor22_t
DC Motor 22 Click context object.
Definition: dcmotor22.h:340
dcmotor22_t::uart
uart_t uart
Definition: dcmotor22.h:351
dcmotor22_write_register
err_t dcmotor22_write_register(dcmotor22_t *ctx, uint8_t reg, uint32_t data_in)
DC Motor 22 write register function.
dcmotor22_cfg_t::data_bit
uart_data_bits_t data_bit
Definition: dcmotor22.h:386
dcmotor22_adc_write_config_byte
err_t dcmotor22_adc_write_config_byte(dcmotor22_t *ctx, uint8_t config_byte)
DC Motor 22 ADC write config byte function.
dcmotor22_cfg_t::tx_pin
pin_name_t tx_pin
Definition: dcmotor22.h:373
dcmotor22_init
err_t dcmotor22_init(dcmotor22_t *ctx, dcmotor22_cfg_t *cfg)
DC Motor 22 initialization function.
dcmotor22_set_motor_pwm
err_t dcmotor22_set_motor_pwm(dcmotor22_t *ctx, uint8_t motor_sel, int16_t pwm_duty)
DC Motor 22 set motor pwm function.
dcmotor22_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: dcmotor22.h:390
dcmotor22_get_int_pin
uint8_t dcmotor22_get_int_pin(dcmotor22_t *ctx)
DC Motor 22 get int pin function.
dcmotor22_t::en
digital_out_t en
Definition: dcmotor22.h:344
dcmotor22_cfg_t::baud_rate
uint32_t baud_rate
Definition: dcmotor22.h:384
DCMOTOR22_ERROR
@ DCMOTOR22_ERROR
Definition: dcmotor22.h:402
dcmotor22_read_register
err_t dcmotor22_read_register(dcmotor22_t *ctx, uint8_t reg, uint32_t *data_out)
DC Motor 22 read register function.
dcmotor22_cfg_t::int_pin
pin_name_t int_pin
Definition: dcmotor22.h:381
dcmotor22_cfg_t::a0
pin_name_t a0
Definition: dcmotor22.h:378
dcmotor22_t::uart_device_address
uint8_t uart_device_address
Definition: dcmotor22.h:353
dcmotor22_adc_get_voltage
err_t dcmotor22_adc_get_voltage(dcmotor22_t *ctx, float *voltage)
DC Motor 22 ADC get voltage function.
dcmotor22_cfg_t::uart_blocking
bool uart_blocking
Definition: dcmotor22.h:385
dcmotor22_enable_device
void dcmotor22_enable_device(dcmotor22_t *ctx)
DC Motor 22 enable device function.
dcmotor22_reset_device
void dcmotor22_reset_device(dcmotor22_t *ctx)
DC Motor 22 reset device function.
dcmotor22_cfg_t::stop_bit
uart_stop_bits_t stop_bit
Definition: dcmotor22.h:388
dcmotor22_cfg_t
DC Motor 22 Click configuration object.
Definition: dcmotor22.h:370
dcmotor22_cfg_t::parity_bit
uart_parity_t parity_bit
Definition: dcmotor22.h:387
dcmotor22_set_device_address
void dcmotor22_set_device_address(dcmotor22_t *ctx, uint8_t addr)
DC Motor 22 set device address function.
dcmotor22_cfg_t::i2c_address
uint8_t i2c_address
Definition: dcmotor22.h:391
dcmotor22_t::pwm_ab
uint32_t pwm_ab
Definition: dcmotor22.h:361