Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.

This commit is contained in:
Dean Camera 2012-05-10 19:24:58 +00:00
parent e8570c4a37
commit 359fbfe14d
395 changed files with 9912 additions and 2756 deletions

View file

@ -42,6 +42,13 @@
*
* Board specific Buttons driver header for the Atmel XMEGA A3BU Xplained.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>SW0 Button</td><td>Low</td><td>PORTE.5</td></tr>
* <tr><td>BUTTONS_BUTTON2</td><td>SW1 Button</td><td>Low</td><td>PORTF.1</td></tr>
* <tr><td>BUTTONS_BUTTON3</td><td>SW2 Button</td><td>Low</td><td>PORTF.2</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel XMEGA B1 Xplained board.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTF.4</td><td>USARTD0 (In SPI Mode)</td></tr>
* </table>
*
* @{
*/
@ -71,10 +76,10 @@
#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. */
#define DATAFLASH_CHIP1 0
#define DATAFLASH_CHIP1 (1 << 4)
/** Internal main memory page size for the board's dataflash ICs. */
#define DATAFLASH_PAGE_SIZE 1024
@ -88,8 +93,10 @@
*/
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;
PORTCFG.MPCMASK = DATAFLASH_CHIPCS_MASK;
DATAFLASH_CHIPCS_PORT.PIN0CTRL = PORT_INVEN_bm;
}
/** Sends a byte to the currently selected dataflash IC, and returns a byte from the dataflash.
@ -143,7 +150,8 @@
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;
}
/** Deselects the current dataflash chip, so that no dataflash is selected. */

View file

@ -42,6 +42,12 @@
*
* Board specific LED driver header for the Atmel XMEGA A3BU Xplained.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>LED0 LED</td><td>Low</td><td>PORTR.0</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>LED1 LED</td><td>Low</td><td>PORTR.1</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,14 @@
*
* Board specific Buttons driver header for the Atmel XMEGA B1 Xplained.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>BUTTONS_BUTTON1</td><td>Touch CS0 Button</td><td>Low</td><td>PORTE.0</td></tr>
* <tr><td>BUTTONS_BUTTON2</td><td>Touch CS1 Button</td><td>Low</td><td>PORTE.1</td></tr>
* <tr><td>BUTTONS_BUTTON3</td><td>Touch CS2 Button</td><td>Low</td><td>PORTE.2</td></tr>
* <tr><td>BUTTONS_BUTTON4</td><td>Touch CS3 Button</td><td>Low</td><td>PORTE.3</td></tr>
* </table>
*
* @{
*/

View file

@ -42,6 +42,11 @@
*
* Board specific Dataflash driver header for the Atmel XMEGA A3BU Xplained board.
*
* <table>
* <tr><th>Name</th><th>Info</th><th>Select Pin</th><th>SPI Port</th></tr>
* <tr><td>DATAFLASH_CHIP1</td><td>AT45DB642D (8MB)</td><td>PORTD.2</td><td>USARTC0 (In SPI Mode, Remapped)</td></tr>
* </table>
*
* @{
*/
@ -71,10 +76,10 @@
#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. */
#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
@ -88,10 +93,12 @@
*/
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.
@ -103,7 +110,7 @@
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(&USARTE0, Byte);
return SerialSPI_TransferByte(&USARTC0, Byte);
}
/** Sends a byte to the currently selected dataflash IC, and ignores the next byte from the dataflash.
@ -113,7 +120,7 @@
static inline void Dataflash_SendByte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Dataflash_SendByte(const uint8_t Byte)
{
SerialSPI_SendByte(&USARTE0, Byte);
SerialSPI_SendByte(&USARTC0, Byte);
}
/** Sends a dummy byte to the currently selected dataflash IC, and returns the next byte from the dataflash.
@ -123,7 +130,7 @@
static inline uint8_t Dataflash_ReceiveByte(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Dataflash_ReceiveByte(void)
{
return SerialSPI_ReceiveByte(&USARTE0);
return SerialSPI_ReceiveByte(&USARTC0);
}
/** Determines the currently selected dataflash chip.
@ -145,7 +152,8 @@
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. */

View file

@ -42,6 +42,15 @@
*
* Board specific LED driver header for the Atmel XMEGA B1 Xplained.
*
* <table>
* <tr><th>Name</th><th>Color</th><th>Info</th><th>Active Level</th><th>Port Pin</th></tr>
* <tr><td>LEDS_LED1</td><td>Yellow</td><td>LED0 LED</td><td>High</td><td>PORTB.4</td></tr>
* <tr><td>LEDS_LED2</td><td>Yellow</td><td>LED1 LED</td><td>High</td><td>PORTB.5</td></tr>
* <tr><td>LEDS_LED3</td><td>Yellow</td><td>LED2 LED</td><td>High</td><td>PORTB.6</td></tr>
* <tr><td>LEDS_LED4</td><td>Yellow</td><td>LED3 LED</td><td>High</td><td>PORTB.7</td></tr>
* <tr><td>LEDS_LED5</td><td>Green</td><td>USB LED</td><td>Low</td><td>PORTE.4</td></tr>
* </table>
*
* @{
*/