Skip to content

Rework 1-Wire implementation #2265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .vscode/cmake-variants-DEVCONTAINER.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"API_System.IO.Ports": "ON",
"API_Windows.Devices.Adc": "ON",
"API_System.Device.Adc": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.Devices.Can": "OFF",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
Expand Down Expand Up @@ -142,7 +142,7 @@
"API_System.Device.Adc": "ON",
"API_System.Device.Dac": "ON",
"API_System.Net": "ON",
"API_nanoFramework.Devices.OneWire": "OFF",
"API_nanoFramework.Device.OneWire": "OFF",
"API_nanoFramework.Devices.Can": "OFF",
"API_Windows.Storage": "ON",
"API_nanoFramework.ResourceManager": "ON",
Expand Down Expand Up @@ -191,7 +191,7 @@
"API_System.Device.Adc": "ON",
"API_System.Device.Dac": "ON",
"API_System.Net": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.Devices.Can": "ON",
"API_Windows.Storage": "ON",
"API_nanoFramework.ResourceManager": "ON",
Expand Down Expand Up @@ -285,7 +285,7 @@
"API_System.Net": "ON",
"API_System.Device.WiFi": "ON",
"API_Hardware.Esp32": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
"API_nanoFramework.System.Text": "ON",
Expand Down Expand Up @@ -332,7 +332,7 @@
"API_System.Net": "ON",
"API_System.Device.WiFi": "ON",
"API_Hardware.Esp32": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
"API_nanoFramework.System.Text": "ON",
Expand Down Expand Up @@ -380,7 +380,7 @@
"API_System.Net": "ON",
"API_System.Device.WiFi": "ON",
"API_Hardware.Esp32": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
"API_nanoFramework.System.Text": "ON",
Expand Down Expand Up @@ -433,7 +433,7 @@
"API_nanoFramework.System.Text": "ON",
"API_nanoFramework.Hardware.Esp32.Rmt": "ON",
"API_Windows.Devices.Adc": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.Graphics": "OFF",
"API_nanoFramework.Device.Bluetooth": "OFF"
}
Expand Down Expand Up @@ -476,7 +476,7 @@
"API_System.Net": "ON",
"API_System.Device.WiFi": "ON",
"API_Hardware.Esp32": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_nanoFramework.ResourceManager": "ON",
"API_nanoFramework.System.Collections": "ON",
"API_nanoFramework.System.Text": "ON",
Expand Down Expand Up @@ -533,7 +533,7 @@
"API_nanoFramework.System.Text": "ON",
"API_nanoFramework.Hardware.Esp32.Rmt": "ON",
"API_System.Device.Dac": "ON",
"API_nanoFramework.Devices.OneWire": "OFF",
"API_nanoFramework.Device.OneWire": "OFF",
"API_nanoFramework.Graphics": "OFF",
"API_nanoFramework.Device.Bluetooth": "OFF"
}
Expand Down Expand Up @@ -581,7 +581,7 @@
"API_nanoFramework.Hardware.Esp32.Rmt": "ON",
"API_System.Device.Dac": "ON",
"API_nanoFramework.Device.Bluetooth": "OFF",
"API_nanoFramework.Devices.OneWire": "OFF",
"API_nanoFramework.Device.OneWire": "OFF",
"API_nanoFramework.Graphics": "ON",
"GRAPHICS_DISPLAY": "ILI9341_240x320_SPI.cpp",
"GRAPHICS_DISPLAY_INTERFACE": "Spi_To_Display.cpp",
Expand Down Expand Up @@ -679,7 +679,7 @@
"API_nanoFramework.System.Collections": "ON",
"API_nanoFramework.System.Text": "ON",
"API_nanoFramework.Hardware.Esp32.Rmt": "ON",
"API_nanoFramework.Devices.OneWire": "ON",
"API_nanoFramework.Device.OneWire": "ON",
"API_System.Device.Dac": "ON",
"API_nanoFramework.Graphics": "OFF",
"API_nanoFramework.Device.Bluetooth": "OFF"
Expand Down
2 changes: 1 addition & 1 deletion .vscode/cmake-variants.TEMPLATE.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"NF_SECURITY_MBEDTLS": "OFF-default-ON-to-add-network-security-from-mbedTLS",
"MBEDTLS_SOURCE": "<path-to-mbedtls-source-mind-the-forward-slashes>",
"API_nanoFramework.Devices.Can": "OFF-default-ON-to-add-this-API",
"API_nanoFramework.Devices.OneWire": "OFF-default-ON-to-add-this-API",
"API_nanoFramework.Device.OneWire": "OFF-default-ON-to-add-this-API",
"API_nanoFramework.ResourceManager": "OFF-default-ON-to-add-this-API",
"API_nanoFramework.System.Collections": "OFF-default-ON-to-add-this-API",
"API_nanoFramework.System.Text": "OFF-default-ON-to-add-this-API",
Expand Down
8 changes: 4 additions & 4 deletions CMake/Modules/FindNF_NativeAssemblies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
###########################################################################################

option(API_nanoFramework.Devices.Can "option for nanoFramework.Devices.Can")
option(API_nanoFramework.Devices.OneWire "option for nanoFramework.Devices.OneWire")
option(API_nanoFramework.Device.OneWire "option for nanoFramework.Device.OneWire")
option(API_nanoFramework.Networking.Sntp "option for nanoFramework.Networking.Sntp")
option(API_nanoFramework.Runtime.Events "option for nanoFramework.Runtime.Events API")
option(API_nanoFramework.ResourceManager "option for nanoFramework.ResourceManager")
Expand Down Expand Up @@ -201,10 +201,10 @@ if(API_nanoFramework.Graphics)
PerformSettingsForApiEntry("nanoFramework.Graphics")
endif()

# nanoFramework.Devices.OneWire
if(API_nanoFramework.Devices.OneWire)
# nanoFramework.Device.OneWire
if(API_nanoFramework.Device.OneWire)
##### API name here (doted name)
PerformSettingsForApiEntry("nanoFramework.Devices.OneWire")
PerformSettingsForApiEntry("nanoFramework.Device.OneWire")
endif()

# nanoFramework.Networking.Sntp
Expand Down
49 changes: 49 additions & 0 deletions CMake/Modules/FindnanoFramework.Device.OneWire.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#


# native code directory
set(BASE_PATH_FOR_THIS_MODULE "${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Device.OneWire")


# set include directories
list(APPEND nanoFramework.Device.OneWire_INCLUDE_DIRS ${BASE_PATH_FOR_THIS_MODULE})
list(APPEND nanoFramework.Device.OneWire_INCLUDE_DIRS ${TARGET_BASE_LOCATION})
list(APPEND nanoFramework.Device.OneWire_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/nanoFramework.Device.OneWire)

# source files
set(nanoFramework.Device.OneWire_SRCS

nf_dev_onewire_nanoFramework_Device_OneWire_OneWireHost.cpp
nf_dev_onewire.cpp

target_nf_dev_onewire_config.cpp
)

foreach(SRC_FILE ${nanoFramework.Device.OneWire_SRCS})

set(nanoFramework.Device.OneWire_SRC_FILE SRC_FILE-NOTFOUND)

find_file(nanoFramework.Device.OneWire_SRC_FILE ${SRC_FILE}
PATHS
${BASE_PATH_FOR_THIS_MODULE}
${TARGET_BASE_LOCATION}
${CMAKE_SOURCE_DIR}/src/nanoFramework.Device.OneWire

CMAKE_FIND_ROOT_PATH_BOTH
)

if (BUILD_VERBOSE)
message("${SRC_FILE} >> ${nanoFramework.Device.OneWire_SRC_FILE}")
endif()

list(APPEND nanoFramework.Device.OneWire_SOURCES ${nanoFramework.Device.OneWire_SRC_FILE})

endforeach()


include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(nanoFramework.Device.OneWire DEFAULT_MSG nanoFramework.Device.OneWire_INCLUDE_DIRS nanoFramework.Device.OneWire_SOURCES)
49 changes: 0 additions & 49 deletions CMake/Modules/FindnanoFramework.Devices.OneWire.cmake

This file was deleted.

14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,14 @@ endif()
# for some APIs we need to enable the device in the HAL config
# and/or manage other APIs that are required

if( API_nanoFramework.Devices.OneWire OR
if( API_nanoFramework.Device.OneWire OR
API_Windows.Devices.SerialCommunication OR
API_System.IO.Ports)

set(HAL_USE_UART_OPTION TRUE CACHE INTERNAL "HAL OneWire for nanoFramework.Devices.OneWire")
set(HAL_USE_UART_OPTION TRUE CACHE INTERNAL "HAL OneWire for nanoFramework.Device.OneWire")

else()
set(HAL_USE_UART_OPTION FALSE CACHE INTERNAL "HAL OneWire for nanoFramework.Devices.OneWire")
set(HAL_USE_UART_OPTION FALSE CACHE INTERNAL "HAL OneWire for nanoFramework.Device.OneWire")
endif()

if( API_System.Net)
Expand Down Expand Up @@ -594,10 +594,10 @@ else()
endif()


if(API_nanoFramework.Devices.OneWire)
set(HAL_USE_STM32_ONEWIRE_OPTION TRUE CACHE INTERNAL "HAL STM32_ONEWIRE for nanoFramework.Devices.OneWire")
if(API_nanoFramework.Device.OneWire)
set(HAL_USE_STM32_ONEWIRE_OPTION TRUE CACHE INTERNAL "HAL STM32_ONEWIRE for nanoFramework.Device.OneWire")
else()
set(HAL_USE_STM32_ONEWIRE_OPTION FALSE CACHE INTERNAL "HAL STM32_ONEWIRE for nanoFramework.Devices.OneWire")
set(HAL_USE_STM32_ONEWIRE_OPTION FALSE CACHE INTERNAL "HAL STM32_ONEWIRE for nanoFramework.Device.OneWire")
endif()

#################################################################################
Expand Down Expand Up @@ -626,7 +626,7 @@ endif()
#################################################################

# include nanoFramework.Runtime.Events API
if( API_nanoFramework.Devices.OneWire OR
if( API_nanoFramework.Device.OneWire OR
API_System.Net OR
API_System.Device.Gpio OR
API_Windows.Devices.Gpio OR
Expand Down
4 changes: 2 additions & 2 deletions CMakeSettings.SAMPLE.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"type": "BOOL"
},
{
"name": "API_nanoFramework.Devices.OneWire",
"name": "API_nanoFramework.Device.OneWire",
"value": "True",
"type": "BOOL"
},
Expand Down Expand Up @@ -449,7 +449,7 @@
"type": "PATH"
},
{
"name": "API_nanoFramework.Devices.OneWire",
"name": "API_nanoFramework.Device.OneWire",
"value": "True",
"type": "BOOL"
},
Expand Down
4 changes: 2 additions & 2 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"value": "ON"
},
{
"name": "API_nanoFramework.Devices.OneWire",
"name": "API_nanoFramework.Device.OneWire",
"value": "OFF"
},
{
Expand Down Expand Up @@ -364,7 +364,7 @@
},
// LIBRARIES
{
"name": "API_nanoFramework.Devices.OneWire:BOOL", //OFF-default-ON-to-add-this-API
"name": "API_nanoFramework.Device.OneWire:BOOL", //OFF-default-ON-to-add-this-API
"value": "ON"
},
{
Expand Down
10 changes: 5 additions & 5 deletions azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down Expand Up @@ -477,7 +477,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down Expand Up @@ -591,7 +591,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ jobs:
-DAPI_Windows.Devices.Pwm=ON -DAPI_System.Device.Pwm=ON
-DAPI_Windows.Devices.SerialCommunication=ON -DAPI_System.IO.Ports=ON
-DAPI_Windows.Devices.Adc=ON -DAPI_System.Device.Adc=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.Devices.Can=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
Expand Down Expand Up @@ -357,7 +357,7 @@ jobs:
-DAPI_System.Device.Dac=ON
-DAPI_System.Net=ON
-DNF_SECURITY_MBEDTLS=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.Devices.Can=ON
-DAPI_System.IO.FileSystem=ON
-DAPI_nanoFramework.ResourceManager=ON
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down Expand Up @@ -482,7 +482,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down Expand Up @@ -519,7 +519,7 @@ jobs:
-DAPI_System.Net=ON
-DAPI_System.Device.WiFi=ON
-DAPI_Hardware.Esp32=ON
-DAPI_nanoFramework.Devices.OneWire=ON
-DAPI_nanoFramework.Device.OneWire=ON
-DAPI_nanoFramework.ResourceManager=ON
-DAPI_nanoFramework.System.Collections=ON
-DAPI_nanoFramework.System.Text=ON
Expand Down
Loading