void init_board() { int x,y,z; memset(register_cube, 0, sizeof(register_cube)); write_led(0, 0,0,0); /* only flushes one block if unitialized fix */ }
//------------------------------------------------------------------------------ // @fn main //! //! Core of "main_can_sensor_node_example.c". //! //! This program performs a response to an remote frame of a master. //! The response is a data frame that contents (in the order) the local //! temperature, the local luminosity and the local VCC values. //! //! @warning - Use DVK90CAN1 board, //! - Define CAN_BAUDRATE in "config.h". //! //! @param none //! //! @return Integer 0 //! //------------------------------------------------------------------------------ int main (void) { CLKPR = 0x80; CLKPR = 0x00; //-- Clock prescaler Reset MCUSR = 0; //-- Clear all reset flags - needed by IAP audio_init(); led_init(); write_led(MY_ID_TAG); //-- Display MY_ID_TAG on LEDs can_init(0); send_sensor_values(); while(1); return 0; }
static INT32 pan_ch455_mode_set(struct pan_device *dev) { struct pan_ch455_private *tp = (struct pan_ch455_private *)dev->priv; UINT32 re; if(re=write_led(tp, SETING_ADDR, tp->mode)) { PAN_CH455_PRINTF("Mode Set failed! re = %d cnt = %d\n",__FUNCTION__, re); return re; } }
static void handle_led(hfcusb_data * hfc, int event) { hfcsusb_vdata *driver_info = (hfcsusb_vdata *) hfcusb_idtab[hfc->vend_idx].driver_info; /* if no scheme -> no LED action */ if (driver_info->led_scheme == LED_OFF) return; switch (event) { case LED_POWER_ON: set_led_bit(hfc, driver_info->led_bits[0], 0); set_led_bit(hfc, driver_info->led_bits[1], 1); set_led_bit(hfc, driver_info->led_bits[2], 1); set_led_bit(hfc, driver_info->led_bits[3], 1); break; case LED_POWER_OFF: /* no Power off handling */ break; case LED_S0_ON: set_led_bit(hfc, driver_info->led_bits[1], 0); break; case LED_S0_OFF: set_led_bit(hfc, driver_info->led_bits[1], 1); break; case LED_B1_ON: set_led_bit(hfc, driver_info->led_bits[2], 0); break; case LED_B1_OFF: set_led_bit(hfc, driver_info->led_bits[2], 1); break; case LED_B2_ON: set_led_bit(hfc, driver_info->led_bits[3], 0); break; case LED_B2_OFF: set_led_bit(hfc, driver_info->led_bits[3], 1); break; } write_led(hfc, hfc->led_state); }
//------------------------------------------------------------------------------ // @fn main //! //! Core of "main_interrupt_example.c". //! //! Display in decimal on DVK90CAN1 board the seconds, minutes, hours & days //! given by the Unit declared as RTC. //! - NO key = seconds //! - NORTH key = minutes //! - CENTER key = hours //! - SOUTH key = days //! //! @warning Care on "#define"'s in "config.h". //! //! @param none. //! //! @return Integer 0 //! //------------------------------------------------------------------------------ int main (void) { U8 temp1, temp2; asm("cli"); //--- I N I T // --- Clock prescaler Reset CLKPR = 0x80; CLKPR = 0x00; // --- Init LED's & Keys led_init(); key_init(); // --- Init "SECOND COUNTER" rtc_int_init(); //--- C O R E O F T H E M A I N while(1) { //- Get display order switch (get_key_code()) { case BUTTON_S_CODE: // South for days display temp1 = rtc_days; break; case BUTTON_C_CODE: // Center for hours display temp1 = rtc_hours; break; case BUTTON_N_CODE: // North for minutes display temp1 = rtc_minutes; break; default: // Nothing for seconds display temp1 = rtc_seconds; break; } //- Display in decimal temp2 = temp1 % 10; temp2 |= (temp1/10)<<4; write_led(temp2); } return 0; }
void put_character(uint8_t c) { if (c == 'A' || c == 'a') { write_led(A,LENGTHA); } else if (c == 'B' || c == 'b') { write_led(B,LENGTHB); } else if (c == 'C' || c == 'c') { write_led(C,LENGTHC); } else if (c == 'D' || c == 'd') { write_led(D,LENGTHD); } else if (c == 'E' || c == 'e') { write_led(E,LENGTHE); } else if (c == 'F' || c == 'f') { write_led(F,LENGTHF); } else if (c == 'G' || c == 'g') { write_led(G,LENGTHG); } else if (c == 'H' || c == 'h') { write_led(H,LENGTHH); } else if (c == 'I' || c == 'i') { write_led(I,LENGTHI); } else if (c == 'J' || c == 'j') { write_led(J,LENGTHJ); } else if (c == 'K' || c == 'k') { write_led(K,LENGTHK); } else if (c == 'L' || c == 'l') { write_led(L,LENGTHL); } else if (c == 'M' || c == 'm') { write_led(M,LENGTHM); } else if (c == 'N' || c == 'n') { write_led(N,LENGTHN); } else if (c == 'O' || c == 'o') { write_led(O,LENGTHO); } else if (c == 'P' || c == 'p') { write_led(P,LENGTHP); } else if (c == 'Q' || c == 'q') { write_led(Q,LENGTHQ); } else if (c == 'R' || c == 'r') { write_led(R,LENGTHR); } else if (c == 'S' || c == 's') { write_led(S,LENGTHS); } else if (c == 'T' || c == 't') { write_led(T,LENGTHT); } else if (c == 'U' || c == 'u') { write_led(U,LENGTHU); } else if (c == 'V' || c == 'v') { write_led(V,LENGTHV); } else if (c == 'W' || c == 'w') { write_led(W,LENGTHW); } else if (c == 'X' || c == 'x') { write_led(X,LENGTHX); } else if (c == 'Y' || c == 'y') { write_led(Y,LENGTHY); } else if (c == 'Z' || c == 'z') { write_led(Z,LENGTHZ); } else if (c == ' ') { write_led(sp,LENGTHSP); } else if (c == '!') { write_led(esm,LENGTHESM); } else if (c == '.') { write_led(pnt,LENGTHPNT); } else if (c == '-') { write_led(min,LENGTHMIN); } else if (c == '+') { write_led(plu,LENGTHPLU); } else if (c == 0x27) { write_led(apo,LENGTHAPO); } write_led(sp,LENGTHSP); }
void tlc5916_write_led(int led, int on_off){ write_led(led, on_off); }