Texas Instruments TMS320C6000 User Manual
Texas Instruments TMS320C6000 User Manual

Texas Instruments TMS320C6000 User Manual

Tms320c6000 dsk board support library api user's guide
Hide thumbs Also See for TMS320C6000:

Advertisement

TMS320C6000 DSK
Board Support Library
API User's Guide
Literature Number: SPRU432A
October 2001
Printed on Recycled Paper

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C6000 and is the answer not in the manual?

Questions and answers

Summary of Contents for Texas Instruments TMS320C6000

  • Page 1 TMS320C6000 DSK Board Support Library API User’s Guide Literature Number: SPRU432A October 2001 Printed on Recycled Paper...
  • Page 2 Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
  • Page 3: Read This First

    About This Manual The TMS320C6000t DSK Board Support Library (BSL) is a set of application programming interfaces (APIs) used to configure and control all on-board de- vices. It is intended to make it easier for developers by eliminating much of the tedious grunt-work usually needed to get algorithms up and running in a real system.
  • Page 4 Macro names are written in uppercase text; function names are written in lowercase. TMS320C6000 devices are referred to throughout this reference guide as C6201, C6202, etc. Related Documentation From Texas Instruments The following books describe the TMS320C6x devices and related support tools.
  • Page 5 TMS320C6000 Programmer’s Guide (literature number SPRU198) describes ways to optimize C and assembly code for the TMS320C6000 DSPs and includes application program examples. TMS320C6000 Assembly Language Tools User’s Guide (literature number SPRU186) describes the assembly language tools (assembler, linker, and other tools used to develop assembly language code), assembler directives, macros, common object file format, and symbolic debugging directives for the ’C6000 generation of devices.
  • Page 6: Table Of Contents

    BSL Overview ..............Provides an overview of the board support library (BSL), describes its beneficial features, and lists each of its API modules.
  • Page 7 Contents DIP API Module ..............Provides a description of the DIP API module, lists the individual APIs within the module, and includes a reference section showing the single API function and constant within this module.
  • Page 8 1–1. BSL Modules and Include Files 1–2. BSL Support Library Name and Symbol Conventions 1–3. BSL API Module Support for 6711 DSK 2–1. AD535 API Summary ............. 3–1.
  • Page 9: Bsl Overview

    This chapter provides an overview of the board support library (BSL), de- scribes its beneficial features, and lists each of its API modules. Topic BSL Introduction ..........BSL API Modules .
  • Page 10: Bsl Introduction

    BSL Introduction 1.1 BSL Introduction 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 ar- chived into a library file. Each module represents an individual API and is re- ferred to simply as an API module.
  • Page 11: Bsl Api Modules

    1.2 BSL API Modules For each on-board device, one header file and one source file will be gener- ated with the following names: bsl_device.h and bsl_device.c. Also, a library will be built for a given board: i.e: bsl6711dsk.lib Note : The soource files.c are archived into a single source file bsl.src. Table 1–1 provides a current list of BSL API Modules.
  • Page 12: Using Bsl Handles

    BSL API Modules 6711 DSK Module Support Table 1–3 shows which board each API module is supported on. Currently, all modules described in the following chapters are supported by the C6711 DSK. In the future, more APIs supported by other platforms will be added to the BSL. Table 1–2.
  • Page 13: Bsl Project Settings

    1.3 BSL Project Settings 1.3.1 User’s Program Setting Due to the interdependancies between CSL and BSL, the CSL is initialized by calling the CSL_init() function followed by the BSL initialization function, BSL_init(). Also, the two header files <csl.h> and <bsl.h> have to be included in your pro- gram in order for you to have access to the BSL APIs.
  • Page 14: Ad535 Api Module

    This chapter provides a description of the AD535 API module, lists the individ- ual APIs within the module, and includes a reference section showing the API functions, structures, and constants that are applicable to this module. Topic AD535 API Module Description AD535 API Reference .
  • Page 15: Ad535 Api Module Description

    AD535 API Module Description 2.1 AD535 API Module Description The AD535 module (audio codec supported by the C6711 DSK) serves as a level of abstraction such that it works the same for all AD535s supported on TI EVM/DSKs. To use an AD535 device, you must first open it and obtain a device handle us- ing AD535_open().
  • Page 16 Syntax AD535_write AD535_writeHwi AD535_writeReg Note: F = Function; C = Constant; S = Structure; T = Typedef Type Description Writes data to be sent Writes data to be sent Writes to the AD535 control registers AD535 API Module Description Page 2-16 2-17 2-17...
  • Page 17: Ad535 Api Reference

    2.2 AD535 API Reference Closes codec channel AD535_close Function Void AD535_close( AD535_Handle hAD535 Arguments hAD535 Return Value none Description This function closes a codec channel previously opened via AD535_open(). The registers for the codec are set to their power-on defaults. Example AD535_close(hAD535);...
  • Page 18 AD535_config Description This is the AD535 configuration structure used to set up a codec channel. You create and initialize this structure and then pass its address to the AD535_config() function. Example AD535_Config myConfig = { AD535_config(hAD535,&myConfig); Sets up AD535 using configuration structure AD535_config Function Void AD535_config(...
  • Page 19 Description Sets 1 to the FREE field of the SPCR register of the given McBSP port. When FREE is set to 1, the serial clocks continue to run during an emulation halt. Example /* Set the FREE bit of Mcbsp serial port 0 */ AD535_freeMcbsp (MCBSP_DEV0);...
  • Page 20 AD535_getMcbspHandle AD535_getMcbsp Returns McBSP Handle Handle Function Mcbsp_Handle AD535_getMcbspHandle( AD535_Handle hAD535, Arguments hAD535 Return Value Mcbsp_handle Description Returns the McBSP Handle associated with the McBSP used for AD535 communication. Note: The Mcbsp_Handle type is defined in the Chip Suppport Library (CSL) and created by the internal call of the MCBSP_open() function.
  • Page 21 Description This AD535_Id structure is used to allocate a codec channel. You create and initialize this structure, then pass its address to the AD535_open() function. Also, this structure allows you to access to the McBSP handle through the AD535_getMcbspHandle() function after calling AD535_open().
  • Page 22 AD535_inGain Sets AD535’s input gain AD535_inGain Function void AD535_inGain( AD535_Handle hAD535, float Arguments hAD535 inGain Return Value none Description Sets the AD535’s input gain. 6711 DSK AD535_GAIN_MUTE AD535_GAIN_0DB –36 dB <= inGain <= 12 dB (in 1.5 dB steps) Example AD535_inGain (hAD535,6.0);...
  • Page 23 Modifies specified control register AD535_modifyReg Function void AD535_modifyReg( AD535_Handle hAD535, AD535_Reg Uint32 Uint32 Arguments hAD535 ad535Register mask Return Value none Description Modifies the specified control register according to the bit mask (Mask) and value (Val). 6711 DSK Note: Only the Voice channel is available on this board. This means the changes to control registers 0, 1, and 2 will have no effect on the operation of the codec.
  • Page 24 AD535_open Opens codec channel AD535_open Function AD535_Handle AD535_open ( AD535_Id *myId Arguments myId Return Value AD535_Handle Description Before a codec channel can be used, it must first be opened by this function. Once opened, it cannot be opened again until closed. See AD535_close().
  • Page 25 Sets AD535’s output gain AD535_outGain Function void AD535_outGain( AD535_Handle float Arguments hAD535 outGain Return Value none Description Sets the AD535’s output gain. 6711 DSK AD535_GAIN_MUTE AD535_GAIN_0DB –36 dB <= outGain <= 12 dB (in 1.5 dB steps) Example AD535_outGain(hAD535,AD535_GAIN_0DB); Enables AD535’s power-down mode AD535_powerDown Function void AD535_powerDown(...
  • Page 26 AD535_read Returns value of ouput from ADC AD535_read Function int AD535_read( AD535_Handle hAD535 Arguments hAD535 Return Value Description Returns the value of the ouput from the ADC. Example int val; val = AD535_read(hAD535); Display Code at Selected Address AD535_readHwi Function int AD535_readHwi( AD535_Handle hAD535 Arguments...
  • Page 27 ad535Register Return Value Uint32 Description Returns the value of the specified control register. Example Uint32 controlRegVal; controlRegVal = AD535_readReg(hAD535, AD535_REG_CTRL3); Control register enumeration: AD535_REG_CTRL0 AD535_REG_CTRL1 AD535_REG_CTRL2 AD535_REG_CTRL3 AD535_REG_CTRL4 AD535_REG_CTRL5 Value of specified control register. AD535 API Module AD535_readReg 2-15...
  • Page 28 AD535_reset Asserts software reset AD535_reset Function void AD535_reset( AD535_Handle hAD535 Arguments hAD535 Return Value none Description Asserts a software reset and sets all the registers to their power-on default values. Example AD535_reset(hAD535); Compile time constant AD535_SUPPORT Constant AD535_SUPPORT Description Compile time constant that has a value of 1 if the board supports the AD535 module and 0 otherwise.
  • Page 29 Writes value to input of DAC AD535_writeHwi Function void AD535_writeHwi( AD535_Handle Arguments hAD535 Return Value none Description Writes value to the input of the DAC. Unlike the AD535_write API, it does not use polling to establish that the McBSP is ready to write another sample.
  • Page 30 AD535_writeReg Description Writes value to the specified control register. 6711 DSK Note: Only the Voice channel is available on this board. This means the changes to control registers 0, 1, and 2 will have no effect on the operation of the codec. Example /* Set up 10.5db ADC input gain and 0dB microphone preamp gain in control register 4 */...
  • Page 31: Board Api Module

    This chapter provides a description of the BOARD API module, lists the individ- ual APIs within the module, and includes a reference section showing the API functions and constants that are applicable to this module. Topic BOARD API Module Description BOARD API Reference .
  • Page 32: Board Api Module Description

    BOARD API Module Description 3.1 BOARD API Module Description The BOARD module is where we put board-specific content. This module has the potential to grow in the future as more boards are placed on the market. Currently, the module has some API functions for register access such as BOARD_readReg(), and BOARD_writeReg().
  • Page 33 3.2 BOARD API Reference Returns value of specified memory-mapped register BOARD_readReg Function Uint32 BOARD_readReg( BOARD_Reg boardRegister Arguments boardRegister Return Value Uint32 Description Returns the value of the specified memory-mapped register. Example Uint32 boardRegVal; boardRegVal = BOARD_readReg(BOARD_REG_IOPORT); Compile time constant BOARD_SUPPORT Constant BOARD_SUPPORT Description...
  • Page 34 BOARD_writeReg Writes value to specified memory-mapped register BOARD_writeReg Function void BOARD_writeReg( BOARD_Reg Uint32 Arguments boardRegister Return Value none Description Writes the value to the specified memory-mapped register. Example BOARD_writeReg(BOARD_REG_IOPORT, 0x00000000); boardRegister, Register enumeration C6711 DSK BOARD_REG_IOPORT Value to be written to specified register.
  • Page 35: Bsl Api Module

    This chapter provides a description of the BSL API module and includes a ref- erence section showing the single API function within this module. Topic BSL API Module Description BSL API Reference ..........Chapter 4 BSL API Module .
  • Page 36: Bsl Api Module Description

    BSL API Module Description 4.1 BSL API Module Description The BSL module serves to initialize the API modules supported by the board.The following unique function has to be called before using the API func- tions: BSL_init () Table 4–1. BSL API Function Syntax BSL_init Note:...
  • Page 37: Bsl Api Reference

    4.2 BSL API Reference Initializes all programmable modules on board BSL_init Function void BSL_init(); Arguments none Return Value none Description This function initializes all of the programmable modules on the board. C6711 DSK AD535 Codec BOARD module DIP switch FLASH ROM User LEDs Example BSL_init();...
  • Page 38: Dip Api Module

    This chapter provides a description of the DIP API module, lists the individual APIs within the module, and includes a reference section showing the single API function and constant within this module. Topic DIP API Module Description DIP API Reference .
  • Page 39: Dip Api Module Description

    DIP API Module Description 5.1 DIP API Module Description This module has the following single API for reading DIP switch positions: DIP_get(dip#) returns a boolean value {0,1}. Table 5–1. DIP API Summary Syntax DIP_get DIP_SUPPORT Note: F = Function; C = Constant; S = Structure; T = Typedef Type Description Reads the status of the DIP switches...
  • Page 40: Dip Api Reference

    5.2 DIP API Reference Returns current value of specified DIP switch DIP_get Function Uint32 DIP_get( Uint32 dipNum Arguments dipNum Return Value Uint32 Description Returns the current value of the specified DIP switch. C6711 DSK DIP_1 = USER_SW1 DIP_2 = USER_SW2 DIP_3 = USER_SW3 Example Uint32 val;...
  • Page 41: Flash Api Module

    This chapter provides a description of the FLASH API module, lists the individ- ual APIs within the module, and includes a reference section showing the API functions and constants that are applicable to this module. Topic FLASH API Module Description FLASH API Reference .
  • Page 42: Flash Api Module Description

    FLASH API Module Description 6.1 FLASH API Module Description The FLASH module allows access to on-board flash and executes data memory manipulation by using the following three functions: FLASH_read(), FLASH_write() and FLASH_erase() For the 6711 DSK, the 128KB FLASH is split into 128 bytes per page. Table 6–1.
  • Page 43: Flash Api Reference

    6.2 FLASH API Reference Returns checksum of specified Flash data FLASH_checksum Function Uint32 FLASH_checksum( Uint32 locator, Uint32 length Arguments locator length Return Value Uint32 Description Returns the checksum of the specified Flash data. Checksum calculated by byte by byte addition. Note: This function does not affect unspecified segments of Flash.
  • Page 44 FLASH_erase Erases specified segment of Flash memory FLASH_erase Function void FLASH_erase( Uint32 locator, Uint32 length Arguments locator length Return Value none Description Erases the specified segment of Flash memory. Note: This function does not affect unspecified segments of Flash. For example, altering the lower half of a page of Flash memory does not change the value of the upper half page.
  • Page 45 Reads data from FLASH address FLASH_read Function void FLASH_read( Uint32 locator, Uint32 dst, Uint32 length Arguments locator length Return Value none Description Reads data from the FLASH address (locator) and copies it to a destination address (dst). This function is limited only by the length of the FLASH memory.
  • Page 46 FLASH_SUPPORT Compile time constant FLASH_SUPPORT Constant FLASH_SUPPORT Description Compile time constant that has a value of 1 if the board supports the FLASH module and 0 otherwise. You are not required to use this constant. Currently, all devices support this module. Example #if (FLASH_SUPPORT) /* do FLASH operations */...
  • Page 47 Description Writes data to the Flash address (locator) from a source address (src). This function is limited by the page length of the Flash memory. Note: This function does not affect unspecified segments of Flash. For example, altering the lower half of a page of Flash memory does not change the value of the upper half page.
  • Page 48: Includes A Reference Section Showing The Api Functions And Constants That Are Applicable To This

    This chapter provides a description of the LED API module, lists the individual APIs within the module, and includes a reference section showing the API functions and constants that are applicable to this module. Topic LED API Module Description LED API Reference .
  • Page 49: Led Api Module Description

    LED API Module Description 7.1 LED API Module Description This module has a simple API for configuring on-board LED outputs. Three states can be set by the following functions: LED_on(led#) LED_off(led#) LED_toggle(led#) Table 7–1. LED API Summary Syntax LED_off LED_on LED_SUPPORT LED_toggle Note:...
  • Page 50: Led Api Reference

    7.2 LED API Reference Turns off specified LED LED_off Function void LED_off( Uint32 LedNum Arguments LedNum Return Value none Description Turns off the specified LED. C6711 DSK LED_1 = USER_LED1 LED_2 = USER_LED2 LED_3 = USER_LED3 LED_ALL = all user LEDs Example If you want to turn off LED # 1 use: LED_off(LED_1);...
  • Page 51 LED_SUPPORT Description Turns on the specified LED. C6711 DSK LED_1 = USER_LED1 LED_2 = USER_LED2 LED_3 = USER_LED3 LED_ALL = all user LEDs Example If you want to turn on LED # 1 use: LED_on(LED_1); Compile time constant LED_SUPPORT Constant LED_SUPPORT Description Compile time constant that has a value of 1 if the board supports the LED...
  • Page 52: A Glossary

    AD535: The audio codec API module. Currently supported by the 6711 DSK. address: accessible memory location. A-law companding: See compress and expand (compand). API: See application programming interface. API module: A set of API functions designed for a specific purpose. application programming interface (API): Used for proprietary applica- tion programs to interact with communications software or to conform to protocols from another vendor’s product.
  • Page 53 Glossary block: The three least significant bits of the program address. These corre- BOARD: The BOARD-specific API Module. board support library (BSL): The BSL is a set of application programming boot: The process of loading a program into program memory. boot mode: The method of loading a program into program memory.
  • Page 54 clock cycle: A periodic or sequence of events based on the input from the external clock. clock modes: Options used by the clock generator to change the internal CPU clock frequency to a fraction or multiple of the frequency of the input clock signal.
  • Page 55 Glossary device ID: Configuration register that identifies each peripheral component digital signal processor (DSP): A semiconductor that turns analog sig- DIP: The DIP Switches API Module. direct memory access (DMA): A mechanism whereby a device other than DMA : See direct memory access. DMA module: DMA is an API module that currently has two architectures DMA source: The module where the DMA data originates.
  • Page 56 external interrupt: A hardware interrupt triggered by a specific value on a pin. external memory interface (EMIF): Microprocessor hardware that is used to read to and write from off-chip memory. fetch packet: A contiguous 8-word series of instructions fetched by the CPU and aligned on an 8-word boundary.
  • Page 57 Glossary indirect addressing: An addressing mode in which an address points to instruction fetch packet: A group of up to eight instructions held in memory internal interrupt: A hardware interrupt caused by an on-chip peripheral. internal peripherals: Devices connected to and controlled by a host device. interrupt: A signal sent by hardware or software to a processor requesting interrupt service fetch packet (ISFP): A fetch packet used to service inter- interrupt service routine (ISR): A module of code that is executed in re-...
  • Page 58 little endian: An addressing protocol in which bytes are numbered from right to left within a word. More significant bytes in a word have higher-num- bered addresses. Endian ordering is specific to hardware and is deter- mined at reset. See also big endian. -law companding: See compress and expand (compand).
  • Page 59 Glossary peripheral: A device connected to and usually controlled by a host device. program cache: A fast memory cache for storing program instructions al- program memory: Memory accessed through the C6x’s program fetch in- PWR: Power; see PWR module. PWR module: PWR is an API module that is used to configure the power- random-access memory (RAM): A type of memory device in which the register: A small area of high speed memory located within a processor or reduced-instruction-set computer (RISC): A computer whose instruction...
  • Page 60 synchronous dynamic random-access memory (SDRAM): RAM whose contents is refreshed periodically so the data is not lost. Transfer of data is at a fixed rate relative to the clock speed of the device. syntax: The grammatical and structural rules of a language. All higher-level programming languages possess a formal syntax.
  • Page 61 AD535 API module, 2-1 API constant, 2-5 AD535_SUPPORT, 2-16 API functions AD535_close, 2-5 AD535_config, 2-6 AD535_getMcbspHandle, 2-8 AD535_inGain, 2-10 AD535_micGain, 2-10 AD535_modifyReg, 2-11 AD535_open, 2-12 AD535_outGain, 2-13 AD535_powerDown, 2-13 AD535_read, 2-14 AD535_readReg, 2-14 AD535_reset, 2-16 AD535_write, 2-16 AD535_writeReg, 2-17 API structures AD535_Config, 2-5 AD535_Id, 2-8 API summary table, 2-2...
  • Page 62 Index LED API module, 7-1 API constant, 7-3 LED_SUPPORT, 7-4 Index-2 API functions LED_off, 7-3 LED_on, 7-3 LED_toggle, 7-4 API summary table, 7-2 description, 7-2...

Table of Contents