Xmega Application Note


init.c

Go to the documentation of this file.
00001 /*This file is prepared for Doxygen automatic documentation generation.*/
00050 #include "board.h"
00051 #include "compiler.h"
00052 #include "xplain_a1.h"
00053 #include "conf_board.h"
00054 #include "ioport.h"
00055 
00056 void board_init(void)
00057 {
00058         ioport_configure_pin(LED0_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00059         ioport_configure_pin(LED1_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00060         ioport_configure_pin(LED2_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00061         ioport_configure_pin(LED3_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00062         ioport_configure_pin(LED4_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00063         ioport_configure_pin(LED5_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00064         ioport_configure_pin(LED6_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00065         ioport_configure_pin(LED7_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00066         ioport_configure_pin(LEDUSB_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00067         
00068         ioport_configure_pin(GPIO_PUSH_BUTTON_0, IOPORT_DIR_INPUT |
00069                         IOPORT_PULL_UP);
00070         ioport_configure_pin(GPIO_PUSH_BUTTON_1, IOPORT_DIR_INPUT |
00071                         IOPORT_PULL_UP);
00072         ioport_configure_pin(GPIO_PUSH_BUTTON_2, IOPORT_DIR_INPUT |
00073                         IOPORT_PULL_UP);
00074         ioport_configure_pin(GPIO_PUSH_BUTTON_3, IOPORT_DIR_INPUT |
00075                         IOPORT_PULL_UP);
00076         ioport_configure_pin(GPIO_PUSH_BUTTON_4, IOPORT_DIR_INPUT |
00077                         IOPORT_PULL_UP);
00078         ioport_configure_pin(GPIO_PUSH_BUTTON_5, IOPORT_DIR_INPUT |
00079                         IOPORT_PULL_UP);
00080         ioport_configure_pin(GPIO_PUSH_BUTTON_6, IOPORT_DIR_INPUT |
00081                         IOPORT_PULL_UP);
00082         ioport_configure_pin(GPIO_PUSH_BUTTON_7, IOPORT_DIR_INPUT |
00083                         IOPORT_PULL_UP);
00084 
00085 #ifdef CONF_BOARD_AT45DBX
00086         ioport_configure_pin(AT45DBX_MASTER_SCK, IOPORT_DIR_OUTPUT |
00087                         IOPORT_INIT_HIGH);
00088         ioport_configure_pin(AT45DBX_MASTER_MOSI, IOPORT_DIR_OUTPUT |
00089                         IOPORT_INIT_HIGH);
00090         ioport_configure_pin(AT45DBX_CS, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
00091 #endif
00092 #ifdef CONF_BOARD_ENABLE_AC_PINS
00093         ioport_configure_pin(IOPORT_CREATE_PIN(PORTA, 0), IOPORT_DIR_INPUT);
00094         ioport_configure_pin(IOPORT_CREATE_PIN(PORTA, 2), IOPORT_DIR_INPUT);
00095         ioport_configure_pin(IOPORT_CREATE_PIN(PORTB, 1), IOPORT_DIR_INPUT);
00096 #endif
00097 }
@DOC_TITLE@
Generated on Fri Oct 22 12:15:25 2010 for AVR1300 Using the Xmega ADC by doxygen 1.6.3