ONLP
Open Network Linux Platform APIs
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
psu.h File Reference

Power Supply Management. More...

#include <onlp/onlp.h>
#include <onlp/oids.h>

Go to the source code of this file.

Data Structures

struct  onlp_psu_info_t
 

Macros

#define ONLP_PSU_INFO_CAP_IS_SET(_pinfo, _name)   ((_pinfo)->caps & ONLP_PSU_CAPS_##_name)
 
#define ONLP_PSU_STATUS_PRESENT(_pi)   ( (_pi).status & ONLP_PSU_STATUS_PRESENT )
 
#define ONLP_PSU_STATUS_MISSING(_pi)   (!ONLP_PSU_STATUS_PRESENT(_pi))
 
#define ONLP_PSU_STATUS_FAILED(_pi)   ( (_pi).status & ONLP_PSU_STATUS_FAILED)
 
#define ONLP_PSU_CAPS_VALID(_e)   (onlp_psu_caps_valid((_e)))
 
#define ONLP_PSU_TYPE_STRINGS
 
#define ONLP_PSU_TYPE_VALID(_e)   ( (0 <= (_e)) && ((_e) <= ONLP_PSU_TYPE_DC48))
 

Typedefs

typedef enum onlp_psu_caps_e onlp_psu_caps_t
 
typedef enum onlp_psu_type_e onlp_psu_type_t
 
typedef struct onlp_psu_info_t onlp_psu_info_t
 

Enumerations

enum  onlp_psu_caps_e {
  ONLP_PSU_CAPS_GET_TYPE = (1 << 0),
  ONLP_PSU_CAPS_GET_VIN = (1 << 1),
  ONLP_PSU_CAPS_GET_VOUT = (1 << 2),
  ONLP_PSU_CAPS_GET_IIN = (1 << 3),
  ONLP_PSU_CAPS_GET_IOUT = (1 << 4),
  ONLP_PSU_CAPS_GET_PIN = (1 << 5),
  ONLP_PSU_CAPS_GET_POUT = (1 << 6)
}
 
enum  onlp_psu_type_e {
  ONLP_PSU_TYPE_AC,
  ONLP_PSU_TYPE_DC12,
  ONLP_PSU_TYPE_DC48,
  ONLP_PSU_TYPE_LAST = ONLP_PSU_TYPE_DC48,
  ONLP_PSU_TYPE_COUNT,
  ONLP_PSU_TYPE_INVALID = -1
}
 

Functions

int onlp_psu_sw_init (void)
 Software initialization of the PSU module.
 
int onlp_psu_hw_init (uint32_t flags)
 Hardware initialization of the PSU module. More...
 
int onlp_psu_sw_denit (void)
 Deinitialize the psu software module. More...
 
int onlp_psu_hdr_get (onlp_oid_t oid, onlp_oid_hdr_t *rv)
 Get the PSU's oid header. More...
 
int onlp_psu_info_get (onlp_oid_t oid, onlp_psu_info_t *rv)
 Get the PSU information. More...
 
int onlp_psu_info_to_user_json (onlp_psu_info_t *info, cJSON **cj, uint32_t flags)
 Convert a PSU info structure to user JSON. More...
 
int onlp_psu_info_to_json (onlp_psu_info_t *info, cJSON **cj, uint32_t flags)
 Convert a PSU info structure to JSON. More...
 
int onlp_psu_info_from_json (cJSON *cj, onlp_psu_info_t *info)
 Convert a JSON object to a PSU info structure. More...
 
const char * onlp_psu_caps_name (onlp_psu_caps_t e)
 
int onlp_psu_caps_value (const char *str, onlp_psu_caps_t *e, int substr)
 
const char * onlp_psu_caps_desc (onlp_psu_caps_t e)
 
int onlp_psu_caps_valid (onlp_psu_caps_t e)
 
const char * onlp_psu_type_name (onlp_psu_type_t e)
 
int onlp_psu_type_value (const char *str, onlp_psu_type_t *e, int substr)
 
const char * onlp_psu_type_desc (onlp_psu_type_t e)
 

Variables

aim_map_si_t onlp_psu_caps_map []
 
aim_map_si_t onlp_psu_caps_desc_map []
 
aim_map_si_t onlp_psu_type_map []
 
aim_map_si_t onlp_psu_type_desc_map []
 

Detailed Description

Power Supply Management.