mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 11:30:01 +08:00
[device] add dev_ prefix for file names
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <rthw.h>
|
||||
#include <rtdevice.h>
|
||||
#include "audio_pipe.h"
|
||||
#include "dev_audio_pipe.h"
|
||||
|
||||
static void _rt_pipe_resume_writer(struct rt_audio_pipe *pipe)
|
||||
{
|
||||
@@ -6,8 +6,8 @@
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
*/
|
||||
#ifndef __AUDIO_PIPE_H__
|
||||
#define __AUDIO_PIPE_H__
|
||||
#ifndef __DEV_AUDIO_PIPE_H__
|
||||
#define __DEV_AUDIO_PIPE_H__
|
||||
|
||||
/**
|
||||
* Pipe Device
|
||||
@@ -72,4 +72,4 @@ rt_err_t rt_audio_pipe_create(const char *name, rt_int32_t flag, rt_size_t size)
|
||||
void rt_audio_pipe_destroy(struct rt_audio_pipe *pipe);
|
||||
#endif /* RT_USING_HEAP */
|
||||
|
||||
#endif /* __AUDIO_PIPE_H__ */
|
||||
#endif /* __DEV_AUDIO_PIPE_H__ */
|
||||
@@ -3,16 +3,16 @@ from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Split("""
|
||||
i2c_core.c
|
||||
i2c_dev.c
|
||||
dev_i2c_core.c
|
||||
dev_i2c_dev.c
|
||||
""")
|
||||
|
||||
if GetDepend('RT_USING_I2C_BITOPS'):
|
||||
src = src + ['i2c-bit-ops.c']
|
||||
src = src + ['dev_i2c_bit_ops.c']
|
||||
if GetDepend('RT_USING_SOFT_I2C'):
|
||||
src = src + ['soft_i2c.c']
|
||||
src = src + ['dev_soft_i2c.c']
|
||||
if GetDepend(['RT_USING_DM']):
|
||||
src += ['i2c_bus.c', 'i2c_dm.c']
|
||||
src += ['dev_i2c_bus.c', 'dev_i2c_dm.c']
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
path = [cwd + '/../include']
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <rtdevice.h>
|
||||
|
||||
#define DBG_TAG "i2c.bus"
|
||||
#define DBG_TAG "dev.i2c.bus"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <rtdevice.h>
|
||||
|
||||
#define DBG_TAG "i2c.dm"
|
||||
#define DBG_TAG "dev.i2c.dm"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
+3
-3
@@ -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__ */
|
||||
+4
-4
@@ -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__ */
|
||||
+3
-3
@@ -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*/
|
||||
|
||||
+21
-2
@@ -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);
|
||||
+2
-2
@@ -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" {
|
||||
+3
-3
@@ -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__ */
|
||||
+2
-2
@@ -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>
|
||||
|
||||
+3
-3
@@ -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__ */
|
||||
+3
-3
@@ -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__ */
|
||||
@@ -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
|
||||
@@ -12,7 +12,7 @@
|
||||
#define __SENSOR_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "pin.h"
|
||||
#include "dev_pin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define __SENSOR_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "pin.h"
|
||||
#include "dev_pin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <rtthread.h>
|
||||
#include <drivers/pin.h>
|
||||
#include <drivers/dev_pin.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define __TOUCH_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "pin.h"
|
||||
#include "dev_pin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -8,13 +8,13 @@ if not GetDepend(['RT_USING_PIN']):
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd + '/../include']
|
||||
|
||||
src = ['pin.c']
|
||||
src = ['dev_pin.c']
|
||||
|
||||
if GetDepend(['RT_USING_DM']):
|
||||
src += ['pin_dm.c']
|
||||
src += ['dev_pin_dm.c']
|
||||
|
||||
if GetDepend(['RT_USING_OFW']):
|
||||
src += ['pin_ofw.c']
|
||||
src += ['dev_pin_ofw.c']
|
||||
|
||||
group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* 2022-04-29 WangQiang add pin operate command in MSH
|
||||
*/
|
||||
|
||||
#include <drivers/pin.h>
|
||||
#include <drivers/dev_pin.h>
|
||||
|
||||
static struct rt_device_pin _hw_pin;
|
||||
static rt_ssize_t _pin_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
|
||||
@@ -8,7 +8,7 @@
|
||||
* 2022-11-26 GuEe-GUI first version
|
||||
*/
|
||||
|
||||
#include "pin_dm.h"
|
||||
#include "dev_pin_dm.h"
|
||||
|
||||
static void pin_dm_irq_mask(struct rt_pic_irq *pirq)
|
||||
{
|
||||
@@ -18,4 +18,4 @@
|
||||
rt_err_t pin_pic_handle_isr(struct rt_device_pin *gpio, rt_base_t pin);
|
||||
rt_err_t pin_pic_init(struct rt_device_pin *gpio);
|
||||
|
||||
#endif /* __PIN_DM_H__ */
|
||||
#endif /* __DEV_PIN_DM_H__ */
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <dt-bindings/pin/pin.h>
|
||||
|
||||
#include "pin_dm.h"
|
||||
#include "dev_pin_dm.h"
|
||||
|
||||
static const char * const gpio_suffixes[] =
|
||||
{
|
||||
@@ -7,11 +7,11 @@ CPPPATH = [cwd + '/../include']
|
||||
group = []
|
||||
|
||||
if GetDepend(['RT_USING_RTC']):
|
||||
src = src + ['rtc.c']
|
||||
src = src + ['dev_rtc.c']
|
||||
if GetDepend(['RT_USING_ALARM']):
|
||||
src = src + ['alarm.c']
|
||||
src = src + ['dev_alarm.c']
|
||||
if GetDepend(['RT_USING_SOFT_RTC']):
|
||||
src = src + ['soft_rtc.c']
|
||||
src = src + ['dev_soft_rtc.c']
|
||||
|
||||
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_RTC'], CPPPATH = CPPPATH)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <rtthread.h>
|
||||
#include <drivers/rtc.h>
|
||||
#include <drivers/dev_rtc.h>
|
||||
|
||||
#ifdef RT_USING_RTC
|
||||
|
||||
Reference in New Issue
Block a user