nimaltd / max31865

Max31865 library for stm32 hal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MAX31865 Library

This is the MAX31865 STM32 HAL Library
Based on https://github.com/adafruit/Adafruit_MAX31865

How to use this Library:

  • Select "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" on project settings.
  • Enable SPI and set clock below 2MHz,MSB,CPOL LOW,CPHA 2 Edge.
  • Enable a gpio as Output for CS Pin.
  • Include Header and source into your project.
  • Config "Max31865Conf.h".
  • Call Max31865_Init( .. .. .. ).
#include "Max31865.h"
Max31865_t  pt100;
bool        pt100isOK;
float       pt100Temp;
int main()
{
  Max31865_init(&pt100,&hspi3,SENSOR_CS1_GPIO_Port,SENSOR_CS1_Pin,4,50);
  while(1)
  {
    float t;
    pt100isOK = Max31865_readTempC(&pt100,&t);
    pt100Temp = Max31865_Filter(t,pt100Temp,0.1);   //  << For Smoothing data  
    HAL_Delay(1000);
  }
}

About

Max31865 library for stm32 hal

License:GNU General Public License v3.0


Languages

Language:C 100.0%