@@ -104,6 +104,23 @@ typedef struct serial_s serial_t;
104
104
105
105
#endif
106
106
107
+ typedef struct {
108
+ int peripheral ;
109
+ PinName tx_pin ;
110
+ int tx_function ;
111
+ PinName rx_pin ;
112
+ int rx_function ;
113
+ bool stdio_config ;
114
+ } serial_pinmap_t ;
115
+
116
+ typedef struct {
117
+ int peripheral ;
118
+ PinName tx_flow_pin ;
119
+ int tx_flow_function ;
120
+ PinName rx_flow_pin ;
121
+ int rx_flow_function ;
122
+ } serial_fc_pinmap_t ;
123
+
107
124
#ifdef __cplusplus
108
125
extern "C" {
109
126
#endif
@@ -203,6 +220,15 @@ extern "C" {
203
220
*/
204
221
void serial_init (serial_t * obj , PinName tx , PinName rx );
205
222
223
+ /** Initialize the serial peripheral. It sets the default parameters for serial
224
+ * peripheral, and configures its specifieds pins.
225
+ *
226
+ * @param obj The serial object
227
+ * @param pinmap pointer to strucure which holds static pinmap
228
+ */
229
+ void serial_init_direct (serial_t * obj , const serial_pinmap_t * pinmap );
230
+
231
+
206
232
/** Release the serial peripheral, not currently invoked. It requires further
207
233
* resource management.
208
234
*
@@ -304,6 +330,15 @@ void serial_pinout_tx(PinName tx);
304
330
* @param txflow The RX pin name
305
331
*/
306
332
void serial_set_flow_control (serial_t * obj , FlowControl type , PinName rxflow , PinName txflow );
333
+
334
+ /** Configure the serial for the flow control. It sets flow control in the hardware
335
+ * if a serial peripheral supports it, otherwise software emulation is used.
336
+ *
337
+ * @param obj The serial object
338
+ * @param type The type of the flow control. Look at the available FlowControl types.
339
+ * @param pinmap Pointer to strucure which holds static pinmap
340
+ */
341
+ void serial_set_flow_control_direct (serial_t * obj , FlowControl type , const serial_fc_pinmap_t * pinmap );
307
342
#endif
308
343
309
344
/** Get the pins that support Serial TX
0 commit comments