119 bcm2835_gpio_fsel(t->
data, BCM2835_GPIO_FSEL_OUTP);
120 bcm2835_gpio_fsel(t->
clock, BCM2835_GPIO_FSEL_OUTP);
121 bcm2835_gpio_fsel(t->
strobe, BCM2835_GPIO_FSEL_OUTP);
123 bcm2835_gpio_write(t->
strobe, HIGH);
124 bcm2835_gpio_write(t->
clock, HIGH);
125 delayMicroseconds(1);
195 for(
int i = 0; i < 8; i++)
197 bcm2835_gpio_write(t->
clock, LOW);
198 delayMicroseconds(1);
200 bcm2835_gpio_write(t->
data, x & 1 ? HIGH : LOW);
201 delayMicroseconds(1);
204 bcm2835_gpio_write(t->
clock, HIGH);
205 delayMicroseconds(1);
225 bcm2835_gpio_fsel(t->
data, BCM2835_GPIO_FSEL_INPT);
227 for(
int i = 0; i < 8; i++)
231 bcm2835_gpio_write(t->
clock, LOW);
232 delayMicroseconds(1);
234 uint8_t y = bcm2835_gpio_lev(t->
data);
238 delayMicroseconds(1);
240 bcm2835_gpio_write(t->
clock, HIGH);
241 delayMicroseconds(1);
245 bcm2835_gpio_fsel(t->
data, BCM2835_GPIO_FSEL_OUTP);
261 bcm2835_gpio_write(t->
strobe, LOW);
262 delayMicroseconds(1);
266 bcm2835_gpio_write(t->
strobe, HIGH);
267 delayMicroseconds(1);
284 bcm2835_gpio_write(t->
strobe, LOW);
285 delayMicroseconds(1);
290 bcm2835_gpio_write(t->
strobe, HIGH);
291 delayMicroseconds(1);
305 for(
int i = 0, j = 1; i < 8; i++, j <<= 1)
330 for(
int i = 0, j = 128; i < 8; i++, j >>= 1)
331 tm1638_set_led(t, i, ((red & j) ? 1 : 0) + ((green & j) ? 2 : 0));
341 bcm2835_gpio_write(t->
strobe, LOW);
342 delayMicroseconds(1);
345 for(
int i = 0; i < 16; i++)
348 bcm2835_gpio_write(t->
strobe, HIGH);
349 delayMicroseconds(1);
355 const uint8_t f[] = {
356 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
357 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
358 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
359 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
360 0x00, 0x86, 0x22, 0x7e, 0x6d, 0x00, 0x00, 0x02,
361 0x30, 0x06, 0x63, 0x00, 0x04, 0x40, 0x80, 0x52,
362 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x27,
363 0x7f, 0x6f, 0x00, 0x00, 0x00, 0x48, 0x00, 0x53,
364 0x5f, 0x77, 0x7f, 0x39, 0x3f, 0x79, 0x71, 0x3d,
365 0x76, 0x06, 0x1f, 0x69, 0x38, 0x15, 0x37, 0x3f,
366 0x73, 0x67, 0x31, 0x6d, 0x78, 0x3e, 0x2a, 0x1d,
367 0x76, 0x6e, 0x5b, 0x39, 0x64, 0x0f, 0x00, 0x08,
368 0x20, 0x5f, 0x7c, 0x58, 0x5e, 0x7b, 0x31, 0x6f,
369 0x74, 0x04, 0x0e, 0x75, 0x30, 0x55, 0x54, 0x5c,
370 0x73, 0x67, 0x50, 0x6d, 0x78, 0x1c, 0x2a, 0x1d,
371 0x76, 0x6e, 0x47, 0x46, 0x06, 0x70, 0x01, 0x00
374 return (c > 127) ? 0 : f[(
unsigned char)c];
382 bcm2835_gpio_write(t->
strobe, LOW);
383 delayMicroseconds(1);
388 for(
int i = 0; i < 4; i++)
394 bcm2835_gpio_write(t->
strobe, HIGH);
395 delayMicroseconds(1);
406 for(
int i = 0; i < 4; i++)