void lpc31_setled(int led, bool ledon) { uint32_t bit; #ifndef CONFIG_ARCH_LEDS if (led == BOARD_LED1) { bit = GPIO_LED1; } else #endif if (led == BOARD_LED2) { bit = GPIO_LED2; } else { return; } if (ledon) { gpio_outputhigh(LPC31_IOCONFIG_GPIO, bit); } else { gpio_outputlow(LPC31_IOCONFIG_GPIO, bit); } }
void weak_function lpc31_usbhost_bootinitialize(void) { /* Configure output pin to drive VBUS power (initial state: power off) */ gpio_outputhigh(LPC31_IOCONFIG_GPIO, GPIO_NOTG_PWR_E); /* Configure input pin to detect overrcurrent errors */ gpio_configinput(LPC31_IOCONFIG_GPIO, GPIO_NOTG_OVRCR); /* Configure to receive interrupts on the overrcurrent input pin */ #warning Missing logic }
void board_led_on(int led) { switch (led) { case 0: gpio_outputlow(LPC31_IOCONFIG_GPIO, GPIO_LED1); gpio_outputlow(LPC31_IOCONFIG_GPIO, GPIO_LED2); break; case 1: gpio_outputlow(LPC31_IOCONFIG_GPIO, GPIO_LED1); gpio_outputhigh(LPC31_IOCONFIG_GPIO, GPIO_LED2); break; case 2: break; case 3: gpio_outputhigh(LPC31_IOCONFIG_GPIO, GPIO_LED1); break; } }
void lpc31_usbhost_vbusdrive(int rhport, bool enable) { uinfo("RHPort%d: enable=%d\n", rhport+1, enable); /* The LPC3131 has only a single root hub port */ if (rhport == 0) { /* Then enable or disable VBUS power */ if (enable) { /* Enable the Power Switch by driving the enable pin low */ gpio_outputlow(LPC31_IOCONFIG_GPIO, GPIO_NOTG_PWR_E); } else { /* Disable the Power Switch by driving the enable pin high */ gpio_outputhigh(LPC31_IOCONFIG_GPIO, GPIO_NOTG_PWR_E); } } }