/* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. * (c) 2014 Stefan Rupp * ---------------------------------------------------------------------------- */ #include #include "led1642gw.h" #include #define NUM_LED1642GW_CHANNELS (16) #define NUM_LED_CHANNELS (NUM_LED1642GW_CHANNELS*NUM_LED1642GW_ICs) #define NUM_LED1642GW_ICs (3) static uint16_t ledbuffer[NUM_LED_CHANNELS]; #define DDR_CLK (DDRC) #define PORT_CLK (PORTC) #define PIN_CLK (3) #define SET_CLK_H() ((PORT_CLK) |= (1<<(PIN_CLK))) #define SET_CLK_L() ((PORT_CLK) &= ~(1<<(PIN_CLK))) #define DDR_SDI (DDRC) #define PORT_SDI (PORTC) #define PIN_SDI (4) #define SET_SDI_H() ((PORT_SDI) |= (1<<(PIN_SDI))) #define SET_SDI_L() ((PORT_SDI) &= ~(1<<(PIN_SDI))) #define DDR_LE (DDRC) #define PORT_LE (PORTC) #define PIN_LE (2) #define SET_LE_H() ((PORT_LE) |= (1<<(PIN_LE))) #define SET_LE_L() ((PORT_LE) &= ~(1<<(PIN_LE))) static void write_data(uint16_t data, uint8_t le_clocks) { uint16_t mask = 0x8000; int8_t bit; //PORTC &= ~(1<=le_clocks; bit--) { //PORTC &= ~(1<>= 1; } //PORTC |= (1<=0; bit--) { //PORTC &= ~(1<>= 1; } //PORTC &= ~(1<