ml2011usersfunc.c

来自「OkiML2011Driver」· C语言 代码 · 共 72 行

C
72
字号
/******************************************************************************
*
*	Oki Sound Library for ML2011
*		ML2011 Driver (ML2011usersfunc.c)
*
*		 Oki Electric Industry Co.,Ltd.
*		 Software Development Department
*
*		 2006, 6, 30
*	----------------------------------------------
*	System Dependent Function for ML2011.
******************************************************************************/
#include "ML2011usersfunc.h"

/******************************************************************************
*	1. EXTERNAL AMPLIFIER CONTROL	(CUSTOMIZE!)
*	----------------------------------------
*	-usrExtHpAmpOpen() 
*	-usrExtHpAmpClose()
******************************************************************************/
/******************************************************************************
* usrExtAmpOpen()
* ----------------------------------------
*	REMARKS:
*	 Wake up external  headphone amplifier.
******************************************************************************/

#define	GPPOE			0xB7A00080
#define	HPAMP_ENABLE	0x0008		//bit3

void usrExtHpAmpOpen(void)
{
	*(volatile unsigned int *)(GPPOE) = 
		((*(volatile unsigned int *)(GPPOE)) | HPAMP_ENABLE);
}
/******************************************************************************
* usrExtHpAmpClose()
* ----------------------------------------
*	REMARKS:
*	 make external amplifier sleep.
******************************************************************************/
void usrExtHpAmpClose(void)
{
	*(volatile unsigned int *)(GPPOE) = 
		((*(volatile unsigned int *)(GPPOE)) & ~HPAMP_ENABLE);
}

/******************************************************************************
*	2. TIMER DELAY	(CUSTOMIZE!)
*	----------------------------------------
*	-usrTimerDelay() 
******************************************************************************/
/******************************************************************************
* usrTimerDelay()
* ------------------------------------------------------------------------------
*	REMARKS:
*	 delay task. Use operating system's funtion.
*	INPUT:
*	 delay time (milli-second)
******************************************************************************/
void usrTimerDelay(int msec)
{
	unsigned char i,j,k;
	for(k=0;k<msec;k++){
		for(i=0;i<127;i++){
			for(j=0;j<127;){
				j++;
			}
		}
	}
}

⌨️ 快捷键说明

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