void board_led_on(int led) { bool blueoff = true; /* Low illuminates */ bool redon = false; /* High illuminates */ switch (led) { case 0: /* LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED */ break; case 1: /* LED_STACKCREATED */ blueoff = false; break; default: case 2: /* LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ return; case 3: /* LED_PANIC */ redon = true; break; } sam_piowrite(PIO_BLUE, blueoff); sam_piowrite(PIO_RED, redon); }
void board_led_on(int led) { bool blueoff = true; /* Low illuminates */ #ifndef CONFIG_SAMA5D3xEK_NOREDLED bool redon = false; /* High illuminates */ #endif switch (led) { case 0: /* LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED */ break; case 1: /* LED_STACKCREATED */ blueoff = false; break; default: case 2: /* LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ return; case 3: /* LED_PANIC */ #ifdef CONFIG_SAMA5D3xEK_NOREDLED blueoff = false; #else redon = true; #endif break; } sam_piowrite(PIO_BLUE, blueoff); #ifndef CONFIG_SAMA5D3xEK_NOREDLED sam_piowrite(PIO_RED, redon); #endif }
void board_autoled_on(int led) { switch (led) { default: case 0: /* LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED */ break; /* Leave USER LED off */ case 1: /* LED_STACKCREATED */ { /* User LED is ON (Low illuminates) */ sam_piowrite(PIO_LED_USER, false); } break; case 2: /* LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ break; /* Ignored */ case 3: /* LED_PANIC */ { /* Power LED is ON (High illuminates) */ sam_piowrite(PIO_LED_POWER, true); } break; } }
void board_led_off(int led) { if (led != 2) { sam_piowrite(PIO_BLUE, true); /* Low illuminates */ sam_piowrite(PIO_RED, false); /* High illuminates */ } }
void sam_usbhost_vbusdrive(int rhport, bool enable) { pio_pinset_t pinset = 0; uvdbg("RHPort%d: enable=%d\n", rhport+1, enable); /* Pick the PIO configuration associated with the selected root hub port */ switch (rhport) { case SAM_RHPORT1: #ifndef CONFIG_SAMA5_UHPHS_RHPORT1 udbg("ERROR: RHPort1 is not available in this configuration\n"); return; #else pinset = PIO_USBA_VBUS_ENABLE; break; #endif case SAM_RHPORT2: #ifndef CONFIG_SAMA5_UHPHS_RHPORT2 udbg("ERROR: RHPort2 is not available in this configuration\n"); return; #else pinset = PIO_USBB_VBUS_ENABLE; break; #endif case SAM_RHPORT3: #ifndef CONFIG_SAMA5_UHPHS_RHPORT3 udbg("ERROR: RHPort3 is not available in this configuration\n"); return; #else pinset = PIO_USBC_VBUS_ENABLE; break; #endif default: udbg("ERROR: RHPort%d is not supported\n", rhport+1); return; } /* Then enable or disable VBUS power */ if (enable) { /* Enable the Power Switch by driving the enable pin low */ sam_piowrite(pinset, false); } else { /* Disable the Power Switch by driving the enable pin high */ sam_piowrite(pinset, true); } }
void board_led_off(int led) { if (led != 2) { sam_piowrite(PIO_BLUE, true); /* Low illuminates */ #ifndef CONFIG_SAMA5D3xEK_NOREDLED sam_piowrite(PIO_RED, false); /* High illuminates */ #endif } }
void sam_setleds(uint8_t ledset) { bool ledon; /* Low illuminates */ ledon = ((ledset & BOARD_BLUE_BIT) == 0); sam_piowrite(PIO_LED_USER, ledon); /* High illuminates */ ledon = ((ledset & BOARD_RED_BIT) != 0); sam_piowrite(PIO_LED_POWER, ledon); }
void sam_spi0select(enum spi_dev_e devid, bool selected) { #ifdef CONFIG_MTD_AT25 /* The AT25 serial FLASH connects using NPCS0 */ if (devid == SPIDEV_FLASH) { sam_piowrite(PIO_AT25_NPCS0, !selected); } #endif }
void board_autoled_off(int led) { switch (led) { default: case 0: /* LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED, */ case 1: /* LED_STACKCREATED */ break; /* Will not happen */ case 2: /* LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ break; /* No change */ case 3: /* LED_PANIC */ { /* Power LED is OFF (Low illuminates) */ sam_piowrite(PIO_LED_GREEN, true); } break; } }
void board_autoled_on(int led) { switch (led) { default: case 0: /* LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED */ break; /* Leave Green LED off */ case 1: /* LED_STACKCREATED */ case 3: /* LED_PANIC */ { /* Green LED is ON (Low illuminates) */ sam_piowrite(PIO_LED_GREEN, false); } break; case 2: /* LED_INIRQ, LED_SIGNAL, LED_ASSERTION */ break; /* No change */ } }
void sam_setled(int led, bool ledon) { uint32_t ledcfg; if (led == BOARD_BLUE) { /* Low illuminates */ ledcfg = PIO_LED_USER; ledon = !ledon; } else if (led == BOARD_RED) { /* High illuminates */ ledcfg = PIO_LED_POWER; } else { return; } sam_piowrite(ledcfg, ledon); }