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

Classes

struct  ADC_INFO
 
struct  _1OU_CARD_MAPPING_TABLE
 

Macros

#define I2C_DATA_SIZE   5
 
#define CPLD_1OU_CARD_DETECTION   0x09
 
#define NUMBER_OF_ADC_CHANNEL   16
 
#define AST1030_ADC_BASE_ADDR   0x7e6e9000
 

Enumerations

enum  ADC_REF_VOL_SELECTION {
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40
}
 
enum  CONDITION {
  LOWER = 0x0 , HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 ,
  HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 , HIGHER = 0x01 ,
  RANGE = 0x02 , LOWER = 0x0 , HIGHER = 0x01 , RANGE = 0x02 ,
  LOWER = 0x0 , HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 ,
  HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 , HIGHER = 0x01 ,
  RANGE = 0x02
}
 
enum  ADC_CHANNEL {
  CHANNEL_6 = 6 , CHANNEL_7 = 7 , CHANNEL_6 = 6 , CHANNEL_7 = 7 ,
  CHANNEL_6 = 6 , CHANNEL_7 = 7 , CHANNEL_6 = 6 , CHANNEL_6 = 6 ,
  CHANNEL_6 = 6 , CHANNEL_7 = 7 , CHANNEL_5 = 5 , NUMBER_OF_ADC_CHANNEL = 16 ,
  ADC_CHANNEL_2 = 2 , ADC_CHANNEL_12 = 12 , ADC_CHANNEL_13 = 13 , NUMBER_OF_ADC_CHANNEL = 16
}
 

Functions

 LOG_MODULE_REGISTER (plat_class)
 
bool get_adc_voltage (int channel, float *voltage)
 
uint8_t get_system_class ()
 
CARD_STATUS get_1ou_status ()
 
CARD_STATUS get_2ou_status ()
 
uint8_t get_hsc_module ()
 
void init_hsc_module ()
 
void init_platform_config ()
 

Variables

struct ADC_INFO adc_info [NUMBER_OF_ADC_CHANNEL]
 
struct _1OU_CARD_MAPPING_TABLE _1ou_card_mapping_table []
 

Macro Definition Documentation

◆ AST1030_ADC_BASE_ADDR

#define AST1030_ADC_BASE_ADDR   0x7e6e9000

◆ CPLD_1OU_CARD_DETECTION

#define CPLD_1OU_CARD_DETECTION   0x09

◆ I2C_DATA_SIZE

#define I2C_DATA_SIZE   5

◆ NUMBER_OF_ADC_CHANNEL

#define NUMBER_OF_ADC_CHANNEL   16

Enumeration Type Documentation

◆ ADC_CHANNEL

Enumerator
CHANNEL_6 
CHANNEL_7 
CHANNEL_6 
CHANNEL_7 
CHANNEL_6 
CHANNEL_7 
CHANNEL_6 
CHANNEL_6 
CHANNEL_6 
CHANNEL_7 
CHANNEL_5 
NUMBER_OF_ADC_CHANNEL 
ADC_CHANNEL_2 
ADC_CHANNEL_12 
ADC_CHANNEL_13 
NUMBER_OF_ADC_CHANNEL 

◆ ADC_REF_VOL_SELECTION

Enumerator
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 

◆ CONDITION

enum CONDITION
Enumerator
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 

Function Documentation

◆ get_1ou_status()

CARD_STATUS get_1ou_status ( )

◆ get_2ou_status()

CARD_STATUS get_2ou_status ( )

◆ get_adc_voltage()

bool get_adc_voltage ( int  channel,
float *  voltage 
)

◆ get_hsc_module()

uint8_t get_hsc_module ( )

◆ get_system_class()

uint8_t get_system_class ( )

◆ init_hsc_module()

void init_hsc_module ( )

◆ init_platform_config()

void init_platform_config ( )
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_class  )

Variable Documentation

◆ _1ou_card_mapping_table

struct _1OU_CARD_MAPPING_TABLE _1ou_card_mapping_table[]
Initial value:
= {
}
@ RANGE
Definition: plat_class.c:76
@ LOWER
Definition: plat_class.c:74
@ TYPE_1OU_EXP_WITH_6_M2
Definition: plat_class.h:40
@ TYPE_1OU_RAINBOW_FALLS
Definition: plat_class.h:41
@ TYPE_1OU_EXP_WITH_NIC
Definition: plat_class.h:44
@ TYPE_1OU_VERNAL_FALLS_WITH_AST
Definition: plat_class.h:43
@ TYPE_1OU_SI_TEST_CARD
Definition: plat_class.h:39
@ TYPE_1OU_VERNAL_FALLS_WITH_TI
Definition: plat_class.h:42

◆ adc_info

Initial value:
= {
{ 0x10, 0 }, { 0x10, 16 }, { 0x14, 0 }, { 0x14, 16 }, { 0x18, 0 }, { 0x18, 16 },
{ 0x1C, 0 }, { 0x1C, 16 }, { 0x110, 0 }, { 0x110, 16 }, { 0x114, 0 }, { 0x114, 16 },
{ 0x118, 0 }, { 0x118, 16 }, { 0x11C, 0 }, { 0x11C, 16 },
}