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

Macros

#define TI_REG_NVM_CHECKSUM   0xF4
 
#define TI_REG_USER_NVM_INDEX   0xF5
 
#define TI_REG_USER_NVM_EXECUTE   0xF6
 

Enumerations

enum  LINE_INDEX { FIRST_LINE = 1 , DEV_ID_LINE = 2 , LAST_LINE = 11 }
 
enum  LINE_FORMAT { HEADER_LEN = 8 , DATA_LEN = 32 }
 
enum  DEV_ID_LINE_OFFSET {
  DEV_REV1_OFFSET = 6 , DEV_REV2_OFFSET = 7 , ADDR_OFFSET = 8 , CRC1_OFFSET = 9 ,
  CRC2_OFFSET = 10
}
 

Functions

 LOG_MODULE_REGISTER (tps53689)
 
bool tps536xx_parse_image (uint8_t *img_buff, uint32_t img_size, struct tps_config *cfg)
 
bool tps536xx_get_crc (uint8_t bus, uint8_t addr, uint32_t *crc)
 
bool tps536xx_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size)
 
uint8_t tps53689_read (sensor_cfg *cfg, int *reading)
 
uint8_t tps53689_init (sensor_cfg *cfg)
 

Variables

uint8_t tps536c5_dev_id [] = { 0x54, 0x49, 0x53, 0x6C, 0x50, 0x00 }
 
uint8_t tps53685_dev_id [] = { 0x54, 0x49, 0x53, 0x68, 0x50, 0x00 }
 

Macro Definition Documentation

◆ TI_REG_NVM_CHECKSUM

#define TI_REG_NVM_CHECKSUM   0xF4

◆ TI_REG_USER_NVM_EXECUTE

#define TI_REG_USER_NVM_EXECUTE   0xF6

◆ TI_REG_USER_NVM_INDEX

#define TI_REG_USER_NVM_INDEX   0xF5

Enumeration Type Documentation

◆ DEV_ID_LINE_OFFSET

Enumerator
DEV_REV1_OFFSET 
DEV_REV2_OFFSET 
ADDR_OFFSET 
CRC1_OFFSET 
CRC2_OFFSET 

◆ LINE_FORMAT

Enumerator
HEADER_LEN 
DATA_LEN 

◆ LINE_INDEX

enum LINE_INDEX
Enumerator
FIRST_LINE 
DEV_ID_LINE 
LAST_LINE 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( tps53689  )

◆ tps53689_init()

uint8_t tps53689_init ( sensor_cfg cfg)
Here is the call graph for this function:

◆ tps53689_read()

uint8_t tps53689_read ( sensor_cfg cfg,
int *  reading 
)
Here is the call graph for this function:

◆ tps536xx_fwupdate()

bool tps536xx_fwupdate ( uint8_t  bus,
uint8_t  addr,
uint8_t *  img_buff,
uint32_t  img_size 
)
Here is the call graph for this function:

◆ tps536xx_get_crc()

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

◆ tps536xx_parse_image()

bool tps536xx_parse_image ( uint8_t *  img_buff,
uint32_t  img_size,
struct tps_config cfg 
)

Variable Documentation

◆ tps53685_dev_id

uint8_t tps53685_dev_id[] = { 0x54, 0x49, 0x53, 0x68, 0x50, 0x00 }

◆ tps536c5_dev_id

uint8_t tps536c5_dev_id[] = { 0x54, 0x49, 0x53, 0x6C, 0x50, 0x00 }