keybrd library is an open source library for creating custom-keyboard firmware.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

tutorial_10_writing_IOE_port_classes.md 2.3KB

7 роки тому
7 роки тому
7 роки тому
7 роки тому
7 роки тому
7 роки тому
7 роки тому
12345678910111213141516171819202122232425262728
  1. Tutorial 10 - writing new IOE Port classes
  2. ==========================================
  3. Port classes are the keybrd library's interface to I/O expander ports.
  4. Steps to writing a new port class:
  5. 1. Get a copy of the I/O expander's datasheet.
  6. 2. An I/O expander will use one of two communication protocols: [http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/](SPI or I2C).
  7. Refer to the [Arduino SPI](https://www.arduino.cc/en/Reference/SPI)
  8. or [Arduino Wire (I2C)](https://www.arduino.cc/en/Reference/Wire) library
  9. 3. Get familiar with your I/O expander.
  10. * Different I/O expanders use different commands (a.k.a. operation codes).
  11. Refer to your I/O expander's datasheet for read and write commands.
  12. * Search for Arduino sketch examples containing your I/O expander
  13. ([sumotoy](https://github.com/sumotoy/gpio_expander) has a large gpio expander library).
  14. 4. Study a simple keybrd sketch that uses an I/O expander.
  15. * [SPI I/O expander example sketch](keybrd_4c_split_with_IOE/keybrd_4c_split_with_IOE.ino)
  16. * [I2C I/O expander example sketch](../examples/keybrd_PCA9655E/keybrd_PCA9655E.ino)
  17. 5. Study other keybrd port classes.
  18. * SPI I/O expander port classes: Port_MCP23S17
  19. * I2C I/O expander port classes: Port_PCA9655E
  20. 6. Write the port classes for your I/O expander.
  21. * [Example](../examples/IOE_PCA9655E_development/) shows how Port_PCA9655E was developed in stages, from fundamental to practical
  22. * Debugging I/O expander code is hard because
  23. SPI or I2C protocol, expander configuration, and expander commands.
  24. <br>
  25. <a rel="license" href="https://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">keybrd tutorial</span> by <a xmlns:cc="https://creativecommons.org/ns" href="https://github.com/wolfv6/keybrd" property="cc:attributionName" rel="cc:attributionURL">Wolfram Volpi</a> is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="https://creativecommons.org/ns" href="https://github.com/wolfv6/keybrd/issues/new" rel="cc:morePermissions">https://github.com/wolfv6/keybrd/issues/new</a>.