mirror of
https://github.com/khoih-prog/AsyncHTTPRequest_Generic.git
synced 2025-07-31 02:47:14 +02:00
Update Packages' Patches
This commit is contained in:
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f4xx_hal_conf_default.h
|
@file stm32f4xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -90,10 +90,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -103,25 +103,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -131,10 +131,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -144,8 +144,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -206,9 +206,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1U */
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -235,8 +235,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* LAN8742A PHY Address*/
|
/* LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -282,8 +282,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -291,8 +291,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f4xx_hal_rcc.h"
|
#include "stm32f4xx_hal_rcc.h"
|
||||||
@ -489,13 +489,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f7xx_hal_conf_default.h
|
@file stm32f7xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -90,10 +90,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -103,25 +103,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -131,10 +131,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -144,8 +144,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -203,9 +203,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1 */
|
/* #define USE_FULL_ASSERT 1 */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -232,8 +232,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* LAN8742A PHY Address*/
|
/* LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -279,8 +279,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -288,8 +288,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f7xx_hal_rcc.h"
|
#include "stm32f7xx_hal_rcc.h"
|
||||||
@ -486,13 +486,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -24,8 +24,8 @@ extern "C" {
|
|||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PG9 0
|
#define PG9 0
|
||||||
#define PG14 1
|
#define PG14 1
|
||||||
@ -156,30 +156,30 @@ extern "C" {
|
|||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
|
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _VARIANT_ARDUINO_STM32_ */
|
#endif /* _VARIANT_ARDUINO_STM32_ */
|
||||||
|
@ -24,8 +24,8 @@ extern "C" {
|
|||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PA3 0
|
#define PA3 0
|
||||||
#define PA2 1
|
#define PA2 1
|
||||||
@ -116,30 +116,30 @@ extern "C" {
|
|||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
|
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _VARIANT_ARDUINO_STM32_ */
|
#endif /* _VARIANT_ARDUINO_STM32_ */
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f4xx_hal_conf_default.h
|
@file stm32f4xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -91,10 +91,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -104,25 +104,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -132,10 +132,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -145,8 +145,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -208,9 +208,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1U */
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -237,8 +237,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* LAN8742A PHY Address*/
|
/* LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -284,8 +284,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -293,8 +293,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f4xx_hal_rcc.h"
|
#include "stm32f4xx_hal_rcc.h"
|
||||||
@ -495,13 +495,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f7xx_hal_conf_default.h
|
@file stm32f7xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -90,10 +90,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -103,25 +103,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -131,10 +131,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -144,8 +144,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -203,9 +203,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1 */
|
/* #define USE_FULL_ASSERT 1 */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -232,8 +232,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* LAN8742A PHY Address*/
|
/* LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -279,8 +279,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -288,8 +288,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f7xx_hal_rcc.h"
|
#include "stm32f7xx_hal_rcc.h"
|
||||||
@ -486,13 +486,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PG9 0
|
#define PG9 0
|
||||||
#define PG14 1
|
#define PG14 1
|
||||||
@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PB0
|
#define LED_BUILTIN PB0
|
||||||
#endif
|
#endif
|
||||||
#define LED_GREEN LED_BUILTIN
|
#define LED_GREEN LED_BUILTIN
|
||||||
#define LED_BLUE PB7
|
#define LED_BLUE PB7
|
||||||
@ -196,29 +196,29 @@
|
|||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PC13
|
#define USER_BTN PC13
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM7
|
#define TIMER_SERVO TIM7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
||||||
#endif
|
#endif
|
||||||
// Serial pin used for console (ex: stlink)
|
// Serial pin used for console (ex: stlink)
|
||||||
// Rerquired by Firmata
|
// Rerquired by Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PD9
|
#define PIN_SERIAL_RX PD9
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PD8
|
#define PIN_SERIAL_TX PD8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Value of the External oscillator in Hz
|
// Value of the External oscillator in Hz
|
||||||
@ -226,16 +226,16 @@
|
|||||||
|
|
||||||
/* Extra HAL modules */
|
/* Extra HAL modules */
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_ETH_MODULE_DISABLED)
|
#if !defined(HAL_ETH_MODULE_DISABLED)
|
||||||
#define HAL_ETH_MODULE_ENABLED
|
#define HAL_ETH_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
||||||
#define HAL_QSPI_MODULE_ENABLED
|
#define HAL_QSPI_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_SD_MODULE_DISABLED)
|
#if !defined(HAL_SD_MODULE_DISABLED)
|
||||||
#define HAL_SD_MODULE_ENABLED
|
#define HAL_SD_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
||||||
@ -244,31 +244,31 @@
|
|||||||
#define FLASH_DATA_SECTOR 11
|
#define FLASH_DATA_SECTOR 11
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* STM32 pins number
|
STM32 pins number
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#define PA0 PIN_A0
|
#define PA0 PIN_A0
|
||||||
#define PA1 PIN_A1
|
#define PA1 PIN_A1
|
||||||
#define PA2 PIN_A2
|
#define PA2 PIN_A2
|
||||||
@ -75,99 +75,99 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PNUM_NOT_DEFINED
|
#define LED_BUILTIN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PNUM_NOT_DEFINED
|
#define USER_BTN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SPI definitions
|
// SPI definitions
|
||||||
#ifndef PIN_SPI_SS
|
#ifndef PIN_SPI_SS
|
||||||
#define PIN_SPI_SS PA4
|
#define PIN_SPI_SS PA4
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS1
|
#ifndef PIN_SPI_SS1
|
||||||
#define PIN_SPI_SS1 PA15
|
#define PIN_SPI_SS1 PA15
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS2
|
#ifndef PIN_SPI_SS2
|
||||||
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS3
|
#ifndef PIN_SPI_SS3
|
||||||
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MOSI
|
#ifndef PIN_SPI_MOSI
|
||||||
#define PIN_SPI_MOSI PA7
|
#define PIN_SPI_MOSI PA7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MISO
|
#ifndef PIN_SPI_MISO
|
||||||
#define PIN_SPI_MISO PA6
|
#define PIN_SPI_MISO PA6
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SCK
|
#ifndef PIN_SPI_SCK
|
||||||
#define PIN_SPI_SCK PA5
|
#define PIN_SPI_SCK PA5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// I2C definitions
|
// I2C definitions
|
||||||
#ifndef PIN_WIRE_SDA
|
#ifndef PIN_WIRE_SDA
|
||||||
#define PIN_WIRE_SDA PB7
|
#define PIN_WIRE_SDA PB7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_WIRE_SCL
|
#ifndef PIN_WIRE_SCL
|
||||||
#define PIN_WIRE_SCL PB6
|
#define PIN_WIRE_SCL PB6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM21
|
#define TIMER_SERVO TIM21
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 2
|
#define SERIAL_UART_INSTANCE 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default pin used for generic 'Serial' instance
|
// Default pin used for generic 'Serial' instance
|
||||||
// Mandatory for Firmata
|
// Mandatory for Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PA3
|
#define PIN_SERIAL_RX PA3
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PA2
|
#define PIN_SERIAL_TX PA2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Extra HAL modules
|
// Extra HAL modules
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PG9 0
|
#define PG9 0
|
||||||
#define PG14 1
|
#define PG14 1
|
||||||
@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PB0
|
#define LED_BUILTIN PB0
|
||||||
#endif
|
#endif
|
||||||
#define LED_GREEN LED_BUILTIN
|
#define LED_GREEN LED_BUILTIN
|
||||||
#define LED_BLUE PB7
|
#define LED_BLUE PB7
|
||||||
@ -196,29 +196,29 @@
|
|||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PC13
|
#define USER_BTN PC13
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM7
|
#define TIMER_SERVO TIM7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
||||||
#endif
|
#endif
|
||||||
// Serial pin used for console (ex: stlink)
|
// Serial pin used for console (ex: stlink)
|
||||||
// Rerquired by Firmata
|
// Rerquired by Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PD9
|
#define PIN_SERIAL_RX PD9
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PD8
|
#define PIN_SERIAL_TX PD8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Value of the External oscillator in Hz
|
// Value of the External oscillator in Hz
|
||||||
@ -226,16 +226,16 @@
|
|||||||
|
|
||||||
/* Extra HAL modules */
|
/* Extra HAL modules */
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_ETH_MODULE_DISABLED)
|
#if !defined(HAL_ETH_MODULE_DISABLED)
|
||||||
#define HAL_ETH_MODULE_ENABLED
|
#define HAL_ETH_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
||||||
#define HAL_QSPI_MODULE_ENABLED
|
#define HAL_QSPI_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_SD_MODULE_DISABLED)
|
#if !defined(HAL_SD_MODULE_DISABLED)
|
||||||
#define HAL_SD_MODULE_ENABLED
|
#define HAL_SD_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
||||||
@ -244,31 +244,31 @@
|
|||||||
#define FLASH_DATA_SECTOR 11
|
#define FLASH_DATA_SECTOR 11
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* STM32 pins number
|
STM32 pins number
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#define PA0 PIN_A0
|
#define PA0 PIN_A0
|
||||||
#define PA1 PIN_A1
|
#define PA1 PIN_A1
|
||||||
#define PA2 PIN_A2
|
#define PA2 PIN_A2
|
||||||
@ -75,99 +75,99 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PNUM_NOT_DEFINED
|
#define LED_BUILTIN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PNUM_NOT_DEFINED
|
#define USER_BTN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SPI definitions
|
// SPI definitions
|
||||||
#ifndef PIN_SPI_SS
|
#ifndef PIN_SPI_SS
|
||||||
#define PIN_SPI_SS PA4
|
#define PIN_SPI_SS PA4
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS1
|
#ifndef PIN_SPI_SS1
|
||||||
#define PIN_SPI_SS1 PA15
|
#define PIN_SPI_SS1 PA15
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS2
|
#ifndef PIN_SPI_SS2
|
||||||
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS3
|
#ifndef PIN_SPI_SS3
|
||||||
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MOSI
|
#ifndef PIN_SPI_MOSI
|
||||||
#define PIN_SPI_MOSI PA7
|
#define PIN_SPI_MOSI PA7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MISO
|
#ifndef PIN_SPI_MISO
|
||||||
#define PIN_SPI_MISO PA6
|
#define PIN_SPI_MISO PA6
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SCK
|
#ifndef PIN_SPI_SCK
|
||||||
#define PIN_SPI_SCK PA5
|
#define PIN_SPI_SCK PA5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// I2C definitions
|
// I2C definitions
|
||||||
#ifndef PIN_WIRE_SDA
|
#ifndef PIN_WIRE_SDA
|
||||||
#define PIN_WIRE_SDA PB7
|
#define PIN_WIRE_SDA PB7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_WIRE_SCL
|
#ifndef PIN_WIRE_SCL
|
||||||
#define PIN_WIRE_SCL PB6
|
#define PIN_WIRE_SCL PB6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM21
|
#define TIMER_SERVO TIM21
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 2
|
#define SERIAL_UART_INSTANCE 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default pin used for generic 'Serial' instance
|
// Default pin used for generic 'Serial' instance
|
||||||
// Mandatory for Firmata
|
// Mandatory for Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PA3
|
#define PIN_SERIAL_RX PA3
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PA2
|
#define PIN_SERIAL_TX PA2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Extra HAL modules
|
// Extra HAL modules
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f4xx_hal_conf_default.h
|
@file stm32f4xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -91,10 +91,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -104,25 +104,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -132,10 +132,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -145,8 +145,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -208,9 +208,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1U */
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -237,8 +237,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* LAN8742A PHY Address*/
|
/* LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -284,8 +284,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -293,8 +293,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f4xx_hal_rcc.h"
|
#include "stm32f4xx_hal_rcc.h"
|
||||||
@ -495,13 +495,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f7xx_hal_conf_default.h
|
@file stm32f7xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -90,10 +90,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -103,25 +103,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -131,10 +131,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -144,8 +144,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -203,9 +203,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1 */
|
/* #define USE_FULL_ASSERT 1 */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -232,8 +232,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* LAN8742A PHY Address*/
|
/* LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -279,8 +279,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -288,8 +288,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f7xx_hal_rcc.h"
|
#include "stm32f7xx_hal_rcc.h"
|
||||||
@ -486,13 +486,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PG9 0
|
#define PG9 0
|
||||||
#define PG14 1
|
#define PG14 1
|
||||||
@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PB0
|
#define LED_BUILTIN PB0
|
||||||
#endif
|
#endif
|
||||||
#define LED_GREEN LED_BUILTIN
|
#define LED_GREEN LED_BUILTIN
|
||||||
#define LED_BLUE PB7
|
#define LED_BLUE PB7
|
||||||
@ -196,29 +196,29 @@
|
|||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PC13
|
#define USER_BTN PC13
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM7
|
#define TIMER_SERVO TIM7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
||||||
#endif
|
#endif
|
||||||
// Serial pin used for console (ex: stlink)
|
// Serial pin used for console (ex: stlink)
|
||||||
// Rerquired by Firmata
|
// Rerquired by Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PD9
|
#define PIN_SERIAL_RX PD9
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PD8
|
#define PIN_SERIAL_TX PD8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Value of the External oscillator in Hz
|
// Value of the External oscillator in Hz
|
||||||
@ -226,16 +226,16 @@
|
|||||||
|
|
||||||
/* Extra HAL modules */
|
/* Extra HAL modules */
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_ETH_MODULE_DISABLED)
|
#if !defined(HAL_ETH_MODULE_DISABLED)
|
||||||
#define HAL_ETH_MODULE_ENABLED
|
#define HAL_ETH_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
||||||
#define HAL_QSPI_MODULE_ENABLED
|
#define HAL_QSPI_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_SD_MODULE_DISABLED)
|
#if !defined(HAL_SD_MODULE_DISABLED)
|
||||||
#define HAL_SD_MODULE_ENABLED
|
#define HAL_SD_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
||||||
@ -244,31 +244,31 @@
|
|||||||
#define FLASH_DATA_SECTOR 11
|
#define FLASH_DATA_SECTOR 11
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* STM32 pins number
|
STM32 pins number
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#define PA0 PIN_A0
|
#define PA0 PIN_A0
|
||||||
#define PA1 PIN_A1
|
#define PA1 PIN_A1
|
||||||
#define PA2 PIN_A2
|
#define PA2 PIN_A2
|
||||||
@ -75,99 +75,99 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PNUM_NOT_DEFINED
|
#define LED_BUILTIN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PNUM_NOT_DEFINED
|
#define USER_BTN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SPI definitions
|
// SPI definitions
|
||||||
#ifndef PIN_SPI_SS
|
#ifndef PIN_SPI_SS
|
||||||
#define PIN_SPI_SS PA4
|
#define PIN_SPI_SS PA4
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS1
|
#ifndef PIN_SPI_SS1
|
||||||
#define PIN_SPI_SS1 PA15
|
#define PIN_SPI_SS1 PA15
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS2
|
#ifndef PIN_SPI_SS2
|
||||||
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS3
|
#ifndef PIN_SPI_SS3
|
||||||
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MOSI
|
#ifndef PIN_SPI_MOSI
|
||||||
#define PIN_SPI_MOSI PA7
|
#define PIN_SPI_MOSI PA7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MISO
|
#ifndef PIN_SPI_MISO
|
||||||
#define PIN_SPI_MISO PA6
|
#define PIN_SPI_MISO PA6
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SCK
|
#ifndef PIN_SPI_SCK
|
||||||
#define PIN_SPI_SCK PA5
|
#define PIN_SPI_SCK PA5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// I2C definitions
|
// I2C definitions
|
||||||
#ifndef PIN_WIRE_SDA
|
#ifndef PIN_WIRE_SDA
|
||||||
#define PIN_WIRE_SDA PB7
|
#define PIN_WIRE_SDA PB7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_WIRE_SCL
|
#ifndef PIN_WIRE_SCL
|
||||||
#define PIN_WIRE_SCL PB6
|
#define PIN_WIRE_SCL PB6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM21
|
#define TIMER_SERVO TIM21
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 2
|
#define SERIAL_UART_INSTANCE 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default pin used for generic 'Serial' instance
|
// Default pin used for generic 'Serial' instance
|
||||||
// Mandatory for Firmata
|
// Mandatory for Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PA3
|
#define PIN_SERIAL_RX PA3
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PA2
|
#define PIN_SERIAL_TX PA2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Extra HAL modules
|
// Extra HAL modules
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f4xx_hal_conf_default.h
|
@file stm32f4xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -91,10 +91,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -104,25 +104,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -132,10 +132,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -145,8 +145,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -208,9 +208,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1U */
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -237,8 +237,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* KH, LAN8742A PHY Address*/
|
/* KH, LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -284,8 +284,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -293,8 +293,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f4xx_hal_rcc.h"
|
#include "stm32f4xx_hal_rcc.h"
|
||||||
@ -495,13 +495,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f7xx_hal_conf_default.h
|
@file stm32f7xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -90,10 +90,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -103,25 +103,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -131,10 +131,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -144,8 +144,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -203,9 +203,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1 */
|
/* #define USE_FULL_ASSERT 1 */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -232,8 +232,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* KH, LAN8742A PHY Address*/
|
/* KH, LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -279,8 +279,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -288,8 +288,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f7xx_hal_rcc.h"
|
#include "stm32f7xx_hal_rcc.h"
|
||||||
@ -486,13 +486,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PG9 0
|
#define PG9 0
|
||||||
#define PG14 1
|
#define PG14 1
|
||||||
@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PB0
|
#define LED_BUILTIN PB0
|
||||||
#endif
|
#endif
|
||||||
#define LED_GREEN LED_BUILTIN
|
#define LED_GREEN LED_BUILTIN
|
||||||
#define LED_BLUE PB7
|
#define LED_BLUE PB7
|
||||||
@ -196,29 +196,29 @@
|
|||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PC13
|
#define USER_BTN PC13
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM7
|
#define TIMER_SERVO TIM7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
||||||
#endif
|
#endif
|
||||||
// Serial pin used for console (ex: stlink)
|
// Serial pin used for console (ex: stlink)
|
||||||
// Rerquired by Firmata
|
// Rerquired by Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PD9
|
#define PIN_SERIAL_RX PD9
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PD8
|
#define PIN_SERIAL_TX PD8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Value of the External oscillator in Hz
|
// Value of the External oscillator in Hz
|
||||||
@ -226,16 +226,16 @@
|
|||||||
|
|
||||||
/* Extra HAL modules */
|
/* Extra HAL modules */
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_ETH_MODULE_DISABLED)
|
#if !defined(HAL_ETH_MODULE_DISABLED)
|
||||||
#define HAL_ETH_MODULE_ENABLED
|
#define HAL_ETH_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
||||||
#define HAL_QSPI_MODULE_ENABLED
|
#define HAL_QSPI_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_SD_MODULE_DISABLED)
|
#if !defined(HAL_SD_MODULE_DISABLED)
|
||||||
#define HAL_SD_MODULE_ENABLED
|
#define HAL_SD_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
||||||
@ -244,31 +244,31 @@
|
|||||||
#define FLASH_DATA_SECTOR 11
|
#define FLASH_DATA_SECTOR 11
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* STM32 pins number
|
STM32 pins number
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#define PA0 PIN_A0
|
#define PA0 PIN_A0
|
||||||
#define PA1 PIN_A1
|
#define PA1 PIN_A1
|
||||||
#define PA2 PIN_A2
|
#define PA2 PIN_A2
|
||||||
@ -75,99 +75,99 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PNUM_NOT_DEFINED
|
#define LED_BUILTIN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PNUM_NOT_DEFINED
|
#define USER_BTN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SPI definitions
|
// SPI definitions
|
||||||
#ifndef PIN_SPI_SS
|
#ifndef PIN_SPI_SS
|
||||||
#define PIN_SPI_SS PA4
|
#define PIN_SPI_SS PA4
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS1
|
#ifndef PIN_SPI_SS1
|
||||||
#define PIN_SPI_SS1 PA15
|
#define PIN_SPI_SS1 PA15
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS2
|
#ifndef PIN_SPI_SS2
|
||||||
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS3
|
#ifndef PIN_SPI_SS3
|
||||||
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MOSI
|
#ifndef PIN_SPI_MOSI
|
||||||
#define PIN_SPI_MOSI PA7
|
#define PIN_SPI_MOSI PA7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MISO
|
#ifndef PIN_SPI_MISO
|
||||||
#define PIN_SPI_MISO PA6
|
#define PIN_SPI_MISO PA6
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SCK
|
#ifndef PIN_SPI_SCK
|
||||||
#define PIN_SPI_SCK PA5
|
#define PIN_SPI_SCK PA5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// I2C definitions
|
// I2C definitions
|
||||||
#ifndef PIN_WIRE_SDA
|
#ifndef PIN_WIRE_SDA
|
||||||
#define PIN_WIRE_SDA PB7
|
#define PIN_WIRE_SDA PB7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_WIRE_SCL
|
#ifndef PIN_WIRE_SCL
|
||||||
#define PIN_WIRE_SCL PB6
|
#define PIN_WIRE_SCL PB6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM21
|
#define TIMER_SERVO TIM21
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 2
|
#define SERIAL_UART_INSTANCE 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default pin used for generic 'Serial' instance
|
// Default pin used for generic 'Serial' instance
|
||||||
// Mandatory for Firmata
|
// Mandatory for Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PA3
|
#define PIN_SERIAL_RX PA3
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PA2
|
#define PIN_SERIAL_TX PA2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Extra HAL modules
|
// Extra HAL modules
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f4xx_hal_conf_default.h
|
@file stm32f4xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
<h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.</center></h2>
|
All rights reserved.</center></h2>
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F4xx_HAL_CONF_DEFAULT_H
|
||||||
@ -29,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -92,10 +92,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -105,25 +105,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -133,10 +133,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -146,8 +146,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -209,9 +209,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1U */
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -238,8 +238,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* KH, LAN8742A PHY Address*/
|
/* KH, LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -285,8 +285,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -294,8 +294,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f4xx_hal_rcc.h"
|
#include "stm32f4xx_hal_rcc.h"
|
||||||
@ -500,13 +500,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f7xx_hal_conf_default.h
|
@file stm32f7xx_hal_conf_default.h
|
||||||
* @brief HAL default configuration file.
|
@brief HAL default configuration file.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
@attention
|
||||||
*
|
|
||||||
* Copyright (c) 2017 STMicroelectronics.
|
Copyright (c) 2017 STMicroelectronics.
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software is licensed under terms that can be found in the LICENSE file
|
This software is licensed under terms that can be found in the LICENSE file
|
||||||
* in the root directory of this software component.
|
in the root directory of this software component.
|
||||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
*
|
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
#ifndef __STM32F7xx_HAL_CONF_DEFAULT_H
|
||||||
@ -28,14 +28,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## Module Selection ############################## */
|
/* ########################## Module Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Include the default list of modules to be used in the HAL driver
|
@brief Include the default list of modules to be used in the HAL driver
|
||||||
* and manage module deactivation
|
and manage module deactivation
|
||||||
*/
|
*/
|
||||||
#include "stm32yyxx_hal_conf.h"
|
#include "stm32yyxx_hal_conf.h"
|
||||||
#if 0
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This is the list of modules to be used in the HAL driver
|
@brief This is the list of modules to be used in the HAL driver
|
||||||
*/
|
*/
|
||||||
#define HAL_MODULE_ENABLED
|
#define HAL_MODULE_ENABLED
|
||||||
#define HAL_ADC_MODULE_ENABLED
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
#define HAL_CAN_MODULE_ENABLED
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
@ -89,10 +89,10 @@ extern "C" {
|
|||||||
|
|
||||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
/**
|
/**
|
||||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
@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
|
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).
|
(when HSE is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSE_VALUE)
|
#if !defined (HSE_VALUE)
|
||||||
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||||
#endif /* HSE_VALUE */
|
#endif /* HSE_VALUE */
|
||||||
@ -102,25 +102,25 @@ extern "C" {
|
|||||||
#endif /* HSE_STARTUP_TIMEOUT */
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal High Speed oscillator (HSI) value.
|
@brief Internal High Speed oscillator (HSI) value.
|
||||||
* This value is used by the RCC HAL module to compute the system frequency
|
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).
|
(when HSI is used as system clock source, directly or through the PLL).
|
||||||
*/
|
*/
|
||||||
#if !defined (HSI_VALUE)
|
#if !defined (HSI_VALUE)
|
||||||
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* HSI_VALUE */
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Internal Low Speed oscillator (LSI) value.
|
@brief Internal Low Speed oscillator (LSI) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSI_VALUE)
|
#if !defined (LSI_VALUE)
|
||||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
The real value may vary depending on the variations
|
The real value may vary depending on the variations
|
||||||
in voltage and temperature. */
|
in voltage and temperature. */
|
||||||
/**
|
/**
|
||||||
* @brief External Low Speed oscillator (LSE) value.
|
@brief External Low Speed oscillator (LSE) value.
|
||||||
*/
|
*/
|
||||||
#if !defined (LSE_VALUE)
|
#if !defined (LSE_VALUE)
|
||||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
#endif /* LSE_VALUE */
|
#endif /* LSE_VALUE */
|
||||||
@ -130,10 +130,10 @@ in voltage and temperature. */
|
|||||||
#endif /* LSE_STARTUP_TIMEOUT */
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief External clock source for I2S peripheral
|
@brief External clock source for I2S peripheral
|
||||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
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.
|
frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
*/
|
*/
|
||||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
@ -143,8 +143,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################### System Configuration ######################### */
|
/* ########################### System Configuration ######################### */
|
||||||
/**
|
/**
|
||||||
* @brief This is the HAL system configuration section
|
@brief This is the HAL system configuration section
|
||||||
*/
|
*/
|
||||||
#if !defined (VDD_VALUE)
|
#if !defined (VDD_VALUE)
|
||||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
#endif
|
#endif
|
||||||
@ -202,9 +202,9 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* ########################## Assert Selection ############################## */
|
/* ########################## Assert Selection ############################## */
|
||||||
/**
|
/**
|
||||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
@brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
* HAL drivers code
|
HAL drivers code
|
||||||
*/
|
*/
|
||||||
/* #define USE_FULL_ASSERT 1 */
|
/* #define USE_FULL_ASSERT 1 */
|
||||||
|
|
||||||
/* ################## Ethernet peripheral configuration ##################### */
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
@ -231,8 +231,8 @@ in voltage and temperature. */
|
|||||||
//#define LAN8742A_PHY_ADDRESS 0x00U
|
//#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
/* Section 2: PHY configuration section */
|
/* Section 2: PHY configuration section */
|
||||||
#if !defined (LAN8742A_PHY_ADDRESS)
|
#if !defined (LAN8742A_PHY_ADDRESS)
|
||||||
/* KH, LAN8742A PHY Address*/
|
/* KH, LAN8742A PHY Address*/
|
||||||
#define LAN8742A_PHY_ADDRESS 0x00U
|
#define LAN8742A_PHY_ADDRESS 0x00U
|
||||||
#endif
|
#endif
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
@ -278,8 +278,8 @@ in voltage and temperature. */
|
|||||||
/* ################## SPI peripheral configuration ########################## */
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
* Activated: CRC code is present inside driver
|
Activated: CRC code is present inside driver
|
||||||
* Deactivated: CRC code cleaned from driver
|
Deactivated: CRC code cleaned from driver
|
||||||
*/
|
*/
|
||||||
#if !defined (USE_SPI_CRC)
|
#if !defined (USE_SPI_CRC)
|
||||||
#define USE_SPI_CRC 0U
|
#define USE_SPI_CRC 0U
|
||||||
@ -287,8 +287,8 @@ in voltage and temperature. */
|
|||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* @brief Include module's header file
|
@brief Include module's header file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAL_RCC_MODULE_ENABLED
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
#include "stm32f7xx_hal_rcc.h"
|
#include "stm32f7xx_hal_rcc.h"
|
||||||
@ -485,13 +485,13 @@ in voltage and temperature. */
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief The assert_param macro is used for function's parameters check.
|
@brief The assert_param macro is used for function's parameters check.
|
||||||
* @param expr If expr is false, it calls assert_failed function
|
@param expr If expr is false, it calls assert_failed function
|
||||||
* which reports the name of the source file and the source
|
which reports the name of the source file and the source
|
||||||
* line number of the call that failed.
|
line number of the call that failed.
|
||||||
* If expr is true, it returns no value.
|
If expr is true, it returns no value.
|
||||||
* @retval None
|
@retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t *file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Pins
|
Pins
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define PG9 0
|
#define PG9 0
|
||||||
#define PG14 1
|
#define PG14 1
|
||||||
@ -188,7 +188,7 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PB0
|
#define LED_BUILTIN PB0
|
||||||
#endif
|
#endif
|
||||||
#define LED_GREEN LED_BUILTIN
|
#define LED_GREEN LED_BUILTIN
|
||||||
#define LED_BLUE PB7
|
#define LED_BLUE PB7
|
||||||
@ -196,29 +196,29 @@
|
|||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PC13
|
#define USER_BTN PC13
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM7
|
#define TIMER_SERVO TIM7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
#define SERIAL_UART_INSTANCE 3 //Connected to ST-Link
|
||||||
#endif
|
#endif
|
||||||
// Serial pin used for console (ex: stlink)
|
// Serial pin used for console (ex: stlink)
|
||||||
// Rerquired by Firmata
|
// Rerquired by Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PD9
|
#define PIN_SERIAL_RX PD9
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PD8
|
#define PIN_SERIAL_TX PD8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Value of the External oscillator in Hz
|
// Value of the External oscillator in Hz
|
||||||
@ -226,16 +226,16 @@
|
|||||||
|
|
||||||
/* Extra HAL modules */
|
/* Extra HAL modules */
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_ETH_MODULE_DISABLED)
|
#if !defined(HAL_ETH_MODULE_DISABLED)
|
||||||
#define HAL_ETH_MODULE_ENABLED
|
#define HAL_ETH_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
#if !defined(HAL_QSPI_MODULE_DISABLED)
|
||||||
#define HAL_QSPI_MODULE_ENABLED
|
#define HAL_QSPI_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
#if !defined(HAL_SD_MODULE_DISABLED)
|
#if !defined(HAL_SD_MODULE_DISABLED)
|
||||||
#define HAL_SD_MODULE_ENABLED
|
#define HAL_SD_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
// Last Flash sector used for EEPROM emulation, address/sector depends on single/dual bank configuration.
|
||||||
@ -244,31 +244,31 @@
|
|||||||
#define FLASH_DATA_SECTOR 11
|
#define FLASH_DATA_SECTOR 11
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* Copyright (c) 2020-2021, STMicroelectronics
|
Copyright (c) 2020-2021, STMicroelectronics
|
||||||
* All rights reserved.
|
All rights reserved.
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
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
|
the "License"; You may not use this file except in compliance with the
|
||||||
* License. You may obtain a copy of the License at:
|
License. You may obtain a copy of the License at:
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
opensource.org/licenses/BSD-3-Clause
|
||||||
*
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* STM32 pins number
|
STM32 pins number
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
#define PA0 PIN_A0
|
#define PA0 PIN_A0
|
||||||
#define PA1 PIN_A1
|
#define PA1 PIN_A1
|
||||||
#define PA2 PIN_A2
|
#define PA2 PIN_A2
|
||||||
@ -75,99 +75,99 @@
|
|||||||
|
|
||||||
// On-board LED pin number
|
// On-board LED pin number
|
||||||
#ifndef LED_BUILTIN
|
#ifndef LED_BUILTIN
|
||||||
#define LED_BUILTIN PNUM_NOT_DEFINED
|
#define LED_BUILTIN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// On-board user button
|
// On-board user button
|
||||||
#ifndef USER_BTN
|
#ifndef USER_BTN
|
||||||
#define USER_BTN PNUM_NOT_DEFINED
|
#define USER_BTN PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SPI definitions
|
// SPI definitions
|
||||||
#ifndef PIN_SPI_SS
|
#ifndef PIN_SPI_SS
|
||||||
#define PIN_SPI_SS PA4
|
#define PIN_SPI_SS PA4
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS1
|
#ifndef PIN_SPI_SS1
|
||||||
#define PIN_SPI_SS1 PA15
|
#define PIN_SPI_SS1 PA15
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS2
|
#ifndef PIN_SPI_SS2
|
||||||
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SS3
|
#ifndef PIN_SPI_SS3
|
||||||
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MOSI
|
#ifndef PIN_SPI_MOSI
|
||||||
#define PIN_SPI_MOSI PA7
|
#define PIN_SPI_MOSI PA7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_MISO
|
#ifndef PIN_SPI_MISO
|
||||||
#define PIN_SPI_MISO PA6
|
#define PIN_SPI_MISO PA6
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SPI_SCK
|
#ifndef PIN_SPI_SCK
|
||||||
#define PIN_SPI_SCK PA5
|
#define PIN_SPI_SCK PA5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// I2C definitions
|
// I2C definitions
|
||||||
#ifndef PIN_WIRE_SDA
|
#ifndef PIN_WIRE_SDA
|
||||||
#define PIN_WIRE_SDA PB7
|
#define PIN_WIRE_SDA PB7
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_WIRE_SCL
|
#ifndef PIN_WIRE_SCL
|
||||||
#define PIN_WIRE_SCL PB6
|
#define PIN_WIRE_SCL PB6
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Timer Definitions
|
// Timer Definitions
|
||||||
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
|
||||||
#ifndef TIMER_TONE
|
#ifndef TIMER_TONE
|
||||||
#define TIMER_TONE TIM6
|
#define TIMER_TONE TIM6
|
||||||
#endif
|
#endif
|
||||||
#ifndef TIMER_SERVO
|
#ifndef TIMER_SERVO
|
||||||
#define TIMER_SERVO TIM21
|
#define TIMER_SERVO TIM21
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// UART Definitions
|
// UART Definitions
|
||||||
#ifndef SERIAL_UART_INSTANCE
|
#ifndef SERIAL_UART_INSTANCE
|
||||||
#define SERIAL_UART_INSTANCE 2
|
#define SERIAL_UART_INSTANCE 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Default pin used for generic 'Serial' instance
|
// Default pin used for generic 'Serial' instance
|
||||||
// Mandatory for Firmata
|
// Mandatory for Firmata
|
||||||
#ifndef PIN_SERIAL_RX
|
#ifndef PIN_SERIAL_RX
|
||||||
#define PIN_SERIAL_RX PA3
|
#define PIN_SERIAL_RX PA3
|
||||||
#endif
|
#endif
|
||||||
#ifndef PIN_SERIAL_TX
|
#ifndef PIN_SERIAL_TX
|
||||||
#define PIN_SERIAL_TX PA2
|
#define PIN_SERIAL_TX PA2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Extra HAL modules
|
// Extra HAL modules
|
||||||
#if !defined(HAL_DAC_MODULE_DISABLED)
|
#if !defined(HAL_DAC_MODULE_DISABLED)
|
||||||
#define HAL_DAC_MODULE_ENABLED
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
* Arduino objects - C++ only
|
Arduino objects - C++ only
|
||||||
*----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
// 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
|
// 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,
|
// 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.
|
// 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_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
// 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 Hardware serial port, physical RX & TX pins.
|
||||||
//
|
//
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||||
// pins are NOT connected to anything by default.
|
// pins are NOT connected to anything by default.
|
||||||
#ifndef SERIAL_PORT_MONITOR
|
#ifndef SERIAL_PORT_MONITOR
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
#define SERIAL_PORT_MONITOR Serial
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERIAL_PORT_HARDWARE
|
#ifndef SERIAL_PORT_HARDWARE
|
||||||
// KH mod to add Serial1, for ESP-AT
|
// KH mod to add Serial1, for ESP-AT
|
||||||
//#define SERIAL_PORT_HARDWARE Serial
|
//#define SERIAL_PORT_HARDWARE Serial
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
#define SERIAL_PORT_HARDWARE Serial1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,386 +35,432 @@
|
|||||||
/* default implementation: may be overridden */
|
/* default implementation: may be overridden */
|
||||||
size_t Print::write(const uint8_t *buffer, size_t size)
|
size_t Print::write(const uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
while (size--) {
|
|
||||||
if (write(*buffer++)) n++;
|
while (size--)
|
||||||
else break;
|
{
|
||||||
}
|
if (write(*buffer++))
|
||||||
return n;
|
n++;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const __FlashStringHelper *ifsh)
|
size_t Print::print(const __FlashStringHelper *ifsh)
|
||||||
{
|
{
|
||||||
return print(reinterpret_cast<const char *>(ifsh));
|
return print(reinterpret_cast<const char *>(ifsh));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const String &s)
|
size_t Print::print(const String &s)
|
||||||
{
|
{
|
||||||
return write(s.c_str(), s.length());
|
return write(s.c_str(), s.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const char str[])
|
size_t Print::print(const char str[])
|
||||||
{
|
{
|
||||||
return write(str);
|
return write(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(char c)
|
size_t Print::print(char c)
|
||||||
{
|
{
|
||||||
return write(c);
|
return write(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned char b, int base)
|
size_t Print::print(unsigned char b, int base)
|
||||||
{
|
{
|
||||||
return print((unsigned long) b, base);
|
return print((unsigned long) b, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(int n, int base)
|
size_t Print::print(int n, int base)
|
||||||
{
|
{
|
||||||
return print((long) n, base);
|
return print((long) n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned int n, int base)
|
size_t Print::print(unsigned int n, int base)
|
||||||
{
|
{
|
||||||
return print((unsigned long) n, base);
|
return print((unsigned long) n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(long n, int base)
|
size_t Print::print(long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) {
|
if (base == 0)
|
||||||
return write(n);
|
{
|
||||||
} else if (base == 10) {
|
return write(n);
|
||||||
if (n < 0) {
|
}
|
||||||
int t = print('-');
|
else if (base == 10)
|
||||||
n = -n;
|
{
|
||||||
return printNumber(n, 10) + t;
|
if (n < 0)
|
||||||
}
|
{
|
||||||
return printNumber(n, 10);
|
int t = print('-');
|
||||||
} else {
|
n = -n;
|
||||||
return printNumber(n, base);
|
return printNumber(n, 10) + t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return printNumber(n, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return printNumber(n, base);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned long n, int base)
|
size_t Print::print(unsigned long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) return write(n);
|
if (base == 0)
|
||||||
else return printNumber(n, base);
|
return write(n);
|
||||||
|
else
|
||||||
|
return printNumber(n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(long long n, int base)
|
size_t Print::print(long long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) {
|
if (base == 0)
|
||||||
return write(n);
|
{
|
||||||
} else if (base == 10) {
|
return write(n);
|
||||||
if (n < 0) {
|
}
|
||||||
int t = print('-');
|
else if (base == 10)
|
||||||
n = -n;
|
{
|
||||||
return printULLNumber(n, 10) + t;
|
if (n < 0)
|
||||||
}
|
{
|
||||||
return printULLNumber(n, 10);
|
int t = print('-');
|
||||||
} else {
|
n = -n;
|
||||||
return printULLNumber(n, base);
|
return printULLNumber(n, 10) + t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return printULLNumber(n, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return printULLNumber(n, base);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned long long n, int base)
|
size_t Print::print(unsigned long long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) return write(n);
|
if (base == 0)
|
||||||
else return printULLNumber(n, base);
|
return write(n);
|
||||||
|
else
|
||||||
|
return printULLNumber(n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(double n, int digits)
|
size_t Print::print(double n, int digits)
|
||||||
{
|
{
|
||||||
return printFloat(n, digits);
|
return printFloat(n, digits);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const __FlashStringHelper *ifsh)
|
size_t Print::println(const __FlashStringHelper *ifsh)
|
||||||
{
|
{
|
||||||
size_t n = print(ifsh);
|
size_t n = print(ifsh);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const Printable& x)
|
size_t Print::print(const Printable& x)
|
||||||
{
|
{
|
||||||
return x.printTo(*this);
|
return x.printTo(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(void)
|
size_t Print::println(void)
|
||||||
{
|
{
|
||||||
return write("\r\n");
|
return write("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const String &s)
|
size_t Print::println(const String &s)
|
||||||
{
|
{
|
||||||
size_t n = print(s);
|
size_t n = print(s);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const char c[])
|
size_t Print::println(const char c[])
|
||||||
{
|
{
|
||||||
size_t n = print(c);
|
size_t n = print(c);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(char c)
|
size_t Print::println(char c)
|
||||||
{
|
{
|
||||||
size_t n = print(c);
|
size_t n = print(c);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned char b, int base)
|
size_t Print::println(unsigned char b, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(b, base);
|
size_t n = print(b, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(int num, int base)
|
size_t Print::println(int num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned int num, int base)
|
size_t Print::println(unsigned int num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(long num, int base)
|
size_t Print::println(long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned long num, int base)
|
size_t Print::println(unsigned long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(long long num, int base)
|
size_t Print::println(long long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned long long num, int base)
|
size_t Print::println(unsigned long long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(double num, int digits)
|
size_t Print::println(double num, int digits)
|
||||||
{
|
{
|
||||||
size_t n = print(num, digits);
|
size_t n = print(num, digits);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const Printable& x)
|
size_t Print::println(const Printable& x)
|
||||||
{
|
{
|
||||||
size_t n = print(x);
|
size_t n = print(x);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printf(const char * format, ...)
|
size_t Print::printf(const char * format, ...)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
|
||||||
len = vsnprintf(buf, 256, format, ap);
|
len = vsnprintf(buf, 256, format, ap);
|
||||||
this->write(buf, len);
|
this->write(buf, len);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private Methods /////////////////////////////////////////////////////////////
|
// Private Methods /////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
size_t Print::printNumber(unsigned long n, uint8_t base)
|
size_t Print::printNumber(unsigned long n, uint8_t base)
|
||||||
{
|
{
|
||||||
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
|
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
|
||||||
char *str = &buf[sizeof(buf) - 1];
|
char *str = &buf[sizeof(buf) - 1];
|
||||||
|
|
||||||
*str = '\0';
|
*str = '\0';
|
||||||
|
|
||||||
// prevent crash if called with base == 1
|
// prevent crash if called with base == 1
|
||||||
if (base < 2) base = 10;
|
if (base < 2)
|
||||||
|
base = 10;
|
||||||
|
|
||||||
do {
|
do
|
||||||
char c = n % base;
|
{
|
||||||
n /= base;
|
char c = n % base;
|
||||||
|
n /= base;
|
||||||
|
|
||||||
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||||
} while(n);
|
} while (n);
|
||||||
|
|
||||||
return write(str);
|
return write(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// REFERENCE IMPLEMENTATION FOR ULL
|
// REFERENCE IMPLEMENTATION FOR ULL
|
||||||
// size_t Print::printULLNumber(unsigned long long n, uint8_t base)
|
// size_t Print::printULLNumber(unsigned long long n, uint8_t base)
|
||||||
// {
|
// {
|
||||||
// // if limited to base 10 and 16 the bufsize can be smaller
|
// // if limited to base 10 and 16 the bufsize can be smaller
|
||||||
// char buf[65];
|
// char buf[65];
|
||||||
// char *str = &buf[64];
|
// char *str = &buf[64];
|
||||||
|
|
||||||
// *str = '\0';
|
// *str = '\0';
|
||||||
|
|
||||||
// // prevent crash if called with base == 1
|
// // prevent crash if called with base == 1
|
||||||
// if (base < 2) base = 10;
|
// if (base < 2) base = 10;
|
||||||
|
|
||||||
// do {
|
// do {
|
||||||
// unsigned long long t = n / base;
|
// unsigned long long t = n / base;
|
||||||
// char c = n - t * base; // faster than c = n%base;
|
// char c = n - t * base; // faster than c = n%base;
|
||||||
// n = t;
|
// n = t;
|
||||||
// *--str = c < 10 ? c + '0' : c + 'A' - 10;
|
// *--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||||
// } while(n);
|
// } while(n);
|
||||||
|
|
||||||
// return write(str);
|
// return write(str);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// FAST IMPLEMENTATION FOR ULL
|
// FAST IMPLEMENTATION FOR ULL
|
||||||
size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
|
size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
|
||||||
{
|
{
|
||||||
// if limited to base 10 and 16 the bufsize can be 20
|
// if limited to base 10 and 16 the bufsize can be 20
|
||||||
char buf[64];
|
char buf[64];
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
uint8_t innerLoops = 0;
|
uint8_t innerLoops = 0;
|
||||||
|
|
||||||
// prevent crash if called with base == 1
|
// prevent crash if called with base == 1
|
||||||
if (base < 2) base = 10;
|
if (base < 2)
|
||||||
|
base = 10;
|
||||||
|
|
||||||
// process chunks that fit in "16 bit math".
|
// process chunks that fit in "16 bit math".
|
||||||
uint16_t top = 0xFFFF / base;
|
uint16_t top = 0xFFFF / base;
|
||||||
uint16_t th16 = 1;
|
uint16_t th16 = 1;
|
||||||
while (th16 < top)
|
|
||||||
{
|
|
||||||
th16 *= base;
|
|
||||||
innerLoops++;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (n64 > th16)
|
while (th16 < top)
|
||||||
{
|
{
|
||||||
// 64 bit math part
|
th16 *= base;
|
||||||
uint64_t q = n64 / th16;
|
innerLoops++;
|
||||||
uint16_t r = n64 - q*th16;
|
}
|
||||||
n64 = q;
|
|
||||||
|
|
||||||
// 16 bit math loop to do remainder. (note buffer is filled reverse)
|
while (n64 > th16)
|
||||||
for (uint8_t j=0; j < innerLoops; j++)
|
{
|
||||||
{
|
// 64 bit math part
|
||||||
uint16_t qq = r/base;
|
uint64_t q = n64 / th16;
|
||||||
buf[i++] = r - qq*base;
|
uint16_t r = n64 - q * th16;
|
||||||
r = qq;
|
n64 = q;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t n16 = n64;
|
// 16 bit math loop to do remainder. (note buffer is filled reverse)
|
||||||
while (n16 > 0)
|
for (uint8_t j = 0; j < innerLoops; j++)
|
||||||
{
|
{
|
||||||
uint16_t qq = n16/base;
|
uint16_t qq = r / base;
|
||||||
buf[i++] = n16 - qq*base;
|
buf[i++] = r - qq * base;
|
||||||
n16 = qq;
|
r = qq;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
size_t bytes = i;
|
uint16_t n16 = n64;
|
||||||
for (; i > 0; i--)
|
|
||||||
write((char) (buf[i - 1] < 10 ?
|
|
||||||
'0' + buf[i - 1] :
|
|
||||||
'A' + buf[i - 1] - 10));
|
|
||||||
|
|
||||||
return bytes;
|
while (n16 > 0)
|
||||||
|
{
|
||||||
|
uint16_t qq = n16 / base;
|
||||||
|
buf[i++] = n16 - qq * base;
|
||||||
|
n16 = qq;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t bytes = i;
|
||||||
|
|
||||||
|
for (; i > 0; i--)
|
||||||
|
write((char) (buf[i - 1] < 10 ?
|
||||||
|
'0' + buf[i - 1] :
|
||||||
|
'A' + buf[i - 1] - 10));
|
||||||
|
|
||||||
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printFloat(double number, int digits)
|
size_t Print::printFloat(double number, int digits)
|
||||||
{
|
{
|
||||||
if (digits < 0)
|
if (digits < 0)
|
||||||
digits = 2;
|
digits = 2;
|
||||||
|
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
|
|
||||||
if (isnan(number)) return print("nan");
|
if (isnan(number))
|
||||||
if (isinf(number)) return print("inf");
|
return print("nan");
|
||||||
if (number > 4294967040.0) return print ("ovf"); // constant determined empirically
|
|
||||||
if (number <-4294967040.0) return print ("ovf"); // constant determined empirically
|
|
||||||
|
|
||||||
// Handle negative numbers
|
if (isinf(number))
|
||||||
if (number < 0.0)
|
return print("inf");
|
||||||
{
|
|
||||||
n += print('-');
|
|
||||||
number = -number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Round correctly so that print(1.999, 2) prints as "2.00"
|
if (number > 4294967040.0)
|
||||||
double rounding = 0.5;
|
return print ("ovf"); // constant determined empirically
|
||||||
for (uint8_t i=0; i<digits; ++i)
|
|
||||||
rounding /= 10.0;
|
|
||||||
|
|
||||||
number += rounding;
|
if (number < -4294967040.0)
|
||||||
|
return print ("ovf"); // constant determined empirically
|
||||||
|
|
||||||
// Extract the integer part of the number and print it
|
// Handle negative numbers
|
||||||
unsigned long int_part = (unsigned long)number;
|
if (number < 0.0)
|
||||||
double remainder = number - (double)int_part;
|
{
|
||||||
n += print(int_part);
|
n += print('-');
|
||||||
|
number = -number;
|
||||||
|
}
|
||||||
|
|
||||||
// Print the decimal point, but only if there are digits beyond
|
// Round correctly so that print(1.999, 2) prints as "2.00"
|
||||||
if (digits > 0) {
|
double rounding = 0.5;
|
||||||
n += print(".");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract digits from the remainder one at a time
|
for (uint8_t i = 0; i < digits; ++i)
|
||||||
while (digits-- > 0)
|
rounding /= 10.0;
|
||||||
{
|
|
||||||
remainder *= 10.0;
|
|
||||||
unsigned int toPrint = (unsigned int)remainder;
|
|
||||||
n += print(toPrint);
|
|
||||||
remainder -= toPrint;
|
|
||||||
}
|
|
||||||
|
|
||||||
return n;
|
number += rounding;
|
||||||
|
|
||||||
|
// Extract the integer part of the number and print it
|
||||||
|
unsigned long int_part = (unsigned long)number;
|
||||||
|
double remainder = number - (double)int_part;
|
||||||
|
n += print(int_part);
|
||||||
|
|
||||||
|
// Print the decimal point, but only if there are digits beyond
|
||||||
|
if (digits > 0)
|
||||||
|
{
|
||||||
|
n += print(".");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract digits from the remainder one at a time
|
||||||
|
while (digits-- > 0)
|
||||||
|
{
|
||||||
|
remainder *= 10.0;
|
||||||
|
unsigned int toPrint = (unsigned int)remainder;
|
||||||
|
n += print(toPrint);
|
||||||
|
remainder -= toPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printBuffer(uint8_t const buffer[], int len, char delim, int byteline)
|
size_t Print::printBuffer(uint8_t const buffer[], int len, char delim, int byteline)
|
||||||
{
|
{
|
||||||
if (buffer == NULL || len == 0) return 0;
|
if (buffer == NULL || len == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
for(int i=0; i<len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
if ( i != 0 ) print(delim);
|
if ( i != 0 )
|
||||||
if ( byteline && (i%byteline == 0) ) println();
|
print(delim);
|
||||||
|
|
||||||
this->printf("%02X", buffer[i]);
|
if ( byteline && (i % byteline == 0) )
|
||||||
}
|
println();
|
||||||
|
|
||||||
return (len*3 - 1);
|
this->printf("%02X", buffer[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (len * 3 - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printBufferReverse(uint8_t const buffer[], int len, char delim, int byteline)
|
size_t Print::printBufferReverse(uint8_t const buffer[], int len, char delim, int byteline)
|
||||||
{
|
{
|
||||||
if (buffer == NULL || len == 0) return 0;
|
if (buffer == NULL || len == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
for(int i=0; i<len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
if (i != 0) print(delim);
|
if (i != 0)
|
||||||
if ( byteline && (i%byteline == 0) ) println();
|
print(delim);
|
||||||
|
|
||||||
this->printf("%02X", buffer[len-1-i]);
|
if ( byteline && (i % byteline == 0) )
|
||||||
}
|
println();
|
||||||
|
|
||||||
return (len*3 - 1);
|
this->printf("%02X", buffer[len - 1 - i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (len * 3 - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,77 +31,93 @@
|
|||||||
|
|
||||||
class Print
|
class Print
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int write_error;
|
int write_error;
|
||||||
size_t printNumber(unsigned long, uint8_t);
|
size_t printNumber(unsigned long, uint8_t);
|
||||||
size_t printULLNumber(unsigned long long, uint8_t);
|
size_t printULLNumber(unsigned long long, uint8_t);
|
||||||
size_t printFloat(double, int);
|
size_t printFloat(double, int);
|
||||||
protected:
|
protected:
|
||||||
void setWriteError(int err = 1) { write_error = err; }
|
void setWriteError(int err = 1)
|
||||||
public:
|
{
|
||||||
Print() : write_error(0) {}
|
write_error = err;
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
Print() : write_error(0) {}
|
||||||
|
|
||||||
int getWriteError() { return write_error; }
|
int getWriteError()
|
||||||
void clearWriteError() { setWriteError(0); }
|
{
|
||||||
|
return write_error;
|
||||||
|
}
|
||||||
|
void clearWriteError()
|
||||||
|
{
|
||||||
|
setWriteError(0);
|
||||||
|
}
|
||||||
|
|
||||||
virtual size_t write(uint8_t) = 0;
|
virtual size_t write(uint8_t) = 0;
|
||||||
size_t write(const char *str) {
|
size_t write(const char *str)
|
||||||
if (str == NULL) return 0;
|
{
|
||||||
return write((const uint8_t *)str, strlen(str));
|
if (str == NULL)
|
||||||
}
|
return 0;
|
||||||
virtual size_t write(const uint8_t *buffer, size_t size);
|
|
||||||
size_t write(const char *buffer, size_t size) {
|
|
||||||
return write((const uint8_t *)buffer, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// default to zero, meaning "a single write may block"
|
return write((const uint8_t *)str, strlen(str));
|
||||||
// should be overridden by subclasses with buffering
|
}
|
||||||
virtual int availableForWrite() { return 0; }
|
virtual size_t write(const uint8_t *buffer, size_t size);
|
||||||
|
size_t write(const char *buffer, size_t size)
|
||||||
|
{
|
||||||
|
return write((const uint8_t *)buffer, size);
|
||||||
|
}
|
||||||
|
|
||||||
size_t print(const __FlashStringHelper *);
|
// default to zero, meaning "a single write may block"
|
||||||
size_t print(const String &);
|
// should be overridden by subclasses with buffering
|
||||||
size_t print(const char[]);
|
virtual int availableForWrite()
|
||||||
size_t print(char);
|
{
|
||||||
size_t print(unsigned char, int = DEC);
|
return 0;
|
||||||
size_t print(int, int = DEC);
|
}
|
||||||
size_t print(unsigned int, int = DEC);
|
|
||||||
size_t print(long, int = DEC);
|
|
||||||
size_t print(unsigned long, int = DEC);
|
|
||||||
size_t print(long long, int = DEC);
|
|
||||||
size_t print(unsigned long long, int = DEC);
|
|
||||||
size_t print(double, int = 2);
|
|
||||||
size_t print(const Printable&);
|
|
||||||
|
|
||||||
size_t println(const __FlashStringHelper *);
|
size_t print(const __FlashStringHelper *);
|
||||||
size_t println(const String &s);
|
size_t print(const String &);
|
||||||
size_t println(const char[]);
|
size_t print(const char[]);
|
||||||
size_t println(char);
|
size_t print(char);
|
||||||
size_t println(unsigned char, int = DEC);
|
size_t print(unsigned char, int = DEC);
|
||||||
size_t println(int, int = DEC);
|
size_t print(int, int = DEC);
|
||||||
size_t println(unsigned int, int = DEC);
|
size_t print(unsigned int, int = DEC);
|
||||||
size_t println(long, int = DEC);
|
size_t print(long, int = DEC);
|
||||||
size_t println(unsigned long, int = DEC);
|
size_t print(unsigned long, int = DEC);
|
||||||
size_t println(long long, int = DEC);
|
size_t print(long long, int = DEC);
|
||||||
size_t println(unsigned long long, int = DEC);
|
size_t print(unsigned long long, int = DEC);
|
||||||
size_t println(double, int = 2);
|
size_t print(double, int = 2);
|
||||||
size_t println(const Printable&);
|
size_t print(const Printable&);
|
||||||
size_t println(void);
|
|
||||||
|
|
||||||
size_t printf(const char * format, ...);
|
size_t println(const __FlashStringHelper *);
|
||||||
|
size_t println(const String &s);
|
||||||
|
size_t println(const char[]);
|
||||||
|
size_t println(char);
|
||||||
|
size_t println(unsigned char, int = DEC);
|
||||||
|
size_t println(int, int = DEC);
|
||||||
|
size_t println(unsigned int, int = DEC);
|
||||||
|
size_t println(long, int = DEC);
|
||||||
|
size_t println(unsigned long, int = DEC);
|
||||||
|
size_t println(long long, int = DEC);
|
||||||
|
size_t println(unsigned long long, int = DEC);
|
||||||
|
size_t println(double, int = 2);
|
||||||
|
size_t println(const Printable&);
|
||||||
|
size_t println(void);
|
||||||
|
|
||||||
size_t printBuffer(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
|
size_t printf(const char * format, ...);
|
||||||
size_t printBuffer(char const buffer[], int size, char delim=' ', int byteline = 0)
|
|
||||||
{
|
|
||||||
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t printBufferReverse(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
|
size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0);
|
||||||
size_t printBufferReverse(char const buffer[], int size, char delim=' ', int byteline = 0)
|
size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0)
|
||||||
{
|
{
|
||||||
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
|
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void flush() { /* Empty implementation for backward compatibility */ }
|
size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0);
|
||||||
|
size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0)
|
||||||
|
{
|
||||||
|
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void flush() { /* Empty implementation for backward compatibility */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,386 +35,432 @@
|
|||||||
/* default implementation: may be overridden */
|
/* default implementation: may be overridden */
|
||||||
size_t Print::write(const uint8_t *buffer, size_t size)
|
size_t Print::write(const uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
while (size--) {
|
|
||||||
if (write(*buffer++)) n++;
|
while (size--)
|
||||||
else break;
|
{
|
||||||
}
|
if (write(*buffer++))
|
||||||
return n;
|
n++;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const __FlashStringHelper *ifsh)
|
size_t Print::print(const __FlashStringHelper *ifsh)
|
||||||
{
|
{
|
||||||
return print(reinterpret_cast<const char *>(ifsh));
|
return print(reinterpret_cast<const char *>(ifsh));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const String &s)
|
size_t Print::print(const String &s)
|
||||||
{
|
{
|
||||||
return write(s.c_str(), s.length());
|
return write(s.c_str(), s.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const char str[])
|
size_t Print::print(const char str[])
|
||||||
{
|
{
|
||||||
return write(str);
|
return write(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(char c)
|
size_t Print::print(char c)
|
||||||
{
|
{
|
||||||
return write(c);
|
return write(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned char b, int base)
|
size_t Print::print(unsigned char b, int base)
|
||||||
{
|
{
|
||||||
return print((unsigned long) b, base);
|
return print((unsigned long) b, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(int n, int base)
|
size_t Print::print(int n, int base)
|
||||||
{
|
{
|
||||||
return print((long) n, base);
|
return print((long) n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned int n, int base)
|
size_t Print::print(unsigned int n, int base)
|
||||||
{
|
{
|
||||||
return print((unsigned long) n, base);
|
return print((unsigned long) n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(long n, int base)
|
size_t Print::print(long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) {
|
if (base == 0)
|
||||||
return write(n);
|
{
|
||||||
} else if (base == 10) {
|
return write(n);
|
||||||
if (n < 0) {
|
}
|
||||||
int t = print('-');
|
else if (base == 10)
|
||||||
n = -n;
|
{
|
||||||
return printNumber(n, 10) + t;
|
if (n < 0)
|
||||||
}
|
{
|
||||||
return printNumber(n, 10);
|
int t = print('-');
|
||||||
} else {
|
n = -n;
|
||||||
return printNumber(n, base);
|
return printNumber(n, 10) + t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return printNumber(n, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return printNumber(n, base);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned long n, int base)
|
size_t Print::print(unsigned long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) return write(n);
|
if (base == 0)
|
||||||
else return printNumber(n, base);
|
return write(n);
|
||||||
|
else
|
||||||
|
return printNumber(n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(long long n, int base)
|
size_t Print::print(long long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) {
|
if (base == 0)
|
||||||
return write(n);
|
{
|
||||||
} else if (base == 10) {
|
return write(n);
|
||||||
if (n < 0) {
|
}
|
||||||
int t = print('-');
|
else if (base == 10)
|
||||||
n = -n;
|
{
|
||||||
return printULLNumber(n, 10) + t;
|
if (n < 0)
|
||||||
}
|
{
|
||||||
return printULLNumber(n, 10);
|
int t = print('-');
|
||||||
} else {
|
n = -n;
|
||||||
return printULLNumber(n, base);
|
return printULLNumber(n, 10) + t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return printULLNumber(n, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return printULLNumber(n, base);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(unsigned long long n, int base)
|
size_t Print::print(unsigned long long n, int base)
|
||||||
{
|
{
|
||||||
if (base == 0) return write(n);
|
if (base == 0)
|
||||||
else return printULLNumber(n, base);
|
return write(n);
|
||||||
|
else
|
||||||
|
return printULLNumber(n, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(double n, int digits)
|
size_t Print::print(double n, int digits)
|
||||||
{
|
{
|
||||||
return printFloat(n, digits);
|
return printFloat(n, digits);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const __FlashStringHelper *ifsh)
|
size_t Print::println(const __FlashStringHelper *ifsh)
|
||||||
{
|
{
|
||||||
size_t n = print(ifsh);
|
size_t n = print(ifsh);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const Printable& x)
|
size_t Print::print(const Printable& x)
|
||||||
{
|
{
|
||||||
return x.printTo(*this);
|
return x.printTo(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(void)
|
size_t Print::println(void)
|
||||||
{
|
{
|
||||||
return write("\r\n");
|
return write("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const String &s)
|
size_t Print::println(const String &s)
|
||||||
{
|
{
|
||||||
size_t n = print(s);
|
size_t n = print(s);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const char c[])
|
size_t Print::println(const char c[])
|
||||||
{
|
{
|
||||||
size_t n = print(c);
|
size_t n = print(c);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(char c)
|
size_t Print::println(char c)
|
||||||
{
|
{
|
||||||
size_t n = print(c);
|
size_t n = print(c);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned char b, int base)
|
size_t Print::println(unsigned char b, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(b, base);
|
size_t n = print(b, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(int num, int base)
|
size_t Print::println(int num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned int num, int base)
|
size_t Print::println(unsigned int num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(long num, int base)
|
size_t Print::println(long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned long num, int base)
|
size_t Print::println(unsigned long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(long long num, int base)
|
size_t Print::println(long long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(unsigned long long num, int base)
|
size_t Print::println(unsigned long long num, int base)
|
||||||
{
|
{
|
||||||
size_t n = print(num, base);
|
size_t n = print(num, base);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(double num, int digits)
|
size_t Print::println(double num, int digits)
|
||||||
{
|
{
|
||||||
size_t n = print(num, digits);
|
size_t n = print(num, digits);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::println(const Printable& x)
|
size_t Print::println(const Printable& x)
|
||||||
{
|
{
|
||||||
size_t n = print(x);
|
size_t n = print(x);
|
||||||
n += println();
|
n += println();
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printf(const char * format, ...)
|
size_t Print::printf(const char * format, ...)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
|
||||||
len = vsnprintf(buf, 256, format, ap);
|
len = vsnprintf(buf, 256, format, ap);
|
||||||
this->write(buf, len);
|
this->write(buf, len);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private Methods /////////////////////////////////////////////////////////////
|
// Private Methods /////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
size_t Print::printNumber(unsigned long n, uint8_t base)
|
size_t Print::printNumber(unsigned long n, uint8_t base)
|
||||||
{
|
{
|
||||||
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
|
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
|
||||||
char *str = &buf[sizeof(buf) - 1];
|
char *str = &buf[sizeof(buf) - 1];
|
||||||
|
|
||||||
*str = '\0';
|
*str = '\0';
|
||||||
|
|
||||||
// prevent crash if called with base == 1
|
// prevent crash if called with base == 1
|
||||||
if (base < 2) base = 10;
|
if (base < 2)
|
||||||
|
base = 10;
|
||||||
|
|
||||||
do {
|
do
|
||||||
char c = n % base;
|
{
|
||||||
n /= base;
|
char c = n % base;
|
||||||
|
n /= base;
|
||||||
|
|
||||||
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||||
} while(n);
|
} while (n);
|
||||||
|
|
||||||
return write(str);
|
return write(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// REFERENCE IMPLEMENTATION FOR ULL
|
// REFERENCE IMPLEMENTATION FOR ULL
|
||||||
// size_t Print::printULLNumber(unsigned long long n, uint8_t base)
|
// size_t Print::printULLNumber(unsigned long long n, uint8_t base)
|
||||||
// {
|
// {
|
||||||
// // if limited to base 10 and 16 the bufsize can be smaller
|
// // if limited to base 10 and 16 the bufsize can be smaller
|
||||||
// char buf[65];
|
// char buf[65];
|
||||||
// char *str = &buf[64];
|
// char *str = &buf[64];
|
||||||
|
|
||||||
// *str = '\0';
|
// *str = '\0';
|
||||||
|
|
||||||
// // prevent crash if called with base == 1
|
// // prevent crash if called with base == 1
|
||||||
// if (base < 2) base = 10;
|
// if (base < 2) base = 10;
|
||||||
|
|
||||||
// do {
|
// do {
|
||||||
// unsigned long long t = n / base;
|
// unsigned long long t = n / base;
|
||||||
// char c = n - t * base; // faster than c = n%base;
|
// char c = n - t * base; // faster than c = n%base;
|
||||||
// n = t;
|
// n = t;
|
||||||
// *--str = c < 10 ? c + '0' : c + 'A' - 10;
|
// *--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||||
// } while(n);
|
// } while(n);
|
||||||
|
|
||||||
// return write(str);
|
// return write(str);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// FAST IMPLEMENTATION FOR ULL
|
// FAST IMPLEMENTATION FOR ULL
|
||||||
size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
|
size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
|
||||||
{
|
{
|
||||||
// if limited to base 10 and 16 the bufsize can be 20
|
// if limited to base 10 and 16 the bufsize can be 20
|
||||||
char buf[64];
|
char buf[64];
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
uint8_t innerLoops = 0;
|
uint8_t innerLoops = 0;
|
||||||
|
|
||||||
// prevent crash if called with base == 1
|
// prevent crash if called with base == 1
|
||||||
if (base < 2) base = 10;
|
if (base < 2)
|
||||||
|
base = 10;
|
||||||
|
|
||||||
// process chunks that fit in "16 bit math".
|
// process chunks that fit in "16 bit math".
|
||||||
uint16_t top = 0xFFFF / base;
|
uint16_t top = 0xFFFF / base;
|
||||||
uint16_t th16 = 1;
|
uint16_t th16 = 1;
|
||||||
while (th16 < top)
|
|
||||||
{
|
|
||||||
th16 *= base;
|
|
||||||
innerLoops++;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (n64 > th16)
|
while (th16 < top)
|
||||||
{
|
{
|
||||||
// 64 bit math part
|
th16 *= base;
|
||||||
uint64_t q = n64 / th16;
|
innerLoops++;
|
||||||
uint16_t r = n64 - q*th16;
|
}
|
||||||
n64 = q;
|
|
||||||
|
|
||||||
// 16 bit math loop to do remainder. (note buffer is filled reverse)
|
while (n64 > th16)
|
||||||
for (uint8_t j=0; j < innerLoops; j++)
|
{
|
||||||
{
|
// 64 bit math part
|
||||||
uint16_t qq = r/base;
|
uint64_t q = n64 / th16;
|
||||||
buf[i++] = r - qq*base;
|
uint16_t r = n64 - q * th16;
|
||||||
r = qq;
|
n64 = q;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t n16 = n64;
|
// 16 bit math loop to do remainder. (note buffer is filled reverse)
|
||||||
while (n16 > 0)
|
for (uint8_t j = 0; j < innerLoops; j++)
|
||||||
{
|
{
|
||||||
uint16_t qq = n16/base;
|
uint16_t qq = r / base;
|
||||||
buf[i++] = n16 - qq*base;
|
buf[i++] = r - qq * base;
|
||||||
n16 = qq;
|
r = qq;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
size_t bytes = i;
|
uint16_t n16 = n64;
|
||||||
for (; i > 0; i--)
|
|
||||||
write((char) (buf[i - 1] < 10 ?
|
|
||||||
'0' + buf[i - 1] :
|
|
||||||
'A' + buf[i - 1] - 10));
|
|
||||||
|
|
||||||
return bytes;
|
while (n16 > 0)
|
||||||
|
{
|
||||||
|
uint16_t qq = n16 / base;
|
||||||
|
buf[i++] = n16 - qq * base;
|
||||||
|
n16 = qq;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t bytes = i;
|
||||||
|
|
||||||
|
for (; i > 0; i--)
|
||||||
|
write((char) (buf[i - 1] < 10 ?
|
||||||
|
'0' + buf[i - 1] :
|
||||||
|
'A' + buf[i - 1] - 10));
|
||||||
|
|
||||||
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printFloat(double number, int digits)
|
size_t Print::printFloat(double number, int digits)
|
||||||
{
|
{
|
||||||
if (digits < 0)
|
if (digits < 0)
|
||||||
digits = 2;
|
digits = 2;
|
||||||
|
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
|
|
||||||
if (isnan(number)) return print("nan");
|
if (isnan(number))
|
||||||
if (isinf(number)) return print("inf");
|
return print("nan");
|
||||||
if (number > 4294967040.0) return print ("ovf"); // constant determined empirically
|
|
||||||
if (number <-4294967040.0) return print ("ovf"); // constant determined empirically
|
|
||||||
|
|
||||||
// Handle negative numbers
|
if (isinf(number))
|
||||||
if (number < 0.0)
|
return print("inf");
|
||||||
{
|
|
||||||
n += print('-');
|
|
||||||
number = -number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Round correctly so that print(1.999, 2) prints as "2.00"
|
if (number > 4294967040.0)
|
||||||
double rounding = 0.5;
|
return print ("ovf"); // constant determined empirically
|
||||||
for (uint8_t i=0; i<digits; ++i)
|
|
||||||
rounding /= 10.0;
|
|
||||||
|
|
||||||
number += rounding;
|
if (number < -4294967040.0)
|
||||||
|
return print ("ovf"); // constant determined empirically
|
||||||
|
|
||||||
// Extract the integer part of the number and print it
|
// Handle negative numbers
|
||||||
unsigned long int_part = (unsigned long)number;
|
if (number < 0.0)
|
||||||
double remainder = number - (double)int_part;
|
{
|
||||||
n += print(int_part);
|
n += print('-');
|
||||||
|
number = -number;
|
||||||
|
}
|
||||||
|
|
||||||
// Print the decimal point, but only if there are digits beyond
|
// Round correctly so that print(1.999, 2) prints as "2.00"
|
||||||
if (digits > 0) {
|
double rounding = 0.5;
|
||||||
n += print(".");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract digits from the remainder one at a time
|
for (uint8_t i = 0; i < digits; ++i)
|
||||||
while (digits-- > 0)
|
rounding /= 10.0;
|
||||||
{
|
|
||||||
remainder *= 10.0;
|
|
||||||
unsigned int toPrint = (unsigned int)remainder;
|
|
||||||
n += print(toPrint);
|
|
||||||
remainder -= toPrint;
|
|
||||||
}
|
|
||||||
|
|
||||||
return n;
|
number += rounding;
|
||||||
|
|
||||||
|
// Extract the integer part of the number and print it
|
||||||
|
unsigned long int_part = (unsigned long)number;
|
||||||
|
double remainder = number - (double)int_part;
|
||||||
|
n += print(int_part);
|
||||||
|
|
||||||
|
// Print the decimal point, but only if there are digits beyond
|
||||||
|
if (digits > 0)
|
||||||
|
{
|
||||||
|
n += print(".");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract digits from the remainder one at a time
|
||||||
|
while (digits-- > 0)
|
||||||
|
{
|
||||||
|
remainder *= 10.0;
|
||||||
|
unsigned int toPrint = (unsigned int)remainder;
|
||||||
|
n += print(toPrint);
|
||||||
|
remainder -= toPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printBuffer(uint8_t const buffer[], int len, char delim, int byteline)
|
size_t Print::printBuffer(uint8_t const buffer[], int len, char delim, int byteline)
|
||||||
{
|
{
|
||||||
if (buffer == NULL || len == 0) return 0;
|
if (buffer == NULL || len == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
for(int i=0; i<len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
if ( i != 0 ) print(delim);
|
if ( i != 0 )
|
||||||
if ( byteline && (i%byteline == 0) ) println();
|
print(delim);
|
||||||
|
|
||||||
this->printf("%02X", buffer[i]);
|
if ( byteline && (i % byteline == 0) )
|
||||||
}
|
println();
|
||||||
|
|
||||||
return (len*3 - 1);
|
this->printf("%02X", buffer[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (len * 3 - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::printBufferReverse(uint8_t const buffer[], int len, char delim, int byteline)
|
size_t Print::printBufferReverse(uint8_t const buffer[], int len, char delim, int byteline)
|
||||||
{
|
{
|
||||||
if (buffer == NULL || len == 0) return 0;
|
if (buffer == NULL || len == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
for(int i=0; i<len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
if (i != 0) print(delim);
|
if (i != 0)
|
||||||
if ( byteline && (i%byteline == 0) ) println();
|
print(delim);
|
||||||
|
|
||||||
this->printf("%02X", buffer[len-1-i]);
|
if ( byteline && (i % byteline == 0) )
|
||||||
}
|
println();
|
||||||
|
|
||||||
return (len*3 - 1);
|
this->printf("%02X", buffer[len - 1 - i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (len * 3 - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,77 +31,93 @@
|
|||||||
|
|
||||||
class Print
|
class Print
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int write_error;
|
int write_error;
|
||||||
size_t printNumber(unsigned long, uint8_t);
|
size_t printNumber(unsigned long, uint8_t);
|
||||||
size_t printULLNumber(unsigned long long, uint8_t);
|
size_t printULLNumber(unsigned long long, uint8_t);
|
||||||
size_t printFloat(double, int);
|
size_t printFloat(double, int);
|
||||||
protected:
|
protected:
|
||||||
void setWriteError(int err = 1) { write_error = err; }
|
void setWriteError(int err = 1)
|
||||||
public:
|
{
|
||||||
Print() : write_error(0) {}
|
write_error = err;
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
Print() : write_error(0) {}
|
||||||
|
|
||||||
int getWriteError() { return write_error; }
|
int getWriteError()
|
||||||
void clearWriteError() { setWriteError(0); }
|
{
|
||||||
|
return write_error;
|
||||||
|
}
|
||||||
|
void clearWriteError()
|
||||||
|
{
|
||||||
|
setWriteError(0);
|
||||||
|
}
|
||||||
|
|
||||||
virtual size_t write(uint8_t) = 0;
|
virtual size_t write(uint8_t) = 0;
|
||||||
size_t write(const char *str) {
|
size_t write(const char *str)
|
||||||
if (str == NULL) return 0;
|
{
|
||||||
return write((const uint8_t *)str, strlen(str));
|
if (str == NULL)
|
||||||
}
|
return 0;
|
||||||
virtual size_t write(const uint8_t *buffer, size_t size);
|
|
||||||
size_t write(const char *buffer, size_t size) {
|
|
||||||
return write((const uint8_t *)buffer, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// default to zero, meaning "a single write may block"
|
return write((const uint8_t *)str, strlen(str));
|
||||||
// should be overridden by subclasses with buffering
|
}
|
||||||
virtual int availableForWrite() { return 0; }
|
virtual size_t write(const uint8_t *buffer, size_t size);
|
||||||
|
size_t write(const char *buffer, size_t size)
|
||||||
|
{
|
||||||
|
return write((const uint8_t *)buffer, size);
|
||||||
|
}
|
||||||
|
|
||||||
size_t print(const __FlashStringHelper *);
|
// default to zero, meaning "a single write may block"
|
||||||
size_t print(const String &);
|
// should be overridden by subclasses with buffering
|
||||||
size_t print(const char[]);
|
virtual int availableForWrite()
|
||||||
size_t print(char);
|
{
|
||||||
size_t print(unsigned char, int = DEC);
|
return 0;
|
||||||
size_t print(int, int = DEC);
|
}
|
||||||
size_t print(unsigned int, int = DEC);
|
|
||||||
size_t print(long, int = DEC);
|
|
||||||
size_t print(unsigned long, int = DEC);
|
|
||||||
size_t print(long long, int = DEC);
|
|
||||||
size_t print(unsigned long long, int = DEC);
|
|
||||||
size_t print(double, int = 2);
|
|
||||||
size_t print(const Printable&);
|
|
||||||
|
|
||||||
size_t println(const __FlashStringHelper *);
|
size_t print(const __FlashStringHelper *);
|
||||||
size_t println(const String &s);
|
size_t print(const String &);
|
||||||
size_t println(const char[]);
|
size_t print(const char[]);
|
||||||
size_t println(char);
|
size_t print(char);
|
||||||
size_t println(unsigned char, int = DEC);
|
size_t print(unsigned char, int = DEC);
|
||||||
size_t println(int, int = DEC);
|
size_t print(int, int = DEC);
|
||||||
size_t println(unsigned int, int = DEC);
|
size_t print(unsigned int, int = DEC);
|
||||||
size_t println(long, int = DEC);
|
size_t print(long, int = DEC);
|
||||||
size_t println(unsigned long, int = DEC);
|
size_t print(unsigned long, int = DEC);
|
||||||
size_t println(long long, int = DEC);
|
size_t print(long long, int = DEC);
|
||||||
size_t println(unsigned long long, int = DEC);
|
size_t print(unsigned long long, int = DEC);
|
||||||
size_t println(double, int = 2);
|
size_t print(double, int = 2);
|
||||||
size_t println(const Printable&);
|
size_t print(const Printable&);
|
||||||
size_t println(void);
|
|
||||||
|
|
||||||
size_t printf(const char * format, ...);
|
size_t println(const __FlashStringHelper *);
|
||||||
|
size_t println(const String &s);
|
||||||
|
size_t println(const char[]);
|
||||||
|
size_t println(char);
|
||||||
|
size_t println(unsigned char, int = DEC);
|
||||||
|
size_t println(int, int = DEC);
|
||||||
|
size_t println(unsigned int, int = DEC);
|
||||||
|
size_t println(long, int = DEC);
|
||||||
|
size_t println(unsigned long, int = DEC);
|
||||||
|
size_t println(long long, int = DEC);
|
||||||
|
size_t println(unsigned long long, int = DEC);
|
||||||
|
size_t println(double, int = 2);
|
||||||
|
size_t println(const Printable&);
|
||||||
|
size_t println(void);
|
||||||
|
|
||||||
size_t printBuffer(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
|
size_t printf(const char * format, ...);
|
||||||
size_t printBuffer(char const buffer[], int size, char delim=' ', int byteline = 0)
|
|
||||||
{
|
|
||||||
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t printBufferReverse(uint8_t const buffer[], int len, char delim=' ', int byteline = 0);
|
size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0);
|
||||||
size_t printBufferReverse(char const buffer[], int size, char delim=' ', int byteline = 0)
|
size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0)
|
||||||
{
|
{
|
||||||
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
|
return printBuffer((uint8_t const*) buffer, size, delim, byteline);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void flush() { /* Empty implementation for backward compatibility */ }
|
size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0);
|
||||||
|
size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0)
|
||||||
|
{
|
||||||
|
return printBufferReverse((uint8_t const*) buffer, size, delim, byteline);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void flush() { /* Empty implementation for backward compatibility */ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user