void iic_scl(int bit) { switch (I2C_ADAP_HWNR) { case 0: at91_set_pio_value(I2C0_PORT, SCL0_PIN, bit); break; case 1: at91_set_pio_value(I2C1_PORT, SCL1_PIN, bit); break; } }
void coloured_LED_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; /* Enable clock */ writel(1 << ATMEL_ID_PIOB, &pmc->pcer); at91_set_pio_output(CONFIG_RED_LED, 1); at91_set_pio_output(CONFIG_GREEN_LED, 1); at91_set_pio_value(CONFIG_RED_LED, 0); at91_set_pio_value(CONFIG_GREEN_LED, 1); }
int gpio_set_value(unsigned gpio, int value) { at91_set_pio_value(at91_gpio_to_port(gpio), at91_gpio_to_pin(gpio), value); return 0; }
static void pm9g45_macb_hw_init(void) { struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; /* * PD2 enables the 50MHz oscillator for Ethernet PHY * 1 - enable * 0 - disable */ at91_set_pio_output(AT91_PIO_PORTD, 2, 1); at91_set_pio_value(AT91_PIO_PORTD, 2, 1); /* 1- enable, 0 - disable */ /* Enable clock */ writel(1 << ATMEL_ID_EMAC, &pmc->pcer); /* * Disable pull-up on: * RXDV (PA15) => PHY normal mode (not Test mode) * ERX0 (PA12) => PHY ADDR0 * ERX1 (PA13) => PHY ADDR1 => PHYADDR = 0x0 * * PHY has internal pull-down */ at91_set_pio_pullup(AT91_PIO_PORTA, 15, 0); at91_set_pio_pullup(AT91_PIO_PORTA, 12, 0); at91_set_pio_pullup(AT91_PIO_PORTA, 13, 0); /* Re-enable pull-up */ at91_set_pio_pullup(AT91_PIO_PORTA, 15, 1); at91_set_pio_pullup(AT91_PIO_PORTA, 12, 1); at91_set_pio_pullup(AT91_PIO_PORTA, 13, 1); at91_macb_hw_init(); }
void coloured_LED_init(void) { at91_pmc_t *pmc = (at91_pmc_t *) ATMEL_BASE_PMC; /* Enable clock */ writel(1 << ATMEL_ID_PIOC, &pmc->pcer); at91_set_pio_output(CONFIG_RED_LED, 1); at91_set_pio_output(CONFIG_GREEN_LED, 1); at91_set_pio_output(CONFIG_YELLOW_LED, 1); at91_set_pio_output(CONFIG_BLUE_LED, 1); at91_set_pio_value(CONFIG_RED_LED, 1); at91_set_pio_value(CONFIG_GREEN_LED, 1); at91_set_pio_value(CONFIG_YELLOW_LED, 1); at91_set_pio_value(CONFIG_BLUE_LED, 1); }
void lcd_disable(void) { at91_set_pio_value(AT91_PIO_PORTA, 30, 1); /* power down */ }
void lcd_enable(void) { at91_set_pio_value(AT91_PIO_PORTA, 30, 0); /* power up */ }
void blue_led_on(void) { at91_set_pio_value(CONFIG_BLUE_LED, 0); saved_state[STATUS_LED_BLUE] = STATUS_LED_ON; }
void yellow_led_on(void) { at91_set_pio_value(CONFIG_YELLOW_LED, 0); saved_state[STATUS_LED_YELLOW] = STATUS_LED_ON; }
void green_led_on(void) { at91_set_pio_value(CONFIG_GREEN_LED, 0); saved_state[STATUS_LED_GREEN] = STATUS_LED_ON; }
void red_led_on(void) { at91_set_pio_value(CONFIG_RED_LED, 0); saved_state[STATUS_LED_RED] = STATUS_LED_ON; }
void blue_led_off(void) { at91_set_pio_value(CONFIG_BLUE_LED, 1); saved_state[STATUS_LED_BLUE] = STATUS_LED_OFF; }
void green_led_off(void) { at91_set_pio_value(CONFIG_GREEN_LED, 1); saved_state[STATUS_LED_GREEN] = STATUS_LED_OFF; }
void red_led_off(void) { at91_set_pio_value(CONFIG_RED_LED, 1); saved_state[STATUS_LED_RED] = STATUS_LED_OFF; }