no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mdio_bitbang.c File Reference

Source file for MDIO implementation using gpio bit banging. More...

#include <errno.h>
#include <stdlib.h>
#include "no_os_util.h"
#include "no_os_alloc.h"
#include "no_os_gpio.h"
#include "no_os_mdio.h"
#include "mdio_bitbang.h"
Include dependency graph for mdio_bitbang.c:

Classes

struct  mdio_bitbang_extra
 

Functions

int mdio_bitbang_init (struct no_os_mdio_desc **dev, struct no_os_mdio_init_param *ip)
 
int mdio_bitbang_write (struct no_os_mdio_desc *dev, uint32_t reg, uint16_t in)
 
int mdio_bitbang_read (struct no_os_mdio_desc *dev, uint32_t reg, uint16_t *out)
 
int mdio_bitbang_remove (struct no_os_mdio_desc *dev)
 

Variables

struct no_os_mdio_ops mdio_bitbang_ops
 

Detailed Description

Source file for MDIO implementation using gpio bit banging.

Author
Darius Berghe (dariu.nosp@m.s.be.nosp@m.rghe@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2023(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ mdio_bitbang_init()

int mdio_bitbang_init ( struct no_os_mdio_desc ** dev,
struct no_os_mdio_init_param * ip )

◆ mdio_bitbang_read()

int mdio_bitbang_read ( struct no_os_mdio_desc * dev,
uint32_t reg,
uint16_t * out )

◆ mdio_bitbang_remove()

int mdio_bitbang_remove ( struct no_os_mdio_desc * dev)

◆ mdio_bitbang_write()

int mdio_bitbang_write ( struct no_os_mdio_desc * dev,
uint32_t reg,
uint16_t in )

Variable Documentation

◆ mdio_bitbang_ops

struct no_os_mdio_ops mdio_bitbang_ops
Initial value:
= {
}
int mdio_bitbang_read(struct no_os_mdio_desc *dev, uint32_t reg, uint16_t *out)
Definition mdio_bitbang.c:162
int mdio_bitbang_write(struct no_os_mdio_desc *dev, uint32_t reg, uint16_t in)
Definition mdio_bitbang.c:148
int mdio_bitbang_remove(struct no_os_mdio_desc *dev)
Definition mdio_bitbang.c:176
int mdio_bitbang_init(struct no_os_mdio_desc **dev, struct no_os_mdio_init_param *ip)
Definition mdio_bitbang.c:46