Open main menu

DAVE Developer's Wiki β

Changes

SBCX-TN-001: Android Things and SPI bus

67 bytes added, 09:42, 11 April 2018
Managing the device connection
=== Managing the device connection ===
In order to open a connection to a particular SPI slave, you need to know the unique name of the bus.
Boot the developer board and run the following commands command from the serial consoleto get the name:
<pre>
root@sbcx:/ # ls /dev/spi*-al/dev/crw-rw-rw- system root 153, 0 1970-01-01 00:00 spidev32765.0root@sbcx:/ #
</pre>
Is important to note that the above method is the only method available in order to retrieve the spi device name and because <code> getSpiBusList()</code> function is not implemented within the library.
Once you know the target name, the api API of the library <code> eu.dave.spi_dev</code> follow the Android things nomenclature
<pre>
 
public class HomeActivity extends Activity {
// SPI Device Name
}
</pre>
 
=== Configuring clock and data modes ===
Configuration method are identical to the Andriod Things api [https://developer.android.com/things/sdk/pio/spi.html#mode ref].
4,650
edits