Data Structures | Macros | Typedefs | Enumerations | Functions
ENCODER

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...
 

Detailed Description

Macro Definition Documentation

◆ ENC_inline_run

#define ENC_inline_run   ENC_run

Runs the ENC controller.

Parameters
[in]handlethe ENC Handle

Typedef Documentation

◆ ENC_Obj

typedef struct _ENC_Obj_ ENC_Obj

Defines the ENC controller object.

◆ ENC_Handle

typedef struct _ENC_Obj_* ENC_Handle

Defines the ENC handle.

Enumeration Type Documentation

◆ ENC_Status_e

Enumerator
ENC_IDLE 
ENC_ALIGNMENT 
ENC_WAIT_FOR_INDEX 
ENC_CALIBRATION_DONE 
ENC_ALIGNMENT 
ENC_WAIT_FOR_INDEX 
ENC_CALIBRATION_DONE 

Function Documentation

◆ ENC_init()

ENC_Handle ENC_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the ENC controller.

Parameters
[in]pMemoryA pointer to the memory for the ENC controller object
[in]numBytesThe number of bytes allocated for the ENC controller object, bytes
Returns
The ENC controller (ENC) object handle

◆ ENC_setParams()

void ENC_setParams ( ENC_Handle  handle,
const USER_Params pUserParams 
)

Set the controller.

Parameters
[in]handleThe ENC controller handle

◆ ENC_getSpeedElec_Hz()

static float32_t ENC_getSpeedElec_Hz ( ENC_Handle  handle)
inlinestatic

Runs the ENC controller.

Parameters
[in]handleThe ENC controller handle
Returns
speed from encoder

References _ENC_Obj_::speedElec_Hz.

◆ ENC_getElecAngle()

static float32_t ENC_getElecAngle ( ENC_Handle  handle)
inlinestatic

gets the angle from encoder

Parameters
[in]handleThe ENC controller handle
Returns
angle from encoder

References _ENC_Obj_::thetaElec_rad.

◆ ENC_getState()

static float32_t ENC_getState ( ENC_Handle  handle)
inlinestatic

Gets the state of the ENC controller.

Parameters
[in]handlethe ENC Handle
Returns
state from encode

References _ENC_Obj_::encState.

◆ ENC_resetState()

static void ENC_resetState ( ENC_Handle  handle)
inlinestatic

Gets the ENC controller.

Parameters
[in]handlethe ENC Handle

References ENC_IDLE, and _ENC_Obj_::encState.

◆ ENC_setState()

static void ENC_setState ( ENC_Handle  handle,
const ENC_Status_e  encState 
)
inlinestatic

sets up the ENC controller

Parameters
[in]handlethe ENC Handle

References _ENC_Obj_::encState.

◆ ENC_setHallGPIO()

void ENC_setHallGPIO ( ENC_Handle  handle,
const uint16_t  gpioHallU,
const uint16_t  gpioHallV,
const uint16_t  gpioHallW 
)

set the ENC controller

Parameters
[in]handlethe ENC Handle

◆ ENC_setGPIOHallU()

static void ENC_setGPIOHallU ( ENC_Handle  handle,
const uint32_t  gpioHallU 
)
inlinestatic

set the ENC controller

Parameters
[in]handlethe ENC Handle

References _ENC_Obj_::gpioHallU.

◆ ENC_setGPIOHallV()

static void ENC_setGPIOHallV ( ENC_Handle  handle,
const uint32_t  gpioHallV 
)
inlinestatic

Gets the ENC controller.

Parameters
[in]handlethe ENC Handle

References _ENC_Obj_::gpioHallV.

◆ ENC_setGPIOHallW()

static void ENC_setGPIOHallW ( ENC_Handle  handle,
const uint32_t  gpioHallW 
)
inlinestatic

Gets the ENC controller.

Parameters
[in]handlethe ENC Handle

References _ENC_Obj_::gpioHallW.

◆ ENC_setQEPHandle()

static void ENC_setQEPHandle ( ENC_Handle  handle,
const uint32_t  qepBase 
)
inlinestatic

Gets the ENC controller.

Parameters
[in]handlethe ENC Handle

References _ENC_Obj_::qepHandle.

◆ ENC_getHallState()

static uint16_t ENC_getHallState ( ENC_Handle  handle)
inlinestatic

get the hall state

Parameters
[in]handlethe ENC Handle

References _ENC_Obj_::gpioHallU, _ENC_Obj_::gpioHallV, _ENC_Obj_::gpioHallW, and _ENC_Obj_::hallState.

Referenced by ENC_run().

◆ ENC_full_run()

void ENC_full_run ( ENC_Handle  handle)

Runs the ENC controller.

Parameters
[in]handlethe ENC Handle

◆ ENC_run()

static void ENC_run ( ENC_Handle  handle)
inlinestatic

◆ ENC_runHall()

static void ENC_runHall ( ENC_Handle  handle)
inlinestatic

Copyright 2023, Texas Instruments Incorporated