1 //////////////////////////////////////////////////////////////////////////////
3 // Filename: libdso138.h
8 // Company: JYE Tech Ltd.
9 // Web: www.jyetech.com
11 //-----------------------------------------------------------------------------
13 // Target: STM32F103C8
14 // Tool chain: CodeSourcery G++
16 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
26 ///////////////////////////////////////////////////////////////////////////////
34 // =======================================================
39 #define VSenMax VS_10mV
48 #define TrigModeMax TM_Single
49 #define TrigModeMin TM_Auto
51 #define TrigEdgeMax TE_Rising
52 #define TrigEdgeMin TE_Falling
54 #define TrigLvlMax 300
55 #define TrigLvlMin -300
57 #define SampleBufSizeMax 0x400
59 #define RecLenMax SampleBufSizeMax
63 // =======================================================
64 // Scope control type definitions
65 // =======================================================
123 // -- V sensitivity type
162 DSO_CaptureDone = 0x0001,
163 DSO_Trigged = 0x0002,
165 DSO_Rolling = 0x0008,
166 DSO_NormalDisplay = 0x0080,
169 enum DispUpdateFlags {
175 // =====================================
176 // Exported variables
178 extern U16 *SampleBuf;
179 extern U16 *CurrentSample;
180 extern U8 LibVersion[];
181 extern U8 NoScopePanel;
185 // -- Function Prototypes --
187 void StartCapture(void);
188 void StopCapture(void);
189 U16 GetDsoStatus(void);
192 void UpdateTimebase(void);
196 S16 SetVPos(S16 vpos);
197 S8 SetTimeBase(S8 timebase);
198 S16 SetHPos(S16 hpos);
199 S8 SetTrigMode(S8 trigmode);
200 S8 SetTrigEdge(S8 trigslope);
201 S16 SetTrigLvl(S16 triglvl);
202 U16 SetRecLen(U16 reclen);
203 S16 SetVPosOfs(S16 ofs);
208 S8 GetTimebase(void);
210 S8 GetTrigMode(void);
211 S8 GetTrigEdge(void);
212 S16 GetTrigLvl(void);
214 S16 GetVPosOfs(void);
216 void DsoDisplay(void);
217 void UpdateDisp(U16 disp);
219 U8 SetFocus(U8 focus);
222 S16 GetAverage(void);