dcmotor17 2.0.0.0
DC Motor 17 Click Driver

API for configuring and manipulating DC Motor 17 Click driver. More...

Topics

 DC Motor 17 Settings
 Settings of DC Motor 17 Click driver.
 
 DC Motor 17 MikroBUS Map
 MikroBUS pin mapping of DC Motor 17 Click driver.
 
 Retval_flag
 
 Sel_out
 
 Mode
 

Functions

void dcmotor17_cfg_setup (dcmotor17_cfg_t *cfg)
 DC Motor 17 configuration object setup function.
 
err_t dcmotor17_init (dcmotor17_t *ctx, dcmotor17_cfg_t *cfg)
 DC Motor 17 initialization function.
 
void dcmotor17_default_cfg (dcmotor17_t *ctx)
 DC Motor 17 default configuration function.
 
void dcmotor17_standby_mode (dcmotor17_t *ctx)
 DC Motor 17 set to standby operating mode function.
 
void dcmotor17_normal_mode (dcmotor17_t *ctx)
 DC Motor 17 set to normal operating mode function.
 
dcmotor17_retval_t dcmotor17_set_mode (dcmotor17_t *ctx, uint8_t op_mode)
 DC Motor 17 set operating mode function.
 
dcmotor17_retval_t dcmotor17_stop (dcmotor17_t *ctx, uint8_t sel_out)
 DC Motor 17 stop motor function.
 
dcmotor17_retval_t dcmotor17_forward (dcmotor17_t *ctx, uint8_t sel_out)
 DC Motor 17 forward function.
 
dcmotor17_retval_t dcmotor17_reverse (dcmotor17_t *ctx, uint8_t sel_out)
 DC Motor 17 reverse function.
 

Detailed Description

API for configuring and manipulating DC Motor 17 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ dcmotor17_cfg_setup()

void dcmotor17_cfg_setup ( dcmotor17_cfg_t * cfg)

DC Motor 17 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See dcmotor17_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ dcmotor17_default_cfg()

void dcmotor17_default_cfg ( dcmotor17_t * ctx)

DC Motor 17 default configuration function.

This function executes a default configuration of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.

See #err_t definition for detailed explanation.

Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ dcmotor17_forward()

dcmotor17_retval_t dcmotor17_forward ( dcmotor17_t * ctx,
uint8_t sel_out )

DC Motor 17 forward function.

This function is used to drive the motor forward of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
[in]sel_out: Select channel motor output.
  • 0 ( DCMOTOR17_SEL_OUT_A ) - A channel motor output,
  • 1 ( DCMOTOR17_SEL_OUT_B ) - B channel motor output.
Returns
  • 0x00 ( DCMOTOR17_OK ) - Ok,
  • 0xFF ( DCMOTOR17_ERROR ) - Error.
Note
None.

◆ dcmotor17_init()

err_t dcmotor17_init ( dcmotor17_t * ctx,
dcmotor17_cfg_t * cfg )

DC Motor 17 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See dcmotor17_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor17_normal_mode()

void dcmotor17_normal_mode ( dcmotor17_t * ctx)

DC Motor 17 set to normal operating mode function.

This function sets the normal operating mode of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ dcmotor17_reverse()

dcmotor17_retval_t dcmotor17_reverse ( dcmotor17_t * ctx,
uint8_t sel_out )

DC Motor 17 reverse function.

This function is used to drive the motor reverse of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
Returns
  • 0x00 ( DCMOTOR17_OK ) - Ok,
  • 0xFF ( DCMOTOR17_ERROR ) - Error.
Note
None.

◆ dcmotor17_set_mode()

dcmotor17_retval_t dcmotor17_set_mode ( dcmotor17_t * ctx,
uint8_t op_mode )

DC Motor 17 set operating mode function.

This function sets the desired operating mode of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
[in]op_mode: Operating mode.
  • 0 ( DCMOTOR17_SEL_MODE_STANDBY ) - Standby operating mode,
  • 1 ( DCMOTOR17_SEL_MODE_NORMAL ) - Normal operating mode.
Returns
  • 0x00 ( DCMOTOR17_OK ) - Ok,
  • 0xFF ( DCMOTOR17_ERROR ) - Error.
Note
None.

◆ dcmotor17_standby_mode()

void dcmotor17_standby_mode ( dcmotor17_t * ctx)

DC Motor 17 set to standby operating mode function.

This function sets the standby operating mode of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ dcmotor17_stop()

dcmotor17_retval_t dcmotor17_stop ( dcmotor17_t * ctx,
uint8_t sel_out )

DC Motor 17 stop motor function.

This function is used to stop the motor of DC Motor 17 click board.

Parameters
[in]ctx: Click context object. See dcmotor17_t object definition for detailed explanation.
[in]sel_out: Select channel motor output.
  • 0 ( DCMOTOR17_SEL_OUT_A ) - A channel motor output,
  • 1 ( DCMOTOR17_SEL_OUT_B ) - B channel motor output.
Returns
  • 0x00 ( DCMOTOR17_OK ) - Ok,
  • 0xFF ( DCMOTOR17_ERROR ) - Error.
Note
None.