增加工程文件
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,7 +1,6 @@
|
||||
# ##############################
|
||||
# 1. 忽略所有编译目录(不管层级)
|
||||
# ##############################
|
||||
**/IAR/
|
||||
**/IAR_*/
|
||||
**/Debug/
|
||||
**/FlashDebug/
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# 忽略整个目录及其所有子文件和子目录
|
||||
/configs/
|
||||
/IAR/
|
||||
/IAR_Norflash/
|
||||
/SES/
|
||||
/configs/**
|
||||
/IAR/**
|
||||
/IAR_Norflash/**
|
||||
/SES/**
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<iarUserArgVars>
|
||||
<group name="PART" active="true">
|
||||
<variable>
|
||||
<name>PART_ID</name>
|
||||
<value>E3106</value>
|
||||
</variable>
|
||||
</group>
|
||||
</iarUserArgVars>
|
||||
2974
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.ewd
Normal file
2974
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.ewd
Normal file
File diff suppressed because it is too large
Load Diff
2469
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.ewp
Normal file
2469
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.ewp
Normal file
File diff suppressed because it is too large
Load Diff
3151
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.ewt
Normal file
3151
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.ewt
Normal file
File diff suppressed because it is too large
Load Diff
7
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.eww
Normal file
7
boards/e3_176_ref/driver_demo/gpio/IAR/gpio.eww
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\gpio.ewp</path>
|
||||
</project>
|
||||
<batchBuild />
|
||||
</workspace>
|
||||
51
boards/e3_176_ref/driver_demo/gpio/configs/clock_cfg.c
Normal file
51
boards/e3_176_ref/driver_demo/gpio/configs/clock_cfg.c
Normal file
@@ -0,0 +1,51 @@
|
||||
#include <sdrv_ckgen.h>
|
||||
#include <clock_ip.h>
|
||||
#include <part.h>
|
||||
|
||||
#if ((CONFIG_E3210) || (CONFIG_E3110))
|
||||
const sdrv_ckgen_rate_config_t g_ip_config = {
|
||||
.config_num = 7,
|
||||
.config_nodes[0].clk_node = CLK_NODE(g_ckgen_ip_uart_sf_1_to_8),
|
||||
.config_nodes[0].rate = 83000000,
|
||||
.config_nodes[1].clk_node = CLK_NODE(g_ckgen_ip_enet1_tx),
|
||||
.config_nodes[1].rate = 250000000,
|
||||
.config_nodes[2].clk_node = CLK_NODE(g_ckgen_ip_enet1_rmii),
|
||||
.config_nodes[2].rate = 50000000,
|
||||
.config_nodes[3].clk_node = CLK_NODE(g_ckgen_ip_enet1_phy_ref),
|
||||
.config_nodes[3].rate = 125000000,
|
||||
.config_nodes[4].clk_node = CLK_NODE(g_ckgen_ip_enet1_timer_sec),
|
||||
.config_nodes[4].rate = 125000000,
|
||||
.config_nodes[5].clk_node = CLK_NODE(g_ckgen_ip_can),
|
||||
.config_nodes[5].rate = 40000000,
|
||||
.config_nodes[6].clk_node = CLK_NODE(g_ckgen_ip_uart_sf_7_to_12),
|
||||
.config_nodes[6].rate = 83000000,
|
||||
};
|
||||
#else
|
||||
const sdrv_ckgen_rate_config_t g_ip_config = {
|
||||
.config_num = 7,
|
||||
.config_nodes[0].clk_node = CLK_NODE(g_ckgen_ip_uart_sf_1_to_6),
|
||||
.config_nodes[0].rate = 83000000,
|
||||
.config_nodes[1].clk_node = CLK_NODE(g_ckgen_ip_enet1_tx),
|
||||
.config_nodes[1].rate = 250000000,
|
||||
.config_nodes[2].clk_node = CLK_NODE(g_ckgen_ip_enet1_rmii),
|
||||
.config_nodes[2].rate = 50000000,
|
||||
.config_nodes[3].clk_node = CLK_NODE(g_ckgen_ip_enet1_phy_ref),
|
||||
.config_nodes[3].rate = 125000000,
|
||||
.config_nodes[4].clk_node = CLK_NODE(g_ckgen_ip_enet1_timer_sec),
|
||||
.config_nodes[4].rate = 125000000,
|
||||
.config_nodes[5].clk_node = CLK_NODE(g_ckgen_ip_can),
|
||||
.config_nodes[5].rate = 40000000,
|
||||
.config_nodes[6].clk_node = CLK_NODE(g_ckgen_ip_uart_sf_7_to_12),
|
||||
.config_nodes[6].rate = 83000000,
|
||||
};
|
||||
#endif /* end ((defined CONFIG_E3210) || (defined CONFIG_E3110)) */
|
||||
|
||||
|
||||
const sdrv_ckgen_config_t g_clock_config = {
|
||||
.pre_bus_config = &g_pre_bus_config,
|
||||
.pll_config = &g_pll_config,
|
||||
.bus_config = &g_bus_config,
|
||||
.core_config = NULL,
|
||||
.ip_config = &g_ip_config,
|
||||
.gating_config = NULL,
|
||||
};
|
||||
9
boards/e3_176_ref/driver_demo/gpio/configs/clock_cfg.h
Normal file
9
boards/e3_176_ref/driver_demo/gpio/configs/clock_cfg.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef SDRV_CLOCK_CFG_H_
|
||||
#define SDRV_CLOCK_CFG_H_
|
||||
|
||||
#include <sdrv_ckgen.h>
|
||||
#include <clock_ip.h>
|
||||
|
||||
extern sdrv_ckgen_config_t g_clock_config;
|
||||
|
||||
#endif /* SDRV_CLOCK_CFG_H_ */
|
||||
153
boards/e3_176_ref/driver_demo/gpio/configs/config.h
Normal file
153
boards/e3_176_ref/driver_demo/gpio/configs/config.h
Normal file
@@ -0,0 +1,153 @@
|
||||
/**
|
||||
* @file config.h
|
||||
* @brief SSDK configuration header file.
|
||||
*
|
||||
* @copyright Copyright (c) 2022 Semidrive Semiconductor.
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Enable ARM I-Cache and D-Cache operations.
|
||||
*
|
||||
* If CONFIG_ARCH_WITH_CACHE is defined, ARM I-Cache and D-Cache
|
||||
* operations are enabled and you can call functions defiend in cache.h to
|
||||
* manage caches.
|
||||
*/
|
||||
#define CONFIG_ARCH_WITH_CACHE 1
|
||||
|
||||
/**
|
||||
* @brief ARM cache line size in bytes.
|
||||
*
|
||||
* Cortex R5 cache line length is 8 words (256 bits).
|
||||
*/
|
||||
#define CONFIG_ARCH_CACHE_LINE 32
|
||||
|
||||
/**
|
||||
* @brief Enable I-Cache on power up.
|
||||
*
|
||||
* If CONFIG_ARCH_EARLY_ENABLE_ICACHE is defined, ARM I-Cache is
|
||||
* enabled on power up.
|
||||
*/
|
||||
#define CONFIG_ARCH_EARLY_ENABLE_ICACHE 1
|
||||
|
||||
/**
|
||||
* @brief Enable D-Cache on power up.
|
||||
*
|
||||
* If CONFIG_ARCH_EARLY_ENABLE_DCACHE is defined, ARM D-Cache is enabled on
|
||||
* power up.
|
||||
*/
|
||||
#define CONFIG_ARCH_EARLY_ENABLE_DCACHE 1
|
||||
|
||||
/**
|
||||
* @brief Enable ARM FPU.
|
||||
*
|
||||
* If CONFIG_ARCH_WITH_FPU is defined, ARM floating processing unit (FPU) is
|
||||
* enabled.
|
||||
*/
|
||||
#define CONFIG_ARCH_WITH_FPU 1
|
||||
|
||||
/**
|
||||
* @brief SemiDrive E3 product macro.
|
||||
*/
|
||||
#define CONFIG_ARCH_CHIP_E3 1
|
||||
|
||||
/**
|
||||
* @brief Enable ARM TCM.
|
||||
*
|
||||
* If CONFIG_ARCH_WITH_TCM is defined, ARM tightly coupled memory
|
||||
* (TCM) driver is enabed.
|
||||
*/
|
||||
#define CONFIG_ARM_WITH_TCM 1
|
||||
|
||||
/**
|
||||
* @brief Enable ARM CP 15 operations.
|
||||
*
|
||||
* If CONFIG_ARCH_WITH_CP15 is defined, ARM CP15 coprocessor
|
||||
* instructions are used.
|
||||
*/
|
||||
#define CONFIG_ARM_WITH_CP15 1
|
||||
|
||||
/**
|
||||
* @brief Enable ARM PMU operations.
|
||||
*
|
||||
* If CONFIG_ARCH_WITH_PMU is defined, ARM performance monitor
|
||||
* unit (PMU) functions can be used to manage PMU.
|
||||
*/
|
||||
#define CONFIG_ARM_WITH_PMU 1
|
||||
|
||||
/**
|
||||
* @brief Enable Cortex R5 TCM A area.
|
||||
*/
|
||||
#define CONFIG_ARMV7R_USE_TCMA 1
|
||||
|
||||
/**
|
||||
* @brief Cortex R5 TCM A base address.
|
||||
*
|
||||
* TCM A base address is configured on power up, by setting CP15. Note that
|
||||
* this address could be different from TCMx_BASE address defined in
|
||||
* regs_base.h, which is the bus address used by other AXI masters to access
|
||||
* TCMA from outside the Cortex R5 core.
|
||||
*/
|
||||
#define CONFIG_ARMV7R_TCMA_BASE 0x10000
|
||||
|
||||
/**
|
||||
* @brief Enable Cortex R5 TCM B area.
|
||||
*/
|
||||
#define CONFIG_ARMV7R_USE_TCMB 1
|
||||
|
||||
/**
|
||||
* @brief Cortex R5 TCM B base address.
|
||||
*
|
||||
* TCM B base address is configured on power up, by setting CP15. Note that
|
||||
* this address could be different from TCMx_BASE address defined in
|
||||
* regs_base.h, which is the bus address used by other AXI masters to access
|
||||
* TCMB from outside the Cortex R5 core.
|
||||
*/
|
||||
#define CONFIG_ARMV7R_TCMB_BASE 0x0
|
||||
|
||||
/**
|
||||
* @brief Enable VIC driver
|
||||
*/
|
||||
#define CONFIG_IRQ 1
|
||||
|
||||
/**
|
||||
* @brief Enable vectored IRQ mode.
|
||||
*
|
||||
* In vectored IRQ mode if IRQ signal received, R5 acknowledge to
|
||||
* VIC through dedicated hardware channel and get interrupt address
|
||||
* from VIC directly.
|
||||
*
|
||||
* If not configured, interupt address is always 0x18, and interrupt routing
|
||||
* will read VICADDRESS register to acknowledge to VIC and get interrupt
|
||||
* nubmer, and branch to user ISR.
|
||||
*/
|
||||
#define CONFIG_VIC_IRQ_INTERRUPT_MODE 1
|
||||
|
||||
/**
|
||||
* @brief Enable Ethernet controller driver, and LWIP stacks.
|
||||
*/
|
||||
#define CONFIG_ETH 1
|
||||
|
||||
/**
|
||||
* @brief Enable debug logs and asserts.
|
||||
*
|
||||
* Define CONFIG_DEBUG if you want ssdk_printf() logs, as well as PANIC()
|
||||
* and ASSERT() dumps.
|
||||
*/
|
||||
#define CONFIG_DEBUG 1
|
||||
|
||||
/**
|
||||
* @brief SSDK Log level.
|
||||
*
|
||||
* ssdk_printf() logs with "level" no greater than CONFIG_DEBUG_LEVEL are
|
||||
* shown, while other logs are ignored. See log levels defined in debug.h.
|
||||
*/
|
||||
#define CONFIG_DEBUG_LEVEL SSDK_DEBUG
|
||||
|
||||
/**
|
||||
* @brief Enable printf function.
|
||||
*
|
||||
* The middleware/printf library provides simple printf function.
|
||||
* CONFIG_PRINTF_LIB is valid only when CONFIG_DEBUG is defined.
|
||||
*/
|
||||
#define CONFIG_PRINTF_LIB 1
|
||||
82
boards/e3_176_ref/driver_demo/gpio/configs/eth_cfg.c
Normal file
82
boards/e3_176_ref/driver_demo/gpio/configs/eth_cfg.c
Normal file
@@ -0,0 +1,82 @@
|
||||
#if CONFIG_ETH
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "reg.h"
|
||||
#include "regs_base.h"
|
||||
#include "irq_num.h"
|
||||
#include "scr_hw.h"
|
||||
#include "sdrv_scr.h"
|
||||
#include "scr_cfg.h"
|
||||
#include "eth_cfg.h"
|
||||
#include "sdrv_pinctrl.h"
|
||||
#include "sdrv_gpio.h"
|
||||
#include "sdrv_eth.h"
|
||||
#include <lwip/init.h>
|
||||
#include <part.h>
|
||||
#include <wdt_refresh.h>
|
||||
|
||||
#define PHY_INTF_SEL 0x2080
|
||||
|
||||
struct net_driver_s g_eth1_dev;
|
||||
|
||||
static void set_phyif_mode(uint32_t base, eth_phy_intf_mode_type mode)
|
||||
{
|
||||
uint32_t v;
|
||||
|
||||
/* Config MII interface. */
|
||||
if (mode == ETH_PHY_INTF_SEL_MII)
|
||||
v = 0;
|
||||
else if (mode == ETH_PHY_INTF_SEL_RMII) {
|
||||
if (base == APB_ENET1_BASE) {
|
||||
const scr_signal_t rmii_oe = SCR_SF_SCR_ENET1_CLK_RMII_OE;
|
||||
scr_set(&g_scr_ctrl, &rmii_oe, 1);
|
||||
}
|
||||
#if ((CONFIG_E3210) || (CONFIG_E3110))
|
||||
else {
|
||||
const scr_signal_t rmii_oe = SCR_SF_SCR_ENET2_CLK_RMII_OE;
|
||||
scr_set(&g_scr_ctrl, &rmii_oe, 1);
|
||||
}
|
||||
#endif
|
||||
v = 4;
|
||||
}
|
||||
else
|
||||
v = 1;
|
||||
|
||||
writel(v, base + PHY_INTF_SEL);
|
||||
}
|
||||
|
||||
static phy_dev_t g_phy_arr1[] = {
|
||||
{
|
||||
.phy_addr = 0,
|
||||
.duplex_mode = ETH_PHY_DUPLEX_MODE_FULL,
|
||||
.speed = PHY_SPEED_100,
|
||||
.auto_negotiation = true
|
||||
},
|
||||
|
||||
/* Invalid phy dev to indicate end of array. */
|
||||
{
|
||||
.phy_addr = ~0,
|
||||
}
|
||||
};
|
||||
|
||||
static dwc_eth_config_t g_eth1_cfg = {
|
||||
.base = APB_ENET1_BASE,
|
||||
.irq_num = ENET1_SBD_INTR_NUM,
|
||||
.mtu = 1500,
|
||||
.dma_bus_width = 64,
|
||||
.phy_intf_mode = ETH_PHY_INTF_SEL_RMII,
|
||||
.set_phy_intf = set_phyif_mode,
|
||||
.ip = {192,168,17,20},
|
||||
.mask = {255, 255, 255, 0},
|
||||
|
||||
.phy = g_phy_arr1
|
||||
};
|
||||
|
||||
void board_eth_init(void)
|
||||
{
|
||||
dwc_eth_probe(&g_eth1_dev, &g_eth1_cfg);
|
||||
External_wdt_refresh();
|
||||
lwip_init();
|
||||
}
|
||||
|
||||
#endif
|
||||
12
boards/e3_176_ref/driver_demo/gpio/configs/eth_cfg.h
Normal file
12
boards/e3_176_ref/driver_demo/gpio/configs/eth_cfg.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _ETH_CFG_H_
|
||||
#define _ETH_CFG_H_
|
||||
|
||||
#if CONFIG_ETH
|
||||
|
||||
extern struct net_driver_s g_eth1_dev;
|
||||
|
||||
void board_eth_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
174
boards/e3_176_ref/driver_demo/gpio/configs/flexcan_cfg.c
Normal file
174
boards/e3_176_ref/driver_demo/gpio/configs/flexcan_cfg.c
Normal file
@@ -0,0 +1,174 @@
|
||||
#include <flexcan_cfg.h>
|
||||
#include <sdrv_flexcan.h>
|
||||
#include "IAP_Task.h"
|
||||
|
||||
const flexcan_config_t g_flexcan_config = {
|
||||
.clkSrc = FLEXCAN_ClkSrcPeri, /* 40MHz */
|
||||
.maxMbNum = 64U,
|
||||
.enableSelfWakeup = true,
|
||||
.enableIndividMask = true,
|
||||
.enableCANFD = false,
|
||||
BAUDRATE_1M_5M,
|
||||
.enableLBUFTransmittedFirst = true
|
||||
};
|
||||
|
||||
static flexcan_rx_fifo_filter_table_t flexcan_tableID[RX_FIFO_ID_FILTER_NUM] = {
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x01, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x03, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x103, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x104, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x105, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x106, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x107, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x108, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x109, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x10A, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x10B, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{ /* LSB can be 0 or 1 */
|
||||
MAKE_TYPE_A_FILTER(0x10C, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FE, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x3e7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{ /* LSB can be 0 or 1 */
|
||||
MAKE_TYPE_A_FILTER(0x3f7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFE, EXTENDED_DATA_ID)
|
||||
},
|
||||
/* remaining elements can only be affected by RXFGMASK. */
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x507, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x517, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x527, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x537, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x547, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x557, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x567, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x577, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FF, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x587, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FE, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x597, STANDARD_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x7FE, STANDARD_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x5a7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x5b7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x5c7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x5d7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x5e7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x5f7, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x607, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
},
|
||||
{
|
||||
MAKE_TYPE_A_FILTER(0x617, EXTENDED_DATA_ID),
|
||||
MAKE_TYPE_A_FILTER(0x1FFFFFFF, EXTENDED_DATA_ID)
|
||||
}
|
||||
};
|
||||
|
||||
flexcan_rx_fifo_config_t flexcan_fifo_cfg = {
|
||||
.priority = FLEXCAN_RxFifoPrioHigh,
|
||||
.idFilterType = FLEXCAN_RxFifoFilterTypeA,
|
||||
.idFilterNum = RX_FIFO_ID_FILTER_NUM,
|
||||
.filter_tab = &flexcan_tableID[0]
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
53
boards/e3_176_ref/driver_demo/gpio/configs/flexcan_cfg.h
Normal file
53
boards/e3_176_ref/driver_demo/gpio/configs/flexcan_cfg.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef SDRV_FLEXCAN_CFG_H_
|
||||
#define SDRV_FLEXCAN_CFG_H_
|
||||
|
||||
#include <sdrv_flexcan.h>
|
||||
|
||||
/* for 40MHz. */
|
||||
#define BAUDRATE_1M_5M \
|
||||
.nominalBitTiming = \
|
||||
{/* 1Mbps, sample point 80% */ \
|
||||
.preDivider = 1U, \
|
||||
.rJumpwidth = 5U, \
|
||||
.propSeg = 10U, \
|
||||
.phaseSeg1 = 21U, \
|
||||
.phaseSeg2 = 8U}, \
|
||||
.dataBitTiming = \
|
||||
{/* 5Mbps, sample point 75% */ \
|
||||
.preDivider = \
|
||||
1U, /* Should be the same as nominalBitTiming.preDivider. */ \
|
||||
.rJumpwidth = 1U, \
|
||||
.propSeg = 2U, \
|
||||
.phaseSeg1 = 3U, \
|
||||
.phaseSeg2 = 2U}
|
||||
|
||||
/* for 40MHz. */
|
||||
#define BAUDRATE_500K_1M \
|
||||
.nominalBitTiming = \
|
||||
{/* 500kbps, sample point 75% */ \
|
||||
.preDivider = 4U, \
|
||||
.rJumpwidth = 2U, \
|
||||
.propSeg = 6U, \
|
||||
.phaseSeg1 = 8U, \
|
||||
.phaseSeg2 = 5U}, \
|
||||
.dataBitTiming = \
|
||||
{/* 1Mbps, sample point 80% */ \
|
||||
.preDivider = \
|
||||
4U, /* Should be the same as nominalBitTiming.preDivider. */ \
|
||||
.rJumpwidth = 2U, \
|
||||
.propSeg = 3U, \
|
||||
.phaseSeg1 = 4U, \
|
||||
.phaseSeg2 = 2U}
|
||||
|
||||
#define RX_FIFO_ID_FILTER_NUM 32
|
||||
#define USED_MB_FOR_FIFO 14
|
||||
#define TX_MAILBOX_NUM 7
|
||||
|
||||
extern const flexcan_config_t g_flexcan_config;
|
||||
extern flexcan_rx_fifo_config_t flexcan_fifo_cfg;
|
||||
|
||||
void flexcan_transfer_callback(flexcan_handle_t *handle,
|
||||
flexcan_status_e status, uint32_t result,
|
||||
void *userData);
|
||||
|
||||
#endif /* SDRV_FLEXCAN_CFG_H_ */
|
||||
677
boards/e3_176_ref/driver_demo/gpio/configs/pinmux_cfg.c
Normal file
677
boards/e3_176_ref/driver_demo/gpio/configs/pinmux_cfg.c
Normal file
@@ -0,0 +1,677 @@
|
||||
#include "pinmux_cfg.h"
|
||||
#include "pinmux_cfg.h"
|
||||
#include "IAP_Task.h"
|
||||
|
||||
const pin_settings_config_t g_pin_init_config[NUM_OF_CONFIGURED_PINS] = {
|
||||
/* Pin 23, GPIO_Y6, Mux:UART12.TXD */
|
||||
{
|
||||
.pin_index = GPIO_A8,
|
||||
.mux = PIN_MUX_ALT4,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 24, GPIO_Y7, Mux:UART12.RXD */
|
||||
{
|
||||
.pin_index = GPIO_A9,
|
||||
.mux = PIN_MUX_ALT4,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 23, GPIO_E0, Mux:UART2.TXD */
|
||||
{
|
||||
.pin_index = GPIO_E0,//
|
||||
.mux = PIN_MUX_ALT5,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 24, GPIO_E1, Mux:UART2.RXD */
|
||||
{
|
||||
.pin_index = GPIO_E1,//
|
||||
.mux = PIN_MUX_ALT5,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 25, GPIO_E2, Mux:UART2.EN */
|
||||
{
|
||||
.pin_index = GPIO_E2,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_HIGH,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 33, GPIO_L4, Mux:CANFD3.RX */
|
||||
{
|
||||
.pin_index = GPIO_L4,
|
||||
.mux = PIN_MUX_ALT3,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_SLOW,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 34, GPIO_L5, Mux:CANFD3.TX */
|
||||
{
|
||||
.pin_index = GPIO_L5,
|
||||
.mux = PIN_MUX_ALT3,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_SLOW,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 38, GPIO_H12, Mux:GPIO_SAFETY.IO38 */
|
||||
{
|
||||
.pin_index = GPIO_H12,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_HIGH,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 38, GPIO_F5, Mux:GPIO_SAFETY.IO39 */
|
||||
{
|
||||
.pin_index = GPIO_F5,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_12MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 38, GPIO_H13, Mux:GPIO_SAFETY.IO39 */
|
||||
{
|
||||
.pin_index = GPIO_H13,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_12MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 38, GPIO_B9, Mux:GPIO_SAFETY.IO38 */
|
||||
{
|
||||
.pin_index = GPIO_B9,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
#if EN_24C02
|
||||
/* Pin 23, GPIO_Y2, Mux:I2C.SCL */
|
||||
{
|
||||
.pin_index = GPIO_Y2,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 24, GPIO_Y3, Mux:I2C.SDA */
|
||||
{
|
||||
.pin_index = GPIO_Y3,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_OPEN_DRAIN,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 24, GPIO_Y1, Mux:I2C.WP */
|
||||
{
|
||||
.pin_index = GPIO_Y1,
|
||||
.mux = PIN_MUX_ALT0,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
#else
|
||||
/* PortPinid: 0 - SPI6_SS0 */
|
||||
{
|
||||
.pin_index = GPIO_Y2,
|
||||
.mux = PIN_MUX_ALT3,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
/* PortPinid: 1 - SPI6_SCLK */
|
||||
{
|
||||
.pin_index = GPIO_Y3,
|
||||
.mux = PIN_MUX_ALT3,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* PortPinid: 2 - SPI6_MISO */
|
||||
{
|
||||
.pin_index = GPIO_Y4,
|
||||
.mux = PIN_MUX_ALT3,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* PortPinid: 3 - SPI6_MOSI */
|
||||
{
|
||||
.pin_index = GPIO_Y5,
|
||||
.mux = PIN_MUX_ALT3,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_HIGH,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
#endif
|
||||
|
||||
/* Pin 95, GPIO_H6, Mux:CANFD6.RX */
|
||||
{
|
||||
.pin_index = GPIO_H6,
|
||||
.mux = PIN_MUX_ALT2,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_SLOW,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 96, GPIO_H7, Mux:CANFD6.TX */
|
||||
{
|
||||
.pin_index = GPIO_H7,
|
||||
.mux = PIN_MUX_ALT2,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_SLOW,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 5, GPIO_X0, Mux:XSPI1.PA_DQS */
|
||||
{
|
||||
.pin_index = GPIO_X0,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 6, GPIO_X1, Mux:XSPI1.PA_SCLK */
|
||||
{
|
||||
.pin_index = GPIO_X1,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 7, GPIO_X2, Mux:XSPI1.PA_SS0 */
|
||||
{
|
||||
.pin_index = GPIO_X2,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 8, GPIO_X3, Mux:XSPI1.PA_DATA0 */
|
||||
{
|
||||
.pin_index = GPIO_X3,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 9, GPIO_X4, Mux:XSPI1.PA_DATA1 */
|
||||
{
|
||||
.pin_index = GPIO_X4,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 10, GPIO_X5, Mux:XSPI1.PA_DATA2 */
|
||||
{
|
||||
.pin_index = GPIO_X5,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 11, GPIO_X6, Mux:XSPI1.PA_DATA3 */
|
||||
{
|
||||
.pin_index = GPIO_X6,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 12, GPIO_X7, Mux:XSPI1.PA_DATA4 */
|
||||
{
|
||||
.pin_index = GPIO_X7,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 13, GPIO_X8, Mux:XSPI1.PA_DATA5 */
|
||||
{
|
||||
.pin_index = GPIO_X8,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 14, GPIO_X9, Mux:XSPI1.PA_DATA6 */
|
||||
{
|
||||
.pin_index = GPIO_X9,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 15, GPIO_X10, Mux:XSPI1.PA_DATA7 */
|
||||
{
|
||||
.pin_index = GPIO_X10,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_NOPULL,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
/* Pin 16, GPIO_X11, Mux:XSPI1.PA_SS1 */
|
||||
{
|
||||
.pin_index = GPIO_X11,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_UP,
|
||||
.drive_strength = PIN_DS_2MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 78, GPIO_G1, Mux:ETHERNET1.TXD0 */
|
||||
{
|
||||
.pin_index = GPIO_G1,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 79, GPIO_G2, Mux:ETHERNET1.TXD1 */
|
||||
{
|
||||
.pin_index = GPIO_G2,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 80, GPIO_G3, Mux:ETHERNET1.MDIO */
|
||||
{
|
||||
.pin_index = GPIO_G3,
|
||||
.mux = PIN_MUX_ALT2,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 81, GPIO_G4, Mux:ETHERNET1.MDC */
|
||||
{
|
||||
.pin_index = GPIO_G4,
|
||||
.mux = PIN_MUX_ALT2,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 82, GPIO_G5, Mux:ETHERNET1.TXEN */
|
||||
{
|
||||
.pin_index = GPIO_G5,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 84, GPIO_G7, Mux:ETHERNET1.RXD0 */
|
||||
{
|
||||
.pin_index = GPIO_G7,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 85, GPIO_G8, Mux:ETHERNET1.RXD1 */
|
||||
{
|
||||
.pin_index = GPIO_G8,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 86, GPIO_G9, Mux:ETHERNET1.RMII_REF_CLK */
|
||||
{
|
||||
.pin_index = GPIO_G9,
|
||||
.mux = PIN_MUX_ALT2,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_ENABLE,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 87, GPIO_G10, Mux:ETHERNET1.RX_ER */
|
||||
{
|
||||
.pin_index = GPIO_G10,
|
||||
.mux = PIN_MUX_ALT2,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
|
||||
/* Pin 88, GPIO_G11, Mux:ETHERNET1.RXDV */
|
||||
{
|
||||
.pin_index = GPIO_G11,
|
||||
.mux = PIN_MUX_ALT1,
|
||||
.open_drain = PIN_PUSH_PULL,
|
||||
.pull_config = PIN_PULL_DOWN,
|
||||
.drive_strength = PIN_DS_8MA,
|
||||
.slew_rate = PIN_SR_FAST,
|
||||
.input_select = PIN_IS_CMOS_SCHMITT,
|
||||
.data_direction = PIN_OUTPUT_DIRECTION,
|
||||
.interrupt_config = PIN_INTERRUPT_DISABLED,
|
||||
.initial_value = PIN_LEVEL_LOW,
|
||||
.force_input = PIN_FORCE_INPUT_NORMAL,
|
||||
.mode_select = PIN_MODE_DIGITAL,
|
||||
},
|
||||
};
|
||||
11
boards/e3_176_ref/driver_demo/gpio/configs/pinmux_cfg.h
Normal file
11
boards/e3_176_ref/driver_demo/gpio/configs/pinmux_cfg.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef SDRV_PINMUX_CFG_H_
|
||||
#define SDRV_PINMUX_CFG_H_
|
||||
|
||||
#include <sdrv_pinctrl.h>
|
||||
|
||||
#define NUM_OF_CONFIGURED_PINS 39
|
||||
|
||||
extern const pin_settings_config_t g_pin_init_config[NUM_OF_CONFIGURED_PINS];
|
||||
|
||||
|
||||
#endif /* SDRV_PINMUX_CFG_H_ */
|
||||
12
boards/e3_176_ref/driver_demo/gpio/configs/reset_cfg.c
Normal file
12
boards/e3_176_ref/driver_demo/gpio/configs/reset_cfg.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <reset_ip.h>
|
||||
#include "reset_cfg.h"
|
||||
|
||||
sdrv_rstgen_sig_t *board_reset_array[NUM_OF_RSTGEN_SIGS] = {
|
||||
&rstsig_canfd3,
|
||||
&rstsig_vic1,
|
||||
&rstsig_xspi1a,
|
||||
&rstsig_xspi1b,
|
||||
&rstsig_canfd6,
|
||||
&rstsig_enet1,
|
||||
|
||||
};
|
||||
11
boards/e3_176_ref/driver_demo/gpio/configs/reset_cfg.h
Normal file
11
boards/e3_176_ref/driver_demo/gpio/configs/reset_cfg.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef SDRV_RESET_CFG_H_
|
||||
#define SDRV_RESET_CFG_H_
|
||||
|
||||
#include <sdrv_rstgen.h>
|
||||
#include <reset_ip.h>
|
||||
|
||||
#define NUM_OF_RSTGEN_SIGS 6
|
||||
|
||||
extern sdrv_rstgen_sig_t *board_reset_array[NUM_OF_RSTGEN_SIGS];
|
||||
|
||||
#endif /* SDRV_RESET_CFG_H_ */
|
||||
7
boards/e3_176_ref/driver_demo/gpio/configs/scr_cfg.c
Normal file
7
boards/e3_176_ref/driver_demo/gpio/configs/scr_cfg.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <regs_base.h>
|
||||
#include <scr_cfg.h>
|
||||
|
||||
/*scr structures*/
|
||||
sdrv_scr_t g_scr_ctrl = {
|
||||
.base = APB_SCR_SF_BASE,
|
||||
};
|
||||
4
boards/e3_176_ref/driver_demo/gpio/configs/scr_cfg.h
Normal file
4
boards/e3_176_ref/driver_demo/gpio/configs/scr_cfg.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#include <sdrv_scr.h>
|
||||
|
||||
/*exported scr*/
|
||||
extern sdrv_scr_t g_scr_ctrl;
|
||||
Reference in New Issue
Block a user