Data Structures | |
struct | _ENC_Obj_ |
Defines the ENC controller object. More... | |
Macros | |
#define | ENC_inline_run ENC_run |
Runs the ENC controller. More... | |
Typedefs | |
typedef struct _ENC_Obj_ | ENC_Obj |
Defines the ENC controller object. More... | |
typedef struct _ENC_Obj_ * | ENC_Handle |
Defines the ENC handle. More... | |
Enumerations | |
enum | ENC_Status_e { ENC_IDLE = 0, ENC_ALIGNMENT = 1, ENC_WAIT_FOR_INDEX = 2, ENC_CALIBRATION_DONE = 3, ENC_ALIGNMENT = 0, ENC_WAIT_FOR_INDEX = 1, ENC_CALIBRATION_DONE = 2 } |
Functions | |
ENC_Handle | ENC_init (void *pMemory, const size_t numBytes) |
Initializes the ENC controller. More... | |
void | ENC_setParams (ENC_Handle handle, const USER_Params *pUserParams) |
Set the controller. More... | |
static float32_t | ENC_getSpeedElec_Hz (ENC_Handle handle) |
Runs the ENC controller. More... | |
static float32_t | ENC_getElecAngle (ENC_Handle handle) |
gets the angle from encoder More... | |
static float32_t | ENC_getState (ENC_Handle handle) |
Gets the state of the ENC controller. More... | |
static void | ENC_resetState (ENC_Handle handle) |
Gets the ENC controller. More... | |
static void | ENC_setState (ENC_Handle handle, const ENC_Status_e encState) |
sets up the ENC controller More... | |
void | ENC_setHallGPIO (ENC_Handle handle, const uint16_t gpioHallU, const uint16_t gpioHallV, const uint16_t gpioHallW) |
set the ENC controller More... | |
static void | ENC_setGPIOHallU (ENC_Handle handle, const uint32_t gpioHallU) |
set the ENC controller More... | |
static void | ENC_setGPIOHallV (ENC_Handle handle, const uint32_t gpioHallV) |
Gets the ENC controller. More... | |
static void | ENC_setGPIOHallW (ENC_Handle handle, const uint32_t gpioHallW) |
Gets the ENC controller. More... | |
static void | ENC_setQEPHandle (ENC_Handle handle, const uint32_t qepBase) |
Gets the ENC controller. More... | |
static uint16_t | ENC_getHallState (ENC_Handle handle) |
get the hall state More... | |
void | ENC_full_run (ENC_Handle handle) |
Runs the ENC controller. More... | |
static void | ENC_run (ENC_Handle handle) |
static void | ENC_runHall (ENC_Handle handle) |
Runs the hall of ENC controller. More... | |
#define ENC_inline_run ENC_run |
Runs the ENC controller.
[in] | handle | the ENC Handle |
typedef struct _ENC_Obj_* ENC_Handle |
Defines the ENC handle.
enum ENC_Status_e |
ENC_Handle ENC_init | ( | void * | pMemory, |
const size_t | numBytes | ||
) |
Initializes the ENC controller.
[in] | pMemory | A pointer to the memory for the ENC controller object |
[in] | numBytes | The number of bytes allocated for the ENC controller object, bytes |
void ENC_setParams | ( | ENC_Handle | handle, |
const USER_Params * | pUserParams | ||
) |
Set the controller.
[in] | handle | The ENC controller handle |
|
inlinestatic |
Runs the ENC controller.
[in] | handle | The ENC controller handle |
References _ENC_Obj_::speedElec_Hz.
|
inlinestatic |
gets the angle from encoder
[in] | handle | The ENC controller handle |
References _ENC_Obj_::thetaElec_rad.
|
inlinestatic |
Gets the state of the ENC controller.
[in] | handle | the ENC Handle |
References _ENC_Obj_::encState.
|
inlinestatic |
Gets the ENC controller.
[in] | handle | the ENC Handle |
References ENC_IDLE, and _ENC_Obj_::encState.
|
inlinestatic |
void ENC_setHallGPIO | ( | ENC_Handle | handle, |
const uint16_t | gpioHallU, | ||
const uint16_t | gpioHallV, | ||
const uint16_t | gpioHallW | ||
) |
set the ENC controller
[in] | handle | the ENC Handle |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
get the hall state
[in] | handle | the ENC Handle |
References _ENC_Obj_::gpioHallU, _ENC_Obj_::gpioHallV, _ENC_Obj_::gpioHallW, and _ENC_Obj_::hallState.
Referenced by ENC_run().
void ENC_full_run | ( | ENC_Handle | handle | ) |
Runs the ENC controller.
[in] | handle | the ENC Handle |
|
inlinestatic |
References ENC_CALIBRATION_DONE, ENC_getHallState(), ENC_WAIT_FOR_INDEX, _ENC_Obj_::encState, _ENC_Obj_::hallState, _ENC_Obj_::hallStateZero, _ENC_Obj_::indexOffset, MATH_PI, MATH_TWO_PI, _ENC_Obj_::mechanicalScaler, _ENC_Obj_::polePairs, _ENC_Obj_::qepHandle, _ENC_Obj_::thetaElec_rad, _ENC_Obj_::thetaMech_pu, and _ENC_Obj_::thetaMech_rad.
|
inlinestatic |
Runs the hall of ENC controller.
[in] | handle | The ENC controller handle |
References ENC_CALIBRATION_DONE, ENC_WAIT_FOR_INDEX, _ENC_Obj_::encState, MATH_PI, MATH_TWO_PI, _ENC_Obj_::mechanicalScaler, _ENC_Obj_::polePairs, _ENC_Obj_::qepHandle, _ENC_Obj_::thetaElec_rad, _ENC_Obj_::thetaMech_pu, and _ENC_Obj_::thetaMech_rad.