| scutimer Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Functions | Variables
Overview

## Data Structures
struct | XScuTimer_Config
| This typedef contains configuration information for the device. More...
struct | XScuTimer
| The XScuTimer driver instance data. More...

## Macros
#define | XScuTimer_IsExpired(InstancePtr)
| Check if the timer has expired. More...
#define | XScuTimer_RestartTimer(InstancePtr)
| Re-start the timer. More...
#define | XScuTimer_LoadTimer(InstancePtr, Value)
| Write to the timer load register. More...
#define | XScuTimer_GetCounterValue(InstancePtr)
| Returns the current timer counter register value. More...
#define | XScuTimer_EnableAutoReload(InstancePtr)
| Enable auto-reload mode. More...
#define | XScuTimer_DisableAutoReload(InstancePtr)
| Disable auto-reload mode. More...
#define | XScuTimer_EnableInterrupt(InstancePtr)
| Enable the Timer interrupt. More...
#define | XScuTimer_DisableInterrupt(InstancePtr)
| Disable the Timer interrupt. More...
#define | XScuTimer_GetInterruptStatus(InstancePtr)
| This function reads the interrupt status. More...
#define | XScuTimer_ClearInterruptStatus(InstancePtr)
| This function clears the interrupt status. More...
#define | XScuTimer_SetLoadReg(BaseAddr, Value) XScuTimer_WriteReg(BaseAddr, XSCUTIMER_LOAD_OFFSET, (Value))
| Write to the timer load register. More...
#define | XScuTimer_GetLoadReg(BaseAddr) XScuTimer_ReadReg(BaseAddr, XSCUTIMER_LOAD_OFFSET)
| Returns the current timer load register value. More...
#define | XScuTimer_SetCounterReg(BaseAddr, Value) XScuTimer_WriteReg(BaseAddr, XSCUTIMER_COUNTER_OFFSET, (Value))
| Write to the timer counter register. More...
#define | XScuTimer_GetCounterReg(BaseAddr) XScuTimer_ReadReg(BaseAddr, XSCUTIMER_COUNTER_OFFSET)
| Returns the current timer counter register value. More...
#define | XScuTimer_SetControlReg(BaseAddr, Value) XScuTimer_WriteReg(BaseAddr, XSCUTIMER_CONTROL_OFFSET, (Value))
| Write to the timer load register. More...
#define | XScuTimer_GetControlReg(BaseAddr) XScuTimer_ReadReg(BaseAddr, XSCUTIMER_CONTROL_OFFSET)
| Returns the current timer load register value. More...
#define | XScuTimer_SetIntrReg(BaseAddr, Value) XScuTimer_WriteReg(BaseAddr, XSCUTIMER_ISR_OFFSET, (Value))
| Write to the timer counter register. More...
#define | XScuTimer_GetIntrReg(BaseAddr) XScuTimer_ReadReg(BaseAddr, XSCUTIMER_ISR_OFFSET)
| Returns the current timer counter register value. More...
#define | XScuTimer_ReadReg(BaseAddr, RegOffset) Xil_In32((BaseAddr) + (RegOffset))
| Read from the given Timer register. More...
#define | XScuTimer_WriteReg(BaseAddr, RegOffset, Data) Xil_Out32((BaseAddr) + (RegOffset), (Data))
| Write to the given Timer register. More...

## Functions
s32 | XScuTimer_CfgInitialize (XScuTimer *InstancePtr, XScuTimer_Config *ConfigPtr, u32 EffectiveAddress)
| Initialize a specific timer instance/driver. More...
void | XScuTimer_Start (XScuTimer *InstancePtr)
| Start the timer. More...
void | XScuTimer_Stop (XScuTimer *InstancePtr)
| Stop the timer. More...
void | XScuTimer_SetPrescaler (XScuTimer *InstancePtr, u8 PrescalerValue)
| This function sets the prescaler bits in the timer control register. More...
u8 | XScuTimer_GetPrescaler (XScuTimer *InstancePtr)
| This function returns the current prescaler value. More...
XScuTimer_Config * | XScuTimer_LookupConfig (u16 DeviceId)
| Lookup the device configuration based on the unique device ID. More...
s32 | XScuTimer_SelfTest (XScuTimer *InstancePtr)
| Run a self-test on the timer. More...

## Variables
XScuTimer_Config | XScuTimer_ConfigTable [XPAR_XSCUTIMER_NUM_INSTANCES]
| This table contains configuration information for each timer device in the system. More...
XScuTimer_Config | XScuTimer_ConfigTable [XPAR_XSCUTIMER_NUM_INSTANCES]
| This table contains configuration information for each timer device in the system. More...

## Register Map
Offsets of registers from the start of the device
#define | XSCUTIMER_LOAD_OFFSET 0x00U
| Timer Load Register. More...
#define | XSCUTIMER_COUNTER_OFFSET 0x04U
| Timer Counter Register. More...
#define | XSCUTIMER_CONTROL_OFFSET 0x08U
| Timer Control Register. More...
#define | XSCUTIMER_ISR_OFFSET 0x0CU
| Timer Interrupt Status Register. More...

## Timer Control register
This register bits control the prescaler, Intr enable, auto-reload and timer enable.
#define | XSCUTIMER_CONTROL_PRESCALER_MASK 0x0000FF00U
| Prescaler. More...
#define | XSCUTIMER_CONTROL_PRESCALER_SHIFT 8U
#define | XSCUTIMER_CONTROL_IRQ_ENABLE_MASK 0x00000004U
| Intr enable. More...
#define | XSCUTIMER_CONTROL_AUTO_RELOAD_MASK 0x00000002U
| Auto-reload. More...
#define | XSCUTIMER_CONTROL_ENABLE_MASK 0x00000001U
| Timer enable. More...

## Interrupt Status register
This register indicates the Timer counter register has reached zero.
#define | XSCUTIMER_ISR_EVENT_FLAG_MASK 0x00000001U
| Event flag. More...

## Macro Definition Documentation

#define XScuTimer_ClearInterruptStatus | ( |  | InstancePtr | ) |

Value:
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_ISR_OFFSET, XSCUTIMER_ISR_EVENT_FLAG_MASK)
XSCUTIMER_ISR_OFFSET
#define XSCUTIMER_ISR_OFFSET
Timer Interrupt Status Register.
Definition: xscutimer_hw.h:53
XScuTimer_WriteReg
#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data)
Write to the given Timer register.
Definition: xscutimer_hw.h:251
XSCUTIMER_ISR_EVENT_FLAG_MASK
#define XSCUTIMER_ISR_EVENT_FLAG_MASK
Event flag.
Definition: xscutimer_hw.h:76

This function clears the interrupt status.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_ClearInterruptStatus(XScuTimer *InstancePtr)

#define XSCUTIMER_CONTROL_AUTO_RELOAD_MASK 0x00000002U

Auto-reload.

#define XSCUTIMER_CONTROL_ENABLE_MASK 0x00000001U

Timer enable.

Referenced by XScuTimer_SelfTest(), XScuTimer_Start(), and XScuTimer_Stop().

#define XSCUTIMER_CONTROL_IRQ_ENABLE_MASK 0x00000004U

Intr enable.

#define XSCUTIMER_CONTROL_OFFSET 0x08U

Timer Control Register.

Referenced by XScuTimer_GetPrescaler(), XScuTimer_SelfTest(), XScuTimer_SetPrescaler(), XScuTimer_Start(), and XScuTimer_Stop().

#define XSCUTIMER_CONTROL_PRESCALER_MASK 0x0000FF00U

Prescaler.

Referenced by XScuTimer_GetPrescaler(), and XScuTimer_SetPrescaler().

#define XSCUTIMER_COUNTER_OFFSET 0x04U

Timer Counter Register.

#define XScuTimer_DisableAutoReload | ( |  | InstancePtr | ) |

Value:
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET, \
(XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET) & \
~(XSCUTIMER_CONTROL_AUTO_RELOAD_MASK)))
XScuTimer_WriteReg
#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data)
Write to the given Timer register.
Definition: xscutimer_hw.h:251
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233
XSCUTIMER_CONTROL_AUTO_RELOAD_MASK
#define XSCUTIMER_CONTROL_AUTO_RELOAD_MASK
Auto-reload.
Definition: xscutimer_hw.h:67
XSCUTIMER_CONTROL_OFFSET
#define XSCUTIMER_CONTROL_OFFSET
Timer Control Register.
Definition: xscutimer_hw.h:52

Disable auto-reload mode.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_DisableAutoReload(XScuTimer *InstancePtr)

#define XScuTimer_DisableInterrupt | ( |  | InstancePtr | ) |

Value:
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET, \
(XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET) & \
~(XSCUTIMER_CONTROL_IRQ_ENABLE_MASK)))
XScuTimer_WriteReg
#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data)
Write to the given Timer register.
Definition: xscutimer_hw.h:251
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233
XSCUTIMER_CONTROL_OFFSET
#define XSCUTIMER_CONTROL_OFFSET
Timer Control Register.
Definition: xscutimer_hw.h:52
XSCUTIMER_CONTROL_IRQ_ENABLE_MASK
#define XSCUTIMER_CONTROL_IRQ_ENABLE_MASK
Intr enable.
Definition: xscutimer_hw.h:66

Disable the Timer interrupt.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_DisableInterrupt(XScuTimer *InstancePtr)

#define XScuTimer_EnableAutoReload | ( |  | InstancePtr | ) |

Value:
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET, \
(XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET) | \
XSCUTIMER_CONTROL_AUTO_RELOAD_MASK))
XScuTimer_WriteReg
#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data)
Write to the given Timer register.
Definition: xscutimer_hw.h:251
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233
XSCUTIMER_CONTROL_AUTO_RELOAD_MASK
#define XSCUTIMER_CONTROL_AUTO_RELOAD_MASK
Auto-reload.
Definition: xscutimer_hw.h:67
XSCUTIMER_CONTROL_OFFSET
#define XSCUTIMER_CONTROL_OFFSET
Timer Control Register.
Definition: xscutimer_hw.h:52

Enable auto-reload mode.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_EnableAutoReload(XScuTimer *InstancePtr)

Referenced by ScuTimerIntrExample().

#define XScuTimer_EnableInterrupt | ( |  | InstancePtr | ) |

Value:
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET, \
(XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_CONTROL_OFFSET) | \
XSCUTIMER_CONTROL_IRQ_ENABLE_MASK))
XScuTimer_WriteReg
#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data)
Write to the given Timer register.
Definition: xscutimer_hw.h:251
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233
XSCUTIMER_CONTROL_OFFSET
#define XSCUTIMER_CONTROL_OFFSET
Timer Control Register.
Definition: xscutimer_hw.h:52
XSCUTIMER_CONTROL_IRQ_ENABLE_MASK
#define XSCUTIMER_CONTROL_IRQ_ENABLE_MASK
Intr enable.
Definition: xscutimer_hw.h:66

Enable the Timer interrupt.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_EnableInterrupt(XScuTimer *InstancePtr)

Referenced by ScuTimerIntrExample().

#define XScuTimer_GetControlReg | ( |  | BaseAddr | ) | XScuTimer_ReadReg(BaseAddr, XSCUTIMER_CONTROL_OFFSET)

Returns the current timer load register value.

Parameters

  BaseAddr | is the base address of the scu timer.

Returns
  Contents of the timer load register.

Note
  C-style signature: u32 XScuTimer_GetControlReg(u32 BaseAddr)

#define XScuTimer_GetCounterReg | ( |  | BaseAddr | ) | XScuTimer_ReadReg(BaseAddr, XSCUTIMER_COUNTER_OFFSET)

Returns the current timer counter register value.

Parameters

  BaseAddr | is the base address of the scu timer.

Returns
  Contents of the timer counter register.

Note
  C-style signature: u32 XScuTimer_GetCounterReg(u32 BaseAddr)

#define XScuTimer_GetCounterValue | ( |  | InstancePtr | ) |

Value:
XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_COUNTER_OFFSET)
XSCUTIMER_COUNTER_OFFSET
#define XSCUTIMER_COUNTER_OFFSET
Timer Counter Register.
Definition: xscutimer_hw.h:51
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233

Returns the current timer counter register value.

It can be called at any time.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  Contents of the timer counter register.

Note
  C-style signature: u32 XScuTimer_GetCounterValue(XScuTimer *InstancePtr)

Referenced by ScuTimerPolledExample().

#define XScuTimer_GetInterruptStatus | ( |  | InstancePtr | ) |

Value:
XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_ISR_OFFSET)
XSCUTIMER_ISR_OFFSET
#define XSCUTIMER_ISR_OFFSET
Timer Interrupt Status Register.
Definition: xscutimer_hw.h:53
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233

This function reads the interrupt status.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_GetInterruptStatus(XScuTimer *InstancePtr)

#define XScuTimer_GetIntrReg | ( |  | BaseAddr | ) | XScuTimer_ReadReg(BaseAddr, XSCUTIMER_ISR_OFFSET)

Returns the current timer counter register value.

Parameters

  BaseAddr | is the base address of the scu timer.

Returns
  Contents of the timer counter register.

Note
  C-style signature: u32 XScuTimer_GetIntrReg(u32 BaseAddr)

#define XScuTimer_GetLoadReg | ( |  | BaseAddr | ) | XScuTimer_ReadReg(BaseAddr, XSCUTIMER_LOAD_OFFSET)

Returns the current timer load register value.

Parameters

  BaseAddr | is the base address of the scu timer.

Returns
  Contents of the timer load register.

Note
  C-style signature: u32 XScuTimer_GetLoadReg(u32 BaseAddr)

#define XScuTimer_IsExpired | ( |  | InstancePtr | ) |

Value:
((XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_ISR_OFFSET) & \
XSCUTIMER_ISR_EVENT_FLAG_MASK) == \
XSCUTIMER_ISR_EVENT_FLAG_MASK)
XSCUTIMER_ISR_OFFSET
#define XSCUTIMER_ISR_OFFSET
Timer Interrupt Status Register.
Definition: xscutimer_hw.h:53
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233
XSCUTIMER_ISR_EVENT_FLAG_MASK
#define XSCUTIMER_ISR_EVENT_FLAG_MASK
Event flag.
Definition: xscutimer_hw.h:76

Check if the timer has expired.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  - TRUE if the timer has expired.
  - FALSE if the timer has not expired.

Note
  C-style signature: int XScuTimer_IsExpired(XScuTimer *InstancePtr)

#define XSCUTIMER_ISR_EVENT_FLAG_MASK 0x00000001U

Event flag.

#define XSCUTIMER_ISR_OFFSET 0x0CU

Timer Interrupt Status Register.

#define XSCUTIMER_LOAD_OFFSET 0x00U

Timer Load Register.

Referenced by XScuTimer_SelfTest().

#define XScuTimer_LoadTimer | ( |  | InstancePtr,
|  |  | Value
| ) |  |

Value:
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_LOAD_OFFSET, (Value))
XSCUTIMER_LOAD_OFFSET
#define XSCUTIMER_LOAD_OFFSET
Timer Load Register.
Definition: xscutimer_hw.h:50
XScuTimer_WriteReg
#define XScuTimer_WriteReg(BaseAddr, RegOffset, Data)
Write to the given Timer register.
Definition: xscutimer_hw.h:251

Write to the timer load register.

This will also update the timer counter register with the new value. This macro can be used to change the time-out value.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.
  Value | is the count to be loaded in to the load register.

Returns
  None.

Note
  C-style signature: void XScuTimer_LoadTimer(XScuTimer *InstancePtr, u32 Value)

Referenced by ScuTimerIntrExample(), ScuTimerPolledExample(), and XScuTimer_SelfTest().

#define XScuTimer_ReadReg | ( |  | BaseAddr,
|  |  | RegOffset
| ) |  | Xil_In32((BaseAddr) + (RegOffset))

Read from the given Timer register.

Parameters

  BaseAddr | is the base address of the device
  RegOffset | is the register offset to be read

Returns
  The 32-bit value of the register

Note
  C-style signature: u32 XScuTimer_ReadReg(u32 BaseAddr, u32 RegOffset)

Referenced by XScuTimer_GetPrescaler(), XScuTimer_SelfTest(), XScuTimer_SetPrescaler(), XScuTimer_Start(), and XScuTimer_Stop().

#define XScuTimer_RestartTimer | ( |  | InstancePtr | ) |

Value:
XScuTimer_LoadTimer((InstancePtr), \
XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \
XSCUTIMER_LOAD_OFFSET))
XScuTimer_LoadTimer
#define XScuTimer_LoadTimer(InstancePtr, Value)
Write to the timer load register.
Definition: xscutimer.h:193
XSCUTIMER_LOAD_OFFSET
#define XSCUTIMER_LOAD_OFFSET
Timer Load Register.
Definition: xscutimer_hw.h:50
XScuTimer_ReadReg
#define XScuTimer_ReadReg(BaseAddr, RegOffset)
Read from the given Timer register.
Definition: xscutimer_hw.h:233

Re-start the timer.

This macro will read the timer load register and writes the same value to load register to update the counter register.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  C-style signature: void XScuTimer_RestartTimer(XScuTimer *InstancePtr)

#define XScuTimer_SetControlReg | ( |  | BaseAddr,
|  |  | Value
| ) |  | XScuTimer_WriteReg(BaseAddr, XSCUTIMER_CONTROL_OFFSET, (Value))

Write to the timer load register.

This will also update the timer counter register with the new value. This macro can be used to change the time-out value.

Parameters

  BaseAddr | is the base address of the scu timer.
  Value | is the count to be loaded in to the load register.

Returns
  None.

Note
  C-style signature: void XScuTimer_SetControlReg(u32 BaseAddr, u32 Value)

#define XScuTimer_SetCounterReg | ( |  | BaseAddr,
|  |  | Value
| ) |  | XScuTimer_WriteReg(BaseAddr, XSCUTIMER_COUNTER_OFFSET, (Value))

Write to the timer counter register.

Parameters

  BaseAddr | is the base address of the scu timer.
  Value | is the count to be loaded in to the counter register.

Returns
  None.

Note
  C-style signature: void XScuTimer_SetCounterReg(u32 BaseAddr, u32 Value)

#define XScuTimer_SetIntrReg | ( |  | BaseAddr,
|  |  | Value
| ) |  | XScuTimer_WriteReg(BaseAddr, XSCUTIMER_ISR_OFFSET, (Value))

Write to the timer counter register.

Parameters

  BaseAddr | is the base address of the scu timer.
  Value | is the count to be loaded in to the counter register.

Returns
  None.

Note
  C-style signature: void XScuTimer_SetIntrReg(u32 BaseAddr, u32 Value)

#define XScuTimer_SetLoadReg | ( |  | BaseAddr,
|  |  | Value
| ) |  | XScuTimer_WriteReg(BaseAddr, XSCUTIMER_LOAD_OFFSET, (Value))

Write to the timer load register.

This will also update the timer counter register with the new value. This macro can be used to change the time-out value.

Parameters

  BaseAddr | is the base address of the scu timer.
  Value | is the count to be loaded in to the load register.

Returns
  None.

Note
  C-style signature: void XScuTimer_SetLoadReg(u32 BaseAddr, u32 Value)

#define XScuTimer_WriteReg | ( |  | BaseAddr,
|  |  | RegOffset,
|  |  | Data
| ) |  | Xil_Out32((BaseAddr) + (RegOffset), (Data))

Write to the given Timer register.

Parameters

  BaseAddr | is the base address of the device
  RegOffset | is the register offset to be written
  Data | is the 32-bit value to write to the register

Returns
  None.

Note
  C-style signature: void XScuTimer_WriteReg(u32 BaseAddr, u32 RegOffset, u32 Data)

Referenced by XScuTimer_SelfTest(), XScuTimer_SetPrescaler(), XScuTimer_Start(), and XScuTimer_Stop().

## Function Documentation

s32 XScuTimer_CfgInitialize | ( | XScuTimer * | InstancePtr,
|  | XScuTimer_Config * | ConfigPtr,
|  | u32 | EffectiveAddress
| ) |  |

Initialize a specific timer instance/driver.

This function must be called before other functions of the driver are called.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.
  ConfigPtr | points to the XScuTimer configuration structure.
  EffectiveAddress | is the base address for the device. It could be a virtual address if address translation is supported in the system, otherwise it is the physical address.

Returns
  - XST_SUCCESS if initialization was successful.
  - XST_DEVICE_IS_STARTED if the device has already been started.

Note
  None.

References XScuTimer_Config::BaseAddr, XScuTimer::Config, XScuTimer_Config::DeviceId, XScuTimer::IsReady, and XScuTimer::IsStarted.

Referenced by ScuTimerIntrExample(), and ScuTimerPolledExample().

u8 XScuTimer_GetPrescaler | ( | XScuTimer * | InstancePtr | ) |

This function returns the current prescaler value.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  The prescaler value.

Note
  None.

References XScuTimer_Config::BaseAddr, XScuTimer::Config, XScuTimer::IsReady, XSCUTIMER_CONTROL_OFFSET, XSCUTIMER_CONTROL_PRESCALER_MASK, and XScuTimer_ReadReg.

XScuTimer_Config * XScuTimer_LookupConfig | ( | u16 | DeviceId | ) |

Lookup the device configuration based on the unique device ID.

The table contains the configuration info for each device in the system.

Parameters

  DeviceId | is the unique device ID of the device being looked up.

Returns
  A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.

Note
  None.

Referenced by ScuTimerIntrExample(), and ScuTimerPolledExample().

s32 XScuTimer_SelfTest | ( | XScuTimer * | InstancePtr | ) |

Run a self-test on the timer.

This test clears the timer enable bit in the control register, writes to the timer load register and verifies the value read back matches the value written and restores the control register and the timer load register.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  - XST_SUCCESS if self-test was successful.
  - XST_FAILURE if self test was not successful.

Note
  None.

References XScuTimer_Config::BaseAddr, XScuTimer::Config, XScuTimer::IsReady, XSCUTIMER_CONTROL_ENABLE_MASK, XSCUTIMER_CONTROL_OFFSET, XSCUTIMER_LOAD_OFFSET, XScuTimer_LoadTimer, XScuTimer_ReadReg, and XScuTimer_WriteReg.

Referenced by ScuTimerIntrExample().

void XScuTimer_SetPrescaler | ( | XScuTimer * | InstancePtr,
|  | u8 | PrescalerValue
| ) |  |

This function sets the prescaler bits in the timer control register.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.
  PrescalerValue | is a 8 bit value that sets the prescaler to use.

Returns
  None

Note
  None

References XScuTimer_Config::BaseAddr, XScuTimer::Config, XScuTimer::IsReady, XSCUTIMER_CONTROL_OFFSET, XSCUTIMER_CONTROL_PRESCALER_MASK, XScuTimer_ReadReg, and XScuTimer_WriteReg.

void XScuTimer_Start | ( | XScuTimer * | InstancePtr | ) |

Start the timer.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  None.

References XScuTimer_Config::BaseAddr, XScuTimer::Config, XScuTimer::IsReady, XScuTimer::IsStarted, XSCUTIMER_CONTROL_ENABLE_MASK, XSCUTIMER_CONTROL_OFFSET, XScuTimer_ReadReg, and XScuTimer_WriteReg.

Referenced by ScuTimerIntrExample(), and ScuTimerPolledExample().

void XScuTimer_Stop | ( | XScuTimer * | InstancePtr | ) |

Stop the timer.

Parameters

  InstancePtr | is a pointer to the XScuTimer instance.

Returns
  None.

Note
  None.

References XScuTimer_Config::BaseAddr, XScuTimer::Config, XScuTimer::IsReady, XScuTimer::IsStarted, XSCUTIMER_CONTROL_ENABLE_MASK, XSCUTIMER_CONTROL_OFFSET, XScuTimer_ReadReg, and XScuTimer_WriteReg.

Referenced by ScuTimerIntrExample(), and ScuTimerPolledExample().

## Variable Documentation

XScuTimer_Config XScuTimer_ConfigTable[XPAR_XSCUTIMER_NUM_INSTANCES]

This table contains configuration information for each timer device in the system.

XScuTimer_Config XScuTimer_ConfigTable[XPAR_XSCUTIMER_NUM_INSTANCES]

Initial value:
= {
{
(u16)XPAR_XSCUTIMER_0_DEVICE_ID,
(u32)XPAR_XSCUTIMER_0_BASEADDR
}
}

This table contains configuration information for each timer device in the system.