Documente Academic
Documente Profesional
Documente Cultură
BSL Overview
The BSL provides a C-language interface for configuring and controlling all on-board devices. The library consists of discrete modules that are built and archived into a library file. Each module represents an individual Application Program Interface (API) and is referred to simply as an API module. The module granularity is structured so each device is implemented in an individual API module. The goal of the BSL is to provide a level of hardware abstraction and software standardization that improves development time and portability.
BSL Overview
The BSL contains 5 modules:
Module Board Setup Codec DIP Switch LED Flash Function General board initialization Access the AIC23 codec Read DIP switches Manipulate LEDs Program and erase Flash
The libraries and include files reside in these directories: TI_DIR\C6000\dsk6713\lib Library Files TI_DIR\C6000\dsk6713\include Include Files where TI_DIR is the directory Code Composer is installed in.
Project Checklist
The following are things to check when creating your own project:
File Type CDB File Action The CDB file contains all of the DSP/BIOS settings. The easiest thing to do is copy, rename and modify one of the BSL examples.
Linker Command File Included Make sure the linker command file is included in your project. It ends in .cmd and is auto-generated when your CDB file is compiled. Endian Mode is Consistent The endian mode must be consistent in each place it is set. It is set in the project options by selecting Project Build Options and viewing the Advanced tab. It is also set in your CDB file under System Global Settings in the DSP Endian Mode selector.
Project Checklist
File BSL Library Included Action Make sure the correct BSL library is included. The BSL library should be specified by selecting Project Build Options on the Linker tab and typing dsk6713bsl.lib in the "Include Libraries" field. If you cant see header (.h) files that your program uses, make sure you have the paths set correctly in Project Build Options on the Preprocessor tab. If you cant see header files in the same directory as your project, add a . to your search path. To include multiple paths, place a semicolon between paths. Include both the project directory and the BSL include directory
Project Checklist
File Processor Options are Set Action The processor type is set under Project Build Options by selecting C671x in the Target Version field of the Basic tab. It is also used in your CDB file to select the matching version of the Chip Support Library. Look under System Global Settings in the CSL selector box. If your program does not use DSP/BIOS you must manually define the value CHIP_6713 under Project Build Options on the Define Symbols field of the Preprocessor tab. Use a semicolon to separate multiple values if something else is already defined.
DSK6713_AIC23_openCodec()
Required headers: dsk6713.h, dsk6713_aic23.h Prototype
DSK6713_AIC23_CodecHandle DSK6713_AIC23_openCodec(int id, DSK6713_AIC23_Config *Config)
DSK6713_AIC23_openCodec()
/* Codec configuration settings */ DSK6713_AIC23_Config config = { \ 0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \ 0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\ 0x01f9, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \ 0x01f9, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \ 0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \ 0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \ 0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \ 0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \ 0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \ 0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \ }; // Open codec with default settings DSK6713_AIC23_CodecHandle hCodec; hCodec = DSK6713_AIC23_openCodec(0, &config);
DSK6713_AIC23_setFreq()
Set the codec sample rate
void DSK6713_AIC23_setFreq(DSK6713_AIC23_CodecHandle hCodec, Uint32 freq);
Parameters hCodec Codec handle. freq Sample rate of the codec clock. Default is 48KHz
DSK6713_AIC23_setFreq()
Field Value Frequency 8 KHz 16 KHz 24 KHz 32 KHz 44.1 KHz 48 KHz 96 KHz
DSK6713_AIC23_read()
Int16 DSK6713_AIC23_read(DSK6713_AIC23_Co decHandle hCodec, Int32 *val)
Parameters:
hCodec - Codec Handle val pointer to int32 variable to get the data
Return Value:
TRUE Data was successfully read FALSE Data port is busy
DSK6713_AIC23_read()
The function read 16-bit sample from each channel:
Left channel sample is stored in the high word Rigth channel sample is stored in the low word
Before using the values of the samples, the value should be converted to short int.
DSK6713_AIC23_write ()
Int16 DSK6713_AIC23_write(DSK6713_AIC23_C odecHandle hCodec, Int32 val)
Parameters:
hCodec - Codec Handle val Int32 variable to write to codec
Return Value:
TRUE Data written succesfully FALSE Data port is busy
DSK6713_AIC23_write ()
Example:
data = 0x12345678 while(!DSK6713_AIC23_write(hCodec, data))