2 * FreeRTOS Kernel V10.0.0
\r
3 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 * this software and associated documentation files (the "Software"), to deal in
\r
7 * the Software without restriction, including without limitation the rights to
\r
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 * subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software. If you wish to use our Amazon
\r
14 * FreeRTOS name, please do so in a fair use way that does not cause confusion.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * http://www.FreeRTOS.org
\r
24 * http://aws.amazon.com/freertos
\r
26 * 1 tab == 4 spaces!
\r
29 #ifndef STM_32_SERIAL_COMMS_H
\r
30 #define STM_32_SERIAL_COMMS_H
\r
33 * Initialise a COM port. As supplied 2 COM ports are supported, so ulPort can
\r
34 * be either 0 or 1. Note that COM 0 is in effect USART1 in ST library
\r
35 * terminology. The baud rate can be any standard baud rate and has been tested
\r
36 * up to 115200 baud.
\r
38 long lCOMPortInit( unsigned long ulPort, unsigned long ulWantedBaud );
\r
41 * Output a single char to a COM port. As supplied 2 COM ports are supported,
\r
42 * so ulPort can be 0 or 1. Note that COM 0 is in effect USART1 in ST library
\r
43 * terminology. cOutChar is the character to be transmit, and xBlockTime is
\r
44 * the time the task should be held in the Blocked state (in ticks) for space
\r
45 * to become available in the queue of characters waiting transmission. pdPASS
\r
46 * will be returned if the character is successfully queued (possible after
\r
47 * waiting in the Blocked state for up to xBlockTime ticks), otherwise pdFAIL
\r
50 signed long xSerialPutChar( long lPort, signed char cOutChar, TickType_t xBlockTime );
\r
53 * Retrieve a character from the queue of received characters. As supplied 2
\r
54 * COM ports are supported, so ulPort can be 0 or 1. Note that COM 0 is in
\r
55 * effect USART1 in ST library terminology. pcRxedChar is the address into
\r
56 * which the received character will be copied, and xBlockTime is the time the
\r
57 * task should be held in the Blocked state (in ticks) for a character to be
\r
58 * available if one is not available immediately. pdPASS will be returned if a
\r
59 * character is successfully returned (possible after waiting in the Blocked
\r
60 * state for up to xBlockTime ticks), otherwise pdFAIL will be returned.
\r
62 signed long xSerialGetChar( long lPort, signed char *pcRxedChar, TickType_t xBlockTime );
\r
65 * Send a string of characters to a COM port. As supplied 2 COM ports are
\r
66 * supported, so ulPort can be 0 or 1. Note that COM 0 is in effect USART1 in
\r
67 * ST library terminology. pcString contains the address of the first
\r
68 * character to be transmit, and ulStringLength the total number of characters
\r
69 * from and including *pcString. pdPASS will be returned if the entire string
\r
70 * is queued for transmission successfully, otherwise pdFAIL will be returned.
\r
71 * Note that serPUT_STRING_CHAR_DELAY within STM32_USART.c can be adjusted in
\r
72 * accordance with the applications requirements. Comments are included where
\r
73 * serPUT_STRING_CHAR_DELAY is defined.
\r
75 long lSerialPutString( long lPort, const char * const pcString, unsigned long ulStringLength );
\r