TEMP.h 1014 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __DS18B20_H
  2. #define __DS18B20_H
  3. /* Includes ------------------------------------------------------------------*/
  4. #include "stm32f4xx_hal.h"
  5. /** @defgroup GPIO_pins_define GPIO pins define
  6. * @{
  7. */
  8. /* DS18B20 IO operation functions *****************************************************/
  9. #define CLR_DS18B20() HAL_GPIO_WritePin (ONEWIRE_GPIO_Port,ONEWIRE_Pin,GPIO_PIN_RESET )
  10. #define SET_DS18B20() HAL_GPIO_WritePin (ONEWIRE_GPIO_Port,ONEWIRE_Pin,GPIO_PIN_SET )
  11. #define DS18B20_DQ_IN HAL_GPIO_ReadPin(ONEWIRE_GPIO_Port, ONEWIRE_Pin)
  12. /* Exported functions --------------------------------------------------------*/
  13. /** @addtogroup DS18B20_Exported_Functions
  14. * @{
  15. */
  16. uint8_t DS18B20_Init(void);
  17. short DS18B20_Get_Temp(void);
  18. void DS18B20_Start(void);
  19. void DS18B20_Write_Byte(uint8_t dat);
  20. uint8_t DS18B20_Read_Byte(void);
  21. uint8_t DS18B20_Read_Bit(void);
  22. uint8_t DS18B20_Check(void);
  23. void DS18B20_Rst(void);
  24. #endif