diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-25 22:24:18 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-25 22:29:25 +0100 |
commit | 40e04e3772726829d66c12e69f24b03920d79c67 (patch) | |
tree | 636811bad956798c9d5d22de9e7ba8c799b8d791 /thirdparty/STM32_USB-FS-Device_Lib_V4.0.0/Utilities/STM32_EVAL/STM32373C_EVAL/stm32373c_eval_i2c_tsensor_cpal.h | |
parent | 2fff65aed2477a503c72629d27e2a330d30c02d1 (diff) | |
download | stm32f103-playground-40e04e3772726829d66c12e69f24b03920d79c67.tar.gz stm32f103-playground-40e04e3772726829d66c12e69f24b03920d79c67.tar.bz2 stm32f103-playground-40e04e3772726829d66c12e69f24b03920d79c67.tar.xz stm32f103-playground-40e04e3772726829d66c12e69f24b03920d79c67.zip |
o Moving tinyprintf and stm libraries under thirdparty.
Diffstat (limited to 'thirdparty/STM32_USB-FS-Device_Lib_V4.0.0/Utilities/STM32_EVAL/STM32373C_EVAL/stm32373c_eval_i2c_tsensor_cpal.h')
-rw-r--r-- | thirdparty/STM32_USB-FS-Device_Lib_V4.0.0/Utilities/STM32_EVAL/STM32373C_EVAL/stm32373c_eval_i2c_tsensor_cpal.h | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/thirdparty/STM32_USB-FS-Device_Lib_V4.0.0/Utilities/STM32_EVAL/STM32373C_EVAL/stm32373c_eval_i2c_tsensor_cpal.h b/thirdparty/STM32_USB-FS-Device_Lib_V4.0.0/Utilities/STM32_EVAL/STM32373C_EVAL/stm32373c_eval_i2c_tsensor_cpal.h new file mode 100644 index 0000000..dd868b4 --- /dev/null +++ b/thirdparty/STM32_USB-FS-Device_Lib_V4.0.0/Utilities/STM32_EVAL/STM32373C_EVAL/stm32373c_eval_i2c_tsensor_cpal.h @@ -0,0 +1,129 @@ +/** + ****************************************************************************** + * @file stm32373c_eval_i2c_tsensor_cpal.h + * @author MCD Application Team + * @version V1.0.0 + * @date 20-September-2012 + * @brief This file contains all the functions prototypes for the + * stm32373c_eval_i2c_tsensor_cpal.c firmware driver. + ****************************************************************************** + * @attention + * + * <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2> + * + * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.st.com/software_license_agreement_liberty_v2 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32373C_EVAL_I2C_TSENSOR_CPAL_H +#define __STM32373C_EVAL_I2C_TSENSOR_CPAL_H + +#ifdef __cplusplus + extern "C" { +#endif + + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f37x_i2c_cpal.h" + +/* Exported types ------------------------------------------------------------*/ + +/** + * @brief TSENSOR Status + */ +typedef enum +{ + LM75_OK = 0, + LM75_FAIL +}LM75_Status_TypDef; + +/* Exported constants --------------------------------------------------------*/ + +/*====================== CPAL Structure configuration ========================*/ +/* Select I2C device (uncomment relative define) */ + +//#define LM75_DevStructure I2C1_DevStructure +#define LM75_DevStructure I2C2_DevStructure + + +/*============== TIMING Configuration ==========================*/ +/* I2C TIMING Register define when I2C clock source is SYSCLK */ +/* I2C TIMING is calculated in case of the I2C Clock source is the SYSCLK = 72 MHz */ +/* set TIMING to 0xC062121F to reach 100 KHz speed (Rise time = 640ns, Fall time = 20ns) */ + +#define LM75_I2C_TIMING 0xC062121F + + +/*=================== Programming model Configuration ========================*/ +/* Select interrupt programming model : By default DMA programming model is selected. + To select interrupt programming model uncomment this define */ +//#define LM75_IT + + +/* Maximum Timeout values for waiting until device is ready for communication.*/ + +#define LM75_TIMEOUT ((uint32_t)0x3FFFF) + +/** + * @brief Internal register Memory + */ +#define LM75_REG_TEMP 0x00 /*!< Temperature Register of LM75 */ +#define LM75_REG_CONF 0x01 /*!< Configuration Register of LM75 */ +#define LM75_REG_THYS 0x02 /*!< Temperature Register of LM75 */ +#define LM75_REG_TOS 0x03 /*!< Over-temp Shutdown threshold Register of LM75 */ +#define LM75_ADDR 0x90 /*!< LM75 address */ + + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +void LM75_DeInit(void); +void LM75_Config(void); +ErrorStatus LM75_GetStatus(void); +uint16_t LM75_ReadTemp(void); +uint16_t LM75_ReadReg(uint8_t RegName); +uint8_t LM75_WriteReg(uint8_t RegName, uint16_t RegValue); +uint8_t LM75_ReadConfReg(void); +uint8_t LM75_WriteConfReg(uint8_t RegValue); +uint8_t LM75_ShutDown(FunctionalState NewState); + + + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32373C_EVAL_I2C_TSENSOR_CPAL_H */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |