📄 uda13xx.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 : uda13xx.h 1.4
*
* Last update : 18:43:51 - 00/11/09
*
*
*/
#ifndef _UDA13XX_H
#define _UDA13XX_H
#include <tm1/tmBoard.h>
#include "l3.h"
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
/*------------------------------------ Defines ---------------------------------------*/
#define UDA13XX_ERR_IC_NOT_SUPPORTED 0x01
#define UDA13XX_ERR_MODE_NOT_SUPPORTED 0x02
#define uda13xxIICMode 0x0001
#define uda13xxXIOMode 0x0002
#define uda13xxGPIOMode 0x0003
#define UDA13XX_L3_DATA_MODE 0x00
#define UDA13XX_L3_STATUS_MODE 0x02
#define UDA13XX_L3_ADDRESS 0x05 /* default L3 address for UDA13xx */
#define UDA13XX_L3_ADDRESS_ALT 0x04 /* for the UDA1328T the address can be
switched between the two values */
/*------------------------------------- Types ----------------------------------------*/
typedef enum
{
UDA1320ATS_N2 = 0x00000001, /* DAC */
UDA1330TS = 0x00000002, /* DAC */
UDA1328T = 0x00000003, /* 6 channel DAC */
UDA1340 = 0x00000100, /* codec */
UDA1341TS = 0x00000100, /* codec */
UDA1344TS = 0x00000100, /* codec */
UDA1360TS = 0x00010000, /* ADC */
} uda13xx_t;
typedef struct uda13xxRegisters
{
UInt8 status0;
UInt8 status1;
UInt8 data0;
UInt8 data1;
UInt8 data2;
UInt8 data3;
}uda13xxRegisters_t, *puda13xxRegisters_t;
typedef struct uda13xxInputParam
{
Bool muteOn;
puda13xxRegisters_t regs;
} uda13xxInputParam_t, *puda13xxInputParam_t;
typedef struct uda13xxOutputParam
{
Bool muteOn;
puda13xxRegisters_t regs;
} uda13xxOutputParam_t, *puda13xxOutputParam_t;
typedef struct uda13xxParam
{
UInt32 mode;
Pointer modeParams;
puda13xxRegisters_t regs;
} uda13xxParam_t, *puda13xxParam_t;
/*------------------------------------ Functions ---------------------------------------*/
extern tmLibdevErr_t uda13xxInitOutput(puda13xxParam_t p, puda13xxOutputParam_t op);
extern tmLibdevErr_t uda13xxInitInput(puda13xxParam_t p, puda13xxInputParam_t ip);
extern tmLibdevErr_t uda13xxConfigOutput(puda13xxParam_t p, UInt32 subAddr, Pointer value);
extern tmLibdevErr_t uda13xxConfigInput(puda13xxParam_t p, UInt32 subAddr, Pointer value);
#if defined(__cplusplus)
}
#endif /* defined(__cplusplus) */
#endif /* _UDA13XX_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -