📄 w83977atf.h
字号:
/*
* Copyright (c) 1999 by TriMedia Technologies.
*
* +------------------------------------------------------------------+
* | This software is furnished under a license and may only be used |
* | and copied in accordance with the terms and conditions of such |
* | a license and with the inclusion of this copyright notice. This |
* | software or any other copies of this software may not be provided|
* | or otherwise made available to any other person. The ownership |
* | and title of this software is not transferred. |
* | |
* | The information in this software is subject to change without |
* | any prior notice and should not be construed as a commitment by |
* | TriMedia Technologies. |
* | |
* | this code and information is provided "as is" without any |
* | warranty of any kind, either expressed or implied, including but |
* | not limited to the implied warranties of merchantability and/or |
* | fitness for any particular purpose. |
* +------------------------------------------------------------------+
*
* Module name : w83977atf.h 1.4
*
* Last update : 18:43:52 - 00/11/09
*/
#include <tmlib/tmtypes.h>
#include <tm1/tmLibdevErr.h>
#include <tm1/tsaIR.h>
#include <tm1/tsaUartBoard.h>
#include <tm1/tsaUart.h>
#ifndef _W83977ATF_H_
#define _W83977ATF_H_
#define W83977ATF_PNP_ADDRESS 0x3F0
#define W83977ATF_PNP_WRITE 0x3F1
#define W83977ATF_PNP_READ 0x3F1
#define W83977ATF_SEL_LDEV 0x07
#define W83977ATF_IR_BASE 0x400
/* IR registers */
/* SET 0 REGISTERS */
#define W83977ATF_IR_RBR (W83977ATF_IR_BASE + 0) /* Receiver Buffer Register RO */
#define W83977ATF_IR_ICR (W83977ATF_IR_BASE + 1) /* Interrupt Control Register RW */
#define W83977ATF_IR_ISR (W83977ATF_IR_BASE + 2) /* Interrupt Status Register RO */
#define W83977ATF_IR_UFR (W83977ATF_IR_BASE + 2) /* FIFO Control Register WO */
#define W83977ATF_IR_SSR (W83977ATF_IR_BASE + 3) /* Set Select Register RW */
#define W83977ATF_IR_UCR (W83977ATF_IR_BASE + 3) /* IR Control Register RW in bank 0 */
#define W83977ATF_IR_HCR (W83977ATF_IR_BASE + 4) /* Handshake control register */
#define W83977ATF_IR_USR (W83977ATF_IR_BASE + 5) /* IR Status Register */
#define W83977ATF_IR_AUDR (W83977ATF_IR_BASE + 7) /* User Defined register */
/* SET 2 REGISTERS */
#define W83977ATF_IR_ADCR1 (W83977ATF_IR_BASE + 2) /* Advanced IR Control Register 1 */
#define W83977ATF_IR_ADCR2 (W83977ATF_IR_BASE + 4) /* Advanced IR Control Register 2 */
/* SET 4 REGISTERS */
#define W83977ATF_IR_MSL (W83977ATF_IR_BASE + 2) /* Mode Select Register */
#define W83977ATF_IR_SET0 0x03
#define W83977ATF_IR_SET1 0x80
#define W83977ATF_IR_SET2 0xE0
#define W83977ATF_IR_SET3 0xE4
#define W83977ATF_IR_SET4 0xE8
#define W83977ATF_IR_SET5 0xEC
#define W83977ATF_IR_SET6 0xF0
#define W83977ATF_IR_SET7 0xF4
/* UART registers */
#define W83977ATF_UART_RBR 0x00
#define W83977ATF_UART_TBR 0x00
#define W83977ATF_UART_ICR 0x01
#define W83977ATF_UART_ISR 0x02
#define W83977ATF_UART_UFR 0x02
#define W83977ATF_UART_UCR 0x03
#define W83977ATF_UART_HCR 0x04
#define W83977ATF_UART_USR 0x05
#define W83977ATF_UART_HSR 0x06
#define W83977ATF_UART_UDR 0x07
#define W83977ATF_UART_BLL 0x00
#define W83977ATF_UART_BHL 0x01
#define W83977ATF_SUPPORTED_BAUD_RATES (UART_BAUD_9600 | \
UART_BAUD_14400 | \
UART_BAUD_19200 | \
UART_BAUD_38400 | \
UART_BAUD_57600 | \
UART_BAUD_115200 | \
UART_BAUD_230400 | \
UART_BAUD_460800 | \
UART_BAUD_921600 )
#if defined(__cplusplus)
extern "C" {
#endif
/************************************* types **************************************/
typedef tmLibdevErr_t (* w83977SioWriteFunc_t) (UInt32 sioAddress, UInt8 data);
typedef tmLibdevErr_t (* w83977SioReadFunc_t) (UInt32 sioAddress, UInt32 *data);
typedef struct
{
w83977SioWriteFunc_t sioWriteFunc;
w83977SioReadFunc_t sioReadFunc;
Bool sharedInterrupts; /* True - use shared interrupts */
}w83977atfParams_t, *pw83977atfParams_t;
typedef struct
{
tsaIRDevice_t irDevice;
}w83977atfIRParams_t, *pw83977atfIRParams_t;
/*********************************** functions **************************************/
extern tmLibdevErr_t w83977atfInit(pw83977atfParams_t params);
/* PIC support (used in shared interrupts mode) */
extern Bool w83977atfPICSourceDetect(UInt32 * source);
/* IR support */
extern tmLibdevErr_t w83977atfIRInit(pw83977atfIRParams_t params);
extern void w83977atfIRGetEvent(tsaIREvent_t *event, UInt32 *value);
/* UART support */
extern tmLibdevErr_t w83977atfUartInitPort(unitSelect_t portID, pboardUartParam_t params);
extern tmLibdevErr_t w83977atfUartTermPort(unitSelect_t portID);
extern tmLibdevErr_t w83977atfUartSetBaudRate(unitSelect_t portID, tsaUartBaud_t baudRate);
extern tmLibdevErr_t w83977atfUartSetSerialDataFormat(unitSelect_t portID, Int numStopBits, Int numDataBits, tsaUartParity_t parity);
extern tmLibdevErr_t w83977atfUartSetTxInt(unitSelect_t portID, Bool enable);
extern tmLibdevErr_t w83977atfUartSetRxInt(unitSelect_t portID, Bool enable);
extern tmLibdevErr_t w83977atfUartSetLineStatusInt(unitSelect_t portID, Bool enable);
extern tmLibdevErr_t w83977atfUartSetModemStatusInt(unitSelect_t portID, Bool enable);
extern tmLibdevErr_t w83977atfUartReadData(unitSelect_t portID, Address data);
extern tmLibdevErr_t w83977atfUartWriteData(unitSelect_t portID, Char data);
extern Bool w83977atfUartGetEvent(unitSelect_t portID, tsaUartConfigEvent_t *event);
extern tmLibdevErr_t w83977atfUartConfig(unitSelect_t portID, tsaUartConfig_t command, Pointer value);
#if defined(__cplusplus)
}
#endif
#endif /* _W83977ATF_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -