1.优化api。
This commit is contained in:
@@ -90,8 +90,8 @@ struct mr_i2c_bus_ops
|
||||
void (*start)(struct mr_i2c_bus *i2c_bus);
|
||||
void (*send_addr)(struct mr_i2c_bus *i2c_bus, int addr, int addr_bits);
|
||||
void (*stop)(struct mr_i2c_bus *i2c_bus);
|
||||
ssize_t (*read)(struct mr_i2c_bus *i2c_bus, uint8_t *buf, size_t size);
|
||||
ssize_t (*write)(struct mr_i2c_bus *i2c_bus, const uint8_t *buf, size_t size);
|
||||
uint8_t (*read)(struct mr_i2c_bus *i2c_bus);
|
||||
void (*write)(struct mr_i2c_bus *i2c_bus, uint8_t data);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,8 +75,8 @@ struct mr_pin
|
||||
struct mr_pin_ops
|
||||
{
|
||||
int (*configure)(struct mr_pin *pin, int number, int mode);
|
||||
int (*read)(struct mr_pin *pin, int number);
|
||||
void (*write)(struct mr_pin *pin, int number, int value);
|
||||
uint8_t (*read)(struct mr_pin *pin, int number);
|
||||
void (*write)(struct mr_pin *pin, int number, uint8_t value);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,8 +118,8 @@ struct mr_serial
|
||||
struct mr_serial_ops
|
||||
{
|
||||
int (*configure)(struct mr_serial *serial, struct mr_serial_config *config);
|
||||
ssize_t (*read)(struct mr_serial *serial, uint8_t *buf, size_t size);
|
||||
ssize_t (*write)(struct mr_serial *serial, const uint8_t *buf, size_t size);
|
||||
uint8_t (*read)(struct mr_serial *serial);
|
||||
void (*write)(struct mr_serial *serial, uint8_t data);
|
||||
void (*start_tx)(struct mr_serial *serial);
|
||||
void (*stop_tx)(struct mr_serial *serial);
|
||||
};
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* @copyright (c) 2023, MR Development Team
|
||||
*
|
||||
* @license SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* @date 2023-11-11 MacRsh First version
|
||||
*/
|
||||
|
||||
#ifndef _MR_DRV_H_
|
||||
#define _MR_DRV_H_
|
||||
|
||||
#include "include/mr_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef MR_USING_ADC
|
||||
#include "driver/drv_adc.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_CAN
|
||||
#include "driver/drv_can.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_DAC
|
||||
#include "driver/drv_dac.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_I2C
|
||||
#include "driver/drv_i2c.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_PIN
|
||||
#include "driver/drv_pin.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_SERIAL
|
||||
#include "driver/drv_serial.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_SPI
|
||||
#include "driver/drv_spi.h"
|
||||
#endif
|
||||
|
||||
#ifdef MR_USING_TIMER
|
||||
#include "driver/drv_timer.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _MR_DRV_H_ */
|
||||
Reference in New Issue
Block a user