tools.h 500 B

1234567891011121314151617181920
  1. /*
  2. * tools.h
  3. *
  4. * Created: 20.08.2019 9:59:00
  5. * Author: Radioman
  6. */
  7. #ifndef TOOLS_H_
  8. #define TOOLS_H_
  9. #include <stdint.h>
  10. void UInt8ToFloat(uint8_t *int_part, uint8_t *frac_part, float *result);
  11. void FloatToUInt8(float *input, uint8_t *int_out, uint8_t *frac_out);
  12. //void arrncpy(void *dest, void *source, uint16_t n);
  13. inline double Approx(double x1, double x2, double y1, double y2, double x)
  14. { return(y1 + ((y2 - y1) * (x - x1) / (x2 - x1))); }
  15. #endif /* TOOLS_H_ */