@@ -57,7 +57,16 @@ extern "C" {
5757 * Website: www.fredslab.net <br>
5858 * Twitter: \@marzacdev <br>
5959 */
60-
60+
61+ #define PARITY_NONE 0x00000000 //see comOpen()
62+ #define PARITY_EVEN 0x10000000 //see comOpen()
63+ #define PARITY_ODD 0x20000000 //see comOpen()
64+ #define PARITY_SPACE 0x30000000 //see comOpen()
65+ #define PARITY_MARK 0x40000000 //see comOpen()
66+
67+ #define PARITY_BITMASK 0xF0000000
68+ #define BAUDRATE_BITMASK 0x0FFFFFFF
69+
6170/*****************************************************************************/
6271 /**
6372 * \fn int comEnumerate()
@@ -76,31 +85,31 @@ extern "C" {
7685 /**
7786 * \fn int comTerminate()
7887 * \brief Release ports and memory resources used by the library
79- */
88+ */
8089 void comTerminate ();
8190
8291 /**
8392 * \fn const char * comGetPortName(int index)
8493 * \brief Get port user-friendly name
8594 * \param[in] index port index
8695 * \return null terminated port name
87- */
96+ */
8897 const char * comGetPortName (int index );
8998
9099 /**
91100 * \fn const char * comGetInternalName(int index)
92101 * \brief Get port operating-system name
93102 * \param[in] index port index
94103 * \return null terminated port name
95- */
104+ */
96105 const char * comGetInternalName (int index );
97106
98107 /**
99108 * \fn int comFindPort(const char * name)
100109 * \brief Try to find a port given its user-friendly name
101110 * \param[in] name port name (case sensitive)
102111 * \return index of found port or -1 if not enumerated
103- */
112+ */
104113 int comFindPort (const char * name );
105114
106115/*****************************************************************************/
@@ -109,10 +118,13 @@ extern "C" {
109118 * \brief Try to open a port at a specific baudrate
110119 * \brief (No parity, single stop bit, no hardware flow control)
111120 * \param[in] index port index
112- * \param[in] baudrate port baudrate
121+ * \param[in] baudrate port baudrate plus parity (see PARITY_*).
122+ * i.E. 9600|PARITY_EVEN.
123+ * Optionally also only a baudrate may be specified. In this
124+ * case Parity is PARITY_NONE
113125 * \return 1 if opened, 0 if not available
114- */
115- int comOpen (int index , int baudrate );
126+ */
127+ int comOpen (int index , int baudrate_and_parity );
116128
117129 /**
118130 * \fn void comClose(int index)
0 commit comments