Get rid of the redundant ATTR_NEVER_INLINE macro which translated to the same as...
[pub/USBasp.git] / LUFA / Drivers / Board / AVR8 / XPLAIN / Dataflash.h
index 950d4a2..d8bb12b 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2012.
+     Copyright (C) Dean Camera, 2013.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2013  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -18,7 +18,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
@@ -71,7 +71,7 @@
 
        /* Includes: */
                #include "../../../../Common/Common.h"
-               
+
                #include "../../../Misc/AT45DB642D.h"
                #include "../../../Peripheral/SPI.h"
 
 
                /* 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.