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,30 @@
#if !defined(__DOXYGEN__)
static inline void LEDs_Init(void)
{
PORTR_DIRSET = LEDS_ALL_LEDS;
PORTR_OUTSET = LEDS_ALL_LEDS;
PORTR.DIRSET = LEDS_ALL_LEDS;
PORTR.OUTCLR = LEDS_ALL_LEDS;
PORTCFG.MPCMASK = LEDS_ALL_LEDS;
PORTR.PIN0CTRL = PORT_INVEN_bm;
}
static inline void LEDs_Disable(void)
{
PORTR_DIRCLR = LEDS_ALL_LEDS;
PORTR_OUTCLR = LEDS_ALL_LEDS;
PORTR.DIRCLR = LEDS_ALL_LEDS;
PORTR.OUTCLR = LEDS_ALL_LEDS;
PORTCFG.MPCMASK = 0;
PORTR.PIN0CTRL = LEDS_ALL_LEDS;
}
static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask)
{
PORTR_OUTCLR = LEDMask;
PORTR_OUTSET = LEDMask;
}
static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask)
{
PORTR_OUTSET = LEDMask;
PORTR_OUTCLR = LEDMask;
}
static inline void LEDs_SetAllLEDs(const uint8_t LEDMask)
@ -117,7 +123,7 @@
static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT;
static inline uint8_t LEDs_GetLEDs(void)
{
return (~PORTR_OUT & LEDS_ALL_LEDS);
return (PORTR_OUT & LEDS_ALL_LEDS);
}
#endif