zephyr/drivers/ethernet/phy_sam_gmac.h
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00

69 lines
1.4 KiB
C

/*
* Copyright (c) 2016 Piotr Mienkowski
* SPDX-License-Identifier: Apache-2.0
*/
/** @file
* @brief Atmel SAM MCU family Ethernet PHY (GMAC) driver.
*/
#ifndef ZEPHYR_DRIVERS_ETHERNET_PHY_SAM_GMAC_H_
#define ZEPHYR_DRIVERS_ETHERNET_PHY_SAM_GMAC_H_
#include <zephyr/types.h>
#include <soc.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PHY_DUPLEX_FULL GMAC_NCFGR_FD
#define PHY_DUPLEX_HALF 0
#define PHY_SPEED_100M GMAC_NCFGR_SPD
#define PHY_SPEED_10M 0
struct phy_sam_gmac_dev {
Gmac *regs;
uint8_t address;
};
/**
* @brief Initialize Ethernet PHY device.
*
* @param phy PHY instance
* @return 0 on success or a negative error value on failure
*/
int phy_sam_gmac_init(const struct phy_sam_gmac_dev *phy);
/**
* @brief Auto-negotiate and configure link parameters.
*
* @param phy PHY instance
* @param status link parameters common to remote and local PHY
* @return 0 on success or a negative error value on failure
*/
int phy_sam_gmac_auto_negotiate(const struct phy_sam_gmac_dev *phy,
uint32_t *status);
/**
* @brief Get PHY ID value.
*
* @param phy PHY instance
* @return PHY ID value or 0xFFFFFFFF on failure
*/
uint32_t phy_sam_gmac_id_get(const struct phy_sam_gmac_dev *phy);
/**
* @brief Get PHY link status.
*
* @param phy PHY instance
* @return link status
*/
bool phy_sam_gmac_link_status_get(const struct phy_sam_gmac_dev *phy);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_DRIVERS_ETHERNET_PHY_SAM_GMAC_H_ */