dcmotor18 2.0.0.0
|
API for configuring and manipulating DC Motor 18 Click driver. More...
Topics | |
DC Motor 18 PWM Settings | |
Settings for configuration of DC Motor 18 Click driver. | |
DC Motor 18 MikroBUS Map | |
MikroBUS pin mapping of DC Motor 18 Click driver. | |
Dcmotor18_cfg | |
Functions | |
void | dcmotor18_cfg_setup (dcmotor18_cfg_t *cfg) |
DC Motor 18 configuration object setup function. | |
err_t | dcmotor18_init (dcmotor18_t *ctx, dcmotor18_cfg_t *cfg) |
DC Motor 18 initialization function. | |
err_t | dcmotor18_default_cfg (dcmotor18_t *ctx) |
DC Motor 18 default configuration function. | |
err_t | dcmotor18_set_duty_cycle (dcmotor18_t *ctx, float duty_cycle) |
Sets PWM duty cycle. | |
err_t | dcmotor18_pwm_stop (dcmotor18_t *ctx) |
DC Motor 18 stop PWM module. | |
err_t | dcmotor18_pwm_start (dcmotor18_t *ctx) |
DC Motor 18 start PWM module. | |
err_t | dcmotor18_read_an_pin_value (dcmotor18_t *ctx, uint16_t *data_out) |
DC Motor 18 read AN pin value function. | |
err_t | dcmotor18_read_an_pin_voltage (dcmotor18_t *ctx, float *data_out) |
DC Motor 18 read AN pin voltage level function. | |
err_t | dcmotor18_read_an_pin_current (dcmotor18_t *ctx, float *data_out) |
Read AN pin current. | |
void | dcmotor18_set_direction (dcmotor18_t *ctx, uint8_t state) |
Set diretion of motor rotation. | |
void | dcmotor18_set_enable (dcmotor18_t *ctx, uint8_t state) |
Set enable pin state. | |
uint8_t | dcmotor18_get_interrupt (dcmotor18_t *ctx) |
Get interrupt pin state. | |
err_t | dcmotor18_set_speed_percentage (dcmotor18_t *ctx, float speed_percentage) |
Set speed output percentage. | |
API for configuring and manipulating DC Motor 18 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dcmotor18_cfg_setup | ( | dcmotor18_cfg_t * | cfg | ) |
DC Motor 18 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor18_cfg_t object definition for detailed explanation. |
err_t dcmotor18_default_cfg | ( | dcmotor18_t * | ctx | ) |
DC Motor 18 default configuration function.
This function executes a default configuration of DC Motor 18 click board.
[in] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t dcmotor18_get_interrupt | ( | dcmotor18_t * | ctx | ) |
Get interrupt pin state.
This function reads the int_pin pin state.
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
err_t dcmotor18_init | ( | dcmotor18_t * | ctx, |
dcmotor18_cfg_t * | cfg ) |
DC Motor 18 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dcmotor18_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dcmotor18_pwm_start | ( | dcmotor18_t * | ctx | ) |
DC Motor 18 start PWM module.
This function starts the PWM module output.
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dcmotor18_pwm_stop | ( | dcmotor18_t * | ctx | ) |
DC Motor 18 stop PWM module.
This function stops the PWM module output.
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dcmotor18_read_an_pin_current | ( | dcmotor18_t * | ctx, |
float * | data_out ) |
Read AN pin current.
This function reads voltage of AN pin and calculates current.
[in] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[out] | data_out | : Output current of the analog pin [mA]. |
0
- Success, -1
- Error.err_t dcmotor18_read_an_pin_value | ( | dcmotor18_t * | ctx, |
uint16_t * | data_out ) |
DC Motor 18 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error.err_t dcmotor18_read_an_pin_voltage | ( | dcmotor18_t * | ctx, |
float * | data_out ) |
DC Motor 18 read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error.void dcmotor18_set_direction | ( | dcmotor18_t * | ctx, |
uint8_t | state ) |
Set diretion of motor rotation.
This function sets the pw2 pin state.
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[in] | state | : State of the pin. |
err_t dcmotor18_set_duty_cycle | ( | dcmotor18_t * | ctx, |
float | duty_cycle ) |
Sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[in] | duty_ratio | : PWM duty_ratio. |
0
- Success, -1
- Error.void dcmotor18_set_enable | ( | dcmotor18_t * | ctx, |
uint8_t | state ) |
Set enable pin state.
This function sets the en pin state.
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[in] | state | : State of the pin. |
err_t dcmotor18_set_speed_percentage | ( | dcmotor18_t * | ctx, |
float | speed_percentage ) |
Set speed output percentage.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[out] | ctx | : Click context object. See dcmotor18_t object definition for detailed explanation. |
[in] | speed_percentage | : PWM duty_ratio. |
0
- Success, -1
- Error.