MityDSP Documentation Index

MityDSP::tcDspMcbsp Class Reference

The tcDspMcbsp class is used for communications via the Texas Instruments Multichannel Buffered Serial Port (McBSP). More...

#include <core/DspMcbsp.h>

List of all members.

Public Member Functions

 tcDspMcbsp (void *apAddress, tcDspMcbspConfig *apConfig=NULL, LCK_Handle ahLock=NULL)
 This constructor is used to open a McBSP interface at the address specified by apAddress with the specified settings.
 tcDspMcbsp (void *apAddress, int anRxDataDelay=DATA_DELAY1, int anRxWordLen=WORD_LENGTH_32, int anRxJustify=RXJUST_RJZF, int anTxDataDelay=DATA_DELAY1, int anTxWordLen=WORD_LENGTH_32, int anRxFsync=FSYNC_MODE_INT, int anTxFsync=FSYNC_MODE_INT, int anRxClock=CLK_MODE_INT, int anTxClock=CLK_MODE_INT, int anRxFsyncPolarity=FSYNC_POL_HIGH, int anTxFsyncPolarity=FSYNC_POL_HIGH, int anRxClockPolarity=CLKR_POL_FALLING, int anTxClockPolarity=CLKX_POL_RISING, int anClockStop=CSTOP_NODELAY)
 This constructor is used to open a McBSP interface at the address specified by apAddress with the specified settings.
 ~tcDspMcbsp ()
 Default destructor.
bool reconfig (tcDspMcbspConfig *apConfig)
 This routine saves new configuration settings, resets the McBSP, then implements the new configuration.
bool reconfig (int anRxDataDelay=DATA_DELAY1, int anRxWordLen=WORD_LENGTH_32, int anRxJustify=RXJUST_RJZF, int anTxDataDelay=DATA_DELAY1, int anTxWordLen=WORD_LENGTH_32, int anRxFsync=FSYNC_MODE_INT, int anTxFsync=FSYNC_MODE_INT, int anRxClock=CLK_MODE_INT, int anTxClock=CLK_MODE_INT, int anRxFsyncPolarity=FSYNC_POL_HIGH, int anTxFsyncPolarity=FSYNC_POL_HIGH, int anRxClockPolarity=CLKR_POL_FALLING, int anTxClockPolarity=CLKX_POL_RISING, int anClockStop=CSTOP_NODELAY)
 This routine saves new configuration settings, resets the McBSP, then implements the new configuration.
void change_word_length (int)
 This routine changes the McBSP word length, without a re-configuration.
void write (unsigned int anData, bool abWaitForCompletion=false, tcDspOutputLatch *apLatch=NULL, unsigned int anLatchID=0)
 This routine attempts to write data to the McBSP.
unsigned int read (tcDspOutputLatch *apLatch=NULL, unsigned int anLatchID=0)
 This routine attempts to read data from the McBSP.

Public Attributes

unsigned int mnTxWords
unsigned int mnRxWords

Detailed Description

The tcDspMcbsp class is used for communications via the Texas Instruments Multichannel Buffered Serial Port (McBSP).

The McBSP provides high-speed serial communication between the TI DSP chip and peripheral devices.

See also:
tcDspMcbsp Page

Constructor & Destructor Documentation

tcDspMcbsp::tcDspMcbsp ( void *  apAddress,
tcDspMcbspConfig apConfig = NULL,
LCK_Handle  ahLock = NULL 
)

This constructor is used to open a McBSP interface at the address specified by apAddress with the specified settings.

Parameters:
[in] apAddress Address for McBSP communication.
[in] apConfig Pointer to configuration data.
[in] ahLock Optional parameter specifying a lock to use to protect McBSP access.
Note:
A lock may be provided to allow access to the McBSP from multiple threads simultaneously. If multiple operations must be performed as a group, the application must take the lock prior to the first operation, and release it after the last (the locks may be taken multiple times by the same thread).
If the McBSP is to be accessed from an ISR (or ISR callback), a lock must NOT be utilitzed. It is up to the application to ensure that a McBSP access from an ISR will not interrupt a McBSP access in another thread (i.e. turn interrupts off around the thread calls to the McBSP).
See also:
DspMcBsp.h
tcDspMcbsp::tcDspMcbsp ( void *  apAddress,
int  anRxDataDelay = DATA_DELAY1,
int  anRxWordLen = WORD_LENGTH_32,
int  anRxJustify = RXJUST_RJZF,
int  anTxDataDelay = DATA_DELAY1,
int  anTxWordLen = WORD_LENGTH_32,
int  anRxFsync = FSYNC_MODE_INT,
int  anTxFsync = FSYNC_MODE_INT,
int  anRxClock = CLK_MODE_INT,
int  anTxClock = CLK_MODE_INT,
int  anRxFsyncPolarity = FSYNC_POL_HIGH,
int  anTxFsyncPolarity = FSYNC_POL_HIGH,
int  anRxClockPolarity = CLKR_POL_FALLING,
int  anTxClockPolarity = CLKX_POL_RISING,
int  anClockStop = CSTOP_NODELAY 
)

This constructor is used to open a McBSP interface at the address specified by apAddress with the specified settings.

Parameters:
[in] apAddress Address for McBSP communication.
[in] anRxDataDelay Receive Data Delay:

  • DATA_DELAY0 - No delay
  • DATA_DELAY1 - 1 clk period delay
  • DATA_DELAY2 - 2 clk period delay
[in] anRxWordLen Receive word length:

  • WORD_LENGTH_8 - 8 bit word length
  • WORD_LENGTH_12 - 12 bit word length
  • WORD_LENGTH_16 - 16 bit word length
  • WORD_LENGTH_20 - 20 bit word length
  • WORD_LENGTH_24 - 24 bit word length
  • WORD_LENGTH_32 - 32 bit word length
[in] anRxJustify Receive bit-justify parameter:

  • RXJUST_RJZF - Right Justify Zero Fill
  • RXJUST_RJSE - Right Justify Sign Extend
  • RXJUST_LJZF - Left Justify Zero Fill
  • RXJUST_LJSE - Left Justify Sign Extend
[in] anTxDataDelay Transmit data delay:

  • DATA_DELAY0 - No delay
  • DATA_DELAY1 - 1 clk period delay
  • DATA_DELAY2 - 2 clk period delay
[in] anTxWordLen Transmit word length:

  • WORD_LENGTH_8 - 8 bit word length
  • WORD_LENGTH_12 - 12 bit word length
  • WORD_LENGTH_16 - 16 bit word length
  • WORD_LENGTH_20 - 20 bit word length
  • WORD_LENGTH_24 - 24 bit word length
  • WORD_LENGTH_32 - 32 bit word length
[in] anRxFsync Receive Frame Sync mode.

  • FSYNC_MODE_EXT - Sync from external source
  • FSYNC_MODE_INT - Sync from internal source
[in] anTxFsync Transmit Frame Sync mode.

  • FSYNC_MODE_EXT - Sync from external source
  • FSYNC_MODE_INT - Sync from internal source
[in] anRxClock Receive clock mode.

  • CLK_MODE_EXT - Clock from external source
  • CLK_MODE_INT - Clock from internal source
[in] anTxClock Transmit clock mode.

  • CLK_MODE_EXT - Clock from external source
  • CLK_MODE_INT - Clock from internal source
[in] anRxFsyncPolarity Receive Frame Sync polarity.

  • FSYNC_POL_HIGH - Frame Sync Active High
  • FSYNC_POL_LOW - Frame Sync Active Low
[in] anTxFsyncPolarity Transmit Frame Sync polarity.

  • FSYNC_POL_HIGH - Frame Sync Active High
  • FSYNC_POL_LOW - Frame Sync Active Low
[in] anRxClockPolarity Receive clock polarity.

  • CLKR_POL_FALLING - Falling Edge Sampling
  • CLKR_POL_RISING - Rising Edge Sampling
[in] anTxClockPolarity Transmit clock polarity.

  • CLKX_POL_RISING - Rising Edge Send
  • CLKX_POL_FALLING - Falling Edge Send
[in] anClockStop Clock stop mode.

  • CSTOP_DISABLED - Clock Stop disabled
  • CSTOP_NODELAY - Clock Stop at trailing edge w/out delay
  • CSTOP_DELAY - Clock Stop at trailing edge after delay
See also:
DspMcBsp.h
tcDspMcbsp::~tcDspMcbsp (  ) 

Default destructor.


Member Function Documentation

bool tcDspMcbsp::reconfig ( tcDspMcbspConfig apConfig  ) 

This routine saves new configuration settings, resets the McBSP, then implements the new configuration.

Parameters:
[in] apConfig Pointer to configuration data.
Returns:
Always returns true.
See also:
DspMcBsp.h
bool tcDspMcbsp::reconfig ( int  anRxDataDelay = DATA_DELAY1,
int  anRxWordLen = WORD_LENGTH_32,
int  anRxJustify = RXJUST_RJZF,
int  anTxDataDelay = DATA_DELAY1,
int  anTxWordLen = WORD_LENGTH_32,
int  anRxFsync = FSYNC_MODE_INT,
int  anTxFsync = FSYNC_MODE_INT,
int  anRxClock = CLK_MODE_INT,
int  anTxClock = CLK_MODE_INT,
int  anRxFsyncPolarity = FSYNC_POL_HIGH,
int  anTxFsyncPolarity = FSYNC_POL_HIGH,
int  anRxClockPolarity = CLKR_POL_FALLING,
int  anTxClockPolarity = CLKX_POL_RISING,
int  anClockStop = CSTOP_NODELAY 
)

This routine saves new configuration settings, resets the McBSP, then implements the new configuration.

Parameters:
[in] anRxDataDelay Receive Data Delay:

  • DATA_DELAY0 - No delay
  • DATA_DELAY1 - 1 clk period delay
  • DATA_DELAY2 - 2 clk period delay
[in] anRxWordLen Receive word length:

  • WORD_LENGTH_8 - 8 bit word length
  • WORD_LENGTH_12 - 12 bit word length
  • WORD_LENGTH_16 - 16 bit word length
  • WORD_LENGTH_20 - 20 bit word length
  • WORD_LENGTH_24 - 24 bit word length
  • WORD_LENGTH_32 - 32 bit word length
[in] anRxJustify Receive bit-justify parameter:

  • RXJUST_RJZF - Right Justify Zero Fill
  • RXJUST_RJSE - Right Justify Sign Extend
  • RXJUST_LJZF - Left Justify Zero Fill
  • RXJUST_LJSE - Left Justify Sign Extend
[in] anTxDataDelay Transmit data delay:

  • DATA_DELAY0 - No delay
  • DATA_DELAY1 - 1 clk period delay
  • DATA_DELAY2 - 2 clk period delay
[in] anTxWordLen Transmit word length:

  • WORD_LENGTH_8 - 8 bit word length
  • WORD_LENGTH_12 - 12 bit word length
  • WORD_LENGTH_16 - 16 bit word length
  • WORD_LENGTH_20 - 20 bit word length
  • WORD_LENGTH_24 - 24 bit word length
  • WORD_LENGTH_32 - 32 bit word length
[in] anRxFsync Receive Frame Sync mode.

  • FSYNC_MODE_EXT - Sync from external source
  • FSYNC_MODE_INT - Sync from internal source
[in] anTxFsync Transmit Frame Sync mode.

  • FSYNC_MODE_EXT - Sync from external source
  • FSYNC_MODE_INT - Sync from internal source
[in] anRxClock Receive clock mode.

  • CLK_MODE_EXT - Clock from external source
  • CLK_MODE_INT - Clock from internal source
[in] anTxClock Transmit clock mode.

  • CLK_MODE_EXT - Clock from external source
  • CLK_MODE_INT - Clock from internal source
[in] anRxFsyncPolarity Receive Frame Sync polarity.

  • FSYNC_POL_HIGH - Frame Sync Active High
  • FSYNC_POL_LOW - Frame Sync Active Low
[in] anTxFsyncPolarity Transmit Frame Sync polarity.

  • FSYNC_POL_HIGH - Frame Sync Active High
  • FSYNC_POL_LOW - Frame Sync Active Low
[in] anRxClockPolarity Receive clock polarity.

  • CLKR_POL_FALLING - Falling Edge Sampling
  • CLKR_POL_RISING - Rising Edge Sampling
[in] anTxClockPolarity Transmit clock polarity.

  • CLKX_POL_RISING - Rising Edge Send
  • CLKX_POL_FALLING - Falling Edge Send
[in] anClockStop Clock stop mode.

  • CSTOP_DISABLED - Clock Stop disabled
  • CSTOP_NODELAY - Clock Stop at trailing edge w/out delay
  • CSTOP_DELAY - Clock Stop at trailing edge after delay
Returns:
Always returns true.
See also:
DspMcBsp.h
void tcDspMcbsp::change_word_length ( int  anWordLen  ) 

This routine changes the McBSP word length, without a re-configuration.

Parameters:
[in] anWordLen The new McBSP word length:

  • WORD_LENGTH_8 - 8 bit word length
  • WORD_LENGTH_12 - 12 bit word length
  • WORD_LENGTH_16 - 16 bit word length
  • WORD_LENGTH_20 - 20 bit word length
  • WORD_LENGTH_24 - 24 bit word length
  • WORD_LENGTH_32 - 32 bit word length
Returns:
None.
See also:
DspMcBsp.h
void tcDspMcbsp::write ( unsigned int  anData,
bool  abWaitForCompletion = false,
tcDspOutputLatch apLatch = NULL,
unsigned int  anLatchID = 0 
)

This routine attempts to write data to the McBSP.

Parameters:
[in] anData A single word of data to write to the McBSP.
[in] abWaitForCompletion If true, wait for McBSP to clock out data.
[in] apLatch - An optional pointer to a latch class (default:NULL)
[in] anLatchID - Chip Select to assert for this device, if any
Returns:
None.
See also:
DspMcBsp.h
unsigned int tcDspMcbsp::read ( tcDspOutputLatch apLatch = NULL,
unsigned int  anLatchID = 0 
)

This routine attempts to read data from the McBSP.

Parameters:
[in] apLatch - An optional pointer to a latch class (default:NULL)
[in] anLatchID - Chip Select to assert for this device, if any
Returns:
The data word read from the McBSP.
See also:
DspMcBsp.h

Member Data Documentation


  
Generated on Fri Sep 23 16:33:52 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.