Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The section describes the programming interface of the ENC HAL driver.

Enumerations

enum  enc_status_t {
  kStatus_ENC_Success = 0U,
  kStatus_ENC_Error = 1U,
  kStatus_ENC_InvalidArgument = 2U
}
 Encoder status. More...
 
enum  enc_operation_mode_t {
  kEncNormalMode = 0U,
  kEncModuloCountingMode = 1U,
  kEncSignalPhaseCountMode = 2U
}
 Encoder operation modes. More...
 
enum  enc_status_flag_t {
  kEncCmpFlag = 0U,
  kEncHomeSignalFlag = 1U,
  kEncWatchdogTimeoutFlag = 2U,
  kEncIndexPulseFlag = 3U,
  kEncRollunderFlag = 4U,
  kEncRolloverFlag = 5U,
  kEncSimultaneousFlag = 6U,
  kEncCountDirectionFlag = 7U
}
 Encoder status flags. More...
 
enum  enc_int_source_t {
  kEncIntCmp = 0U,
  kEncIntHomeSignal = 1U,
  kEncIntWatchdogTimeout = 2U,
  kEncIntIndexPulse = 3U,
  kEncIntRollunder = 4U,
  kEncIntRollover = 5U,
  kEncIntSimultaneous = 6U
}
 Encoder interrupts. More...
 

Configuration

void ENC_HAL_Init (ENC_Type *base)
 Resets all configurable registers to be in the reset state for ENC. More...
 
static void ENC_HAL_SetCmpIntCmd (ENC_Type *base, bool enable)
 Switches to enable the Compare interrupt. More...
 
static bool ENC_HAL_GetCmpIntCmd (ENC_Type *base)
 Gets the Compare Interrupt configuration setting. More...
 
static bool ENC_HAL_GetCmpIntFlag (ENC_Type *base)
 Gets the Compare Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearCmpIntFlag (ENC_Type *base)
 Clears the Compare Interrupt Request bit pending. More...
 
static void ENC_HAL_SetWatchdogCmd (ENC_Type *base, bool enable)
 Switches to enable the Watchdog. More...
 
static bool ENC_HAL_GetWatchdogCmd (ENC_Type *base)
 Gets the Watchdog configuration setting. More...
 
static void ENC_HAL_SetWatchdogIntCmd (ENC_Type *base, bool enable)
 Switches to enable the Watchdog Timeout Interrupt. More...
 
static bool ENC_HAL_GetWatchdogIntCmd (ENC_Type *base)
 Gets the Watchdog Timeout Interrupt configuration setting. More...
 
static bool ENC_HAL_GetWatchdogIntFlag (ENC_Type *base)
 Gets the Watchdog Timeout Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearWatchdogIntFlag (ENC_Type *base)
 Clears the Watchdog Timeout Interrupt Request pending. More...
 
static void ENC_HAL_SetIndexPulseNegativeEdgeCmd (ENC_Type *base, bool enable)
 Sets the type of INDEX pulse edge. More...
 
static bool ENC_HAL_GetIndexPulseNegativeEdgeCmd (ENC_Type *base)
 Gets INDEX pulse edge configuration setting. More...
 
static void ENC_HAL_SetIndexInitPosCmd (ENC_Type *base, bool enable)
 Switches to enable the INDEX to Initialize Position Counters UPOS and LPOS. More...
 
static bool ENC_HAL_GetIndexInitPosCmd (ENC_Type *base)
 Gets the INDEX to Initialize Position Counters configuration setting. More...
 
static void ENC_HAL_SetIndexPulseIntCmd (ENC_Type *base, bool enable)
 Switches to enable the INDEX Pulse Interrupt. More...
 
static bool ENC_HAL_GetIndexPulseIntCmd (ENC_Type *base)
 Gets the INDEX Pulse Interrupt configuration setting. More...
 
static bool ENC_HAL_GetIndexPulseIntFlag (ENC_Type *base)
 Gets the INDEX Pulse Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearIndexPulseIntFlag (ENC_Type *base)
 Clears the INDEX Pulse Interrupt Request pending. More...
 
static void ENC_HAL_SetSignalPhaseCountModeCmd (ENC_Type *base, bool enable)
 Enables Signal Phase Count Mode. More...
 
static bool ENC_HAL_GetSignalPhaseCountModeCmd (ENC_Type *base)
 Gets the Signal Phase Count Mode configuration setting. More...
 
static void ENC_HAL_SetReverseCountingCmd (ENC_Type *base, bool enable)
 Switches to enable the Reverse Direction Counting. More...
 
static bool ENC_HAL_GetReverseCountingCmd (ENC_Type *base)
 Gets Direction Counting configuration setting. More...
 
static bool ENC_HAL_GetLastCountDirectionFlag (ENC_Type *base)
 Gets the Last Count Direction Flag. More...
 
static void ENC_HAL_InitPosCounter (ENC_Type *base)
 Initializes the Position Counter. More...
 
static void ENC_HAL_SetHomeSignalNegativeEdgeCmd (ENC_Type *base, bool enable)
 Sets the type of HOME Input Signal Edge. More...
 
static bool ENC_HAL_GetHomeSignalNegativeEdgeCmd (ENC_Type *base)
 Gets HOME Input Signal Edge configuration setting. More...
 
static void ENC_HAL_SetHomeInitPosCmd (ENC_Type *base, bool enable)
 Switches to enable the Initialize Position Counters UPOS and LPOS. More...
 
static bool ENC_HAL_GetHomeInitPosCmd (ENC_Type *base)
 Gets the HOME to Initialize Position Counters configuration setting. More...
 
static void ENC_HAL_SetHomeSignalIntCmd (ENC_Type *base, bool enable)
 Switches to enable the HOME Signal Interrupt. More...
 
static bool ENC_HAL_GetHomeSignalIntCmd (ENC_Type *base)
 Gets the HOME Signal Interrupt configuration setting. More...
 
static bool ENC_HAL_GetHomeSignalIntFlag (ENC_Type *base)
 Gets the HOME Signal Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearHomeSignalIntFlag (ENC_Type *base)
 Clears the HOME Signal Interrupt Request pending. More...
 
static void ENC_HAL_SetInputFilterSampleCount (ENC_Type *base, uint8_t sampleCount)
 Sets the Input Filter Sample Count. More...
 
static uint8_t ENC_HAL_GetInputFilterSampleCount (ENC_Type *base)
 Gets the Input Filter Sample Count. More...
 
void ENC_HAL_SetInputFilterSamplePeriod (ENC_Type *base, uint8_t samplePeriod)
 Sets the Input Filter Sample Period. More...
 
static uint8_t ENC_HAL_GetInputFilterSamplePeriod (ENC_Type *base)
 Gets the Input Filter Sample Period. More...
 
static void ENC_HAL_SetWatchdogTimeout (ENC_Type *base, uint16_t wdtTimeout)
 Sets the Watchdog timeout register. More...
 
static uint16_t ENC_HAL_GetWatchdogTimeout (ENC_Type *base)
 Gets the Watchdog timeout register. More...
 
static void ENC_HAL_SetPosDiffCounterReg (ENC_Type *base, uint16_t diffPosition)
 Sets the Position Difference Counter Register. More...
 
static uint16_t ENC_HAL_GetPosDiffCounterReg (ENC_Type *base)
 Gets the Position Difference Counter Register. More...
 
static uint16_t ENC_HAL_GetPosDiffHoldReg (ENC_Type *base)
 Gets the Position Difference Hold Register. More...
 
static void ENC_HAL_SetRevolutionCounterReg (ENC_Type *base, uint16_t revValue)
 Sets the Revolution Counter Register. More...
 
static uint16_t ENC_HAL_GetRevolutionCounterReg (ENC_Type *base)
 Gets the Revolution Counter Register. More...
 
static uint16_t ENC_HAL_GetRevolutionHoldReg (ENC_Type *base)
 Gets the Revolution Hold Register. More...
 
uint32_t ENC_HAL_GetPosCounterReg (ENC_Type *base)
 Gets the Position Counter Register. More...
 
void ENC_HAL_SetPosCounterReg (ENC_Type *base, uint32_t posVal)
 Sets the Position Counter Register. More...
 
uint32_t ENC_HAL_GetPosHoldReg (ENC_Type *base)
 Gets the Position Hold Register. More...
 
void ENC_HAL_SetInitReg (ENC_Type *base, uint32_t initValue)
 Sets the Initialization Register. More...
 
uint32_t ENC_HAL_GetInitReg (ENC_Type *base)
 Gets the Initialization Register. More...
 
static bool ENC_HAL_GetRawHomeInput (ENC_Type *base)
 Gets the Raw HOME Input. More...
 
static bool ENC_HAL_GetRawIndexInput (ENC_Type *base)
 Gets the Raw INDEX Input. More...
 
static bool ENC_HAL_GetRawPhaseBInput (ENC_Type *base)
 Gets the Raw PHASEB Input. More...
 
static bool ENC_HAL_GetRawPhaseAInput (ENC_Type *base)
 Gets the Raw PHASEA Input. More...
 
static bool ENC_HAL_GetFilteredHomeInput (ENC_Type *base)
 Gets the Filtered HOME Input. More...
 
static bool ENC_HAL_GetFilteredIndexInput (ENC_Type *base)
 Gets the Filtered INDEX Input. More...
 
static bool ENC_HAL_GetFilteredPhaseBInput (ENC_Type *base)
 Gets the Filtered PHASEB Input. More...
 
static bool ENC_HAL_GetFilteredPhaseAInput (ENC_Type *base)
 Gets the Filtered PHASEA Input. More...
 
static uint8_t ENC_HAL_GetTestCount (ENC_Type *base)
 Gets the ENC Test Count. More...
 
static void ENC_HAL_SetTestCount (ENC_Type *base, uint8_t testCount)
 Sets the ENC Test Count. More...
 
static uint8_t ENC_HAL_GetTestPeriod (ENC_Type *base)
 Gets the ENC Test Period. More...
 
static void ENC_HAL_SetTestPeriod (ENC_Type *base, uint8_t testPeriod)
 Sets the ENC Test Period. More...
 
static void ENC_HAL_SetNegativeTestSignalCmd (ENC_Type *base, bool enable)
 Sets the Quadrature Decoder Test Signal. More...
 
static bool ENC_HAL_GetNegativeTestSignalCmd (ENC_Type *base)
 Gets the Quadrature Decoder Test Signal configuration setting. More...
 
static void ENC_HAL_SetTestCounterCmd (ENC_Type *base, bool enable)
 Switches to enable the Test Counter. More...
 
static bool ENC_HAL_GetTestCounterCmd (ENC_Type *base)
 Tests the Test Counter Enable bit. More...
 
static void ENC_HAL_SetTestModuleCmd (ENC_Type *base, bool enable)
 Switches to enable the Test Module. More...
 
static bool ENC_HAL_GetTestModuleCmd (ENC_Type *base)
 Tests the Test Module Enable bit. More...
 
void ENC_HAL_SetModulusReg (ENC_Type *base, uint32_t modValue)
 Sets the ENC Modulus Register. More...
 
uint32_t ENC_HAL_GetModulusReg (ENC_Type *base)
 Gets the ENC Modulus Register. More...
 
void ENC_HAL_SetCmpReg (ENC_Type *base, uint32_t cmpValue)
 Sets the ENC Compare Register. More...
 
uint32_t ENC_HAL_GetCmpReg (ENC_Type *base)
 Gets the ENC Compare Register. More...
 
static void ENC_HAL_SetTriggerUpdateHoldRegCmd (ENC_Type *base, bool enable)
 Switches to enable the Update Hold Registers. More...
 
static bool ENC_HAL_GetTriggerUpdateHoldRegCmd (ENC_Type *base)
 Gets the Update Hold Registers configuration setting. More...
 
static void ENC_HAL_SetTriggerClearPosRegCmd (ENC_Type *base, bool enable)
 Enables Update Position Registers. More...
 
static bool ENC_HAL_GetTriggerClearPosRegCmd (ENC_Type *base)
 Gets the Update Position Registers configuration setting. More...
 
static void ENC_HAL_SetModuloCountingCmd (ENC_Type *base, bool enable)
 Switches to enable the Modulo Counting. More...
 
static bool ENC_HAL_GetModuloCountingCmd (ENC_Type *base)
 Gets the Modulo Counting configuration setting. More...
 
static void ENC_HAL_SetRollunderIntCmd (ENC_Type *base, bool enable)
 Switches to enable the Roll-under Interrupt. More...
 
static bool ENC_HAL_GetRollunderIntCmd (ENC_Type *base)
 Gets the Roll-under Interrupt configuration setting. More...
 
static bool ENC_HAL_GetRollunderIntFlag (ENC_Type *base)
 Gets the Roll-under Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearRollunderIntFlag (ENC_Type *base)
 Clears the Roll-under Interrupt Request pending. More...
 
static void ENC_HAL_SetRolloverIntCmd (ENC_Type *base, bool enable)
 Switches to enable the Roll-over Interrupt. More...
 
static bool ENC_HAL_GetRolloverIntCmd (ENC_Type *base)
 Gets the Roll-over Interrupt configuration setting. More...
 
static bool ENC_HAL_GetRolloverIntFlag (ENC_Type *base)
 Gets the Roll-over Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearRolloverIntFlag (ENC_Type *base)
 Clears the Roll-over Interrupt Request pending. More...
 
static void ENC_HAL_SetModulusRevCounterCmd (ENC_Type *base, bool enable)
 Switches to enable the Modulus Revolution Counter. More...
 
static bool ENC_HAL_GetModulusRevCounterCmd (ENC_Type *base)
 Gets the Modulus Revolution Counter configuration setting. More...
 
static void ENC_HAL_SetPosmatchOnReadingCmd (ENC_Type *base, bool enable)
 Switches to enable the POSMATCH to pulse on Counters registers reading. More...
 
static bool ENC_HAL_GetPosmatchOnReadingCmd (ENC_Type *base)
 Gets the POSMATCH Output configuration setting. More...
 
static void ENC_HAL_SetSimultaneousIntCmd (ENC_Type *base, bool enable)
 Switches to enable the Simultaneous PHASEA and PHASEB Change Interrupt. More...
 
static bool ENC_HAL_GetSimultaneousIntCmd (ENC_Type *base)
 Gets the SAB Interrupt configuration setting. More...
 
static bool ENC_HAL_GetSimultaneousIntFlag (ENC_Type *base)
 Gets the SAB Interrupt Request configuration setting. More...
 
static void ENC_HAL_ClearSimultaneousIntFlag (ENC_Type *base)
 Clears the SAB Interrupt Request pending. More...
 

Enumeration Type Documentation

Enumerator
kStatus_ENC_Success 

Encoder success status.

kStatus_ENC_Error 

Encoder error status.

kStatus_ENC_InvalidArgument 

Encoder invalid argument.

Enumerator
kEncNormalMode 

Normal mode (transition signal counting).

kEncModuloCountingMode 

Modulo counting mode.

kEncSignalPhaseCountMode 

Signal phase count mode (pulse counting).

Enumerator
kEncCmpFlag 

Encoder Compare status flag.

kEncHomeSignalFlag 

Encoder HOME Signal transition status flag.

kEncWatchdogTimeoutFlag 

Encoder Watchdog timeout status flag.

kEncIndexPulseFlag 

Encoder INDEX Pulse transition status flag.

kEncRollunderFlag 

Encoder Roll-under status flag.

kEncRolloverFlag 

Encoder Roll-over status flag.

kEncSimultaneousFlag 

Encoder Simultaneous PHA and PHB change status flag.

kEncCountDirectionFlag 

Encoder Last count direction status flag.

Enumerator
kEncIntCmp 

Compare interrupt source.

kEncIntHomeSignal 

HOME signal interrupt source.

kEncIntWatchdogTimeout 

Watchdog timeout interrupt source.

kEncIntIndexPulse 

INDEX pulse interrupt source.

kEncIntRollunder 

Roll-under position counter interrupt source.

kEncIntRollover 

Roll-over position counter interrupt source.

kEncIntSimultaneous 

Simultaneous PHASEA and PHASEB change interrupt source.

Function Documentation

void ENC_HAL_Init ( ENC_Type *  base)

This function resets all configurable registers to be in the reset state for ENC. It should be called before configuring the ENC module.

Parameters
baseThe ENC peripheral base address.
static void ENC_HAL_SetCmpIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable/disable compare interrupt.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetCmpIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the compare interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of compare interrupt setting.
static bool ENC_HAL_GetCmpIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the compare interrupt request. This bit is set when a match occurs between the counter and the COMP value. It will remain set until cleared by software.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the compare interrupt request bit.
static void ENC_HAL_ClearCmpIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the compare interrupt request bit.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetWatchdogCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable watchdog timer. Allow operation of the watchdog timer monitoring the PHESEA and PHASEB inputs for motor movement.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetWatchdogCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the watchdog configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of watchdog.
static void ENC_HAL_SetWatchdogIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable watchdog timeout interrupt.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetWatchdogIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the watchdog timeout interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of wdt timeout interrupt setting.
static bool ENC_HAL_GetWatchdogIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the watchdog timeout interrupt request. This bit is set when a watchdog timeout interrupt occurs. It will remain set until cleared by software. This bit is also cleared when watchdog is disabled.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the wdt timetout interrupt request bit.
static void ENC_HAL_ClearWatchdogIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the watchdog timeout interrupt request bit.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetIndexPulseNegativeEdgeCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to set the type of INDEX pulse edge used to initialize the position counter.

Parameters
baseThe ENC module base address.
enableThe edge type of INDEX pulse input.
static bool ENC_HAL_GetIndexPulseNegativeEdgeCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the type of INDEX pulse edge.

Parameters
baseThe ENC module base address.
Returns
The INDEX pulse edge configuration setting
static void ENC_HAL_SetIndexInitPosCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable INDEX pulse to initialize position counters UPOS and LPOS.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetIndexInitPosCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the INDEX to initialize position counters configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of INDEX init position counters.
static void ENC_HAL_SetIndexPulseIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the INDEX pulse interrupt.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetIndexPulseIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the INDEX pulse interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of INDEX pulse interrupt setting.
static bool ENC_HAL_GetIndexPulseIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the INDEX pulse interrupt request. This bit is set when an INDEX interrupt occurs. It will remain set until cleared by software.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the INDEX pulse interrupt request bit.
static void ENC_HAL_ClearIndexPulseIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the INDEX pulse interrupt request bit.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetSignalPhaseCountModeCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the signal phase count mode which bypasses the quadrature decoder. A positive transition of the PHASEA input generates a count signal. The PHASEB input and the REV (direction control bit) control the counter direction.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetSignalPhaseCountModeCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the signal phase counter mode configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of signal phase count mode setting.
static void ENC_HAL_SetReverseCountingCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the reverse direction counting. It reverses the interpretation of the quadrature signal, changing the direction of count.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetReverseCountingCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the counting type configuration setting.

Parameters
baseThe ENC module base address.
Returns
The count type configuration setting.
static bool ENC_HAL_GetLastCountDirectionFlag ( ENC_Type *  base)
inlinestatic

This function allows the user to get the flag that indicates the direction of the last count. Returns true if last count was in the up direction or returns false if last count was in the down direction.

Parameters
baseThe ENC module base address.
Returns
The state of count direction.
static void ENC_HAL_InitPosCounter ( ENC_Type *  base)
inlinestatic

This function allows the user to initialize position counters UPOS and LPOS. It will transfer the UINIT and LINIT contents to UPOS and LPOS.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetHomeSignalNegativeEdgeCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to set the type of HOME input signal edge. Use positive or negative going edge-to-trigger initialization of position counters UPOS and LPOS.

Parameters
baseThe ENC module base address.
enableThe edge type of HOME input signal.
static bool ENC_HAL_GetHomeSignalNegativeEdgeCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the HOME input signal edge configuration setting.

Parameters
baseThe ENC module base address.
Returns
The edge type of HOME input signal.
static void ENC_HAL_SetHomeInitPosCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable HOME signal to initialize position counters UPOS and LPOS.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetHomeInitPosCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the HOME signal input init configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of HOME signal initialization POS counters.
static void ENC_HAL_SetHomeSignalIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the HOME signal interrupt.

Parameters
baseThe ENC module base address
enableBool parameter to enable/disable.
static bool ENC_HAL_GetHomeSignalIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the HOME signal interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of HOME signal interrupt setting.
static bool ENC_HAL_GetHomeSignalIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the HOME signal interrupt request. This bit is set when a transition on the HOME signal occurs. It will remain set until it is cleared by software.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the HOME signal interrupt request bit.
static void ENC_HAL_ClearHomeSignalIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the HOME signal interrupt request bit.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetInputFilterSampleCount ( ENC_Type *  base,
uint8_t  sampleCount 
)
inlinestatic

This function allows the user to set the input filter sample counts. The value represents the number of consecutive samples that must agree prior to the input filter accepting an input transition. A value of 0x0 represents 3 samples. A value of 0x7 represents 10 samples. A value of sampleCount affects the input latency.

Parameters
baseThe ENC module base address.
sampleCountValue that represents the number of consecutive samples.
static uint8_t ENC_HAL_GetInputFilterSampleCount ( ENC_Type *  base)
inlinestatic

This function allows the user to read the input filter sample counts. The value represents the number of consecutive samples that must agree prior to the input filter accepting an input transition.

Parameters
baseThe ENC module base address.
Returns
Value that represents the number of consecutive samples.
void ENC_HAL_SetInputFilterSamplePeriod ( ENC_Type *  base,
uint8_t  samplePeriod 
)

This function allows the user to set the input filter sample period. This value represents the sampling period of the decoder input signals. Each input is sampled multiple times at the rate specified by this field. If samplePeriod is 0x00 (default), then the input filter is bypassed. Bypassing the digital filter enables the position/position difference counters to operate with count rates up to the IPBus frequency. The value of samplePeriod affects the input latency.

Parameters
baseThe ENC module base address.
samplePeriodValue of filter sample period.
static uint8_t ENC_HAL_GetInputFilterSamplePeriod ( ENC_Type *  base)
inlinestatic

This function allows the user to read the input filter sample period. This value represents the sampling period of the decoder input signals.

Parameters
baseThe ENC module base address.
Returns
Value of filter sample period.
static void ENC_HAL_SetWatchdogTimeout ( ENC_Type *  base,
uint16_t  wdtTimeout 
)
inlinestatic

This function allows the user to set the timeout value for Watchdog timer, which is separated from the watchdog timer in the COP module. Timeout value is the number of clock cycles plus one that the watchdog timer counts before timing out and optionally generating an interrupt.

Parameters
baseThe ENC module base address.
wdtTimeoutValue of watchdog timeout.
static uint16_t ENC_HAL_GetWatchdogTimeout ( ENC_Type *  base)
inlinestatic

This function allows the user to read the timeout value for Watchdog timer, which is separated from the watchdog timer in the COP module. Timeout value is the number of clock cycles plus one that the watchdog timer counts before timing out and optionally generating an interrupt.

Parameters
baseThe ENC module base address.
Returns
Value of watchdog timeout.
static void ENC_HAL_SetPosDiffCounterReg ( ENC_Type *  base,
uint16_t  diffPosition 
)
inlinestatic

This function allows the user to write the POSD register. It contains the position change in value occuring between each read of the position register. The value of the position difference counter register can be used to calculate velocity.

Parameters
baseThe ENC module base address.
diffPositionValue of position difference.
static uint16_t ENC_HAL_GetPosDiffCounterReg ( ENC_Type *  base)
inlinestatic

This function allows the user to read the POSD register. It contains the position change in value occurring between each read of the position register. The value of the position difference counter register can be used to calculate velocity. The 16-bit position difference counter computes up or down on every count pulse. This counter acts as a differentiator whose count value is proportional to the change in position since the last time the position counter was read. When the position register, the position difference counter, or the revolution counter is read, the position difference counter's contents are copied into the position difference hold register (POSDH) and the position difference counter is cleared.

Parameters
baseThe ENC module base address.
Returns
Value of position difference hold register.
static uint16_t ENC_HAL_GetPosDiffHoldReg ( ENC_Type *  base)
inlinestatic

This function allows the user to read the POSD Hold register. Hold register contains a snapshot of the value of the position difference register. The value of the position difference hold register can be used to calculate velocity.

Parameters
baseThe ENC module base address.
Returns
Value of position difference hold register.
static void ENC_HAL_SetRevolutionCounterReg ( ENC_Type *  base,
uint16_t  revValue 
)
inlinestatic

This function allows the user to write the Revolution counter.

Parameters
baseThe ENC module base address.
revValueValue of revolution.
static uint16_t ENC_HAL_GetRevolutionCounterReg ( ENC_Type *  base)
inlinestatic

This function allows the user to read the Revolution counter.

Parameters
baseThe ENC module base address.
Returns
Value of revolution counter.
static uint16_t ENC_HAL_GetRevolutionHoldReg ( ENC_Type *  base)
inlinestatic

This function allows the user to read the Revolution Hold register. Contains a snapshot of the value of the revolution counter register.

Parameters
baseThe ENC module base address.
Returns
Value of revolution hold register.
uint32_t ENC_HAL_GetPosCounterReg ( ENC_Type *  base)

This function allows the user to read the Position counter.

Parameters
baseThe ENC module base address.
Returns
Value of position counter.
void ENC_HAL_SetPosCounterReg ( ENC_Type *  base,
uint32_t  posVal 
)

This function allows the user to write the Position counter.

Parameters
baseThe ENC module base address.
posValValue of position counter.
uint32_t ENC_HAL_GetPosHoldReg ( ENC_Type *  base)

This function allows the user to read the Position hold register. Contains a snapshot of the position counter register.

Parameters
baseThe ENC module base address.
Returns
Value of position hold register.
void ENC_HAL_SetInitReg ( ENC_Type *  base,
uint32_t  initValue 
)

This function allows the user to write the initialization register.

Parameters
baseThe ENC module base address.
initValueValue of initialization register.
uint32_t ENC_HAL_GetInitReg ( ENC_Type *  base)

This function allows the user to read the initialization register.

Parameters
baseThe ENC module base address.
Returns
Value of initialization register.
static bool ENC_HAL_GetRawHomeInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the raw HOME input.

Parameters
baseThe ENC module base address.
Returns
Value of the raw HOME input.
static bool ENC_HAL_GetRawIndexInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the raw INDEX input.

Parameters
baseThe ENC module base address.
Returns
Value of the raw INDEX input.
static bool ENC_HAL_GetRawPhaseBInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the raw PHASEB input.

Parameters
baseThe ENC module base address.
Returns
Value of the raw PHASEB input.
static bool ENC_HAL_GetRawPhaseAInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the raw PHASEA input.

Parameters
baseThe ENC module base address.
Returns
Value of the raw PHASEA input.
static bool ENC_HAL_GetFilteredHomeInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the filtered HOME input.

Parameters
baseThe ENC module base address.
Returns
Value of the filtered HOME input.
static bool ENC_HAL_GetFilteredIndexInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the filtered INDEX input.

Parameters
baseThe ENC module base address.
Returns
Value of the filtered INDEX input.
static bool ENC_HAL_GetFilteredPhaseBInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the filtered PHASEB input.

Parameters
baseThe ENC module base address.
Returns
Value of the filtered PHASEB input.
static bool ENC_HAL_GetFilteredPhaseAInput ( ENC_Type *  base)
inlinestatic

This function allows the user to read the value of the filtered PHASEA input.

Parameters
baseThe ENC module base address.
Returns
Value of the filtered PHASEA input.
static uint8_t ENC_HAL_GetTestCount ( ENC_Type *  base)
inlinestatic

This function allows the user to read the test count value of the test register. This value holds the number of quadrature advances to generate.

Parameters
baseThe ENC module base address.
Returns
Value of test count.
static void ENC_HAL_SetTestCount ( ENC_Type *  base,
uint8_t  testCount 
)
inlinestatic

This function allows the user to write the test count value of the test register. This value holds the number of quadrature advances to generate.

Parameters
baseThe ENC module base address.
testCountValue of test count.
static uint8_t ENC_HAL_GetTestPeriod ( ENC_Type *  base)
inlinestatic

This function allows the user to read the test period value of the test register. This value holds the period of quadrature phase in IPBus clock cycles.

Parameters
baseThe ENC module base address.
Returns
Value of test period.
static void ENC_HAL_SetTestPeriod ( ENC_Type *  base,
uint8_t  testPeriod 
)
inlinestatic

This function allows the user to write the test period value of the test register. This value holds the period of quadrature phase in IPBus clock cycles.

Parameters
baseThe ENC module base address.
testPeriodValue of test period.
static void ENC_HAL_SetNegativeTestSignalCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to set the quadrature decoder test signal. Test module can generates quadrature decoder signal in a positive or negative direction.

Parameters
baseThe ENC module base address.
enableThe type of test signal.
static bool ENC_HAL_GetNegativeTestSignalCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the test signal configuration setting.

Parameters
baseThe ENC module base address.
Returns
The type of test signal.
static void ENC_HAL_SetTestCounterCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable test counter. It connects the test counter to inputs of the quadrature decoder module.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetTestCounterCmd ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the test counter enable bit.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the test counter enable.
static void ENC_HAL_SetTestModuleCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable test module. Connects the test module to inputs of the quadrature decoder module.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetTestModuleCmd ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the test module enable bit.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the test module enable.
void ENC_HAL_SetModulusReg ( ENC_Type *  base,
uint32_t  modValue 
)

This function allows the user to write the ENC modulus register. Modulus acts as the upper bound during modulo counting and as the upper reload value when rolling over from the lower bound.

Parameters
baseThe ENC module base address.
modValueValue of modulo register.
uint32_t ENC_HAL_GetModulusReg ( ENC_Type *  base)

This function allows the user to read the ENC modulus register. Modulus acts as the upper bound during modulo counting and as the upper reload value when rolling over from the lower bound.

Parameters
baseThe ENC module base address.
Returns
Value of modulo register.
void ENC_HAL_SetCmpReg ( ENC_Type *  base,
uint32_t  cmpValue 
)

This function allows the user to write the ENC compare register. When the value of Position counter matches the value of Compare register the CTRL[CMPIRQ] flag is set and the POSMATCH output is asserted.

Parameters
baseThe ENC module base address.
cmpValueValue of modulo register.
uint32_t ENC_HAL_GetCmpReg ( ENC_Type *  base)

This function allows the user to read the ENC compare register. When the value of Position counter matches the value of Compare register the CTRL[CMPIRQ] flag is set and the POSMATCH output is asserted.

Parameters
baseThe ENC module base address.
Returns
Value of modulo register.
static void ENC_HAL_SetTriggerUpdateHoldRegCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the update hold registers on external trigger input. Updating POSDH register will also cause the POSD register to be cleared.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetTriggerUpdateHoldRegCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the update hold registers configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of update hold registers
static void ENC_HAL_SetTriggerClearPosRegCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the update of position registers on external trigger input. Allows the TRIGGER input to clear POSD, REV, UPOS and LPOS registers on rising edge.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetTriggerClearPosRegCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the update of position registers configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of update position registers
static void ENC_HAL_SetModuloCountingCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the modulo counting. It allows the position counters to count in a modulo fashion using MOD and INIT as the upper and lower bounds of the counting range.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetModuloCountingCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the modulo counting configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of modulo counting.
static void ENC_HAL_SetRollunderIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the roll-under interrupt.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetRollunderIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the roll-under interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of roll-under interrupt setting.
static bool ENC_HAL_GetRollunderIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the Roll-under interrupt request. It is set when the position counter rolls under from the INIT value to the MOD value or from 0x00000000 to 0xFFFFFFFF. It will remain set until cleared by software.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the interrupt request bit.
static void ENC_HAL_ClearRollunderIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the roll-under interrupt request bit.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetRolloverIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the roll-over interrupt.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetRolloverIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the roll-over interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of roll-over interrupt setting.
static bool ENC_HAL_GetRolloverIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the Roll-over interrupt request. It is set when the position counter rolls over the MOD value to the INIT value or from 0xFFFFFFFF to 0x00000000. It will remain set until cleared by software.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the interrupt request bit.
static void ENC_HAL_ClearRolloverIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the roll-over interrupt request bit.

Parameters
baseThe ENC module base address.
static void ENC_HAL_SetModulusRevCounterCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the modulo revolution counter. This is used to determine how the revolution counter (REV) is incremented or decremented. By default REV is controlled based on the count direction and the INDEX pulse. As an option, REV can be controlled using the roll-over/under detection during modulo counting.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetModulusRevCounterCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the modulus revolution counter configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of modulus revolution counter.
static void ENC_HAL_SetPosmatchOnReadingCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to config control of the POSMATCH output. POSMATCH pulses when the UPOS, LPOS, REV or POSD registers are read - when set true or when match occurred between position register and Compare value register (false).

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetPosmatchOnReadingCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the POSMATCH output configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of POSMATCH output setting.
static void ENC_HAL_SetSimultaneousIntCmd ( ENC_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to enable the SAB interrupt.

Parameters
baseThe ENC module base address.
enableBool parameter to enable/disable.
static bool ENC_HAL_GetSimultaneousIntCmd ( ENC_Type *  base)
inlinestatic

This function allows the user to get the SAB interrupt configuration setting.

Parameters
baseThe ENC module base address.
Returns
The state of SAB interrupt setting.
static bool ENC_HAL_GetSimultaneousIntFlag ( ENC_Type *  base)
inlinestatic

This function returns the configuration setting of the SAB interrupt request. It indicates that the PHASEA and PHASEB inputs changed simultaneously (within a single clock period). This event typically indicates an error condition because quadrature coding requires only one of these inputs to change at a time. The bit remains set until it is cleared by software or a reset.

Parameters
baseThe ENC module base address.
Returns
Bit setting of the interrupt request bit.
static void ENC_HAL_ClearSimultaneousIntFlag ( ENC_Type *  base)
inlinestatic

This function clears the SAB interrupt request bit.

Parameters
baseThe ENC module base address.