| resetps Vitis Drivers API Documentation

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

Data Structures | Macros | Enumerations | Functions | Variables
Overview

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

## Macros
#define | XRESETPS_SUPPORTED_ACT(ResetSupport, PulseSupport, AssertSupport) ((ResetSupport << 2) | (PulseSupport << 1) | AssertSupport)
| Set supported reset action. More...
#define | XRESETPS_CHK_ASSERT_SUPPORT(Actions) ((Actions & 0x1))
| Check if assert/dessert reset is supported. More...
#define | XRESETPS_CHK_PULSE_SUPPORT(Actions) ((Actions & 0x2) >> 1)
| Check if pulse reset is supported. More...
#define | XRESETPS_CHK_STATUS_SUPPORT(Actions) ((Actions & 0x4) >> 2)
| Check if Status check is supported. More...
#define | XResetPs_ReadReg(RegAddress) Xil_In32((u32)RegAddress)
| Read the given register. More...
#define | XResetPs_WriteReg(RegAddress, Data) Xil_Out32((u32)RegAddress, (u32)Data)
| Write the given register. More...

## Enumerations
enum | XResetPs_PulseTypes { XRESETPS_PT_NO_DLY_NO_PSCHK, XRESETPS_PT_DLY_NO_PSCHK, XRESETPS_PT_DLY_PSCHK, XRESETPS_PT_INVALID }
| This typedef defines type of pulse reset to be executed for peripherals. More...
enum | XresetPs_ResetAction
| This typedef defines reset actions on the peripherals. More...
enum | XResetPs_RstId
| This typedef defines resetIDs of peripherals maps to PMUFW resetIDs. More...
enum | XResetPs_RstStatus
| This typedef defines possible values for reset status of peripherals. More...

## Functions
XStatus | XResetPs_CfgInitialize (XResetPs *InstancePtr, XResetPs_Config *ConfigPtr)
| Initialize a specific reset controller instance/driver. More...
XStatus | XResetPs_ResetAssert (XResetPs *InstancePtr, const XResetPs_RstId ResetID)
| Assert reset for specific peripheral based on reset ID. More...
XStatus | XResetPs_ResetDeassert (XResetPs *InstancePtr, const XResetPs_RstId ResetID)
| Deassert reset for specific peripheral based on reset ID. More...
XStatus | XResetPs_ResetPulse (XResetPs *InstancePtr, const XResetPs_RstId ResetID)
| Pulse reset for specific peripheral based on reset ID. More...
XStatus | XResetPs_ResetStatus (XResetPs *InstancePtr, const XResetPs_RstId ResetID, XResetPs_RstStatus *Status)
| Get reset status for specific peripheral based on reset ID. More...
XResetPs_Config * | XResetPs_LookupConfig (u16 DeviceId)
| Lookup the device configuration based on the unique device ID. More...

## Variables
XResetPs_Config | XResetPs_ConfigTable [XPAR_XRESETPS_NUM_INSTANCES]
| This table contains configuration information for each reset controller device in the system. More...
XResetPs_Config | XResetPs_ConfigTable [XPAR_XRESETPS_NUM_INSTANCES]
| This table contains configuration information for each reset controller device in the system. More...

## Macro Definition Documentation

#define XRESETPS_CHK_ASSERT_SUPPORT | ( |  | Actions | ) | ((Actions & 0x1))

Check if assert/dessert reset is supported.

Parameters

  Actions | is supported reset actions

Returns
  1 - Supported 0 - Not Supported

Note
  None.

Referenced by XResetPs_ResetAssert(), and XResetPs_ResetDeassert().

#define XRESETPS_CHK_PULSE_SUPPORT | ( |  | Actions | ) | ((Actions & 0x2) >> 1)

Check if pulse reset is supported.

Parameters

  Actions | is supported reset actions

Returns
  1 - Supported 0 - Not Supported

Note
  None.

Referenced by XResetPs_ResetPulse().

#define XRESETPS_CHK_STATUS_SUPPORT | ( |  | Actions | ) | ((Actions & 0x4) >> 2)

Check if Status check is supported.

Parameters

  Actions | is supported reset actions

Returns
  1 - Supported 0 - Not Supported

Note
  None.

Referenced by XResetPs_ResetStatus().

#define XResetPs_ReadReg | ( |  | RegAddress | ) | Xil_In32((u32)RegAddress)

Read the given register.

Parameters

  RegAddress | is the address of the register to read

Returns
  The 32-bit value of the register

Note
  None.

Referenced by XResetPs_ResetAssert(), XResetPs_ResetDeassert(), XResetPs_ResetPulse(), and XResetPs_ResetStatus().

#define XRESETPS_SUPPORTED_ACT | ( |  | ResetSupport,
|  |  | PulseSupport,
|  |  | AssertSupport
| ) |  | ((ResetSupport << 2) | (PulseSupport << 1) | AssertSupport)

Set supported reset action.

Parameters

  ResetSupport | indicates if reset status check is supported
  PulseSupport | indicates if pulse reset action is supported
  AssertSupport | indicates if reset assert/deassert is supported

Returns
  Supported reset actions

Note
  Here bit fields are used decide supported actions as defined below: BIT 1 - Assert/Deassert BIT 2 - Pulse BIT 3 - Reset status Bit set indicates corresponding action is supported and vice versa.

#define XResetPs_WriteReg | ( |  | RegAddress,
|  |  | Data
| ) |  | Xil_Out32((u32)RegAddress, (u32)Data)

Write the given register.

Parameters

  RegAddress | is the address of the register to write
  Data | is the 32-bit value to write to the register

Returns
  None.

Note
  None.

Referenced by XResetPs_ResetAssert(), XResetPs_ResetDeassert(), and XResetPs_ResetPulse().

## Enumeration Type Documentation

enum XResetPs_PulseTypes

This typedef defines type of pulse reset to be executed for peripherals.

3 type of pulse reset are possible:

1. Pulse with no delay and no power state validation
2. Pulse with delay but no power state validation
3. Pulse with delay and power state validation

Enumerator
XRESETPS_PT_NO_DLY_NO_PSCHK | No delay, no power state check.
XRESETPS_PT_DLY_NO_PSCHK | Delay, no power state check.
XRESETPS_PT_DLY_PSCHK | Delay, power state check.
XRESETPS_PT_INVALID | Invalid pulse type.

enum XresetPs_ResetAction

This typedef defines reset actions on the peripherals.

enum XResetPs_RstId

This typedef defines resetIDs of peripherals maps to PMUFW resetIDs.

This resetIDs are not offsetted by 1000 and are relative.

enum XResetPs_RstStatus

This typedef defines possible values for reset status of peripherals.

## Function Documentation

XStatus XResetPs_CfgInitialize | ( | XResetPs * | InstancePtr,
|  | XResetPs_Config * | ConfigPtr
| ) |  |

Initialize a specific reset controller instance/driver.

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

Parameters

  InstancePtr | is a pointer to the XResetPs instance.
  ConfigPtr | is the config structure.

Returns
  - XST_SUCCESS if initialization was successful.

Note
  None.

References XResetPs::Config, and XResetPs_Config::DeviceId.

XResetPs_Config * XResetPs_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.

XStatus XResetPs_ResetAssert | ( | XResetPs * | InstancePtr,
|  | const XResetPs_RstId | ResetID
| ) |  |

Assert reset for specific peripheral based on reset ID.

Parameters

  InstancePtr | is a pointer to the XResetPs instance.
  ResetID | is the ID of the peripheral.

Returns
  - XST_SUCCESS if reset assertion was successful.
  - Error Code otherwise.

Note
  None.

References XRESETPS_CHK_ASSERT_SUPPORT, XResetPs_ReadReg, and XResetPs_WriteReg.

XStatus XResetPs_ResetDeassert | ( | XResetPs * | InstancePtr,
|  | const XResetPs_RstId | ResetID
| ) |  |

Deassert reset for specific peripheral based on reset ID.

Parameters

  InstancePtr | is a pointer to the XResetPs instance.
  ResetID | is the ID of the peripheral.

Returns
  - XST_SUCCESS if reset deassertion was successful.
  - Error Code otherwise.

Note
  None.

References XRESETPS_CHK_ASSERT_SUPPORT, XResetPs_ReadReg, and XResetPs_WriteReg.

XStatus XResetPs_ResetPulse | ( | XResetPs * | InstancePtr,
|  | const XResetPs_RstId | ResetID
| ) |  |

Pulse reset for specific peripheral based on reset ID.

Parameters

  InstancePtr | is a pointer to the XResetPs instance.
  ResetID | is the ID of the peripheral.

Returns
  - XST_SUCCESS if pulse reset was successful.
  - Error Code otherwise.

Note
  None.

References XRESETPS_CHK_PULSE_SUPPORT, XRESETPS_PT_DLY_PSCHK, XRESETPS_PT_NO_DLY_NO_PSCHK, XResetPs_ReadReg, and XResetPs_WriteReg.

XStatus XResetPs_ResetStatus | ( | XResetPs * | InstancePtr,
|  | const XResetPs_RstId | ResetID,
|  | XResetPs_RstStatus * | Status
| ) |  |

Get reset status for specific peripheral based on reset ID.

Parameters

  InstancePtr | is a pointer to the XResetPs instance.
  ResetID | is the ID of the peripheral.
  Status | is the status of reset for ResetID. 1 if asserted and 0 if released

Returns
  - XST_SUCCESS if status fetched successful.
  - Error Code otherwise.

Note
  None.

References XRESETPS_CHK_STATUS_SUPPORT, and XResetPs_ReadReg.

## Variable Documentation

XResetPs_Config XResetPs_ConfigTable[XPAR_XRESETPS_NUM_INSTANCES]

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

Note: This is a dummy instance since reset system doesnot have a dedicated controller

XResetPs_Config XResetPs_ConfigTable[XPAR_XRESETPS_NUM_INSTANCES]

Initial value:
= {
{
(u16)XPAR_XRESETPS_DEVICE_ID,
}
}

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

Note: This is a dummy instance since reset system doesnot have a dedicated controller