stm32_eval_i2c_tsensor.c File Reference

This file provides a set of functions needed to manage the I2C LM75 temperature sensor mounted on STM32xx-EVAL board (refer to stm32_eval.h to know about the boards supporting this sensor). It implements a high level communication layer for read and write from/to this sensor. The needed STM32 hardware resources (I2C and GPIO) are defined in stm32xx_eval.h file, and the initialization is performed in LM75_LowLevel_Init() function declared in stm32xx_eval.c file. More...

#include "stm32_eval_i2c_tsensor.h"
#include "stm32_eval.h"

Go to the source code of this file.

Defines

#define LM75_SD_RESET   0xFE
#define LM75_SD_SET   0x01

Functions

void LM75_DeInit (void)
 DeInitializes the LM75_I2C.
static void LM75_DMA_Config (LM75_DMADirection_TypeDef Direction, uint8_t *buffer, uint8_t NumData)
 Configure the DMA Peripheral used to handle communication via I2C.
ErrorStatus LM75_GetStatus (void)
 Checks the LM75 status.
void LM75_Init (void)
 Initializes the LM75_I2C.
uint8_t LM75_ReadConfReg (void)
 Read the configuration register from the LM75.
uint16_t LM75_ReadReg (uint8_t RegName)
 Read the specified register from the LM75.
uint16_t LM75_ReadTemp (void)
 Read Temperature register of LM75: double temperature value.
uint8_t LM75_ShutDown (FunctionalState NewState)
 Enables or disables the LM75.
uint8_t LM75_WriteConfReg (uint8_t RegValue)
 Write to the configuration register of the LM75.
uint8_t LM75_WriteReg (uint8_t RegName, uint16_t RegValue)
 Write to the specified register of the LM75.

Variables

__IO uint32_t LM75_Timeout = LM75_LONG_TIMEOUT

Detailed Description

This file provides a set of functions needed to manage the I2C LM75 temperature sensor mounted on STM32xx-EVAL board (refer to stm32_eval.h to know about the boards supporting this sensor). It implements a high level communication layer for read and write from/to this sensor. The needed STM32 hardware resources (I2C and GPIO) are defined in stm32xx_eval.h file, and the initialization is performed in LM75_LowLevel_Init() function declared in stm32xx_eval.c file.

Author:
MCD Application Team
Version:
V4.3.0
Date:
10/15/2010 Note: ----- This driver uses the DMA method to send and receive data on I2C bus, which allows higher efficiency and reliability of the communication.

You can easily tailor this driver to any other development board, by just adapting the defines for hardware resources and LM75_LowLevel_Init() function.

+-----------------------------------------------------------------+ | Pin assignment | +---------------------------------------+-----------+-------------+ | STM32 I2C Pins | STLM75 | Pin | +---------------------------------------+-----------+-------------+ | LM75_I2C_SDA_PIN/ SDA | SDA | 1 | | LM75_I2C_SCL_PIN/ SCL | SCL | 2 | | LM75_I2C_SMBUSALERT_PIN/ SMBUS ALERT | OS/INT | 3 | | . | GND | 4 (0V) | | . | GND | 5 (0V) | | . | GND | 6 (0V) | | . | GND | 7 (0V) | | . | VDD | 8 (3.3V)| +---------------------------------------+-----------+-------------+

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2010 STMicroelectronics

Definition in file stm32_eval_i2c_tsensor.c.

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32