xref: /FreeRTOS-Plus-TCP-v4.0.0/source/portable/NetworkInterface/ThirdParty/MSP432/NetworkMiddleware.h (revision 1ab6eb88857cf1011bf1f8349b43a1c34c7ced0f)
1 /*
2  * FreeRTOS+TCP <DEVELOPMENT BRANCH>
3  * Copyright (C) 2022 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * SPDX-License-Identifier: MIT
6  *
7  * Driver code:
8  * Copyright (C) Nicholas J. Kinar <n.kinar@usask.ca>, Centre for Hydrology, University of Saskatchewan
9  *
10  * MSP432 Driverlib (C) 2017-2019 Texas Instruments Incorporated <https://www.ti.com/>
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of
13  * this software and associated documentation files (the "Software"), to deal in
14  * the Software without restriction, including without limitation the rights to
15  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
16  * the Software, and to permit persons to whom the Software is furnished to do so,
17  * subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included in all
20  * copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
25  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  *
29  * http://aws.amazon.com/freertos
30  * http://www.FreeRTOS.org
31  */
32 
33 #pragma once
34 #include <stdint.h>
35 #include "FreeRTOS.h"
36 #include "FreeRTOS_IP.h"
37 #include "semphr.h"
38 
39 #define MAX_NAME_LLMNR    32 /* maximum length of the LLMNR name used in this project */
40 
41 struct InternalNetworkMiddlewareData
42 {
43     uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ];
44     uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ];
45     uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ];
46     uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ];
47     BaseType_t resetNetworkTaskRunning;
48     uint32_t resetNetworkTaskEveryXSeconds;
49     char deviceName[ MAX_NAME_LLMNR ];
50 }; /* end */
51 
52 void vPublicSetupFreeRTOSTasks( const struct InternalNetworkMiddlewareData data );
53 void vPublicSetupDeviceName( const char * deviceName );
54 BaseType_t vPublicPreventNetworkReset( const BaseType_t preventReset,
55                                        const uint32_t waitTime );
56 void vConvertOctetsToAddr( uint8_t arr[ ipIP_ADDRESS_LENGTH_BYTES ],
57                            uint8_t b0,
58                            uint8_t b1,
59                            uint8_t b2,
60                            uint8_t b3 );
61