📄 iekc64_init.h
字号:
#ifndef _IEKC64_INIT_H_
#define _IEKC64_INIT_H_
#include <csl_stdinc.h>
#include "iekc64.h"
#ifdef __cplusplus
extern "C" {
#endif
/*=======================================================================*//*!
\defgroup INIT INIT - Board Initialization and configuration functions
\brief This module provides the main board initialization function
</P>*//*==============================================================*//*@{*/
/*--------------------------------------------------------------------------*/
/*! Module error codes.<br>
If status returned from a module call is negative (or
IEKC64_SUCCESS(return code) is false), the value represents
an error from the list below:
*/
enum IEKC64_INIT_STATUS
{
//! An error has occured during SDRAM-A testing
IEKC64_ERR_INIT_SDRAMA = IEKC64_ERR_CODE( IEKC64_INIT, 1 ),
//! An error has occured during SDRAM-B testing
IEKC64_ERR_INIT_SDRAMB = IEKC64_ERR_CODE( IEKC64_INIT, 2 ),
//! An invalid dip-switch configuration has been detected
IEKC64_ERR_BAD_DIPSWITCH_CONFIG = IEKC64_ERR_CODE( IEKC64_INIT, 3 ),
//! An invalid dip-switch configuration has been detected
IEKC64_EEPROM_TIMEOUT_WAITRDY = IEKC64_ERR_CODE( IEKC64_EEPROM, 4 ),
//! Timeout occured on EEPROM configuration
IEKC64_EEPROM_TIMEOUT_WAITCFG = IEKC64_ERR_CODE( IEKC64_EEPROM, 5 ),
//! Error when reading clock on EEPROM. The IEK board is initialized even if this error appear.
IEKC64_EEPROM_CLK_ERROR = IEKC64_ERR_CODE( IEKC64_EEPROM, 6 ),
//! Error when reading address for EEPROM
IEKC64_EEPROM_BAD_ADDR = IEKC64_ERR_CODE( IEKC64_EEPROM, 7 )
};
/*--------------------------------------------------------------------------*/
/*! Initializes the board
This function configures EMIF on board registers.
It also downloads the FPGA data (this takes around 1 second if the FPGA has not been previously loaded)
\return An IEKC64_STATUS. If the call succeed, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true if the value
represents a successful call.
\b Example:
\verbatim
IEKC64_STATUS status;
// Initialize the board
status = IEKC64_init();
if ( !IEKC64_SUCCESS(status) )
{
printf( "IEKC64_init() returned error %08X\n", status );
exit( 1 );
}
\endverbatim
You can find usage of this function in <a href="../../example/loopback_audio">example/loopback_audio</a>
/<a href="../../example/loopback_audio/loopback_audio.c">loopback_audio.c</a>.
*/
IEKC64_STATUS IEKC64_init(void);
/*--------------------------------------------------------------------------*/
/*! Return the version of IEKC64x library
This function returns the version of the used IEKC64x library.
\return version of IEKC64x library
\b Example:
\verbatim
Uint32 version;
version=IEKC64_getLibraryVersion();
\endverbatim
*/
Uint32 IEKC64_getLibraryVersion();
/*--------------------------------------------------------------------------*/
/*! Returns the DSP clock frequency in MHz
This function return the DSP clock frquency in MHz.
\param pDspBiosClock
This parameter return the DSP speed defined in the DSP/BIOS configuration file. If this parameter is not
equal to the DSP clock frequency you must change it in the DSP/BIOS configuration file.
\return DSP clock frequency in MHz
\b Example:
\verbatim
Uint32 boardCpuClock;
Uint32 dspBiosCpuClock;
boardCpuClock=IEKC64_getCpuClock(&dspBiosCpuClock);
if(boardCpuClock != dspBiosCpuClock)
printf("WARNING: Board clock is different from DSP/BIOS configuration file clock.\n");
\endverbatim
You can find usage of this function in <a href="../../example/loopback_audio">example/loopback_audio</a>
/<a href="../../example/loopback_audio/loopback_audio.c">loopback_audio.c</a>.
*/
Uint32 IEKC64_getCpuClock(Uint32 *pDspBiosClock);
/*@}*//* end of group INIT */
#ifdef __cplusplus
}
#endif
#endif /* ifndef _IEKC64_INIT_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -