1
|
/**
|
2
|
* @file UppSignalDAC.h
|
3
|
* @author James Thesing <james.thesing@criticallink.com>
|
4
|
* @version 1.0
|
5
|
*
|
6
|
* @section LICENSE
|
7
|
*
|
8
|
*
|
9
|
* o 0
|
10
|
* | / Copyright (c) 2005-2011
|
11
|
* (CL)---o Critical Link, LLC
|
12
|
* \
|
13
|
* O
|
14
|
*
|
15
|
*
|
16
|
* @section DESCRIPTION
|
17
|
*
|
18
|
* This class handles exercising the DAC5672 on the DSP. Input data is
|
19
|
* generated by the DSPAPP and then sent over upp to the DAC. Output
|
20
|
* is generated as two analog signals to two coaxial outputs.
|
21
|
*/
|
22
|
|
23
|
#ifndef UppSignalDAC_H_
|
24
|
#define UppSignalDAC_H_
|
25
|
|
26
|
//#include "UppSignalDAC.h"
|
27
|
#include "core/DspUpp.h"
|
28
|
|
29
|
#include <stdint.h>
|
30
|
#include <std.h>
|
31
|
#include <tsk.h>
|
32
|
#include <clk.h>
|
33
|
#include <vector>
|
34
|
#include <string>
|
35
|
|
36
|
|
37
|
class DAC5672/*UppSignalDAC*/{
|
38
|
public:
|
39
|
|
40
|
/**
|
41
|
* Get a pointer to the singleton UppSignalDAC object.
|
42
|
*
|
43
|
* @return A pointer to the singleton object.
|
44
|
*/
|
45
|
|
46
|
static DAC5672/*UppSignalDAC*/* getInstance();
|
47
|
|
48
|
/**
|
49
|
* starts an endless loop of sending 32k * 2 bytes of data
|
50
|
* @param buff1 - buffer used to send data to upp
|
51
|
* @param buff2 - buffer used to send data to upp
|
52
|
* @param buff3 - buffer used to send data to upp
|
53
|
* @param data - table used to store values that are sent to buffers
|
54
|
*/
|
55
|
void communicate(int16_t* buff1, int16_t* buff2, int16_t* buff3, int16_t *data );
|
56
|
|
57
|
/**
|
58
|
* Generates data to fill buffer, in this case a sign wave at designated frequency and amplitude
|
59
|
* @param amplitude - value (0,1] - the amplitude of the sign wave
|
60
|
* @param frequency - the desired output frequency of signwave
|
61
|
* @param data - the int16_t array to put generated data
|
62
|
*/
|
63
|
void fillData( float amplitude, int32_t frequency, int16_t* data);
|
64
|
|
65
|
|
66
|
private:
|
67
|
|
68
|
/**
|
69
|
* Private Constructor - forces getInstance() use
|
70
|
*/
|
71
|
DAC5672/*UppSignalDAC*/();
|
72
|
|
73
|
/**
|
74
|
* Destructor
|
75
|
*/
|
76
|
~DAC5672/*UppSignalDAC*/();
|
77
|
|
78
|
void init();
|
79
|
|
80
|
|
81
|
static DAC5672/*UppSignalDAC*/* mpDAC5672/*mpUppSignalDAC*/; //!< Pointer to the singleton.
|
82
|
bool filled; //!<ensures table is filled only once
|
83
|
const MityDSP::tcDspUpp::teUppChan meXmitChan; //!< Constant for
|
84
|
//!< transmit channel.
|
85
|
static const uint32_t uppFreq = 50000000; //!<freq of upp
|
86
|
MityDSP::tcDspUpp* mpDspUpp; //!< Pointer to uPP driver singleton.
|
87
|
MBX_Handle mhXmitMbx; //!< Handle to transmit mailbox.
|
88
|
const MityDSP::tcDspUpp::teUppChan meRecvChan; //!< Constant for
|
89
|
//!< receive channel.
|
90
|
MBX_Handle mhRecvMbx; //!< Handle to receive mailbox.
|
91
|
|
92
|
};
|
93
|
|
94
|
#endif /*UppSignalDAC_H_*/
|