API for configuring and manipulating DC Motor 15 Click driver.
More...
API for configuring and manipulating DC Motor 15 Click driver.
◆ DCMOTOR15_AIPROP_AMP
#define DCMOTOR15_AIPROP_AMP 0.000455 |
◆ DCMOTOR15_RIPROP_OHM
#define DCMOTOR15_RIPROP_OHM 1500 |
DC Motor 15 IPROPI values.
Specified IPROPI values of DC Motor 15 Click driver.
◆ dcmotor15_brake()
DC Motor 15 brake function.
This function pulls the motor brake.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
- Returns
- None.
- Note
- None.
◆ dcmotor15_cfg_setup()
DC Motor 15 configuration object setup function.
This function initializes click configuration structure to initial values.
- Parameters
-
[out] | cfg | : Click configuration structure. See dcmotor15_cfg_t object definition for detailed explanation. |
- Returns
- Nothing.
- Note
- The all used pins will be set to unconnected state.
◆ dcmotor15_default_cfg()
DC Motor 15 default configuration function.
This function executes a default configuration of DC Motor 15 click board.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
- Note
- This function can consist any necessary configuration or setting to put device into operating mode.
◆ dcmotor15_fault_check()
DC Motor 15 get FLT pin state function.
This function returns the FLT pin logic state.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
- Returns
- Pin logic state.
- Note
- None.
◆ dcmotor15_forward()
DC Motor 15 drive forward function.
This function drives the motor forward.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
- Returns
- None.
- Note
- None.
◆ dcmotor15_get_current()
float dcmotor15_get_current |
( |
dcmotor15_t * |
ctx, |
|
|
uint16_t |
num_of_conv |
|
) |
| |
DC Motor 15 get current function.
This function reads the motor current consumption by performing analog to digital read of IPR pin.
- Parameters
-
[in] | ctx | : Click context object. |
[in] | num_of_conv | : Number of ADC conversions to be performed. See dcmotor15_t object definition for detailed explanation. |
- Returns
- Current value in Amps.
- Note
- None.
◆ dcmotor15_init()
DC Motor 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
- Parameters
-
[out] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dcmotor15_cfg_t object definition for detailed explanation. |
- Returns
-
See #err_t definition for detailed explanation.
- Note
- None.
◆ dcmotor15_read_an_pin_value()
err_t dcmotor15_read_an_pin_value |
( |
dcmotor15_t * |
ctx, |
|
|
uint16_t * |
data_out |
|
) |
| |
DC Motor 15 read IPR pin value function.
This function reads results of AD conversion of the IPR pin.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
- Returns
-
See #err_t definition for detailed explanation.
- Note
- None.
◆ dcmotor15_read_an_pin_voltage()
err_t dcmotor15_read_an_pin_voltage |
( |
dcmotor15_t * |
ctx, |
|
|
float * |
data_out |
|
) |
| |
DC Motor 15 read IPR pin voltage level function.
This function reads results of AD conversion of the IPR pin and converts them to proportional voltage level.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
- Returns
-
See #err_t definition for detailed explanation.
- Note
- The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).
◆ dcmotor15_reverse()
DC Motor 15 drive reverse function.
This function drives the motor in reverse.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
- Returns
- None.
- Note
- None.
◆ dcmotor15_set_in1_pin_state()
void dcmotor15_set_in1_pin_state |
( |
dcmotor15_t * |
ctx, |
|
|
uint8_t |
state |
|
) |
| |
DC Motor 15 set IN1 pin state function.
This function sets the IN1 pin to a desired state.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
- Returns
- None.
- Note
- None.
◆ dcmotor15_set_in2_pin_state()
void dcmotor15_set_in2_pin_state |
( |
dcmotor15_t * |
ctx, |
|
|
uint8_t |
state |
|
) |
| |
DC Motor 15 set IN2 pin state function.
This function sets the IN2 pin to a desired state.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
- Returns
- None.
- Note
- None.
◆ dcmotor15_set_slp_pin_state()
void dcmotor15_set_slp_pin_state |
( |
dcmotor15_t * |
ctx, |
|
|
uint8_t |
state |
|
) |
| |
DC Motor 15 set SLP pin state function.
This function sets the SLP pin to a desired state.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
- Returns
- None.
- Note
- None.
◆ dcmotor15_stop()
DC Motor 15 stop function.
This function stops the motor, the click goes to sleep mode, the motor is disconnected.
- Parameters
-
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
- Returns
- None.
- Note
- None.