⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 board.h

📁 DSP 5402 声音压缩 Demo板测试程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************/
/* Copyright (c) Texas Instruments, Incorporated  2000           */
/*****************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/*  BOARD.H - Header file for board.c                                        */
/*                                                                           */
/*                                                                           */
/*  FUNCTIONS:                                                               */
/*                                                                           */
/*  brd_init()                                                               */
/*  brd_init_bios()                                                          */
/*  brd_fifo_read()                                                          */
/*  brd_fifo_write()                                                         */
/*  brd_led_enable()                                                         */
/*  brd_led_disable()                                                        */
/*  brd_led_toggle()                                                         */
/*                                                                           */
/*                                                                           */
/*  STATIC FUNCTIONS:                                                        */
/*    None                                                                   */
/*                                                                           */
/*                                                                           */
/*  GLOBAL VARIABLES DEFINED                                                 */
/*                                                                           */
/*                                                                           */ 
/*****************************************************************************/
#ifndef _BOARD_H
#define _BOARD_H

#include "type.h"

#undef  OK
#define OK                       0

#undef  ERROR
#define ERROR                   -1

//port declarations used to access CPLD registers
volatile ioport u16 port0;
volatile ioport u16 port1;
volatile ioport u16 port2;
volatile ioport u16 port3;
volatile ioport u16 port4;
volatile ioport u16 port5;
volatile ioport u16 port6;
volatile ioport u16 port7;

/*----------------------------------------------------------------------------*/
/* MACRO DEFINITIONS                                                          */
/*----------------------------------------------------------------------------*/
#define MIN_CPU_FREQ             10
#define MAX_CPU_FREQ             100
#define DELAY_TIMER_PORT         0

#define LED0_MASK                0x1
#define LED1_MASK                0x2
#define LED2_MASK                0x4

#define CPLD_CTRL1_DEFAULT       0x10 //NMIEN=1
#define CPLD_DMCTRL_DEFAULT      0x00
#define CPLD_DBIO_DEFAULT        0x30
#define CPLD_CTRL2_DEFAULT       0x03
#define CPLD_SEM0_DEFAULT        0x00
#define CPLD_SEM1_DEFAULT        0x00
#define CPLD_SLIC_DEFAULT        0x00

#define CPLD_CTRL1_REG           port0
#define CPLD_STAT_REG            port1
#define CPLD_DMCTRL_REG          port2
#define CPLD_DBIO_REG            port3
#define CPLD_CTRL2_REG           port4
#define CPLD_SEM0_REG            port5
#define CPLD_SEM1_REG            port6
#define CPLD_SLIC_REG            port7

//CPLD register addresses used the C-callable portio routines
//DO NOT use the above defines with the c-callable portio
//routines prototyped in portio.h


/*****************************************************************************/
/* FUNCTIONS                                                                 */
/*****************************************************************************/

/******************************************************************************/
/* brd_init(u16 freq) - Initialize DSK board for use                          */
/*                                                                            */
/*  Parameters:                                                               */
/*      - freq: Desired board operating frequency.                            */
/*                                                                            */ 
/*  Return:                                                                   */
/*  - OK success                                                              */
/*  - ERROR failure                                                           */
/*                                                                            */ 
/*  Notes:                                                                    */
/*                                                                            */ 
/*  Board frequencies must be a multiple of 10 with the lowest being 20 MHz   */
/*  and the highest being 100 MHz.  Board frequencies supported are:	      */
/*  20,30,40,50,60,70,                                                        */ 
/*                                                                            */ 
/*  WARNING: This function is not compatible with DSP/BIOS                    */
/*                                                                            */
/******************************************************************************/
s16 brd_init(unsigned int cpuFreq);


/******************************************************************************/
/* brd_init_bios() - Initialize DSK board for use with DSP BIOS               */
/*                                                                            */
/*  Parameters:  none                                                         */
/*                                                                            */ 
/*  Return:                                                                   */
/*  - OK success                                                              */
/*  - ERROR failure                                                           */
/*                                                                            */ 
/*                                                                            */ 
/******************************************************************************/
s16 brd_init_bios(void);

/*****************************************************************************/
/*  s16 brd_interrupt_host(EvmInt intr)                                      */
/*                                                                           */ 
/*  This routine interrupts the host application .                           */
/*                                                                           */
/*  Parameters:                                                              */
/*      - intr: specified interrupt                                          */
/*  Return:                                                                  */
/*  - OK success                                                             */
/*  - ERROR failure                                                          */
/*                                                                           */ 
/*  Notes:                                                                   */
/*                                                                           */ 
/*****************************************************************************/
s16 brd_interrupt_host(BrdIntr intr);

/*****************************************************************************/
/*  s16 brd_led_enable(BrdLed led)                                            */
/*                                                                           */ 
/*  This routine enables the dsk led.             .                          */
/*                                                                           */
/*  Parameters:                                                              */
/*      - led - specific led                                                 */
/*                                                                           */ 
/*  Return:                                                                  */
/*  - OK success                                                             */
/*  - ERROR failure                                                          */
/*                                                                           */ 
/*  Notes:                                                                   */
/*                                                                           */ 
/*****************************************************************************/
s16 brd_led_enable(BrdLed led);

/*****************************************************************************/
/*  s16 brd_led_disable(BrdLed led)                                           */
/*                                                                           */ 
/*  This routine disables the dsk led.            .                          */
/*                                                                           */
/*  Parameters:                                                              */
/*      - led - specific led                                                 */
/*                                                                           */ 
/*  Return:                                                                  */
/*  - OK success                                                             */
/*  - ERROR failure                                                          */
/*                                                                           */ 
/*  Notes:                                                                   */
/*                                                                           */ 
/*****************************************************************************/
s16 brd_led_disable(BrdLed led);

/*****************************************************************************/
/*  s16 brd_toggle_led(BrdLed led)                                            */
/*                                                                           */ 
/*  This routine enables the dsk led.             .                          */
/*                                                                           */
/*  Parameters:                                                              */
/*      - led - specific led                                                 */
/*                                                                           */ 
/*  Return:                                                                  */
/*  - OK success                                                             */
/*  - ERROR failure                                                          */
/*                                                                           */ 
/*  Notes:                                                                   */
/*                                                                           */ 
/*****************************************************************************/
s16 brd_led_toggle(BrdLed led);

/*****************************************************************************/
/*  s16 brd_sem_get(void)                                                    */
/*                                                                           */ 
/*  This routine tries to obtain the specified user semaphore.               */
/*                                                                           */
/*                                                                           */
/*  Parameters:                                                              */
/*      - sem - desired semaphore                                            */
/*                                                                           */ 
/*  Return:                                                                  */
/*  - OK success                                                             */
/*  - ERROR failure                                                          */
/*                                                                           */ 
/*  Notes:                                                                   */
/*                                                                           */ 
/*****************************************************************************/
s16 brd_sem_get(BrdSem sem);

/*****************************************************************************/
/*  s16 brd_sem_wait(void)                                                   */
/*                                                                           */ 
/*  This routine tries to obtain the specified user semaphore. It blocks till*/
/*  the semaphore is obtained.                                               */
/*                                                                           */
/*  Parameters:                                                              */
/*      - sem - desired semaphore                                            */
/*                                                                           */ 
/*  Return:                                                                  */

⌨️ 快捷键说明

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