77 void IO_ConfigurePin( PORT_t * port, uint8_t pinMask, uint8_t slewRateEnable, uint8_t invertEnable,
78 PORT_OPC_t opc, PORT_ISC_t isc )
81 uint8_t temp = (uint8_t) opc |
83 (slewRateEnable ? PORT_SRLEN_bm : 0) |
84 (invertEnable ? PORT_INVEN_bm : 0);
92 PORTCFG.MPCMASK = pinMask;
93 port->PIN0CTRL = temp;
109 port->OUT |= pinMask;
122 port->OUT &= ~pinMask;
134 port->DIR |= pinMask;
146 port->DIR |= pinMask;
147 port->OUT |= pinMask;
160 port->DIR &= ~pinMask;
163 bool IO_GetPinLevel( PORT_t * port, uint8_t pinMask )
165 return port->IN & pinMask;
176 port->OUTTGL = pinMask;
190 PORT_INT0LVL_t intLevel,
193 port->INTCTRL = ( port->INTCTRL & ~PORT_INT0LVL_gm ) | intLevel;
194 port->INT0MASK = pinMask;
208 PORT_INT1LVL_t intLevel,
211 port->INTCTRL = ( port->INTCTRL & ~PORT_INT1LVL_gm ) | intLevel;
212 port->INT1MASK = pinMask;
225 PORTCFG.VPCTRLA = ( PORTCFG.VPCTRLA & ~PORTCFG_VP0MAP_gm ) | realPort;
238 PORTCFG.VPCTRLA = ( PORTCFG.VPCTRLA & ~PORTCFG_VP1MAP_gm ) | realPort;
251 PORTCFG.VPCTRLB = ( PORTCFG.VPCTRLB & ~PORTCFG_VP2MAP_gm ) | realPort;
264 PORTCFG.VPCTRLB = ( PORTCFG.VPCTRLB & ~PORTCFG_VP3MAP_gm ) | realPort;
void IO_MapVirtualPort2(PORTCFG_VP02MAP_t realPort)
Maps a real port to virtual port 2.
void IO_SetPinAsOutput(PORT_t *port, uint8_t pinMask)
This function configures a pin in an I/O port or virtual port as an output.
void IO_ConfigureInterrupt0(PORT_t *port, PORT_INT0LVL_t intLevel, uint8_t pinMask)
Configures interrupt 0.
void IO_MapVirtualPort3(PORTCFG_VP13MAP_t realPort)
Maps a real port to virtual port 3.
void IO_SetPinHigh(PORT_t *port, uint8_t pinMask)
This function sets a bit in the OUT register of an I/O port or virtual port.
XMEGA I/O Port driver header file.
void IO_MapVirtualPort1(PORTCFG_VP13MAP_t realPort)
Maps a real port to virtual port 1.
void IO_SetPinLow(PORT_t *port, uint8_t pinMask)
This function clears a bit in the OUT register of an I/O port or virtual port.
void IO_ConfigurePin(PORT_t *port, uint8_t pinMask, uint8_t slewRateEnable, uint8_t invertEnable, PORT_OPC_t opc, PORT_ISC_t isc)
This function changes the configuration of a set of pins.
void IO_ConfigureInterrupt1(PORT_t *port, PORT_INT1LVL_t intLevel, uint8_t pinMask)
Configures interrupt 1.
void IO_SetPinAsOutput_InitHigh(PORT_t *port, uint8_t pinMask)
This function configures a pin in an I/O port or virtual port as an output and sets the pin to high a...
void IO_SetPinAsInput(PORT_t *port, uint8_t pinMask)
This function configures a pin in an I/O port or virtual port as an input.
void IO_MapVirtualPort0(PORTCFG_VP02MAP_t realPort)
Maps a real port to virtual port 0.
void IO_TogglePin(PORT_t *port, uint8_t pinMask)
Toggle the value of an IOPORT pin, which has previously been configured as an output.