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:
parent
7a1033025b
commit
a2d18e46f8
7 changed files with 292 additions and 54 deletions
|
@ -76,28 +76,28 @@
|
|||
#if !defined(__DOXYGEN__)
|
||||
static inline void Buttons_Init(void)
|
||||
{
|
||||
PORTE_OUTCLR = BUTTONS_BUTTON1;
|
||||
PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
|
||||
PORTE.OUTCLR = BUTTONS_BUTTON1;
|
||||
PORTE.PIN5CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
|
||||
|
||||
PORTE_PIN5CTRL = PORT_OPC_PULLUP_gc;
|
||||
PORTF_PIN1CTRL = PORT_OPC_PULLUP_gc;
|
||||
PORTF_PIN2CTRL = PORT_OPC_PULLUP_gc;
|
||||
PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
|
||||
PORTF.PIN1CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
|
||||
PORTF.PIN2CTRL = (PORT_OPC_PULLUP_gc | PORT_INVEN_bm);
|
||||
}
|
||||
|
||||
static inline void Buttons_Disable(void)
|
||||
{
|
||||
PORTE_OUTCLR = BUTTONS_BUTTON1;
|
||||
PORTF_OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
|
||||
|
||||
PORTE_PIN5CTRL = 0;
|
||||
PORTF_PIN1CTRL = 0;
|
||||
PORTF_PIN2CTRL = 0;
|
||||
PORTE.OUTCLR = BUTTONS_BUTTON1;
|
||||
PORTE.PIN5CTRL = 0;
|
||||
|
||||
PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3);
|
||||
PORTF.PIN1CTRL = 0;
|
||||
PORTF.PIN2CTRL = 0;
|
||||
}
|
||||
|
||||
static inline uint8_t Buttons_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
|
||||
static inline uint8_t Buttons_GetStatus(void)
|
||||
{
|
||||
return ((~PORTE_IN & BUTTONS_BUTTON1) | (~PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3)));
|
||||
return ((PORTE_IN & BUTTONS_BUTTON1) | (PORTF_IN & (BUTTONS_BUTTON2 | BUTTONS_BUTTON3)));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue