libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
phy.c
Go to the documentation of this file.
1/** @defgroup ethernet_phy_file PHY Generic Drivers
2 *
3 * @ingroup ETH
4 *
5 * @brief <b>Ethernet PHY Generic Drivers</b>
6 *
7 * @version 1.0.0
8 * @author @htmlonly &copy; @endhtmlonly 2013 Frantisek Burian <BuFran@seznam.cz>
9 *
10 * @date 1 September 2013
11 *
12 *
13 * LGPL License Terms @ref lgpl_license
14 */
15
16/*
17 * This file is part of the libopencm3 project.
18 *
19 * Copyright (C) 2013 Frantisek Burian <BuFran@seznam.cz>
20 *
21 * This library is free software: you can redistribute it and/or modify
22 * it under the terms of the GNU Lesser General Public License as published by
23 * the Free Software Foundation, either version 3 of the License, or
24 * (at your option) any later version.
25 *
26 * This library is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU Lesser General Public License for more details.
30 *
31 * You should have received a copy of the GNU Lesser General Public License
32 * along with this library. If not, see <http://www.gnu.org/licenses/>.
33 */
34
37
38/**@{*/
39
40/*---------------------------------------------------------------------------*/
41/** @brief Is the link up ?
42 *
43 * @param[in] phy uint8_t phy ID of the PHY
44 * @returns bool true, if link is up
45 */
46bool phy_link_isup(uint8_t phy)
47{
49}
50
51/*---------------------------------------------------------------------------*/
52/** @brief Reset the PHY
53 *
54 * Reset the PHY chip and wait for done
55 * @param[in] phy uint8_t phy ID of the PHY
56 */
57void phy_reset(uint8_t phy)
58{
61}
62
63/*---------------------------------------------------------------------------*/
64
65/**@}*/
void eth_smi_write(uint8_t phy, uint8_t reg, uint16_t data)
Write 16-bit register to the PHY.
uint16_t eth_smi_read(uint8_t phy, uint8_t reg)
Read the 16-bit register from the PHY.
#define PHY_REG_BCR
Definition: phy.h:44
#define PHY_REG_BSR
Definition: phy.h:45
#define PHY_REG_BCR_RESET
Definition: phy.h:66
#define PHY_REG_BSR_UP
Definition: phy.h:69
bool phy_link_isup(uint8_t phy)
Is the link up ?
Definition: phy.c:46
void phy_reset(uint8_t phy)
Reset the PHY.
Definition: phy.c:57