Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
28401f7b
Commit
28401f7b
authored
Jul 29, 2010
by
Dean Camera
Browse files
Spell check all source files once again to find any typos.
parent
ca007f91
Changes
116
Hide whitespace changes
Inline
Side-by-side
Bootloaders/CDC/BootloaderCDC.txt
View file @
28401f7b
...
...
@@ -60,7 +60,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
@@ -69,4 +69,4 @@
* </td>
* </tr>
* </table>
*/
\ No newline at end of file
*/
Bootloaders/DFU/BootloaderDFU.txt
View file @
28401f7b
...
...
@@ -71,7 +71,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/AudioInput/AudioInput.txt
View file @
28401f7b
...
...
@@ -61,7 +61,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
View file @
28401f7b
...
...
@@ -156,7 +156,7 @@ void EVENT_USB_Device_Connect(void)
/* PWM speaker timer initialization */
TCCR3A
=
((
1
<<
WGM30
)
|
(
1
<<
COM3A1
)
|
(
1
<<
COM3A0
)
|
(
1
<<
COM3B1
)
|
(
1
<<
COM3B0
));
// Set on match, clear on TOP
TCCR3B
=
((
1
<<
WGM32
)
|
(
1
<<
CS30
));
// Fast 8-Bit PWM, F
cpu
speed
TCCR3B
=
((
1
<<
WGM32
)
|
(
1
<<
CS30
));
// Fast 8-Bit PWM, F
_CPU
speed
#endif
}
...
...
Demos/Device/ClassDriver/AudioOutput/AudioOutput.txt
View file @
28401f7b
...
...
@@ -63,7 +63,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.txt
View file @
28401f7b
...
...
@@ -73,7 +73,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
@@ -82,4 +82,4 @@
* </td>
* </tr>
* </table>
*/
\ No newline at end of file
*/
Demos/Device/ClassDriver/GenericHID/GenericHID.txt
View file @
28401f7b
...
...
@@ -57,7 +57,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/Joystick/Joystick.txt
View file @
28401f7b
...
...
@@ -61,7 +61,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
@@ -70,4 +70,4 @@
* </td>
* </tr>
* </table>
*/
\ No newline at end of file
*/
Demos/Device/ClassDriver/Keyboard/Keyboard.txt
View file @
28401f7b
...
...
@@ -55,12 +55,12 @@
* when the USB connection to a host is present. To use the keyboard example,
* manipulate the joystick to send the letters a, b, c, d and e. See the USB HID
* documentation for more information on sending keyboard event and key presses. Unlike
* other LUFA Keyboard demos, this example shows explicitly how to send multiple keypresses
* other LUFA Keyboard demos, this example shows explicitly how to send multiple key
presses
* inside the same report to the host.
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.txt
View file @
28401f7b
...
...
@@ -65,7 +65,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/MIDI/MIDI.txt
View file @
28401f7b
...
...
@@ -62,7 +62,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.c
View file @
28401f7b
...
...
@@ -30,7 +30,7 @@
/** \file
*
* Functions to manage the physical
d
ataflash media, including reading and writing of
* Functions to manage the physical
D
ataflash media, including reading and writing of
* blocks of data. These functions are called by the SCSI layer when data must be stored
* or retrieved to/from the physical storage media. If a different media is used (such
* as a SD card or EEPROM), functions similar to these will need to be generated.
...
...
@@ -39,9 +39,9 @@
#define INCLUDE_FROM_DATAFLASHMANAGER_C
#include
"DataflashManager.h"
/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board
d
ataflash IC(s), from
/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board
D
ataflash IC(s), from
* the pre-selected data OUT endpoint. This routine reads in OS sized blocks from the endpoint and writes
* them to the
d
ataflash in Dataflash page sized blocks.
* them to the
D
ataflash in Dataflash page sized blocks.
*
* \param[in] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state
* \param[in] BlockAddress Data block starting address for the write sequence
...
...
@@ -60,13 +60,13 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
Dataflash_SelectChipFromPage
(
CurrDFPage
);
#if (DATAFLASH_PAGE_SIZE > VIRTUAL_MEMORY_BLOCK_SIZE)
/* Copy selected dataflash's current page contents to the
d
ataflash buffer */
/* Copy selected dataflash's current page contents to the
D
ataflash buffer */
Dataflash_SendByte
(
DF_CMD_MAINMEMTOBUFF1
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
Dataflash_WaitWhileBusy
();
#endif
/* Send the
d
ataflash buffer write command */
/* Send the
D
ataflash buffer write command */
Dataflash_SendByte
(
DF_CMD_BUFF1WRITE
);
Dataflash_SendAddressBytes
(
0
,
CurrDFPageByte
);
...
...
@@ -78,7 +78,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
{
uint8_t
BytesInBlockDiv16
=
0
;
/* Write an endpoint packet sized data block to the
d
ataflash */
/* Write an endpoint packet sized data block to the
D
ataflash */
while
(
BytesInBlockDiv16
<
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
{
/* Check if the endpoint is currently empty */
...
...
@@ -92,30 +92,30 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
return
;
}
/* Check if end of
d
ataflash page reached */
/* Check if end of
D
ataflash page reached */
if
(
CurrDFPageByteDiv16
==
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Write the
d
ataflash buffer contents back to the
d
ataflash page */
/* Write the
D
ataflash buffer contents back to the
D
ataflash page */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_BUFF2TOMAINMEMWITHERASE
:
DF_CMD_BUFF1TOMAINMEMWITHERASE
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
/* Reset the
d
ataflash buffer counter, increment the page counter */
/* Reset the
D
ataflash buffer counter, increment the page counter */
CurrDFPageByteDiv16
=
0
;
CurrDFPage
++
;
/* Once all the
d
ataflash ICs have had their first buffers filled, switch buffers to maintain throughput */
/* Once all the
D
ataflash ICs have had their first buffers filled, switch buffers to maintain throughput */
if
(
Dataflash_GetSelectedChip
()
==
DATAFLASH_CHIP_MASK
(
DATAFLASH_TOTALCHIPS
))
UsingSecondBuffer
=
!
(
UsingSecondBuffer
);
/* Select the next
d
ataflash chip based on the new
d
ataflash page index */
/* Select the next
D
ataflash chip based on the new
D
ataflash page index */
Dataflash_SelectChipFromPage
(
CurrDFPage
);
#if (DATAFLASH_PAGE_SIZE > VIRTUAL_MEMORY_BLOCK_SIZE)
/* If less than one
d
ataflash page remaining, copy over the existing page to preserve trailing data */
/* If less than one
D
ataflash page remaining, copy over the existing page to preserve trailing data */
if
((
TotalBlocks
*
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
<
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Copy selected dataflash's current page contents to the
d
ataflash buffer */
/* Copy selected dataflash's current page contents to the
D
ataflash buffer */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_MAINMEMTOBUFF2
:
DF_CMD_MAINMEMTOBUFF1
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
...
...
@@ -123,12 +123,12 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
}
#endif
/* Send the
d
ataflash buffer write command */
/* Send the
D
ataflash buffer write command */
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_BUFF2WRITE
:
DF_CMD_BUFF1WRITE
);
Dataflash_SendAddressBytes
(
0
,
0
);
}
/* Write one 16-byte chunk of data to the
d
ataflash */
/* Write one 16-byte chunk of data to the
D
ataflash */
Dataflash_SendByte
(
Endpoint_Read_Byte
());
Dataflash_SendByte
(
Endpoint_Read_Byte
());
Dataflash_SendByte
(
Endpoint_Read_Byte
());
...
...
@@ -146,7 +146,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
Dataflash_SendByte
(
Endpoint_Read_Byte
());
Dataflash_SendByte
(
Endpoint_Read_Byte
());
/* Increment the
d
ataflash page 16 byte block counter */
/* Increment the
D
ataflash page 16 byte block counter */
CurrDFPageByteDiv16
++
;
/* Increment the block 16 byte block counter */
...
...
@@ -161,7 +161,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
TotalBlocks
--
;
}
/* Write the
d
ataflash buffer contents back to the
d
ataflash page */
/* Write the
D
ataflash buffer contents back to the
D
ataflash page */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_BUFF2TOMAINMEMWITHERASE
:
DF_CMD_BUFF1TOMAINMEMWITHERASE
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0x00
);
...
...
@@ -171,11 +171,11 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
if
(
!
(
Endpoint_IsReadWriteAllowed
()))
Endpoint_ClearOUT
();
/* Deselect all
d
ataflash chips */
/* Deselect all
D
ataflash chips */
Dataflash_DeselectChip
();
}
/** Reads blocks (OS blocks, not Dataflash pages) from the storage medium, the board
d
ataflash IC(s), into
/** Reads blocks (OS blocks, not Dataflash pages) from the storage medium, the board
D
ataflash IC(s), into
* the pre-selected data IN endpoint. This routine reads in Dataflash page sized blocks from the Dataflash
* and writes them in OS sized blocks to the endpoint.
*
...
...
@@ -194,7 +194,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
/* Select the correct starting Dataflash IC for the block requested */
Dataflash_SelectChipFromPage
(
CurrDFPage
);
/* Send the
d
ataflash main memory page read command */
/* Send the
D
ataflash main memory page read command */
Dataflash_SendByte
(
DF_CMD_MAINMEMPAGEREAD
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
CurrDFPageByte
);
Dataflash_SendByte
(
0x00
);
...
...
@@ -210,7 +210,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
{
uint8_t
BytesInBlockDiv16
=
0
;
/* Write an endpoint packet sized data block to the
d
ataflash */
/* Write an endpoint packet sized data block to the
D
ataflash */
while
(
BytesInBlockDiv16
<
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
{
/* Check if the endpoint is currently full */
...
...
@@ -224,17 +224,17 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
return
;
}
/* Check if end of
d
ataflash page reached */
/* Check if end of
D
ataflash page reached */
if
(
CurrDFPageByteDiv16
==
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Reset the
d
ataflash buffer counter, increment the page counter */
/* Reset the
D
ataflash buffer counter, increment the page counter */
CurrDFPageByteDiv16
=
0
;
CurrDFPage
++
;
/* Select the next
d
ataflash chip based on the new
d
ataflash page index */
/* Select the next
D
ataflash chip based on the new
D
ataflash page index */
Dataflash_SelectChipFromPage
(
CurrDFPage
);
/* Send the
d
ataflash main memory page read command */
/* Send the
D
ataflash main memory page read command */
Dataflash_SendByte
(
DF_CMD_MAINMEMPAGEREAD
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
Dataflash_SendByte
(
0x00
);
...
...
@@ -243,7 +243,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
Dataflash_SendByte
(
0x00
);
}
/* Read one 16-byte chunk of data from the
d
ataflash */
/* Read one 16-byte chunk of data from the
D
ataflash */
Endpoint_Write_Byte
(
Dataflash_ReceiveByte
());
Endpoint_Write_Byte
(
Dataflash_ReceiveByte
());
Endpoint_Write_Byte
(
Dataflash_ReceiveByte
());
...
...
@@ -261,7 +261,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
Endpoint_Write_Byte
(
Dataflash_ReceiveByte
());
Endpoint_Write_Byte
(
Dataflash_ReceiveByte
());
/* Increment the
d
ataflash page 16 byte block counter */
/* Increment the
D
ataflash page 16 byte block counter */
CurrDFPageByteDiv16
++
;
/* Increment the block 16 byte block counter */
...
...
@@ -280,14 +280,14 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
if
(
!
(
Endpoint_IsReadWriteAllowed
()))
Endpoint_ClearIN
();
/* Deselect all
d
ataflash chips */
/* Deselect all
D
ataflash chips */
Dataflash_DeselectChip
();
}
/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board
d
ataflash IC(s), from
/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board
D
ataflash IC(s), from
* the a given RAM buffer. This routine reads in OS sized blocks from the buffer and writes them to the
*
d
ataflash in Dataflash page sized blocks. This can be linked to FAT libraries to write files to the
*
d
ataflash.
*
D
ataflash in Dataflash page sized blocks. This can be linked to FAT libraries to write files to the
*
D
ataflash.
*
* \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write
...
...
@@ -306,13 +306,13 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
Dataflash_SelectChipFromPage
(
CurrDFPage
);
#if (DATAFLASH_PAGE_SIZE > VIRTUAL_MEMORY_BLOCK_SIZE)
/* Copy selected dataflash's current page contents to the
d
ataflash buffer */
/* Copy selected dataflash's current page contents to the
D
ataflash buffer */
Dataflash_SendByte
(
DF_CMD_MAINMEMTOBUFF1
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
Dataflash_WaitWhileBusy
();
#endif
/* Send the
d
ataflash buffer write command */
/* Send the
D
ataflash buffer write command */
Dataflash_SendByte
(
DF_CMD_BUFF1WRITE
);
Dataflash_SendAddressBytes
(
0
,
CurrDFPageByte
);
...
...
@@ -320,33 +320,33 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
{
uint8_t
BytesInBlockDiv16
=
0
;
/* Write an endpoint packet sized data block to the
d
ataflash */
/* Write an endpoint packet sized data block to the
D
ataflash */
while
(
BytesInBlockDiv16
<
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
{
/* Check if end of
d
ataflash page reached */
/* Check if end of
D
ataflash page reached */
if
(
CurrDFPageByteDiv16
==
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Write the
d
ataflash buffer contents back to the
d
ataflash page */
/* Write the
D
ataflash buffer contents back to the
D
ataflash page */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_BUFF2TOMAINMEMWITHERASE
:
DF_CMD_BUFF1TOMAINMEMWITHERASE
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
/* Reset the
d
ataflash buffer counter, increment the page counter */
/* Reset the
D
ataflash buffer counter, increment the page counter */
CurrDFPageByteDiv16
=
0
;
CurrDFPage
++
;
/* Once all the
d
ataflash ICs have had their first buffers filled, switch buffers to maintain throughput */
/* Once all the
D
ataflash ICs have had their first buffers filled, switch buffers to maintain throughput */
if
(
Dataflash_GetSelectedChip
()
==
DATAFLASH_CHIP_MASK
(
DATAFLASH_TOTALCHIPS
))
UsingSecondBuffer
=
!
(
UsingSecondBuffer
);
/* Select the next
d
ataflash chip based on the new
d
ataflash page index */
/* Select the next
D
ataflash chip based on the new
D
ataflash page index */
Dataflash_SelectChipFromPage
(
CurrDFPage
);
#if (DATAFLASH_PAGE_SIZE > VIRTUAL_MEMORY_BLOCK_SIZE)
/* If less than one
d
ataflash page remaining, copy over the existing page to preserve trailing data */
/* If less than one
D
ataflash page remaining, copy over the existing page to preserve trailing data */
if
((
TotalBlocks
*
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
<
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Copy selected dataflash's current page contents to the
d
ataflash buffer */
/* Copy selected dataflash's current page contents to the
D
ataflash buffer */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_MAINMEMTOBUFF2
:
DF_CMD_MAINMEMTOBUFF1
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
...
...
@@ -354,17 +354,17 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
}
#endif
/* Send the
d
ataflash buffer write command */
/* Send the
D
ataflash buffer write command */
Dataflash_ToggleSelectedChipCS
();
Dataflash_SendByte
(
DF_CMD_BUFF1WRITE
);
Dataflash_SendAddressBytes
(
0
,
0
);
}
/* Write one 16-byte chunk of data to the
d
ataflash */
/* Write one 16-byte chunk of data to the
D
ataflash */
for
(
uint8_t
ByteNum
=
0
;
ByteNum
<
16
;
ByteNum
++
)
Dataflash_SendByte
(
*
(
BufferPtr
++
));
/* Increment the
d
ataflash page 16 byte block counter */
/* Increment the
D
ataflash page 16 byte block counter */
CurrDFPageByteDiv16
++
;
/* Increment the block 16 byte block counter */
...
...
@@ -375,20 +375,20 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
TotalBlocks
--
;
}
/* Write the
d
ataflash buffer contents back to the
d
ataflash page */
/* Write the
D
ataflash buffer contents back to the
D
ataflash page */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_BUFF2TOMAINMEMWITHERASE
:
DF_CMD_BUFF1TOMAINMEMWITHERASE
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0x00
);
Dataflash_WaitWhileBusy
();
/* Deselect all
d
ataflash chips */
/* Deselect all
D
ataflash chips */
Dataflash_DeselectChip
();
}
/** Reads blocks (OS blocks, not Dataflash pages) from the storage medium, the board
d
ataflash IC(s), into
/** Reads blocks (OS blocks, not Dataflash pages) from the storage medium, the board
D
ataflash IC(s), into
* the a preallocated RAM buffer. This routine reads in Dataflash page sized blocks from the Dataflash
* and writes them in OS sized blocks to the given buffer. This can be linked to FAT libraries to read
* the files stored on the
d
ataflash.
* the files stored on the
D
ataflash.
*
* \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read
...
...
@@ -405,7 +405,7 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
/* Select the correct starting Dataflash IC for the block requested */
Dataflash_SelectChipFromPage
(
CurrDFPage
);
/* Send the
d
ataflash main memory page read command */
/* Send the
D
ataflash main memory page read command */
Dataflash_SendByte
(
DF_CMD_MAINMEMPAGEREAD
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
CurrDFPageByte
);
Dataflash_SendByte
(
0x00
);
...
...
@@ -417,20 +417,20 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
{
uint8_t
BytesInBlockDiv16
=
0
;
/* Write an endpoint packet sized data block to the
d
ataflash */
/* Write an endpoint packet sized data block to the
D
ataflash */
while
(
BytesInBlockDiv16
<
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
{
/* Check if end of
d
ataflash page reached */
/* Check if end of
D
ataflash page reached */
if
(
CurrDFPageByteDiv16
==
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Reset the
d
ataflash buffer counter, increment the page counter */
/* Reset the
D
ataflash buffer counter, increment the page counter */
CurrDFPageByteDiv16
=
0
;
CurrDFPage
++
;
/* Select the next
d
ataflash chip based on the new
d
ataflash page index */
/* Select the next
D
ataflash chip based on the new
D
ataflash page index */
Dataflash_SelectChipFromPage
(
CurrDFPage
);
/* Send the
d
ataflash main memory page read command */
/* Send the
D
ataflash main memory page read command */
Dataflash_SendByte
(
DF_CMD_MAINMEMPAGEREAD
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
Dataflash_SendByte
(
0x00
);
...
...
@@ -439,11 +439,11 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
Dataflash_SendByte
(
0x00
);
}
/* Read one 16-byte chunk of data from the
d
ataflash */
/* Read one 16-byte chunk of data from the
D
ataflash */
for
(
uint8_t
ByteNum
=
0
;
ByteNum
<
16
;
ByteNum
++
)
*
(
BufferPtr
++
)
=
Dataflash_ReceiveByte
();
/* Increment the
d
ataflash page 16 byte block counter */
/* Increment the
D
ataflash page 16 byte block counter */
CurrDFPageByteDiv16
++
;
/* Increment the block 16 byte block counter */
...
...
@@ -454,14 +454,14 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
TotalBlocks
--
;
}
/* Deselect all
d
ataflash chips */
/* Deselect all
D
ataflash chips */
Dataflash_DeselectChip
();
}
/** Disables the
d
ataflash memory write protection bits on the board Dataflash ICs, if enabled. */
/** Disables the
D
ataflash memory write protection bits on the board Dataflash ICs, if enabled. */
void
DataflashManager_ResetDataflashProtections
(
void
)
{
/* Select first
d
ataflash chip, send the read status register command */
/* Select first
D
ataflash chip, send the read status register command */
Dataflash_SelectChip
(
DATAFLASH_CHIP1
);
Dataflash_SendByte
(
DF_CMD_GETSTATUS
);
...
...
@@ -477,7 +477,7 @@ void DataflashManager_ResetDataflashProtections(void)
Dataflash_SendByte
(
DF_CMD_SECTORPROTECTIONOFF
[
3
]);
}
/* Select second
d
ataflash chip (if present on selected board), send read status register command */
/* Select second
D
ataflash chip (if present on selected board), send read status register command */
#if (DATAFLASH_TOTALCHIPS == 2)
Dataflash_SelectChip
(
DATAFLASH_CHIP2
);
Dataflash_SendByte
(
DF_CMD_GETSTATUS
);
...
...
@@ -495,7 +495,7 @@ void DataflashManager_ResetDataflashProtections(void)
}
#endif
/* Deselect current
d
ataflash chip */
/* Deselect current
D
ataflash chip */
Dataflash_DeselectChip
();
}
...
...
Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h
View file @
28401f7b
...
...
@@ -53,7 +53,7 @@
#endif
/* Defines: */
/** Total number of bytes of the storage medium, comprised of one or more
d
ataflash ICs. */
/** Total number of bytes of the storage medium, comprised of one or more
D
ataflash ICs. */
#define VIRTUAL_MEMORY_BYTES ((uint32_t)DATAFLASH_PAGES * DATAFLASH_PAGE_SIZE * DATAFLASH_TOTALCHIPS)
/** Block size of the device. This is kept at 512 to remain compatible with the OS despite the underlying
...
...
Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c
View file @
28401f7b
...
...
@@ -241,7 +241,7 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte
}
/** Command processing for an issued SCSI READ (10) or WRITE (10) command. This command reads in the block start address
* and total number of blocks to process, then calls the appropriate low-level
d
ataflash routine to handle the actual
* and total number of blocks to process, then calls the appropriate low-level
D
ataflash routine to handle the actual
* reading and writing of the data.
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
...
...
Demos/Device/ClassDriver/MassStorage/MassStorage.txt
View file @
28401f7b
...
...
@@ -74,7 +74,7 @@
*
* \section SSec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behavio
u
r when defined, or changed in value.
* The following defines can be found in this demo, which can control the demo behavior when defined, or changed in value.
*
* <table>
* <tr>
...
...
Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c
View file @
28401f7b
...
...
@@ -30,7 +30,7 @@
/** \file
*
* Functions to manage the physical
d
ataflash media, including reading and writing of
* Functions to manage the physical
D
ataflash media, including reading and writing of
* blocks of data. These functions are called by the SCSI layer when data must be stored
* or retrieved to/from the physical storage media. If a different media is used (such
* as a SD card or EEPROM), functions similar to these will need to be generated.
...
...
@@ -39,9 +39,9 @@
#define INCLUDE_FROM_DATAFLASHMANAGER_C
#include
"DataflashManager.h"
/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board
d
ataflash IC(s), from
/** Writes blocks (OS blocks, not Dataflash pages) to the storage medium, the board
D
ataflash IC(s), from
* the pre-selected data OUT endpoint. This routine reads in OS sized blocks from the endpoint and writes
* them to the
d
ataflash in Dataflash page sized blocks.
* them to the
D
ataflash in Dataflash page sized blocks.
*
* \param[in] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state
* \param[in] BlockAddress Data block starting address for the write sequence
...
...
@@ -60,13 +60,13 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
Dataflash_SelectChipFromPage
(
CurrDFPage
);
#if (DATAFLASH_PAGE_SIZE > VIRTUAL_MEMORY_BLOCK_SIZE)
/* Copy selected dataflash's current page contents to the
d
ataflash buffer */
/* Copy selected dataflash's current page contents to the
D
ataflash buffer */
Dataflash_SendByte
(
DF_CMD_MAINMEMTOBUFF1
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
Dataflash_WaitWhileBusy
();
#endif
/* Send the
d
ataflash buffer write command */
/* Send the
D
ataflash buffer write command */
Dataflash_SendByte
(
DF_CMD_BUFF1WRITE
);
Dataflash_SendAddressBytes
(
0
,
CurrDFPageByte
);
...
...
@@ -78,7 +78,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
{
uint8_t
BytesInBlockDiv16
=
0
;
/* Write an endpoint packet sized data block to the
d
ataflash */
/* Write an endpoint packet sized data block to the
D
ataflash */
while
(
BytesInBlockDiv16
<
(
VIRTUAL_MEMORY_BLOCK_SIZE
>>
4
))
{
/* Check if the endpoint is currently empty */
...
...
@@ -92,30 +92,30 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
return
;
}
/* Check if end of
d
ataflash page reached */
/* Check if end of
D
ataflash page reached */
if
(
CurrDFPageByteDiv16
==
(
DATAFLASH_PAGE_SIZE
>>
4
))
{
/* Write the
d
ataflash buffer contents back to the
d
ataflash page */
/* Write the
D
ataflash buffer contents back to the
D
ataflash page */
Dataflash_WaitWhileBusy
();
Dataflash_SendByte
(
UsingSecondBuffer
?
DF_CMD_BUFF2TOMAINMEMWITHERASE
:
DF_CMD_BUFF1TOMAINMEMWITHERASE
);
Dataflash_SendAddressBytes
(
CurrDFPage
,
0
);
/* Reset the
d
ataflash buffer counter, increment the page counter */
/* Reset the
D
ataflash buffer counter, increment the page counter */
CurrDFPageByteDiv16
=
0
;
CurrDFPage
++
;
/* Once all the
d
ataflash ICs have had their first buffers filled, switch buffers to maintain throughput */
/* Once all the
D
ataflash ICs have had their first buffers filled, switch buffers to maintain throughput */
if
(
Dataflash_GetSelectedChip
()
==
DATAFLASH_CHIP_MASK
(
DATAFLASH_TOTALCHIPS
))