projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1afe51f
)
Fix incorrect ADC driver documentation for the parameters of ADC_Init(), fix incorrec...
author
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 31 Aug 2010 07:32:48 +0000
(07:32 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Tue, 31 Aug 2010 07:32:48 +0000
(07:32 +0000)
LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
patch
|
blob
|
blame
|
history
LUFA/ManPages/LUFAPoweredProjects.txt
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/V2Protocol.c
patch
|
blob
|
blame
|
history
Projects/TempDataLogger/TempDataLogger.c
patch
|
blob
|
blame
|
history
diff --git
a/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
b/LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
index
ed42b34
..
e927de1
100644
(file)
--- a/
LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
+++ b/
LUFA/Drivers/Peripheral/AVRU4U6U7/ADC.h
@@
-31,7
+31,8
@@
/** \file
* \brief ADC peripheral driver for the U7, U6 and U4 USB AVRs.
*
/** \file
* \brief ADC peripheral driver for the U7, U6 and U4 USB AVRs.
*
- * ADC driver for the AT90USB1287, AT90USB1286, AT90USB647, AT90USB646, ATMEGA16U4 and ATMEGA32U4 AVRs.
+ * On-chip Analogue-to-Digital converter (ADC) driver for supported U4, U6 and U7 model AVRs that contain an ADC
+ * peripheral internally.
*
* \note This file should not be included directly. It is automatically included as needed by the ADC driver
* dispatch header located in LUFA/Drivers/Peripheral/ADC.h.
*
* \note This file should not be included directly. It is automatically included as needed by the ADC driver
* dispatch header located in LUFA/Drivers/Peripheral/ADC.h.
@@
-40,7
+41,8
@@
/** \ingroup Group_ADC
* @defgroup Group_ADC_AVRU4U6U7 Series U4, U6 and U7 Model ADC Driver
*
/** \ingroup Group_ADC
* @defgroup Group_ADC_AVRU4U6U7 Series U4, U6 and U7 Model ADC Driver
*
- * ADC driver for the AT90USB1287, AT90USB1286, AT90USB647, AT90USB646, ATMEGA16U4 and ATMEGA32U4 AVRs.
+ * On-chip Analogue-to-Digital converter (ADC) driver for supported U4, U6 and U7 model AVRs that contain an ADC
+ * peripheral internally.
*
* \note This file should not be included directly. It is automatically included as needed by the ADC driver
* dispatch header located in LUFA/Drivers/Peripheral/ADC.h.
*
* \note This file should not be included directly. It is automatically included as needed by the ADC driver
* dispatch header located in LUFA/Drivers/Peripheral/ADC.h.
@@
-208,35
+210,35
@@
*
* \note The channel number must be specified as an integer, and NOT a ADC_CHANNELx mask.
*
*
* \note The channel number must be specified as an integer, and NOT a ADC_CHANNELx mask.
*
- * \param[in] Channel ADC channel number to set up for conversions.
+ * \param[in] Channel
Index
ADC channel number to set up for conversions.
*/
*/
- static inline void ADC_SetupChannel(const uint8_t Channel)
+ static inline void ADC_SetupChannel(const uint8_t Channel
Index
)
{
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
defined(__AVR_ATmega32U6__))
{
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
defined(__AVR_ATmega32U6__))
- DDRF &= ~(1 << Channel);
- DIDR0 |= (1 << Channel);
+ DDRF &= ~(1 << Channel
Index
);
+ DIDR0 |= (1 << Channel
Index
);
#elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
#elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
- if (Channel < 8)
+ if (Channel
Index
< 8)
{
{
- DDRF &= ~(1 << Channel);
- DIDR0 |= (1 << Channel);
+ DDRF &= ~(1 << Channel
Index
);
+ DIDR0 |= (1 << Channel
Index
);
}
}
- else if (Channel == 8)
+ else if (Channel
Index
== 8)
{
DDRD &= ~(1 << 4);
DIDR2 |= (1 << 0);
}
{
DDRD &= ~(1 << 4);
DIDR2 |= (1 << 0);
}
- else if (Channel < 11)
+ else if (Channel
Index
< 11)
{
{
- DDRD &= ~(1 << (Channel - 3));
- DIDR2 |= (1 << (Channel - 8));
+ DDRD &= ~(1 << (Channel
Index
- 3));
+ DIDR2 |= (1 << (Channel
Index
- 8));
}
else
{
}
else
{
- DDRB &= ~(1 << (Channel - 7));
- DIDR2 |= (1 << (Channel - 8));
+ DDRB &= ~(1 << (Channel
Index
- 7));
+ DIDR2 |= (1 << (Channel
Index
- 8));
}
#endif
}
}
#endif
}
@@
-251,35
+253,35
@@
*
* \note The channel number must be specified as an integer, and NOT a ADC_CHANNELx mask.
*
*
* \note The channel number must be specified as an integer, and NOT a ADC_CHANNELx mask.
*
- * \param[in] Channel ADC channel number to set up for conversions.
+ * \param[in] Channel
Index
ADC channel number to set up for conversions.
*/
*/
- static inline void ADC_DisableChannel(const uint8_t Channel)
+ static inline void ADC_DisableChannel(const uint8_t Channel
Index
)
{
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
defined(__AVR_ATmega32U6__))
{
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB647__) || \
defined(__AVR_ATmega32U6__))
- DDRF &= ~(1 << Channel);
- DIDR0 &= ~(1 << Channel);
+ DDRF &= ~(1 << Channel
Index
);
+ DIDR0 &= ~(1 << Channel
Index
);
#elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
#elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
- if (Channel < 8)
+ if (Channel
Index
< 8)
{
{
- DDRF &= ~(1 << Channel);
- DIDR0 &= ~(1 << Channel);
+ DDRF &= ~(1 << Channel
Index
);
+ DIDR0 &= ~(1 << Channel
Index
);
}
}
- else if (Channel == 8)
+ else if (Channel
Index
== 8)
{
DDRD &= ~(1 << 4);
DIDR2 &= ~(1 << 0);
}
{
DDRD &= ~(1 << 4);
DIDR2 &= ~(1 << 0);
}
- else if (Channel < 11)
+ else if (Channel
Index
< 11)
{
{
- DDRD &= ~(1 << (Channel - 3));
- DIDR2 &= ~(1 << (Channel - 8));
+ DDRD &= ~(1 << (Channel
Index
- 3));
+ DIDR2 &= ~(1 << (Channel
Index
- 8));
}
else
{
}
else
{
- DDRB &= ~(1 << (Channel - 7));
- DIDR2 &= ~(1 << (Channel - 8));
+ DDRB &= ~(1 << (Channel
Index
- 7));
+ DIDR2 &= ~(1 << (Channel
Index
- 8));
}
#endif
}
}
#endif
}
@@
-292,7
+294,7
@@
* conversions. If the ADC is in single conversion mode (or the channel to convert from is to be changed),
* this function must be called each time a conversion is to take place.
*
* conversions. If the ADC is in single conversion mode (or the channel to convert from is to be changed),
* this function must be called each time a conversion is to take place.
*
- * \param[in] MUXMask
Mask comprising of an
ADC channel mask, reference mask and adjustment mask.
+ * \param[in] MUXMask ADC channel mask, reference mask and adjustment mask.
*/
static inline void ADC_StartReading(const uint16_t MUXMask)
{
*/
static inline void ADC_StartReading(const uint16_t MUXMask)
{
@@
-354,7
+356,7
@@
* The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and
* prescaler masks.
*
* The "mode" parameter should be a mask comprised of a conversion mode (free running or single) and
* prescaler masks.
*
- * \param[in] Mode Mask of ADC
settings, including adjustment, prescale, mode and reference
.
+ * \param[in] Mode Mask of ADC
prescale and mode settings
.
*/
static inline void ADC_Init(uint8_t Mode) ATTR_ALWAYS_INLINE;
static inline void ADC_Init(uint8_t Mode)
*/
static inline void ADC_Init(uint8_t Mode) ATTR_ALWAYS_INLINE;
static inline void ADC_Init(uint8_t Mode)
diff --git
a/LUFA/ManPages/LUFAPoweredProjects.txt
b/LUFA/ManPages/LUFAPoweredProjects.txt
index
abb0e02
..
7ab60e3
100644
(file)
--- a/
LUFA/ManPages/LUFAPoweredProjects.txt
+++ b/
LUFA/ManPages/LUFAPoweredProjects.txt
@@
-49,6
+49,7
@@
* - Ghetto Drum, a MIDI drum controller: http://noisybox.net/art/gdrum/
* - IR Remote to Keyboard decoder: http://netzhansa.blogspot.com/2010/04/our-living-room-hi-fi-setup-needs-mp3.html
* - LED Panel controller: http://projects.peterpolidoro.net/caltech/panelscontroller/panelscontroller.htm
* - Ghetto Drum, a MIDI drum controller: http://noisybox.net/art/gdrum/
* - IR Remote to Keyboard decoder: http://netzhansa.blogspot.com/2010/04/our-living-room-hi-fi-setup-needs-mp3.html
* - LED Panel controller: http://projects.peterpolidoro.net/caltech/panelscontroller/panelscontroller.htm
+ * - Single LED Matrix Display: http://guysoft.wordpress.com/2009/10/08/bumble-b/
* - Linux Secure Storage Dongle: http://github.com/TomMD/teensy
* - MakeTV Episode Dispenser: http://www.youtube.com/watch?v=BkWUi18hl3g
* - MidiMonster, a USB-to-MIDI gateway board: http://www.dorkbotpdx.org/wiki/midimonster
* - Linux Secure Storage Dongle: http://github.com/TomMD/teensy
* - MakeTV Episode Dispenser: http://www.youtube.com/watch?v=BkWUi18hl3g
* - MidiMonster, a USB-to-MIDI gateway board: http://www.dorkbotpdx.org/wiki/midimonster
@@
-61,6
+62,7
@@
* - SD Card reader: http://elasticsheep.com/2010/04/teensy2-usb-mass-storage-with-an-sd-card/
* - SEGA Megadrive/Genesis Development Cartridge: http://www.makestuff.eu/wordpress/?page_id=398
* - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/
* - SD Card reader: http://elasticsheep.com/2010/04/teensy2-usb-mass-storage-with-an-sd-card/
* - SEGA Megadrive/Genesis Development Cartridge: http://www.makestuff.eu/wordpress/?page_id=398
* - Stripe Snoop, a Magnetic Card reader: http://www.ossguy.com/ss_usb/
+ * - Teensy SD Card .WAV file player: http://elasticsheep.com/2010/04/teensy2-usb-wav-player-part-1/
* - Touchscreen Input Device: http://capnstech.blogspot.com/2010/07/touchscreen-update.html
* - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001
* - Userial, a USB to Serial converter with SPI, I2C and other protocols: http://www.tty1.net/userial/
* - Touchscreen Input Device: http://capnstech.blogspot.com/2010/07/touchscreen-update.html
* - USB Interface for Playstation Portable Devices: http://forums.ps2dev.org/viewtopic.php?t=11001
* - Userial, a USB to Serial converter with SPI, I2C and other protocols: http://www.tty1.net/userial/
diff --git
a/Projects/AVRISP-MKII/Lib/V2Protocol.c
b/Projects/AVRISP-MKII/Lib/V2Protocol.c
index
45d840b
..
4ef1b94
100644
(file)
--- a/
Projects/AVRISP-MKII/Lib/V2Protocol.c
+++ b/
Projects/AVRISP-MKII/Lib/V2Protocol.c
@@
-57,7
+57,7
@@
void V2Protocol_Init(void)
/* Initialize the ADC converter for VTARGET level detection on supported AVR models */
ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_128);
ADC_SetupChannel(VTARGET_ADC_CHANNEL);
/* Initialize the ADC converter for VTARGET level detection on supported AVR models */
ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_128);
ADC_SetupChannel(VTARGET_ADC_CHANNEL);
- ADC_StartReading(
VTARGET_ADC_CHANNEL_MASK | ADC_RIGHT_ADJUSTED | ADC_REFERENCE_AVCC
);
+ ADC_StartReading(
ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | VTARGET_ADC_CHANNEL_MASK
);
#endif
/* Timeout timer initialization (10ms period) */
#endif
/* Timeout timer initialization (10ms period) */
diff --git
a/Projects/TempDataLogger/TempDataLogger.c
b/Projects/TempDataLogger/TempDataLogger.c
index
ee9ca18
..
607e225
100644
(file)
--- a/
Projects/TempDataLogger/TempDataLogger.c
+++ b/
Projects/TempDataLogger/TempDataLogger.c
@@
-201,7
+201,7
@@
void SetupHardware(void)
/* Hardware Initialization */
LEDs_Init();
SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER);
/* Hardware Initialization */
LEDs_Init();
SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER);
- ADC_Init(ADC_
REFERENCE_AVCC | ADC_
FREE_RUNNING | ADC_PRESCALE_128);
+ ADC_Init(ADC_FREE_RUNNING | ADC_PRESCALE_128);
Temperature_Init();
Dataflash_Init();
USB_Init();
Temperature_Init();
Dataflash_Init();
USB_Init();