dcmotor24
2.1.0.0
|
API for configuring and manipulating DC Motor 24 Click driver. More...
Modules | |
DC Motor 24 Settings | |
Settings of DC Motor 24 Click driver. | |
DC Motor 24 MikroBUS Map | |
MikroBUS pin mapping of DC Motor 24 Click driver. | |
Functions | |
void | dcmotor24_cfg_setup (dcmotor24_cfg_t *cfg) |
DC Motor 24 configuration object setup function. More... | |
err_t | dcmotor24_init (dcmotor24_t *ctx, dcmotor24_cfg_t *cfg) |
DC Motor 24 initialization function. More... | |
err_t | dcmotor24_default_cfg (dcmotor24_t *ctx) |
DC Motor 24 default configuration function. More... | |
err_t | dcmotor24_write_config (dcmotor24_t *ctx, uint16_t config_word) |
DC Motor 24 write config function. More... | |
err_t | dcmotor24_read_diag (dcmotor24_t *ctx, uint16_t *diag) |
DC Motor 24 read diag function. More... | |
void | dcmotor24_set_direction (dcmotor24_t *ctx, uint8_t dir) |
DC Motor 24 set direction function. More... | |
void | dcmotor24_switch_direction (dcmotor24_t *ctx) |
DC Motor 24 switch direction function. More... | |
void | dcmotor24_enable_output (dcmotor24_t *ctx) |
DC Motor 24 enable output function. More... | |
void | dcmotor24_disable_output (dcmotor24_t *ctx) |
DC Motor 24 disable output function. More... | |
err_t | dcmotor24_set_duty_cycle (dcmotor24_t *ctx, float duty_cycle) |
DC Motor 24 sets PWM duty cycle. More... | |
err_t | dcmotor24_pwm_stop (dcmotor24_t *ctx) |
DC Motor 24 stop PWM module. More... | |
err_t | dcmotor24_pwm_start (dcmotor24_t *ctx) |
DC Motor 24 start PWM module. More... | |
API for configuring and manipulating DC Motor 24 Click driver.
void dcmotor24_cfg_setup | ( | dcmotor24_cfg_t * | cfg | ) |
DC Motor 24 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor24_cfg_t object definition for detailed explanation. |
err_t dcmotor24_default_cfg | ( | dcmotor24_t * | ctx | ) |
DC Motor 24 default configuration function.
This function executes a default configuration of DC Motor 24 click board.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dcmotor24_disable_output | ( | dcmotor24_t * | ctx | ) |
DC Motor 24 disable output function.
This function disables the output by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
void dcmotor24_enable_output | ( | dcmotor24_t * | ctx | ) |
DC Motor 24 enable output function.
This function enables the output by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
err_t dcmotor24_init | ( | dcmotor24_t * | ctx, |
dcmotor24_cfg_t * | cfg | ||
) |
DC Motor 24 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dcmotor24_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor24_pwm_start | ( | dcmotor24_t * | ctx | ) |
DC Motor 24 start PWM module.
This function starts the PWM module output.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor24_pwm_stop | ( | dcmotor24_t * | ctx | ) |
DC Motor 24 stop PWM module.
This function stops the PWM module output.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t dcmotor24_read_diag | ( | dcmotor24_t * | ctx, |
uint16_t * | diag | ||
) |
DC Motor 24 read diag function.
This function reads a diagnostics word by using SPI serial interface.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
[out] | diag | : Diagnostics word from DIA_REG. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dcmotor24_set_direction | ( | dcmotor24_t * | ctx, |
uint8_t | dir | ||
) |
DC Motor 24 set direction function.
This function sets the motor direction.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
[in] | dir |
|
err_t dcmotor24_set_duty_cycle | ( | dcmotor24_t * | ctx, |
float | duty_cycle | ||
) |
DC Motor 24 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty cycle. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void dcmotor24_switch_direction | ( | dcmotor24_t * | ctx | ) |
DC Motor 24 switch direction function.
This function switches the direction by toggling the DIR pin state.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
err_t dcmotor24_write_config | ( | dcmotor24_t * | ctx, |
uint16_t | config_word | ||
) |
DC Motor 24 write config function.
This function writes a desired configuration word by using SPI serial interface.
[in] | ctx | : Click context object. See dcmotor24_t object definition for detailed explanation. |
[in] | config_word | : Configuration word for CFG_REG. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.