OpenBIC
OpenSource Bridge-IC
pt5161l.c File Reference
#include <stdlib.h>
#include <logging/log.h>
#include "util_spi.h"
#include "pt5161l.h"
#include "hal_i2c.h"
#include "libutil.h"
#include "sensor.h"
Include dependency graph for pt5161l.c:

Functions

 LOG_MODULE_REGISTER (dev_pt5161l)
 
 K_MUTEX_DEFINE (pt5161l_mutex)
 
bool pt5161l_get_vendor_id (I2C_MSG *msg)
 
bool pt5161l_write_block_data (I2C_MSG *msg, uint32_t address, uint8_t num_bytes, uint8_t *values)
 
bool pt5161l_read_block_data (I2C_MSG *msg, uint32_t address, uint8_t num_bytes, uint8_t *values)
 
bool pt5161l_read_block_data_to_sram (I2C_MSG *msg, uint32_t micro_ind_struct_oft, uint32_t eeprom_offset, uint8_t num_bytes, uint8_t *values)
 
bool pt5161l_i2c_master_soft_reset (I2C_MSG *msg)
 
bool pt5161l_i2c_master_write_ctrl_reg (I2C_MSG *msg, uint32_t offset, uint8_t length, uint8_t *data)
 
bool pt5161l_i2c_master_init (I2C_MSG *msg)
 
bool pt5161l_i2c_master_set_page (I2C_MSG *msg, int page)
 
bool pt5161l_i2c_master_multi_block_write (I2C_MSG *msg, uint16_t offset, int num_bytes, uint8_t *values)
 
bool pt5161l_pre_update (I2C_MSG *msg)
 
bool pt5161l_write_eeprom_image (I2C_MSG *msg, uint32_t offset, uint8_t *txbuf, uint16_t length, bool is_end)
 
bool pt5161l_post_update (I2C_MSG *msg)
 
uint8_t pt5161l_do_update (I2C_MSG *msg, uint32_t update_offset, uint8_t *txbuf, uint16_t length, bool is_end)
 
uint8_t pcie_retimer_fw_update (I2C_MSG *msg, uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, uint8_t flag)
 
bool pt5161l_get_fw_version (I2C_MSG *msg, uint8_t *version)
 
bool get_temp_calibration_codes (I2C_MSG *msg, pt5161l_init_arg *init_args)
 
uint8_t pt5161l_read_avg_temp (I2C_MSG *i2c_msg, uint8_t temp_cal_code_avg, double *avg_temperature)
 
uint8_t pt5161l_read (sensor_cfg *cfg, int *reading)
 
uint8_t pt5161l_init (sensor_cfg *cfg)
 

Variables

uint8_t PT5161L_VENDOR_ID [7] = { 0x06, 0x04, 0x00, 0x01, 0x00, 0xFA, 0x1D }
 

Function Documentation

◆ get_temp_calibration_codes()

bool get_temp_calibration_codes ( I2C_MSG msg,
pt5161l_init_arg init_args 
)
Here is the call graph for this function:

◆ K_MUTEX_DEFINE()

K_MUTEX_DEFINE ( pt5161l_mutex  )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_pt5161l  )

◆ pcie_retimer_fw_update()

uint8_t pcie_retimer_fw_update ( I2C_MSG msg,
uint32_t  offset,
uint16_t  msg_len,
uint8_t *  msg_buf,
uint8_t  flag 
)
Here is the call graph for this function:

◆ pt5161l_do_update()

uint8_t pt5161l_do_update ( I2C_MSG msg,
uint32_t  update_offset,
uint8_t *  txbuf,
uint16_t  length,
bool  is_end 
)

◆ pt5161l_get_fw_version()

bool pt5161l_get_fw_version ( I2C_MSG msg,
uint8_t *  version 
)

◆ pt5161l_get_vendor_id()

bool pt5161l_get_vendor_id ( I2C_MSG msg)
Here is the call graph for this function:

◆ pt5161l_i2c_master_init()

bool pt5161l_i2c_master_init ( I2C_MSG msg)
Here is the call graph for this function:

◆ pt5161l_i2c_master_multi_block_write()

bool pt5161l_i2c_master_multi_block_write ( I2C_MSG msg,
uint16_t  offset,
int  num_bytes,
uint8_t *  values 
)
Here is the call graph for this function:

◆ pt5161l_i2c_master_set_page()

bool pt5161l_i2c_master_set_page ( I2C_MSG msg,
int  page 
)
Here is the call graph for this function:

◆ pt5161l_i2c_master_soft_reset()

bool pt5161l_i2c_master_soft_reset ( I2C_MSG msg)
Here is the call graph for this function:

◆ pt5161l_i2c_master_write_ctrl_reg()

bool pt5161l_i2c_master_write_ctrl_reg ( I2C_MSG msg,
uint32_t  offset,
uint8_t  length,
uint8_t *  data 
)
Here is the call graph for this function:

◆ pt5161l_init()

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

◆ pt5161l_post_update()

bool pt5161l_post_update ( I2C_MSG msg)
Here is the call graph for this function:

◆ pt5161l_pre_update()

bool pt5161l_pre_update ( I2C_MSG msg)
Here is the call graph for this function:

◆ pt5161l_read()

uint8_t pt5161l_read ( sensor_cfg cfg,
int *  reading 
)

◆ pt5161l_read_avg_temp()

uint8_t pt5161l_read_avg_temp ( I2C_MSG i2c_msg,
uint8_t  temp_cal_code_avg,
double *  avg_temperature 
)
Here is the call graph for this function:

◆ pt5161l_read_block_data()

bool pt5161l_read_block_data ( I2C_MSG msg,
uint32_t  address,
uint8_t  num_bytes,
uint8_t *  values 
)
Here is the call graph for this function:

◆ pt5161l_read_block_data_to_sram()

bool pt5161l_read_block_data_to_sram ( I2C_MSG msg,
uint32_t  micro_ind_struct_oft,
uint32_t  eeprom_offset,
uint8_t  num_bytes,
uint8_t *  values 
)
Here is the call graph for this function:

◆ pt5161l_write_block_data()

bool pt5161l_write_block_data ( I2C_MSG msg,
uint32_t  address,
uint8_t  num_bytes,
uint8_t *  values 
)
Here is the call graph for this function:

◆ pt5161l_write_eeprom_image()

bool pt5161l_write_eeprom_image ( I2C_MSG msg,
uint32_t  offset,
uint8_t *  txbuf,
uint16_t  length,
bool  is_end 
)
Here is the call graph for this function:

Variable Documentation

◆ PT5161L_VENDOR_ID

uint8_t PT5161L_VENDOR_ID[7] = { 0x06, 0x04, 0x00, 0x01, 0x00, 0xFA, 0x1D }