projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Atmel Studio integration known issues.
[pub/USBasp.git]
/
LUFA
/
Drivers
/
Board
/
XMEGA
/
A3BU_XPLAINED
/
Dataflash.h
diff --git
a/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
b/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
index
143fbbf
..
7ba478c
100644
(file)
--- a/
LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
+++ b/
LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h
@@
-89,7
+89,7
@@
/* Inline Functions: */
/** Initializes the dataflash driver so that commands and data may be sent to an attached dataflash IC.
/* 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 us
ed.
+ * The
appropriate SPI interface will be automatically configur
ed.
*/
static inline void Dataflash_Init(void)
{
*/
static inline void Dataflash_Init(void)
{
@@
-97,6
+97,12
@@
PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
+
+ SerialSPI_Init(&USARTD0, (USART_SPI_SCK_LEAD_RISING | USART_SPI_SAMPLE_LEADING | USART_SPI_ORDER_MSB_FIRST), (F_CPU / 2));
+
+ PORTD.DIRSET = PIN3_bm | PIN1_bm;
+ PORTD.DIRCLR = PIN2_bm;
+ PORTC.PIN2CTRL = PORT_OPC_PULLUP_gc;
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.