Skip to content

Commit

Permalink
Chapter 14 files
Browse files Browse the repository at this point in the history
  • Loading branch information
rosterloh committed Apr 16, 2014
1 parent a0bd3a9 commit fbc869d
Show file tree
Hide file tree
Showing 54 changed files with 9,385 additions and 4,356 deletions.
286 changes: 286 additions & 0 deletions ADCT0ATrigger/ADCT0ATrigger.c

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions ADCT0ATrigger/ADCT0ATrigger.h
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);
Loading

0 comments on commit fbc869d

Please sign in to comment.