From: lottaviano Date: Tue, 23 Mar 2010 09:12:48 +0000 (+0000) Subject: doc: Clarify serial module documentation. X-Git-Tag: 2.5.0~638 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=4fa66632424dc460a346d369252977486708c22e;p=bertos.git doc: Clarify serial module documentation. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3265 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/ser.c b/bertos/drv/ser.c index a684ebba..dac277b0 100644 --- a/bertos/drv/ser.c +++ b/bertos/drv/ser.c @@ -410,6 +410,8 @@ static struct KFile *ser_reopen(struct KFile *fd) /** * Init serial driver for \a unit. + * + * Use values SER_UARTn as values for \a unit. */ void ser_init(struct Serial *fds, unsigned int unit) { @@ -476,6 +478,8 @@ static size_t spimaster_write(struct KFile *fd, const void *buf, size_t size) /** * Init SPI serial driver \a unit in master mode. * + * Use SER_SPIn for \a unit parameter. + * * This interface implements the SPI master protocol over a serial SPI * driver. This is needed because normal serial driver send/receive data * at the same time. SPI slaves like memories and other peripherals diff --git a/bertos/drv/ser.h b/bertos/drv/ser.h index c264811e..fe05b4d5 100644 --- a/bertos/drv/ser.h +++ b/bertos/drv/ser.h @@ -62,10 +62,10 @@ #define SERRF_TXTIMEOUT BV(2) /**< Transmit timeout */ /* Hardware errors */ - #define SERRF_RXSROVERRUN 0 /**< Unsupported in emulated serial port. */ - #define SERRF_FRAMEERROR 0 /**< Unsupported in emulated serial port. */ - #define SERRF_PARITYERROR 0 /**< Unsupported in emulated serial port. */ - #define SERRF_NOISEERROR 0 /**< Unsupported in emulated serial port. */ + #define SERRF_RXSROVERRUN 0 /**< Rx shift register overrun, unsupported in emulated serial port. */ + #define SERRF_FRAMEERROR 0 /**< Stop bit missing, unsupported in emulated serial port. */ + #define SERRF_PARITYERROR 0 /**< Parity error, unsupported in emulated serial port. */ + #define SERRF_NOISEERROR 0 /**< Noise error, unsupported in emulated serial port. */ enum { @@ -93,8 +93,8 @@ | SERRF_RXSROVERRUN \ | SERRF_PARITYERROR \ | SERRF_FRAMEERROR \ - | SERRF_NOISEERROR) -#define SERRF_TX (SERRF_TXTIMEOUT) + | SERRF_NOISEERROR) /**< All possible rx errors */ +#define SERRF_TX (SERRF_TXTIMEOUT) /**< All possible tx errors */ /*\}*/ /** @@ -212,8 +212,8 @@ void spimaster_init(Serial *fds, unsigned int unit); * * \{ */ -#define ser_getstatus(h) ((h)->status) -#define ser_setstatus(h, x) ((h)->status = (x)) +#define ser_getstatus(serial) ((serial)->status) +#define ser_setstatus(serial, new_status) ((serial)->status = (new_status)) /* \} */ #endif /* DRV_SER_H */