28 #ifndef __ONLP_PSU_H__ 29 #define __ONLP_PSU_H__ 31 #include <onlp/onlp.h> 37 ONLP_PSU_CAPS_GET_TYPE = (1 << 0),
38 ONLP_PSU_CAPS_GET_VIN = (1 << 1),
39 ONLP_PSU_CAPS_GET_VOUT = (1 << 2),
40 ONLP_PSU_CAPS_GET_IIN = (1 << 3),
41 ONLP_PSU_CAPS_GET_IOUT = (1 << 4),
42 ONLP_PSU_CAPS_GET_PIN = (1 << 5),
43 ONLP_PSU_CAPS_GET_POUT = (1 << 6),
51 ONLP_PSU_TYPE_LAST = ONLP_PSU_TYPE_DC48,
53 ONLP_PSU_TYPE_INVALID = -1,
101 #define ONLP_PSU_INFO_CAP_IS_SET(_pinfo, _name) \ 102 ((_pinfo)->caps & ONLP_PSU_CAPS_##_name) 162 #define ONLP_PSU_STATUS_PRESENT(_pi) ( (_pi).status & ONLP_PSU_STATUS_PRESENT ) 165 #define ONLP_PSU_STATUS_MISSING(_pi) (!ONLP_PSU_STATUS_PRESENT(_pi)) 168 #define ONLP_PSU_STATUS_FAILED(_pi) ( (_pi).status & ONLP_PSU_STATUS_FAILED) 193 #define ONLP_PSU_CAPS_VALID(_e) \ 194 (onlp_psu_caps_valid((_e))) 202 #define ONLP_PSU_TYPE_STRINGS \ 218 #define ONLP_PSU_TYPE_VALID(_e) \ 219 ( (0 <= (_e)) && ((_e) <= ONLP_PSU_TYPE_DC48)) aim_map_si_t onlp_psu_type_map[]
aim_map_si_t onlp_psu_caps_map[]
onlp_psu_type_e
Definition: psu.h:47
int mvout
Definition: psu.h:81
int onlp_psu_caps_value(const char *str, onlp_psu_caps_t *e, int substr)
int onlp_psu_sw_denit(void)
Deinitialize the psu software module.
char serial[ONLP_CONFIG_INFO_STR_MAX]
Definition: psu.h:69
onlp_psu_caps_e
Definition: psu.h:36
uint32_t onlp_oid_t
Definition: oids.h:52
uint32_t caps
Definition: psu.h:72
enum onlp_psu_type_e onlp_psu_type_t
int mpin
Definition: psu.h:90
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.
int miin
Definition: psu.h:84
#define ONLP_CONFIG_INFO_STR_MAX
Definition: onlp_config.h:218
int onlp_psu_sw_init(void)
Software initialization of the PSU module.
enum onlp_psu_caps_e onlp_psu_caps_t
int onlp_psu_info_to_json(onlp_psu_info_t *info, cJSON **cj, uint32_t flags)
Convert a PSU info structure to JSON.
int onlp_psu_hdr_get(onlp_oid_t oid, onlp_oid_hdr_t *rv)
Get the PSU's oid header.
int onlp_psu_caps_valid(onlp_psu_caps_t e)
const char * onlp_psu_caps_desc(onlp_psu_caps_t e)
int onlp_psu_hw_init(uint32_t flags)
Hardware initialization of the PSU module.
const char * onlp_psu_caps_name(onlp_psu_caps_t e)
const char * onlp_psu_type_name(onlp_psu_type_t e)
int onlp_psu_info_get(onlp_oid_t oid, onlp_psu_info_t *rv)
Get the PSU information.
const char * onlp_psu_type_desc(onlp_psu_type_t e)
int onlp_psu_type_value(const char *str, onlp_psu_type_t *e, int substr)
int miout
Definition: psu.h:87
onlp_oid_hdr_t hdr
Definition: psu.h:63
onlp_psu_type_t type
Definition: psu.h:75
struct onlp_psu_info_t onlp_psu_info_t
int mvin
Definition: psu.h:78
aim_map_si_t onlp_psu_caps_desc_map[]
int onlp_psu_info_from_json(cJSON *cj, onlp_psu_info_t *info)
Convert a JSON object to a PSU info structure.
aim_map_si_t onlp_psu_type_desc_map[]
char model[ONLP_CONFIG_INFO_STR_MAX]
Definition: psu.h:66
int mpout
Definition: psu.h:93