projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure CRC value is pre-zeroed before reading from the XMEGA target device, to...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
Board
/
XMEGA
/
B1_XPLAINED
/
Dataflash.h
diff --git
a/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
b/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
index
f1e6da5
..
0b8a261
100644
(file)
--- a/
LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
+++ b/
LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h
@@
-71,10
+71,10
@@
#define DATAFLASH_TOTALCHIPS 1
/** Mask for no dataflash chip selected. */
#define DATAFLASH_TOTALCHIPS 1
/** Mask for no dataflash chip selected. */
- #define DATAFLASH_NO_CHIP
DATAFLASH_CHIPCS_MASK
+ #define DATAFLASH_NO_CHIP
0
/** Mask for the first dataflash chip selected. */
/** Mask for the first dataflash chip selected. */
- #define DATAFLASH_CHIP1
0
+ #define DATAFLASH_CHIP1
(1 << 2)
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
@@
-88,10
+88,12
@@
*/
static inline void Dataflash_Init(void)
{
*/
static inline void Dataflash_Init(void)
{
- DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
- DATAFLASH_CHIPCS_PORT.OUTSET = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.DIRSET = DATAFLASH_CHIPCS_MASK;
- PORTE.REMAP |= PORT_USART0_bm;
+ PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
+
+ PORTC.REMAP |= PORT_USART0_bm;
}
/** 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.
@@
-103,7
+105,7
@@
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte)
{
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline uint8_t Dataflash_TransferByte(const uint8_t Byte)
{
- return SerialSPI_TransferByte(&USART
E
0, Byte);
+ return SerialSPI_TransferByte(&USART
C
0, Byte);
}
/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
}
/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
@@
-113,7
+115,7
@@
static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SendByte(const uint8_t Byte)
{
static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SendByte(const uint8_t Byte)
{
- SerialSPI_SendByte(&USART
E
0, Byte);
+ SerialSPI_SendByte(&USART
C
0, Byte);
}
/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
}
/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
@@
-123,7
+125,7
@@
static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Dataflash_ReceiveByte(void)
{
static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Dataflash_ReceiveByte(void)
{
- return SerialSPI_ReceiveByte(&USART
E
0);
+ return SerialSPI_ReceiveByte(&USART
C
0);
}
/** Determines the currently selected dataflash chip.
}
/** Determines the currently selected dataflash chip.
@@
-145,7
+147,8
@@
static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SelectChip(const uint8_t ChipMask)
{
static inline void Dataflash_SelectChip(const uint8_t ChipMask) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SelectChip(const uint8_t ChipMask)
{
- DATAFLASH_CHIPCS_PORT.OUT = ((DATAFLASH_CHIPCS_PORT.OUT & ~DATAFLASH_CHIPCS_MASK) | ChipMask);
+ DATAFLASH_CHIPCS_PORT.OUTCLR = DATAFLASH_CHIPCS_MASK;
+ DATAFLASH_CHIPCS_PORT.OUTSET = (ChipMask & DATAFLASH_CHIPCS_MASK);
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */