1 /******************************************************************************
3 * Copyright (C) 2016 Xilinx, Inc. All rights reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
31 ******************************************************************************/
32 /*****************************************************************************/
36 * The XSysMon driver supports the Xilinx System Monitor device.
38 * The System Monitor device has the following features:
39 * - PL Sysmon instance has 10-bit, 200-KSPS (kilo samples per second)
40 * Analog-to-Digital Converter (ADC)
41 * - PS Sysmon instance has 10-bit, 1000-KSPS ADC.
42 * - Monitoring of on-chip supply voltages and temperature
43 * - 1 dedicated differential analog-input pair and
44 * 16 auxiliary differential analog-input pairs
45 * - Automatic alarms based on user defined limits for the on-chip
46 * supply voltages and temperature
47 * - Automatic Channel Sequencer, programmable averaging, programmable
48 * acquisition time for the external inputs, unipolar or differential
49 * input selection for the external inputs
50 * - Inbuilt Calibration
51 * - Optional interrupt request generation
55 * The user should refer to the hardware device specification for detailed
56 * information about the device.
58 * This header file contains the prototypes of driver functions that can
59 * be used to access the System Monitor device.
62 * <b> System Monitor Channel Sequencer Modes </b>
64 * The System Monitor Channel Sequencer supports the following operating modes:
66 * - <b> Default </b>: This is the default mode after power up.
67 * In this mode of operation the System Monitor operates in
68 * a sequence mode, monitoring the on chip sensors:
69 * Temperature, VCCINT, and VCCAUX.
70 * - <b> One pass through sequence </b>: In this mode the System Monitor
71 * converts the channels enabled in the Sequencer Channel Enable
72 * registers for a single pass and then stops.
73 * - <b> Continuous cycling of sequence </b>: In this mode the System Monitor
74 * converts the channels enabled in the Sequencer Channel Enable
75 * registers continuously.
76 * - <b> Single channel mode</b>: In this mode the System Monitor Channel
77 * Sequencer is disabled and the System Monitor operates in a
78 * Single Channel Mode.
79 * The System Monitor can operate either in a Continuous or Event
80 * driven sampling mode in the single channel mode.
83 * <b> Initialization and Configuration </b>
85 * The device driver enables higher layer software (e.g., an application) to
86 * communicate to the System Monitor device.
88 * XSysMonPsu_CfgInitialize() API is used to initialize the System Monitor
89 * device. The user needs to first call the XSysMonPsu_LookupConfig() API which
90 * returns the Configuration structure pointer which is passed as a parameter to
91 * the XSysMonPsu_CfgInitialize() API.
96 * The System Monitor device supports interrupt driven mode and the default
97 * operation mode is polling mode.
99 * This driver does not provide a Interrupt Service Routine (ISR) for the device.
100 * It is the responsibility of the application to provide one if needed. Refer to
101 * the interrupt example provided with this driver for details on using the
102 * device in interrupt mode.
105 * <b> Virtual Memory </b>
107 * This driver supports Virtual Memory. The RTOS is responsible for calculating
108 * the correct device base address in Virtual Memory space.
113 * This driver is not thread safe. Any needs for threads or thread mutual
114 * exclusion must be satisfied by the layer above this driver.
119 * Asserts are used within all Xilinx drivers to enforce constraints on argument
120 * values. Asserts can be turned off on a system-wide basis by defining, at
121 * compile time, the NDEBUG identifier. By default, asserts are turned on and it
122 * is recommended that users leave asserts on during development.
125 * <b> Building the driver </b>
127 * The XSysMonPsu driver is composed of several source files. This allows the user
128 * to build and link only those parts of the driver that are necessary.
131 * <b> Limitations of the driver </b>
133 * System Monitor device can be accessed through the JTAG port and the AXI
134 * interface. The driver implementation does not support the simultaneous access
135 * of the device by both these interfaces. The user has to take care of this
136 * situation in the user application code.
144 * MODIFICATION HISTORY:
146 * Ver Who Date Changes
147 * ----- ----- -------- -----------------------------------------------
148 * 1.00 kvn 12/15/15 First release
149 * 02/15/16 Corrected Assert function call in
150 * XSysMonPsu_GetMonitorStatus API.
151 * 03/03/16 Added Temperature remote channel for Setsingle
152 * channel API. Also corrected external mux channel
157 ******************************************************************************/
160 #ifndef XSYSMONPSU_H_ /* prevent circular inclusions */
161 #define XSYSMONPSU_H_ /* by using protection macros */
167 /***************************** Include Files *********************************/
170 #include "xil_assert.h"
172 #include "xsysmonpsu_hw.h"
173 #include "xil_types.h"
175 /************************** Constant Definitions *****************************/
178 * @name Indexes for the different channels.
181 #define XSM_CH_TEMP 0x0U /**< On Chip Temperature */
182 #define XSM_CH_SUPPLY1 0x1U /**< SUPPLY1 VCC_PSINTLP */
183 #define XSM_CH_SUPPLY2 0x2U /**< SUPPLY2 VCC_PSINTFP */
184 #define XSM_CH_VPVN 0x3U /**< VP/VN Dedicated analog inputs */
185 #define XSM_CH_VREFP 0x4U /**< VREFP */
186 #define XSM_CH_VREFN 0x5U /**< VREFN */
187 #define XSM_CH_SUPPLY3 0x6U /**< SUPPLY3 VCC_PSAUX */
188 #define XSM_CH_SUPPLY_CALIB 0x08U /**< Supply Calib Data Reg */
189 #define XSM_CH_ADC_CALIB 0x09U /**< ADC Offset Channel Reg */
190 #define XSM_CH_GAINERR_CALIB 0x0AU /**< Gain Error Channel Reg */
191 #define XSM_CH_SUPPLY4 0x0DU /**< SUPPLY4 VCC_PSDDR_504 */
192 #define XSM_CH_SUPPLY5 0x0EU /**< SUPPLY5 VCC_PSIO3_503 */
193 #define XSM_CH_SUPPLY6 0x0FU /**< SUPPLY6 VCC_PSIO0_500 */
194 #define XSM_CH_AUX_MIN 16U /**< Channel number for 1st Aux Channel */
195 #define XSM_CH_AUX_MAX 31U /**< Channel number for Last Aux channel */
196 #define XSM_CH_SUPPLY7 32U /**< SUPPLY7 VCC_PSIO1_501 */
197 #define XSM_CH_SUPPLY8 33U /**< SUPPLY8 VCC_PSIO2_502 */
198 #define XSM_CH_SUPPLY9 34U /**< SUPPLY9 PS_MGTRAVCC */
199 #define XSM_CH_SUPPLY10 35U /**< SUPPLY10 PS_MGTRAVTT */
200 #define XSM_CH_VCCAMS 36U /**< VCCAMS */
201 #define XSM_CH_TEMP_REMTE 37U /**< Temperature Remote */
202 #define XSM_CH_VCC_PSLL0 38U /**< VCC_PSLL0 */
203 #define XSM_CH_VCC_PSLL1 39U /**< VCC_PSLL1 */
204 #define XSM_CH_VCC_PSLL2 40U /**< VCC_PSLL2 */
205 #define XSM_CH_VCC_PSLL3 41U /**< VCC_PSLL3 */
206 #define XSM_CH_VCC_PSLL4 42U /**< VCC_PSLL4 */
207 #define XSM_CH_VCC_PSBATT 43U /**< VCC_PSBATT */
208 #define XSM_CH_VCCINT 44U /**< VCCINT */
209 #define XSM_CH_VCCBRAM 45U /**< VCCBRAM */
210 #define XSM_CH_VCCAUX 46U /**< VCCAUX */
211 #define XSM_CH_VCC_PSDDRPLL 47U /**< VCC_PSDDRPLL */
212 #define XSM_CH_DDRPHY_VREF 48U /**< DDRPHY_VREF */
213 #define XSM_CH_DDRPHY_AT0 49U /**< DDRPHY_AT0 */
214 #define XSM_CH_PSGT_AT0 50U /**< PSGT_AT0 */
215 #define XSM_CH_PSGT_AT1 51U /**< PSGT_AT0 */
216 #define XSM_CH_RESERVE0 52U /**< PSGT_AT0 */
217 #define XSM_CH_RESERVE1 53U /**< PSGT_AT0 */
222 * @name Indexes for reading the Calibration Coefficient Data.
225 #define XSM_CALIB_SUPPLY_OFFSET_COEFF 0U /**< Supply Offset Calib Coefficient */
226 #define XSM_CALIB_ADC_OFFSET_COEFF 1U /**< ADC Offset Calib Coefficient */
227 #define XSM_CALIB_GAIN_ERROR_COEFF 2U /**< Gain Error Calib Coefficient*/
232 * @name Indexes for reading the Minimum/Maximum Measurement Data.
235 #define XSM_MAX_TEMP 0U /**< Maximum Temperature Data */
236 #define XSM_MAX_SUPPLY1 1U /**< Maximum SUPPLY1 Data */
237 #define XSM_MAX_SUPPLY2 2U /**< Maximum SUPPLY2 Data */
238 #define XSM_MAX_SUPPLY3 3U /**< Maximum SUPPLY3 Data */
239 #define XSM_MIN_TEMP 4U /**< Minimum Temperature Data */
240 #define XSM_MIN_SUPPLY1 5U /**< Minimum SUPPLY1 Data */
241 #define XSM_MIN_SUPPLY2 6U /**< Minimum SUPPLY2 Data */
242 #define XSM_MIN_SUPPLY3 7U /**< Minimum SUPPLY3 Data */
243 #define XSM_MAX_SUPPLY4 8U /**< Maximum SUPPLY4 Data */
244 #define XSM_MAX_SUPPLY5 9U /**< Maximum SUPPLY5 Data */
245 #define XSM_MAX_SUPPLY6 0xAU /**< Maximum SUPPLY6 Data */
246 #define XSM_MIN_SUPPLY4 0xCU /**< Minimum SUPPLY4 Data */
247 #define XSM_MIN_SUPPLY5 0xDU /**< Minimum SUPPLY5 Data */
248 #define XSM_MIN_SUPPLY6 0xEU /**< Minimum SUPPLY6 Data */
249 #define XSM_MAX_SUPPLY7 0x80U /**< Maximum SUPPLY7 Data */
250 #define XSM_MAX_SUPPLY8 0x81U /**< Maximum SUPPLY8 Data */
251 #define XSM_MAX_SUPPLY9 0x82U /**< Maximum SUPPLY9 Data */
252 #define XSM_MAX_SUPPLY10 0x83U /**< Maximum SUPPLY10 Data */
253 #define XSM_MAX_VCCAMS 0x84U /**< Maximum VCCAMS Data */
254 #define XSM_MAX_TEMP_REMOTE 0x85U /**< Maximum Remote Temperature Data */
255 #define XSM_MIN_SUPPLY7 0x88U /**< Minimum SUPPLY7 Data */
256 #define XSM_MIN_SUPPLY8 0x89U /**< Minimum SUPPLY8 Data */
257 #define XSM_MIN_SUPPLY9 0x8AU /**< Minimum SUPPLY9 Data */
258 #define XSM_MIN_SUPPLY10 0x8BU /**< Minimum SUPPLY10 Data */
259 #define XSM_MIN_VCCAMS 0x8CU /**< Minimum VCCAMS Data */
260 #define XSM_MIN_TEMP_REMOTE 0x8DU /**< Minimum Remote Temperature Data */
265 * @name Averaging to be done for the channels.
268 #define XSM_AVG_0_SAMPLES 0U /**< No Averaging */
269 #define XSM_AVG_16_SAMPLES 1U /**< Average 16 samples */
270 #define XSM_AVG_64_SAMPLES 2U /**< Average 64 samples */
271 #define XSM_AVG_256_SAMPLES 3U /**< Average 256 samples */
276 * @name Channel Sequencer Modes of operation.
279 #define XSM_SEQ_MODE_SAFE 0U /**< Default Safe Mode */
280 #define XSM_SEQ_MODE_ONEPASS 1U /**< Onepass through Sequencer */
281 #define XSM_SEQ_MODE_CONTINPASS 2U /**< Continuous Cycling Seqquencer */
282 #define XSM_SEQ_MODE_SINGCHAN 3U /**< Single channel - No Sequencing */
283 #define XSM_SEQ_MODE_OYLMPUS 6U /**< Olympus mode */
288 * @name Clock Divisor values range.
291 #define XSM_CLK_DIV_MIN 0U /**< Minimum Clock Divisor value */
292 #define XSM_CLK_DIV_MAX 255U /**< Maximum Clock Divisor value */
297 * @name Alarm Threshold(Limit) Register (ATR) indexes.
300 #define XSM_ATR_TEMP_UPPER 0U /**< High user Temperature limit */
301 #define XSM_ATR_SUP1_UPPER 1U /**< Supply1 high voltage limit */
302 #define XSM_ATR_SUP2_UPPER 2U /**< Supply2 high voltage limit */
303 #define XSM_ATR_OT_UPPER 3U /**< Upper Over Temperature limit */
304 #define XSM_ATR_TEMP_LOWER 4U /**< Low user Temperature */
305 #define XSM_ATR_SUP1_LOWER 5U /**< Suuply1 low voltage limit */
306 #define XSM_ATR_SUP2_LOWER 6U /**< Supply2 low voltage limit */
307 #define XSM_ATR_OT_LOWER 7U /**< Lower Over Temperature limit */
308 #define XSM_ATR_SUP3_UPPER 8U /**< Supply3 high voltage limit */
309 #define XSM_ATR_SUP4_UPPER 9U /**< Supply4 high voltage limit */
310 #define XSM_ATR_SUP5_UPPER 0xAU /**< Supply5 high voltage limit */
311 #define XSM_ATR_SUP6_UPPER 0xBU /**< Supply6 high voltage limit */
312 #define XSM_ATR_SUP3_LOWER 0xCU /**< Supply3 low voltage limit */
313 #define XSM_ATR_SUP4_LOWER 0xDU /**< Supply4 low voltage limit */
314 #define XSM_ATR_SUP5_LOWER 0xEU /**< Supply5 low voltage limit */
315 #define XSM_ATR_SUP6_LOWER 0xFU /**< Supply6 low voltage limit */
316 #define XSM_ATR_SUP7_UPPER 0x10U /**< Supply7 high voltage limit */
317 #define XSM_ATR_SUP8_UPPER 0x11U /**< Supply8 high voltage limit */
318 #define XSM_ATR_SUP9_UPPER 0x12U /**< Supply9 high voltage limit */
319 #define XSM_ATR_SUP10_UPPER 0x13U /**< Supply10 high voltage limit */
320 #define XSM_ATR_VCCAMS_UPPER 0x14U /**< VCCAMS high voltage limit */
321 #define XSM_ATR_TEMP_RMTE_UPPER 0x15U /**< High remote Temperature limit */
322 #define XSM_ATR_SUP7_LOWER 0x18U /**< Supply7 low voltage limit */
323 #define XSM_ATR_SUP8_LOWER 0x19U /**< Supply8 low voltage limit */
324 #define XSM_ATR_SUP9_LOWER 0x1AU /**< Supply9 low voltage limit */
325 #define XSM_ATR_SUP10_LOWER 0x1BU /**< Supply10 low voltage limit */
326 #define XSM_ATR_VCCAMS_LOWER 0x1CU /**< VCCAMS low voltage limit */
327 #define XSM_ATR_TEMP_RMTE_LOWER 0x1DU /**< Low remote Temperature limit */
332 * @name Alarm masks for channels in Configuration registers 1
335 #define XSM_CFR_ALM_SUPPLY6_MASK 0x0800 /**< Alarm 6 - SUPPLY6 */
336 #define XSM_CFR_ALM_SUPPLY5_MASK 0x0400 /**< Alarm 5 - SUPPLY5 */
337 #define XSM_CFR_ALM_SUPPLY4_MASK 0x0200 /**< Alarm 4 - SUPPLY4 */
338 #define XSM_CFR_ALM_SUPPLY3_MASK 0x0100 /**< Alarm 3 - SUPPLY3 */
339 #define XSM_CFR_ALM_SUPPLY2_MASK 0x0008 /**< Alarm 2 - SUPPLY2 */
340 #define XSM_CFR_ALM_SUPPLY1_MASK 0x0004 /**< Alarm 1 - SUPPLY1 */
341 #define XSM_CFR_ALM_TEMP_MASK 0x0002 /**< Alarm 0 - Temperature */
342 #define XSM_CFR_ALM_OT_MASK 0x0001 /**< Over Temperature Alarm */
346 /**************************** Type Definitions *******************************/
348 /******************************************************************************/
350 * This data type defines a handler that an application defines to communicate
351 * with interrupt system to retrieve state information about an application.
353 * @param CallBackRef is a callback reference passed in by the upper layer
354 * when setting the handler, and is passed back to the upper layer
355 * when the handler is called. It is used to find the device driver
358 ******************************************************************************/
359 typedef void (*XSysMonPsu_Handler) (void *CallBackRef);
362 * This typedef contains configuration information for a device.
365 u16 DeviceId; /**< Unique ID of device */
366 u32 BaseAddress; /**< Register base address */
370 * The XSysmonPsu driver instance data. The user is required to allocate a
371 * variable of this type for the SYSMON device in the system. A pointer
372 * to a variable of this type is then passed to the driver API functions.
375 XSysMonPsu_Config Config; /**< Device configuration */
376 u32 IsReady; /**< Device is initialized and ready */
377 XSysMonPsu_Handler Handler;
378 void *CallBackRef; /**< Callback reference for event handler */
381 /* BaseAddress Offsets */
382 #define XSYSMON_PS 1U
383 #define XSYSMON_PL 2U
384 #define XSYSMON_AMS 3U
385 #define XPS_BA_OFFSET 0x00000800U
386 #define XPL_BA_OFFSET 0x00000C00U
387 #define XSM_ADC_CH_OFFSET 0x00000200U
388 #define XSM_AMS_CH_OFFSET 0x00000060U
389 #define XSM_MIN_MAX_CH_OFFSET 0x00000080U
391 /************************* Variable Definitions ******************************/
393 /***************** Macros (Inline Functions) Definitions *********************/
395 /****************************************************************************/
398 * This macro converts System Monitor Raw Data to Temperature(centigrades)
399 * for On-Chip Sensors.
401 * @param AdcData is the SysMon Raw ADC Data.
403 * @return The Temperature in centigrades.
405 * @note C-Style signature:
406 * float XSysMon_RawToTemperature_OnChip(u32 AdcData)
408 *****************************************************************************/
409 #define XSysMonPsu_RawToTemperature_OnChip(AdcData) \
410 ((((float)(AdcData)/65536.0f)/0.00199451786f ) - 273.6777f)
412 /****************************************************************************/
415 * This macro converts System Monitor Raw Data to Temperature(centigrades)
416 * for external reference.
418 * @param AdcData is the SysMon Raw ADC Data.
420 * @return The Temperature in centigrades.
422 * @note C-Style signature:
423 * float XSysMon_RawToTemperature_ExternalRef(u32 AdcData)
425 *****************************************************************************/
426 #define XSysMonPsu_RawToTemperature_ExternalRef(AdcData) \
427 ((((float)(AdcData)/65536.0f)/0.00198842814f ) - 273.8195f)
429 /****************************************************************************/
432 * This macro converts System Monitor Raw Data to Voltage(volts).
434 * @param AdcData is the System Monitor ADC Raw Data.
436 * @return The Voltage in volts.
438 * @note C-Style signature:
439 * float XSysMon_RawToVoltage(u32 AdcData)
441 *****************************************************************************/
442 #define XSysMonPsu_RawToVoltage(AdcData) \
443 ((((float)(AdcData))* (3.0f))/65536.0f)
445 /****************************************************************************/
448 * This macro converts Temperature in centigrades to System Monitor Raw Data
449 * for On-Chip Sensors.
451 * @param Temperature is the Temperature in centigrades to be
452 * converted to System Monitor ADC Raw Data.
454 * @return The System Monitor ADC Raw Data.
456 * @note C-Style signature:
457 * int XSysMon_TemperatureToRaw_OnChip(float Temperature)
459 *****************************************************************************/
460 #define XSysMonPsu_TemperatureToRaw_OnChip(Temperature) \
461 ((int)(((Temperature) + 273.6777f)*65536.0f*0.00199451786f))
463 /****************************************************************************/
466 * This macro converts Temperature in centigrades to System Monitor Raw Data
467 * for external reference.
469 * @param Temperature is the Temperature in centigrades to be
470 * converted to System Monitor ADC Raw Data.
472 * @return The System Monitor ADC Raw Data.
474 * @note C-Style signature:
475 * int XSysMon_TemperatureToRaw_ExternalRef(float Temperature)
477 *****************************************************************************/
478 #define XSysMonPsu_TemperatureToRaw_ExternalRef(Temperature) \
479 ((int)(((Temperature) + 273.8195f)*65536.0f*0.00198842814f))
481 /****************************************************************************/
484 * This macro converts Voltage in Volts to System Monitor Raw Data.
486 * @param Voltage is the Voltage in volts to be converted to
487 * System Monitor/ADC Raw Data.
489 * @return The System Monitor ADC Raw Data.
491 * @note C-Style signature:
492 * int XSysMon_VoltageToRaw(float Voltage)
494 *****************************************************************************/
495 #define XSysMonPsu_VoltageToRaw(Voltage) \
496 ((s32)((Voltage)*65536.0f/3.0f))
498 /****************************************************************************/
501 * This static inline macro calculates the effective baseaddress based on the
502 * Sysmon instance. For PS Sysmon, use additional offset XPS_BA_OFFSET and For
503 * PL Sysmon, use additional offset XPL_BA_OFFSET.
505 * @param BaseAddress is the starting address of the SysMon block in
507 * @param SysmonBlk is the value that tells whether it is for PS Sysmon block
508 * or PL Sysmon block or the AMS controller register region.
510 * @return Returns the effective baseaddress of the sysmon instance.
512 *****************************************************************************/
513 static inline u32 XSysMonPsu_GetEffBaseAddress(u32 BaseAddress, u32 SysmonBlk)
517 if (SysmonBlk == XSYSMON_PS) {
518 EffBaseAddr = BaseAddress + XPS_BA_OFFSET;
519 } else if(SysmonBlk == XSYSMON_PL) {
520 EffBaseAddr = BaseAddress + XPL_BA_OFFSET;
522 EffBaseAddr = BaseAddress;
528 /************************** Function Prototypes ******************************/
530 /* Functions in xsysmonpsu.c */
531 s32 XSysMonPsu_CfgInitialize(XSysMonPsu *InstancePtr, XSysMonPsu_Config *ConfigPtr,
533 void XSysMonPsu_Reset(XSysMonPsu *InstancePtr);
534 void XSysMonPsu_Reset_FromLPD(XSysMonPsu *InstancePtr);
535 u32 XSysMonPsu_GetStatus(XSysMonPsu *InstancePtr, u32 SysmonBlk);
536 void XSysMonPsu_StartAdcConversion(XSysMonPsu *InstancePtr);
537 u16 XSysMonPsu_GetAdcData(XSysMonPsu *InstancePtr, u8 Channel, u32 SysmonBlk);
538 u16 XSysMonPsu_GetCalibCoefficient(XSysMonPsu *InstancePtr, u8 CoeffType, u32 SysmonBlk);
539 u16 XSysMonPsu_GetMinMaxMeasurement(XSysMonPsu *InstancePtr, u8 MeasurementType,
541 void XSysMonPsu_SetAvg(XSysMonPsu *InstancePtr, u8 Average, u32 SysmonBlk);
542 u8 XSysMonPsu_GetAvg(XSysMonPsu *InstancePtr, u32 SysmonBlk);
543 s32 XSysMonPsu_SetSingleChParams(XSysMonPsu *InstancePtr, u8 Channel,
544 u32 IncreaseAcqCycles, u32 IsEventMode,
545 u32 IsDifferentialMode, u32 SysmonBlk);
546 void XSysMonPsu_SetAlarmEnables(XSysMonPsu *InstancePtr, u32 AlmEnableMask,
548 u32 XSysMonPsu_GetAlarmEnables(XSysMonPsu *InstancePtr, u32 SysmonBlk);
549 void XSysMonPsu_SetSequencerMode(XSysMonPsu *InstancePtr, u8 SequencerMode,
551 u8 XSysMonPsu_GetSequencerMode(XSysMonPsu *InstancePtr, u32 SysmonBlk);
552 void XSysMonPsu_SetSequencerEvent(XSysMonPsu *InstancePtr, u32 IsEventMode,
554 s32 XSysMonPsu_GetSequencerEvent(XSysMonPsu *InstancePtr, u32 SysmonBlk);
555 void XSysMonPsu_SetExtenalMux(XSysMonPsu *InstancePtr, u8 Channel, u32 SysmonBlk);
556 u32 XSysMonPsu_GetExtenalMux(XSysMonPsu *InstancePtr, u32 SysmonBlk);
557 void XSysMonPsu_SetAdcClkDivisor(XSysMonPsu *InstancePtr, u8 Divisor, u32 SysmonBlk);
558 u8 XSysMonPsu_GetAdcClkDivisor(XSysMonPsu *InstancePtr, u32 SysmonBlk);
559 s32 XSysMonPsu_SetSeqChEnables(XSysMonPsu *InstancePtr, u32 ChEnableMask,
561 u32 XSysMonPsu_GetSeqAvgEnables(XSysMonPsu *InstancePtr, u32 SysmonBlk);
562 u32 XSysMonPsu_GetSeqChEnables(XSysMonPsu *InstancePtr, u32 SysmonBlk);
563 s32 XSysMonPsu_SetSeqAvgEnables(XSysMonPsu *InstancePtr, u32 AvgEnableChMask,
565 s32 XSysMonPsu_SetSeqInputMode(XSysMonPsu *InstancePtr, u32 InputModeChMask,
567 u32 XSysMonPsu_GetSeqInputMode(XSysMonPsu *InstancePtr, u32 SysmonBlk);
568 s32 XSysMonPsu_SetSeqAcqTime(XSysMonPsu *InstancePtr, u32 AcqCyclesChMask,
570 u32 XSysMonPsu_GetSeqAcqTime(XSysMonPsu *InstancePtr, u32 SysmonBlk);
571 void XSysMonPsu_SetAlarmThreshold(XSysMonPsu *InstancePtr, u8 AlarmThrReg,
572 u16 Value, u32 SysmonBlk);
573 u16 XSysMonPsu_GetAlarmThreshold(XSysMonPsu *InstancePtr, u8 AlarmThrReg,
575 void XSysMonPsu_SetPSAutoConversion(XSysMonPsu *InstancePtr);
576 u32 XSysMonPsu_GetMonitorStatus(XSysMonPsu *InstancePtr);
578 /* interrupt functions in xsysmonpsu_intr.c */
579 void XSysMonPsu_IntrEnable(XSysMonPsu *InstancePtr, u64 Mask);
580 void XSysMonPsu_IntrDisable(XSysMonPsu *InstancePtr, u64 Mask);
581 u64 XSysMonPsu_IntrGetEnabled(XSysMonPsu *InstancePtr);
582 u64 XSysMonPsu_IntrGetStatus(XSysMonPsu *InstancePtr);
583 void XSysMonPsu_IntrClear(XSysMonPsu *InstancePtr, u64 Mask);
585 /* Functions in xsysmonpsu_selftest.c */
586 s32 XSysMonPsu_SelfTest(XSysMonPsu *InstancePtr);
588 /* Functions in xsysmonpsu_sinit.c */
589 XSysMonPsu_Config *XSysMonPsu_LookupConfig(u16 DeviceId);
592 #endif /* XSYSMONPSU_H_ */