OpenBIC
OpenSource Bridge-IC
mp2988.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <logging/log.h>
#include "mp2988.h"
#include "sensor.h"
#include "hal_i2c.h"
#include "pmbus.h"
Include dependency graph for mp2988.c:

Classes

struct  mp2988_data
 
struct  mp2988_config
 

Macros

#define MP2988_DEV_ID   0x98
 
#define VR_REG_CODE_REV   0x26
 
#define VR_REG_DEV_ID   0x28
 
#define VR_REG_STAT_CML   0x7E
 
#define VR_REG_FAULT_CLR   0x03
 
#define VR_REG_STORE_USR_ALL   0x15
 
#define VR_REG_RESTORE_USR_ALL   0x16
 
#define VR_REG_STORE_STAT   0x00
 
#define MAX_CMD_LINE   720
 
#define VR_MPS_PAGE_0   0x00
 
#define VR_MPS_PAGE_1   0x01
 
#define VR_MPS_PAGE_2   0x02
 
#define VR_MPS_PAGE_3   0x03
 

Enumerations

enum  {
  ATE_CONF_ID = 0 , ATE_PAGE_NUM , ATE_REG_ADDR_HEX , ATE_REG_ADDR_DEC ,
  ATE_REG_NAME , ATE_REG_DATA_HEX , ATE_REG_DATA_DEC , ATE_COL_MAX
}
 
enum  { MODE_STORE_USR_ALL , MODE_RESTORE_USR_ALL }
 

Functions

 LOG_MODULE_REGISTER (mp2988)
 
bool mp2988_get_checksum (uint8_t bus, uint8_t addr, uint16_t *crc)
 
bool mp2988_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size)
 

Macro Definition Documentation

◆ MAX_CMD_LINE

#define MAX_CMD_LINE   720

◆ MP2988_DEV_ID

#define MP2988_DEV_ID   0x98

◆ VR_MPS_PAGE_0

#define VR_MPS_PAGE_0   0x00

◆ VR_MPS_PAGE_1

#define VR_MPS_PAGE_1   0x01

◆ VR_MPS_PAGE_2

#define VR_MPS_PAGE_2   0x02

◆ VR_MPS_PAGE_3

#define VR_MPS_PAGE_3   0x03

◆ VR_REG_CODE_REV

#define VR_REG_CODE_REV   0x26

◆ VR_REG_DEV_ID

#define VR_REG_DEV_ID   0x28

◆ VR_REG_FAULT_CLR

#define VR_REG_FAULT_CLR   0x03

◆ VR_REG_RESTORE_USR_ALL

#define VR_REG_RESTORE_USR_ALL   0x16

◆ VR_REG_STAT_CML

#define VR_REG_STAT_CML   0x7E

◆ VR_REG_STORE_STAT

#define VR_REG_STORE_STAT   0x00

◆ VR_REG_STORE_USR_ALL

#define VR_REG_STORE_USR_ALL   0x15

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ATE_CONF_ID 
ATE_PAGE_NUM 
ATE_REG_ADDR_HEX 
ATE_REG_ADDR_DEC 
ATE_REG_NAME 
ATE_REG_DATA_HEX 
ATE_REG_DATA_DEC 
ATE_COL_MAX 

◆ anonymous enum

anonymous enum
Enumerator
MODE_STORE_USR_ALL 
MODE_RESTORE_USR_ALL 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( mp2988  )

◆ mp2988_fwupdate()

bool mp2988_fwupdate ( uint8_t  bus,
uint8_t  addr,
uint8_t *  img_buff,
uint32_t  img_size 
)

◆ mp2988_get_checksum()

bool mp2988_get_checksum ( uint8_t  bus,
uint8_t  addr,
uint16_t *  crc 
)
Here is the call graph for this function: