Bowls Eye  1.0
Classes | Functions
stepperMotor.h File Reference
#include <pigpiod_if2.h>
#include <stdint.h>
#include "globals.h"
Include dependency graph for stepperMotor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StepperMotor_t
 Structure for interfacing with stepper motor and its dual H bridge driver. More...
 

Functions

void StepperMotor_construct (StepperMotor_t *stepper, uint8_t multiple)
 
void StepperMotor_enable (StepperMotor_t *stepper)
 
void StepperMotor_update (StepperMotor_t *stepper)
 
void StepperMotor_setDirection (StepperMotor_t *stepper, uint8_t direction)
 
void StepperMotor_setStepSize (StepperMotor_t *stepper, uint8_t multiple)
 
void StepperMotor_enA (StepperMotor_t *stepper)
 
void StepperMotor_enB (StepperMotor_t *stepper)
 
void StepperMotor_disable (StepperMotor_t *stepper)
 
void StepperMotor_incrementStep (StepperMotor_t *stepper)
 
void StepperMotor_decrementStep (StepperMotor_t *stepper)
 
void StepperMotor_wrapStep (StepperMotor_t *stepper)
 
void StepperMotor_step0 (StepperMotor_t *stepper)
 
void StepperMotor_step1 (StepperMotor_t *stepper)
 
void StepperMotor_step2 (StepperMotor_t *stepper)
 
void StepperMotor_step3 (StepperMotor_t *stepper)
 

Detailed Description

Author
Harvey Leicester

Definition in file stepperMotor.h.

Function Documentation

void StepperMotor_construct ( StepperMotor_t *  stepper,
uint8_t  multiple 
)

Constructor for StepperMotor_t

Parameters
stepperInstance of StepperMotor_t
multipleMultiple of minimum step angle (0.9deg), defines angular resolution of system

Definition at line 15 of file stepperMotor.c.

References StepperMotor_t::currentStep, StepperMotor_t::pinB1, StepperMotor_t::pinEnA, StepperMotor_t::stepMultiple, StepperMotor_enable(), StepperMotor_step0(), StepperMotor_step1(), StepperMotor_step2(), StepperMotor_step3(), and StepperMotor_t::waitTime.

Here is the call graph for this function:

void StepperMotor_decrementStep ( StepperMotor_t *  stepper)

Decrement the current step of the motor

Parameters
stepperInstance of StepperMotor_t

Definition at line 147 of file stepperMotor.c.

References StepperMotor_t::currentStep, and StepperMotor_wrapStep().

Referenced by StepperMotor_update().

Here is the call graph for this function:

void StepperMotor_disable ( StepperMotor_t *  stepper)

Disable the stepper motor

Parameters
stepperInstance of StepperMotor_t

Definition at line 101 of file stepperMotor.c.

References StepperMotor_t::pinB1, and StepperMotor_t::pinEnA.

void StepperMotor_enA ( StepperMotor_t *  stepper)

Enable the A H bridge of the stepper motor driver

Parameters
stepper

Definition at line 116 of file stepperMotor.c.

References StepperMotor_t::pinEnA.

void StepperMotor_enable ( StepperMotor_t *  stepper)

Enable the stepper motor

Parameters
stepperInstance of StepperMotor_t

Definition at line 86 of file stepperMotor.c.

References StepperMotor_t::pinB1, and StepperMotor_t::pinEnA.

Referenced by StepperMotor_construct().

void StepperMotor_enB ( StepperMotor_t *  stepper)

Enable the B H bridge of the stepper motor driver

Parameters
stepper

Definition at line 125 of file stepperMotor.c.

void StepperMotor_incrementStep ( StepperMotor_t *  stepper)

Increment the current step of the motor

Parameters
stepperInstance of StepperMotor_t

Definition at line 134 of file stepperMotor.c.

References StepperMotor_t::currentStep, and StepperMotor_wrapStep().

Referenced by StepperMotor_update().

Here is the call graph for this function:

void StepperMotor_setDirection ( StepperMotor_t *  stepper,
uint8_t  direction 
)

Set the rotational direction of the motor

Parameters
stepperInstance of StepperMotor_t
directionDirection to assign

Definition at line 77 of file stepperMotor.c.

void StepperMotor_setStepSize ( StepperMotor_t *  stepper,
uint8_t  multiple 
)

Set the size of the motor step increment, defines the angular resolution of the system

Parameters
stepperInstance of StepperMotor_t
multipleMultiple of minimum step increment (0.9deg)

Definition at line 67 of file stepperMotor.c.

References StepperMotor_t::stepMultiple.

void StepperMotor_step0 ( StepperMotor_t *  stepper)

Method for performing a step

Parameters
stepperInstance of StepperMotor_t

Definition at line 174 of file stepperMotor.c.

References StepperMotor_t::pinB1.

Referenced by StepperMotor_construct().

void StepperMotor_step1 ( StepperMotor_t *  stepper)

Method for performing a step

Parameters
stepperInstance of StepperMotor_t

Definition at line 186 of file stepperMotor.c.

References StepperMotor_t::pinB1.

Referenced by StepperMotor_construct().

void StepperMotor_step2 ( StepperMotor_t *  stepper)

Method for performing a step

Parameters
stepperInstance of StepperMotor_t

Definition at line 198 of file stepperMotor.c.

References StepperMotor_t::pinB1.

Referenced by StepperMotor_construct().

void StepperMotor_step3 ( StepperMotor_t *  stepper)

Method for performing a step

Parameters
stepperInstance of StepperMotor_t

Definition at line 210 of file stepperMotor.c.

References StepperMotor_t::pinB1.

Referenced by StepperMotor_construct().

void StepperMotor_update ( StepperMotor_t *  stepper)

Update the stepper motor position

Parameters
stepperInstance of StepperMotor_t

Definition at line 42 of file stepperMotor.c.

References StepperMotor_t::stepMultiple, StepperMotor_decrementStep(), StepperMotor_incrementStep(), and StepperMotor_t::waitTime.

Here is the call graph for this function:

void StepperMotor_wrapStep ( StepperMotor_t *  stepper)

Wrap current step of motor at limits

Parameters
stepperInstance of StepperMotor_t

Definition at line 159 of file stepperMotor.c.

References StepperMotor_t::currentStep.

Referenced by StepperMotor_decrementStep(), and StepperMotor_incrementStep().