dcmotor15 2.0.0.0
|
API for configuring and manipulating DC Motor 15 Click driver. More...
Topics | |
DC Motor 15 MikroBUS Map | |
MikroBUS pin mapping of DC Motor 15 Click driver. | |
Macros | |
#define | DCMOTOR15_RIPROP_OHM 1500 |
DC Motor 15 IPROPI values. | |
#define | DCMOTOR15_AIPROP_AMP 0.000455 |
Functions | |
void | dcmotor15_cfg_setup (dcmotor15_cfg_t *cfg) |
DC Motor 15 configuration object setup function. | |
err_t | dcmotor15_init (dcmotor15_t *ctx, dcmotor15_cfg_t *cfg) |
DC Motor 15 initialization function. | |
void | dcmotor15_default_cfg (dcmotor15_t *ctx) |
DC Motor 15 default configuration function. | |
err_t | dcmotor15_read_an_pin_value (dcmotor15_t *ctx, uint16_t *data_out) |
DC Motor 15 read IPR pin value function. | |
err_t | dcmotor15_read_an_pin_voltage (dcmotor15_t *ctx, float *data_out) |
DC Motor 15 read IPR pin voltage level function. | |
void | dcmotor15_set_slp_pin_state (dcmotor15_t *ctx, uint8_t state) |
DC Motor 15 set SLP pin state function. | |
void | dcmotor15_set_in1_pin_state (dcmotor15_t *ctx, uint8_t state) |
DC Motor 15 set IN1 pin state function. | |
void | dcmotor15_set_in2_pin_state (dcmotor15_t *ctx, uint8_t state) |
DC Motor 15 set IN2 pin state function. | |
uint8_t | dcmotor15_fault_check (dcmotor15_t *ctx) |
DC Motor 15 get FLT pin state function. | |
void | dcmotor15_forward (dcmotor15_t *ctx) |
DC Motor 15 drive forward function. | |
void | dcmotor15_reverse (dcmotor15_t *ctx) |
DC Motor 15 drive reverse function. | |
void | dcmotor15_brake (dcmotor15_t *ctx) |
DC Motor 15 brake function. | |
void | dcmotor15_stop (dcmotor15_t *ctx) |
DC Motor 15 stop function. | |
float | dcmotor15_get_current (dcmotor15_t *ctx, uint16_t num_of_conv) |
DC Motor 15 get current function. | |
API for configuring and manipulating DC Motor 15 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
#define DCMOTOR15_AIPROP_AMP 0.000455 |
#define DCMOTOR15_RIPROP_OHM 1500 |
DC Motor 15 IPROPI values.
Specified IPROPI values of DC Motor 15 Click driver.
void dcmotor15_brake | ( | dcmotor15_t * | ctx | ) |
DC Motor 15 brake function.
This function pulls the motor brake.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
void dcmotor15_cfg_setup | ( | dcmotor15_cfg_t * | cfg | ) |
DC Motor 15 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor15_cfg_t object definition for detailed explanation. |
void dcmotor15_default_cfg | ( | dcmotor15_t * | ctx | ) |
DC Motor 15 default configuration function.
This function executes a default configuration of DC Motor 15 click board.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
uint8_t dcmotor15_fault_check | ( | dcmotor15_t * | ctx | ) |
DC Motor 15 get FLT pin state function.
This function returns the FLT pin logic state.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
void dcmotor15_forward | ( | dcmotor15_t * | ctx | ) |
DC Motor 15 drive forward function.
This function drives the motor forward.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. |
[in] | num_of_conv | : Number of ADC conversions to be performed. See dcmotor15_t object definition for detailed explanation. |
err_t dcmotor15_init | ( | dcmotor15_t * | ctx, |
dcmotor15_cfg_t * | cfg ) |
DC Motor 15 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[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. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error.void dcmotor15_reverse | ( | dcmotor15_t * | ctx | ) |
DC Motor 15 drive reverse function.
This function drives the motor in reverse.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | state | : Pin logic 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.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | state | : Pin logic 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.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void dcmotor15_stop | ( | dcmotor15_t * | ctx | ) |
DC Motor 15 stop function.
This function stops the motor, the click goes to sleep mode, the motor is disconnected.
[in] | ctx | : Click context object. See dcmotor15_t object definition for detailed explanation. |