summaryrefslogtreecommitdiff
path: root/bsp/hpmicro/libraries/drivers/drv_soft_i2c.h
blob: 384e13e18a618b507de3d3d54525b6949e222c1f (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
/*
 * Copyright (c) 2026 HPMicro
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef __DRV_SOFT_I2C__
#define __DRV_SOFT_I2C__

#include <rtthread.h>
#include <rthw.h>
#include <rtdevice.h>

/* HPM config class */
struct hpm_soft_i2c_config
{
    const char  *scl_pin_name;
    const char  *sda_pin_name;
    const char *bus_name;
};

/* HPM i2c driver class */
struct hpm_i2c
{
    struct rt_i2c_bit_ops ops;
    struct rt_i2c_bus_device i2c_bus;
};

int rt_hw_i2c_init(void);

#endif /* __DRV_SOFT_I2C__ */