keybrd library is an open source library for creating custom-keyboard firmware.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
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.4KB

Tutorial 10 - writing new IOE Port classes

Port classes are the keybrd library’s interface to I/O expander ports.

To write a new Port class:

  1. Get a copy of the I/O expander’s datasheet.
  2. An I/O expander will use one of two communication protocols: http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/. Refer to the Arduino SPI or Arduino Wire (I2C) library
  3. Get familiar with your I/O expander. Different I/O expanders use different commands (a.k.a. operation codes). Refer to your I/O expander’s datasheet for read and write commands. Search for Arduino sketch examples containing your I/O expander (sumotoy has a large gpio expander library). Write very simple read and write examples for your I/O expander. Simple SPI I/O expander examples: todo link, pictures /home/wolfv/Documents/Arduino/demo/IOE_MCP23S17_read/ /home/wolfv/Documents/Arduino/demo/IOE_MCP23S17_write/ Simple I2C I/O expander examples: todo link, pictures read write
  4. Study other keybrd Port classes. Port classes for SPI MCP23S17 I/O expander: *todo * * Port classes for I2C PCA9655E I/O expander:
    • PortWrite_PCA9655E todo link
    • PortRead_PCA9655E
    • LED_PCA9655E
  5. Write similar Port classes for your I/O expander. Debugging I/O expander code is hard because SPI or I2C protocol adds a level of indirection.


Creative Commons License
keybrd tutorial by Wolfram Volpi is licensed under a Creative Commons Attribution 4.0 International License.
Permissions beyond the scope of this license may be available at https://github.com/wolfv6/keybrd/issues/new.