File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ # mruby-esp32-spi
2+
3+ SPI library for mruby-esp32.
4+
5+ ## Installation
6+
7+ You need [ esp-idf v5.0] ( https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/index.html ) to use this mrbgems.
8+
9+ Add the line below to your ` build_config.rb ` :
10+
11+ ``` ruby
12+ conf.gem :github => ' yuuu/mruby-esp32-spi'
13+ ```
14+
15+ ## Examples
16+
17+ ``` ruby
18+ spi = SPI .new
19+ spi = SPI .new (unit: 1 , mode: 0 , frequency: 10_000_000 , first_bit: SPI ::MSB_FIRST )
20+
21+ spi.setmode(unit: 1 , mode: 0 , frequency: 10_000_000 , first_bit: SPI ::MSB_FIRST )
22+
23+ spi.write(0x30 , 0x20 , 0x00 )
24+ spi.write(" \x30\xa2 " )
25+ spi.write(0x30 )
26+
27+ data = spi.read( 32 )
28+
29+ s = spi.transfer([0x30 , 0x20 ], 1 )
30+
31+ ```
32+
33+ ## LICENSE
34+
35+ MIT License.
You can’t perform that action at this time.
0 commit comments