📄 dc_hal.c
字号:
/*
** WASABI-Hot! version 1.2c (DeviceController sub-unit)
**
**
** -- copyright (c) 2001-2004 by Philips Japan, Ltd. -- All rights reserved --
**
**
** ** This code has been made to check/learn **
** ** the ISP1362/ISP1363 functionalities **
** ** Release 06-Aug-2004 **
**
** HIGASHIYAMA, Ken
**
** Application Laboratory, Mobile and Connectivity
** Semiconductors Div, Philips Japan Ltd.
** ken.higashiyama@philips.com
** +81-3-3740-5136
**
**
*/
#include <stdio.h>
#include <dos.h>
#include "general.h" //AO
#include "_dc/dc_hal.h"
#include "_dc/dc_isr.h" //AO
#include "_hc_hw/hw_acces.h"
#include "ui.h"
unsigned char gp_Dc_IRQ_num;
unsigned int gp_1362_Dc_command_address;
unsigned int gp_1362_Dc_data_address;
//*********************************************************************************************//
//
// 16-bit ISA port access
// It is IO port access can be used for PCI also //AO
//
//*********************************************************************************************//
void D13_outport(unsigned short port, unsigned short data)
{
outport(port, data);
}
unsigned short D13_inport(unsigned short port)
{
unsigned short i;
i=inport(port);
return i;
}
//*********************************************************************************************//
//
// Interrupt Control
//
//*********************************************************************************************//
void interrupt (*Oldhandler)(); // Original Interrupt Handler
/*
void init_isr()
{
disable_INT();
outportb(0xA0, 0x20);
outportb(0x20, 0x20);
// Oldhandler=getvect(0x71); // hook IRQ#9
Oldhandler=getvect(0x72); // hook IRQ#10
// setvect(0x71, usb_isr); // Interrupt Service Routine is usb_isr()
setvect(0x72, usb_isr); // Interrupt Service Routine is usb_isr()
outportb(0x21, (inportb(0x21) & 0xFB)); // clear interrupt mask for IRQ#2 (Cascaded from PIC2)
outportb(0xA1, (inportb(0xA1) & 0xFB)); // clear interrupt mask for IRQ#10
// outportb(0x21, (inportb(0x21) & (char)~0x04)); // clear interrupt mask for IRQ#2 (Cascaded from PIC2)
// outportb(0xA1, (inportb(0xA1) & (char)~0x04)); // clear interrupt mask for IRQ#10
outportb(0xA0, 0x20); // EOI to PIC2
outportb(0x20, 0x20); // EOI to PIC1
enable_INT();
}
*/
void dc_init_isr( void )
{
hwacces_install_isr( gp_Dc_IRQ_num, usb_isr );
Dc_printf( WHITE, CONTINUE, "ISR for DC installed (IRQ=%d)\r\n", gp_Dc_IRQ_num );
}
void end_of_isr( void )
{
outportb(0xA0, 0x20); // EOI to PIC2
outportb(0x20, 0x20); // EOI to PIC1
}
void release_interrupt()
{
// setvect(0x72, Oldhandler);
// setvect(0x0B, Oldhandler);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -