Skip to content

PU8702 Brake Pressure

Linear pressure sensor scaling to bar units.

Functions

void pu8702_init(Generic_Linear_Sensor_t* s, uint16_t min_adc, uint16_t max_adc, uint8_t port, Generic_Kalman_Settings_t k)

Initializes the range and metadata.

void pu8702_update(Generic_Linear_Sensor_t* s, uint16_t raw_adc)

Updates displacement for the pressure sensor.

float pu8702_decode(uint8_t high_byte, uint8_t low_byte)

Decodes bar from the encoded value.

Usage

c
#include "pu8702.h"

void pu8702_example(void) {
    Generic_Linear_Sensor_t s = {0};
    Generic_Kalman_Settings_t k = {0};
    pu8702_init(&s, 500, 3500, 0, k);
    pu8702_update(&s, 2000);
}

Released under the MIT License.