]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32F103_GCC_Rowley/Drivers/STM32_USART.h
Roll up the minor changes checked into svn since V10.0.0 into new V10.0.1 ready for...
[freertos] / FreeRTOS / Demo / CORTEX_STM32F103_GCC_Rowley / Drivers / STM32_USART.h
1 /*\r
2  * FreeRTOS Kernel V10.0.1\r
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\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
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software.\r
14  *\r
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21  *\r
22  * http://www.FreeRTOS.org\r
23  * http://aws.amazon.com/freertos\r
24  *\r
25  * 1 tab == 4 spaces!\r
26  */\r
27 \r
28 #ifndef STM_32_SERIAL_COMMS_H\r
29 #define STM_32_SERIAL_COMMS_H\r
30 \r
31 /*\r
32  * Initialise a COM port.  As supplied 2 COM ports are supported, so ulPort can\r
33  * be either 0 or 1.  Note that COM 0 is in effect USART1 in ST library \r
34  * terminology.  The baud rate can be any standard baud rate and has been tested\r
35  * up to 115200 baud.\r
36  */\r
37 long lCOMPortInit( unsigned long ulPort, unsigned long ulWantedBaud );\r
38 \r
39 /*\r
40  * Output a single char to a COM port.  As supplied 2 COM ports are supported,\r
41  * so ulPort can be 0 or 1.  Note that COM 0 is in effect USART1 in ST library\r
42  * terminology.  cOutChar is the character to be transmit, and xBlockTime is\r
43  * the time the task should be held in the Blocked state (in ticks) for space \r
44  * to become available in the queue of characters waiting transmission.  pdPASS \r
45  * will be returned if the character is successfully queued (possible after \r
46  * waiting in the Blocked state for up to xBlockTime ticks), otherwise pdFAIL \r
47  * will be returned.\r
48  */\r
49 signed long xSerialPutChar( long lPort, signed char cOutChar, TickType_t xBlockTime );\r
50 \r
51 /*\r
52  * Retrieve a character from the queue of received characters.  As supplied 2 \r
53  * COM ports are supported, so ulPort can be 0 or 1.  Note that COM 0 is in \r
54  * effect USART1 in ST library terminology.  pcRxedChar is the address into\r
55  * which the received character will be copied, and xBlockTime is the time the \r
56  * task should be held in the Blocked state (in ticks) for a character to be\r
57  * available if one is not available immediately.  pdPASS will be returned if a\r
58  * character is successfully returned (possible after waiting in the Blocked \r
59  * state for up to xBlockTime ticks), otherwise pdFAIL will be returned.\r
60  */\r
61 signed long xSerialGetChar( long lPort, signed char *pcRxedChar, TickType_t xBlockTime );\r
62 \r
63 /*\r
64  * Send a string of characters to a COM port.  As supplied 2 COM ports are \r
65  * supported, so ulPort can be 0 or 1.  Note that COM 0 is in effect USART1 in \r
66  * ST library terminology.  pcString contains the address of the first \r
67  * character to be transmit, and ulStringLength the total number of characters\r
68  * from and including *pcString.  pdPASS will be returned if the entire string\r
69  * is queued for transmission successfully, otherwise pdFAIL will be returned.\r
70  * Note that serPUT_STRING_CHAR_DELAY within STM32_USART.c can be adjusted in\r
71  * accordance with the applications requirements.  Comments are included where\r
72  * serPUT_STRING_CHAR_DELAY is defined.\r
73  */\r
74 long lSerialPutString( long lPort, const char * const pcString, unsigned long ulStringLength );\r
75 \r
76 #endif\r
77 \r
78 \r