Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
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... | |
enum enc_status_t |
enum enc_operation_mode_t |
enum enc_status_flag_t |
enum enc_int_source_t |
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.
base | The ENC peripheral base address. |
|
inlinestatic |
This function allows the user to enable/disable compare interrupt.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the compare interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the compare interrupt request bit.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the watchdog configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable watchdog timeout interrupt.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the watchdog timeout interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the watchdog timeout interrupt request bit.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to set the type of INDEX pulse edge used to initialize the position counter.
base | The ENC module base address. |
enable | The edge type of INDEX pulse input. |
|
inlinestatic |
This function allows the user to get the type of INDEX pulse edge.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable INDEX pulse to initialize position counters UPOS and LPOS.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the INDEX to initialize position counters configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable the INDEX pulse interrupt.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the INDEX pulse interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the INDEX pulse interrupt request bit.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the signal phase counter mode configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the counting type configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | The edge type of HOME input signal. |
|
inlinestatic |
This function allows the user to get the HOME input signal edge configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable HOME signal to initialize position counters UPOS and LPOS.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the HOME signal input init configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable the HOME signal interrupt.
base | The ENC module base address |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the HOME signal interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the HOME signal interrupt request bit.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
sampleCount | Value that represents the number of consecutive samples. |
|
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.
base | The ENC module base address. |
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.
base | The ENC module base address. |
samplePeriod | Value of filter sample period. |
|
inlinestatic |
This function allows the user to read the input filter sample period. This value represents the sampling period of the decoder input signals.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
wdtTimeout | Value of watchdog timeout. |
|
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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
diffPosition | Value of position difference. |
|
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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to write the Revolution counter.
base | The ENC module base address. |
revValue | Value of revolution. |
|
inlinestatic |
This function allows the user to read the Revolution counter.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the Revolution Hold register. Contains a snapshot of the value of the revolution counter register.
base | The ENC module base address. |
uint32_t ENC_HAL_GetPosCounterReg | ( | ENC_Type * | base | ) |
This function allows the user to read the Position counter.
base | The ENC module base address. |
void ENC_HAL_SetPosCounterReg | ( | ENC_Type * | base, |
uint32_t | posVal | ||
) |
This function allows the user to write the Position counter.
base | The ENC module base address. |
posVal | Value 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.
base | The ENC module base address. |
void ENC_HAL_SetInitReg | ( | ENC_Type * | base, |
uint32_t | initValue | ||
) |
This function allows the user to write the initialization register.
base | The ENC module base address. |
initValue | Value of initialization register. |
uint32_t ENC_HAL_GetInitReg | ( | ENC_Type * | base | ) |
This function allows the user to read the initialization register.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the raw HOME input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the raw INDEX input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the raw PHASEB input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the raw PHASEA input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the filtered HOME input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the filtered INDEX input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the filtered PHASEB input.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to read the value of the filtered PHASEA input.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
testCount | Value of test count. |
|
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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
testPeriod | Value of test period. |
|
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.
base | The ENC module base address. |
enable | The type of test signal. |
|
inlinestatic |
This function allows the user to get the test signal configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable test counter. It connects the test counter to inputs of the quadrature decoder module.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function returns the configuration setting of the test counter enable bit.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable test module. Connects the test module to inputs of the quadrature decoder module.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function returns the configuration setting of the test module enable bit.
base | The ENC module base address. |
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.
base | The ENC module base address. |
modValue | Value 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.
base | The ENC module base address. |
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.
base | The ENC module base address. |
cmpValue | Value 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.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the update hold registers configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the update of position registers configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the modulo counting configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable the roll-under interrupt.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the roll-under interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the roll-under interrupt request bit.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable the roll-over interrupt.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the roll-over interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the roll-over interrupt request bit.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the modulus revolution counter configuration setting.
base | The ENC module base address. |
|
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).
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the POSMATCH output configuration setting.
base | The ENC module base address. |
|
inlinestatic |
This function allows the user to enable the SAB interrupt.
base | The ENC module base address. |
enable | Bool parameter to enable/disable. |
|
inlinestatic |
This function allows the user to get the SAB interrupt configuration setting.
base | The ENC module base address. |
|
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.
base | The ENC module base address. |
|
inlinestatic |
This function clears the SAB interrupt request bit.
base | The ENC module base address. |