Skip to content

Commit 526e02d

Browse files
author
Toni Klopfenstein
committed
Merge commit 'b0cefc3473be51346913643b94b99495e4c901f7' as 'Libraries/Arduino'
2 parents 603944e + b0cefc3 commit 526e02d

File tree

9 files changed

+686
-0
lines changed

9 files changed

+686
-0
lines changed

Libraries/Arduino/.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

Libraries/Arduino/.gitignore

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
#################
2+
## SparkFun Useful stuff
3+
#################
4+
5+
## AVR Development
6+
*.eep
7+
*.elf
8+
*.lst
9+
*.lss
10+
*.sym
11+
*.d
12+
*.o
13+
*.srec
14+
*.map
15+
16+
## Notepad++ backup files
17+
*.bak
18+
19+
## BOM files
20+
*bom*
21+
22+
#################
23+
## Eclipse
24+
#################
25+
26+
*.pydevproject
27+
.project
28+
.metadata
29+
bin/
30+
tmp/
31+
*.tmp
32+
*.bak
33+
*.swp
34+
*~.nib
35+
local.properties
36+
.classpath
37+
.settings/
38+
.loadpath
39+
40+
# External tool builders
41+
.externalToolBuilders/
42+
43+
# Locally stored "Eclipse launch configurations"
44+
*.launch
45+
46+
# CDT-specific
47+
.cproject
48+
49+
# PDT-specific
50+
.buildpath
51+
52+
53+
#############
54+
## Eagle
55+
#############
56+
57+
# Ignore the board and schematic backup files
58+
*.b#?
59+
*.s#?
60+
61+
62+
#################
63+
## Visual Studio
64+
#################
65+
66+
## Ignore Visual Studio temporary files, build results, and
67+
## files generated by popular Visual Studio add-ons.
68+
69+
# User-specific files
70+
*.suo
71+
*.user
72+
*.sln.docstates
73+
74+
# Build results
75+
[Dd]ebug/
76+
[Rr]elease/
77+
*_i.c
78+
*_p.c
79+
*.ilk
80+
*.meta
81+
*.obj
82+
*.pch
83+
*.pdb
84+
*.pgc
85+
*.pgd
86+
*.rsp
87+
*.sbr
88+
*.tlb
89+
*.tli
90+
*.tlh
91+
*.tmp
92+
*.vspscc
93+
.builds
94+
*.dotCover
95+
96+
## TODO: If you have NuGet Package Restore enabled, uncomment this
97+
#packages/
98+
99+
# Visual C++ cache files
100+
ipch/
101+
*.aps
102+
*.ncb
103+
*.opensdf
104+
*.sdf
105+
106+
# Visual Studio profiler
107+
*.psess
108+
*.vsp
109+
110+
# ReSharper is a .NET coding add-in
111+
_ReSharper*
112+
113+
# Installshield output folder
114+
[Ee]xpress
115+
116+
# DocProject is a documentation generator add-in
117+
DocProject/buildhelp/
118+
DocProject/Help/*.HxT
119+
DocProject/Help/*.HxC
120+
DocProject/Help/*.hhc
121+
DocProject/Help/*.hhk
122+
DocProject/Help/*.hhp
123+
DocProject/Help/Html2
124+
DocProject/Help/html
125+
126+
# Click-Once directory
127+
publish
128+
129+
# Others
130+
[Bb]in
131+
[Oo]bj
132+
sql
133+
TestResults
134+
*.Cache
135+
ClientBin
136+
stylecop.*
137+
~$*
138+
*.dbmdl
139+
Generated_Code #added for RIA/Silverlight projects
140+
141+
# Backup & report files from converting an old project file to a newer
142+
# Visual Studio version. Backup files are not needed, because we have git ;-)
143+
_UpgradeReport_Files/
144+
Backup*/
145+
UpgradeLog*.XML
146+
147+
148+
############
149+
## Windows
150+
############
151+
152+
# Windows image file caches
153+
Thumbs.db
154+
155+
# Folder config file
156+
Desktop.ini
157+
158+
159+
#############
160+
## Python
161+
#############
162+
163+
*.py[co]
164+
165+
# Packages
166+
*.egg
167+
*.egg-info
168+
dist
169+
build
170+
eggs
171+
parts
172+
bin
173+
var
174+
sdist
175+
develop-eggs
176+
.installed.cfg
177+
178+
# Installer logs
179+
pip-log.txt
180+
181+
# Unit test / coverage reports
182+
.coverage
183+
.tox
184+
185+
#Translations
186+
*.mo
187+
188+
#Mr Developer
189+
.mr.developer.cfg
190+
191+
# Mac crap
192+
.DS_Store

Libraries/Arduino/LICENSE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
License Information
3+
-------------------
4+
5+
The hardware is released under [Creative Commons Share-alike 3.0](http://creativecommons.org/licenses/by-sa/3.0/).
6+
7+
All other code is open source so please feel free to do anything you want with it; you buy me a beer if you use this and we meet someday ([Beerware license](http://en.wikipedia.org/wiki/Beerware)).
8+

Libraries/Arduino/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
SparkFun MiniGen Arduino Library
2+
========================================
3+
4+
![SparkFun MiniGen](https://cdn.sparkfun.com//assets/parts/7/2/2/3/11420-01.jpg)
5+
6+
[*SparkFun MiniGen (BOB-11420)*](https://www.sparkfun.com/products/11420)
7+
8+
This library allows the user to generate sine, square, or triangle waves at up to 3MHz, and approximately 1Vp-p using the SparkFun MiniGen.
9+
10+
Repository Contents
11+
-------------------
12+
13+
* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE.
14+
* **/extras** - Additional documentation for the user. These files are ignored by the IDE.
15+
* **/src** - Source files for the library (.cpp, .h).
16+
* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE.
17+
* **library.properties** - General library properties for the Arduino package manager.
18+
19+
Documentation
20+
--------------
21+
22+
* **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library.
23+
* **[Product Repository](https://github.com/sparkfun/MiniGen)** - Main repository (including hardware files) for the MiniGen.
24+
* **[Hookup Guide](https://learn.sparkfun.com/tutorials/minigen-hookup-guide)** - Basic hookup guide for the MiniGen.
25+
26+
Products that use this Library
27+
---------------------------------
28+
29+
* [BOB-11420](https://www.sparkfun.com/products/11420)- MiniGen Arduino Pro Mini Shield.
30+
31+
License Information
32+
-------------------
33+
34+
This product is _**open source**_!
35+
36+
The **code** is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!
37+
38+
Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license.
39+
40+
Distributed as-is; no warranty is given.
41+
42+
- Your friends at SparkFun.
43+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/******************************************************************************
2+
SparkFun_MiniGen_Library_Test.ino
3+
Library test file for the MiniGen library.
4+
Mike Hord @ SparkFun Electronics
5+
6 May 2014
6+
https://github.com/sparkfun/SparkFun_MiniGen_Arduino_Library
7+
8+
This is a simple test/example file for the MiniGen board and library.
9+
10+
The MiniGen is a Pro Mini shield-type board (although it can be used as a
11+
standalone product as well) that generates sine, square and triangle waves up
12+
to a frequency of approximately 3MHz; above 3MHz, you'll start to see rolloff
13+
as the anti-aliasing filter on the output begins to affect the signal. Expect
14+
a peak-to-peak amplitude of about 1V and a DC offset of Vcc/2.
15+
16+
Resources:
17+
Uses the MiniGen library and the built-in SPI library.
18+
19+
Development environment specifics:
20+
Code developed in Arduino 1.0.5, on an Arduino Pro Mini 5V.
21+
22+
**Updated to Arduino 1.6.4 5/2015**
23+
24+
25+
This code is beerware; if you see me (or any other SparkFun employee) at the
26+
local, and you've found our code helpful, please buy us a round!
27+
28+
Distributed as-is; no warranty is given.
29+
******************************************************************************/
30+
// Due to limitations in the Arduino environment, SPI.h must be included both
31+
// in the library which uses it *and* any sketch using that library.
32+
#include <SPI.h>
33+
#include <SparkFun_MiniGen.h>
34+
35+
// Create an instance of the MiniGen device; note that this has no provision for
36+
// alternate CLK and MOSI pins, but you *can* pass it a different CS (or FSYNC,
37+
// as it's referred to elsewhere) pin number.
38+
MiniGen gen;
39+
40+
void setup()
41+
{
42+
// Clear the registers in the AD9837 chip, so we're starting from a known
43+
// location. Note that since the AD9837 has no DOUT, we can't use the
44+
// read-modify-write method of control. At power up, the output frequency
45+
// will be 100Hz.
46+
gen.reset();
47+
delay(2000);
48+
49+
// SQUARE is, as it suggests, a square wave. SQUARE is at the current output
50+
// frequency.
51+
gen.setMode(MiniGen::SQUARE);
52+
delay(3000);
53+
54+
// SQUARE_2 is at half the normal output frequency.
55+
gen.setMode(MiniGen::SQUARE_2);
56+
delay(3000);
57+
58+
// Exactly what you think it is.
59+
gen.setMode(MiniGen::TRIANGLE);
60+
delay(3000);
61+
62+
// Yep.
63+
gen.setMode(MiniGen::SINE);
64+
65+
// This needs a little explanation. The choices are FULL, COARSE, and FINE.
66+
// a FULL write takes longer but writes the entire frequency word, so you
67+
// can change from any frequency to any other frequency. COARSE only allows
68+
// you to change the upper bits; the lower bits remain unchanged, so you
69+
// can do a fast write of a large step size. FINE is the opposite; quick
70+
// writes but smaller steps.
71+
gen.setFreqAdjustMode(MiniGen::FULL);
72+
}
73+
74+
void loop()
75+
{
76+
// Loop is going to increase the frequency in steps of 10Hz, basically
77+
// forever. Since the upper limit is 3MHz, you'll probably not sit
78+
// around long enough for frequency to overflow.
79+
static float frequency = 10.0;
80+
81+
// freqCalc() makes a useful 32-bit value out of the frequency value (in
82+
// Hz) passed to it.
83+
unsigned long freqReg = gen.freqCalc(frequency);
84+
85+
// Adjust the frequency. This is a full 32-bit write.
86+
gen.adjustFreq(MiniGen::FREQ0, freqReg);
87+
delay(100);
88+
frequency += 10.0;
89+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=SparkFun MiniGen
2+
version=1.1.0
3+
author=Mike Hord@SparkFun Electronics <techsupport@sparkfun.com>
4+
maintainer=SparkFun Electronics <sparkfun.com>
5+
sentence=SparkFun MiniGen library allows the user to generate sine, square, or triangle waves at up to 3MHz, and approximately 1Vp-p.
6+
paragraph=Communication occurs via SPI, and eanbles the 10-bit DAC for accuracy.
7+
category=Signal Input/Output
8+
url=https://github.com/sparkfun/SparkFun_MiniGen_Arduino_Library
9+
architectures=*

0 commit comments

Comments
 (0)