void led_init (void) { S3C2440_GPIO_CONFIG (GPBCON, 5, GPIO_OUTPUT); S3C2440_GPIO_CONFIG (GPBCON, 6, GPIO_OUTPUT); S3C2440_GPIO_CONFIG (GPBCON, 7, GPIO_OUTPUT); S3C2440_GPIO_CONFIG (GPBCON, 8, GPIO_OUTPUT); S3C2440_GPIO_PULLUP (GPBUP, 5, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPBUP, 6, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPBUP, 7, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPBUP, 8, GPIO_PULLUP_DISABLE); }
static void l3_init (void) { L3PORT |= L3MODE | L3CLOCK; L3PORT &= ~L3DATA; S3C2440_GPIO_CONFIG (GPBCON, 2, GPIO_OUTPUT); /* L3 MODE */ S3C2440_GPIO_CONFIG (GPBCON, 3, GPIO_OUTPUT); /* L3 DATA */ S3C2440_GPIO_CONFIG (GPBCON, 4, GPIO_OUTPUT); /* L3 CLOCK */ S3C2440_GPIO_PULLUP (GPBUP, 2, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPBUP, 3, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPBUP, 4, GPIO_PULLUP_DISABLE); }
bool uart_init_device (unsigned dev) { /* set GPIOs, clock enable? etc */ switch (dev) { case 0: { S3C2440_GPIO_CONFIG (GPHCON, 2, GPIO_FUNCTION); S3C2440_GPIO_CONFIG (GPHCON, 3, GPIO_FUNCTION); S3C2440_GPIO_PULLUP (GPHUP, 2, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPHUP, 3, GPIO_PULLUP_DISABLE); break; } case 1: { S3C2440_GPIO_CONFIG (GPHCON, 4, GPIO_FUNCTION); S3C2440_GPIO_CONFIG (GPHCON, 5, GPIO_FUNCTION); S3C2440_GPIO_PULLUP (GPHUP, 4, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPHUP, 5, GPIO_PULLUP_DISABLE); break; } case 2: { S3C2440_GPIO_CONFIG (GPHCON, 6, GPIO_FUNCTION); S3C2440_GPIO_CONFIG (GPHCON, 7, GPIO_FUNCTION); S3C2440_GPIO_PULLUP (GPHUP, 6, GPIO_PULLUP_DISABLE); S3C2440_GPIO_PULLUP (GPHUP, 7, GPIO_PULLUP_DISABLE); break; } default: return false; } /* set a default configuration */ uart_config (dev, 115200, 8, UART_NO_PARITY, UART_1_STOP_BIT); return true; }