MityDSP Documentation Index

MityDSP::tcDspAdc1278 Class Reference

Instances of this class create an interface to an ADS1278 24-bit analog to digital converter. More...

#include <core/DspAdc1278.h>

List of all members.

Classes

struct  tsTccMap

Public Member Functions

 tcDspAdc1278 (int mnMcBSPDevNum, unsigned int anSCLKFreq_Hz, unsigned int anFSample_Hz, int anNumChannels)
 This constructor is used to open a tcDspAdc1278 interface with the the specified settings (optional).
 ~tcDspAdc1278 ()
 Default destructor.
unsigned int GetSamples (int *apBuffer, int anNumWords, SEM_Handle ahHandle)
 Get a sample from the ADC.
int ContinuousCapture (int *apBuffer[2], int anWordsPerBuffer, SEM_Handle ahSemHandle)
 Run ADC continuously into local ping/pong buffer.
void AbortCapture (void)
 Aborts a continuous capture cycle.
unsigned int SampleRateHz (void)

Static Protected Member Functions

static void DMA_Channel_Handler (int anTcc)
 Handle a TCC complete code from an ongoing transfer.

Protected Attributes

int mnDevNum
 the McBSP running port number
MCBSP_Handle mhMcBSPHandle
 CSL Handle to McBSP.
EDMA_Handle mhEDMA
 CSL handle to base DMA table.
EDMA_Handle mhEDMA_pong
 CSL handle to pong transfer.
EDMA_Handle mhEDMA_ping
 CSL handle to ping transfer.
int mnTcc
 our allocated transfer complete code
int mnNumChannels
 number of channels collected during operation
SEM_Handle mhPingPong
 semaphore handle to post for continous capture
volatile bool mbAbortCapture
 true when a continuous capture abort is pending
volatile bool mbCCaptureRunning
 true when a continuous capture is running
unsigned int mnSampleRateHz
 our sampling rate

Static Protected Attributes

static tsTccMap maTccMap [_MCBSP_PORT_CNT]
static int mnNumOpenedMcBsps = 0

Detailed Description

Instances of this class create an interface to an ADS1278 24-bit analog to digital converter.

See also:
tcDspAdc1278 Page

Constructor & Destructor Documentation

tcDspAdc1278::tcDspAdc1278 ( int  mnMcBSPDevNum,
unsigned int  anSCLKFreq_Hz,
unsigned int  anFSample_Hz,
int  anNumChannels 
)

This constructor is used to open a tcDspAdc1278 interface with the the specified settings (optional).

Parameters:
[in] mnMcBSPDevNum McBDSP Number as defined by CSL (MCBSP_DEV0 or MCBSP_DEV1 for MityDSP/XM) (CSL_MCBSP_0 or CSL_MCBSP_1 for MityDSP-PRO)
[in] anSCLKFreq_Hz Desired chip SCLK rate, in Hz
[in] anFSample_Hz Desired sample rate (per channel), in Hz
[in] anNumChannels Number of channels read per sample (minimum 1)
Note:
The SCLK rate should be evenly divisible by the ADC CLK rate.
The anFSample_Hz must be at least 256 ADC CLKs.
The SCLK should be evenly divisible by the anFSample_Hz rate

An example to accomplish a 20,000 Hz sampling rate would include:

  • Running the ADC clock at 25 MHz.
  • Running the SCLK at 25 MHz
  • Running the Sampling Rate at 20,000 Hz
Returns:
None.
See also:
DspAdc1278.h
tcDspAdc1278::~tcDspAdc1278 (  ) 

Default destructor.

Returns:
None.

Member Function Documentation

unsigned int tcDspAdc1278::GetSamples ( int *  apBuffer,
int  anNumWords,
SEM_Handle  ahSemHandle 
)

Get a sample from the ADC.

Parameters:
[in] apBuffer Buffer to store the samples
[in] anNumWords number of ADC samples to store into buffer, must be less than 65536 and greater than 0.
[in] ahSemHandle Semaphore Handle that will be posted with transfer completes, if the Handle is NULL, then the operation will block until the transfer completes
Note:
it would make sense to have the anNumWords evenly divisible by the anNumChannels specified in the constructor.
Returns:
the number of samples scheduled for a read
See also:
DspAdc1278.h
int tcDspAdc1278::ContinuousCapture ( int *  apBuffer[2],
int  anWordsPerBuffer,
SEM_Handle  ahSemHandle 
)

Run ADC continuously into local ping/pong buffer.

Parameters:
[in] apBuffer Buffers to store the samples (ping/pong style)
[in] anWordsPerBuffer number of ADC samples to store into each buffer, must be less than 65536 and greater than 0.
[in] ahSemHandle semaphore to post when ping/pong flip occurs
Note:
it would make sense to have the anNumWords evenly divisible by the anNumChannels specified in the constructor.
Returns:
the value read from the ADC
See also:
DspAdc1278.h
void tcDspAdc1278::AbortCapture ( void   ) 

Aborts a continuous capture cycle.

Should be called to terminate a continuous capture operation. Returns when DMA engine has beed disabled.

See also:
DspAdc1278.h
unsigned int MityDSP::tcDspAdc1278::SampleRateHz ( void   )  [inline]
void tcDspAdc1278::DMA_Channel_Handler ( int  anTcc  )  [static, protected]

Handle a TCC complete code from an ongoing transfer.

Parameters:
[in] anTcc transfer complete code from ISR handler
See also:
DspAdc1278.h

Member Data Documentation

int tcDspAdc1278::mnNumOpenedMcBsps = 0 [static, protected]

the McBSP running port number

MCBSP_Handle MityDSP::tcDspAdc1278::mhMcBSPHandle [protected]

CSL Handle to McBSP.

EDMA_Handle MityDSP::tcDspAdc1278::mhEDMA [protected]

CSL handle to base DMA table.

EDMA_Handle MityDSP::tcDspAdc1278::mhEDMA_pong [protected]

CSL handle to pong transfer.

EDMA_Handle MityDSP::tcDspAdc1278::mhEDMA_ping [protected]

CSL handle to ping transfer.

our allocated transfer complete code

number of channels collected during operation

SEM_Handle MityDSP::tcDspAdc1278::mhPingPong [protected]

semaphore handle to post for continous capture

volatile bool MityDSP::tcDspAdc1278::mbAbortCapture [protected]

true when a continuous capture abort is pending

volatile bool MityDSP::tcDspAdc1278::mbCCaptureRunning [protected]

true when a continuous capture is running

unsigned int MityDSP::tcDspAdc1278::mnSampleRateHz [protected]

our sampling rate


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