]> begriffs open source - cmsis/blob - CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c
updating version and version history for General and Pack
[cmsis] / CMSIS / Driver / DriverTemplates / Driver_ETH_PHY.c
1 /*
2  * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the License); you may
7  * not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18  
19 #include "Driver_ETH_PHY.h"
20
21 #define ARM_ETH_PHY_DRV_VERSION    ARM_DRIVER_VERSION_MAJOR_MINOR(2, 0) /* driver version */
22
23 /* Driver Version */
24 static const ARM_DRIVER_VERSION DriverVersion = {
25     ARM_ETH_PHY_API_VERSION,
26     ARM_ETH_PHY_DRV_VERSION
27 };
28
29 //
30 // Functions
31 //
32
33 ARM_DRIVER_VERSION ARM_ETH_PHY_GetVersion(void)
34 {
35 }
36
37 int32_t ARM_ETH_PHY_Initialize(ARM_ETH_PHY_Read_t fn_read, ARM_ETH_PHY_Write_t fn_write)
38 {
39 }
40
41 int32_t ARM_ETH_PHY_Uninitialize(void)
42 {
43 }
44
45 int32_t ARM_ETH_PHY_PowerControl(ARM_POWER_STATE state)
46 {
47     switch (state)
48     {
49     case ARM_POWER_OFF:
50         break;
51
52     case ARM_POWER_LOW:
53         break;
54
55     case ARM_POWER_FULL:
56         break;
57
58     default:
59         return ARM_DRIVER_ERROR_UNSUPPORTED;
60     }
61 }
62
63 int32_t ARM_ETH_PHY_SetInterface(uint32_t interface)
64 {
65     switch (interface)
66     {
67     case ARM_ETH_INTERFACE_MII:
68         break;
69     case ARM_ETH_INTERFACE_RMII:
70         break;
71     default:
72         return ARM_DRIVER_ERROR_UNSUPPORTED;
73     }
74 }
75
76 int32_t ARM_ETH_PHY_SetMode(uint32_t mode)
77 {
78     switch (mode & ARM_ETH_PHY_SPEED_Msk)
79     {
80     case ARM_ETH_PHY_SPEED_10M:
81         break;
82     case ARM_ETH_PHY_SPEED_100M:
83         break;
84     default:
85         return ARM_DRIVER_ERROR_UNSUPPORTED;
86     }
87
88     switch (mode & ARM_ETH_PHY_DUPLEX_Msk)
89     {
90     case ARM_ETH_PHY_DUPLEX_HALF:
91         break;
92     case ARM_ETH_PHY_DUPLEX_FULL:
93         break;
94     }
95
96     if (mode & ARM_ETH_PHY_AUTO_NEGOTIATE)
97     {
98     }
99
100     if (mode & ARM_ETH_PHY_LOOPBACK)
101     {
102     }
103
104     if (mode & ARM_ETH_PHY_ISOLATE)
105     {
106     }
107 }
108
109 ARM_ETH_LINK_STATE ARM_ETH_PHY_GetLinkState(void)
110 {
111 }
112
113 ARM_ETH_LINK_INFO ARM_ETH_PHY_GetLinkInfo(void)
114 {
115 }
116
117 ARM_DRIVER_ETH_PHY ARM_Driver_ETH_PHY_(ETH_PHY_NUM) =
118 {
119     ARM_ETH_PHY_GetVersion,
120     ARM_ETH_PHY_Initialize,
121     ARM_ETH_PHY_Uninitialize,
122     ARM_ETH_PHY_PowerControl,
123     ARM_ETH_PHY_SetInterface,
124     ARM_ETH_PHY_SetMode,
125     ARM_ETH_PHY_GetLinkState,
126     ARM_ETH_PHY_GetLinkInfo,
127 };