LibSpindle-C-Library 1.0
Library Code documentation
Loading...
Searching...
No Matches
SpindlePhysicalParams Struct Reference

#include <Spindle.h>

Data Fields

void(* setDutyCycle )(SpindleHandle_t h, void *context, int backwards, float dutyCycle)
 
void(* enaPWM )(SpindleHandle_t h, void *context, int ena)
 
float maxRPM
 
float absMinRPM
 
float minRPM
 
void * context
 

Detailed Description

The SpindlePhysicalParams_t structure is represents the abstraction functions and members as a container. The objetcs are passed as structure pointer when calling SPINDLE_CreateInstance. It contains function pointers to platform specific functions which enable the spindle or regulate the speed and direction of it. There are also limit values for the maximum, minimum and absolute minimum RPM and an additional context pointer which is passed the the abstraction functions. The user must provide a configured structure in its design when calling SPINDLE_CreateInstance.

Field Documentation

◆ absMinRPM

float SpindlePhysicalParams::absMinRPM

specifies the minimum possible absolute RPM value which is usable with the spindle a requested RPM value lower than this value is limited and therefore its not possible to let the spindle run slower. This value is used for clock wise and counter clock wise spindle rotation in the same way.

◆ context

void* SpindlePhysicalParams::context

optional context pointer for platform abstraction. can be null.

◆ enaPWM

void(* SpindlePhysicalParams::enaPWM) (SpindleHandle_t h, void *context, int ena)

This function pointer is used to enable or disable the PWM output and to set the enable outputs od the half bridges of the spindle

The pointer must not be null

Parameters
[in,out]hoptional handle of the spindle library.
[in,out]contextoptional context pointer the user has passed by the SPINDLE_CreateInstance call.
[in]enavalue that sets enable or disable state (1 = enabled, 0 = disabled)

The behavior is schematically as follows:

◆ maxRPM

float SpindlePhysicalParams::maxRPM

specifies the maximum positive RPM value which represents a duty cycle of 1.0

◆ minRPM

float SpindlePhysicalParams::minRPM

specifies the minimum negative RPM value. Mostly this value is symmetrical to the max value which means it can be the same value

◆ setDutyCycle

void(* SpindlePhysicalParams::setDutyCycle) (SpindleHandle_t h, void *context, int backwards, float dutyCycle)

This function pointer is used to change the duty cycle of the spindle. This function is necessary for changing the PWM generation itself. It also sets the direction of the spindle which means turning clock wise or counter clock wise

The pointer must not be null

Parameters
[in,out]hoptional handle of the spindle library.
[in,out]contextoptional context pointer the user has passed by the SPINDLE_CreateInstance call.
[in]dutyCyclevalue between 0 = 0% and 1 = 100%
[in]backwardssets the direction of the spindle (clockwise or counter clockwise = backward).

The behavior is schematically as follows:


The documentation for this struct was generated from the following file: