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

Macros

#define MINUTES_IN_HOUR   60
 
#define HOURS_IN_DAY   24
 
#define DAYS_IN_YEAR   365
 
#define LEAP_YEAR_CYCLE   4
 
#define MINUTES_FROM_1970_1996   (820454400 / 60)
 

Functions

 LOG_MODULE_REGISTER (plat_fru_date)
 
int is_leap_year (int year)
 
int days_in_month (int year, int month)
 
void store_ascii_to_result (char *str, uint8_t *result, int *index)
 
uint8_t store_time_to_result (int year, int month, int day, int hour, int minute, int weekday, uint8_t *result)
 
uint8_t calculate_time_in_hex (long long total_minutes, uint8_t *result)
 
uint8_t get_fru_date (uint16_t *data, uint16_t *return_data)
 

Macro Definition Documentation

◆ DAYS_IN_YEAR

#define DAYS_IN_YEAR   365

◆ HOURS_IN_DAY

#define HOURS_IN_DAY   24

◆ LEAP_YEAR_CYCLE

#define LEAP_YEAR_CYCLE   4

◆ MINUTES_FROM_1970_1996

#define MINUTES_FROM_1970_1996   (820454400 / 60)

◆ MINUTES_IN_HOUR

#define MINUTES_IN_HOUR   60

Function Documentation

◆ calculate_time_in_hex()

uint8_t calculate_time_in_hex ( long long  total_minutes,
uint8_t *  result 
)
Here is the call graph for this function:

◆ days_in_month()

int days_in_month ( int  year,
int  month 
)
Here is the call graph for this function:

◆ get_fru_date()

uint8_t get_fru_date ( uint16_t *  data,
uint16_t *  return_data 
)
Here is the call graph for this function:

◆ is_leap_year()

int is_leap_year ( int  year)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_fru_date  )

◆ store_ascii_to_result()

void store_ascii_to_result ( char *  str,
uint8_t *  result,
int *  index 
)

◆ store_time_to_result()

uint8_t store_time_to_result ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  weekday,
uint8_t *  result 
)
Here is the call graph for this function: