glue_fur.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
- #include "playcorenav_sacdglue_fur.h"
- #include "playcoresampsamp_gen.h"
- #include "kerneluitronrtos.h"
- static SAMP(UInt16) furBase = 0x0000;
- static SAMP(UInt16) furIhBase = 0x0000;
- SAMP(UInt16) SAMP(FUR_ReadMem)(SAMP(UInt32) addr)
- {
- SAMP(UInt16) val;
- int i;
- STATUS_REG srValue = InterruptDisable();
- if (((addr>>7)&0xFFFF) != furBase)
- {
- /* Save base-address */
- furBase = (SAMP(UInt16))((addr>>7)&0xFFFF);
- /* Activate H_A_sel and put base-address on data bus */
- SACD_Write16(0x80, furBase);
- }
- /* Read data */
- val = SACD_Read16(addr&0x7E);
- /* Wait at least Twait (30 sys_clk cycles) */
- /* #error insert required delay here */
- /* Is needed because no wait signal is present */
- for(i = 0; i < 8; i++);
- /* Read data again */
- val = SACD_Read16(0x80);
- set_SR(srValue);
- return val;
- }
- void SAMP(FUR_WriteMem)(SAMP(UInt32) addr, SAMP(UInt16) val)
- {
- int i;
- STATUS_REG srValue = InterruptDisable();
- if (((addr>>7)&0xFFFF) != furBase)
- {
- /* Save base-address */
- furBase = (SAMP(UInt16))((addr>>7)&0xFFFF);
- /* Activate H_A_sel and put base-address on data bus */
- SACD_Write16(0x80, furBase);
- }
- /* Write data */
- SACD_Write16(addr&0x7E, val);
- /* Wait at least Twait (30 sys_clk cycles) */
- /* #error insert required delay here */
- for(i = 0; i < 8; i++);
- set_SR(srValue);
- }
- SAMP(UInt16) SAMP(FUR_ReadReg)(SAMP(UInt32) addr)
- {
- SAMP(UInt16) val;
- val = SAMP(FUR_ReadMem)(addr);
- return ((val<<8)|(val>>8));
- }
- void SAMP(FUR_WriteReg)(SAMP(UInt32) addr, SAMP(UInt16) val)
- {
- val = ((val<<8)|(val>>8));
- SAMP(FUR_WriteMem)(addr, val);
- }
- void SAMP(FUR_IhEnter)(void)
- {
- furIhBase = furBase;
- }
- void SAMP(FUR_IhExit)(void)
- {
- furBase = furIhBase;
- /* Activate H_A_sel and put base-address on data bus */
- SACD_Write16(0x80, furBase);
- }