Skip to content

Commit

Permalink
Revert "[nxp noup][platform][k32w] Adding platform code changes for k…
Browse files Browse the repository at this point in the history
…32w"

This reverts commit 8973b88.

Signed-off-by: Dina Benamar <[email protected]>
  • Loading branch information
dinabenamar committed Feb 26, 2024
1 parent f1a2b5a commit 892b18b
Show file tree
Hide file tree
Showing 39 changed files with 312 additions and 1,021 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 Project CHIP Authors
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/nxp_sdk.gni")
import("${nxp_sdk_build_root}/nxp_sdk.gni")

assert(nxp_platform == "k32w/k32w0", "${nxp_platform} must be k32w/k32w0.")

arm_float_abi = "soft"
arm_cpu = "cortex-m4"
arm_arch = "armv7e-m"
declare_args() {
# Root directory for K32W SDK build files.
k32w0_sdk_build_root = "//third_party/nxp/k32w0_sdk"
}
5 changes: 5 additions & 0 deletions src/lib/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ static_library("shell") {
"MainLoopSilabs.cpp",
"streamer_silabs.cpp",
]
} else if (chip_device_platform == "k32w0") {
sources += [
"MainLoopDefault.cpp",
"streamer_k32w.cpp",
]
} else if (chip_device_platform == "nxp") {
sources += [
"MainLoopDefault.cpp",
Expand Down
76 changes: 76 additions & 0 deletions src/lib/shell/streamer_k32w.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
*
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* Source implementation of an input / output stream for k32w targets.
*/

#include <lib/shell/Engine.h>
#include <lib/shell/streamer.h>

#include <stdio.h>
#include <string.h>

#include "SerialManager.h"
extern uint8_t gShellSerMgrIf;

namespace chip {
namespace Shell {
namespace {
extern "C" void K32WWriteBlocking(const uint8_t * aBuf, uint32_t len);
extern "C" serialStatus_t Serial_Read(uint8_t InterfaceId, uint8_t * pData, uint16_t dataSize, uint16_t * bytesRead);

int streamer_k32w_init(streamer_t * streamer)
{
(void) streamer;

return 0;
}

ssize_t streamer_k32w_read(streamer_t * streamer, char * buffer, size_t length)
{
uint16_t bytesRead = 0;

(void) streamer;
Serial_Read(gShellSerMgrIf, (uint8_t *) buffer, length, &bytesRead);

return bytesRead;
}

ssize_t streamer_k32w_write(streamer_t * streamer, const char * buffer, size_t length)
{
(void) streamer;
K32WWriteBlocking((uint8_t *) buffer, length);

return length;
}

static streamer_t streamer_k32w = {
.init_cb = streamer_k32w_init,
.read_cb = streamer_k32w_read,
.write_cb = streamer_k32w_write,
};
} // namespace

streamer_t * streamer_get(void)
{
return &streamer_k32w;
}

} // namespace Shell
} // namespace chip
15 changes: 10 additions & 5 deletions src/lwip/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ if (lwip_platform == "") {
assert(lwip_platform == "external" || lwip_platform == "standalone" ||
lwip_platform == "cc13xx_26xx" || lwip_platform == "cc32xx" ||
lwip_platform == "nxp" || lwip_platform == "silabs" ||
lwip_platform == "qpg" || lwip_platform == "mbed" ||
lwip_platform == "psoc6" || lwip_platform == "cyw30739" ||
lwip_platform == "bl602" || lwip_platform == "mw320" ||
lwip_platform == "bl702" || lwip_platform == "bl702l" ||
lwip_platform == "mt793x" || lwip_platform == "asr",
lwip_platform == "k32w0" || lwip_platform == "qpg" ||
lwip_platform == "mbed" || lwip_platform == "psoc6" ||
lwip_platform == "cyw30739" || lwip_platform == "bl602" ||
lwip_platform == "mw320" || lwip_platform == "bl702" ||
lwip_platform == "bl702l" || lwip_platform == "mt793x" ||
lwip_platform == "asr",
"Unsupported lwIP platform: ${lwip_platform}")

if (lwip_platform != "external") {
Expand All @@ -53,6 +54,8 @@ if (lwip_platform == "cc13xx_26xx") {
} else if (lwip_platform == "qpg") {
import("//build_overrides/qpg_sdk.gni")
import("${qpg_sdk_build_root}/qpg_sdk.gni")
} else if (lwip_platform == "k32w0") {
import("//build_overrides/k32w0_sdk.gni")
} else if (lwip_platform == "psoc6") {
import("//build_overrides/psoc6.gni")
} else if (lwip_platform == "cyw30739") {
Expand Down Expand Up @@ -222,6 +225,8 @@ if (current_os == "zephyr" || current_os == "mbed") {
public_deps += [ "${efr32_sdk_build_root}:efr32_sdk" ]
} else if (lwip_platform == "standalone") {
public_deps += [ "${chip_root}/src/lib/support" ]
} else if (lwip_platform == "k32w0") {
public_deps += [ "${k32w0_sdk_build_root}:k32w0_sdk" ]
} else if (lwip_platform == "cyw30739") {
public_deps += [ "${cyw30739_sdk_build_root}:cyw30739_sdk" ]
} else if (lwip_platform == "bl702") {
Expand Down
90 changes: 0 additions & 90 deletions src/lwip/k32w1/arch/cc.h

This file was deleted.

26 changes: 0 additions & 26 deletions src/lwip/k32w1/arch/perf.h

This file was deleted.

Loading

0 comments on commit 892b18b

Please sign in to comment.