summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/dev_alarm.h (renamed from components/drivers/include/drivers/alarm.h)6
-rw-r--r--components/drivers/include/drivers/dev_audio.h (renamed from components/drivers/include/drivers/audio.h)8
-rw-r--r--components/drivers/include/drivers/dev_can.h (renamed from components/drivers/include/drivers/can.h)6
-rw-r--r--components/drivers/include/drivers/dev_i2c.h (renamed from components/drivers/include/drivers/i2c.h)23
-rw-r--r--components/drivers/include/drivers/dev_i2c_bit_ops.h (renamed from components/drivers/include/drivers/i2c-bit-ops.h)4
-rw-r--r--components/drivers/include/drivers/dev_i2c_dm.h (renamed from components/drivers/include/drivers/i2c_dm.h)6
-rw-r--r--components/drivers/include/drivers/dev_pin.h (renamed from components/drivers/include/drivers/pin.h)4
-rw-r--r--components/drivers/include/drivers/dev_pwm.h (renamed from components/drivers/include/drivers/rt_drv_pwm.h)6
-rw-r--r--components/drivers/include/drivers/dev_rtc.h (renamed from components/drivers/include/drivers/rtc.h)6
-rw-r--r--components/drivers/include/drivers/i2c_dev.h44
-rw-r--r--components/drivers/include/drivers/sensor.h2
-rw-r--r--components/drivers/include/drivers/sensor_v2.h2
-rw-r--r--components/drivers/include/drivers/spi.h2
-rw-r--r--components/drivers/include/drivers/touch.h2
-rw-r--r--components/drivers/include/rtdevice.h19
15 files changed, 57 insertions, 83 deletions
diff --git a/components/drivers/include/drivers/alarm.h b/components/drivers/include/drivers/dev_alarm.h
index 864933d78c..4553569260 100644
--- a/components/drivers/include/drivers/alarm.h
+++ b/components/drivers/include/drivers/dev_alarm.h
@@ -10,8 +10,8 @@
* 2020-10-15 zhangsz add alarm flags hour minute second.
*/
-#ifndef __ALARM_H__
-#define __ALARM_H__
+#ifndef __DEV_ALARM_H__
+#define __DEV_ALARM_H__
#include <sys/time.h>
#include <rtdef.h>
@@ -72,4 +72,4 @@ rt_err_t rt_alarm_start(rt_alarm_t alarm);
rt_err_t rt_alarm_stop(rt_alarm_t alarm);
int rt_alarm_system_init(void);
-#endif /* __ALARM_H__ */
+#endif /* __DEV_ALARM_H__ */
diff --git a/components/drivers/include/drivers/audio.h b/components/drivers/include/drivers/dev_audio.h
index 6d98272556..ef92a935ab 100644
--- a/components/drivers/include/drivers/audio.h
+++ b/components/drivers/include/drivers/dev_audio.h
@@ -10,10 +10,10 @@
*
*/
-#ifndef __AUDIO_H__
-#define __AUDIO_H__
+#ifndef __DEV_AUDIO_H__
+#define __DEV_AUDIO_H__
-#include "audio_pipe.h"
+#include "dev_audio_pipe.h"
/* AUDIO command */
#define _AUDIO_CTL(a) (RT_DEVICE_CTRL_BASE(Sound) + a)
@@ -173,4 +173,4 @@ void rt_audio_rx_done(struct rt_audio_device *audio, rt_uint8_t *pbuf, rt
#define CODEC_VOLUME_MAX (63)
-#endif /* __AUDIO_H__ */
+#endif /* __DEV_AUDIO_H__ */
diff --git a/components/drivers/include/drivers/can.h b/components/drivers/include/drivers/dev_can.h
index 2ce60d8072..9f2d7c0677 100644
--- a/components/drivers/include/drivers/can.h
+++ b/components/drivers/include/drivers/dev_can.h
@@ -10,8 +10,8 @@
* 2022-05-08 hpmicro add CANFD support, fixed typos
*/
-#ifndef CAN_H_
-#define CAN_H_
+#ifndef __DEV_CAN_H_
+#define __DEV_CAN_H_
#include <rtthread.h>
@@ -360,5 +360,5 @@ rt_err_t rt_hw_can_register(struct rt_can_device *can,
const struct rt_can_ops *ops,
void *data);
void rt_hw_can_isr(struct rt_can_device *can, int event);
-#endif /*_CAN_H*/
+#endif /*__DEV_CAN_H*/
diff --git a/components/drivers/include/drivers/i2c.h b/components/drivers/include/drivers/dev_i2c.h
index 0473a1e8dd..1a469eb473 100644
--- a/components/drivers/include/drivers/i2c.h
+++ b/components/drivers/include/drivers/dev_i2c.h
@@ -9,8 +9,8 @@
* 2021-04-20 RiceChen added support for bus control api
*/
-#ifndef __I2C_H__
-#define __I2C_H__
+#ifndef __DEV_I2C_H__
+#define __DEV_I2C_H__
#include <rtthread.h>
@@ -26,6 +26,22 @@ extern "C" {
#define RT_I2C_NO_READ_ACK (1u << 6) /* when I2C reading, we do not ACK */
#define RT_I2C_NO_STOP (1u << 7)
+#define RT_I2C_DEV_CTRL_10BIT (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x01)
+#define RT_I2C_DEV_CTRL_ADDR (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x02)
+#define RT_I2C_DEV_CTRL_TIMEOUT (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x03)
+#define RT_I2C_DEV_CTRL_RW (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x04)
+#define RT_I2C_DEV_CTRL_CLK (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x05)
+#define RT_I2C_DEV_CTRL_UNLOCK (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x06)
+#define RT_I2C_DEV_CTRL_GET_STATE (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x07)
+#define RT_I2C_DEV_CTRL_GET_MODE (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x08)
+#define RT_I2C_DEV_CTRL_GET_ERROR (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x09)
+
+struct rt_i2c_priv_data
+{
+ struct rt_i2c_msg *msgs;
+ rt_size_t number;
+};
+
struct rt_i2c_msg
{
rt_uint16_t addr;
@@ -99,6 +115,9 @@ rt_err_t rt_i2c_device_register(struct rt_i2c_client *client);
#define RT_I2C_DRIVER_EXPORT(driver) RT_DRIVER_EXPORT(driver, i2c, BUILIN)
#endif /* RT_USING_DM */
+rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus,
+ const char *name);
+
rt_err_t rt_i2c_bus_device_register(struct rt_i2c_bus_device *bus,
const char *bus_name);
struct rt_i2c_bus_device *rt_i2c_bus_device_find(const char *bus_name);
diff --git a/components/drivers/include/drivers/i2c-bit-ops.h b/components/drivers/include/drivers/dev_i2c_bit_ops.h
index 2b4ea57990..3c28714b92 100644
--- a/components/drivers/include/drivers/i2c-bit-ops.h
+++ b/components/drivers/include/drivers/dev_i2c_bit_ops.h
@@ -8,8 +8,8 @@
* 2012-04-25 weety first version
*/
-#ifndef __I2C_BIT_OPS_H__
-#define __I2C_BIT_OPS_H__
+#ifndef __DEV_I2C_BIT_OPS_H__
+#define __DEV_I2C_BIT_OPS_H__
#ifdef __cplusplus
extern "C" {
diff --git a/components/drivers/include/drivers/i2c_dm.h b/components/drivers/include/drivers/dev_i2c_dm.h
index 4f5b251c60..c59d6e9a82 100644
--- a/components/drivers/include/drivers/i2c_dm.h
+++ b/components/drivers/include/drivers/dev_i2c_dm.h
@@ -8,8 +8,8 @@
* 2022-11-26 GuEe-GUI first version
*/
-#ifndef __I2C_DM_H__
-#define __I2C_DM_H__
+#ifndef __DEV_I2C_DM_H__
+#define __DEV_I2C_DM_H__
#include <rthw.h>
#include <rtthread.h>
@@ -48,4 +48,4 @@ rt_inline rt_err_t i2c_timings_ofw_parse(struct rt_ofw_node *dev_np, struct i2c_
void i2c_bus_scan_clients(struct rt_i2c_bus_device *bus);
-#endif /* __I2C_DM_H__ */
+#endif /* __DEV_I2C_DM_H__ */
diff --git a/components/drivers/include/drivers/pin.h b/components/drivers/include/drivers/dev_pin.h
index 22d4328e16..55289c0b1a 100644
--- a/components/drivers/include/drivers/pin.h
+++ b/components/drivers/include/drivers/dev_pin.h
@@ -9,8 +9,8 @@
* 2017-10-20 ZYH add mode open drain and input pull down
*/
-#ifndef PIN_H__
-#define PIN_H__
+#ifndef DEV_PIN_H__
+#define DEV_PIN_H__
#include <rtthread.h>
diff --git a/components/drivers/include/drivers/rt_drv_pwm.h b/components/drivers/include/drivers/dev_pwm.h
index e9e1707144..98d6cef6d6 100644
--- a/components/drivers/include/drivers/rt_drv_pwm.h
+++ b/components/drivers/include/drivers/dev_pwm.h
@@ -9,8 +9,8 @@
* 2022-09-24 yuqi add phase and dead time configuration
*/
-#ifndef __DRV_PWM_H_INCLUDE__
-#define __DRV_PWM_H_INCLUDE__
+#ifndef __DEV_PWM_H__
+#define __DEV_PWM_H__
#include <rtthread.h>
@@ -63,4 +63,4 @@ rt_err_t rt_pwm_set_pulse(struct rt_device_pwm *device, int channel, rt_uint32_t
rt_err_t rt_pwm_set_dead_time(struct rt_device_pwm *device, int channel, rt_uint32_t dead_time);
rt_err_t rt_pwm_set_phase(struct rt_device_pwm *device, int channel, rt_uint32_t phase);
-#endif /* __DRV_PWM_H_INCLUDE__ */
+#endif /* __DEV_PWM_H__ */
diff --git a/components/drivers/include/drivers/rtc.h b/components/drivers/include/drivers/dev_rtc.h
index cba0ff9149..96658968e5 100644
--- a/components/drivers/include/drivers/rtc.h
+++ b/components/drivers/include/drivers/dev_rtc.h
@@ -11,8 +11,8 @@
* 2022-04-05 tyx add timestamp function
*/
-#ifndef __RTC_H__
-#define __RTC_H__
+#ifndef __DEV_RTC_H__
+#define __DEV_RTC_H__
#include <rtdef.h>
#include <sys/time.h>
@@ -79,4 +79,4 @@ rt_err_t rt_soft_rtc_set_source(const char *name);
}
#endif
-#endif /* __RTC_H__ */
+#endif /* __DEV_RTC_H__ */
diff --git a/components/drivers/include/drivers/i2c_dev.h b/components/drivers/include/drivers/i2c_dev.h
deleted file mode 100644
index 6744fa142d..0000000000
--- a/components/drivers/include/drivers/i2c_dev.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2006-2023, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2012-04-25 weety first version
- * 2021-04-20 RiceChen added bus clock command
- */
-
-#ifndef __I2C_DEV_H__
-#define __I2C_DEV_H__
-
-#include <rtthread.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define RT_I2C_DEV_CTRL_10BIT (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x01)
-#define RT_I2C_DEV_CTRL_ADDR (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x02)
-#define RT_I2C_DEV_CTRL_TIMEOUT (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x03)
-#define RT_I2C_DEV_CTRL_RW (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x04)
-#define RT_I2C_DEV_CTRL_CLK (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x05)
-#define RT_I2C_DEV_CTRL_UNLOCK (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x06)
-#define RT_I2C_DEV_CTRL_GET_STATE (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x07)
-#define RT_I2C_DEV_CTRL_GET_MODE (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x08)
-#define RT_I2C_DEV_CTRL_GET_ERROR (RT_DEVICE_CTRL_BASE(I2CBUS) + 0x09)
-
-struct rt_i2c_priv_data
-{
- struct rt_i2c_msg *msgs;
- rt_size_t number;
-};
-
-rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus,
- const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/drivers/include/drivers/sensor.h b/components/drivers/include/drivers/sensor.h
index 6c8b78e8a5..537266d705 100644
--- a/components/drivers/include/drivers/sensor.h
+++ b/components/drivers/include/drivers/sensor.h
@@ -12,7 +12,7 @@
#define __SENSOR_H__
#include <rtthread.h>
-#include "pin.h"
+#include "dev_pin.h"
#ifdef __cplusplus
extern "C" {
diff --git a/components/drivers/include/drivers/sensor_v2.h b/components/drivers/include/drivers/sensor_v2.h
index d90cef89c7..3cb00cac88 100644
--- a/components/drivers/include/drivers/sensor_v2.h
+++ b/components/drivers/include/drivers/sensor_v2.h
@@ -13,7 +13,7 @@
#define __SENSOR_H__
#include <rtthread.h>
-#include "pin.h"
+#include "dev_pin.h"
#ifdef __cplusplus
extern "C" {
diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h
index b35c7b30b3..8c0bf0bbe9 100644
--- a/components/drivers/include/drivers/spi.h
+++ b/components/drivers/include/drivers/spi.h
@@ -15,7 +15,7 @@
#include <stdlib.h>
#include <rtthread.h>
-#include <drivers/pin.h>
+#include <drivers/dev_pin.h>
#ifdef __cplusplus
extern "C"{
diff --git a/components/drivers/include/drivers/touch.h b/components/drivers/include/drivers/touch.h
index aa297491dc..edaf0ad230 100644
--- a/components/drivers/include/drivers/touch.h
+++ b/components/drivers/include/drivers/touch.h
@@ -12,7 +12,7 @@
#define __TOUCH_H__
#include <rtthread.h>
-#include "pin.h"
+#include "dev_pin.h"
#ifdef __cplusplus
extern "C" {
diff --git a/components/drivers/include/rtdevice.h b/components/drivers/include/rtdevice.h
index 5b080fced7..caff5284e5 100644
--- a/components/drivers/include/rtdevice.h
+++ b/components/drivers/include/rtdevice.h
@@ -59,9 +59,9 @@ extern "C" {
#endif /* RT_USING_DM */
#ifdef RT_USING_RTC
-#include "drivers/rtc.h"
+#include "drivers/dev_rtc.h"
#ifdef RT_USING_ALARM
-#include "drivers/alarm.h"
+#include "drivers/dev_alarm.h"
#endif
#endif /* RT_USING_RTC */
@@ -94,15 +94,14 @@ extern "C" {
#endif /* RT_USING_SERIAL */
#ifdef RT_USING_I2C
-#include "drivers/i2c.h"
-#include "drivers/i2c_dev.h"
+#include "drivers/dev_i2c.h"
#ifdef RT_USING_I2C_BITOPS
-#include "drivers/i2c-bit-ops.h"
+#include "drivers/dev_i2c_bit_ops.h"
#endif /* RT_USING_I2C_BITOPS */
#ifdef RT_USING_DM
-#include "drivers/i2c_dm.h"
+#include "drivers/dev_i2c_dm.h"
#endif /* RT_USING_DM */
#endif /* RT_USING_I2C */
@@ -123,7 +122,7 @@ extern "C" {
#endif /* RT_USING_WDT */
#ifdef RT_USING_PIN
-#include "drivers/pin.h"
+#include "drivers/dev_pin.h"
#endif /* RT_USING_PIN */
#ifdef RT_USING_SENSOR
@@ -135,7 +134,7 @@ extern "C" {
#endif /* RT_USING_SENSOR */
#ifdef RT_USING_CAN
-#include "drivers/can.h"
+#include "drivers/dev_can.h"
#endif /* RT_USING_CAN */
#ifdef RT_USING_HWTIMER
@@ -143,7 +142,7 @@ extern "C" {
#endif /* RT_USING_HWTIMER */
#ifdef RT_USING_AUDIO
-#include "drivers/audio.h"
+#include "drivers/dev_audio.h"
#endif /* RT_USING_AUDIO */
#ifdef RT_USING_CPUTIME
@@ -159,7 +158,7 @@ extern "C" {
#endif /* RT_USING_DAC */
#ifdef RT_USING_PWM
-#include "drivers/rt_drv_pwm.h"
+#include "drivers/dev_pwm.h"
#endif /* RT_USING_PWM */
#ifdef RT_USING_PM