跳转到内容

BasicComponents API

文档稀疏
符号
60
已记录
25
类型
1
继承关系
0
源码分支
main

35 / 60 个公开 API 符号没有说明。

共 1 个类型

类型目录

其他公开符号

函数

30

ethernetif_init

函数
        err_t ethernetif_init (struct netif *netif)
      

Should be called at the beginning of the program to set up the network interface. low_level_init() It calls the functionto do the actual setup of the hardware. This function should be passed as a parameter to netif_add(). netif the lwip network interface structure for this ethernetif ERR_OK if the loopif is initialized ERR_MEM if private data couldn't be allocated any other err_t on error

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:475

ethernetif_input

函数
        void ethernetif_input (void *argument)
      

This function should be called when a packet is ready to be read from the interface. low_level_input() It uses the functionthat should handle the actual reception of bytes from the network interface. Then the type of the received packet is determined and the appropriate input function is called. netif the lwip network interface structure for this ethernetif

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:418

low_level_init

函数静态
        static void low_level_init (struct netif *netif)
      

In this function, the hardware should be initialized. ethernetif_init() Called from. netif the already initialized lwip network interface structure for this ethernetif

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:200

low_level_input

函数静态
        static struct pbuf * low_level_input (struct netif *netif)
      

Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf. netif the lwip network interface structure for this ethernetif a pbuf filled with the received packet (including MAC header) NULL on memory error

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:397

low_level_output

函数静态
        static err_t low_level_output (struct netif *netif, struct pbuf *p)
      

This function should do the actual transmission of the packet. The packet is contained in the pbuf that is passed to the function. This pbuf might be chained. netif the lwip network interface structure for this ethernetif p the MAC packet to send (e.g. IP packet including MAC addresses and type) ERR_OK if the packet could be sent an err_t value if the packet couldn't be sent Returning ERR_MEM here if a DMA queue of your MAC is full can lead to strange results. You might consider waiting for space in the DMA queue to become available since the stack doesn't retry to send a packet dropped because of memory failure (except for the TCP timers).

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:318

low_level_output_arp_off

函数静态
        static err_t low_level_output_arp_off (struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr)
      

This function has to be completed by user in case of ARP OFF. netif the lwip network interface structure for this ethernetif ERR_OK if ...

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:449

lwip_platform_init

函数
        bool lwip_platform_init (struct netif *netif)
      

由 EthLink 线程调用一次:绑定 netif、复位关联 PHY 并启动自动协商。 netif 已建立的 LwIP 接口,非空;仅借用,不拥有。 true 平台就绪并可用于 poll;false(空 netif、未 prepare、重复 init 或 PHY 启动失败) 表示不可继续,调用方须 Error_Handler。重复调用不产生额外 PHY 复位。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.hpp:40

lwip_platform_init

函数
        bool lwip_platform_init (struct netif *netif)
      

由 EthLink 线程调用一次:绑定 netif、复位关联 PHY 并启动自动协商。 netif 已建立的 LwIP 接口,非空;仅借用,不拥有。 true 平台就绪并可用于 poll;false(空 netif、未 prepare、重复 init 或 PHY 启动失败) 表示不可继续,调用方须 Error_Handler。重复调用不产生额外 PHY 复位。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.cpp:51

lwip_platform_poll

函数
        bool lwip_platform_poll (void)
      

由 EthLink 线程周期调用:读取 PHY 链路并按需切换 MAC 与 netif link。 true 本轮状态已处理(含正常断链/协商);false 表示 PHY 读取或 MAC 配置/启停失败, 链路保持在 down,调用方须 Error_Handler。本函数不做内部重试。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.cpp:56

lwip_platform_poll

函数
        bool lwip_platform_poll (void)
      

由 EthLink 线程周期调用:读取 PHY 链路并按需切换 MAC 与 netif link。 true 本轮状态已处理(含正常断链/协商);false 表示 PHY 读取或 MAC 配置/启停失败, 链路保持在 down,调用方须 Error_Handler。本函数不做内部重试。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.hpp:47

lwip_platform_prepare

函数
        bool lwip_platform_prepare (void)
      

在首次 HAL_ETH_Init 之前调用:创建 RX/HAL 互斥体并注册工程选择的 ETH MSP 回调。 true 已就绪(可重复调用,幂等);false 互斥体或 MSP 注册失败,调用方须 Error_Handler, 不得继续 HAL 初始化。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.hpp:32

lwip_platform_prepare

函数
        bool lwip_platform_prepare (void)
      

在首次 HAL_ETH_Init 之前调用:创建 RX/HAL 互斥体并注册工程选择的 ETH MSP 回调。 true 已就绪(可重复调用,幂等);false 互斥体或 MSP 注册失败,调用方须 Error_Handler, 不得继续 HAL 初始化。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.cpp:36

枚举

1

变量

11

宏定义

8

TIME_WAITING_FOR_INPUT

宏定义

ethernetif.c ethernetif.c File Name :Description : This file provides code for the configuration of theMiddleWare. Copyright (c) 2026 STMicroelectronics. All rights reserved. This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

bsp/ethernet/examples/stm32h723vet6/ethernetif.c:44

文件

5

bsp/ethernet/examples/stm32h723vet6/lwip_platform.hpp

文件

ethernetif.c CubeMX使用的工程 C 绑定入口。 具体 PHY、地址、链路配置和 MSP 由工程 .cpp 选择;通用状态机位于 EthernetPHY::LwipPlatform 包,借用 IPhy 与 ETH 句柄。 生命周期:prepare → HAL_ETH_Init → RX pool/信号量/线程建立 → init → 周期 poll。 init/poll 由同一 EthLink 线程串行调用;input 供 RX 线程使用。 prepare/init/poll 返回 false 时调用方走 Error_Handler;init 成功不代表 link up。 ethernetif.c 的接入与接收桥仅在 USER CODE 区;保持 KeepUserCode=true。 .ld 的 ETH 段保留在 MEMORYMAP 自动生成标记之外,地址与 .ioc 堆配置一致。

bsp/ethernet/examples/stm32h723vet6/lwip_platform.hpp