coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
saradc.c File Reference
#include <device/mmio.h>
#include <assert.h>
#include <delay.h>
#include <soc/clock.h>
#include <soc/saradc.h>
#include <stdint.h>
#include <timer.h>
Include dependency graph for saradc.c:

Go to the source code of this file.

Data Structures

struct  rk3399_saradc_regs
 

Macros

#define ADC_STOP   0
 
#define INT_EN   (1 << 5)
 
#define ADC_PWR_CTRL   (1 << 3)
 
#define ADC_CHN_SEL_MASK   7
 
#define ADC_CHN_SEL_SHIFT   0
 
#define DATA_MASK   0x3FF
 
#define SARADC_HZ   (4*MHz)
 
#define SARADC_MAX_CHANNEL   6
 
#define SARADC_DELAY_PU   (1 * 1000 * 1000 * 1000 / SARADC_HZ * 4)
 

Functions

 check_member (rk3399_saradc_regs, dly_pu_soc, 0xc)
 
u32 get_saradc_value (u32 chn)
 

Variables

struct rk3399_saradc_regsrk3399_saradc = (void *)SARADC_BASE
 

Macro Definition Documentation

◆ ADC_CHN_SEL_MASK

#define ADC_CHN_SEL_MASK   7

Definition at line 27 of file saradc.c.

◆ ADC_CHN_SEL_SHIFT

#define ADC_CHN_SEL_SHIFT   0

Definition at line 28 of file saradc.c.

◆ ADC_PWR_CTRL

#define ADC_PWR_CTRL   (1 << 3)

Definition at line 26 of file saradc.c.

◆ ADC_STOP

#define ADC_STOP   0

Definition at line 22 of file saradc.c.

◆ DATA_MASK

#define DATA_MASK   0x3FF

Definition at line 31 of file saradc.c.

◆ INT_EN

#define INT_EN   (1 << 5)

Definition at line 25 of file saradc.c.

◆ SARADC_DELAY_PU

#define SARADC_DELAY_PU   (1 * 1000 * 1000 * 1000 / SARADC_HZ * 4)

Definition at line 37 of file saradc.c.

◆ SARADC_HZ

#define SARADC_HZ   (4*MHz)

Definition at line 33 of file saradc.c.

◆ SARADC_MAX_CHANNEL

#define SARADC_MAX_CHANNEL   6

Definition at line 35 of file saradc.c.

Function Documentation

◆ check_member()

check_member ( rk3399_saradc_regs  ,
dly_pu_soc  ,
0xc   
)

◆ get_saradc_value()

Variable Documentation

◆ rk3399_saradc

struct rk3399_saradc_regs* rk3399_saradc = (void *)SARADC_BASE

Definition at line 19 of file saradc.c.

Referenced by get_saradc_value().