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

Functions

 LOG_MODULE_REGISTER (libutil)
 
ipmi_msg construct_ipmi_message (uint8_t seq_source, uint8_t netFn, uint8_t command, uint8_t source_inft, uint8_t target_inft, uint16_t data_len, uint8_t *data)
 
I2C_MSG construct_i2c_message (uint8_t bus_id, uint8_t address, uint8_t tx_len, uint8_t *data, uint8_t rx_len)
 
void reverse_array (uint8_t arr[], uint8_t size)
 
int ascii_to_val (uint8_t ascii_byte)
 
uint32_t uint32_t_byte_reverse (uint32_t data)
 
void convert_uint32_t_to_uint8_t_pointer (uint32_t data_32, uint8_t *data_8, uint8_t len, uint8_t endian)
 
void convert_uint8_t_pointer_to_uint32_t (uint32_t *data_32, const uint8_t *data_8, uint8_t len, uint8_t endian)
 
double power (double x, int y)
 
int uint8_t_to_dec_ascii_pointer (uint8_t val, uint8_t *result, uint8_t len)
 
int find_byte_data_in_buf (const uint8_t *buf, uint8_t byte_data, int start_index, int end_index)
 
void clear_bits (uint32_t *value, int start_bit, int end_bit)
 
void sort_bubble (int *array, int len)
 
size_t strlen16 (const char16_t *str)
 
char16_tstrcpy16 (char16_t *dest, const char16_t *src)
 
char16_tch16_strcat_char (char16_t *dest)
 

Function Documentation

◆ ascii_to_val()

int ascii_to_val ( uint8_t  ascii_byte)

◆ ch16_strcat_char()

char16_t * ch16_strcat_char ( char16_t dest)
Here is the call graph for this function:

◆ clear_bits()

void clear_bits ( uint32_t *  value,
int  start_bit,
int  end_bit 
)

◆ construct_i2c_message()

I2C_MSG construct_i2c_message ( uint8_t  bus_id,
uint8_t  address,
uint8_t  tx_len,
uint8_t *  data,
uint8_t  rx_len 
)

◆ construct_ipmi_message()

ipmi_msg construct_ipmi_message ( uint8_t  seq_source,
uint8_t  netFn,
uint8_t  command,
uint8_t  source_inft,
uint8_t  target_inft,
uint16_t  data_len,
uint8_t *  data 
)

◆ convert_uint32_t_to_uint8_t_pointer()

void convert_uint32_t_to_uint8_t_pointer ( uint32_t  data_32,
uint8_t *  data_8,
uint8_t  len,
uint8_t  endian 
)

◆ convert_uint8_t_pointer_to_uint32_t()

void convert_uint8_t_pointer_to_uint32_t ( uint32_t *  data_32,
const uint8_t *  data_8,
uint8_t  len,
uint8_t  endian 
)

◆ find_byte_data_in_buf()

int find_byte_data_in_buf ( const uint8_t *  buf,
uint8_t  byte_data,
int  start_index,
int  end_index 
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( libutil  )

◆ power()

double power ( double  x,
int  y 
)

◆ reverse_array()

void reverse_array ( uint8_t  arr[],
uint8_t  size 
)

◆ sort_bubble()

void sort_bubble ( int *  array,
int  len 
)

◆ strcpy16()

char16_t * strcpy16 ( char16_t dest,
const char16_t src 
)

◆ strlen16()

size_t strlen16 ( const char16_t str)

◆ uint32_t_byte_reverse()

uint32_t uint32_t_byte_reverse ( uint32_t  data)

◆ uint8_t_to_dec_ascii_pointer()

int uint8_t_to_dec_ascii_pointer ( uint8_t  val,
uint8_t *  result,
uint8_t  len 
)