Update XMEGA board drivers to use the port inversion feature of the XMEGA architecture rather than performing the inversion in software. Add partially completed XMEGA-B1-XPLAINED Dataflash board driver and revert implementation of the XMEGA-A3BU-XPLAINED Dataflash driver as the chip is connected to the USART, not the SPI interface.

This commit is contained in:
Dean Camera 2012-02-09 20:26:13 +00:00
parent 7a1033025b
commit a2d18e46f8
7 changed files with 292 additions and 54 deletions

View file

@ -79,24 +79,24 @@
#if !defined(__DOXYGEN__)
static inline void Buttons_Init(void)
{
PORTE_OUTCLR = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTE.OUTSET = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTCFG_MPCMASK = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTE_PIN0CTRL = PORT_OPC_PULLUP_gc;
PORTCFG.MPCMASK = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTE.PIN0CTRL = (PORT_INVEN_bm | PORT_OPC_PULLUP_gc);
}
static inline void Buttons_Disable(void)
{
PORTE_OUTCLR = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTE.OUTCLR = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTCFG_MPCMASK = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTE_PIN0CTRL = 0;
PORTCFG.MPCMASK = (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4);
PORTE.PIN0CTRL = 0;
}
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t Buttons_GetStatus(void)
{
return (~PORTE_IN & (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4));
return (PORTE_IN & (BUTTONS_BUTTON1 | BUTTONS_BUTTON2 | BUTTONS_BUTTON3 | BUTTONS_BUTTON4));
}
#endif