/**
* Init serial driver for \a unit.
+ *
+ * Use values SER_UARTn as values for \a unit.
*/
void ser_init(struct Serial *fds, unsigned int unit)
{
/**
* 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
#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
{
| 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 */
/*\}*/
/**
*
* \{
*/
-#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 */