diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2013-06-12 19:51:57 +0200 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-06-12 19:51:57 +0200 |
commit | f7b9ebea02cf2a48fd4b287f6a445090ea433d52 (patch) | |
tree | bd63623df602229bba4d8f86902c823af97faf16 /LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h | |
parent | 6d58628e85f473001cbacc012d7f25b477c3e797 (diff) | |
download | lufa-f7b9ebea02cf2a48fd4b287f6a445090ea433d52.tar.gz lufa-f7b9ebea02cf2a48fd4b287f6a445090ea433d52.tar.bz2 lufa-f7b9ebea02cf2a48fd4b287f6a445090ea433d52.zip |
Update board Dataflash_Init() functions to automatically configure the appropriate communication interface.
Diffstat (limited to 'LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h')
-rw-r--r-- | LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h b/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h index ef04ebad6..a58a06c85 100644 --- a/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h +++ b/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h @@ -45,7 +45,7 @@ * <table> * <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr> * <tr><td>DATAFLASH_CHIP1</td><td>AT45DB321C (4MB)</td><td>PORTE.6</td><td>SPI0</td></tr> - * </table> + * </table> * * @{ */ @@ -90,12 +90,14 @@ /* Inline Functions: */ /** Initializes the dataflash driver so that commands and data may be sent to an attached dataflash IC. - * The microcontroller's SPI driver MUST be initialized before any of the dataflash commands are used. + * The appropriate SPI interface will be automatically configured. */ static inline void Dataflash_Init(void) { DATAFLASH_CHIPCS_DDR |= DATAFLASH_CHIPCS_MASK; DATAFLASH_CHIPCS_PORT |= DATAFLASH_CHIPCS_MASK; + + SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_ORDER_MSB_FIRST | SPI_SCK_LEAD_FALLING | SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); } /** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash. |