/*
 * cc_pid.h
 *
 *  Created on: Jun 10, 2025
 *      Author: janik
 */

#ifndef INC_PI_H_
#define INC_PI_H_

#include <stdint.h>

#include <stdint.h>

typedef struct {
    float Kp;
    float Ki;
    float prev_error;
    uint16_t output;
    uint16_t out_min;
    uint16_t out_max;
} PIController;

void PI_Init(PIController *pi, float Kp, float Ki, uint16_t out_min, uint16_t out_max);
uint16_t PI_Update(PIController *pi, float target, float measurement);

#endif /* INC_PI_H_ */
