![]() |
tmr_manager
Xilinx SDK Drivers API Documentation
|
Data Structures | |
struct | XTMR_Manager_Stats |
Statistics for the XTMR_Manager driver. More... | |
struct | XTMR_Manager_Config |
This typedef contains configuration information for the device. More... | |
struct | XTMR_Manager |
The XTMR_Manager driver instance data. More... | |
Macros | |
#define | XTMR_Manager_WriteReg(BaseAddress, RegOffset, Data) XTMR_Manager_Out32((BaseAddress) + (RegOffset), (u32)(Data)) |
Write a value to a TMRManager register. More... | |
#define | XTMR_Manager_ReadReg(BaseAddress, RegOffset) XTMR_Manager_In32((BaseAddress) + (RegOffset)) |
Read a value from a TMRManager register. More... | |
#define | XTMR_Manager_SetControlReg(BaseAddress, Mask) XTMR_Manager_WriteReg((BaseAddress), XTM_CONTROL_OFFSET, (Mask)) |
Set the contents of the control register. More... | |
#define | XTMR_Manager_GetFirstFailingReg(BaseAddress) XTMR_Manager_ReadReg((BaseAddress), XTM_FFR_OFFSET) |
Get the contents of the first failing register. More... | |
#define | XTMR_Manager_ClearFirstFailingReg(BaseAddress) XTMR_Manager_WriteReg((BaseAddress), XTM_FFR_OFFSET, 0) |
Clear the contents of the first failing register. More... | |
#define | XTMR_Manager_IsLockstepMismatch(BaseAddress) |
Check to see if a lockstep mismatch has occurred. More... | |
#define | XTMR_Manager_EnableIntr(BaseAddress, Mask) XTMR_Manager_WriteReg((BaseAddress), XTM_SEMIMR_OFFSET, Mask) |
Enable the SEM interrupt. More... | |
#define | XTMR_Manager_DisableIntr(BaseAddress) XTMR_Manager_WriteReg((BaseAddress), XTM_SEMIMR_OFFSET, 0) |
Disable the SEM interrupt. More... | |
Typedefs | |
typedef void(* | XTMR_Manager_Handler )(void *CallBackRef) |
Callback function. More... | |
Functions | |
int | XTMR_Manager_CfgInitialize (XTMR_Manager *InstancePtr, XTMR_Manager_Config *Config, UINTPTR EffectiveAddr) |
Initialize a XTMR_Manager instance. More... | |
int | XTMR_Manager_Initialize (XTMR_Manager *InstancePtr, u16 DeviceId) |
Initialize a XTMR_Manager instance. More... | |
void | XTMR_Manager_SetRecoveryHandler (XTMR_Manager *InstancePtr, XTMR_Manager_Handler FuncPtr, void *CallBackRef) |
Set the user recovery handler, which can replace the pre-defined handler completely, to do custom recovery. More... | |
void | XTMR_Manager_SetPreResetHandler (XTMR_Manager *InstancePtr, XTMR_Manager_Handler FuncPtr, void *CallBackRef) |
Set the user pre-reset handler, which can be used to save context before reset in a recovery sequence. More... | |
void | XTMR_Manager_SetPostResetHandler (XTMR_Manager *InstancePtr, XTMR_Manager_Handler FuncPtr, void *CallBackRef) |
Set the user post-reset handler, which can be used to restore context after reset in a recovery sequence. More... | |
void | XTMR_Manager_GetStats (XTMR_Manager *InstancePtr, XTMR_Manager_Stats *StatsPtr) |
Returns a snapshot of the current statistics in the structure specified. More... | |
void | XTMR_Manager_ClearStats (XTMR_Manager *InstancePtr) |
This function zeros the statistics for the given instance. More... | |
void | XTMR_Manager_EnableInterrupt (XTMR_Manager *InstancePtr, u32 Mask) |
This function enables the core interrupt such that an interrupt will occur when any of the SEM status signals indicated by the mask are changed. More... | |
void | XTMR_Manager_DisableInterrupt (XTMR_Manager *InstancePtr) |
This function disables the core interrupt. More... | |
void | XTMR_Manager_SetHandler (XTMR_Manager *InstancePtr, XTMR_Manager_Handler FuncPtr, void *CallBackRef) |
This function sets the handler that will be called when an event (interrupt) occurs in the driver. More... | |
int | XTMR_Manager_SelfTest (XTMR_Manager *InstancePtr) |
Runs a self-test on the device hardware. More... | |
void | XTMR_Manager_InterruptHandler (XTMR_Manager *InstancePtr) |
This function is the interrupt handler for the TMR Manager driver. More... | |
void | XTMR_Manager_BreakHandler (XTMR_Manager *InstancePtr) |
Break occurred signalling that a recovery should be performed. More... | |
int | XTMR_Manager_ResetHandler (XTMR_Manager *InstancePtr) |
Detect and handle recovery reset or cold reset. More... | |
Variables | |
XTMR_Manager_Config | XTMR_Manager_ConfigTable [XPAR_XTMR_MANAGER_NUM_INSTANCES] |
The configuration table for TMR Manager devices. More... | |
XTMR_Manager_Config | XTMR_Manager_ConfigTable [] |
The configuration table for TMR Manager devices. More... | |
#define XTMR_Manager_ClearFirstFailingReg | ( | BaseAddress | ) | XTMR_Manager_WriteReg((BaseAddress), XTM_FFR_OFFSET, 0) |
Clear the contents of the first failing register.
BaseAddress | is the base address of the device |
Referenced by XTMR_Manager_ResetHandler().
#define XTMR_Manager_DisableIntr | ( | BaseAddress | ) | XTMR_Manager_WriteReg((BaseAddress), XTM_SEMIMR_OFFSET, 0) |
Disable the SEM interrupt.
We cannot read the SEM Interrupt Mask Register, so we just clear all bits. Since the register only defines the interrupt mask, this works without side effects.
BaseAddress | is the base address of the device |
#define XTMR_Manager_EnableIntr | ( | BaseAddress, | |
Mask | |||
) | XTMR_Manager_WriteReg((BaseAddress), XTM_SEMIMR_OFFSET, Mask) |
Enable the SEM interrupt.
We cannot read the SEM Interrupt Mask Register, so we just write the enabled interrupt bits and clear all others. Since the register only defines the interrupt mask, this works without side effects.
BaseAddress | is the base address of the device |
#define XTMR_Manager_GetFirstFailingReg | ( | BaseAddress | ) | XTMR_Manager_ReadReg((BaseAddress), XTM_FFR_OFFSET) |
Get the contents of the first failing register.
Use the XTM_FFR_* constants defined above to interpret the bit-mask returned.
BaseAddress | is the base address of the device |
Referenced by XTMR_Manager_ResetHandler().
#define XTMR_Manager_IsLockstepMismatch | ( | BaseAddress | ) |
Check to see if a lockstep mismatch has occurred.
BaseAddress | is the base address of the device |
#define XTMR_Manager_ReadReg | ( | BaseAddress, | |
RegOffset | |||
) | XTMR_Manager_In32((BaseAddress) + (RegOffset)) |
Read a value from a TMRManager register.
A 32 bit read is performed.
BaseAddress | is the base address of the TMRManager device. |
RegOffset | is the register offset from the base to read from. |
Referenced by XTMR_Manager_SelfTest().
#define XTMR_Manager_SetControlReg | ( | BaseAddress, | |
Mask | |||
) | XTMR_Manager_WriteReg((BaseAddress), XTM_CONTROL_OFFSET, (Mask)) |
Set the contents of the control register.
Use the XTM_CR_* constants defined above to create the bit-mask to be written to the register.
BaseAddress | is the base address of the device |
Mask | is the 32-bit value to write to the control register |
#define XTMR_Manager_WriteReg | ( | BaseAddress, | |
RegOffset, | |||
Data | |||
) | XTMR_Manager_Out32((BaseAddress) + (RegOffset), (u32)(Data)) |
Write a value to a TMRManager register.
A 32 bit write is performed.
BaseAddress | is the base address of the TMRManager device. |
RegOffset | is the register offset from the base to write to. |
Data | is the data written to the register. |
Referenced by XTMR_Manager_CfgInitialize(), XTMR_Manager_DisableInterrupt(), and XTMR_Manager_EnableInterrupt().
typedef void(* XTMR_Manager_Handler)(void *CallBackRef) |
Callback function.
The first argument is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked.
void XTMR_Manager_BreakHandler | ( | XTMR_Manager * | InstancePtr | ) |
Break occurred signalling that a recovery should be performed.
Call the prerecovery user handler, and then suspend the processor, to signal to the TMR Manager hardware that it should reset the TMR sub-system.
InstancePtr | is a pointer to the XTMR_Manager instance. |
int XTMR_Manager_CfgInitialize | ( | XTMR_Manager * | InstancePtr, |
XTMR_Manager_Config * | Config, | ||
UINTPTR | EffectiveAddr | ||
) |
Initialize a XTMR_Manager instance.
The receive and transmit FIFOs of the core are not flushed, so the user may want to flush them. The hardware device does not have any way to disable the receiver such that any valid data may be present in the receive FIFO. This function disables the core interrupt. The baudrate and format of the data are fixed in the hardware at hardware build time.
InstancePtr | is a pointer to the XTMR_Manager instance. |
Config | is a reference to a structure containing information about a specific TMR Manager device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. This function can initialize multiple instance objects with the use of multiple calls giving different Config information on each call. |
EffectiveAddr | is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, use Config->BaseAddress for this parameters, passing the physical address instead. |
References XTMR_Manager_Config::BrkDelayRstValue, XTMR_Manager_Config::BrkDelayWidth, XTMR_Manager_Config::ComparatorsMask, XTMR_Manager_Config::Magic1, XTMR_Manager_Config::MaskRstValue, XTMR_Manager_Config::SemInterface, XTMR_Manager_Config::TestComparator, XTMR_Manager_ClearStats(), and XTMR_Manager_WriteReg.
Referenced by XTMR_Manager_Initialize().
void XTMR_Manager_ClearStats | ( | XTMR_Manager * | InstancePtr | ) |
This function zeros the statistics for the given instance.
InstancePtr | is a pointer to the XTMR_Manager instance. |
References XTMR_Manager_Stats::InterruptCount, and XTMR_Manager_Stats::RecoveryCount.
Referenced by XTMR_Manager_CfgInitialize().
void XTMR_Manager_DisableInterrupt | ( | XTMR_Manager * | InstancePtr | ) |
This function disables the core interrupt.
After calling this function, data may still be received by the core but no interrupt will be generated since the hardware device has no way to disable the receiver.
InstancePtr | is a pointer to the XTMR_Manager instance. |
References XTMR_Manager_WriteReg.
void XTMR_Manager_EnableInterrupt | ( | XTMR_Manager * | InstancePtr, |
u32 | mask | ||
) |
This function enables the core interrupt such that an interrupt will occur when any of the SEM status signals indicated by the mask are changed.
This function enables the core interrupt such that an interrupt will occur when an unmasked SEM status input changes value.
InstancePtr | is a pointer to the XTMR_Manager instance. |
Mask | is a mask indicating bits that should give an interrupt. |
InstancePtr | is a pointer to the XTMR_Manager instance. |
References XTMR_Manager_WriteReg.
Referenced by TMR_ManagerIntrExample().
void XTMR_Manager_GetStats | ( | XTMR_Manager * | InstancePtr, |
XTMR_Manager_Stats * | StatsPtr | ||
) |
Returns a snapshot of the current statistics in the structure specified.
InstancePtr | is a pointer to the XTMR_Manager instance. |
StatsPtr | is a pointer to a XTMR_ManagerStats structure to where the statistics are to be copied. |
References XTMR_Manager_Stats::InterruptCount, and XTMR_Manager_Stats::RecoveryCount.
int XTMR_Manager_Initialize | ( | XTMR_Manager * | InstancePtr, |
u16 | DeviceId | ||
) |
Initialize a XTMR_Manager instance.
The receive and transmit FIFOs of the core are not flushed, so the user may want to flush them. The hardware device does not have any way to disable the receiver such that any valid data may be present in the receive FIFO. This function disables the core interrupt. The baudrate and format of the data are fixed in the hardware at hardware build time.
InstancePtr | is a pointer to the XTMR_Manager instance. |
DeviceId | is the unique id of the device controlled by this XTMR_Manager instance. Passing in a device id associates the generic XTMR_Manager instance to a specific device, as chosen by the caller or application developer. |
References XTMR_Manager_Config::RegBaseAddr, and XTMR_Manager_CfgInitialize().
Referenced by TMR_ManagerIntrExample(), TMR_ManagerPolledExample(), and TMR_ManagerSelfTestExample().
void XTMR_Manager_InterruptHandler | ( | XTMR_Manager * | InstancePtr | ) |
This function is the interrupt handler for the TMR Manager driver.
It must be connected to an interrupt system by the user such that it is called when an interrupt for any TMR Manager occurs. This function does not save or restore the processor context such that the user must ensure this occurs.
InstancePtr | contains a pointer to the instance of the core that the interrupt is for. |
int XTMR_Manager_ResetHandler | ( | XTMR_Manager * | InstancePtr | ) |
Detect and handle recovery reset or cold reset.
InstancePtr | is a pointer to the XTMR_Manager instance. |
References XTMR_Manager_Stats::RecoveryCount, XTMR_Manager_ClearFirstFailingReg, and XTMR_Manager_GetFirstFailingReg.
int XTMR_Manager_SelfTest | ( | XTMR_Manager * | InstancePtr | ) |
Runs a self-test on the device hardware.
Since there is no way to perform a loopback in the hardware, this test can only check the state of the status register to verify it is correct. This test assumes that the hardware device is still in its reset state, but has been initialized with the Initialize function.
InstancePtr | is a pointer to the XTMR_Manager instance. |
References XTMR_Manager_ReadReg.
Referenced by TMR_ManagerIntrExample(), TMR_ManagerPolledExample(), and TMR_ManagerSelfTestExample().
void XTMR_Manager_SetHandler | ( | XTMR_Manager * | InstancePtr, |
XTMR_Manager_Handler | FuncPtr, | ||
void * | CallBackRef | ||
) |
This function sets the handler that will be called when an event (interrupt) occurs in the driver.
The purpose of the handler is to allow application specific processing to be performed.
InstancePtr | is a pointer to the XTMR_Manager instance. |
FuncPtr | is the pointer to the callback function. |
CallBackRef | is the upper layer callback reference passed back when the callback function is invoked. |
The purpose of the handler is to allow application specific processing to be performed.
InstancePtr | is a pointer to the XTMR_Manager instance . |
FuncPtr | is the pointer to the callback function. |
CallBackRef | is the upper layer callback reference passed back when the callback function is invoked. |
void XTMR_Manager_SetPostResetHandler | ( | XTMR_Manager * | InstancePtr, |
XTMR_Manager_Handler | FuncPtr, | ||
void * | CallBackRef | ||
) |
Set the user post-reset handler, which can be used to restore context after reset in a recovery sequence.
InstancePtr | is a pointer to the XTMR_Manager instance. |
void XTMR_Manager_SetPreResetHandler | ( | XTMR_Manager * | InstancePtr, |
XTMR_Manager_Handler | FuncPtr, | ||
void * | CallBackRef | ||
) |
Set the user pre-reset handler, which can be used to save context before reset in a recovery sequence.
InstancePtr | is a pointer to the XTMR_Manager instance. |
void XTMR_Manager_SetRecoveryHandler | ( | XTMR_Manager * | InstancePtr, |
XTMR_Manager_Handler | FuncPtr, | ||
void * | CallBackRef | ||
) |
Set the user recovery handler, which can replace the pre-defined handler completely, to do custom recovery.
InstancePtr | is a pointer to the XTMR_Manager instance. |
XTMR_Manager_Config XTMR_Manager_ConfigTable[XPAR_XTMR_MANAGER_NUM_INSTANCES] |
The configuration table for TMR Manager devices.
XTMR_Manager_Config XTMR_Manager_ConfigTable[] |
The configuration table for TMR Manager devices.