dcmotor2 2.0.0.0

Functions

void dcmotor2_cfg_setup (dcmotor2_cfg_t *cfg)
 Config Object Initialization function.
 
DCMOTOR2_RETVAL dcmotor2_init (dcmotor2_t *ctx, dcmotor2_cfg_t *cfg)
 Initialization function.
 
void dcmotor2_set_duty_cycle (dcmotor2_t *ctx, float duty_cycle)
 Generic sets PWM duty cycle.
 
void dcmotor2_pwm_stop (dcmotor2_t *ctx)
 Stop PWM module.
 
void dcmotor2_pwm_start (dcmotor2_t *ctx)
 Start PWM module.
 
void dcmotor2_enable_motor (dcmotor2_t *ctx)
 Enable motor.
 
void dcmotor2_disable_motor (dcmotor2_t *ctx)
 Disable motor.
 
void dcmotor2_spin_clockwise (dcmotor2_t *ctx)
 Spin motor clockwise.
 
void dcmotor2_spin_counter_clockwise (dcmotor2_t *ctx)
 Spin motor counter clockwise.
 
void dcmotor2_pull_brake (dcmotor2_t *ctx)
 Pull motor brake.
 
void dcmotor2_stop_motor (dcmotor2_t *ctx)
 Stop motor clockwise.
 

Detailed Description

Function Documentation

◆ dcmotor2_cfg_setup()

void dcmotor2_cfg_setup ( dcmotor2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ dcmotor2_disable_motor()

void dcmotor2_disable_motor ( dcmotor2_t * ctx)

Disable motor.

Parameters
ctxClick object.

@description This function sends a low digital output on the SLP pin and disables the motor.

◆ dcmotor2_enable_motor()

void dcmotor2_enable_motor ( dcmotor2_t * ctx)

Enable motor.

Parameters
ctxClick object.

@description This function sends a high digital output on the SLP pin and enables the motor.

◆ dcmotor2_init()

DCMOTOR2_RETVAL dcmotor2_init ( dcmotor2_t * ctx,
dcmotor2_cfg_t * cfg )

Initialization function.

Parameters
dcmotor2Click object.
cfgClick configuration structure.

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

◆ dcmotor2_pull_brake()

void dcmotor2_pull_brake ( dcmotor2_t * ctx)

Pull motor brake.

Parameters
ctxClick object.

@description This function sets the IN1/IN2 pins to 1/1 and forces the motor to break.

◆ dcmotor2_pwm_start()

void dcmotor2_pwm_start ( dcmotor2_t * ctx)

Start PWM module.

Parameters
ctxClick object.

@description This function starts PWM module.

◆ dcmotor2_pwm_stop()

void dcmotor2_pwm_stop ( dcmotor2_t * ctx)

Stop PWM module.

Parameters
ctxClick object.

@description This function stops PWM module.

◆ dcmotor2_set_duty_cycle()

void dcmotor2_set_duty_cycle ( dcmotor2_t * ctx,
float duty_cycle )

Generic sets PWM duty cycle.

Parameters
ctxClick object.
duty_cycleDuty cycle.

@description This function sets the PWM duty cycle.

◆ dcmotor2_spin_clockwise()

void dcmotor2_spin_clockwise ( dcmotor2_t * ctx)

Spin motor clockwise.

Parameters
ctxClick object.

@description This function sets the IN1/IN2 pins to 1/0 and makes the motor spin clockwise.

◆ dcmotor2_spin_counter_clockwise()

void dcmotor2_spin_counter_clockwise ( dcmotor2_t * ctx)

Spin motor counter clockwise.

Parameters
ctxClick object.

@description This function sets the IN1/IN2 pins to 0/1 and makes the motor spin counter clockwise.

◆ dcmotor2_stop_motor()

void dcmotor2_stop_motor ( dcmotor2_t * ctx)

Stop motor clockwise.

Parameters
ctxClick object.

@description This function sets the IN1/IN2 pins to 0/0 and stops the motor completely.