Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6e0fbac77 | ||
|
|
cf0fd6cf93 | ||
|
|
0948b9989e | ||
|
|
5871d154ba | ||
|
|
c4251541d8 | ||
|
|
f420987a47 | ||
|
|
1b67b2f3ff | ||
|
|
e981dea822 | ||
|
|
e3dd512e7a | ||
|
|
c0be95b2ba | ||
|
|
41cb4742ba | ||
|
|
03a6caf35a | ||
|
|
5d1e3fb14f | ||
|
|
b9102c90b5 | ||
|
|
3eed2218ce |
@@ -0,0 +1,31 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
daysUntilStale: 60
|
||||
daysUntilClose: 14
|
||||
limitPerRun: 30
|
||||
staleLabel: stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- "to be implemented"
|
||||
- "for reference"
|
||||
- "move to PR"
|
||||
- "enhancement"
|
||||
|
||||
only: issues
|
||||
onlyLabels: []
|
||||
exemptProjects: false
|
||||
exemptMilestones: false
|
||||
exemptAssignees: false
|
||||
|
||||
markComment: >
|
||||
[STALE_SET] This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed in 14 days if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
|
||||
unmarkComment: >
|
||||
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.
|
||||
|
||||
closeComment: >
|
||||
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
|
||||
Please ensure to specify the following:
|
||||
|
||||
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
|
||||
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.2 or STM32 v2.2.0)
|
||||
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.4 or STM32 v2.3.0)
|
||||
* Contextual information (e.g. what you were trying to achieve)
|
||||
* Simplest possible steps to reproduce
|
||||
* Anything that might be relevant in your opinion, such as:
|
||||
@@ -27,9 +27,9 @@ Please ensure to specify the following:
|
||||
|
||||
```
|
||||
Arduino IDE version: 1.8.19
|
||||
ESP32 Core Version 2.0.2
|
||||
ESP32 Core Version 2.0.4
|
||||
OS: Ubuntu 20.04 LTS
|
||||
Linux xy-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
|
||||
Linux xy-Inspiron-3593 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
|
||||
|
||||
Context:
|
||||
I encountered an endless loop while trying to connect to Local WiFi.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -237,7 +237,7 @@ in voltage and temperature. */
|
||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
/* Section 2: PHY configuration section */
|
||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||
/* KH, LAN8742A PHY Address*/
|
||||
/* LAN8742A PHY Address*/
|
||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
#endif
|
||||
////////////////////////////////
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ in voltage and temperature. */
|
||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
/* Section 2: PHY configuration section */
|
||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||
/* KH, LAN8742A PHY Address*/
|
||||
/* LAN8742A PHY Address*/
|
||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
#endif
|
||||
////////////////////////////////
|
||||
|
||||
+524
@@ -0,0 +1,524 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f4xx_hal_conf_default.h
|
||||
* @brief HAL default configuration file.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||
#define __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* ########################## Module Selection ############################## */
|
||||
/**
|
||||
* @brief Include the default list of modules to be used in the HAL driver
|
||||
* and manage module deactivation
|
||||
*/
|
||||
#include "stm32yyxx_hal_conf.h"
|
||||
#if 0
|
||||
/**
|
||||
* @brief This is the list of modules to be used in the HAL driver
|
||||
*/
|
||||
#define HAL_MODULE_ENABLED
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
#define HAL_CAN_MODULE_ENABLED
|
||||
/*#define HAL_CAN_LEGACY_MODULE_ENABLED*/
|
||||
#define HAL_CRC_MODULE_ENABLED
|
||||
#define HAL_CEC_MODULE_ENABLED
|
||||
#define HAL_CRYP_MODULE_ENABLED
|
||||
#define HAL_DAC_MODULE_ENABLED
|
||||
#define HAL_DCMI_MODULE_ENABLED
|
||||
#define HAL_DMA_MODULE_ENABLED
|
||||
#define HAL_DMA2D_MODULE_ENABLED
|
||||
#define HAL_ETH_MODULE_ENABLED
|
||||
/*#define HAL_ETH_LEGACY_MODULE_ENABLED*/
|
||||
#define HAL_FLASH_MODULE_ENABLED
|
||||
#define HAL_NAND_MODULE_ENABLED
|
||||
#define HAL_NOR_MODULE_ENABLED
|
||||
#define HAL_PCCARD_MODULE_ENABLED
|
||||
#define HAL_SRAM_MODULE_ENABLED
|
||||
#define HAL_SDRAM_MODULE_ENABLED
|
||||
#define HAL_HASH_MODULE_ENABLED
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED
|
||||
#define HAL_I2C_MODULE_ENABLED
|
||||
#define HAL_SMBUS_MODULE_ENABLED
|
||||
#define HAL_I2S_MODULE_ENABLED
|
||||
#define HAL_IWDG_MODULE_ENABLED
|
||||
#define HAL_LTDC_MODULE_ENABLED
|
||||
#define HAL_DSI_MODULE_ENABLED
|
||||
#define HAL_PWR_MODULE_ENABLED
|
||||
#define HAL_QSPI_MODULE_ENABLED
|
||||
#define HAL_RCC_MODULE_ENABLED
|
||||
#define HAL_RNG_MODULE_ENABLED
|
||||
#define HAL_RTC_MODULE_ENABLED
|
||||
#define HAL_SAI_MODULE_ENABLED
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
#define HAL_USART_MODULE_ENABLED
|
||||
#define HAL_IRDA_MODULE_ENABLED
|
||||
#define HAL_SMARTCARD_MODULE_ENABLED
|
||||
#define HAL_WWDG_MODULE_ENABLED
|
||||
#define HAL_CORTEX_MODULE_ENABLED
|
||||
#define HAL_PCD_MODULE_ENABLED
|
||||
#define HAL_HCD_MODULE_ENABLED
|
||||
#define HAL_FMPI2C_MODULE_ENABLED
|
||||
#define HAL_FMPSMBUS_MODULE_ENABLED
|
||||
#define HAL_SPDIFRX_MODULE_ENABLED
|
||||
#define HAL_DFSDM_MODULE_ENABLED
|
||||
#define HAL_LPTIM_MODULE_ENABLED
|
||||
#define HAL_MMC_MODULE_ENABLED
|
||||
#endif
|
||||
|
||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||
/**
|
||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSE is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSE_VALUE)
|
||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||
#endif /* HSE_VALUE */
|
||||
|
||||
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||
#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
|
||||
#endif /* HSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief Internal High Speed oscillator (HSI) value.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSI is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSI_VALUE)
|
||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
||||
#endif /* HSI_VALUE */
|
||||
|
||||
/**
|
||||
* @brief Internal Low Speed oscillator (LSI) value.
|
||||
*/
|
||||
#if !defined (LSI_VALUE)
|
||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||
The real value may vary depending on the variations
|
||||
in voltage and temperature. */
|
||||
/**
|
||||
* @brief External Low Speed oscillator (LSE) value.
|
||||
*/
|
||||
#if !defined (LSE_VALUE)
|
||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||
#endif /* LSE_VALUE */
|
||||
|
||||
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
|
||||
#endif /* LSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief External clock source for I2S peripheral
|
||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
||||
* frequency, this source is inserted directly through I2S_CKIN pad.
|
||||
*/
|
||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||
|
||||
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||
|
||||
/* ########################### System Configuration ######################### */
|
||||
/**
|
||||
* @brief This is the HAL system configuration section
|
||||
*/
|
||||
#if !defined (VDD_VALUE)
|
||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||
#endif
|
||||
#if !defined (TICK_INT_PRIORITY)
|
||||
#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */
|
||||
#endif
|
||||
#if !defined (USE_RTOS)
|
||||
#define USE_RTOS 0U
|
||||
#endif
|
||||
#if !defined (PREFETCH_ENABLE)
|
||||
#define PREFETCH_ENABLE 1U
|
||||
#endif
|
||||
#if !defined (INSTRUCTION_CACHE_ENABLE)
|
||||
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||
#endif
|
||||
#if !defined (DATA_CACHE_ENABLE)
|
||||
#define DATA_CACHE_ENABLE 1U
|
||||
#endif
|
||||
|
||||
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
|
||||
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
|
||||
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
|
||||
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
|
||||
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
|
||||
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
|
||||
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
|
||||
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
|
||||
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
|
||||
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
|
||||
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
|
||||
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
|
||||
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
|
||||
#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
|
||||
#define USE_HAL_FMPSMBUS_REGISTER_CALLBACKS 0U /* FMPSMBUS register callback disabled */
|
||||
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
|
||||
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
|
||||
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
|
||||
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
|
||||
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
|
||||
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
|
||||
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
|
||||
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
|
||||
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
|
||||
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
|
||||
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
|
||||
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
|
||||
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
|
||||
#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
|
||||
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
|
||||
#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
|
||||
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
|
||||
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
|
||||
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
|
||||
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
||||
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
|
||||
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
||||
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
||||
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
||||
|
||||
/* ########################## Assert Selection ############################## */
|
||||
/**
|
||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||
* HAL drivers code
|
||||
*/
|
||||
/* #define USE_FULL_ASSERT 1U */
|
||||
|
||||
/* ################## Ethernet peripheral configuration ##################### */
|
||||
|
||||
/* Section 1 : Ethernet peripheral configuration */
|
||||
|
||||
/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
|
||||
#define MAC_ADDR0 2U
|
||||
#define MAC_ADDR1 0U
|
||||
#define MAC_ADDR2 0U
|
||||
#define MAC_ADDR3 0U
|
||||
#define MAC_ADDR4 0U
|
||||
#define MAC_ADDR5 0U
|
||||
|
||||
/* Definition of the Ethernet driver buffers size and count */
|
||||
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
|
||||
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
|
||||
#define ETH_RXBUFNB (5U) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
|
||||
#define ETH_TXBUFNB (5U) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
|
||||
|
||||
/* Section 2: PHY configuration section */
|
||||
/* LAN8742A PHY Address*/
|
||||
////////////////////////////////
|
||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
/* Section 2: PHY configuration section */
|
||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||
/* KH, LAN8742A PHY Address*/
|
||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
#endif
|
||||
////////////////////////////////
|
||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||
#define PHY_RESET_DELAY 0x000000FFU
|
||||
/* PHY Configuration delay */
|
||||
#define PHY_CONFIG_DELAY 0x00000FFFU
|
||||
|
||||
#define PHY_READ_TO 0x0000FFFFU
|
||||
#define PHY_WRITE_TO 0x0000FFFFU
|
||||
|
||||
/* Section 3: Common PHY Registers */
|
||||
|
||||
#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
|
||||
#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
|
||||
|
||||
#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
|
||||
#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
|
||||
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
|
||||
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
|
||||
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
|
||||
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
|
||||
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
|
||||
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
|
||||
#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
|
||||
#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
|
||||
|
||||
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
|
||||
#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
|
||||
#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
|
||||
|
||||
/* Section 4: Extended PHY Registers */
|
||||
|
||||
#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
|
||||
|
||||
#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
|
||||
#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
|
||||
|
||||
|
||||
#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
|
||||
#define PHY_IMR ((uint16_t)0x1E) /*!< PHY Interrupt Mask register Offset */
|
||||
#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
|
||||
|
||||
/* ################## SPI peripheral configuration ########################## */
|
||||
|
||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||
* Activated: CRC code is present inside driver
|
||||
* Deactivated: CRC code cleaned from driver
|
||||
*/
|
||||
#if !defined (USE_SPI_CRC)
|
||||
#define USE_SPI_CRC 0U
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Include module's header file
|
||||
*/
|
||||
|
||||
#ifdef HAL_RCC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_rcc.h"
|
||||
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_gpio.h"
|
||||
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_exti.h"
|
||||
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dma.h"
|
||||
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_cortex.h"
|
||||
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ADC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_adc.h"
|
||||
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_can.h"
|
||||
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_can_legacy.h"
|
||||
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_crc.h"
|
||||
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRYP_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_cryp.h"
|
||||
#endif /* HAL_CRYP_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA2D_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dma2d.h"
|
||||
#endif /* HAL_DMA2D_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DAC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dac.h"
|
||||
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DCMI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dcmi.h"
|
||||
#endif /* HAL_DCMI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ETH_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_eth.h"
|
||||
#endif /* HAL_ETH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ETH_LEGACY_MODULE_ENABLED
|
||||
#include "Legacy/stm32f4xx_hal_eth_legacy.h"
|
||||
#endif /* HAL_ETH_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FLASH_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_flash.h"
|
||||
#endif /* HAL_FLASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sram.h"
|
||||
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NOR_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_nor.h"
|
||||
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NAND_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_nand.h"
|
||||
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCCARD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_pccard.h"
|
||||
#endif /* HAL_PCCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SDRAM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sdram.h"
|
||||
#endif /* HAL_SDRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HASH_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_hash.h"
|
||||
#endif /* HAL_HASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_i2c.h"
|
||||
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMBUS_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_smbus.h"
|
||||
#endif /* HAL_SMBUS_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2S_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_i2s.h"
|
||||
#endif /* HAL_I2S_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_iwdg.h"
|
||||
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_LTDC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_ltdc.h"
|
||||
#endif /* HAL_LTDC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PWR_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_pwr.h"
|
||||
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RNG_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_rng.h"
|
||||
#endif /* HAL_RNG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RTC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_rtc.h"
|
||||
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SAI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sai.h"
|
||||
#endif /* HAL_SAI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sd.h"
|
||||
#endif /* HAL_SD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_spi.h"
|
||||
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_tim.h"
|
||||
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_uart.h"
|
||||
#endif /* HAL_UART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_USART_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_usart.h"
|
||||
#endif /* HAL_USART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_irda.h"
|
||||
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_smartcard.h"
|
||||
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_wwdg.h"
|
||||
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_pcd.h"
|
||||
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HCD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_hcd.h"
|
||||
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DSI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dsi.h"
|
||||
#endif /* HAL_DSI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_QSPI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_qspi.h"
|
||||
#endif /* HAL_QSPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CEC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_cec.h"
|
||||
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FMPI2C_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_fmpi2c.h"
|
||||
#endif /* HAL_FMPI2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FMPSMBUS_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_fmpsmbus.h"
|
||||
#endif /* HAL_FMPSMBUS_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPDIFRX_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_spdifrx.h"
|
||||
#endif /* HAL_SPDIFRX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DFSDM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dfsdm.h"
|
||||
#endif /* HAL_DFSDM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_LPTIM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_lptim.h"
|
||||
#endif /* HAL_LPTIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MMC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_mmc.h"
|
||||
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr If expr is false, it calls assert_failed function
|
||||
* which reports the name of the source file and the source
|
||||
* line number of the call that failed.
|
||||
* If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t *file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0U)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F4xx_HAL_CONF_DEFAULT_H */
|
||||
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+507
@@ -0,0 +1,507 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f7xx_hal_conf_default.h
|
||||
* @brief HAL default configuration file.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||
#define __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* ########################## Module Selection ############################## */
|
||||
/**
|
||||
* @brief Include the default list of modules to be used in the HAL driver
|
||||
* and manage module deactivation
|
||||
*/
|
||||
#include "stm32yyxx_hal_conf.h"
|
||||
#if 0
|
||||
/**
|
||||
* @brief This is the list of modules to be used in the HAL driver
|
||||
*/
|
||||
#define HAL_MODULE_ENABLED
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
#define HAL_CAN_MODULE_ENABLED
|
||||
#define HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#define HAL_CEC_MODULE_ENABLED
|
||||
#define HAL_CRC_MODULE_ENABLED
|
||||
#define HAL_CRYP_MODULE_ENABLED
|
||||
#define HAL_DAC_MODULE_ENABLED
|
||||
#define HAL_DCMI_MODULE_ENABLED
|
||||
#define HAL_DMA_MODULE_ENABLED
|
||||
#define HAL_DMA2D_MODULE_ENABLED
|
||||
#define HAL_ETH_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED
|
||||
#define HAL_FLASH_MODULE_ENABLED
|
||||
#define HAL_NAND_MODULE_ENABLED
|
||||
#define HAL_NOR_MODULE_ENABLED
|
||||
#define HAL_SRAM_MODULE_ENABLED
|
||||
#define HAL_SDRAM_MODULE_ENABLED
|
||||
#define HAL_HASH_MODULE_ENABLED
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
#define HAL_I2C_MODULE_ENABLED
|
||||
#define HAL_I2S_MODULE_ENABLED
|
||||
#define HAL_IWDG_MODULE_ENABLED
|
||||
#define HAL_LPTIM_MODULE_ENABLED
|
||||
#define HAL_LTDC_MODULE_ENABLED
|
||||
#define HAL_PWR_MODULE_ENABLED
|
||||
#define HAL_QSPI_MODULE_ENABLED
|
||||
#define HAL_RCC_MODULE_ENABLED
|
||||
#define HAL_RNG_MODULE_ENABLED
|
||||
#define HAL_RTC_MODULE_ENABLED
|
||||
#define HAL_SAI_MODULE_ENABLED
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
#define HAL_SPDIFRX_MODULE_ENABLED
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
#define HAL_USART_MODULE_ENABLED
|
||||
#define HAL_IRDA_MODULE_ENABLED
|
||||
#define HAL_SMARTCARD_MODULE_ENABLED
|
||||
#define HAL_WWDG_MODULE_ENABLED
|
||||
#define HAL_CORTEX_MODULE_ENABLED
|
||||
#define HAL_PCD_MODULE_ENABLED
|
||||
#define HAL_HCD_MODULE_ENABLED
|
||||
#define HAL_DFSDM_MODULE_ENABLED
|
||||
#define HAL_DSI_MODULE_ENABLED
|
||||
#define HAL_JPEG_MODULE_ENABLED
|
||||
#define HAL_MDIOS_MODULE_ENABLED
|
||||
#define HAL_SMBUS_MODULE_ENABLED
|
||||
#define HAL_MMC_MODULE_ENABLED
|
||||
#endif
|
||||
|
||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||
/**
|
||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSE is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSE_VALUE)
|
||||
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||
#endif /* HSE_VALUE */
|
||||
|
||||
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||
#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
|
||||
#endif /* HSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief Internal High Speed oscillator (HSI) value.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSI is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSI_VALUE)
|
||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
||||
#endif /* HSI_VALUE */
|
||||
|
||||
/**
|
||||
* @brief Internal Low Speed oscillator (LSI) value.
|
||||
*/
|
||||
#if !defined (LSI_VALUE)
|
||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||
The real value may vary depending on the variations
|
||||
in voltage and temperature. */
|
||||
/**
|
||||
* @brief External Low Speed oscillator (LSE) value.
|
||||
*/
|
||||
#if !defined (LSE_VALUE)
|
||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||
#endif /* LSE_VALUE */
|
||||
|
||||
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
|
||||
#endif /* LSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief External clock source for I2S peripheral
|
||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
||||
* frequency, this source is inserted directly through I2S_CKIN pad.
|
||||
*/
|
||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||
|
||||
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||
|
||||
/* ########################### System Configuration ######################### */
|
||||
/**
|
||||
* @brief This is the HAL system configuration section
|
||||
*/
|
||||
#if !defined (VDD_VALUE)
|
||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||
#endif
|
||||
#if !defined (TICK_INT_PRIORITY)
|
||||
#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */
|
||||
#endif
|
||||
#if !defined (USE_RTOS)
|
||||
#define USE_RTOS 0U
|
||||
#endif
|
||||
#if !defined (PREFETCH_ENABLE)
|
||||
#define PREFETCH_ENABLE 1U /* To enable prefetch */
|
||||
#endif
|
||||
#if !defined (ART_ACCLERATOR_ENABLE)
|
||||
#define ART_ACCLERATOR_ENABLE 1U /* To enable ART Accelerator */
|
||||
#endif
|
||||
|
||||
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
|
||||
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
|
||||
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
|
||||
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
|
||||
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
|
||||
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
|
||||
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
|
||||
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
|
||||
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
|
||||
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
|
||||
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
|
||||
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
|
||||
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
|
||||
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
|
||||
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
|
||||
#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */
|
||||
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
|
||||
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
|
||||
#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIOS register callback disabled */
|
||||
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
|
||||
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
|
||||
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
|
||||
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
|
||||
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
|
||||
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
|
||||
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
|
||||
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
|
||||
#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
|
||||
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
|
||||
#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
|
||||
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
|
||||
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
|
||||
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
|
||||
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
||||
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
|
||||
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
||||
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
||||
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
||||
|
||||
/* ########################## Assert Selection ############################## */
|
||||
/**
|
||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||
* HAL drivers code
|
||||
*/
|
||||
/* #define USE_FULL_ASSERT 1 */
|
||||
|
||||
/* ################## Ethernet peripheral configuration ##################### */
|
||||
|
||||
/* Section 1 : Ethernet peripheral configuration */
|
||||
|
||||
/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
|
||||
#define MAC_ADDR0 2U
|
||||
#define MAC_ADDR1 0U
|
||||
#define MAC_ADDR2 0U
|
||||
#define MAC_ADDR3 0U
|
||||
#define MAC_ADDR4 0U
|
||||
#define MAC_ADDR5 0U
|
||||
|
||||
/* Definition of the Ethernet driver buffers size and count */
|
||||
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
|
||||
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
|
||||
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
|
||||
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
|
||||
|
||||
/* Section 2: PHY configuration section */
|
||||
/* LAN8742A PHY Address*/
|
||||
////////////////////////////////
|
||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
/* Section 2: PHY configuration section */
|
||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||
/* KH, LAN8742A PHY Address*/
|
||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||
#endif
|
||||
////////////////////////////////
|
||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||
#define PHY_RESET_DELAY 0x00000FFFU
|
||||
/* PHY Configuration delay */
|
||||
#define PHY_CONFIG_DELAY 0x00000FFFU
|
||||
|
||||
#define PHY_READ_TO 0x0000FFFFU
|
||||
#define PHY_WRITE_TO 0x0000FFFFU
|
||||
|
||||
/* Section 3: Common PHY Registers */
|
||||
|
||||
#define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */
|
||||
#define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */
|
||||
|
||||
#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */
|
||||
#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */
|
||||
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */
|
||||
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */
|
||||
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */
|
||||
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */
|
||||
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */
|
||||
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */
|
||||
#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */
|
||||
#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */
|
||||
|
||||
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */
|
||||
#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */
|
||||
#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */
|
||||
|
||||
/* Section 4: Extended PHY Registers */
|
||||
|
||||
#define PHY_SR ((uint16_t)0x1FU) /*!< PHY special control/ status register Offset */
|
||||
|
||||
#define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */
|
||||
#define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */
|
||||
|
||||
|
||||
#define PHY_ISFR ((uint16_t)0x01DU) /*!< PHY Interrupt Source Flag register Offset */
|
||||
#define PHY_IMR ((uint16_t)0x001E) /*!< PHY Interrupt Mask register Offset */
|
||||
#define PHY_ISFR_INT4 ((uint16_t)0x0010U) /*!< PHY Link down inturrupt */
|
||||
|
||||
/* ################## SPI peripheral configuration ########################## */
|
||||
|
||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||
* Activated: CRC code is present inside driver
|
||||
* Deactivated: CRC code cleaned from driver
|
||||
*/
|
||||
#if !defined (USE_SPI_CRC)
|
||||
#define USE_SPI_CRC 0U
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Include module's header file
|
||||
*/
|
||||
|
||||
#ifdef HAL_RCC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_rcc.h"
|
||||
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_gpio.h"
|
||||
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_dma.h"
|
||||
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_cortex.h"
|
||||
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ADC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_adc.h"
|
||||
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_can.h"
|
||||
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_can_legacy.h"
|
||||
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CEC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_cec.h"
|
||||
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_crc.h"
|
||||
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRYP_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_cryp.h"
|
||||
#endif /* HAL_CRYP_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA2D_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_dma2d.h"
|
||||
#endif /* HAL_DMA2D_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DAC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_dac.h"
|
||||
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DCMI_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_dcmi.h"
|
||||
#endif /* HAL_DCMI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ETH_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_eth.h"
|
||||
#endif /* HAL_ETH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_exti.h"
|
||||
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FLASH_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_flash.h"
|
||||
#endif /* HAL_FLASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_sram.h"
|
||||
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NOR_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_nor.h"
|
||||
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NAND_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_nand.h"
|
||||
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SDRAM_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_sdram.h"
|
||||
#endif /* HAL_SDRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HASH_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_hash.h"
|
||||
#endif /* HAL_HASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_i2c.h"
|
||||
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2S_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_i2s.h"
|
||||
#endif /* HAL_I2S_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_iwdg.h"
|
||||
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_LPTIM_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_lptim.h"
|
||||
#endif /* HAL_LPTIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_LTDC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_ltdc.h"
|
||||
#endif /* HAL_LTDC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PWR_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_pwr.h"
|
||||
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_QSPI_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_qspi.h"
|
||||
#endif /* HAL_QSPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RNG_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_rng.h"
|
||||
#endif /* HAL_RNG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RTC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_rtc.h"
|
||||
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SAI_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_sai.h"
|
||||
#endif /* HAL_SAI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SD_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_sd.h"
|
||||
#endif /* HAL_SD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPDIFRX_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_spdifrx.h"
|
||||
#endif /* HAL_SPDIFRX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_spi.h"
|
||||
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_tim.h"
|
||||
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_uart.h"
|
||||
#endif /* HAL_UART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_USART_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_usart.h"
|
||||
#endif /* HAL_USART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_irda.h"
|
||||
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_smartcard.h"
|
||||
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_wwdg.h"
|
||||
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_pcd.h"
|
||||
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HCD_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_hcd.h"
|
||||
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DFSDM_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_dfsdm.h"
|
||||
#endif /* HAL_DFSDM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DSI_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_dsi.h"
|
||||
#endif /* HAL_DSI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_JPEG_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_jpeg.h"
|
||||
#endif /* HAL_JPEG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MDIOS_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_mdios.h"
|
||||
#endif /* HAL_MDIOS_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMBUS_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_smbus.h"
|
||||
#endif /* HAL_SMBUS_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MMC_MODULE_ENABLED
|
||||
#include "stm32f7xx_hal_mmc.h"
|
||||
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr If expr is false, it calls assert_failed function
|
||||
* which reports the name of the source file and the source
|
||||
* line number of the call that failed.
|
||||
* If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t *file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0U)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F7xx_HAL_CONF_DEFAULT_H */
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2020-2021, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Pins
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#define PG9 0
|
||||
#define PG14 1
|
||||
#define PF15 2
|
||||
#define PE13 3
|
||||
#define PF14 4
|
||||
#define PE11 5
|
||||
#define PE9 6
|
||||
#define PF13 7
|
||||
#define PF12 8
|
||||
#define PD15 9
|
||||
#define PD14 10
|
||||
#define PA7 PIN_A10
|
||||
#define PA6 PIN_A11
|
||||
#define PA5 PIN_A12
|
||||
#define PB9 14
|
||||
#define PB8 15
|
||||
#define PC6 16
|
||||
#define PB15 17
|
||||
#define PB13 18
|
||||
#define PB12 19
|
||||
#define PA15 20
|
||||
#define PC7 21
|
||||
#define PB5 22
|
||||
#define PB3 23
|
||||
#define PA4 PIN_A13
|
||||
#define PB4 25
|
||||
#define PB6 26
|
||||
#define PB2 27
|
||||
#define PD13 28
|
||||
#define PD12 29
|
||||
#define PD11 30
|
||||
#define PE2 31
|
||||
#define PA0 PIN_A14
|
||||
#define PB0 PIN_A23 // LED_GREEN
|
||||
#define PE0 34
|
||||
#define PB11 35
|
||||
#define PB10 36
|
||||
#define PE15 37
|
||||
#define PE14 38
|
||||
#define PE12 39
|
||||
#define PE10 40
|
||||
#define PE7 41
|
||||
#define PE8 42
|
||||
#define PC8 43
|
||||
#define PC9 44
|
||||
#define PC10 45
|
||||
#define PC11 46
|
||||
#define PC12 47
|
||||
#define PD2 48
|
||||
#define PG2 49
|
||||
#define PG3 50
|
||||
#define PD7 51
|
||||
#define PD6 52
|
||||
#define PD5 53
|
||||
#define PD4 54
|
||||
#define PD3 55
|
||||
// 56 is PE2 (31)
|
||||
#define PE4 57
|
||||
#define PE5 58
|
||||
#define PE6 59
|
||||
#define PE3 60
|
||||
#define PF8 PIN_A15
|
||||
#define PF7 PIN_A16
|
||||
#define PF9 PIN_A17
|
||||
#define PG1 64
|
||||
#define PG0 65
|
||||
#define PD1 66
|
||||
#define PD0 67
|
||||
#define PF0 68
|
||||
#define PF1 69
|
||||
#define PF2 70
|
||||
// 71 is PA7 (11)
|
||||
// 72 is NC
|
||||
#define PB7 73 // LED_BLUE
|
||||
#define PB14 74 // LED_RED
|
||||
#define PC13 75 // USER_BTN
|
||||
#define PD9 76 // Serial Rx
|
||||
#define PD8 77 // Serial Tx
|
||||
#define PA3 PIN_A0
|
||||
#define PC0 PIN_A1
|
||||
#define PC3 PIN_A2
|
||||
#define PF3 PIN_A3
|
||||
#define PF5 PIN_A4
|
||||
#define PF10 PIN_A5
|
||||
#define PB1 PIN_A6
|
||||
#define PC2 PIN_A7
|
||||
#define PF4 PIN_A8
|
||||
#define PF6 PIN_A9
|
||||
// ST Morpho
|
||||
#define PA1 PIN_A18
|
||||
#define PA2 PIN_A19
|
||||
#define PA8 90
|
||||
#define PA9 91
|
||||
#define PA10 92
|
||||
#define PA11 93
|
||||
#define PA12 94
|
||||
#define PA13 95 // SWD
|
||||
#define PA14 96 // SWD
|
||||
#define PC1 PIN_A20
|
||||
#define PC4 PIN_A21
|
||||
#define PC5 PIN_A22
|
||||
#define PC14 100
|
||||
#define PC15 101
|
||||
#define PD10 102
|
||||
#define PE1 103
|
||||
#define PF11 104
|
||||
#define PG4 105
|
||||
#define PG5 106
|
||||
#define PG6 107
|
||||
#define PG7 108
|
||||
#define PG8 109
|
||||
#define PG10 110
|
||||
#define PG11 111
|
||||
#define PG12 112
|
||||
#define PG13 113
|
||||
#define PG15 114
|
||||
#define PH0 115 // MCO
|
||||
#define PH1 116
|
||||
|
||||
// Alternate pins number
|
||||
#define PA0_ALT1 (PA0 | ALT1)
|
||||
#define PA0_ALT2 (PA0 | ALT2)
|
||||
#define PA1_ALT1 (PA1 | ALT1)
|
||||
#define PA1_ALT2 (PA1 | ALT2)
|
||||
#define PA2_ALT1 (PA2 | ALT1)
|
||||
#define PA2_ALT2 (PA2 | ALT2)
|
||||
#define PA3_ALT1 (PA3 | ALT1)
|
||||
#define PA3_ALT2 (PA3 | ALT2)
|
||||
#define PA4_ALT1 (PA4 | ALT1)
|
||||
#define PA5_ALT1 (PA5 | ALT1)
|
||||
#define PA6_ALT1 (PA6 | ALT1)
|
||||
#define PA7_ALT1 (PA7 | ALT1)
|
||||
#define PA7_ALT2 (PA7 | ALT2)
|
||||
#define PA7_ALT3 (PA7 | ALT3)
|
||||
#define PA15_ALT1 (PA15 | ALT1)
|
||||
#define PB0_ALT1 (PB0 | ALT1)
|
||||
#define PB0_ALT2 (PB0 | ALT2)
|
||||
#define PB1_ALT1 (PB1 | ALT1)
|
||||
#define PB1_ALT2 (PB1 | ALT2)
|
||||
#define PB3_ALT1 (PB3 | ALT1)
|
||||
#define PB4_ALT1 (PB4 | ALT1)
|
||||
#define PB5_ALT1 (PB5 | ALT1)
|
||||
#define PB8_ALT1 (PB8 | ALT1)
|
||||
#define PB9_ALT1 (PB9 | ALT1)
|
||||
#define PB14_ALT1 (PB14 | ALT1)
|
||||
#define PB14_ALT2 (PB14 | ALT2)
|
||||
#define PB15_ALT1 (PB15 | ALT1)
|
||||
#define PB15_ALT2 (PB15 | ALT2)
|
||||
#define PC0_ALT1 (PC0 | ALT1)
|
||||
#define PC0_ALT2 (PC0 | ALT2)
|
||||
#define PC1_ALT1 (PC1 | ALT1)
|
||||
#define PC1_ALT2 (PC1 | ALT2)
|
||||
#define PC2_ALT1 (PC2 | ALT1)
|
||||
#define PC2_ALT2 (PC2 | ALT2)
|
||||
#define PC3_ALT1 (PC3 | ALT1)
|
||||
#define PC3_ALT2 (PC3 | ALT2)
|
||||
#define PC4_ALT1 (PC4 | ALT1)
|
||||
#define PC5_ALT1 (PC5 | ALT1)
|
||||
#define PC6_ALT1 (PC6 | ALT1)
|
||||
#define PC7_ALT1 (PC7 | ALT1)
|
||||
#define PC8_ALT1 (PC8 | ALT1)
|
||||
#define PC9_ALT1 (PC9 | ALT1)
|
||||
#define PC10_ALT1 (PC10 | ALT1)
|
||||
#define PC11_ALT1 (PC11 | ALT1)
|
||||
|
||||
// This must be a literal
|
||||
#define NUM_DIGITAL_PINS 117
|
||||
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
|
||||
#define NUM_ANALOG_INPUTS 24
|
||||
|
||||
// On-board LED pin number
|
||||
#ifndef LED_BUILTIN
|
||||
#define LED_BUILTIN PB0
|
||||
#endif
|
||||
#define LED_GREEN LED_BUILTIN
|
||||
#define LED_BLUE PB7
|
||||
#define LED_RED PB14
|
||||
|
||||
// On-board user button
|
||||
#ifndef USER_BTN
|
||||
#define USER_BTN PC13
|
||||
#endif
|
||||
|
||||
// Timer Definitions
|
||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||
#ifndef TIMER_TONE
|
||||
#define TIMER_TONE TIM6
|
||||
#endif
|
||||
#ifndef TIMER_SERVO
|
||||
#define TIMER_SERVO TIM7
|
||||
#endif
|
||||
|
||||
// UART Definitions
|
||||
#ifndef SERIAL_UART_INSTANCE
|
||||
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
||||
#endif
|
||||
// Serial pin used for console (ex: stlink)
|
||||
// Rerquired by Firmata
|
||||
#ifndef PIN_SERIAL_RX
|
||||
#define PIN_SERIAL_RX PD9
|
||||
#endif
|
||||
#ifndef PIN_SERIAL_TX
|
||||
#define PIN_SERIAL_TX PD8
|
||||
#endif
|
||||
|
||||
// Value of the External oscillator in Hz
|
||||
#define HSE_VALUE 8000000U
|
||||
|
||||
/* Extra HAL modules */
|
||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||
#define HAL_DAC_MODULE_ENABLED
|
||||
#endif
|
||||
#if !defined(HAL_ETH_MODULE_DISABLED)
|
||||
#define HAL_ETH_MODULE_ENABLED
|
||||
#endif
|
||||
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
||||
#define HAL_QSPI_MODULE_ENABLED
|
||||
#endif
|
||||
#if !defined(HAL_SD_MODULE_DISABLED)
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
#endif
|
||||
|
||||
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
||||
// By default 2MB single bank
|
||||
#define FLASH_BASE_ADDRESS 0x081C0000
|
||||
#define FLASH_DATA_SECTOR 11
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#ifndef SERIAL_PORT_MONITOR
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#endif
|
||||
#ifndef SERIAL_PORT_HARDWARE
|
||||
// KH mod to add Serial1, for ESP-AT
|
||||
//#define SERIAL_PORT_HARDWARE Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial1
|
||||
#endif
|
||||
#endif
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2020-2021, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* STM32 pins number
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define PA0 PIN_A0
|
||||
#define PA1 PIN_A1
|
||||
#define PA2 PIN_A2
|
||||
#define PA3 PIN_A3
|
||||
#define PA4 PIN_A4
|
||||
#define PA5 PIN_A5
|
||||
#define PA6 PIN_A6
|
||||
#define PA7 PIN_A7
|
||||
#define PA8 8
|
||||
#define PA9 9
|
||||
#define PA10 10
|
||||
#define PA11 11
|
||||
#define PA12 12
|
||||
#define PA13 13
|
||||
#define PA14 14
|
||||
#define PA15 15
|
||||
#define PB0 PIN_A8
|
||||
#define PB1 PIN_A9
|
||||
#define PB2 18
|
||||
#define PB3 19
|
||||
#define PB4 20
|
||||
#define PB5 21
|
||||
#define PB6 22
|
||||
#define PB7 23
|
||||
#define PB8 24
|
||||
#define PB9 25
|
||||
#define PB10 26
|
||||
#define PB11 27
|
||||
#define PB12 28
|
||||
#define PB13 29
|
||||
#define PB14 30
|
||||
#define PB15 31
|
||||
#define PC0 PIN_A10
|
||||
#define PC1 PIN_A11
|
||||
#define PC2 PIN_A12
|
||||
#define PC4 PIN_A13
|
||||
#define PC5 PIN_A14
|
||||
#define PC6 37
|
||||
#define PC7 38
|
||||
#define PC8 39
|
||||
#define PC9 40
|
||||
#define PC10 41
|
||||
#define PC11 42
|
||||
#define PC12 43
|
||||
#define PC13 44
|
||||
#define PC14 45
|
||||
#define PC15 46
|
||||
#define PD2 47
|
||||
#define PH0 48
|
||||
#define PH1 49
|
||||
|
||||
// Alternate pins number
|
||||
#define PA2_ALT1 (PA2 | ALT1)
|
||||
#define PA3_ALT1 (PA3 | ALT1)
|
||||
|
||||
#define NUM_DIGITAL_PINS 50
|
||||
#define NUM_ANALOG_INPUTS 15
|
||||
|
||||
// On-board LED pin number
|
||||
#ifndef LED_BUILTIN
|
||||
#define LED_BUILTIN PNUM_NOT_DEFINED
|
||||
#endif
|
||||
|
||||
// On-board user button
|
||||
#ifndef USER_BTN
|
||||
#define USER_BTN PNUM_NOT_DEFINED
|
||||
#endif
|
||||
|
||||
// SPI definitions
|
||||
#ifndef PIN_SPI_SS
|
||||
#define PIN_SPI_SS PA4
|
||||
#endif
|
||||
#ifndef PIN_SPI_SS1
|
||||
#define PIN_SPI_SS1 PA15
|
||||
#endif
|
||||
#ifndef PIN_SPI_SS2
|
||||
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
||||
#endif
|
||||
#ifndef PIN_SPI_SS3
|
||||
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
||||
#endif
|
||||
#ifndef PIN_SPI_MOSI
|
||||
#define PIN_SPI_MOSI PA7
|
||||
#endif
|
||||
#ifndef PIN_SPI_MISO
|
||||
#define PIN_SPI_MISO PA6
|
||||
#endif
|
||||
#ifndef PIN_SPI_SCK
|
||||
#define PIN_SPI_SCK PA5
|
||||
#endif
|
||||
|
||||
// I2C definitions
|
||||
#ifndef PIN_WIRE_SDA
|
||||
#define PIN_WIRE_SDA PB7
|
||||
#endif
|
||||
#ifndef PIN_WIRE_SCL
|
||||
#define PIN_WIRE_SCL PB6
|
||||
#endif
|
||||
|
||||
// Timer Definitions
|
||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||
#ifndef TIMER_TONE
|
||||
#define TIMER_TONE TIM6
|
||||
#endif
|
||||
#ifndef TIMER_SERVO
|
||||
#define TIMER_SERVO TIM21
|
||||
#endif
|
||||
|
||||
// UART Definitions
|
||||
#ifndef SERIAL_UART_INSTANCE
|
||||
#define SERIAL_UART_INSTANCE 2
|
||||
#endif
|
||||
|
||||
// Default pin used for generic 'Serial' instance
|
||||
// Mandatory for Firmata
|
||||
#ifndef PIN_SERIAL_RX
|
||||
#define PIN_SERIAL_RX PA3
|
||||
#endif
|
||||
#ifndef PIN_SERIAL_TX
|
||||
#define PIN_SERIAL_TX PA2
|
||||
#endif
|
||||
|
||||
// Extra HAL modules
|
||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||
#define HAL_DAC_MODULE_ENABLED
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#ifndef SERIAL_PORT_MONITOR
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#endif
|
||||
#ifndef SERIAL_PORT_HARDWARE
|
||||
// KH mod to add Serial1, for ESP-AT
|
||||
//#define SERIAL_PORT_HARDWARE Serial
|
||||
#define SERIAL_PORT_HARDWARE Serial1
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
menu.split=Flash split
|
||||
Seeed_XIAO_RP2040.name=SEEED XIAO RP2040
|
||||
Seeed_XIAO_RP2040.build.core=arduino
|
||||
Seeed_XIAO_RP2040.build.crossprefix=arm-none-eabi-
|
||||
Seeed_XIAO_RP2040.build.compiler_path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
|
||||
|
||||
# KH fix for Linux case-sensitive path
|
||||
#Seeed_XIAO_RP2040.build.variant=SEEED_XIAO_RP2040
|
||||
Seeed_XIAO_RP2040.build.variant=Seeed_XIAO_RP2040
|
||||
######
|
||||
|
||||
Seeed_XIAO_RP2040.build.mcu=cortex-m0plus
|
||||
Seeed_XIAO_RP2040.build.extra_flags=
|
||||
Seeed_XIAO_RP2040.build.fpu=
|
||||
Seeed_XIAO_RP2040.build.float-abi=
|
||||
Seeed_XIAO_RP2040.build.architecture=cortex-m0plus
|
||||
Seeed_XIAO_RP2040.build.board=SEEED_XIAO_RP2040
|
||||
Seeed_XIAO_RP2040.build.ldscript=linker_script.ld
|
||||
Seeed_XIAO_RP2040.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
|
||||
Seeed_XIAO_RP2040.compiler.mbed.defines={build.variant.path}/defines.txt
|
||||
Seeed_XIAO_RP2040.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
|
||||
Seeed_XIAO_RP2040.compiler.mbed.cflags={build.variant.path}/cflags.txt
|
||||
Seeed_XIAO_RP2040.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
|
||||
Seeed_XIAO_RP2040.compiler.mbed.includes={build.variant.path}/includes.txt
|
||||
Seeed_XIAO_RP2040.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
|
||||
Seeed_XIAO_RP2040.compiler.mbed="{build.variant.path}/libs/libmbed.a"
|
||||
Seeed_XIAO_RP2040.vid.0=0x2886
|
||||
Seeed_XIAO_RP2040.pid.0=0x8042
|
||||
Seeed_XIAO_RP2040.upload_port.0.vid=0x2886
|
||||
Seeed_XIAO_RP2040.upload_port.0.pid=0x8042
|
||||
Seeed_XIAO_RP2040.upload.tool=picotool
|
||||
Seeed_XIAO_RP2040.upload.tool.default=picotool
|
||||
Seeed_XIAO_RP2040.upload.protocol=
|
||||
Seeed_XIAO_RP2040.upload.transport=
|
||||
Seeed_XIAO_RP2040.upload.use_1200bps_touch=true
|
||||
Seeed_XIAO_RP2040.upload.wait_for_upload_port=false
|
||||
Seeed_XIAO_RP2040.upload.native_usb=true
|
||||
Seeed_XIAO_RP2040.upload.maximum_size=16777216
|
||||
Seeed_XIAO_RP2040.upload.maximum_data_size=270336
|
||||
Seeed_XIAO_RP2040.bootloader.tool=openocd
|
||||
Seeed_XIAO_RP2040.bootloader.tool.default=openocd
|
||||
Seeed_XIAO_RP2040.bootloader.config=-f target/rp2040.cfg
|
||||
Seeed_XIAO_RP2040.bootloader.programmer=-f interface/cmsis-dap.cfg
|
||||
|
||||
##############################################################
|
||||
|
||||
menu.split=Flash split
|
||||
WIO_RP2040_MINI_DEV_BOARD.name=Wio RP2040 Mini Dev Board
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.core=arduino
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.crossprefix=arm-none-eabi-
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.compiler_path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.variant=WIO_RP2040_MINI_DEV_BOARD
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.mcu=cortex-m0plus
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.extra_flags=
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.fpu=
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.float-abi=
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.architecture=cortex-m0plus
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.board=WIO_RP2040_MINI_DEV_BOARD
|
||||
WIO_RP2040_MINI_DEV_BOARD.build.ldscript=linker_script.ld
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.arch.define=-DARDUINO_ARCH_RP2040
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.defines={build.variant.path}/defines.txt
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.ldflags={build.variant.path}/ldflags.txt
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.cflags={build.variant.path}/cflags.txt
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.cxxflags={build.variant.path}/cxxflags.txt
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.includes={build.variant.path}/includes.txt
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
|
||||
WIO_RP2040_MINI_DEV_BOARD.compiler.mbed="{build.variant.path}/libs/libmbed.a"
|
||||
WIO_RP2040_MINI_DEV_BOARD.vid.0=0x2886
|
||||
WIO_RP2040_MINI_DEV_BOARD.pid.0=0x8043
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload_port.0.vid=0x2886
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload_port.0.pid=0x8043
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.tool=picotool
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.tool.default=picotool
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.protocol=
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.transport=
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.use_1200bps_touch=true
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.wait_for_upload_port=false
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.native_usb=true
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.maximum_size=16777216
|
||||
WIO_RP2040_MINI_DEV_BOARD.upload.maximum_data_size=270336
|
||||
WIO_RP2040_MINI_DEV_BOARD.bootloader.tool=openocd
|
||||
WIO_RP2040_MINI_DEV_BOARD.bootloader.tool.default=openocd
|
||||
WIO_RP2040_MINI_DEV_BOARD.bootloader.config=-f target/rp2040.cfg
|
||||
WIO_RP2040_MINI_DEV_BOARD.bootloader.programmer=-f interface/cmsis-dap.cfg
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
#pragma once
|
||||
#include <macros.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __PINS_ARDUINO__
|
||||
#define __PINS_ARDUINO__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" unsigned int PINCOUNT_fn();
|
||||
#endif
|
||||
|
||||
// Pin count
|
||||
// ----
|
||||
#define PINS_COUNT (PINCOUNT_fn())
|
||||
#define NUM_DIGITAL_PINS (30u)
|
||||
#define NUM_ANALOG_INPUTS (4u)
|
||||
#define NUM_ANALOG_OUTPUTS (0u)
|
||||
|
||||
extern PinName digitalPinToPinName(pin_size_t P);
|
||||
|
||||
// LEDs
|
||||
// ----
|
||||
#define PIN_LED (25u)
|
||||
#define LED_BUILTIN PIN_LED
|
||||
|
||||
// Digital pins
|
||||
// ----
|
||||
#define PIN_D0 (26u)
|
||||
#define PIN_D1 (27u)
|
||||
#define PIN_D2 (28u)
|
||||
#define PIN_D3 (29u)
|
||||
#define PIN_D4 (6u)
|
||||
#define PIN_D5 (7u)
|
||||
#define PIN_D6 (0u)
|
||||
#define PIN_D7 (1u)
|
||||
#define PIN_D8 (2u)
|
||||
#define PIN_D9 (4u)
|
||||
#define PIN_D10 (3u)
|
||||
|
||||
static const uint8_t D0 = PIN_D0;
|
||||
static const uint8_t D1 = PIN_D1;
|
||||
static const uint8_t D2 = PIN_D2;
|
||||
static const uint8_t D3 = PIN_D3;
|
||||
static const uint8_t D4 = PIN_D4;
|
||||
static const uint8_t D5 = PIN_D5;
|
||||
static const uint8_t D6 = PIN_D6;
|
||||
static const uint8_t D7 = PIN_D7;
|
||||
static const uint8_t D8 = PIN_D8;
|
||||
static const uint8_t D9 = PIN_D9;
|
||||
static const uint8_t D10 = PIN_D10;
|
||||
|
||||
|
||||
// Analog pins
|
||||
// -----------
|
||||
#define PIN_A0 (26u)
|
||||
#define PIN_A1 (27u)
|
||||
#define PIN_A2 (28u)
|
||||
#define PIN_A3 (29u)
|
||||
|
||||
static const uint8_t A0 = PIN_A0;
|
||||
static const uint8_t A1 = PIN_A1;
|
||||
static const uint8_t A2 = PIN_A2;
|
||||
static const uint8_t A3 = PIN_A3;
|
||||
|
||||
#define ADC_RESOLUTION 12
|
||||
|
||||
// Serial
|
||||
#define PIN_SERIAL_TX (0ul)
|
||||
#define PIN_SERIAL_RX (1ul)
|
||||
|
||||
// SPI
|
||||
//#define PIN_SPI_MISO (16u)
|
||||
//#define PIN_SPI_MOSI (19u)
|
||||
//#define PIN_SPI_SCK (18u)
|
||||
//#define PIN_SPI_SS (17u)
|
||||
// KH fix wrong pin
|
||||
#define PIN_SPI_MISO (D9)
|
||||
#define PIN_SPI_MOSI (D10)
|
||||
#define PIN_SPI_SCK (D8)
|
||||
#define PIN_SPI_SS (D7)
|
||||
//////
|
||||
|
||||
static const uint8_t SS = PIN_SPI_SS; // SPI Slave SS not used. Set here only for reference.
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI;
|
||||
static const uint8_t MISO = PIN_SPI_MISO;
|
||||
static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
// Wire
|
||||
#define SDA (6u)
|
||||
#define SCL (7u)
|
||||
|
||||
#define SERIAL_HOWMANY 1
|
||||
#define SERIAL1_TX (digitalPinToPinName(PIN_SERIAL_TX))
|
||||
#define SERIAL1_RX (digitalPinToPinName(PIN_SERIAL_RX))
|
||||
|
||||
#define SERIAL_CDC 1
|
||||
#define HAS_UNIQUE_ISERIAL_DESCRIPTOR
|
||||
#define BOARD_VENDORID 0x2886
|
||||
#define BOARD_PRODUCTID 0x8042
|
||||
#define BOARD_NAME "RaspberryPi Pico"
|
||||
|
||||
uint8_t getUniqueSerialNumber(uint8_t* name);
|
||||
void _ontouch1200bps_();
|
||||
|
||||
#define SPI_HOWMANY (1)
|
||||
#define SPI_MISO (digitalPinToPinName(PIN_SPI_MISO))
|
||||
#define SPI_MOSI (digitalPinToPinName(PIN_SPI_MOSI))
|
||||
#define SPI_SCK (digitalPinToPinName(PIN_SPI_SCK))
|
||||
|
||||
#define WIRE_HOWMANY (1)
|
||||
#define I2C_SDA (digitalPinToPinName(SDA))
|
||||
#define I2C_SCL (digitalPinToPinName(SCL))
|
||||
|
||||
#define digitalPinToPort(P) (digitalPinToPinName(P)/32)
|
||||
|
||||
#define SERIAL_PORT_USBVIRTUAL SerialUSB
|
||||
#define SERIAL_PORT_MONITOR SerialUSB
|
||||
#define SERIAL_PORT_HARDWARE Serial1
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
||||
|
||||
#define USB_MAX_POWER (500)
|
||||
|
||||
#endif //__PINS_ARDUINO__
|
||||
@@ -645,3 +645,72 @@ ninab112.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
ninab112.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
ninab112.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
ninab112.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
##################################################################
|
||||
## KH Add SparkFun Pro nRF52840 Mini
|
||||
##################################################################
|
||||
#**********************************************
|
||||
# SparkFun Pro nRF52840 Mini
|
||||
#**********************************************
|
||||
sparkfunnrf52840mini.name=SparkFun Pro nRF52840 Mini
|
||||
|
||||
# DFU Mode with CDC only
|
||||
sparkfunnrf52840mini.vid.0=0x1B4F
|
||||
sparkfunnrf52840mini.pid.0=0x002A
|
||||
|
||||
# DFU Mode with CDC + MSC (UF2)
|
||||
sparkfunnrf52840mini.vid.1=0x1B4F
|
||||
sparkfunnrf52840mini.pid.1=0x0029
|
||||
|
||||
# Application with CDC + MSC
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x8029
|
||||
|
||||
# CircuitPython
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x802A
|
||||
|
||||
sparkfunnrf52840mini.bootloader.tool=bootburn
|
||||
|
||||
# Upload
|
||||
sparkfunnrf52840mini.upload.tool=nrfutil
|
||||
sparkfunnrf52840mini.upload.protocol=nrfutil
|
||||
sparkfunnrf52840mini.upload.use_1200bps_touch=true
|
||||
sparkfunnrf52840mini.upload.wait_for_upload_port=true
|
||||
#sparkfunnrf52840mini.upload.native_usb=true
|
||||
|
||||
# Build
|
||||
sparkfunnrf52840mini.build.mcu=cortex-m4
|
||||
sparkfunnrf52840mini.build.f_cpu=64000000
|
||||
sparkfunnrf52840mini.build.board=NRF52840_FEATHER
|
||||
sparkfunnrf52840mini.build.core=nRF5
|
||||
sparkfunnrf52840mini.build.variant=sparkfun_nrf52840_mini
|
||||
sparkfunnrf52840mini.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
|
||||
sparkfunnrf52840mini.build.vid=0x1B4F
|
||||
sparkfunnrf52840mini.build.pid=0x5284
|
||||
sparkfunnrf52840mini.build.usb_manufacturer="SparkFun"
|
||||
sparkfunnrf52840mini.build.usb_product="nRF52840 Mini Breakout"
|
||||
|
||||
# SofDevice Menu
|
||||
# Ram & ROM size varies depending on SoftDevice (check linker script)
|
||||
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6=s140 6.1.1 r0
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_flags=-DS140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_name=s140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_version=6.1.1
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_fwid=0x00B6
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.ldscript=nrf52840_s140_v6.ld
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_size=815104
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_data_size=248832
|
||||
|
||||
# Debug Menu
|
||||
sparkfunnrf52840mini.menu.debug.l0=Level 0 (Release)
|
||||
sparkfunnrf52840mini.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l1=Level 1 (Error Message)
|
||||
sparkfunnrf52840mini.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l2=Level 2 (Full Debug)
|
||||
sparkfunnrf52840mini.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
sparkfunnrf52840mini.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -Os
|
||||
|
||||
##################################################################
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
#include "nrf.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] =
|
||||
{
|
||||
// P0
|
||||
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ,
|
||||
8 , 9 , 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39,
|
||||
40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55,
|
||||
56, 57, 58, 59, 60, 61, 62, 63
|
||||
};
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_SPARKFUN52840MINI_
|
||||
#define _VARIANT_SPARKFUN52840MINI_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (64)
|
||||
#define NUM_DIGITAL_PINS (64)
|
||||
#define NUM_ANALOG_INPUTS (8)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (7)
|
||||
#define PIN_LED2 (14)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_RED PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
// Buttons
|
||||
/*
|
||||
#define PIN_BUTTON1 (2)
|
||||
#define PIN_BUTTON2 (3)
|
||||
#define PIN_BUTTON3 (4)
|
||||
#define PIN_BUTTON4 (5)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (2)
|
||||
#define PIN_A1 (3)
|
||||
#define PIN_A2 (4)
|
||||
#define PIN_A3 (5)
|
||||
#define PIN_A4 (28)
|
||||
#define PIN_A5 (29)
|
||||
#define PIN_A6 (30)
|
||||
#define PIN_A7 (31)
|
||||
|
||||
static const uint8_t A0 = PIN_A0 ;
|
||||
static const uint8_t A1 = PIN_A1 ;
|
||||
static const uint8_t A2 = PIN_A2 ;
|
||||
static const uint8_t A3 = PIN_A3 ;
|
||||
static const uint8_t A4 = PIN_A4 ;
|
||||
static const uint8_t A5 = PIN_A5 ;
|
||||
static const uint8_t A6 = PIN_A6 ;
|
||||
static const uint8_t A7 = PIN_A7 ;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (2)
|
||||
#define PIN_DFU (13)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
// Serial
|
||||
//Previous Hardware UART definition for nRF52 Arduino Core, below 0.16.0
|
||||
//Feel free to comment out these two lines below if there are conflicts with latest release
|
||||
#define PIN_SERIAL_RX (15)
|
||||
#define PIN_SERIAL_TX (17)
|
||||
|
||||
//Hardware UART definition for nRF52 Arduino Core, 0.17.0 and above
|
||||
#define PIN_SERIAL1_RX (15)
|
||||
#define PIN_SERIAL1_TX (17)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (31)
|
||||
#define PIN_SPI_MOSI (3)
|
||||
#define PIN_SPI_SCK (30)
|
||||
|
||||
static const uint8_t SS = 2 ;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI ;
|
||||
static const uint8_t MISO = PIN_SPI_MISO ;
|
||||
static const uint8_t SCK = PIN_SPI_SCK ;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (8)
|
||||
#define PIN_WIRE_SCL (11)
|
||||
|
||||
/*
|
||||
* QSPI interface for external flash
|
||||
*/
|
||||
#define PIN_QSPI_SCK 32
|
||||
#define PIN_QSPI_CS 33
|
||||
#define PIN_QSPI_DATA0 34
|
||||
#define PIN_QSPI_DATA1 35
|
||||
#define PIN_QSPI_DATA2 36
|
||||
#define PIN_QSPI_DATA3 37
|
||||
|
||||
// On-board QSPI Flash
|
||||
// If EXTERNAL_FLASH_DEVICES is not defined, all supported devices will be used
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -645,3 +645,72 @@ ninab112.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
ninab112.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
ninab112.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
ninab112.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
##################################################################
|
||||
## KH Add SparkFun Pro nRF52840 Mini
|
||||
##################################################################
|
||||
#**********************************************
|
||||
# SparkFun Pro nRF52840 Mini
|
||||
#**********************************************
|
||||
sparkfunnrf52840mini.name=SparkFun Pro nRF52840 Mini
|
||||
|
||||
# DFU Mode with CDC only
|
||||
sparkfunnrf52840mini.vid.0=0x1B4F
|
||||
sparkfunnrf52840mini.pid.0=0x002A
|
||||
|
||||
# DFU Mode with CDC + MSC (UF2)
|
||||
sparkfunnrf52840mini.vid.1=0x1B4F
|
||||
sparkfunnrf52840mini.pid.1=0x0029
|
||||
|
||||
# Application with CDC + MSC
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x8029
|
||||
|
||||
# CircuitPython
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x802A
|
||||
|
||||
sparkfunnrf52840mini.bootloader.tool=bootburn
|
||||
|
||||
# Upload
|
||||
sparkfunnrf52840mini.upload.tool=nrfutil
|
||||
sparkfunnrf52840mini.upload.protocol=nrfutil
|
||||
sparkfunnrf52840mini.upload.use_1200bps_touch=true
|
||||
sparkfunnrf52840mini.upload.wait_for_upload_port=true
|
||||
#sparkfunnrf52840mini.upload.native_usb=true
|
||||
|
||||
# Build
|
||||
sparkfunnrf52840mini.build.mcu=cortex-m4
|
||||
sparkfunnrf52840mini.build.f_cpu=64000000
|
||||
sparkfunnrf52840mini.build.board=NRF52840_FEATHER
|
||||
sparkfunnrf52840mini.build.core=nRF5
|
||||
sparkfunnrf52840mini.build.variant=sparkfun_nrf52840_mini
|
||||
sparkfunnrf52840mini.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
|
||||
sparkfunnrf52840mini.build.vid=0x1B4F
|
||||
sparkfunnrf52840mini.build.pid=0x5284
|
||||
sparkfunnrf52840mini.build.usb_manufacturer="SparkFun"
|
||||
sparkfunnrf52840mini.build.usb_product="nRF52840 Mini Breakout"
|
||||
|
||||
# SofDevice Menu
|
||||
# Ram & ROM size varies depending on SoftDevice (check linker script)
|
||||
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6=s140 6.1.1 r0
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_flags=-DS140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_name=s140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_version=6.1.1
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_fwid=0x00B6
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.ldscript=nrf52840_s140_v6.ld
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_size=815104
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_data_size=248832
|
||||
|
||||
# Debug Menu
|
||||
sparkfunnrf52840mini.menu.debug.l0=Level 0 (Release)
|
||||
sparkfunnrf52840mini.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l1=Level 1 (Error Message)
|
||||
sparkfunnrf52840mini.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l2=Level 2 (Full Debug)
|
||||
sparkfunnrf52840mini.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
sparkfunnrf52840mini.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -Os
|
||||
|
||||
##################################################################
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
#include "nrf.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] =
|
||||
{
|
||||
// P0
|
||||
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ,
|
||||
8 , 9 , 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39,
|
||||
40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55,
|
||||
56, 57, 58, 59, 60, 61, 62, 63
|
||||
};
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_SPARKFUN52840MINI_
|
||||
#define _VARIANT_SPARKFUN52840MINI_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (64)
|
||||
#define NUM_DIGITAL_PINS (64)
|
||||
#define NUM_ANALOG_INPUTS (8)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (7)
|
||||
#define PIN_LED2 (14)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_RED PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
// Buttons
|
||||
/*
|
||||
#define PIN_BUTTON1 (2)
|
||||
#define PIN_BUTTON2 (3)
|
||||
#define PIN_BUTTON3 (4)
|
||||
#define PIN_BUTTON4 (5)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (2)
|
||||
#define PIN_A1 (3)
|
||||
#define PIN_A2 (4)
|
||||
#define PIN_A3 (5)
|
||||
#define PIN_A4 (28)
|
||||
#define PIN_A5 (29)
|
||||
#define PIN_A6 (30)
|
||||
#define PIN_A7 (31)
|
||||
|
||||
static const uint8_t A0 = PIN_A0 ;
|
||||
static const uint8_t A1 = PIN_A1 ;
|
||||
static const uint8_t A2 = PIN_A2 ;
|
||||
static const uint8_t A3 = PIN_A3 ;
|
||||
static const uint8_t A4 = PIN_A4 ;
|
||||
static const uint8_t A5 = PIN_A5 ;
|
||||
static const uint8_t A6 = PIN_A6 ;
|
||||
static const uint8_t A7 = PIN_A7 ;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (2)
|
||||
#define PIN_DFU (13)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
// Serial
|
||||
//Previous Hardware UART definition for nRF52 Arduino Core, below 0.16.0
|
||||
//Feel free to comment out these two lines below if there are conflicts with latest release
|
||||
#define PIN_SERIAL_RX (15)
|
||||
#define PIN_SERIAL_TX (17)
|
||||
|
||||
//Hardware UART definition for nRF52 Arduino Core, 0.17.0 and above
|
||||
#define PIN_SERIAL1_RX (15)
|
||||
#define PIN_SERIAL1_TX (17)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (31)
|
||||
#define PIN_SPI_MOSI (3)
|
||||
#define PIN_SPI_SCK (30)
|
||||
|
||||
static const uint8_t SS = 2 ;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI ;
|
||||
static const uint8_t MISO = PIN_SPI_MISO ;
|
||||
static const uint8_t SCK = PIN_SPI_SCK ;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (8)
|
||||
#define PIN_WIRE_SCL (11)
|
||||
|
||||
/*
|
||||
* QSPI interface for external flash
|
||||
*/
|
||||
#define PIN_QSPI_SCK 32
|
||||
#define PIN_QSPI_CS 33
|
||||
#define PIN_QSPI_DATA0 34
|
||||
#define PIN_QSPI_DATA1 35
|
||||
#define PIN_QSPI_DATA2 36
|
||||
#define PIN_QSPI_DATA3 37
|
||||
|
||||
// On-board QSPI Flash
|
||||
// If EXTERNAL_FLASH_DEVICES is not defined, all supported devices will be used
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -763,3 +763,72 @@ ninab112.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
ninab112.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
ninab112.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
ninab112.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
##################################################################
|
||||
## KH Add SparkFun Pro nRF52840 Mini
|
||||
##################################################################
|
||||
#**********************************************
|
||||
# SparkFun Pro nRF52840 Mini
|
||||
#**********************************************
|
||||
sparkfunnrf52840mini.name=SparkFun Pro nRF52840 Mini
|
||||
|
||||
# DFU Mode with CDC only
|
||||
sparkfunnrf52840mini.vid.0=0x1B4F
|
||||
sparkfunnrf52840mini.pid.0=0x002A
|
||||
|
||||
# DFU Mode with CDC + MSC (UF2)
|
||||
sparkfunnrf52840mini.vid.1=0x1B4F
|
||||
sparkfunnrf52840mini.pid.1=0x0029
|
||||
|
||||
# Application with CDC + MSC
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x8029
|
||||
|
||||
# CircuitPython
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x802A
|
||||
|
||||
sparkfunnrf52840mini.bootloader.tool=bootburn
|
||||
|
||||
# Upload
|
||||
sparkfunnrf52840mini.upload.tool=nrfutil
|
||||
sparkfunnrf52840mini.upload.protocol=nrfutil
|
||||
sparkfunnrf52840mini.upload.use_1200bps_touch=true
|
||||
sparkfunnrf52840mini.upload.wait_for_upload_port=true
|
||||
#sparkfunnrf52840mini.upload.native_usb=true
|
||||
|
||||
# Build
|
||||
sparkfunnrf52840mini.build.mcu=cortex-m4
|
||||
sparkfunnrf52840mini.build.f_cpu=64000000
|
||||
sparkfunnrf52840mini.build.board=NRF52840_FEATHER
|
||||
sparkfunnrf52840mini.build.core=nRF5
|
||||
sparkfunnrf52840mini.build.variant=sparkfun_nrf52840_mini
|
||||
sparkfunnrf52840mini.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
|
||||
sparkfunnrf52840mini.build.vid=0x1B4F
|
||||
sparkfunnrf52840mini.build.pid=0x5284
|
||||
sparkfunnrf52840mini.build.usb_manufacturer="SparkFun"
|
||||
sparkfunnrf52840mini.build.usb_product="nRF52840 Mini Breakout"
|
||||
|
||||
# SofDevice Menu
|
||||
# Ram & ROM size varies depending on SoftDevice (check linker script)
|
||||
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6=s140 6.1.1 r0
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_flags=-DS140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_name=s140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_version=6.1.1
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_fwid=0x00B6
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.ldscript=nrf52840_s140_v6.ld
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_size=815104
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_data_size=248832
|
||||
|
||||
# Debug Menu
|
||||
sparkfunnrf52840mini.menu.debug.l0=Level 0 (Release)
|
||||
sparkfunnrf52840mini.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l1=Level 1 (Error Message)
|
||||
sparkfunnrf52840mini.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l2=Level 2 (Full Debug)
|
||||
sparkfunnrf52840mini.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
sparkfunnrf52840mini.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -Os
|
||||
|
||||
##################################################################
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
#include "nrf.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] =
|
||||
{
|
||||
// P0
|
||||
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ,
|
||||
8 , 9 , 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39,
|
||||
40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55,
|
||||
56, 57, 58, 59, 60, 61, 62, 63
|
||||
};
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_SPARKFUN52840MINI_
|
||||
#define _VARIANT_SPARKFUN52840MINI_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (64)
|
||||
#define NUM_DIGITAL_PINS (64)
|
||||
#define NUM_ANALOG_INPUTS (8)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (7)
|
||||
#define PIN_LED2 (14)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_RED PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
// Buttons
|
||||
/*
|
||||
#define PIN_BUTTON1 (2)
|
||||
#define PIN_BUTTON2 (3)
|
||||
#define PIN_BUTTON3 (4)
|
||||
#define PIN_BUTTON4 (5)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (2)
|
||||
#define PIN_A1 (3)
|
||||
#define PIN_A2 (4)
|
||||
#define PIN_A3 (5)
|
||||
#define PIN_A4 (28)
|
||||
#define PIN_A5 (29)
|
||||
#define PIN_A6 (30)
|
||||
#define PIN_A7 (31)
|
||||
|
||||
static const uint8_t A0 = PIN_A0 ;
|
||||
static const uint8_t A1 = PIN_A1 ;
|
||||
static const uint8_t A2 = PIN_A2 ;
|
||||
static const uint8_t A3 = PIN_A3 ;
|
||||
static const uint8_t A4 = PIN_A4 ;
|
||||
static const uint8_t A5 = PIN_A5 ;
|
||||
static const uint8_t A6 = PIN_A6 ;
|
||||
static const uint8_t A7 = PIN_A7 ;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (2)
|
||||
#define PIN_DFU (13)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
// Serial
|
||||
//Previous Hardware UART definition for nRF52 Arduino Core, below 0.16.0
|
||||
//Feel free to comment out these two lines below if there are conflicts with latest release
|
||||
#define PIN_SERIAL_RX (15)
|
||||
#define PIN_SERIAL_TX (17)
|
||||
|
||||
//Hardware UART definition for nRF52 Arduino Core, 0.17.0 and above
|
||||
#define PIN_SERIAL1_RX (15)
|
||||
#define PIN_SERIAL1_TX (17)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (31)
|
||||
#define PIN_SPI_MOSI (3)
|
||||
#define PIN_SPI_SCK (30)
|
||||
|
||||
static const uint8_t SS = 2 ;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI ;
|
||||
static const uint8_t MISO = PIN_SPI_MISO ;
|
||||
static const uint8_t SCK = PIN_SPI_SCK ;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (8)
|
||||
#define PIN_WIRE_SCL (11)
|
||||
|
||||
/*
|
||||
* QSPI interface for external flash
|
||||
*/
|
||||
#define PIN_QSPI_SCK 32
|
||||
#define PIN_QSPI_CS 33
|
||||
#define PIN_QSPI_DATA0 34
|
||||
#define PIN_QSPI_DATA1 35
|
||||
#define PIN_QSPI_DATA2 36
|
||||
#define PIN_QSPI_DATA3 37
|
||||
|
||||
// On-board QSPI Flash
|
||||
// If EXTERNAL_FLASH_DEVICES is not defined, all supported devices will be used
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
@@ -763,3 +763,72 @@ ninab112.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
ninab112.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
ninab112.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
ninab112.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
##################################################################
|
||||
## KH Add SparkFun Pro nRF52840 Mini
|
||||
##################################################################
|
||||
#**********************************************
|
||||
# SparkFun Pro nRF52840 Mini
|
||||
#**********************************************
|
||||
sparkfunnrf52840mini.name=SparkFun Pro nRF52840 Mini
|
||||
|
||||
# DFU Mode with CDC only
|
||||
sparkfunnrf52840mini.vid.0=0x1B4F
|
||||
sparkfunnrf52840mini.pid.0=0x002A
|
||||
|
||||
# DFU Mode with CDC + MSC (UF2)
|
||||
sparkfunnrf52840mini.vid.1=0x1B4F
|
||||
sparkfunnrf52840mini.pid.1=0x0029
|
||||
|
||||
# Application with CDC + MSC
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x8029
|
||||
|
||||
# CircuitPython
|
||||
sparkfunnrf52840mini.vid.2=0x1B4F
|
||||
sparkfunnrf52840mini.pid.2=0x802A
|
||||
|
||||
sparkfunnrf52840mini.bootloader.tool=bootburn
|
||||
|
||||
# Upload
|
||||
sparkfunnrf52840mini.upload.tool=nrfutil
|
||||
sparkfunnrf52840mini.upload.protocol=nrfutil
|
||||
sparkfunnrf52840mini.upload.use_1200bps_touch=true
|
||||
sparkfunnrf52840mini.upload.wait_for_upload_port=true
|
||||
#sparkfunnrf52840mini.upload.native_usb=true
|
||||
|
||||
# Build
|
||||
sparkfunnrf52840mini.build.mcu=cortex-m4
|
||||
sparkfunnrf52840mini.build.f_cpu=64000000
|
||||
sparkfunnrf52840mini.build.board=NRF52840_FEATHER
|
||||
sparkfunnrf52840mini.build.core=nRF5
|
||||
sparkfunnrf52840mini.build.variant=sparkfun_nrf52840_mini
|
||||
sparkfunnrf52840mini.build.extra_flags=-DNRF52840_XXAA {build.flags.usb}
|
||||
sparkfunnrf52840mini.build.vid=0x1B4F
|
||||
sparkfunnrf52840mini.build.pid=0x5284
|
||||
sparkfunnrf52840mini.build.usb_manufacturer="SparkFun"
|
||||
sparkfunnrf52840mini.build.usb_product="nRF52840 Mini Breakout"
|
||||
|
||||
# SofDevice Menu
|
||||
# Ram & ROM size varies depending on SoftDevice (check linker script)
|
||||
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6=s140 6.1.1 r0
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_flags=-DS140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_name=s140
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_version=6.1.1
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.sd_fwid=0x00B6
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.build.ldscript=nrf52840_s140_v6.ld
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_size=815104
|
||||
sparkfunnrf52840mini.menu.softdevice.s140v6.upload.maximum_data_size=248832
|
||||
|
||||
# Debug Menu
|
||||
sparkfunnrf52840mini.menu.debug.l0=Level 0 (Release)
|
||||
sparkfunnrf52840mini.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l1=Level 1 (Error Message)
|
||||
sparkfunnrf52840mini.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l2=Level 2 (Full Debug)
|
||||
sparkfunnrf52840mini.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
|
||||
sparkfunnrf52840mini.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
sparkfunnrf52840mini.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3 -Os
|
||||
|
||||
##################################################################
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
#include "nrf.h"
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] =
|
||||
{
|
||||
// P0
|
||||
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ,
|
||||
8 , 9 , 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31,
|
||||
|
||||
// P1
|
||||
32, 33, 34, 35, 36, 37, 38, 39,
|
||||
40, 41, 42, 43, 44, 45, 46, 47,
|
||||
48, 49, 50, 51, 52, 53, 54, 55,
|
||||
56, 57, 58, 59, 60, 61, 62, 63
|
||||
};
|
||||
void initVariant()
|
||||
{
|
||||
// LED1 & LED2
|
||||
pinMode(PIN_LED1, OUTPUT);
|
||||
ledOff(PIN_LED1);
|
||||
|
||||
pinMode(PIN_LED2, OUTPUT);
|
||||
ledOff(PIN_LED2);
|
||||
}
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
Copyright (c) 2016 Sandeep Mistry All right reserved.
|
||||
Copyright (c) 2018, Adafruit Industries (adafruit.com)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_SPARKFUN52840MINI_
|
||||
#define _VARIANT_SPARKFUN52840MINI_
|
||||
|
||||
/** Master clock frequency */
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
// define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WVariant.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (64)
|
||||
#define NUM_DIGITAL_PINS (64)
|
||||
#define NUM_ANALOG_INPUTS (8)
|
||||
#define NUM_ANALOG_OUTPUTS (0)
|
||||
|
||||
// LEDs
|
||||
#define PIN_LED1 (7)
|
||||
#define PIN_LED2 (14)
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
|
||||
#define LED_BLUE PIN_LED1
|
||||
#define LED_RED PIN_LED2
|
||||
|
||||
#define LED_STATE_ON 1 // State when LED is litted
|
||||
|
||||
// Buttons
|
||||
/*
|
||||
#define PIN_BUTTON1 (2)
|
||||
#define PIN_BUTTON2 (3)
|
||||
#define PIN_BUTTON3 (4)
|
||||
#define PIN_BUTTON4 (5)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
*/
|
||||
#define PIN_A0 (2)
|
||||
#define PIN_A1 (3)
|
||||
#define PIN_A2 (4)
|
||||
#define PIN_A3 (5)
|
||||
#define PIN_A4 (28)
|
||||
#define PIN_A5 (29)
|
||||
#define PIN_A6 (30)
|
||||
#define PIN_A7 (31)
|
||||
|
||||
static const uint8_t A0 = PIN_A0 ;
|
||||
static const uint8_t A1 = PIN_A1 ;
|
||||
static const uint8_t A2 = PIN_A2 ;
|
||||
static const uint8_t A3 = PIN_A3 ;
|
||||
static const uint8_t A4 = PIN_A4 ;
|
||||
static const uint8_t A5 = PIN_A5 ;
|
||||
static const uint8_t A6 = PIN_A6 ;
|
||||
static const uint8_t A7 = PIN_A7 ;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (2)
|
||||
#define PIN_DFU (13)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
// Serial
|
||||
//Previous Hardware UART definition for nRF52 Arduino Core, below 0.16.0
|
||||
//Feel free to comment out these two lines below if there are conflicts with latest release
|
||||
#define PIN_SERIAL_RX (15)
|
||||
#define PIN_SERIAL_TX (17)
|
||||
|
||||
//Hardware UART definition for nRF52 Arduino Core, 0.17.0 and above
|
||||
#define PIN_SERIAL1_RX (15)
|
||||
#define PIN_SERIAL1_TX (17)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (31)
|
||||
#define PIN_SPI_MOSI (3)
|
||||
#define PIN_SPI_SCK (30)
|
||||
|
||||
static const uint8_t SS = 2 ;
|
||||
static const uint8_t MOSI = PIN_SPI_MOSI ;
|
||||
static const uint8_t MISO = PIN_SPI_MISO ;
|
||||
static const uint8_t SCK = PIN_SPI_SCK ;
|
||||
|
||||
/*
|
||||
* Wire Interfaces
|
||||
*/
|
||||
#define WIRE_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_WIRE_SDA (8)
|
||||
#define PIN_WIRE_SCL (11)
|
||||
|
||||
/*
|
||||
* QSPI interface for external flash
|
||||
*/
|
||||
#define PIN_QSPI_SCK 32
|
||||
#define PIN_QSPI_CS 33
|
||||
#define PIN_QSPI_DATA0 34
|
||||
#define PIN_QSPI_DATA1 35
|
||||
#define PIN_QSPI_DATA2 36
|
||||
#define PIN_QSPI_DATA3 37
|
||||
|
||||
// On-board QSPI Flash
|
||||
// If EXTERNAL_FLASH_DEVICES is not defined, all supported devices will be used
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
/* Copyright (C) 2012 mbed.org, MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef LWIPOPTS_H
|
||||
#define LWIPOPTS_H
|
||||
|
||||
// Workaround for Linux timeval
|
||||
#if defined (TOOLCHAIN_GCC)
|
||||
#define LWIP_TIMEVAL_PRIVATE 0
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include "nsapi_types.h"
|
||||
#include "mbed_retarget.h"
|
||||
|
||||
// KH fix
|
||||
#include <mbed_config.h>
|
||||
/////////////////////////
|
||||
|
||||
// Operating System
|
||||
#define NO_SYS 0
|
||||
|
||||
#if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error "Either IPv4 or IPv6 must be enabled."
|
||||
#endif
|
||||
|
||||
#define LWIP_IPV4 MBED_CONF_LWIP_IPV4_ENABLED
|
||||
|
||||
#define LWIP_IPV6 MBED_CONF_LWIP_IPV6_ENABLED
|
||||
|
||||
#define LWIP_PROVIDE_ERRNO 0
|
||||
|
||||
// On dual stack configuration how long to wait for both or preferred stack
|
||||
// addresses before completing bring up.
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
#if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE
|
||||
#define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
|
||||
|
||||
#define DHCP_TIMEOUT MBED_CONF_LWIP_DHCP_TIMEOUT
|
||||
|
||||
#define LINK_TIMEOUT 60
|
||||
|
||||
#define PREF_IPV4 1
|
||||
#define PREF_IPV6 2
|
||||
|
||||
#if MBED_CONF_LWIP_IP_VER_PREF == 6
|
||||
#define IP_VERSION_PREF PREF_IPV6
|
||||
#elif MBED_CONF_LWIP_IP_VER_PREF == 4
|
||||
#define IP_VERSION_PREF PREF_IPV4
|
||||
#else
|
||||
#error "Either IPv4 or IPv6 must be preferred."
|
||||
#endif
|
||||
|
||||
#undef LWIP_DEBUG
|
||||
#if MBED_CONF_LWIP_DEBUG_ENABLED
|
||||
#define LWIP_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if NO_SYS == 0
|
||||
#include "cmsis_os2.h"
|
||||
|
||||
#define SYS_LIGHTWEIGHT_PROT 1
|
||||
|
||||
#define LWIP_RAW MBED_CONF_LWIP_RAW_SOCKET_ENABLED
|
||||
|
||||
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
|
||||
|
||||
// Thread stacks use 8-byte alignment
|
||||
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
// For LWIP debug, double the stack
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2, 8)
|
||||
#elif MBED_DEBUG
|
||||
// When debug is enabled on the build increase stack 25 percent
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE + MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE / 4, 8)
|
||||
#else
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
// Thread priority (osPriorityNormal by default)
|
||||
#define TCPIP_THREAD_PRIO (MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY)
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2, 8)
|
||||
#else
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
#define MEMP_NUM_SYS_TIMEOUT 16
|
||||
|
||||
#define sys_msleep(ms) sys_msleep(ms)
|
||||
|
||||
#endif
|
||||
|
||||
// 32-bit alignment
|
||||
#define MEM_ALIGNMENT 4
|
||||
|
||||
#define LWIP_RAM_HEAP_POINTER lwip_ram_heap
|
||||
|
||||
// Number of simultaneously queued TCP segments.
|
||||
#define MEMP_NUM_TCP_SEG MBED_CONF_LWIP_MEMP_NUM_TCP_SEG
|
||||
|
||||
// TCP Maximum segment size.
|
||||
#define TCP_MSS MBED_CONF_LWIP_TCP_MSS
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_SND_BUF MBED_CONF_LWIP_TCP_SND_BUF
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_WND MBED_CONF_LWIP_TCP_WND
|
||||
|
||||
#define TCP_MAXRTX MBED_CONF_LWIP_TCP_MAXRTX
|
||||
|
||||
#define TCP_SYNMAXRTX MBED_CONF_LWIP_TCP_SYNMAXRTX
|
||||
|
||||
// Number of pool pbufs.
|
||||
// Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS)
|
||||
#define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE
|
||||
|
||||
#ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
|
||||
#undef PBUF_POOL_BUFSIZE
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(MBED_CONF_LWIP_PBUF_POOL_BUFSIZE)
|
||||
#else
|
||||
#ifndef PBUF_POOL_BUFSIZE
|
||||
#if LWIP_IPV6
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#elif LWIP_IPV4
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+20+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE
|
||||
|
||||
// One tcp_pcb_listen is needed for each TCP server.
|
||||
// Each requires 72 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN MBED_CONF_LWIP_TCP_SERVER_MAX
|
||||
|
||||
// One is tcp_pcb needed for each TCPSocket.
|
||||
// Each requires 196 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB MBED_CONF_LWIP_TCP_SOCKET_MAX
|
||||
|
||||
// One udp_pcb is needed for each UDPSocket.
|
||||
// Each requires 84 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_UDP_PCB MBED_CONF_LWIP_UDP_SOCKET_MAX
|
||||
|
||||
// Number of non-pool pbufs.
|
||||
// Each requires 92 bytes of RAM.
|
||||
#define MEMP_NUM_PBUF MBED_CONF_LWIP_NUM_PBUF
|
||||
|
||||
// Each netbuf requires 64 bytes of RAM.
|
||||
#define MEMP_NUM_NETBUF MBED_CONF_LWIP_NUM_NETBUF
|
||||
|
||||
// One netconn is needed for each UDPSocket or TCPSocket.
|
||||
// Each requires 236 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX
|
||||
|
||||
#if MBED_CONF_LWIP_TCP_ENABLED
|
||||
#define LWIP_TCP 1
|
||||
#define TCP_OVERSIZE 0
|
||||
#define LWIP_TCP_KEEPALIVE 1
|
||||
|
||||
#define TCP_CLOSE_TIMEOUT MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT
|
||||
|
||||
#else
|
||||
#define LWIP_TCP 0
|
||||
#endif
|
||||
|
||||
#define LWIP_DNS 1
|
||||
// Only DNS address storage is enabled
|
||||
#define LWIP_FULL_DNS 0
|
||||
#define LWIP_SOCKET 0
|
||||
|
||||
#define SO_REUSE 1
|
||||
|
||||
// Support Multicast
|
||||
#include "stdlib.h"
|
||||
#define LWIP_IGMP LWIP_IPV4
|
||||
#define LWIP_RAND() lwip_get_random()
|
||||
|
||||
#define LWIP_COMPAT_SOCKETS 0
|
||||
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
|
||||
|
||||
#define LWIP_BROADCAST_PING 1
|
||||
|
||||
// Fragmentation on, as per IPv4 default
|
||||
#define LWIP_IPV6_FRAG LWIP_IPV6
|
||||
|
||||
// Queuing, default is "disabled", as per IPv4 default (so actually queues 1)
|
||||
#define LWIP_ND6_QUEUEING MBED_CONF_ND6_QUEUEING
|
||||
|
||||
// Debug Options
|
||||
#define NETIF_DEBUG LWIP_DBG_OFF
|
||||
#define PBUF_DEBUG LWIP_DBG_OFF
|
||||
#define API_LIB_DEBUG LWIP_DBG_OFF
|
||||
#define API_MSG_DEBUG LWIP_DBG_OFF
|
||||
#define SOCKETS_DEBUG LWIP_DBG_OFF
|
||||
#define ICMP_DEBUG LWIP_DBG_OFF
|
||||
#define IGMP_DEBUG LWIP_DBG_OFF
|
||||
#define INET_DEBUG LWIP_DBG_OFF
|
||||
#define IP_DEBUG LWIP_DBG_OFF
|
||||
#define IP_REASS_DEBUG LWIP_DBG_OFF
|
||||
#define RAW_DEBUG LWIP_DBG_OFF
|
||||
#define MEM_DEBUG LWIP_DBG_OFF
|
||||
#define MEMP_DEBUG LWIP_DBG_OFF
|
||||
#define SYS_DEBUG LWIP_DBG_OFF
|
||||
#define TIMERS_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_FR_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RTO_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_CWND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_WND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RST_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_QLEN_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_DEBUG LWIP_DBG_OFF
|
||||
#define TCPIP_DEBUG LWIP_DBG_OFF
|
||||
#define SLIP_DEBUG LWIP_DBG_OFF
|
||||
#define DHCP_DEBUG LWIP_DBG_OFF
|
||||
#define AUTOIP_DEBUG LWIP_DBG_OFF
|
||||
#define DNS_DEBUG LWIP_DBG_OFF
|
||||
#define IP6_DEBUG LWIP_DBG_OFF
|
||||
|
||||
#define ETHARP_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_LPC_EMAC LWIP_DBG_OFF
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define MEMP_OVERFLOW_CHECK 1
|
||||
#define MEMP_SANITY_CHECK 1
|
||||
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
|
||||
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
||||
#else
|
||||
#define LWIP_NOASSERT 1
|
||||
#define LWIP_STATS 0
|
||||
#endif
|
||||
|
||||
#define TRACE_TO_ASCII_HEX_DUMP 0
|
||||
|
||||
#define LWIP_PLATFORM_BYTESWAP 1
|
||||
|
||||
#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1
|
||||
|
||||
// Interface type configuration
|
||||
|
||||
#if MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
#define LWIP_ARP 1
|
||||
#define LWIP_ETHERNET 1
|
||||
#define LWIP_DHCP LWIP_IPV4
|
||||
#else
|
||||
#define LWIP_ARP 0
|
||||
#define LWIP_ETHERNET 0
|
||||
#endif // MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
|
||||
#if MBED_CONF_LWIP_L3IP_ENABLED
|
||||
#define LWIP_L3IP 1
|
||||
#else
|
||||
#define LWIP_L3IP 0
|
||||
#endif
|
||||
|
||||
//Maximum size of network interface name
|
||||
#define INTERFACE_NAME_MAX_SIZE NSAPI_INTERFACE_NAME_MAX_SIZE
|
||||
// Note generic macro name used rather than MBED_CONF_LWIP_PPP_ENABLED
|
||||
// to allow users like PPPCellularInterface to detect that nsapi_ppp.h is available.
|
||||
|
||||
// Enable PPP for now either from lwIP PPP configuration (obsolete) or from PPP service configuration
|
||||
#if MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED
|
||||
|
||||
#define PPP_SUPPORT 1
|
||||
|
||||
#if MBED_CONF_PPP_IPV4_ENABLED || MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#error LWIP: IPv4 PPP enabled but not IPv4
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV4_SUPPORT 1
|
||||
#endif
|
||||
|
||||
#if MBED_CONF_PPP_IPV6_ENABLED || MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error LWIP: IPv6 PPP enabled but not IPv6
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV6_SUPPORT 1
|
||||
// Later to be dynamic for use for multiple interfaces
|
||||
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define LWIP_NETBUF_RECVINFO MBED_CONF_LWIP_NETBUF_RECVINFO_ENABLED
|
||||
|
||||
// Make sure we default these to off, so
|
||||
// LWIP doesn't default to on
|
||||
#ifndef LWIP_ARP
|
||||
#define LWIP_ARP 0
|
||||
#endif
|
||||
|
||||
// Checksum-on-copy disabled due to https://savannah.nongnu.org/bugs/?50914
|
||||
#define LWIP_CHECKSUM_ON_COPY 0
|
||||
|
||||
#define LWIP_NETIF_HOSTNAME 1
|
||||
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||
|
||||
#define DNS_TABLE_SIZE 2
|
||||
#define DNS_MAX_NAME_LENGTH 128
|
||||
|
||||
#include "lwip_random.h"
|
||||
#include "lwip_tcp_isn.h"
|
||||
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
|
||||
#ifdef MBEDTLS_MD5_C
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 1
|
||||
#else
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 0
|
||||
#endif
|
||||
|
||||
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS MBED_CONF_LWIP_ND6_RDNSS_MAX_DNS_SERVERS
|
||||
|
||||
#endif /* LWIPOPTS_H_ */
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
portenta_h7_rules () {
|
||||
echo ""
|
||||
echo "# Portenta H7 bootloader mode UDEV rules"
|
||||
echo ""
|
||||
cat <<EOF
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
|
||||
EOF
|
||||
}
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
portenta_h7_rules > /etc/udev/rules.d/49-portenta_h7.rules
|
||||
|
||||
# reload udev rules
|
||||
echo "Reload rules..."
|
||||
udevadm trigger
|
||||
udevadm control --reload-rules
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
/* Copyright (C) 2012 mbed.org, MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef LWIPOPTS_H
|
||||
#define LWIPOPTS_H
|
||||
|
||||
// Workaround for Linux timeval
|
||||
#if defined (TOOLCHAIN_GCC)
|
||||
#define LWIP_TIMEVAL_PRIVATE 0
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include "nsapi_types.h"
|
||||
#include "mbed_retarget.h"
|
||||
|
||||
// KH fix
|
||||
#include <mbed_config.h>
|
||||
/////////////////////////
|
||||
|
||||
// Operating System
|
||||
#define NO_SYS 0
|
||||
|
||||
#if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error "Either IPv4 or IPv6 must be enabled."
|
||||
#endif
|
||||
|
||||
#define LWIP_IPV4 MBED_CONF_LWIP_IPV4_ENABLED
|
||||
|
||||
#define LWIP_IPV6 MBED_CONF_LWIP_IPV6_ENABLED
|
||||
|
||||
#define LWIP_PROVIDE_ERRNO 0
|
||||
|
||||
// On dual stack configuration how long to wait for both or preferred stack
|
||||
// addresses before completing bring up.
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
#if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE
|
||||
#define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
|
||||
|
||||
#define DHCP_TIMEOUT MBED_CONF_LWIP_DHCP_TIMEOUT
|
||||
|
||||
#define LINK_TIMEOUT 60
|
||||
|
||||
#define PREF_IPV4 1
|
||||
#define PREF_IPV6 2
|
||||
|
||||
#if MBED_CONF_LWIP_IP_VER_PREF == 6
|
||||
#define IP_VERSION_PREF PREF_IPV6
|
||||
#elif MBED_CONF_LWIP_IP_VER_PREF == 4
|
||||
#define IP_VERSION_PREF PREF_IPV4
|
||||
#else
|
||||
#error "Either IPv4 or IPv6 must be preferred."
|
||||
#endif
|
||||
|
||||
#undef LWIP_DEBUG
|
||||
#if MBED_CONF_LWIP_DEBUG_ENABLED
|
||||
#define LWIP_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if NO_SYS == 0
|
||||
#include "cmsis_os2.h"
|
||||
|
||||
#define SYS_LIGHTWEIGHT_PROT 1
|
||||
|
||||
#define LWIP_RAW MBED_CONF_LWIP_RAW_SOCKET_ENABLED
|
||||
|
||||
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
|
||||
|
||||
// Thread stacks use 8-byte alignment
|
||||
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
// For LWIP debug, double the stack
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2, 8)
|
||||
#elif MBED_DEBUG
|
||||
// When debug is enabled on the build increase stack 25 percent
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE + MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE / 4, 8)
|
||||
#else
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
// Thread priority (osPriorityNormal by default)
|
||||
#define TCPIP_THREAD_PRIO (MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY)
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2, 8)
|
||||
#else
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
#define MEMP_NUM_SYS_TIMEOUT 16
|
||||
|
||||
#define sys_msleep(ms) sys_msleep(ms)
|
||||
|
||||
#endif
|
||||
|
||||
// 32-bit alignment
|
||||
#define MEM_ALIGNMENT 4
|
||||
|
||||
#define LWIP_RAM_HEAP_POINTER lwip_ram_heap
|
||||
|
||||
// Number of simultaneously queued TCP segments.
|
||||
#define MEMP_NUM_TCP_SEG MBED_CONF_LWIP_MEMP_NUM_TCP_SEG
|
||||
|
||||
// TCP Maximum segment size.
|
||||
#define TCP_MSS MBED_CONF_LWIP_TCP_MSS
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_SND_BUF MBED_CONF_LWIP_TCP_SND_BUF
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_WND MBED_CONF_LWIP_TCP_WND
|
||||
|
||||
#define TCP_MAXRTX MBED_CONF_LWIP_TCP_MAXRTX
|
||||
|
||||
#define TCP_SYNMAXRTX MBED_CONF_LWIP_TCP_SYNMAXRTX
|
||||
|
||||
// Number of pool pbufs.
|
||||
// Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS)
|
||||
#define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE
|
||||
|
||||
#ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
|
||||
#undef PBUF_POOL_BUFSIZE
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(MBED_CONF_LWIP_PBUF_POOL_BUFSIZE)
|
||||
#else
|
||||
#ifndef PBUF_POOL_BUFSIZE
|
||||
#if LWIP_IPV6
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#elif LWIP_IPV4
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+20+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE
|
||||
|
||||
// One tcp_pcb_listen is needed for each TCP server.
|
||||
// Each requires 72 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN MBED_CONF_LWIP_TCP_SERVER_MAX
|
||||
|
||||
// One is tcp_pcb needed for each TCPSocket.
|
||||
// Each requires 196 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB MBED_CONF_LWIP_TCP_SOCKET_MAX
|
||||
|
||||
// One udp_pcb is needed for each UDPSocket.
|
||||
// Each requires 84 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_UDP_PCB MBED_CONF_LWIP_UDP_SOCKET_MAX
|
||||
|
||||
// Number of non-pool pbufs.
|
||||
// Each requires 92 bytes of RAM.
|
||||
#define MEMP_NUM_PBUF MBED_CONF_LWIP_NUM_PBUF
|
||||
|
||||
// Each netbuf requires 64 bytes of RAM.
|
||||
#define MEMP_NUM_NETBUF MBED_CONF_LWIP_NUM_NETBUF
|
||||
|
||||
// One netconn is needed for each UDPSocket or TCPSocket.
|
||||
// Each requires 236 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX
|
||||
|
||||
#if MBED_CONF_LWIP_TCP_ENABLED
|
||||
#define LWIP_TCP 1
|
||||
#define TCP_OVERSIZE 0
|
||||
#define LWIP_TCP_KEEPALIVE 1
|
||||
|
||||
#define TCP_CLOSE_TIMEOUT MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT
|
||||
|
||||
#else
|
||||
#define LWIP_TCP 0
|
||||
#endif
|
||||
|
||||
#define LWIP_DNS 1
|
||||
// Only DNS address storage is enabled
|
||||
#define LWIP_FULL_DNS 0
|
||||
#define LWIP_SOCKET 0
|
||||
|
||||
#define SO_REUSE 1
|
||||
|
||||
// Support Multicast
|
||||
#include "stdlib.h"
|
||||
#define LWIP_IGMP LWIP_IPV4
|
||||
#define LWIP_RAND() lwip_get_random()
|
||||
|
||||
#define LWIP_COMPAT_SOCKETS 0
|
||||
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
|
||||
|
||||
#define LWIP_BROADCAST_PING 1
|
||||
|
||||
// Fragmentation on, as per IPv4 default
|
||||
#define LWIP_IPV6_FRAG LWIP_IPV6
|
||||
|
||||
// Queuing, default is "disabled", as per IPv4 default (so actually queues 1)
|
||||
#define LWIP_ND6_QUEUEING MBED_CONF_ND6_QUEUEING
|
||||
|
||||
// Debug Options
|
||||
#define NETIF_DEBUG LWIP_DBG_OFF
|
||||
#define PBUF_DEBUG LWIP_DBG_OFF
|
||||
#define API_LIB_DEBUG LWIP_DBG_OFF
|
||||
#define API_MSG_DEBUG LWIP_DBG_OFF
|
||||
#define SOCKETS_DEBUG LWIP_DBG_OFF
|
||||
#define ICMP_DEBUG LWIP_DBG_OFF
|
||||
#define IGMP_DEBUG LWIP_DBG_OFF
|
||||
#define INET_DEBUG LWIP_DBG_OFF
|
||||
#define IP_DEBUG LWIP_DBG_OFF
|
||||
#define IP_REASS_DEBUG LWIP_DBG_OFF
|
||||
#define RAW_DEBUG LWIP_DBG_OFF
|
||||
#define MEM_DEBUG LWIP_DBG_OFF
|
||||
#define MEMP_DEBUG LWIP_DBG_OFF
|
||||
#define SYS_DEBUG LWIP_DBG_OFF
|
||||
#define TIMERS_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_FR_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RTO_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_CWND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_WND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RST_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_QLEN_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_DEBUG LWIP_DBG_OFF
|
||||
#define TCPIP_DEBUG LWIP_DBG_OFF
|
||||
#define SLIP_DEBUG LWIP_DBG_OFF
|
||||
#define DHCP_DEBUG LWIP_DBG_OFF
|
||||
#define AUTOIP_DEBUG LWIP_DBG_OFF
|
||||
#define DNS_DEBUG LWIP_DBG_OFF
|
||||
#define IP6_DEBUG LWIP_DBG_OFF
|
||||
|
||||
#define ETHARP_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_LPC_EMAC LWIP_DBG_OFF
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define MEMP_OVERFLOW_CHECK 1
|
||||
#define MEMP_SANITY_CHECK 1
|
||||
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
|
||||
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
||||
#else
|
||||
#define LWIP_NOASSERT 1
|
||||
#define LWIP_STATS 0
|
||||
#endif
|
||||
|
||||
#define TRACE_TO_ASCII_HEX_DUMP 0
|
||||
|
||||
#define LWIP_PLATFORM_BYTESWAP 1
|
||||
|
||||
#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1
|
||||
|
||||
// Interface type configuration
|
||||
|
||||
#if MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
#define LWIP_ARP 1
|
||||
#define LWIP_ETHERNET 1
|
||||
#define LWIP_DHCP LWIP_IPV4
|
||||
#else
|
||||
#define LWIP_ARP 0
|
||||
#define LWIP_ETHERNET 0
|
||||
#endif // MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
|
||||
#if MBED_CONF_LWIP_L3IP_ENABLED
|
||||
#define LWIP_L3IP 1
|
||||
#else
|
||||
#define LWIP_L3IP 0
|
||||
#endif
|
||||
|
||||
//Maximum size of network interface name
|
||||
#define INTERFACE_NAME_MAX_SIZE NSAPI_INTERFACE_NAME_MAX_SIZE
|
||||
// Note generic macro name used rather than MBED_CONF_LWIP_PPP_ENABLED
|
||||
// to allow users like PPPCellularInterface to detect that nsapi_ppp.h is available.
|
||||
|
||||
// Enable PPP for now either from lwIP PPP configuration (obsolete) or from PPP service configuration
|
||||
#if MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED
|
||||
|
||||
#define PPP_SUPPORT 1
|
||||
|
||||
#if MBED_CONF_PPP_IPV4_ENABLED || MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#error LWIP: IPv4 PPP enabled but not IPv4
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV4_SUPPORT 1
|
||||
#endif
|
||||
|
||||
#if MBED_CONF_PPP_IPV6_ENABLED || MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error LWIP: IPv6 PPP enabled but not IPv6
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV6_SUPPORT 1
|
||||
// Later to be dynamic for use for multiple interfaces
|
||||
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define LWIP_NETBUF_RECVINFO MBED_CONF_LWIP_NETBUF_RECVINFO_ENABLED
|
||||
|
||||
// Make sure we default these to off, so
|
||||
// LWIP doesn't default to on
|
||||
#ifndef LWIP_ARP
|
||||
#define LWIP_ARP 0
|
||||
#endif
|
||||
|
||||
// Checksum-on-copy disabled due to https://savannah.nongnu.org/bugs/?50914
|
||||
#define LWIP_CHECKSUM_ON_COPY 0
|
||||
|
||||
#define LWIP_NETIF_HOSTNAME 1
|
||||
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||
|
||||
#define DNS_TABLE_SIZE 2
|
||||
#define DNS_MAX_NAME_LENGTH 128
|
||||
|
||||
#include "lwip_random.h"
|
||||
#include "lwip_tcp_isn.h"
|
||||
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
|
||||
#ifdef MBEDTLS_MD5_C
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 1
|
||||
#else
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 0
|
||||
#endif
|
||||
|
||||
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS MBED_CONF_LWIP_ND6_RDNSS_MAX_DNS_SERVERS
|
||||
|
||||
#endif /* LWIPOPTS_H_ */
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
portenta_h7_rules () {
|
||||
echo ""
|
||||
echo "# Portenta H7 bootloader mode UDEV rules"
|
||||
echo ""
|
||||
cat <<EOF
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
|
||||
EOF
|
||||
}
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
portenta_h7_rules > /etc/udev/rules.d/49-portenta_h7.rules
|
||||
|
||||
# reload udev rules
|
||||
echo "Reload rules..."
|
||||
udevadm trigger
|
||||
udevadm control --reload-rules
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
/* Copyright (C) 2012 mbed.org, MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef LWIPOPTS_H
|
||||
#define LWIPOPTS_H
|
||||
|
||||
// Workaround for Linux timeval
|
||||
#if defined (TOOLCHAIN_GCC)
|
||||
#define LWIP_TIMEVAL_PRIVATE 0
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include "nsapi_types.h"
|
||||
#include "mbed_retarget.h"
|
||||
|
||||
// KH fix
|
||||
#include <mbed_config.h>
|
||||
/////////////////////////
|
||||
|
||||
// Operating System
|
||||
#define NO_SYS 0
|
||||
|
||||
#if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error "Either IPv4 or IPv6 must be enabled."
|
||||
#endif
|
||||
|
||||
#define LWIP_IPV4 MBED_CONF_LWIP_IPV4_ENABLED
|
||||
|
||||
#define LWIP_IPV6 MBED_CONF_LWIP_IPV6_ENABLED
|
||||
|
||||
#define LWIP_PROVIDE_ERRNO 0
|
||||
|
||||
// On dual stack configuration how long to wait for both or preferred stack
|
||||
// addresses before completing bring up.
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
#if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE
|
||||
#define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
|
||||
|
||||
#define DHCP_TIMEOUT MBED_CONF_LWIP_DHCP_TIMEOUT
|
||||
|
||||
#define LINK_TIMEOUT 60
|
||||
|
||||
#define PREF_IPV4 1
|
||||
#define PREF_IPV6 2
|
||||
|
||||
#if MBED_CONF_LWIP_IP_VER_PREF == 6
|
||||
#define IP_VERSION_PREF PREF_IPV6
|
||||
#elif MBED_CONF_LWIP_IP_VER_PREF == 4
|
||||
#define IP_VERSION_PREF PREF_IPV4
|
||||
#else
|
||||
#error "Either IPv4 or IPv6 must be preferred."
|
||||
#endif
|
||||
|
||||
#undef LWIP_DEBUG
|
||||
#if MBED_CONF_LWIP_DEBUG_ENABLED
|
||||
#define LWIP_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if NO_SYS == 0
|
||||
#include "cmsis_os2.h"
|
||||
|
||||
#define SYS_LIGHTWEIGHT_PROT 1
|
||||
|
||||
#define LWIP_RAW MBED_CONF_LWIP_RAW_SOCKET_ENABLED
|
||||
|
||||
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
|
||||
|
||||
// Thread stacks use 8-byte alignment
|
||||
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
// For LWIP debug, double the stack
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2, 8)
|
||||
#elif MBED_DEBUG
|
||||
// When debug is enabled on the build increase stack 25 percent
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE + MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE / 4, 8)
|
||||
#else
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
// Thread priority (osPriorityNormal by default)
|
||||
#define TCPIP_THREAD_PRIO (MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY)
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2, 8)
|
||||
#else
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
#define MEMP_NUM_SYS_TIMEOUT 16
|
||||
|
||||
#define sys_msleep(ms) sys_msleep(ms)
|
||||
|
||||
#endif
|
||||
|
||||
// 32-bit alignment
|
||||
#define MEM_ALIGNMENT 4
|
||||
|
||||
#define LWIP_RAM_HEAP_POINTER lwip_ram_heap
|
||||
|
||||
// Number of simultaneously queued TCP segments.
|
||||
#define MEMP_NUM_TCP_SEG MBED_CONF_LWIP_MEMP_NUM_TCP_SEG
|
||||
|
||||
// TCP Maximum segment size.
|
||||
#define TCP_MSS MBED_CONF_LWIP_TCP_MSS
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_SND_BUF MBED_CONF_LWIP_TCP_SND_BUF
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_WND MBED_CONF_LWIP_TCP_WND
|
||||
|
||||
#define TCP_MAXRTX MBED_CONF_LWIP_TCP_MAXRTX
|
||||
|
||||
#define TCP_SYNMAXRTX MBED_CONF_LWIP_TCP_SYNMAXRTX
|
||||
|
||||
// Number of pool pbufs.
|
||||
// Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS)
|
||||
#define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE
|
||||
|
||||
#ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
|
||||
#undef PBUF_POOL_BUFSIZE
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(MBED_CONF_LWIP_PBUF_POOL_BUFSIZE)
|
||||
#else
|
||||
#ifndef PBUF_POOL_BUFSIZE
|
||||
#if LWIP_IPV6
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#elif LWIP_IPV4
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+20+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE
|
||||
|
||||
// One tcp_pcb_listen is needed for each TCP server.
|
||||
// Each requires 72 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN MBED_CONF_LWIP_TCP_SERVER_MAX
|
||||
|
||||
// One is tcp_pcb needed for each TCPSocket.
|
||||
// Each requires 196 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB MBED_CONF_LWIP_TCP_SOCKET_MAX
|
||||
|
||||
// One udp_pcb is needed for each UDPSocket.
|
||||
// Each requires 84 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_UDP_PCB MBED_CONF_LWIP_UDP_SOCKET_MAX
|
||||
|
||||
// Number of non-pool pbufs.
|
||||
// Each requires 92 bytes of RAM.
|
||||
#define MEMP_NUM_PBUF MBED_CONF_LWIP_NUM_PBUF
|
||||
|
||||
// Each netbuf requires 64 bytes of RAM.
|
||||
#define MEMP_NUM_NETBUF MBED_CONF_LWIP_NUM_NETBUF
|
||||
|
||||
// One netconn is needed for each UDPSocket or TCPSocket.
|
||||
// Each requires 236 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX
|
||||
|
||||
#if MBED_CONF_LWIP_TCP_ENABLED
|
||||
#define LWIP_TCP 1
|
||||
#define TCP_OVERSIZE 0
|
||||
#define LWIP_TCP_KEEPALIVE 1
|
||||
|
||||
#define TCP_CLOSE_TIMEOUT MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT
|
||||
|
||||
#else
|
||||
#define LWIP_TCP 0
|
||||
#endif
|
||||
|
||||
#define LWIP_DNS 1
|
||||
// Only DNS address storage is enabled
|
||||
#define LWIP_FULL_DNS 0
|
||||
#define LWIP_SOCKET 0
|
||||
|
||||
#define SO_REUSE 1
|
||||
|
||||
// Support Multicast
|
||||
#include "stdlib.h"
|
||||
#define LWIP_IGMP LWIP_IPV4
|
||||
#define LWIP_RAND() lwip_get_random()
|
||||
|
||||
#define LWIP_COMPAT_SOCKETS 0
|
||||
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
|
||||
|
||||
#define LWIP_BROADCAST_PING 1
|
||||
|
||||
// Fragmentation on, as per IPv4 default
|
||||
#define LWIP_IPV6_FRAG LWIP_IPV6
|
||||
|
||||
// Queuing, default is "disabled", as per IPv4 default (so actually queues 1)
|
||||
#define LWIP_ND6_QUEUEING MBED_CONF_ND6_QUEUEING
|
||||
|
||||
// Debug Options
|
||||
#define NETIF_DEBUG LWIP_DBG_OFF
|
||||
#define PBUF_DEBUG LWIP_DBG_OFF
|
||||
#define API_LIB_DEBUG LWIP_DBG_OFF
|
||||
#define API_MSG_DEBUG LWIP_DBG_OFF
|
||||
#define SOCKETS_DEBUG LWIP_DBG_OFF
|
||||
#define ICMP_DEBUG LWIP_DBG_OFF
|
||||
#define IGMP_DEBUG LWIP_DBG_OFF
|
||||
#define INET_DEBUG LWIP_DBG_OFF
|
||||
#define IP_DEBUG LWIP_DBG_OFF
|
||||
#define IP_REASS_DEBUG LWIP_DBG_OFF
|
||||
#define RAW_DEBUG LWIP_DBG_OFF
|
||||
#define MEM_DEBUG LWIP_DBG_OFF
|
||||
#define MEMP_DEBUG LWIP_DBG_OFF
|
||||
#define SYS_DEBUG LWIP_DBG_OFF
|
||||
#define TIMERS_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_FR_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RTO_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_CWND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_WND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RST_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_QLEN_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_DEBUG LWIP_DBG_OFF
|
||||
#define TCPIP_DEBUG LWIP_DBG_OFF
|
||||
#define SLIP_DEBUG LWIP_DBG_OFF
|
||||
#define DHCP_DEBUG LWIP_DBG_OFF
|
||||
#define AUTOIP_DEBUG LWIP_DBG_OFF
|
||||
#define DNS_DEBUG LWIP_DBG_OFF
|
||||
#define IP6_DEBUG LWIP_DBG_OFF
|
||||
|
||||
#define ETHARP_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_LPC_EMAC LWIP_DBG_OFF
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define MEMP_OVERFLOW_CHECK 1
|
||||
#define MEMP_SANITY_CHECK 1
|
||||
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
|
||||
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
||||
#else
|
||||
#define LWIP_NOASSERT 1
|
||||
#define LWIP_STATS 0
|
||||
#endif
|
||||
|
||||
#define TRACE_TO_ASCII_HEX_DUMP 0
|
||||
|
||||
#define LWIP_PLATFORM_BYTESWAP 1
|
||||
|
||||
#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1
|
||||
|
||||
// Interface type configuration
|
||||
|
||||
#if MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
#define LWIP_ARP 1
|
||||
#define LWIP_ETHERNET 1
|
||||
#define LWIP_DHCP LWIP_IPV4
|
||||
#else
|
||||
#define LWIP_ARP 0
|
||||
#define LWIP_ETHERNET 0
|
||||
#endif // MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
|
||||
#if MBED_CONF_LWIP_L3IP_ENABLED
|
||||
#define LWIP_L3IP 1
|
||||
#else
|
||||
#define LWIP_L3IP 0
|
||||
#endif
|
||||
|
||||
//Maximum size of network interface name
|
||||
#define INTERFACE_NAME_MAX_SIZE NSAPI_INTERFACE_NAME_MAX_SIZE
|
||||
// Note generic macro name used rather than MBED_CONF_LWIP_PPP_ENABLED
|
||||
// to allow users like PPPCellularInterface to detect that nsapi_ppp.h is available.
|
||||
|
||||
// Enable PPP for now either from lwIP PPP configuration (obsolete) or from PPP service configuration
|
||||
#if MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED
|
||||
|
||||
#define PPP_SUPPORT 1
|
||||
|
||||
#if MBED_CONF_PPP_IPV4_ENABLED || MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#error LWIP: IPv4 PPP enabled but not IPv4
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV4_SUPPORT 1
|
||||
#endif
|
||||
|
||||
#if MBED_CONF_PPP_IPV6_ENABLED || MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error LWIP: IPv6 PPP enabled but not IPv6
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV6_SUPPORT 1
|
||||
// Later to be dynamic for use for multiple interfaces
|
||||
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define LWIP_NETBUF_RECVINFO MBED_CONF_LWIP_NETBUF_RECVINFO_ENABLED
|
||||
|
||||
// Make sure we default these to off, so
|
||||
// LWIP doesn't default to on
|
||||
#ifndef LWIP_ARP
|
||||
#define LWIP_ARP 0
|
||||
#endif
|
||||
|
||||
// Checksum-on-copy disabled due to https://savannah.nongnu.org/bugs/?50914
|
||||
#define LWIP_CHECKSUM_ON_COPY 0
|
||||
|
||||
#define LWIP_NETIF_HOSTNAME 1
|
||||
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||
|
||||
#define DNS_TABLE_SIZE 2
|
||||
#define DNS_MAX_NAME_LENGTH 128
|
||||
|
||||
#include "lwip_random.h"
|
||||
#include "lwip_tcp_isn.h"
|
||||
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
|
||||
#ifdef MBEDTLS_MD5_C
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 1
|
||||
#else
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 0
|
||||
#endif
|
||||
|
||||
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS MBED_CONF_LWIP_ND6_RDNSS_MAX_DNS_SERVERS
|
||||
|
||||
#endif /* LWIPOPTS_H_ */
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
portenta_h7_rules () {
|
||||
echo ""
|
||||
echo "# Portenta H7 bootloader mode UDEV rules"
|
||||
echo ""
|
||||
cat <<EOF
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
|
||||
EOF
|
||||
}
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
portenta_h7_rules > /etc/udev/rules.d/49-portenta_h7.rules
|
||||
|
||||
# reload udev rules
|
||||
echo "Reload rules..."
|
||||
udevadm trigger
|
||||
udevadm control --reload-rules
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
/* Copyright (C) 2012 mbed.org, MIT License
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or
|
||||
* substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef LWIPOPTS_H
|
||||
#define LWIPOPTS_H
|
||||
|
||||
// Workaround for Linux timeval
|
||||
#if defined (TOOLCHAIN_GCC)
|
||||
#define LWIP_TIMEVAL_PRIVATE 0
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include "nsapi_types.h"
|
||||
#include "mbed_retarget.h"
|
||||
|
||||
// KH fix
|
||||
#include <mbed_config.h>
|
||||
/////////////////////////
|
||||
|
||||
// Operating System
|
||||
#define NO_SYS 0
|
||||
|
||||
#if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error "Either IPv4 or IPv6 must be enabled."
|
||||
#endif
|
||||
|
||||
#define LWIP_IPV4 MBED_CONF_LWIP_IPV4_ENABLED
|
||||
|
||||
#define LWIP_IPV6 MBED_CONF_LWIP_IPV6_ENABLED
|
||||
|
||||
#define LWIP_PROVIDE_ERRNO 0
|
||||
|
||||
// On dual stack configuration how long to wait for both or preferred stack
|
||||
// addresses before completing bring up.
|
||||
#if LWIP_IPV4 && LWIP_IPV6
|
||||
#if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE
|
||||
#define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
#else
|
||||
#define PREF_ADDR_TIMEOUT 0
|
||||
#define BOTH_ADDR_TIMEOUT 0
|
||||
#endif
|
||||
|
||||
|
||||
#define DHCP_TIMEOUT MBED_CONF_LWIP_DHCP_TIMEOUT
|
||||
|
||||
#define LINK_TIMEOUT 60
|
||||
|
||||
#define PREF_IPV4 1
|
||||
#define PREF_IPV6 2
|
||||
|
||||
#if MBED_CONF_LWIP_IP_VER_PREF == 6
|
||||
#define IP_VERSION_PREF PREF_IPV6
|
||||
#elif MBED_CONF_LWIP_IP_VER_PREF == 4
|
||||
#define IP_VERSION_PREF PREF_IPV4
|
||||
#else
|
||||
#error "Either IPv4 or IPv6 must be preferred."
|
||||
#endif
|
||||
|
||||
#undef LWIP_DEBUG
|
||||
#if MBED_CONF_LWIP_DEBUG_ENABLED
|
||||
#define LWIP_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if NO_SYS == 0
|
||||
#include "cmsis_os2.h"
|
||||
|
||||
#define SYS_LIGHTWEIGHT_PROT 1
|
||||
|
||||
#define LWIP_RAW MBED_CONF_LWIP_RAW_SOCKET_ENABLED
|
||||
|
||||
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
|
||||
|
||||
// Thread stacks use 8-byte alignment
|
||||
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
// For LWIP debug, double the stack
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2, 8)
|
||||
#elif MBED_DEBUG
|
||||
// When debug is enabled on the build increase stack 25 percent
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE + MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE / 4, 8)
|
||||
#else
|
||||
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
// Thread priority (osPriorityNormal by default)
|
||||
#define TCPIP_THREAD_PRIO (MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY)
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2, 8)
|
||||
#else
|
||||
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE, 8)
|
||||
#endif
|
||||
|
||||
#define MEMP_NUM_SYS_TIMEOUT 16
|
||||
|
||||
#define sys_msleep(ms) sys_msleep(ms)
|
||||
|
||||
#endif
|
||||
|
||||
// 32-bit alignment
|
||||
#define MEM_ALIGNMENT 4
|
||||
|
||||
#define LWIP_RAM_HEAP_POINTER lwip_ram_heap
|
||||
|
||||
// Number of simultaneously queued TCP segments.
|
||||
#define MEMP_NUM_TCP_SEG MBED_CONF_LWIP_MEMP_NUM_TCP_SEG
|
||||
|
||||
// TCP Maximum segment size.
|
||||
#define TCP_MSS MBED_CONF_LWIP_TCP_MSS
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_SND_BUF MBED_CONF_LWIP_TCP_SND_BUF
|
||||
|
||||
// TCP sender buffer space (bytes).
|
||||
#define TCP_WND MBED_CONF_LWIP_TCP_WND
|
||||
|
||||
#define TCP_MAXRTX MBED_CONF_LWIP_TCP_MAXRTX
|
||||
|
||||
#define TCP_SYNMAXRTX MBED_CONF_LWIP_TCP_SYNMAXRTX
|
||||
|
||||
// Number of pool pbufs.
|
||||
// Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS)
|
||||
#define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE
|
||||
|
||||
#ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
|
||||
#undef PBUF_POOL_BUFSIZE
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(MBED_CONF_LWIP_PBUF_POOL_BUFSIZE)
|
||||
#else
|
||||
#ifndef PBUF_POOL_BUFSIZE
|
||||
#if LWIP_IPV6
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#elif LWIP_IPV4
|
||||
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+20+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE
|
||||
|
||||
// One tcp_pcb_listen is needed for each TCP server.
|
||||
// Each requires 72 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN MBED_CONF_LWIP_TCP_SERVER_MAX
|
||||
|
||||
// One is tcp_pcb needed for each TCPSocket.
|
||||
// Each requires 196 bytes of RAM.
|
||||
#define MEMP_NUM_TCP_PCB MBED_CONF_LWIP_TCP_SOCKET_MAX
|
||||
|
||||
// One udp_pcb is needed for each UDPSocket.
|
||||
// Each requires 84 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_UDP_PCB MBED_CONF_LWIP_UDP_SOCKET_MAX
|
||||
|
||||
// Number of non-pool pbufs.
|
||||
// Each requires 92 bytes of RAM.
|
||||
#define MEMP_NUM_PBUF MBED_CONF_LWIP_NUM_PBUF
|
||||
|
||||
// Each netbuf requires 64 bytes of RAM.
|
||||
#define MEMP_NUM_NETBUF MBED_CONF_LWIP_NUM_NETBUF
|
||||
|
||||
// One netconn is needed for each UDPSocket or TCPSocket.
|
||||
// Each requires 236 bytes of RAM (total rounded to multiple of 512).
|
||||
#define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX
|
||||
|
||||
#if MBED_CONF_LWIP_TCP_ENABLED
|
||||
#define LWIP_TCP 1
|
||||
#define TCP_OVERSIZE 0
|
||||
#define LWIP_TCP_KEEPALIVE 1
|
||||
|
||||
#define TCP_CLOSE_TIMEOUT MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT
|
||||
|
||||
#else
|
||||
#define LWIP_TCP 0
|
||||
#endif
|
||||
|
||||
#define LWIP_DNS 1
|
||||
// Only DNS address storage is enabled
|
||||
#define LWIP_FULL_DNS 0
|
||||
#define LWIP_SOCKET 0
|
||||
|
||||
#define SO_REUSE 1
|
||||
|
||||
// Support Multicast
|
||||
#include "stdlib.h"
|
||||
#define LWIP_IGMP LWIP_IPV4
|
||||
#define LWIP_RAND() lwip_get_random()
|
||||
|
||||
#define LWIP_COMPAT_SOCKETS 0
|
||||
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
|
||||
|
||||
#define LWIP_BROADCAST_PING 1
|
||||
|
||||
// Fragmentation on, as per IPv4 default
|
||||
#define LWIP_IPV6_FRAG LWIP_IPV6
|
||||
|
||||
// Queuing, default is "disabled", as per IPv4 default (so actually queues 1)
|
||||
#define LWIP_ND6_QUEUEING MBED_CONF_ND6_QUEUEING
|
||||
|
||||
// Debug Options
|
||||
#define NETIF_DEBUG LWIP_DBG_OFF
|
||||
#define PBUF_DEBUG LWIP_DBG_OFF
|
||||
#define API_LIB_DEBUG LWIP_DBG_OFF
|
||||
#define API_MSG_DEBUG LWIP_DBG_OFF
|
||||
#define SOCKETS_DEBUG LWIP_DBG_OFF
|
||||
#define ICMP_DEBUG LWIP_DBG_OFF
|
||||
#define IGMP_DEBUG LWIP_DBG_OFF
|
||||
#define INET_DEBUG LWIP_DBG_OFF
|
||||
#define IP_DEBUG LWIP_DBG_OFF
|
||||
#define IP_REASS_DEBUG LWIP_DBG_OFF
|
||||
#define RAW_DEBUG LWIP_DBG_OFF
|
||||
#define MEM_DEBUG LWIP_DBG_OFF
|
||||
#define MEMP_DEBUG LWIP_DBG_OFF
|
||||
#define SYS_DEBUG LWIP_DBG_OFF
|
||||
#define TIMERS_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_FR_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RTO_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_CWND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_WND_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_RST_DEBUG LWIP_DBG_OFF
|
||||
#define TCP_QLEN_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_DEBUG LWIP_DBG_OFF
|
||||
#define TCPIP_DEBUG LWIP_DBG_OFF
|
||||
#define SLIP_DEBUG LWIP_DBG_OFF
|
||||
#define DHCP_DEBUG LWIP_DBG_OFF
|
||||
#define AUTOIP_DEBUG LWIP_DBG_OFF
|
||||
#define DNS_DEBUG LWIP_DBG_OFF
|
||||
#define IP6_DEBUG LWIP_DBG_OFF
|
||||
|
||||
#define ETHARP_DEBUG LWIP_DBG_OFF
|
||||
#define UDP_LPC_EMAC LWIP_DBG_OFF
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define MEMP_OVERFLOW_CHECK 1
|
||||
#define MEMP_SANITY_CHECK 1
|
||||
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
|
||||
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
|
||||
#else
|
||||
#define LWIP_NOASSERT 1
|
||||
#define LWIP_STATS 0
|
||||
#endif
|
||||
|
||||
#define TRACE_TO_ASCII_HEX_DUMP 0
|
||||
|
||||
#define LWIP_PLATFORM_BYTESWAP 1
|
||||
|
||||
#define LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS 1
|
||||
|
||||
// Interface type configuration
|
||||
|
||||
#if MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
#define LWIP_ARP 1
|
||||
#define LWIP_ETHERNET 1
|
||||
#define LWIP_DHCP LWIP_IPV4
|
||||
#else
|
||||
#define LWIP_ARP 0
|
||||
#define LWIP_ETHERNET 0
|
||||
#endif // MBED_CONF_LWIP_ETHERNET_ENABLED
|
||||
|
||||
#if MBED_CONF_LWIP_L3IP_ENABLED
|
||||
#define LWIP_L3IP 1
|
||||
#else
|
||||
#define LWIP_L3IP 0
|
||||
#endif
|
||||
|
||||
//Maximum size of network interface name
|
||||
#define INTERFACE_NAME_MAX_SIZE NSAPI_INTERFACE_NAME_MAX_SIZE
|
||||
// Note generic macro name used rather than MBED_CONF_LWIP_PPP_ENABLED
|
||||
// to allow users like PPPCellularInterface to detect that nsapi_ppp.h is available.
|
||||
|
||||
// Enable PPP for now either from lwIP PPP configuration (obsolete) or from PPP service configuration
|
||||
#if MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED
|
||||
|
||||
#define PPP_SUPPORT 1
|
||||
|
||||
#if MBED_CONF_PPP_IPV4_ENABLED || MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV4_ENABLED
|
||||
#error LWIP: IPv4 PPP enabled but not IPv4
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV4_SUPPORT 1
|
||||
#endif
|
||||
|
||||
#if MBED_CONF_PPP_IPV6_ENABLED || MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#define LWIP 0x11991199
|
||||
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV6_ENABLED
|
||||
#error LWIP: IPv6 PPP enabled but not IPv6
|
||||
#endif
|
||||
#undef LWIP
|
||||
#define PPP_IPV6_SUPPORT 1
|
||||
// Later to be dynamic for use for multiple interfaces
|
||||
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define LWIP_NETBUF_RECVINFO MBED_CONF_LWIP_NETBUF_RECVINFO_ENABLED
|
||||
|
||||
// Make sure we default these to off, so
|
||||
// LWIP doesn't default to on
|
||||
#ifndef LWIP_ARP
|
||||
#define LWIP_ARP 0
|
||||
#endif
|
||||
|
||||
// Checksum-on-copy disabled due to https://savannah.nongnu.org/bugs/?50914
|
||||
#define LWIP_CHECKSUM_ON_COPY 0
|
||||
|
||||
#define LWIP_NETIF_HOSTNAME 1
|
||||
#define LWIP_NETIF_STATUS_CALLBACK 1
|
||||
#define LWIP_NETIF_LINK_CALLBACK 1
|
||||
|
||||
#define DNS_TABLE_SIZE 2
|
||||
#define DNS_MAX_NAME_LENGTH 128
|
||||
|
||||
#include "lwip_random.h"
|
||||
#include "lwip_tcp_isn.h"
|
||||
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
|
||||
#ifdef MBEDTLS_MD5_C
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 1
|
||||
#else
|
||||
#define LWIP_USE_EXTERNAL_MBEDTLS 0
|
||||
#endif
|
||||
|
||||
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS MBED_CONF_LWIP_ND6_RDNSS_MAX_DNS_SERVERS
|
||||
|
||||
#endif /* LWIPOPTS_H_ */
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
portenta_h7_rules () {
|
||||
echo ""
|
||||
echo "# Portenta H7 bootloader mode UDEV rules"
|
||||
echo ""
|
||||
cat <<EOF
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
|
||||
EOF
|
||||
}
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
portenta_h7_rules > /etc/udev/rules.d/49-portenta_h7.rules
|
||||
|
||||
# reload udev rules
|
||||
echo "Reload rules..."
|
||||
udevadm trigger
|
||||
udevadm control --reload-rules
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
pgmspace.h - Definitions for compatibility with AVR pgmspace macros
|
||||
|
||||
Copyright (c) 2015 Arduino LLC
|
||||
|
||||
Based on work of Paul Stoffregen on Teensy 3 (http://pjrc.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE
|
||||
*/
|
||||
|
||||
#ifndef __PGMSPACE_H_
|
||||
#define __PGMSPACE_H_ 1
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#define PROGMEM
|
||||
#define PGM_P const char *
|
||||
#define PSTR(str) (str)
|
||||
|
||||
#define _SFR_BYTE(n) (n)
|
||||
|
||||
typedef void prog_void;
|
||||
typedef char prog_char;
|
||||
typedef unsigned char prog_uchar;
|
||||
typedef int8_t prog_int8_t;
|
||||
typedef uint8_t prog_uint8_t;
|
||||
typedef int16_t prog_int16_t;
|
||||
typedef uint16_t prog_uint16_t;
|
||||
typedef int32_t prog_int32_t;
|
||||
typedef uint32_t prog_uint32_t;
|
||||
typedef int64_t prog_int64_t;
|
||||
typedef uint64_t prog_uint64_t;
|
||||
|
||||
typedef const void* int_farptr_t;
|
||||
typedef const void* uint_farptr_t;
|
||||
|
||||
#define memchr_P(s, c, n) memchr((s), (c), (n))
|
||||
#define memcmp_P(s1, s2, n) memcmp((s1), (s2), (n))
|
||||
#define memccpy_P(dest, src, c, n) memccpy((dest), (src), (c), (n))
|
||||
#define memcpy_P(dest, src, n) memcpy((dest), (src), (n))
|
||||
#define memmem_P(haystack, haystacklen, needle, needlelen) memmem((haystack), (haystacklen), (needle), (needlelen))
|
||||
#define memrchr_P(s, c, n) memrchr((s), (c), (n))
|
||||
#define strcat_P(dest, src) strcat((dest), (src))
|
||||
#define strchr_P(s, c) strchr((s), (c))
|
||||
#define strchrnul_P(s, c) strchrnul((s), (c))
|
||||
#define strcmp_P(a, b) strcmp((a), (b))
|
||||
#define strcpy_P(dest, src) strcpy((dest), (src))
|
||||
#define strcasecmp_P(s1, s2) strcasecmp((s1), (s2))
|
||||
#define strcasestr_P(haystack, needle) strcasestr((haystack), (needle))
|
||||
#define strcspn_P(s, accept) strcspn((s), (accept))
|
||||
#define strlcat_P(s1, s2, n) strlcat((s1), (s2), (n))
|
||||
#define strlcpy_P(s1, s2, n) strlcpy((s1), (s2), (n))
|
||||
#define strlen_P(a) strlen((a))
|
||||
#define strnlen_P(s, n) strnlen((s), (n))
|
||||
#define strncmp_P(s1, s2, n) strncmp((s1), (s2), (n))
|
||||
#define strncasecmp_P(s1, s2, n) strncasecmp((s1), (s2), (n))
|
||||
#define strncat_P(s1, s2, n) strncat((s1), (s2), (n))
|
||||
#define strncpy_P(s1, s2, n) strncpy((s1), (s2), (n))
|
||||
#define strpbrk_P(s, accept) strpbrk((s), (accept))
|
||||
#define strrchr_P(s, c) strrchr((s), (c))
|
||||
#define strsep_P(sp, delim) strsep((sp), (delim))
|
||||
#define strspn_P(s, accept) strspn((s), (accept))
|
||||
#define strstr_P(a, b) strstr((a), (b))
|
||||
#define strtok_P(s, delim) strtok((s), (delim))
|
||||
#define strtok_rP(s, delim, last) strtok((s), (delim), (last))
|
||||
|
||||
#define strlen_PF(a) strlen((a))
|
||||
#define strnlen_PF(src, len) strnlen((src), (len))
|
||||
#define memcpy_PF(dest, src, len) memcpy((dest), (src), (len))
|
||||
#define strcpy_PF(dest, src) strcpy((dest), (src))
|
||||
#define strncpy_PF(dest, src, len) strncpy((dest), (src), (len))
|
||||
#define strcat_PF(dest, src) strcat((dest), (src))
|
||||
#define strlcat_PF(dest, src, len) strlcat((dest), (src), (len))
|
||||
#define strncat_PF(dest, src, len) strncat((dest), (src), (len))
|
||||
#define strcmp_PF(s1, s2) strcmp((s1), (s2))
|
||||
#define strncmp_PF(s1, s2, n) strncmp((s1), (s2), (n))
|
||||
#define strcasecmp_PF(s1, s2) strcasecmp((s1), (s2))
|
||||
#define strncasecmp_PF(s1, s2, n) strncasecmp((s1), (s2), (n))
|
||||
#define strstr_PF(s1, s2) strstr((s1), (s2))
|
||||
#define strlcpy_PF(dest, src, n) strlcpy((dest), (src), (n))
|
||||
#define memcmp_PF(s1, s2, n) memcmp((s1), (s2), (n))
|
||||
|
||||
#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
|
||||
#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
|
||||
|
||||
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
|
||||
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
|
||||
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
|
||||
#define pgm_read_float(addr) (*(const float *)(addr))
|
||||
#define pgm_read_ptr(addr) (*(const void **)(addr))
|
||||
|
||||
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
|
||||
#define pgm_read_word_near(addr) pgm_read_word(addr)
|
||||
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
|
||||
#define pgm_read_float_near(addr) pgm_read_float(addr)
|
||||
#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
|
||||
|
||||
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
|
||||
#define pgm_read_word_far(addr) pgm_read_word(addr)
|
||||
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
|
||||
#define pgm_read_float_far(addr) pgm_read_float(addr)
|
||||
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
|
||||
|
||||
#define pgm_get_far_address(addr) (&(addr))
|
||||
|
||||
#endif
|
||||
@@ -40,12 +40,15 @@
|
||||
* [1. Wiring](#1-wiring)
|
||||
* [2. HOWTO program using STLink V-2 or V-3](#2-howto-program-using-stlink-v-2-or-v-3)
|
||||
* [3. HOWTO use Serial Port for Debugging](#3-howto-use-serial-port-for-debugging)
|
||||
* [HOWTO use ESP8266 with W5x00 Ethernet](#HOWTO-use-ESP8266-with-W5x00-Ethernet)
|
||||
* [1. ESP8266 Wiring](#1-ESP8266-wiring)
|
||||
* [Examples](#examples)
|
||||
* [For ESP32 and ESP8266](#for-esp32-and-esp8266)
|
||||
* [1. AsyncHTTPRequest_ESP](examples/AsyncHTTPRequest_ESP)
|
||||
* [2. AsyncHTTPRequest_ESP_WiFiManager](examples/AsyncHTTPRequest_ESP_WiFiManager)
|
||||
* [3. AsyncHTTPMultiRequests_ESP](examples/AsyncHTTPMultiRequests_ESP)
|
||||
* [4. AsyncHTTPRequest_ESP_Multi](examples/AsyncHTTPRequest_ESP_Multi) **New**
|
||||
* [5. AsyncHTTPRequest_ESP8266_Ethernet](examples/AsyncHTTPRequest_ESP8266_Ethernet) **New**
|
||||
* [For STM32 using LAN8742A](#for-stm32-using-lan8742a)
|
||||
* [1. AsyncHTTPRequest_STM32](examples/AsyncHTTPRequest_STM32)
|
||||
* [2. AsyncCustomHeader_STM32](examples/AsyncCustomHeader_STM32)
|
||||
@@ -80,6 +83,8 @@
|
||||
* [9. AsyncHTTPRequest_ESP_WiFiManager running on ESP32C3_DEV](#9-asynchttprequest_esp_wifimanager-running-on-ESP32C3_DEV) **New**
|
||||
* [10. AsyncHTTPRequest_ESP_WiFiManager running on ESP32S3_DEV](#10-asynchttprequest_esp_wifimanager-running-on-ESP32S3_DEV) **New**
|
||||
* [11. AsyncHTTPRequest_ESP_Multi running on ESP32_DEV](#11-AsyncHTTPRequest_ESP_Multi-running-on-ESP32_DEV) **New**
|
||||
* [12. AsyncHTTPRequest_ESP8266_Ethernet running on ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet](#12-AsyncHTTPRequest_ESP8266_Ethernet-running-on-ESP8266_NODEMCU_ESP12E-using-ESP8266_W5500-Ethernet) **New**
|
||||
* [13. AsyncHTTPRequest_ESP8266_Ethernet running on ESP8266_NODEMCU_ESP12E using ESP8266_ENC28J60 Ethernet](#13-AsyncHTTPRequest_ESP8266_Ethernet-running-on-ESP8266_NODEMCU_ESP12E-using-ESP8266_ENC28J60-Ethernet) **New**
|
||||
* [Debug](#debug)
|
||||
* [Troubleshooting](#troubleshooting)
|
||||
* [Issues](#issues)
|
||||
@@ -149,6 +154,10 @@ This library is based on, modified from:
|
||||
|
||||
#### 2. ESP8266
|
||||
|
||||
1. Using WiFi
|
||||
2. Using **W5x00** with [**lwIP_w5100**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_w5100) or [**lwIP_w5500**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_w5500) library
|
||||
3. Using **ENC28J60** with [**lwIP_enc28j60**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_enc28j60) library
|
||||
|
||||
#### 3. STM32F/L/H/G/WB/MP1 with built-in LAN8742A Ethernet.
|
||||
|
||||
1. Nucleo-144 (F429ZI, F746ZG, F756ZG, F767ZI)
|
||||
@@ -171,16 +180,16 @@ This library is based on, modified from:
|
||||
|
||||
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [](https://github.com/arduino/Arduino/releases/latest)
|
||||
2. [`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [](https://github.com/esp8266/Arduino/releases/latest/)
|
||||
3. [`ESP32 Core 2.0.2+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [Latest stable release 
|
||||
5. [`Arduino Core for STM32 2.2.0+`](https://github.com/stm32duino/Arduino_Core_STM32) for for STM32 using built-in Ethernet LAN8742A. [](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)
|
||||
3. [`ESP32 Core 2.0.4+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [Latest stable release 
|
||||
5. [`Arduino Core for STM32 2.3.0+`](https://github.com/stm32duino/Arduino_Core_STM32) for for STM32 using built-in Ethernet LAN8742A. [](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)
|
||||
6. [`ESPAsyncTCP v1.2.2+`](https://github.com/me-no-dev/ESPAsyncTCP) for ESP8266.
|
||||
7. [`AsyncTCP v1.1.1+`](https://github.com/me-no-dev/AsyncTCP) for ESP32.
|
||||
8. [`STM32Ethernet library v1.2.0+`](https://github.com/stm32duino/STM32Ethernet) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [](https://github.com/stm32duino/STM32Ethernet/releases/latest)
|
||||
8. [`STM32Ethernet library v1.3.0+`](https://github.com/stm32duino/STM32Ethernet) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [](https://github.com/stm32duino/STM32Ethernet/releases/latest)
|
||||
9. [`LwIP library v2.1.2+`](https://github.com/stm32duino/LwIP) for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery). [](https://github.com/stm32duino/LwIP/releases/latest)
|
||||
10. [`STM32AsyncTCP library v1.0.1+`](https://github.com/khoih-prog/STM32AsyncTCP) for built-in Ethernet on (Nucleo-144, Discovery). To install manually for Arduino IDE.
|
||||
11. [`ESPAsync_WiFiManager library v1.12.1+`](https://github.com/khoih-prog/ESPAsync_WiFiManager) for ESP32/ESP8266 using some examples. [](https://github.com/khoih-prog/ESPAsync_WiFiManager/releases)
|
||||
12. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS. To install, check [](https://www.ardu-badge.com/LittleFS_esp32).
|
||||
13. [`WebServer_WT32_ETH01 library v1.4.1+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [](https://www.ardu-badge.com/WebServer_WT32_ETH01)
|
||||
11. [`ESPAsync_WiFiManager library v1.12.2+`](https://github.com/khoih-prog/ESPAsync_WiFiManager) for ESP32/ESP8266 using some examples. [](https://github.com/khoih-prog/ESPAsync_WiFiManager/releases)
|
||||
12. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS **only with ESP32 core v1.0.5-**. To install, check [](https://www.ardu-badge.com/LittleFS_esp32).
|
||||
13. [`WebServer_WT32_ETH01 library v1.5.0+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [](https://www.ardu-badge.com/WebServer_WT32_ETH01)
|
||||
|
||||
---
|
||||
|
||||
@@ -216,12 +225,12 @@ To use LAN8720 on some STM32 boards
|
||||
- **Discovery (DISCO_F746NG)**
|
||||
- **STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)**
|
||||
|
||||
you have to copy the files [stm32f4xx_hal_conf_default.h](Packages_Patches/STM32/hardware/stm32/2.2.0/system/STM32F4xx) and [stm32f7xx_hal_conf_default.h](Packages_Patches/STM32/hardware/stm32/2.2.0/system/STM32F7xx) into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system) to overwrite the old files.
|
||||
you have to copy the files [stm32f4xx_hal_conf_default.h](Packages_Patches/STM32/hardware/stm32/2.3.0/system/STM32F4xx) and [stm32f7xx_hal_conf_default.h](Packages_Patches/STM32/hardware/stm32/2.3.0/system/STM32F7xx) into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system) to overwrite the old files.
|
||||
|
||||
Supposing the STM32 stm32 core version is 2.2.0. These files must be copied into the directory:
|
||||
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
|
||||
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h` for STM32F4.
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system/STM32F7xx/stm32f7xx_hal_conf_default.h` for Nucleo-144 STM32F7.
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h` for STM32F4.
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F7xx/stm32f7xx_hal_conf_default.h` for Nucleo-144 STM32F7.
|
||||
|
||||
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz,
|
||||
theses files must be copied into the corresponding directory:
|
||||
@@ -232,12 +241,12 @@ theses files must be copied into the corresponding directory:
|
||||
|
||||
#### 2. For STM32 boards to use Serial1
|
||||
|
||||
**To use Serial1 on some STM32 boards without Serial1 definition (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.) boards**, you have to copy the files [STM32 variant.h](Packages_Patches/STM32/hardware/stm32/2.2.0) into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.2.0). You have to modify the files corresponding to your boards, this is just an illustration how to do.
|
||||
**To use Serial1 on some STM32 boards without Serial1 definition (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.) boards**, you have to copy the files [STM32 variant.h](Packages_Patches/STM32/hardware/stm32/2.3.0) into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0). You have to modify the files corresponding to your boards, this is just an illustration how to do.
|
||||
|
||||
Supposing the STM32 stm32 core version is 2.2.0. These files must be copied into the directory:
|
||||
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
|
||||
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.2.0/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h` for Nucleo-144 NUCLEO_F767ZI.
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.2.0/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h` for Nucleo-64 NUCLEO_L053R8.
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h` for Nucleo-144 NUCLEO_F767ZI.
|
||||
- `~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h` for Nucleo-64 NUCLEO_L053R8.
|
||||
|
||||
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz,
|
||||
theses files must be copied into the corresponding directory:
|
||||
@@ -251,7 +260,7 @@ theses files must be copied into the corresponding directory:
|
||||
|
||||
### Note for Platform IO using ESP32 LittleFS
|
||||
|
||||
In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0`](https://github.com/lorol/LITTLEFS) for ESP32-based boards with ESP32 core v1.0.4- (ESP-IDF v3.2-), uncomment the following line
|
||||
In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0.6`](https://github.com/lorol/LITTLEFS) for ESP32-based boards with ESP32 core v1.0.4- (ESP-IDF v3.2-), uncomment the following line
|
||||
|
||||
from
|
||||
|
||||
@@ -415,6 +424,26 @@ Connect FDTI (USB to Serial) as follows:
|
||||
|TX|<--->|RX=PA_10|
|
||||
|GND|<--->|GND|
|
||||
|
||||
---
|
||||
|
||||
### HOWTO use ESP8266 with W5x00 Ethernet
|
||||
|
||||
#### 1. ESP8266 Wiring
|
||||
|
||||
This is the wiring for EP8266 `W5x00` or `ENC28J60` Ethernet when using `SS = GPIO16`
|
||||
|
||||
https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/e3dd512e7aa9e60c85043893d4527d3b052077c0/examples/AsyncHTTPRequest_ESP8266_Ethernet/AsyncHTTPRequest_ESP8266_Ethernet.ino#L65
|
||||
|
||||
|
||||
|W5x00/ENC28J60 Ethernet|<--->|ESP8266|
|
||||
|:-:|:-:|:-:|
|
||||
|MOSI|<--->|MOSI = GPIO13|
|
||||
|MISO|<--->|MISO = GPIO12|
|
||||
|SCK|<--->|SCK = GPIO14|
|
||||
|SS|<--->|GPIO16|
|
||||
|GND|<--->|GND|
|
||||
|VCC|<--->|+3.3V|
|
||||
|
||||
|
||||
---
|
||||
---
|
||||
@@ -427,6 +456,7 @@ Connect FDTI (USB to Serial) as follows:
|
||||
2. [AsyncHTTPRequest_ESP_WiFiManager](examples/AsyncHTTPRequest_ESP_WiFiManager)
|
||||
3. [AsyncHTTPMultiRequests_ESP](examples/AsyncHTTPMultiRequests_ESP)
|
||||
4. [AsyncHTTPRequest_ESP_Multi](examples/AsyncHTTPRequest_ESP_Multi) **New**
|
||||
5. [AsyncHTTPRequest_ESP8266_Ethernet](examples/AsyncHTTPRequest_ESP8266_Ethernet) **New**
|
||||
|
||||
#### For STM32 using LAN8742A
|
||||
|
||||
@@ -483,43 +513,43 @@ https://github.com/khoih-prog/AsyncHTTPRequest_Generic/blob/98733a6c4a1906ff53f6
|
||||
|
||||
```
|
||||
Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
AsyncHTTPRequest @ IP : 192.168.2.178
|
||||
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-01-23T19:06:29.846071-05:00
|
||||
day_of_week: 0
|
||||
day_of_year: 23
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:00:07.669102-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1642982789
|
||||
utc_datetime: 2022-01-24T00:06:29.846071+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 3
|
||||
unixtime: 1649901607
|
||||
utc_datetime: 2022-04-14T02:00:07.669102+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
*********************
|
||||
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-01-23T19:08:29.871390-05:00
|
||||
day_of_week: 0
|
||||
day_of_year: 23
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:01:07.647308-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1642982909
|
||||
utc_datetime: 2022-01-24T00:08:29.871390+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 3
|
||||
unixtime: 1649901667
|
||||
utc_datetime: 2022-04-14T02:01:07.647308+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
```
|
||||
|
||||
---
|
||||
@@ -528,28 +558,28 @@ week_number: 3
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Stored: SSID = HueNet1, Pass = 12345678
|
||||
Got stored Credentials. Timeout 120s
|
||||
ConnectMultiWiFi in setup
|
||||
After waiting 3.43 secs more in setup(), connection result is connected. Local IP: 192.168.2.186
|
||||
H
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-01-23T19:08:29.871390-05:00
|
||||
day_of_week: 0
|
||||
day_of_year: 23
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:02:07.647703-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1642982909
|
||||
utc_datetime: 2022-01-24T00:08:29.871390+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 3
|
||||
unixtime: 1649901727
|
||||
utc_datetime: 2022-04-14T02:02:07.647703+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHH
|
||||
```
|
||||
@@ -560,46 +590,46 @@ HHHHHH
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Stored: SSID = HueNet1, Pass = 12345678
|
||||
Got stored Credentials. Timeout 120s
|
||||
ConnectMultiWiFi in setup
|
||||
After waiting 2.35 secs more in setup(), connection result is connected. Local IP: 192.168.2.232
|
||||
H
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-01-23T19:06:29.846071-05:00
|
||||
day_of_week: 0
|
||||
day_of_year: 23
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:03:07.647977-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1642982789
|
||||
utc_datetime: 2022-01-24T00:06:29.846071+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 3
|
||||
unixtime: 1649901787
|
||||
utc_datetime: 2022-04-14T02:03:07.647977+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-01-23T19:08:29.871390-05:00
|
||||
day_of_week: 0
|
||||
day_of_year: 23
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:04:07.648721-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1642982909
|
||||
utc_datetime: 2022-01-24T00:08:29.871390+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 3
|
||||
unixtime: 1649901847
|
||||
utc_datetime: 2022-04-14T02:04:07.648721+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
|
||||
```
|
||||
@@ -610,28 +640,27 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Connecting to WiFi SSID: HueNet1
|
||||
...........
|
||||
HTTP WebServer is @ IP : 192.168.2.81
|
||||
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
|
||||
datetime: 2022-01-23T19:08:29.871390-05:00
|
||||
day_of_week: 0
|
||||
day_of_year: 23
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:03:07.647977-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1642982909
|
||||
utc_datetime: 2022-01-24T00:08:29.871390+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 3
|
||||
unixtime: 1649901787
|
||||
utc_datetime: 2022-04-14T02:03:07.647977+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
|
||||
```
|
||||
@@ -643,7 +672,7 @@ HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
|
||||
|
||||
```
|
||||
Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
AsyncHTTPRequest @ IP : 192.168.2.72
|
||||
|
||||
**************************************
|
||||
@@ -696,7 +725,7 @@ AsyncHTTPRequest @ IP : 192.168.2.72
|
||||
|
||||
```
|
||||
Start AsyncWebClientRepeating_STM32_LAN8720 on BLACK_F407VE
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
AsyncHTTPRequest @ IP : 192.168.2.150
|
||||
|
||||
|
||||
@@ -751,8 +780,8 @@ AsyncHTTPRequest @ IP : 192.168.2.150
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_WT32_ETH01 on ESP32_DEV with ETH_PHY_LAN8720
|
||||
WebServer_WT32_ETH01 v1.4.1
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
WebServer_WT32_ETH01 v1.5.0
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
|
||||
AsyncHTTPRequest @ IP : 192.168.2.232
|
||||
|
||||
@@ -777,28 +806,27 @@ H
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_WT32_ETH01 on ESP32_DEV with ETH_PHY_LAN8720
|
||||
WebServer_WT32_ETH01 v1.4.1
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
WebServer_WT32_ETH01 v1.5.0
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
|
||||
AsyncHTTPRequest @ IP : 192.168.2.232
|
||||
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2021-12-30T14:08:41.290808-05:00
|
||||
day_of_week: 4
|
||||
day_of_year: 364
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
datetime: 2022-04-13T22:04:07.648721-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1640891321
|
||||
utc_datetime: 2021-12-30T19:08:41.290808+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 52
|
||||
|
||||
unixtime: 1649901847
|
||||
utc_datetime: 2022-04-14T02:04:07.648721+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
```
|
||||
|
||||
@@ -808,47 +836,47 @@ week_number: 52
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP32C3_DEV
|
||||
ESPAsync_WiFiManager v1.12.1
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
ESPAsync_WiFiManager v1.12.2
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Stored: SSID = HueNet1, Pass = password
|
||||
Got stored Credentials. Timeout 120s
|
||||
ConnectMultiWiFi in setup
|
||||
After waiting 9.23 secs more in setup(), connection result is connected. Local IP: 192.168.2.85
|
||||
H
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
client_ip: 45.72.193.77
|
||||
datetime: 2022-02-11T22:20:36.434352-05:00
|
||||
day_of_week: 5
|
||||
day_of_year: 42
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T22:05:07.648251-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1644636036
|
||||
utc_datetime: 2022-02-12T03:20:36.434352+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 6
|
||||
unixtime: 1649901907
|
||||
utc_datetime: 2022-04-14T02:05:07.648251+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHH
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
client_ip: 45.72.193.77
|
||||
datetime: 2022-02-11T22:21:36.398307-05:00
|
||||
day_of_week: 5
|
||||
day_of_year: 42
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T22:06:07.648775-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1644636096
|
||||
utc_datetime: 2022-02-12T03:21:36.398307+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 6
|
||||
unixtime: 1649901967
|
||||
utc_datetime: 2022-04-14T02:06:07.648775+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
```
|
||||
|
||||
@@ -859,48 +887,48 @@ week_number: 6
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP32S3_DEV
|
||||
ESPAsync_WiFiManager v1.12.1
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
ESPAsync_WiFiManager v1.12.2
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Stored: SSID = HueNet1, Pass = password
|
||||
Got stored Credentials. Timeout 120s
|
||||
ConnectMultiWiFi in setup
|
||||
After waiting 7.77 secs more in setup(), connection result is connected. Local IP: 192.168.2.83
|
||||
H
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
client_ip: 45.72.193.77
|
||||
datetime: 2022-02-11T22:58:46.055783-05:00
|
||||
day_of_week: 5
|
||||
day_of_year: 42
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T22:07:07.649344-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1644638326
|
||||
utc_datetime: 2022-02-12T03:58:46.055783+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 6
|
||||
unixtime: 1649902027
|
||||
utc_datetime: 2022-04-14T02:07:07.649344+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
|
||||
HHHHHH
|
||||
**************************************
|
||||
abbreviation: EST
|
||||
client_ip: 45.72.193.77
|
||||
datetime: 2022-02-11T22:59:45.988493-05:00
|
||||
day_of_week: 5
|
||||
day_of_year: 42
|
||||
dst: false
|
||||
dst_from:
|
||||
dst_offset: 0
|
||||
dst_until:
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T22:08:07.649062-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1644638385
|
||||
utc_datetime: 2022-02-12T03:59:45.988493+00:00
|
||||
utc_offset: -05:00
|
||||
week_number: 6
|
||||
unixtime: 1649902087
|
||||
utc_datetime: 2022-04-14T02:08:07.649062+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
```
|
||||
|
||||
@@ -912,7 +940,7 @@ The terminal output of [AsyncHTTPRequest_ESP_Multi example](examples/AsyncHTTPRe
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP_Multi using ESP32_DEV
|
||||
AsyncHTTPRequest_Generic v1.7.1
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Connecting to WiFi SSID: HueNet1
|
||||
.......
|
||||
AsyncHTTPSRequest @ IP : 192.168.2.88
|
||||
@@ -965,6 +993,106 @@ week_number: 8
|
||||
HHH
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 12. [AsyncHTTPRequest_ESP8266_Ethernet](examples/AsyncHTTPRequest_ESP8266_Ethernet) running on ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet
|
||||
|
||||
The terminal output of [AsyncHTTPRequest_ESP8266_Ethernet example](examples/AsyncHTTPRequest_ESP8266_Ethernet) running on `ESP8266_NODEMCU_ESP12E` to demonstrate how to use ESP8266_W5500 Ethernet Async feature.
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Connecting ethernet..
|
||||
Ethernet IP address: 192.168.2.187
|
||||
|
||||
**************************************
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T21:58:31.037966-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1649901511
|
||||
utc_datetime: 2022-04-14T01:58:31.037966+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHH
|
||||
**************************************
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T21:59:31.025188-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1649901571
|
||||
utc_datetime: 2022-04-14T01:59:31.025188+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HH
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 13. [AsyncHTTPRequest_ESP8266_Ethernet](examples/AsyncHTTPRequest_ESP8266_Ethernet) running on ESP8266_NODEMCU_ESP12E using ESP8266_ENC28J60 Ethernet
|
||||
|
||||
The terminal output of [AsyncHTTPRequest_ESP8266_Ethernet example](examples/AsyncHTTPRequest_ESP8266_Ethernet) running on `ESP8266_NODEMCU_ESP12E` to demonstrate how to use ESP8266_ENC28J60 Ethernet Async feature.
|
||||
|
||||
```
|
||||
Starting AsyncHTTPRequest_ESP8266_Ethernet on ESP8266_NODEMCU_ESP12E using ESP8266_ENC28J60 Ethernet
|
||||
AsyncHTTPRequest_Generic v1.8.2
|
||||
Connecting to network : ..........................................................
|
||||
Ethernet IP address: 192.168.2.187
|
||||
|
||||
**************************************
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T23:54:42.973735-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1649908482
|
||||
utc_datetime: 2022-04-14T03:54:42.973735+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
**************************************
|
||||
HHHHHH
|
||||
**************************************
|
||||
abbreviation: EDT
|
||||
client_ip: aaa.bbb.ccc.ddd
|
||||
datetime: 2022-04-13T23:55:42.894333-04:00
|
||||
day_of_week: 3
|
||||
day_of_year: 103
|
||||
dst: true
|
||||
dst_from: 2022-03-13T07:00:00+00:00
|
||||
dst_offset: 3600
|
||||
dst_until: 2022-11-06T06:00:00+00:00
|
||||
raw_offset: -18000
|
||||
timezone: America/Toronto
|
||||
unixtime: 1649908542
|
||||
utc_datetime: 2022-04-14T03:55:42.894333+00:00
|
||||
utc_offset: -04:00
|
||||
week_number: 15
|
||||
```
|
||||
|
||||
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
@@ -1000,7 +1128,7 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
|
||||
## TO DO
|
||||
|
||||
1. Fix bug. Add enhancement
|
||||
2. Add support to more Ethernet / WiFi shields
|
||||
2. Add support to more Ethernet / WiFi shields with lwIP-based feature.
|
||||
3. Add support to more boards.
|
||||
4. Add many more examples.
|
||||
|
||||
@@ -1022,6 +1150,8 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
|
||||
13. Add `LittleFS` support to **ESP32-C3**
|
||||
14. Use `ESP32-core's LittleFS` library instead of `Lorol's LITTLEFS` library for ESP32 core v2.0.0+
|
||||
15. Add example [AsyncHTTPRequest_ESP_Multi](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/tree/master/examples/AsyncHTTPRequest_ESP_Multi) to demonstrate how to send requests to multiple addresses and receive responses from them.
|
||||
16. Add support to ESP8266 using **W5x00** with [**lwIP_w5100**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_w5100) or [**lwIP_w5500**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_w5500) library
|
||||
17. Add support to ESP8266 using **ENC28J60** with [**lwIP_enc28j60**](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_enc28j60) library
|
||||
|
||||
|
||||
---
|
||||
@@ -1032,19 +1162,13 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
|
||||
This library is based on, modified, bug-fixed and improved from:
|
||||
|
||||
1. [Bob Lemaire's **asyncHTTPrequest Library**](https://github.com/boblemaire/asyncHTTPrequest) to use the better **asynchronous** features of these following Async TCP Libraries : ( [`ESPAsyncTCP`](https://github.com/me-no-dev/ESPAsyncTCP), [`AsyncTCP`](https://github.com/me-no-dev/AsyncTCP), and [`STM32AsyncTCP`](https://github.com/philbowles/STM32AsyncTCP) ).
|
||||
|
||||
2. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [Fixed linker errors when included in multiple .cpp files](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1) leading to v1.0.1. See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
|
||||
|
||||
3. Thanks to [gleniat](https://github.com/gleniat) to make enhancement request in [Add support for sending PUT, PATCH, DELETE request](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/5) leading to v1.1.0.
|
||||
|
||||
4. Thanks to [BadDwarf](https://github.com/baddwarf) to report [**compatibility with ESPAsyncWebServer #11**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/11) leading to the enhancement in v1.1.2.
|
||||
|
||||
5. Thanks to [spdi](https://github.com/spdi) to report [**'Connection' header expects 'disconnect' instead 'close' ? #13**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/13) leading to new release v1.1.3 to fix bug.
|
||||
|
||||
6. Thanks to [andrewk123](https://github.com/andrewk123) to report [**Http GET polling causes crash when host disconnected #22**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/22) leading to new release v1.4.0 to fix bug.
|
||||
|
||||
7. Thanks to [DavidAntonin](https://github.com/DavidAntonin) to report [Cannot send requests to different addresses #4](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/4) leading to new release v1.7.1 to demonstrate how to send requests to multiple addresses and receive responses from them.
|
||||
|
||||
8. Thanks to [per1234](https://github.com/per1234) to make PR [Remove unavailable items from depends field of library.properties](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/35) leading to v1.8.2
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -1057,6 +1181,7 @@ This library is based on, modified, bug-fixed and improved from:
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/DavidAntonin"><img src="https://github.com/DavidAntonin.png" width="100px;" alt="DavidAntonin"/><br /><sub><b>DavidAntonin</b></sub></a><br /></td>
|
||||
<td align="center"><a href="https://github.com/per1234"><img src="https://github.com/per1234.png" width="100px;" alt="per1234"/><br /><sub><b>per1234</b></sub></a><br /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
## Table of Contents
|
||||
|
||||
* [Changelog](#changelog)
|
||||
* [Releases v1.8.2](#releases-v182)
|
||||
* [Releases v1.8.1](#releases-v181)
|
||||
* [Releases v1.8.0](#releases-v180)
|
||||
* [Releases v1.7.1](#releases-v171)
|
||||
* [Releases v1.7.0](#releases-v170)
|
||||
* [Releases v1.6.0](#releases-v160)
|
||||
@@ -36,6 +39,23 @@
|
||||
|
||||
## Changelog
|
||||
|
||||
### Releases v1.8.2
|
||||
|
||||
1. Fix library.properties to remove unavailable items from depends. Check [Remove unavailable items from depends field of library.properties #35](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/35)
|
||||
2. Remove lorol's LittleFS_esp32 library dependency as LittleFS has been included in new ESP32 cores v1.0.6+
|
||||
3. Fix compile error for [AsyncHTTPRequest_ESP_WiFiManager example](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/tree/master/examples/AsyncHTTPRequest_ESP_WiFiManager)
|
||||
4. Update `Packages' Patches`
|
||||
|
||||
### Releases v1.8.1
|
||||
|
||||
1. Add support to ESP8266 using ENC28J60 with [lwIP_enc28j60](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_enc28j60) library
|
||||
|
||||
### Releases v1.8.0
|
||||
|
||||
1. Add support to ESP8266 using W5x00 with [lwIP_w5100](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_w5100) or [lwIP_w5500](https://github.com/esp8266/Arduino/tree/master/libraries/lwIP_w5500) library
|
||||
2. Add example [AsyncHTTPRequest_ESP8266_Ethernet](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/tree/master/examples/AsyncHTTPRequest_ESP8266_Ethernet) to demo the new feature.
|
||||
3. Update `Packages' Patches`
|
||||
|
||||
### Releases v1.7.1
|
||||
|
||||
1. Add example [AsyncHTTPRequest_ESP_Multi](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/tree/master/examples/AsyncHTTPRequest_ESP_Multi) to demo connection to multiple addresses.
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
/****************************************************************************************************************************
|
||||
AsyncHTTPRequest_ESP.ino - Dead simple AsyncHTTPRequest for ESP8266, ESP32 and currently STM32 with built-in LAN8742A Ethernet
|
||||
|
||||
For ESP8266, ESP32 and STM32 with built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc)
|
||||
|
||||
AsyncHTTPRequest_Generic is a library for the ESP8266, ESP32 and currently STM32 run built-in Ethernet WebServer
|
||||
|
||||
Based on and modified from asyncHTTPrequest Library (https://github.com/boblemaire/asyncHTTPrequest)
|
||||
|
||||
Built by Khoi Hoang https://github.com/khoih-prog/AsyncHTTPRequest_Generic
|
||||
Licensed under MIT license
|
||||
|
||||
Copyright (C) <2018> <Bob Lemaire, IoTaWatt, Inc.>
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
||||
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*****************************************************************************************************************************/
|
||||
//************************************************************************************************************
|
||||
//
|
||||
// There are scores of ways to use AsyncHTTPRequest. The important thing to keep in mind is that
|
||||
// it is asynchronous and just like in JavaScript, everything is event driven. You will have some
|
||||
// reason to initiate an asynchronous HTTP request in your program, but then sending the request
|
||||
// headers and payload, gathering the response headers and any payload, and processing
|
||||
// of that response, can (and probably should) all be done asynchronously.
|
||||
//
|
||||
// In this example, a Ticker function is setup to fire every 300 seconds to initiate a request.
|
||||
// Everything is handled in AsyncHTTPRequest without blocking.
|
||||
// The callback onReadyStateChange is made progressively and like most JS scripts, we look for
|
||||
// readyState == 4 (complete) here. At that time the response is retrieved and printed.
|
||||
//
|
||||
// Note that there is no code in loop(). A code entered into loop would run oblivious to
|
||||
// the ongoing HTTP requests. The Ticker could be removed and periodic calls to sendRequest()
|
||||
// could be made in loop(), resulting in the same asynchronous handling.
|
||||
//
|
||||
// For demo purposes, debug is turned on for handling of the first request. These are the
|
||||
// events that are being handled in AsyncHTTPRequest. They all begin with Debug(nnn) where
|
||||
// nnn is the elapsed time in milliseconds since the transaction was started.
|
||||
//
|
||||
//*************************************************************************************************************
|
||||
|
||||
#if !( defined(ESP8266) )
|
||||
#error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
|
||||
#endif
|
||||
|
||||
// Level from 0-4
|
||||
#define ASYNC_HTTP_DEBUG_PORT Serial
|
||||
#define _ASYNC_HTTP_LOGLEVEL_ 1
|
||||
|
||||
// 300s = 5 minutes to not flooding
|
||||
#define HTTP_REQUEST_INTERVAL 60 //300
|
||||
|
||||
// 10s
|
||||
#define HEARTBEAT_INTERVAL 10
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
#define USING_W5500 true
|
||||
#define USING_W5100 false
|
||||
#define USING_ENC28J60 false
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
#define CSPIN 16 // 5
|
||||
|
||||
#if USING_W5500
|
||||
#include "W5500lwIP.h"
|
||||
#define SHIELD_TYPE "ESP8266_W5500 Ethernet"
|
||||
|
||||
Wiznet5500lwIP eth(CSPIN);
|
||||
|
||||
#elif USING_W5100
|
||||
#include <W5100lwIP.h>
|
||||
#define SHIELD_TYPE "ESP8266_W5100 Ethernet"
|
||||
|
||||
Wiznet5100lwIP eth(CSPIN);
|
||||
|
||||
#elif USING_ENC28J60
|
||||
#include <ENC28J60lwIP.h>
|
||||
#define SHIELD_TYPE "ESP8266_ENC28J60 Ethernet"
|
||||
|
||||
ENC28J60lwIP eth(CSPIN);
|
||||
#else
|
||||
// default if none selected
|
||||
#include "W5500lwIP.h"
|
||||
|
||||
Wiznet5500lwIP eth(CSPIN);
|
||||
#endif
|
||||
|
||||
|
||||
#include <WiFiClient.h> // WiFiClient (-> TCPClient)
|
||||
|
||||
using TCPClient = WiFiClient;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.7.1"
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1007001
|
||||
|
||||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
|
||||
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
|
||||
|
||||
#include <Ticker.h>
|
||||
|
||||
AsyncHTTPRequest request;
|
||||
Ticker ticker;
|
||||
Ticker ticker1;
|
||||
|
||||
void heartBeatPrint()
|
||||
{
|
||||
static int num = 1;
|
||||
|
||||
if (eth.connected())
|
||||
Serial.print(F("H")); // H means connected to Ethernet
|
||||
else
|
||||
Serial.print(F("F")); // F means not connected to Ethernet
|
||||
|
||||
if (num == 80)
|
||||
{
|
||||
Serial.println();
|
||||
num = 1;
|
||||
}
|
||||
else if (num++ % 10 == 0)
|
||||
{
|
||||
Serial.print(F(" "));
|
||||
}
|
||||
}
|
||||
|
||||
void sendRequest()
|
||||
{
|
||||
static bool requestOpenResult;
|
||||
|
||||
if (request.readyState() == readyStateUnsent || request.readyState() == readyStateDone)
|
||||
{
|
||||
//requestOpenResult = request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt");
|
||||
requestOpenResult = request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt");
|
||||
|
||||
if (requestOpenResult)
|
||||
{
|
||||
// Only send() if open() returns true, or crash
|
||||
request.send();
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.println(F("Can't send bad request"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.println(F("Can't send request"));
|
||||
}
|
||||
}
|
||||
|
||||
void requestCB(void* optParm, AsyncHTTPRequest* request, int readyState)
|
||||
{
|
||||
(void) optParm;
|
||||
|
||||
if (readyState == readyStateDone)
|
||||
{
|
||||
Serial.println(F("\n**************************************"));
|
||||
Serial.println(request->responseText());
|
||||
Serial.println(F("**************************************"));
|
||||
|
||||
request->setDebug(false);
|
||||
}
|
||||
}
|
||||
|
||||
void initEthernet()
|
||||
{
|
||||
SPI.begin();
|
||||
SPI.setClockDivider(SPI_CLOCK_DIV4);
|
||||
SPI.setBitOrder(MSBFIRST);
|
||||
SPI.setDataMode(SPI_MODE0);
|
||||
eth.setDefault();
|
||||
|
||||
if (!eth.begin())
|
||||
{
|
||||
Serial.println("No Ethernet hardware ... Stop here");
|
||||
|
||||
while (true)
|
||||
{
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.print("Connecting to network : ");
|
||||
|
||||
while (!eth.connected())
|
||||
{
|
||||
Serial.print(".");
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println();
|
||||
Serial.print("Ethernet IP address: ");
|
||||
Serial.println(eth.localIP());
|
||||
}
|
||||
|
||||
void setup()
|
||||
{
|
||||
// put your setup code here, to run once:
|
||||
Serial.begin(115200);
|
||||
while (!Serial && millis() < 5000);
|
||||
|
||||
delay(200);
|
||||
|
||||
Serial.print(F("\nStarting AsyncHTTPRequest_ESP8266_Ethernet on ")); Serial.print(ARDUINO_BOARD);
|
||||
Serial.print(F(" using ")); Serial.println(SHIELD_TYPE);
|
||||
Serial.println(ASYNC_HTTP_REQUEST_GENERIC_VERSION);
|
||||
|
||||
initEthernet();
|
||||
|
||||
request.setDebug(false);
|
||||
|
||||
request.onReadyStateChange(requestCB);
|
||||
ticker.attach(HTTP_REQUEST_INTERVAL, sendRequest);
|
||||
|
||||
ticker1.attach(HEARTBEAT_INTERVAL, heartBeatPrint);
|
||||
|
||||
// Send first request now
|
||||
sendRequest();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
@@ -483,7 +483,9 @@ void loadConfigData()
|
||||
memset(&WM_config, 0, sizeof(WM_config));
|
||||
|
||||
// New in v1.4.0
|
||||
memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig));
|
||||
//memset(&WM_STA_IPconfig, 0, sizeof(WM_STA_IPconfig));
|
||||
// New in v1.8.2
|
||||
initSTAIPConfigStruct(WM_STA_IPconfig);
|
||||
//////
|
||||
|
||||
if (file)
|
||||
|
||||
+1
-3
@@ -79,15 +79,13 @@ IPAddress mySN(255, 255, 255, 0);
|
||||
// Google DNS Server IP
|
||||
IPAddress myDNS(8, 8, 8, 8);
|
||||
|
||||
bool eth_connected = false;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
void heartBeatPrint(void)
|
||||
{
|
||||
static int num = 1;
|
||||
|
||||
if (eth_connected)
|
||||
if (WT32_ETH01_isConnected())
|
||||
Serial.print(F("H")); // H means connected to WiFi
|
||||
else
|
||||
Serial.print(F("F")); // F means not connected to WiFi
|
||||
|
||||
@@ -79,15 +79,13 @@ IPAddress mySN(255, 255, 255, 0);
|
||||
// Google DNS Server IP
|
||||
IPAddress myDNS(8, 8, 8, 8);
|
||||
|
||||
bool eth_connected = false;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
void heartBeatPrint(void)
|
||||
{
|
||||
static int num = 1;
|
||||
|
||||
if (eth_connected)
|
||||
if (WT32_ETH01_isConnected())
|
||||
Serial.print(F("H")); // H means connected
|
||||
else
|
||||
Serial.print(F("F")); // F means not connected
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#error This code is intended to run on the ESP8266, ESP32 or STM32 platform! Please check your Tools->Board setting.
|
||||
#endif
|
||||
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.7.0"
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1007000
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.8.2"
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1008002
|
||||
|
||||
#include "multiFileProject.h"
|
||||
|
||||
|
||||
+5
-11
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name":"AsyncHTTPRequest_Generic",
|
||||
"version": "1.7.1",
|
||||
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 and currently STM32 with LAN8720 or built-in LAN8742A Ethernet.",
|
||||
"keywords":"communication, async, tcp, http, ESP8266, ESP32, ESP32-S2, ESP32-S3, ESP32-C3, wt32-eth01, ESPAsyncTCP, AsyncTCP, stm32, ethernet, wifi, lan8742a, lan8720, f407ve, nucleo, nucleo-144, stm32f7, stm32f4",
|
||||
"version": "1.8.2",
|
||||
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 (WiFi, W5x00 or ENC28J60) and currently STM32 with LAN8720 or built-in LAN8742A Ethernet.",
|
||||
"keywords":"communication, async, tcp, http, ESP8266, ESP32, ESP32-S2, ESP32-S3, ESP32-C3, wt32-eth01, stm32, ethernet, wifi, lan8742a, lan8720, f407ve, nucleo-144, stm32f7, W5x00, ENC28J60",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bob Lemaire",
|
||||
@@ -45,7 +45,7 @@
|
||||
{
|
||||
"owner": "khoih-prog",
|
||||
"name": "ESPAsync_WiFiManager",
|
||||
"version": ">=1.12.1",
|
||||
"version": ">=1.12.2",
|
||||
"platforms": ["espressif8266", "espressif32"]
|
||||
},
|
||||
{
|
||||
@@ -57,15 +57,9 @@
|
||||
{
|
||||
"owner": "stm32duino",
|
||||
"name": "STM32Ethernet",
|
||||
"version": ">=1.2.0",
|
||||
"version": ">=1.3.0",
|
||||
"platforms": "ststm32"
|
||||
},
|
||||
{
|
||||
"owner": "lorol",
|
||||
"name": "LittleFS_esp32",
|
||||
"version": ">=1.0.6",
|
||||
"platforms": ["espressif32"]
|
||||
},
|
||||
{
|
||||
"owner": "khoih-prog",
|
||||
"name": "WebServer_WT32_ETH01",
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
name=AsyncHTTPRequest_Generic
|
||||
version=1.7.1
|
||||
version=1.8.2
|
||||
author=Bob Lemaire,Khoi Hoang <khoih.prog@gmail.com>
|
||||
maintainer=Khoi Hoang <khoih.prog@gmail.com>
|
||||
icense=GPLv3
|
||||
sentence=Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 and currently STM32 with LAN8720 or built-in LAN8742A Ethernet.
|
||||
paragraph=This AsyncHTTPRequest_Generic Library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, for ESP32 (including ESP32-S2), ESP8266 and STM32 with LAN8720 or built-in LAN8742A Ethernet, such as Nucleo-144 F767ZI, F407VE, etc.
|
||||
sentence=Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 (WiFi, W5x00 or ENC28J60) and currently STM32 with LAN8720 or built-in LAN8742A Ethernet.
|
||||
paragraph=This AsyncHTTPRequest_Generic Library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, for ESP32 (including ESP32-S2), ESP8266 (WiFi, W5x00 or ENC28J60) and STM32 with LAN8720 or built-in LAN8742A Ethernet, such as Nucleo-144 F767ZI, F407VE, etc.
|
||||
category=Communication,AsyncTCP,AsyncHTTP
|
||||
url=https://github.com/khoih-prog/AsyncHTTPRequest_Generic
|
||||
architectures=*
|
||||
depends=AsyncTCP,ESPAsyncTCP,ESPAsync_WiFiManager,STM32duino LwIP,STM32duino STM32Ethernet,WebServer_WT32_ETH01
|
||||
depends=depends=ESPAsync_WiFiManager, STM32duino LwIP, STM32duino STM32Ethernet, WebServer_WT32_ETH01
|
||||
includes=AsyncHTTPRequest_Generic.h,AsyncHTTPRequest_Generic.hpp
|
||||
|
||||
@@ -42,20 +42,21 @@ lib_deps =
|
||||
; ESPAsyncTCP@>=1.2.2
|
||||
; https://github.com/khoih-prog/STM32AsyncTCP.git
|
||||
; STM32duino LwIP@>=2.1.2
|
||||
; STM32duino STM32Ethernet@>=1.2.0
|
||||
; ESPAsync_WiFiManager@>=1.12.1
|
||||
; STM32duino STM32Ethernet@>=1.3.0
|
||||
; ESPAsync_WiFiManager@>=1.12.2
|
||||
; LittleFS_esp32@>=1.0.6
|
||||
; WebServer_WT32_ETH01@>=1.4.1
|
||||
; WebServer_WT32_ETH01@>=1.5.0
|
||||
|
||||
; PlatformIO 5.x
|
||||
me-no-dev/AsyncTCP@>=1.1.1
|
||||
me-no-dev/ESPAsyncTCP@>=1.2.2
|
||||
; philbowles/STM32AsyncTCP
|
||||
; https://github.com/khoih-prog/STM32AsyncTCP.git
|
||||
; stm32duino/STM32duino LwIP@>=2.1.2
|
||||
; stm32duino/STM32duino STM32Ethernet@>=1.2.0
|
||||
khoih-prog/ESPAsync_WiFiManager@>=1.12.1
|
||||
lorol/LittleFS_esp32@>=1.0.6
|
||||
; khoih-prog/WebServer_WT32_ETH01@>=1.4.1
|
||||
; stm32duino/STM32duino STM32Ethernet@>=1.3.0
|
||||
khoih-prog/ESPAsync_WiFiManager@>=1.12.2
|
||||
; lorol/LittleFS_esp32@>=1.0.6
|
||||
; khoih-prog/WebServer_WT32_ETH01@>=1.5.0
|
||||
|
||||
build_flags =
|
||||
; set your debug output (default=Serial)
|
||||
|
||||
@@ -17,28 +17,17 @@
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Version: 1.7.1
|
||||
Version: 1.8.2
|
||||
|
||||
Version Modified By Date Comments
|
||||
------- ----------- ---------- -----------
|
||||
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
|
||||
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
|
||||
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
|
||||
1.1.0 K Hoang 23/12/2020 Add HTTP PUT, PATCH, DELETE and HEAD methods
|
||||
1.1.1 K Hoang 24/12/2020 Prevent crash if request and/or method not correct.
|
||||
1.1.2 K Hoang 11/02/2021 Rename _lock and _unlock to avoid conflict with AsyncWebServer library
|
||||
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
|
||||
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
|
||||
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
|
||||
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
|
||||
1.3.0 K Hoang 09/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720) boards
|
||||
1.3.1 K Hoang 09/10/2021 Update `platform.ini` and `library.json`
|
||||
1.4.0 K Hoang 23/11/2021 Fix crashing bug when request a non-existing IP
|
||||
1.4.1 K Hoang 29/11/2021 Auto detect ESP32 core version and improve connection time for WT32_ETH01
|
||||
1.5.0 K Hoang 30/12/2021 Fix `multiple-definitions` linker error
|
||||
1.6.0 K Hoang 23/01/2022 Enable compatibility with old code to include only AsyncHTTPRequest_Generic.h
|
||||
...
|
||||
1.7.0 K Hoang 10/02/2022 Add support to new ESP32-S3. Add LittleFS support to ESP32-C3. Use core LittleFS
|
||||
1.7.1 K Hoang 25/02/2022 Add example AsyncHTTPRequest_ESP_Multi to demo connection to multiple addresses
|
||||
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
|
||||
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
|
||||
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
|
||||
*****************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -17,28 +17,17 @@
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Version: 1.7.1
|
||||
Version: 1.8.2
|
||||
|
||||
Version Modified By Date Comments
|
||||
------- ----------- ---------- -----------
|
||||
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
|
||||
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
|
||||
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
|
||||
1.1.0 K Hoang 23/12/2020 Add HTTP PUT, PATCH, DELETE and HEAD methods
|
||||
1.1.1 K Hoang 24/12/2020 Prevent crash if request and/or method not correct.
|
||||
1.1.2 K Hoang 11/02/2021 Rename _lock and _unlock to avoid conflict with AsyncWebServer library
|
||||
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
|
||||
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
|
||||
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
|
||||
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
|
||||
1.3.0 K Hoang 09/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720) boards
|
||||
1.3.1 K Hoang 09/10/2021 Update `platform.ini` and `library.json`
|
||||
1.4.0 K Hoang 23/11/2021 Fix crashing bug when request a non-existing IP
|
||||
1.4.1 K Hoang 29/11/2021 Auto detect ESP32 core version and improve connection time for WT32_ETH01
|
||||
1.5.0 K Hoang 30/12/2021 Fix `multiple-definitions` linker error
|
||||
1.6.0 K Hoang 23/01/2022 Enable compatibility with old code to include only AsyncHTTPRequest_Generic.h
|
||||
...
|
||||
1.7.0 K Hoang 10/02/2022 Add support to new ESP32-S3. Add LittleFS support to ESP32-C3. Use core LittleFS
|
||||
1.7.1 K Hoang 25/02/2022 Add example AsyncHTTPRequest_ESP_Multi to demo connection to multiple addresses
|
||||
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
|
||||
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
|
||||
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
|
||||
*****************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -17,28 +17,17 @@
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Version: 1.7.1
|
||||
Version: 1.8.2
|
||||
|
||||
Version Modified By Date Comments
|
||||
------- ----------- ---------- -----------
|
||||
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
|
||||
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
|
||||
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
|
||||
1.1.0 K Hoang 23/12/2020 Add HTTP PUT, PATCH, DELETE and HEAD methods
|
||||
1.1.1 K Hoang 24/12/2020 Prevent crash if request and/or method not correct.
|
||||
1.1.2 K Hoang 11/02/2021 Rename _lock and _unlock to avoid conflict with AsyncWebServer library
|
||||
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
|
||||
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
|
||||
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
|
||||
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
|
||||
1.3.0 K Hoang 09/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720) boards
|
||||
1.3.1 K Hoang 09/10/2021 Update `platform.ini` and `library.json`
|
||||
1.4.0 K Hoang 23/11/2021 Fix crashing bug when request a non-existing IP
|
||||
1.4.1 K Hoang 29/11/2021 Auto detect ESP32 core version and improve connection time for WT32_ETH01
|
||||
1.5.0 K Hoang 30/12/2021 Fix `multiple-definitions` linker error
|
||||
1.6.0 K Hoang 23/01/2022 Enable compatibility with old code to include only AsyncHTTPRequest_Generic.h
|
||||
...
|
||||
1.7.0 K Hoang 10/02/2022 Add support to new ESP32-S3. Add LittleFS support to ESP32-C3. Use core LittleFS
|
||||
1.7.1 K Hoang 25/02/2022 Add example AsyncHTTPRequest_ESP_Multi to demo connection to multiple addresses
|
||||
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
|
||||
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
|
||||
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
|
||||
*****************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
@@ -46,13 +35,13 @@
|
||||
#ifndef ASYNC_HTTP_REQUEST_GENERIC_HPP
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_HPP
|
||||
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION "AsyncHTTPRequest_Generic v1.7.1"
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION "AsyncHTTPRequest_Generic v1.8.2"
|
||||
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MAJOR 1
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MINOR 7
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_PATCH 1
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MINOR 8
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_PATCH 2
|
||||
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_INT 1007001
|
||||
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_INT 1008002
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
|
||||
@@ -17,28 +17,17 @@
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Version: 1.7.1
|
||||
Version: 1.8.2
|
||||
|
||||
Version Modified By Date Comments
|
||||
------- ----------- ---------- -----------
|
||||
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
|
||||
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
|
||||
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
|
||||
1.1.0 K Hoang 23/12/2020 Add HTTP PUT, PATCH, DELETE and HEAD methods
|
||||
1.1.1 K Hoang 24/12/2020 Prevent crash if request and/or method not correct.
|
||||
1.1.2 K Hoang 11/02/2021 Rename _lock and _unlock to avoid conflict with AsyncWebServer library
|
||||
1.1.3 K Hoang 25/02/2021 Fix non-persistent Connection header bug
|
||||
1.1.4 K Hoang 21/03/2021 Fix `library.properties` dependency
|
||||
1.1.5 K Hoang 22/03/2021 Fix dependency on STM32AsyncTCP Library
|
||||
1.2.0 K Hoang 11/04/2021 Add support to LAN8720 using STM32F4 or STM32F7
|
||||
1.3.0 K Hoang 09/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720) boards
|
||||
1.3.1 K Hoang 09/10/2021 Update `platform.ini` and `library.json`
|
||||
1.4.0 K Hoang 23/11/2021 Fix crashing bug when request a non-existing IP
|
||||
1.4.1 K Hoang 29/11/2021 Auto detect ESP32 core version and improve connection time for WT32_ETH01
|
||||
1.5.0 K Hoang 30/12/2021 Fix `multiple-definitions` linker error
|
||||
1.6.0 K Hoang 23/01/2022 Enable compatibility with old code to include only AsyncHTTPRequest_Generic.h
|
||||
...
|
||||
1.7.0 K Hoang 10/02/2022 Add support to new ESP32-S3. Add LittleFS support to ESP32-C3. Use core LittleFS
|
||||
1.7.1 K Hoang 25/02/2022 Add example AsyncHTTPRequest_ESP_Multi to demo connection to multiple addresses
|
||||
1.8.0 K Hoang 13/04/2022 Add support to ESP8266 using W5x00 with lwip_W5100 or lwip_W5500 library
|
||||
1.8.1 K Hoang 13/04/2022 Add support to ESP8266 using ENC28J60 with lwip_enc28j60 library
|
||||
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
|
||||
*****************************************************************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
Reference in New Issue
Block a user