-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
9,385 additions
and
4,356 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// ADCT0ATrigger.h | ||
// Runs on LM4F120 | ||
// Provide a function that initializes Timer0A to trigger ADC | ||
// SS3 conversions and request an interrupt when the conversion | ||
// is complete. | ||
// Daniel Valvano | ||
// October 25, 2012 | ||
|
||
/* This example accompanies the book | ||
"Embedded Systems: Real Time Interfacing to Arm Cortex M Microcontrollers", | ||
ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2012 | ||
Copyright 2012 by Jonathan W. Valvano, valvano@mail.utexas.edu | ||
You may use, edit, run or distribute this file | ||
as long as the above copyright notice remains | ||
THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED | ||
OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. | ||
VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, | ||
OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. | ||
For more information about my classes, my research, and my books, see | ||
http://users.ece.utexas.edu/~valvano/ | ||
*/ | ||
|
||
// This initialization function sets up the ADC according to the | ||
// following parameters. Any parameters not explicitly listed | ||
// below are not modified: | ||
// Timer0A: enabled | ||
// Mode: 16-bit, down counting | ||
// One-shot or periodic: periodic | ||
// Prescale value: programmable using variable 'prescale' [0:255] | ||
// Interval value: programmable using variable 'period' [0:65535] | ||
// Sample time is busPeriod*(prescale+1)*(period+1) | ||
// Max sample rate: <=125,000 samples/second | ||
// Sequencer 0 priority: 1st (highest) | ||
// Sequencer 1 priority: 2nd | ||
// Sequencer 2 priority: 3rd | ||
// Sequencer 3 priority: 4th (lowest) | ||
// SS3 triggering event: Timer0A | ||
// SS3 1st sample source: programmable using variable 'channelNum' [0:11] | ||
// SS3 interrupts: enabled and promoted to controller | ||
// channelNum must be 0-11 (inclusive) corresponding to Ain0 through Ain11 | ||
void ADC0_InitTimer0ATriggerSeq3(unsigned char channelNum, unsigned char prescale, unsigned short period); |
Oops, something went wrong.