Skip to content

Commit

Permalink
Add WiFi Shield layers
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertRostohar committed Nov 20, 2024
1 parent 9f3b542 commit 9db2abc
Show file tree
Hide file tree
Showing 30 changed files with 1,450 additions and 5 deletions.
12 changes: 9 additions & 3 deletions ARM.CMSIS-Driver.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
</licenseSets>

<releases>
<release version="2.9.0-dev">
<release version="2.10.0">
Active development ...
- Added USB Host EHCI (TT) driver
- Added USB Host OHCI driver
- Added WiFi Shield layers
</release>
</releases>

Expand Down Expand Up @@ -475,4 +474,11 @@
</component>
</components>

<csolution>
<clayer type="Shield" path="Shield/WiFi/Sparkfun_ESP8266" file="Shield.clayer.yml" copy-to="Shield/WiFi/Sparkfun_ESP8266"/>
<clayer type="Shield" path="Shield/WiFi/WizNet_WizFi360-EVB" file="Shield.clayer.yml" copy-to="Shield/WiFi/WizNet_WizFi360-EVB"/>
<clayer type="Shield" path="Shield/WiFi/Inventek_ISMART43362-E" file="Shield.clayer.yml" copy-to="Shield/WiFi/Inventek_ISMART43362-E"/>
<clayer type="Shield" path="Shield/WiFi/Sparkfun_DA16200" file="Shield.clayer.yml" copy-to="Shield/WiFi/Sparkfun_DA16200"/>
</csolution>

</package>
24 changes: 24 additions & 0 deletions Shield/WiFi/Inventek_ISMART43362-E/Inventek_ISMART43362.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*---------------------------------------------------------------------------
* Copyright (c) 2024 Arm Limited (or its affiliates).
* All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*---------------------------------------------------------------------------*/

#include CMSIS_target_header

// Shield Setup (default configuration)
int shield_setup (void) {
return 0;
}
29 changes: 29 additions & 0 deletions Shield/WiFi/Inventek_ISMART43362-E/Inventek_ISMART43362.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*---------------------------------------------------------------------------
* Copyright (c) 2023 Arm Limited (or its affiliates).
* All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*---------------------------------------------------------------------------*/

#ifndef Inventek_ISMART43362_H_
#define Inventek_ISMART43362_H_

#include "Driver_WiFi.h"

// CMSIS Drivers
extern ARM_DRIVER_WIFI Driver_WiFi0;

extern int shield_setup (void);

#endif /* Inventek_ISMART43362_H_ */
9 changes: 9 additions & 0 deletions Shield/WiFi/Inventek_ISMART43362-E/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Shield: Inventek ISM43362-E WiFi
--------------------------------

The [ISM43362-E WiFi Shield](https://www2.keil.com/iot/shields/ismart43362) is connected via an Arduino header using an SPI
interface. It exposes a [CMSIS-Driver WiFi](https://arm-software.github.io/CMSIS_6/latest/Driver/group__wifi__interface__gr.html).

This module was tested with firmware revision **ISM43362_M3G_L44_SPI_C6.2.1.7**. Refer to
[ISM43362 Firmware Update](https://arm-software.github.io/CMSIS-Driver/latest/driver_WiFi.html#driver_ISM43362) for
more information.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* -----------------------------------------------------------------------------
* Copyright (c) 2019-2022 Arm Limited (or its affiliates). All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*
*
* $Date: 4. April 2022
* $Revision: V1.2
*
* Project: WiFi Driver Configuration for
* Inventek ISM43362-M3G-L44 WiFi Module (SPI variant)
* -------------------------------------------------------------------------- */

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------

#ifndef __WIFI_ISM43362_CONFIG_H
#define __WIFI_ISM43362_CONFIG_H

// <h> WiFi Inventek ISM43362 Driver Configuration (SPI)

// <o> WiFi Driver Number
// <i> Configuration settings specifying driver number (default: Driver_WiFi0)
#define WIFI_ISM43362_DRV_NUM 0

// <o> Memory pool size
// <i> Configuration settings specifying memory pool size for receive packets buffering
#define WIFI_ISM43362_MEM_POOL_SIZE 16384

// </h>

//------------- <<< end of configuration section >>> -------------------------

// Number of sockets supported by Module (default and maximum: 4)
#define WIFI_ISM43362_SOCKETS_NUM (4)

// SPI bus speed (default: 20 Mbps)
#define WIFI_ISM43362_SPI_BUS_SPEED (20000000)

// SPI mutex acquire timeout in ms (default: 1000)
#define WIFI_ISM43362_SPI_TIMEOUT (1000)

// SPI receive transfer size (default: 32)
// This setting specifies chunk size in which SPI read is done
#define WIFI_ISM43362_SPI_RECEIVE_SIZE (32)

// SPI command timeout in ms (default: 30000)
// Maximum time that command can keep the SPI DATARDY line busy
#define WIFI_ISM43362_CMD_TIMEOUT (30000)

// Asynchronous thread polling time interval in ms (default: 8)
// Interval in which asynchronous events are polled and also interval
// in which long blocking socket receive is split
#define WIFI_ISM43362_ASYNC_INTERVAL (8)

// Asynchronous thread stack size (default: 1024)
#define WIFI_ISM43362_ASYNC_THREAD_STACK_SIZE (1024)

// Asynchronous thread priority (default: osPriorityAboveNormal)
// This priority should be above user threads
#define WIFI_ISM43362_ASYNC_PRIORITY (osPriorityAboveNormal)

#ifdef CMSIS_target_header
#include CMSIS_target_header
#endif

// SPI driver number used (if Module uses SPI interface)
#define WIFI_ISM43362_SPI_DRV_NUM ARDUINO_UNO_SPI

#endif // __WIFI_ISM43362_CONFIG_H
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* -----------------------------------------------------------------------------
* Copyright (c) 2019-2022 Arm Limited (or its affiliates). All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*
*
* $Date: 4. April 2022
* $Revision: V1.2
*
* Project: WiFi Driver Configuration for
* Inventek ISM43362-M3G-L44 WiFi Module (SPI variant)
* -------------------------------------------------------------------------- */

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------

#ifndef __WIFI_ISM43362_CONFIG_H
#define __WIFI_ISM43362_CONFIG_H

// <h> WiFi Inventek ISM43362 Driver Configuration (SPI)

// <o> WiFi Driver Number
// <i> Configuration settings specifying driver number (default: Driver_WiFi0)
#define WIFI_ISM43362_DRV_NUM 0

// <o> SPI Driver Number
// <i> Configuration settings specifying SPI driver number used (if Module uses SPI interface)
#define WIFI_ISM43362_SPI_DRV_NUM 0

// <o> Memory pool size
// <i> Configuration settings specifying memory pool size for receive packets buffering
#define WIFI_ISM43362_MEM_POOL_SIZE 16384

// </h>

// Number of sockets supported by Module (default and maximum: 4)
#define WIFI_ISM43362_SOCKETS_NUM (4)

// SPI bus speed (default: 20 Mbps)
#define WIFI_ISM43362_SPI_BUS_SPEED (20000000)

// SPI mutex acquire timeout in ms (default: 1000)
#define WIFI_ISM43362_SPI_TIMEOUT (1000)

// SPI receive transfer size (default: 32)
// This setting specifies chunk size in which SPI read is done
#define WIFI_ISM43362_SPI_RECEIVE_SIZE (32)

// SPI command timeout in ms (default: 30000)
// Maximum time that command can keep the SPI DATARDY line busy
#define WIFI_ISM43362_CMD_TIMEOUT (30000)

// Asynchronous thread polling time interval in ms (default: 8)
// Interval in which asynchronous events are polled and also interval
// in which long blocking socket receive is split
#define WIFI_ISM43362_ASYNC_INTERVAL (8)

// Asynchronous thread stack size (default: 1024)
#define WIFI_ISM43362_ASYNC_THREAD_STACK_SIZE (1024)

// Asynchronous thread priority (default: osPriorityAboveNormal)
// This priority should be above user threads
#define WIFI_ISM43362_ASYNC_PRIORITY (osPriorityAboveNormal)

#endif // __WIFI_ISM43362_CONFIG_H
105 changes: 105 additions & 0 deletions Shield/WiFi/Inventek_ISMART43362-E/RTE/CMSIS_Driver/WiFi_ISM43362_HW.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/* -----------------------------------------------------------------------------
* Copyright (c) 2019-2020 Arm Limited (or its affiliates). All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*
*
* $Date: 13. February 2020
* $Revision: V1.1
*
* Project: WiFi Driver Hardware specific implementation for
* Inventek ISM43362-M3G-L44 WiFi Module (SPI variant)
* -------------------------------------------------------------------------- */

#include <stdint.h>

// Add device specific include files here
// <code WiFi_ISM43362_include_files>
#ifdef CMSIS_target_header
#include CMSIS_target_header
#endif
// </code>

/**
\fn void WiFi_ISM43362_Pin_Initialize (void)
\brief Initialize pin(s).
\return none
*/
void WiFi_ISM43362_Pin_Initialize (void) {
// Add code for initializing Reset, Slave Select and Data Ready pins here
// (for Data Ready pin external interrupt can also be setup here)
// <code WiFi_ISM43362_Pin_Initialize>
Driver_GPIO0.Setup(ARDUINO_UNO_D9, NULL); // DATARDY
Driver_GPIO0.SetDirection(ARDUINO_UNO_D9, ARM_GPIO_INPUT);
Driver_GPIO0.Setup(ARDUINO_UNO_D10, NULL); // SSN
Driver_GPIO0.SetDirection(ARDUINO_UNO_D10, ARM_GPIO_OUTPUT);
// </code>
}

/**
\fn void WiFi_ISM43362_Pin_Uninitialize (void)
\brief De-initialize pin(s).
\return none
*/
void WiFi_ISM43362_Pin_Uninitialize (void) {
// Add code for deinitializing Reset, Slave Select and Data Ready pins here
// <code WiFi_ISM43362_Pin_Uninitialize>
Driver_GPIO0.SetDirection(ARDUINO_UNO_D10, ARM_GPIO_INPUT);
// </code>
}

/**
\fn void WiFi_ISM43362_Pin_RSTN (uint8_t rstn)
\brief Drive Reset line.
\param[in] rstn
- value = 0: Drive Reset line not active state
- value = 1: Drive Reset line active state
\return none
*/
void WiFi_ISM43362_Pin_RSTN (uint8_t rstn) {
// Add code for driving Reset pin here
// <code WiFi_ISM43362_Pin_RSTN>

// </code>
}

/**
\fn void WiFi_ISM43362_Pin_SSN (uint8_t ssn)
\brief Drive Slave Select line.
\param[in] ssn
- value = 0: Drive Slave Select line not active state
- value = 1: Drive Slave Select line active state
\return none
*/
void WiFi_ISM43362_Pin_SSN (uint8_t ssn) {
// Add code for driving Slave Select pin here
// <code WiFi_ISM43362_Pin_SSN>
Driver_GPIO0.SetOutput(ARDUINO_UNO_D10, ssn ? 0U : 1U);
// </code>
}

/**
\fn uint8_t WiFi_ISM43362_Pin_DATARDY (void)
\brief Get Data Ready line state.
\return Data Ready line state
- 0: Data Ready line is not active state
- 1: Data Ready line is active state
*/
uint8_t WiFi_ISM43362_Pin_DATARDY (void) {
// Add code for retrieving Data Ready pin state here
// <code WiFi_ISM43362_Pin_DATARDY>
return Driver_GPIO0.GetInput(ARDUINO_UNO_D9);
// </code>
}
Loading

0 comments on commit 9db2abc

Please sign in to comment.