summaryrefslogtreecommitdiff
path: root/zephyr/include/emul/emul_pct2075.h
blob: f9e1ef60b2b510a2a316a6e0b21c0f49178c62f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Copyright 2022 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef EMUL_PCT2075_H
#define EMUL_PCT2075_H

#include "emul/emul_common_i2c.h"

#include <zephyr/drivers/emul.h>

#define PCT2075_REG_NUMBER 5

struct pct2075_data {
	struct i2c_common_emul_data common;
	uint16_t regs[PCT2075_REG_NUMBER];
};

/**
 * @brief Set the temperature measurement for the sensor.
 *
 * @param emul Pointer to emulator
 * @param mk Temperature to set in mili-kalvin. The temperature
 * should me in range of 328150 to 400150, with 150 resolution.
 *
 * @return 0 on success
 * @return negative on error
 */
int pct2075_emul_set_temp(const struct emul *emul, int mk);

#endif