/* * eth_rx_dma.hpp * * Created on: 6 ���. 2023 �. * Author: sychev */ #ifndef FREE_RTOS_ETHERNET_ETH_RX_DMA_HPP_ #define FREE_RTOS_ETHERNET_ETH_RX_DMA_HPP_ #include #include #include "free_rtos/handler_store/handler_store.hpp" #include "free_rtos/semaphore/semaphore.hpp" #include "free_rtos/task/task.hpp" #include "free_rtos/ethernet/eth_task_settings.hpp" #include "free_rtos/ethernet/eth_frame.h" #include "free_rtos/ethernet_ip/eth_stack_iface.hpp" namespace free_rtos { class EthRxFlow { public: EthRxFlow(TEthFrameMacAddr& mac_addr, EthStackIface& eth_stack); bool open(uint32_t id, int32_t enetDmaRxChId); bool is_open() {return open_;} void set_passive() { passive_mode_ = true; } private: friend void rxIsrHandler(void *appData); /// ���������� ���������� �� ������ friend void rxTaskHandler(void *appData); ///������ ��������� �������� ������� void rxProcessPktTask(); ///������� ��������� �������� ������� private: enum SignalsId { e_signalRxPkt, /// ����� ������ e_signalTotal }; uint32_t id_; /// ������������� ������ bool open_; /// ���� ����, ��� dma ����� ��� ������ Semaphore sem_[e_signalTotal]; /// �������� ������� Task rx_task; /// ������ ������ TEthFrameMacAddr& mac_addr_; /// mac ����� uint32_t rx_pkt_counter_; EthStackIface& eth_stack_; ///------------------------------------ uint32_t rx_start_flow_idx_; uint32_t rx_flow_idx_; EnetDma_RxChHandle dma_handle_; bool passive_mode_; /// ��������� �����, ������ �����������, �� �� ���������� � ���� ��������� }; } #endif /* FREE_RTOS_ETHERNET_ETH_RX_DMA_HPP_ */