Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
05d82d72
Commit
05d82d72
authored
10 years ago
by
Thibaut VIARD
Browse files
Options
Downloads
Patches
Plain Diff
Disabling temporary the DAC
Signed-off-by:
Thibaut VIARD
<
thibaut.viard@atmel.com
>
parent
7722eb9c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cores/arduino/wiring.c
+5
-6
5 additions, 6 deletions
cores/arduino/wiring.c
with
5 additions
and
6 deletions
cores/arduino/wiring.c
+
5
−
6
View file @
05d82d72
...
...
@@ -16,9 +16,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//#include "Arduino.h"
#include
"variant.h"
//
#include "wiring_
constants
.h"
#include
"wiring_
analog
.h"
#include
"wiring_digital.h"
#include
"wiring.h"
...
...
@@ -27,7 +26,7 @@ extern "C" {
#endif
/*
* System Core Clock is at 1MHz at Reset.
* System Core Clock is at 1MHz
(8MHz/8)
at Reset.
* It is switched to 48MHz in the Reset Handler (startup.c)
*/
uint32_t
SystemCoreClock
=
1000000ul
;
...
...
@@ -106,7 +105,7 @@ void init( void )
ADC
->
AVGCTRL
.
reg
=
ADC_AVGCTRL_SAMPLENUM_2
|
// 2 samples
ADC_AVGCTRL_ADJRES
(
0x01ul
);
// Adjusting result by 1
ADC
->
REFCTRL
.
reg
=
ADC_REFCTRL_REFSEL_AREFA
;
// R
Reference AREF
A (
pin
AREF) [default]
analogReference
(
AR_DEFAULT
)
;
// Analog
Reference
is
AREF
pin
(3.3v)
ADC
->
CTRLA
.
bit
.
ENABLE
=
1
;
// Enable ADC
while
(
ADC
->
STATUS
.
bit
.
SYNCBUSY
==
1
)
...
...
@@ -120,7 +119,7 @@ void init( void )
GCLK_CLKCTRL_GEN_GCLK0
|
// Generic Clock Generator 0 is source
GCLK_CLKCTRL_CLKEN
;
/* temporary DAC disable
DAC->CTRLB.reg = DAC_CTRLB_REFSEL_AVCC | // Using the 3.3V reference
DAC_CTRLB_EOEN; // External Output Enable (Vout)
DAC->DATA.reg = 0x3FFul;
...
...
@@ -132,7 +131,7 @@ void init( void )
{
// Waiting for synchronization
}
*/
}
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment