change the coding style of rtdevice.h

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2337 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz@gmail.com 2012-10-10 13:21:06 +00:00
parent 8b570bbae6
commit 66c2e88566

View File

@ -1,3 +1,17 @@
/*
* File : serial.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2012-01-08 bernard first version.
*/
#ifndef __RT_DEVICE_H__
#define __RT_DEVICE_H__
@ -68,10 +82,10 @@ struct rt_data_queue
/**
* Completion
*/
void rt_completion_init(struct rt_completion* completion);
rt_err_t rt_completion_wait(struct rt_completion* completion,
void rt_completion_init(struct rt_completion *completion);
rt_err_t rt_completion_wait(struct rt_completion *completion,
rt_int32_t timeout);
void rt_completion_done(struct rt_completion* completion);
void rt_completion_done(struct rt_completion *completion);
/**
* RingBuffer for DeviceDriver
@ -79,19 +93,19 @@ void rt_completion_done(struct rt_completion* completion);
* Please note that the ring buffer implementation of RT-Thread
* has no thread wait or resume feature.
*/
void rt_ringbuffer_init(struct rt_ringbuffer* rb,
void rt_ringbuffer_init(struct rt_ringbuffer *rb,
rt_uint8_t *pool,
rt_uint16_t size);
rt_size_t rt_ringbuffer_put(struct rt_ringbuffer* rb,
rt_size_t rt_ringbuffer_put(struct rt_ringbuffer *rb,
const rt_uint8_t *ptr,
rt_uint16_t length);
rt_size_t rt_ringbuffer_putchar(struct rt_ringbuffer* rb,
rt_size_t rt_ringbuffer_putchar(struct rt_ringbuffer *rb,
const rt_uint8_t ch);
rt_size_t rt_ringbuffer_get(struct rt_ringbuffer* rb,
rt_size_t rt_ringbuffer_get(struct rt_ringbuffer *rb,
rt_uint8_t *ptr,
rt_uint16_t length);
rt_size_t rt_ringbuffer_getchar(struct rt_ringbuffer* rb, rt_uint8_t *ch);
rt_inline rt_uint16_t rt_ringbuffer_get_size(struct rt_ringbuffer* rb)
rt_size_t rt_ringbuffer_getchar(struct rt_ringbuffer *rb, rt_uint8_t *ch);
rt_inline rt_uint16_t rt_ringbuffer_get_size(struct rt_ringbuffer *rb)
{
RT_ASSERT(rb != RT_NULL);
return rb->buffer_size;
@ -100,20 +114,28 @@ rt_inline rt_uint16_t rt_ringbuffer_get_size(struct rt_ringbuffer* rb)
/**
* Pipe Device
*/
rt_err_t rt_pipe_create(const char* name, rt_size_t size);
void rt_pipe_destroy(struct rt_pipe_device* pipe);
rt_err_t rt_pipe_create(const char *name, rt_size_t size);
void rt_pipe_destroy(struct rt_pipe_device *pipe);
/**
* DataQueue for DeviceDriver
*/
rt_err_t rt_data_queue_init(struct rt_data_queue* queue, rt_uint16_t size, rt_uint16_t lwm,
void (*evt_notify)(struct rt_data_queue* queue, rt_uint32_t event));
rt_err_t rt_data_queue_push(struct rt_data_queue* queue, void* data_ptr, rt_size_t data_size,
rt_err_t rt_data_queue_init(struct rt_data_queue *queue,
rt_uint16_t size,
rt_uint16_t lwm,
void (*evt_notify)(struct rt_data_queue *queue, rt_uint32_t event));
rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
void *data_ptr,
rt_size_t data_size,
rt_int32_t timeout);
rt_err_t rt_data_queue_pop(struct rt_data_queue* queue, void** data_ptr, rt_size_t *size,
rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
void **data_ptr,
rt_size_t *size,
rt_int32_t timeout);
rt_err_t rt_data_queue_peak(struct rt_data_queue* queue, void** data_ptr, rt_size_t *size);
void rt_data_queue_reset(struct rt_data_queue* queue);
rt_err_t rt_data_queue_peak(struct rt_data_queue *queue,
void **data_ptr,
rt_size_t *size);
void rt_data_queue_reset(struct rt_data_queue *queue);
#ifdef RT_USING_RTC
#include "drivers/rtc.h"
@ -150,7 +172,6 @@ void rt_data_queue_reset(struct rt_data_queue* queue);
#ifdef RT_USING_I2C_BITOPS
#include "drivers/i2c-bit-ops.h"
#endif /* RT_USING_I2C_BITOPS */
#endif /* RT_USING_I2C */
#ifdef RT_USING_SDIO