Unit tests for GMAC driver.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "board.h"
#include <sysclk.h>
#include <string.h>
#include <unit_test/suite.h>
#include <stdio_serial.h>
#include "conf_test.h"
#include "conf_board.h"
#include "mini_ip.h"
#include "conf_eth.h"
Macros | |
#define | GMAC_UINT_TEST_MAX_RETRY_TIME 50 |
Functions | |
void | GMAC_Handler (void) |
GMAC interrupt handler. More... | |
int | main (void) |
Run GMAC driver unit tests. More... | |
static void | run_gmac_link_test (const struct test_case *test) |
GMAC link test function. More... | |
static void | run_gmac_read_write_test (const struct test_case *test) |
Test GMAC read/write interfaces. More... | |
Variables | |
static uint8_t | gs_arp_frame [] |
static gmac_device_t | gs_gmac_dev |
The GMAC driver instance. More... | |
static uint8_t | gs_uc_eth_buffer [GMAC_FRAME_LENTGH_MAX] |
Buffer for ethernet packets. More... | |
static uint8_t | gs_uc_mac_address [] |
The MAC address used for the test. More... | |
#define GMAC_UINT_TEST_MAX_RETRY_TIME 50 |
Referenced by run_gmac_read_write_test().
void GMAC_Handler | ( | void | ) |
GMAC interrupt handler.
References gmac_handler(), and GMAC_QUE_0.
int main | ( | void | ) |
Run GMAC driver unit tests.
References uart_rs232_options::baudrate, board_init(), CONF_TEST_BAUDRATE, CONF_TEST_CHAR_LENGTH, CONF_TEST_PARITY, CONF_TEST_STOP_BITS, CONF_TEST_USART, CONSOLE_UART_ID, DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, run_gmac_link_test(), run_gmac_read_write_test(), stdio_serial_init(), sysclk_enable_peripheral_clock(), sysclk_init(), and test_suite_run().
|
static |
GMAC link test function.
test | Current test case. |
References BOARD_GMAC_PHY_ADDR, ethernet_phy_auto_negotiate(), ethernet_phy_init(), ethernet_phy_set_link(), gmac_dev_init(), GMAC_OK, gs_uc_mac_address, gmac_device::p_hw, pmc_enable_periph_clk(), sysclk_get_cpu_hz(), test_assert_true, gmac_options::uc_copy_all_frame, gmac_options::uc_mac_addr, and gmac_options::uc_no_boardcast.
Referenced by main().
|
static |
Test GMAC read/write interfaces.
test | Current test case. |
References gmac_dev_read(), gmac_dev_write(), GMAC_OK, GMAC_QUE_0, GMAC_UINT_TEST_MAX_RETRY_TIME, gs_arp_frame, gs_uc_eth_buffer, gs_uc_mac_address, and test_assert_true.
Referenced by main().
|
static |
Referenced by run_gmac_read_write_test().
|
static |
The GMAC driver instance.
|
static |
Buffer for ethernet packets.
Referenced by run_gmac_read_write_test().
|
static |
The MAC address used for the test.
Referenced by run_gmac_link_test(), and run_gmac_read_write_test().