-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fb93b40
Showing
168 changed files
with
145,497 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.vscode | ||
*.clang-format | ||
Debug | ||
*.launch | ||
Release | ||
.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>CoreCell_USB</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | ||
<triggers>clean,full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | ||
<triggers>full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature> | ||
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature> | ||
<nature>org.eclipse.cdt.core.cnature</nature> | ||
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAProjectNature</nature> | ||
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature> | ||
<nature>com.st.stm32cube.ide.mcu.MCUEndUserDisabledTrustZoneProjectNature</nature> | ||
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature> | ||
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
****************************************************************************** | ||
* @file | ||
* @author MCD Application Team | ||
* @version V2.0.0 | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* COPYRIGHT(c) 2020 STMicroelectronics | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* 3. Neither the name of STMicroelectronics nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software | ||
* without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
*/ | ||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef __RTE_COMPONENTS_H__ | ||
#define __RTE_COMPONENTS_H__ | ||
|
||
/* Defines ------------------------------------------------------------------*/ | ||
/* STMicroelectronics.X-CUBE-MEMS1.7.0.0 */ | ||
#define STTS751_TEMP_I2C | ||
|
||
#endif /* __RTE_COMPONENTS_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
/** | ||
****************************************************************************** | ||
* @file : custom_bus.h | ||
* @brief : header file for the BSP BUS IO driver | ||
****************************************************************************** | ||
* @attention | ||
* | ||
* <h2><center>© Copyright (c) 2020 STMicroelectronics. | ||
* All rights reserved.</center></h2> | ||
* | ||
* This software component is licensed by ST under Ultimate Liberty license | ||
* SLA0044, the "License"; You may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at: | ||
* www.st.com/SLA0044 | ||
* | ||
****************************************************************************** | ||
*/ | ||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef CUSTOM_BUS_H | ||
#define CUSTOM_BUS_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* Includes ------------------------------------------------------------------*/ | ||
#include "custom_conf.h" | ||
#include "custom_errno.h" | ||
|
||
/** @addtogroup BSP | ||
* @{ | ||
*/ | ||
|
||
/** @addtogroup CUSTOM | ||
* @{ | ||
*/ | ||
|
||
/** @defgroup CUSTOM_BUS CUSTOM BUS | ||
* @{ | ||
*/ | ||
|
||
/** @defgroup CUSTOM_BUS_Exported_Constants CUSTOM BUS Exported Constants | ||
* @{ | ||
*/ | ||
|
||
#define BUS_I2C1_INSTANCE I2C1 | ||
#define BUS_I2C1_SCL_GPIO_PIN GPIO_PIN_6 | ||
#define BUS_I2C1_SCL_GPIO_AF GPIO_AF4_I2C1 | ||
#define BUS_I2C1_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() | ||
#define BUS_I2C1_SCL_GPIO_PORT GPIOB | ||
#define BUS_I2C1_SCL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() | ||
#define BUS_I2C1_SDA_GPIO_PIN GPIO_PIN_7 | ||
#define BUS_I2C1_SDA_GPIO_AF GPIO_AF4_I2C1 | ||
#define BUS_I2C1_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() | ||
#define BUS_I2C1_SDA_GPIO_PORT GPIOB | ||
#define BUS_I2C1_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() | ||
#ifndef BUS_I2C1_POLL_TIMEOUT | ||
#define BUS_I2C1_POLL_TIMEOUT 0x1000U | ||
#endif | ||
/* I2C1 Frequeny in Hz */ | ||
#ifndef BUS_I2C1_FREQUENCY | ||
#define BUS_I2C1_FREQUENCY 1000000U /* Frequency of I2Cn = 100 KHz*/ | ||
#endif | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** @defgroup CUSTOM_BUS_Private_Types CUSTOM BUS Private types | ||
* @{ | ||
*/ | ||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) | ||
typedef struct | ||
{ | ||
pI2C_CallbackTypeDef pMspInitCb; | ||
pI2C_CallbackTypeDef pMspDeInitCb; | ||
}BSP_I2C_Cb_t; | ||
#endif /* (USE_HAL_I2C_REGISTER_CALLBACKS == 1) */ | ||
/** | ||
* @} | ||
*/ | ||
|
||
/** @defgroup CUSTOM_LOW_LEVEL_Exported_Variables LOW LEVEL Exported Constants | ||
* @{ | ||
*/ | ||
|
||
extern I2C_HandleTypeDef hi2c1; | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** @addtogroup CUSTOM_BUS_Exported_Functions | ||
* @{ | ||
*/ | ||
|
||
/* BUS IO driver over I2C Peripheral */ | ||
HAL_StatusTypeDef MX_I2C1_Init(I2C_HandleTypeDef* hi2c); | ||
int32_t BSP_I2C1_Init(void); | ||
int32_t BSP_I2C1_DeInit(void); | ||
int32_t BSP_I2C1_IsReady(uint16_t DevAddr, uint32_t Trials); | ||
int32_t BSP_I2C1_WriteReg(uint16_t Addr, uint16_t Reg, uint8_t *pData, uint16_t Length); | ||
int32_t BSP_I2C1_ReadReg(uint16_t Addr, uint16_t Reg, uint8_t *pData, uint16_t Length); | ||
int32_t BSP_I2C1_WriteReg16(uint16_t Addr, uint16_t Reg, uint8_t *pData, uint16_t Length); | ||
int32_t BSP_I2C1_ReadReg16(uint16_t Addr, uint16_t Reg, uint8_t *pData, uint16_t Length); | ||
int32_t BSP_I2C1_Send(uint16_t DevAddr, uint8_t *pData, uint16_t Length); | ||
int32_t BSP_I2C1_Recv(uint16_t DevAddr, uint8_t *pData, uint16_t Length); | ||
int32_t BSP_I2C1_SendRecv(uint16_t DevAddr, uint8_t *pTxdata, uint8_t *pRxdata, uint16_t Length); | ||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) | ||
int32_t BSP_I2C1_RegisterDefaultMspCallbacks (void); | ||
int32_t BSP_I2C1_RegisterMspCallbacks (BSP_I2C_Cb_t *Callbacks); | ||
#endif /* (USE_HAL_I2C_REGISTER_CALLBACKS == 1) */ | ||
|
||
int32_t BSP_GetTick(void); | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** | ||
* @} | ||
*/ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* CUSTOM_BUS_H */ | ||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
****************************************************************************** | ||
* @file : custom_conf.h | ||
* @brief : Configuration file | ||
****************************************************************************** | ||
****************************************************************************** | ||
*/ | ||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef CUSTOM_CONF_H | ||
#define CUSTOM_CONF_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
/* Includes ------------------------------------------------------------------*/ | ||
#include "stm32l4xx_hal.h" | ||
|
||
/** @addtogroup BSP | ||
* @{ | ||
*/ | ||
|
||
/** @addtogroup CUSTOM | ||
* @{ | ||
*/ | ||
|
||
/** @defgroup CUSTOM_CONFIG Config | ||
* @{ | ||
*/ | ||
|
||
/** @defgroup CUSTOM_CONFIG_Exported_Constants | ||
* @{ | ||
*/ | ||
/* COM Feature define */ | ||
#define USE_BSP_COM_FEATURE 0U | ||
|
||
/* COM define */ | ||
#define USE_COM_LOG 1U | ||
|
||
/* IRQ priorities */ | ||
#define BSP_BUTTON_USER_IT_PRIORITY 15U | ||
|
||
/* I2C1 Frequeny in Hz */ | ||
#define BUS_I2C1_FREQUENCY 100000U /* Frequency of I2C1 = 100 KHz*/ | ||
|
||
/* SPI1 Baud rate in bps */ | ||
#define BUS_SPI1_BAUDRATE 16000000U /* baud rate of SPIn = 16 Mbps */ | ||
|
||
/* UART1 Baud rate in bps */ | ||
#define BUS_UART1_BAUDRATE 9600U /* baud rate of UARTn = 9600 baud */ | ||
/** | ||
* @} | ||
*/ | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif /* CUSTOM_CONF_H */ | ||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
****************************************************************************** | ||
* @file : custom_errno.h | ||
* @brief : Error Code | ||
****************************************************************************** | ||
****************************************************************************** | ||
*/ | ||
|
||
/* Define to prevent recursive inclusion -------------------------------------*/ | ||
#ifndef CUSTOM_ERRNO_H | ||
#define CUSTOM_ERRNO_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* BSP Common Error codes */ | ||
#define BSP_ERROR_NONE 0 | ||
#define BSP_ERROR_NO_INIT -1 | ||
#define BSP_ERROR_WRONG_PARAM -2 | ||
#define BSP_ERROR_BUSY -3 | ||
#define BSP_ERROR_PERIPH_FAILURE -4 | ||
#define BSP_ERROR_COMPONENT_FAILURE -5 | ||
#define BSP_ERROR_UNKNOWN_FAILURE -6 | ||
#define BSP_ERROR_UNKNOWN_COMPONENT -7 | ||
#define BSP_ERROR_BUS_FAILURE -8 | ||
#define BSP_ERROR_CLOCK_FAILURE -9 | ||
#define BSP_ERROR_MSP_FAILURE -10 | ||
#define BSP_ERROR_FEATURE_NOT_SUPPORTED -11 | ||
|
||
|
||
/* BSP BUS error codes */ | ||
|
||
#define BSP_ERROR_BUS_TRANSACTION_FAILURE -100 | ||
#define BSP_ERROR_BUS_ARBITRATION_LOSS -101 | ||
#define BSP_ERROR_BUS_ACKNOWLEDGE_FAILURE -102 | ||
#define BSP_ERROR_BUS_PROTOCOL_FAILURE -103 | ||
|
||
#define BSP_ERROR_BUS_MODE_FAULT -104 | ||
#define BSP_ERROR_BUS_FRAME_ERROR -105 | ||
#define BSP_ERROR_BUS_CRC_ERROR -106 | ||
#define BSP_ERROR_BUS_DMA_FAILURE -107 | ||
|
||
#endif /*CUSTOM_ERRNO_H */ | ||
|
||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
Oops, something went wrong.