dcmotor20 2.0.0.0
|
API for configuring and manipulating DC Motor 20 Click driver. More...
Topics | |
DC Motor 20 Settings | |
Settings of DC Motor 20 Click driver. | |
DC Motor 20 MikroBUS Map | |
MikroBUS pin mapping of DC Motor 20 Click driver. | |
Functions | |
void | dcmotor20_cfg_setup (dcmotor20_cfg_t *cfg) |
DC Motor 20 configuration object setup function. | |
err_t | dcmotor20_init (dcmotor20_t *ctx, dcmotor20_cfg_t *cfg) |
DC Motor 20 initialization function. | |
err_t | dcmotor20_drive_motor (dcmotor20_t *ctx, uint8_t speed, uint32_t time_ms) |
DC Motor 20 drive motor function. | |
err_t | dcmotor20_set_channel_mode (dcmotor20_t *ctx, uint8_t channel, uint8_t mode) |
DC Motor 20 set channel mode function. | |
void | dcmotor20_set_standby_mode (dcmotor20_t *ctx) |
DC Motor 20 set standby mode function. | |
API for configuring and manipulating DC Motor 20 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void dcmotor20_cfg_setup | ( | dcmotor20_cfg_t * | cfg | ) |
DC Motor 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor20_cfg_t object definition for detailed explanation. |
err_t dcmotor20_drive_motor | ( | dcmotor20_t * | ctx, |
uint8_t | speed, | ||
uint32_t | time_ms ) |
DC Motor 20 drive motor function.
This function drives the motor for a certian time specified by time_ms at the desired speed. The motor channel and mode must be previously selected using the dcmotor20_set_channel_mode function.
[out] | ctx | : Click context object. See dcmotor20_t object definition for detailed explanation. |
[in] | speed | : Motor speed level [1-100]. |
[in] | time_ms | : Driving time in miliseconds. |
0
- Success, -1
- Error.err_t dcmotor20_init | ( | dcmotor20_t * | ctx, |
dcmotor20_cfg_t * | cfg ) |
DC Motor 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dcmotor20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dcmotor20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t dcmotor20_set_channel_mode | ( | dcmotor20_t * | ctx, |
uint8_t | channel, | ||
uint8_t | mode ) |
DC Motor 20 set channel mode function.
This function sets the active channel and mode which will be used by the dcmotor20_drive_motor function.
[out] | ctx | : Click context object. See dcmotor20_t object definition for detailed explanation. |
[in] | channel | : Active channel selection [1-3]. |
[in] | mode | : Mode selection [0-2]. |
0
- Success, -1
- Error.void dcmotor20_set_standby_mode | ( | dcmotor20_t * | ctx | ) |
DC Motor 20 set standby mode function.
This function sets the chip to the standby mode which affects both channels.
[out] | ctx | : Click context object. See dcmotor20_t object definition for detailed explanation. |