This commit introduces support for Dallas Semiconductor (DS) 1-wire compliant device support using an available UART device. The principle of operation is described in the following Application note by Maxim Electronics: https://www.maximintegrated.com/en/app-notes/index.mvp/id/214 with help (1-wire search) from: https://www.maximintegrated.com/en/app-notes/index.mvp/id/187 It has been tested on Galileo 2 and Edison, with 2 DS 1-wire devices, the DS18B20 and DS2413 connected to the bus. A UPM driver for the DS2413 is already complete and a PR will be submitted after this one. It is important that you use a UART with CMOS/TTL level voltages (3.3v/5v) RX and TX lines. DO NOT use standard RS232 level voltages or you are going to have a bad day. In order for this to work, a simple interface circuit, using a single diode must be constructed: (forgive my "Asciihematic" :) -| U| A| TX---|<--+ R| | T| RX-------o--------o 1-wire data bus -| The diode on TX is a 1N4148 (cheap and common), with the cathode connected to TX, and the anode connected to RX and the 1-wire data line. The 1-wire data line requires a pull-up resistor, as the DS 1-wire spec requires. 4.7-5K is typical for DS 1-wire buses. NOTE: DHT-type (temp/humidity sensor) 1-wire devices ARE NOT DS 1-wire compliant, and will not work with this code/circuit unfortunately. Also note, this will use up one of your UARTs, which cannot be used for any other purpose (ie: to access true UART-type serial devices). You can however, connect as many DS 1-wire devices as feasible to this UART, as it will function as a DS 1-wire bus master. Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
24 lines
833 B
CMake
24 lines
833 B
CMake
enable_language(CXX)
|
|
|
|
add_executable (AioA0 AioA0.cpp)
|
|
add_executable (blink-io-cpp Blink-IO.cpp)
|
|
add_executable (Pwm3-cycle Pwm3-cycle.cpp)
|
|
add_executable (I2c-compass I2c-compass.cpp)
|
|
add_executable (Spi-pot Spi-pot.cpp)
|
|
add_executable (Uart Uart-example.cpp)
|
|
add_executable (Isr-pin6 Isr-pin6.cpp)
|
|
add_executable (Iio-dummy Iio-dummy.cpp)
|
|
add_executable (UartOW UartOW.cpp)
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/api)
|
|
|
|
target_link_libraries (AioA0 mraa stdc++)
|
|
target_link_libraries (blink-io-cpp mraa stdc++)
|
|
target_link_libraries (Pwm3-cycle mraa stdc++)
|
|
target_link_libraries (I2c-compass mraa stdc++ m)
|
|
target_link_libraries (Spi-pot mraa stdc++)
|
|
target_link_libraries (Uart mraa stdc++)
|
|
target_link_libraries (Isr-pin6 mraa stdc++)
|
|
target_link_libraries (Iio-dummy mraa stdc++)
|
|
target_link_libraries (UartOW mraa stdc++)
|