dcmotor16
2.0.0.0
|
API for configuring and manipulating DC Motor 16 Click driver. More...
Modules | |
DC Motor 16 Registers Settings | |
Settings for registers of DC Motor 16 Click driver. | |
DC Motor 16 MikroBUS Map | |
MikroBUS pin mapping of DC Motor 16 Click driver. | |
Functions | |
void | dcmotor16_cfg_setup (dcmotor16_cfg_t *cfg) |
DC Motor 16 configuration object setup function. More... | |
err_t | dcmotor16_init (dcmotor16_t *ctx, dcmotor16_cfg_t *cfg) |
DC Motor 16 initialization function. More... | |
err_t | dcmotor16_generic_write (dcmotor16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
DC Motor 16 data writing function. More... | |
err_t | dcmotor16_generic_read (dcmotor16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
DC Motor 16 data reading function. More... | |
void | dcmotor16_set_direction (dcmotor16_t *ctx, uint8_t dir) |
Set motor direction. More... | |
void | dcmotor16_ctrl_fwd_pin (dcmotor16_t *ctx, uint8_t state) |
Control FWD pin. More... | |
void | dcmotor16_ctrl_rev_pin (dcmotor16_t *ctx, uint8_t state) |
Control REV pin. More... | |
void | dcmotor16_ctrl_vref (dcmotor16_t *ctx, uint16_t value) |
Control motor VRef (speed). More... | |
void | dcmotor16_stop (dcmotor16_t *ctx) |
Motor stop. More... | |
API for configuring and manipulating DC Motor 16 Click driver.
void dcmotor16_cfg_setup | ( | dcmotor16_cfg_t * | cfg | ) |
DC Motor 16 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See dcmotor16_cfg_t object definition for detailed explanation. |
void dcmotor16_ctrl_fwd_pin | ( | dcmotor16_t * | ctx, |
uint8_t | state | ||
) |
Control FWD pin.
This function controls the state of the FWD pin.
[out] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | state | : Pin State ( 1 - ACTIVE / 0 - DEACTIVE ) |
void dcmotor16_ctrl_rev_pin | ( | dcmotor16_t * | ctx, |
uint8_t | state | ||
) |
Control REV pin.
This function controls the state of the REV pin.
[out] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | state | : Pin State ( 1 - ACTIVE / 0 - DEACTIVE ) |
void dcmotor16_ctrl_vref | ( | dcmotor16_t * | ctx, |
uint16_t | value | ||
) |
Control motor VRef (speed).
This function sets the VRef value used for this click board.
[out] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | value | : Motor Vref ( 0x0000 to 0x0100 ) |
err_t dcmotor16_generic_read | ( | dcmotor16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
DC Motor 16 data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t dcmotor16_generic_write | ( | dcmotor16_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
DC Motor 16 data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t dcmotor16_init | ( | dcmotor16_t * | ctx, |
dcmotor16_cfg_t * | cfg | ||
) |
DC Motor 16 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See dcmotor16_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void dcmotor16_set_direction | ( | dcmotor16_t * | ctx, |
uint8_t | dir | ||
) |
Set motor direction.
This function sets the direction of the motor.
[out] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |
[in] | dir | : Motor direction ( FORWARD / BACKWARD ) |
void dcmotor16_stop | ( | dcmotor16_t * | ctx | ) |
Motor stop.
This function stops the motor.
[out] | ctx | : Click context object. See dcmotor16_t object definition for detailed explanation. |