|
OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <logging/log.h>#include "libutil.h"#include "sensor.h"#include "hal_i2c.h"#include "pmbus.h"#include "mp29816a.h"#include "util_pmbus.h"
Classes | |
| struct | cfg_data |
Macros | |
| #define | READ_VOUT_MASK GENMASK(11, 0) |
| #define | MFR_VID_RES_MASK GENMASK(12, 10) |
| #define | MFR_VOUT_SCALE_LOOP 0x29 |
| #define | MFR_VOUT_LOOP_CTRL 0x8D |
| #define | MFR_VDIFF_GAIN_HALF_R2_BIT BIT(10) |
| #define | VR_MPS_PAGE_0 0x00 |
| #define | VR_MPS_PAGE_1 0x01 |
| #define | MP29816A_VOUT_MAX_REG 0x24 |
| #define | MP29816A_VOUT_MIN_REG 0x2B |
| #define | VR_REG_EXPECTED_USER_CRC 0xED |
| #define | MAX_CFG_LEN 1024 |
| #define | MP29816A_MAX_READ_BYTES (6 + 1) |
Enumerations | |
| enum | CFG_PARAM_IDX { CFG_PARAM_IDX_PAGE = 1 , CFG_PARAM_IDX_REG_ADDR = 2 , CFG_PARAM_IDX_REG_NAME = 4 , CFG_PARAM_IDX_REG_VAL = 5 , CFG_PARAM_IDX_REG_LEN = 7 } |
Functions | |
| LOG_MODULE_REGISTER (mp29816a) | |
| float | mp29816a_get_resolution (sensor_cfg *cfg, bool is_vout_max_or_min) |
| uint8_t | parsing_line (char *str, uint16_t len, struct cfg_data *cfg_data) |
| bool | mp29816a_i2c_read (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) |
| bool | mp29816a_i2c_write (uint8_t bus, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len) |
| bool | mp29816a_set_page (uint8_t bus, uint8_t addr, uint8_t page) |
| bool | mp29816a_get_vout_max (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt) |
| bool | mp29816a_get_vout_min (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt) |
| bool | mp29816a_set_vout_max (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt) |
| bool | mp29816a_set_vout_min (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt) |
| bool | mp29816a_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size) |
| bool | mp29816a_get_fw_version (uint8_t bus, uint8_t addr, uint32_t *rev) |
| bool | mp29816a_get_vout_command (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt) |
| bool | mp29816a_set_vout_command (sensor_cfg *cfg, uint8_t rail, uint16_t *millivolt) |
| bool | mp29816a_get_vr_status (sensor_cfg *cfg, uint8_t rail, uint8_t vr_status_rail, uint16_t *vr_status) |
| bool | mp29816a_clear_vr_status (sensor_cfg *cfg, uint8_t rail) |
| uint8_t | mp29816a_read (sensor_cfg *cfg, int *reading) |
| uint8_t | mp29816a_init (sensor_cfg *cfg) |
| #define MAX_CFG_LEN 1024 |
| #define MFR_VDIFF_GAIN_HALF_R2_BIT BIT(10) |
| #define MFR_VID_RES_MASK GENMASK(12, 10) |
| #define MFR_VOUT_LOOP_CTRL 0x8D |
| #define MFR_VOUT_SCALE_LOOP 0x29 |
| #define MP29816A_MAX_READ_BYTES (6 + 1) |
| #define MP29816A_VOUT_MAX_REG 0x24 |
| #define MP29816A_VOUT_MIN_REG 0x2B |
| #define READ_VOUT_MASK GENMASK(11, 0) |
| #define VR_MPS_PAGE_0 0x00 |
| #define VR_MPS_PAGE_1 0x01 |
| #define VR_REG_EXPECTED_USER_CRC 0xED |
| enum CFG_PARAM_IDX |
| LOG_MODULE_REGISTER | ( | mp29816a | ) |
| bool mp29816a_clear_vr_status | ( | sensor_cfg * | cfg, |
| uint8_t | rail | ||
| ) |

| bool mp29816a_fwupdate | ( | uint8_t | bus, |
| uint8_t | addr, | ||
| uint8_t * | img_buff, | ||
| uint32_t | img_size | ||
| ) |
| bool mp29816a_get_fw_version | ( | uint8_t | bus, |
| uint8_t | addr, | ||
| uint32_t * | rev | ||
| ) |

| float mp29816a_get_resolution | ( | sensor_cfg * | cfg, |
| bool | is_vout_max_or_min | ||
| ) |

| bool mp29816a_get_vout_command | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint16_t * | millivolt | ||
| ) |

| bool mp29816a_get_vout_max | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint16_t * | millivolt | ||
| ) |

| bool mp29816a_get_vout_min | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint16_t * | millivolt | ||
| ) |

| bool mp29816a_get_vr_status | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint8_t | vr_status_rail, | ||
| uint16_t * | vr_status | ||
| ) |

| bool mp29816a_i2c_read | ( | uint8_t | bus, |
| uint8_t | addr, | ||
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| uint8_t | len | ||
| ) |

| bool mp29816a_i2c_write | ( | uint8_t | bus, |
| uint8_t | addr, | ||
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| uint8_t | len | ||
| ) |

| uint8_t mp29816a_init | ( | sensor_cfg * | cfg | ) |

| uint8_t mp29816a_read | ( | sensor_cfg * | cfg, |
| int * | reading | ||
| ) |

| bool mp29816a_set_page | ( | uint8_t | bus, |
| uint8_t | addr, | ||
| uint8_t | page | ||
| ) |

| bool mp29816a_set_vout_command | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint16_t * | millivolt | ||
| ) |

| bool mp29816a_set_vout_max | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint16_t * | millivolt | ||
| ) |

| bool mp29816a_set_vout_min | ( | sensor_cfg * | cfg, |
| uint8_t | rail, | ||
| uint16_t * | millivolt | ||
| ) |

| uint8_t parsing_line | ( | char * | str, |
| uint16_t | len, | ||
| struct cfg_data * | cfg_data | ||
| ) |