Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:spi_dot_matrix [2016/12/09 11:29] charles.park [SPI Dot-Matrix] |
en:spi_dot_matrix [2017/06/16 14:05] (current) odroid [Example of Scrolling Text] |
||
---|---|---|---|
Line 123: | Line 123: | ||
struct spi_ioc_transfer tr; | struct spi_ioc_transfer tr; | ||
+ | memset((void *)&tr, 0x00, sizeof(tr)); | ||
+ | | ||
tr.tx_buf = (unsigned long)tx; | tr.tx_buf = (unsigned long)tx; | ||
tr.rx_buf = (unsigned long)rx; | tr.rx_buf = (unsigned long)rx; | ||
Line 201: | Line 203: | ||
==== Example of Scrolling Text ==== | ==== Example of Scrolling Text ==== | ||
+ | |||
+ | <WRAP round important 100%> | ||
+ | <color #00a2e8>**WiringPi SPI API**</color> use case : | ||
+ | |||
+ | Uncomment this line first. | ||
+ | #define USE_WIRING_PI_LIB | ||
+ | |||
+ | Build the example with proper library option. | ||
+ | if defined USE_WIRING_PI_LIB | ||
+ | Compile : gcc -o <create excute file name> <source file name> -lwiringPi -lwiringPiDev -lpthread | ||
+ | else | ||
+ | Compile : gcc -o <create excute file name> <source file name> | ||
+ | </WRAP> | ||
+ | |||
+ | |||
<code> | <code> | ||
gcc -o dot_test dot_shift_test.c | gcc -o dot_test dot_shift_test.c | ||
Line 351: | Line 368: | ||
{ | { | ||
struct spi_ioc_transfer tr; | struct spi_ioc_transfer tr; | ||
+ | |||
+ | memset((void *)&tr, 0x00, sizeof(tr)); | ||
tr.tx_buf = (unsigned long)buf; | tr.tx_buf = (unsigned long)buf; |