Skip to content

Commit

Permalink
Merge pull request #2 from WIZnet-ioNIC/Develop
Browse files Browse the repository at this point in the history
PR #1
  • Loading branch information
wizhannah authored Aug 9, 2024
2 parents 83f369a + d1845ce commit 8ada25b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 25 deletions.
63 changes: 39 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
# CMake minimum required version
cmake_minimum_required(VERSION 3.12)

# Pull in SDK (must be before project)
if(NOT DEFINED PICO_SDK_PATH)
set(PICO_SDK_PATH ${CMAKE_SOURCE_DIR}/libraries/pico-sdk)
message(STATUS "PICO_SDK_PATH = ${PICO_SDK_PATH}")
endif()

include(pico_sdk_import.cmake)
include(wiznet_pico_azure_c_sdk_version.cmake)

# Set project name
set(PROJECT_NAME WIZNET-PICO-AZURE-C)

# Set project informations
project(${PROJECT_NAME} C CXX ASM)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Initialize the SDK
pico_sdk_init()

# Set board
#set(BOARD_NAME WIZnet_Ethernet_HAT)
#set(BOARD_NAME W5100S_EVB_PICO)
#set(BOARD_NAME W5500_EVB_PICO)
set(BOARD_NAME W55RP20_EVB_PICO)

set(BOARD_NAME W5500_EVB_PICO)
#set(BOARD_NAME W55RP20_EVB_PICO)
#set(BOARD_NAME W5100S_EVB_PICO2)
#set(BOARD_NAME W5500_EVB_PICO2)

if(${BOARD_NAME} STREQUAL WIZnet_Ethernet_HAT)
#set(PICO_PLATFORM rp2350) #If you are using WIZnet_ethernet_HAT with Pico2, uncomment it.
set(WIZNET_CHIP W5100S)
add_definitions(-D_WIZCHIP_=W5100S)
add_definitions(-DDEVICE_BOARD_NAME=WIZnet_Ethernet_HAT)
Expand All @@ -40,16 +22,49 @@ elseif(${BOARD_NAME} STREQUAL W5500_EVB_PICO)
set(WIZNET_CHIP W5500)
add_definitions(-D_WIZCHIP_=W5500)
add_definitions(-DDEVICE_BOARD_NAME=W5500_EVB_PICO)

elseif(${BOARD_NAME} STREQUAL W55RP20_EVB_PICO)
set(WIZNET_CHIP W5500)
add_definitions(-D_WIZCHIP_=W5500)
add_definitions(-DDEVICE_BOARD_NAME=W55RP20_EVB_PICO)

elseif(${BOARD_NAME} STREQUAL W5100S_EVB_PICO2)
set(PICO_PLATFORM rp2350)
set(WIZNET_CHIP W5100S)
add_definitions(-D_WIZCHIP_=W5100S)
add_definitions(-DDEVICE_BOARD_NAME=W5100S_EVB_PICO2)
elseif(${BOARD_NAME} STREQUAL W5500_EVB_PICO2)
set(PICO_PLATFORM rp2350)
set(WIZNET_CHIP W5500)
add_definitions(-D_WIZCHIP_=W5500)
add_definitions(-DDEVICE_BOARD_NAME=W5500_EVB_PICO2)
else()
message(FATAL_ERROR "BOARD_NAME is wrong = ${BOARD_NAME}")
endif()

message(STATUS "WIZNET_CHIP = ${WIZNET_CHIP}")

# Pull in SDK (must be before project)
if(NOT DEFINED PICO_SDK_PATH)
set(PICO_SDK_PATH ${CMAKE_SOURCE_DIR}/libraries/pico-sdk)
message(STATUS "PICO_SDK_PATH = ${PICO_SDK_PATH}")
endif()

include(pico_sdk_import.cmake)
include(wiznet_pico_azure_c_sdk_version.cmake)

# Set project name
set(PROJECT_NAME WIZNET-PICO-AZURE-C)

# Set project informations
project(${PROJECT_NAME} C CXX ASM)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Initialize the SDK
pico_sdk_init()

# Set the project root directory if it's not already defined, as may happen if
# the tests folder is included directly by a parent project, without including
# the top level CMakeLists.txt.
Expand Down
2 changes: 2 additions & 0 deletions port/board_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
#define W5100S_EVB_PICO 1
#define W5500_EVB_PICO 2
#define W55RP20_EVB_PICO 3
#define W5100S_EVB_PICO2 4
#define W5500_EVB_PICO2 5
2 changes: 2 additions & 0 deletions port/ioLibrary_Driver/inc/w5x00_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef _W5X00_SPI_H_
#define _W5X00_SPI_H_

#include "board_list.h"

/**
* ----------------------------------------------------------------------------------------------------
* Macros
Expand Down
2 changes: 1 addition & 1 deletion wiznet_pico_azure_c_sdk_version.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WIZNET-PICO-AZURE-C_BUILD_DEFINE: WIZNET-PICO-AZURE-C_SDK_VERSION_MAJOR, SDK major version number
set(WIZNET-PICO-AZURE-C_SDK_VERSION_MAJOR 1)
set(WIZNET-PICO-AZURE-C_SDK_VERSION_MAJOR 2)
# WIZNET-PICO-AZURE-C_BUILD_DEFINE: WIZNET-PICO-AZURE-C_SDK_VERSION_MINOR, SDK minor version number
set(WIZNET-PICO-AZURE-C_SDK_VERSION_MINOR 0)
# WIZNET-PICO-AZURE-C_BUILD_DEFINE: WIZNET-PICO-AZURE-C_SDK_VERSION_REVISION, SDK version revision
Expand Down

0 comments on commit 8ada25b

Please sign in to comment.