dcmotor27 2.1.0.0
DC Motor 27 Click Driver

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

Topics

 DC Motor 27 PWM Settings
 Settings for configuration of DC Motor 27 Click driver.
 
 DC Motor 27 MikroBUS Map
 MikroBUS pin mapping of DC Motor 27 Click driver.
 

Functions

void dcmotor27_cfg_setup (dcmotor27_cfg_t *cfg)
 DC Motor 27 configuration object setup function.
 
err_t dcmotor27_init (dcmotor27_t *ctx, dcmotor27_cfg_t *cfg)
 DC Motor 27 initialization function.
 
err_t dcmotor27_default_cfg (dcmotor27_t *ctx)
 DC Motor 27 default configuration function.
 
err_t dcmotor27_set_duty_cycle (dcmotor27_t *ctx, float duty_cycle)
 DC Motor 27 sets PWM duty cycle.
 
err_t dcmotor27_pwm_stop (dcmotor27_t *ctx)
 DC Motor 27 stop PWM module.
 
err_t dcmotor27_pwm_start (dcmotor27_t *ctx)
 DC Motor 27 start PWM module.
 
uint8_t dcmotor27_get_flt_pin (dcmotor27_t *ctx)
 DC Motor 27 get flt pin state.
 
uint8_t dcmotor27_get_ip_pin (dcmotor27_t *ctx)
 DC Motor 27 get ip pin state.
 
void dcmotor27_set_rst_pin (dcmotor27_t *ctx, uint8_t pin_state)
 DC Motor 27 set RST pin state.
 
void dcmotor27_set_cs_pin (dcmotor27_t *ctx, uint8_t pin_state)
 DC Motor 27 set CS pin state.
 
void dcmotor27_set_coast (dcmotor27_t *ctx, uint8_t coast_state)
 DC Motor 27 set coast mode funtion.
 

Detailed Description

API for configuring and manipulating DC Motor 27 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

◆ dcmotor27_cfg_setup()

void dcmotor27_cfg_setup ( dcmotor27_cfg_t * cfg)

DC Motor 27 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ dcmotor27_default_cfg()

err_t dcmotor27_default_cfg ( dcmotor27_t * ctx)

DC Motor 27 default configuration function.

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

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ dcmotor27_get_flt_pin()

uint8_t dcmotor27_get_flt_pin ( dcmotor27_t * ctx)

DC Motor 27 get flt pin state.

This function reads flt pin state.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
Returns
Flt pin state.
Note
None.

◆ dcmotor27_get_ip_pin()

uint8_t dcmotor27_get_ip_pin ( dcmotor27_t * ctx)

DC Motor 27 get ip pin state.

This function reads ip pin state.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
Returns
Flt pin state.
Note
None.

◆ dcmotor27_init()

err_t dcmotor27_init ( dcmotor27_t * ctx,
dcmotor27_cfg_t * cfg )

DC Motor 27 initialization function.

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

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

◆ dcmotor27_pwm_start()

err_t dcmotor27_pwm_start ( dcmotor27_t * ctx)

DC Motor 27 start PWM module.

This function starts the PWM module output.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor27_pwm_stop()

err_t dcmotor27_pwm_stop ( dcmotor27_t * ctx)

DC Motor 27 stop PWM module.

This function stops the PWM module output.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor27_set_coast()

void dcmotor27_set_coast ( dcmotor27_t * ctx,
uint8_t coast_state )

DC Motor 27 set coast mode funtion.

This function is used to set motor to coast mode.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
[in]coast_state: Coast state.
Returns
Nothing.
Note
None.

◆ dcmotor27_set_cs_pin()

void dcmotor27_set_cs_pin ( dcmotor27_t * ctx,
uint8_t pin_state )

DC Motor 27 set CS pin state.

This function is used to set CS pin state.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
[in]pin_state: State of the pin.
Returns
Nothing.
Note
None

◆ dcmotor27_set_duty_cycle()

err_t dcmotor27_set_duty_cycle ( dcmotor27_t * ctx,
float duty_cycle )

DC Motor 27 sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
[in]duty_cycle: PWM duty cycle.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ dcmotor27_set_rst_pin()

void dcmotor27_set_rst_pin ( dcmotor27_t * ctx,
uint8_t pin_state )

DC Motor 27 set RST pin state.

This function is used to set RST pin state.

Parameters
[in]ctx: Click context object. See dcmotor27_t object definition for detailed explanation.
[in]pin_state: State of the pin.
Returns
Nothing.
Note
None