⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib_apmc.h

📁 ARM9200开发板的ROM boot程序源码1.0
💻 H
字号:
//*----------------------------------------------------------------------------
//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : lib_apmc.h
//* Object              : Power Management Controller Header File.
//*
//* 1.0 19/03/01  HI    : Creation
//*----------------------------------------------------------------------------
#ifndef lib_apmc_h
#define lib_apmc_h

#define     PS_MODE_IDLE            0x1
#define     PS_ALL_PERIPH_ACTIVE    0x2
#define     PS_ALL_PERIPH_INACTIVE  0x3

//* -------------------
//* Include files
//* -------------------
#include "apmc.h"

__inline void at91_apmc_scer(AT91PS_APMC pAPMC, int clock)
{
	pAPMC->APMC_SCER = clock;
}

__inline void at91_apmc_scdr(AT91PS_APMC pAPMC, int clock)
{
	pAPMC->APMC_SCDR = clock;
}

__inline int at91_apmc_scsr(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_SCSR);
}

__inline void at91_apmc_pcer(AT91PS_APMC pAPMC, int periph_clock)
{
	pAPMC->APMC_PCER = (1 << periph_clock);
}

__inline void at91_apmc_pcdr(AT91PS_APMC pAPMC, int periph_clock)
{
	pAPMC->APMC_PCDR = (1 << periph_clock);
}

__inline int at91_apmc_pcsr(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_PCSR);
}

__inline int at91_apmc_set_mor(AT91PS_APMC pAPMC, int mos_state, int oscount)
{
	pAPMC->APMC_MOR = mos_state | (oscount << 8);
}

__inline int at91_apmc_get_mor(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_MOR);
}

__inline int at91_apmc_fmr(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_MCFR);
}

__inline void at91_apmc_set_pllar(AT91PS_APMC pAPMC, int pll_value)
{
	pAPMC->APMC_PLLAR = pll_value;
}

__inline int at91_apmc_get_pplar(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_PLLAR);
}

__inline void at91_apmc_set_pllbr(AT91PS_APMC pAPMC, int pll_value)
{
	pAPMC->APMC_PLLBR = pll_value;
}

__inline int at91_apmc_get_pplbr(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_PLLBR);
}

__inline void at91_apmc_set_mckr(AT91PS_APMC pAPMC, int entry, int master_clock)
{
	pAPMC->APMC_MCKR = master_clock;
}

__inline int at91_apmc_get_mckr(AT91PS_APMC pAPMC, int entry)
{
	return(pAPMC->APMC_MCKR);
}

__inline void at91_apmc_set_pckr(AT91PS_APMC pAPMC, int entry, int clock)
{
	pAPMC->APMC_PCKR[entry] = clock;
}

__inline int at91_apmc_get_pckr(AT91PS_APMC pAPMC, int entry)
{
	return(pAPMC->APMC_PCKR[entry]);
}

__inline void at91_apmc_ier(AT91PS_APMC pAPMC, int ints)
{
	pAPMC->APMC_IER = ints;
}

__inline void at91_apmc_idr(AT91PS_APMC pAPMC, int ints)
{
	pAPMC->APMC_IDR = ints;
}

__inline int at91_apmc_sr(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_SR);
}

__inline int at91_apmc_imr(AT91PS_APMC pAPMC)
{
	return(pAPMC->APMC_IMR);
}



/* -----------------------*/
/* Function Prototyping   */
/* -----------------------*/
extern void at91_clock_set_mode (AT91PS_APMC, u_int  );
extern void at91_clock_open (AT91PS_APMC, u_int  );
extern void at91_clock_close ( AT91PS_APMC, u_int );
extern u_int at91_clock_get_status ( AT91PS_APMC, u_int  );
extern u_int at91_clock_get_pll_status ( AT91PS_APMC );
extern void at91_clock_generator_mode (AT91PS_APMC, u_int , u_int );

#endif //* lib_apmc_h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -