1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2019-2021, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef JUNO_ADC_H 9 #define JUNO_ADC_H 10 11 /* Coefficients for ADC values */ 12 #define ADC_VOLT_CONST 1622 13 #define ADC_CURRENT_CONST1 381 14 #define ADC_CURRENT_CONST2 761 15 #define ADC_POWER_CONST1 617402 16 #define ADC_POWER_CONST2 1234803 17 #define ADC_ENERGY_CONST1 617402 18 #define ADC_ENERGY_CONST2 1234803 19 20 /* Field masks for the ADC values */ 21 #define JUNO_ADC_SYS_REG_AMPS_MASK UINT32_C(0x00000FFF) 22 #define JUNO_ADC_SYS_REG_VOLT_MASK UINT32_C(0x00000FFF) 23 #define JUNO_ADC_SYS_REG_POWER_MASK UINT32_C(0x00FFFFFF) 24 25 /* Multiplying factors */ 26 #define JUNO_ADC_AMPS_MULTIPLIER 1000 27 #define JUNO_ADC_VOLT_MULTIPLIER 1000 28 #define JUNO_ADC_WATTS_MULTIPLIER (1000 * 1000) 29 #define JUNO_ADC_JOULE_MULTIPLIER 100 30 31 #endif /* JUNO_ADC_H */ 32