180 if (reset_from_ecat_core) {
347 if (latch0_from_ntm) {
362 if (latch0_from_trigmux) {
369 #if defined(HPM_IP_FEATURE_ESC_SYNC_IRQ_MASK) && HPM_IP_FEATURE_ESC_SYNC_IRQ_MASK
379 static inline void esc_enable_sync_irq_to_pdi_irq(
ESC_Type *ptr,
bool sync0_irq,
bool sync1_irq)
381 ptr->
GPR_CFG0 = (ptr->
GPR_CFG0 & ~(ESC_GPR_CFG0_SYNC0_PDI_IRQEN_MASK | ESC_GPR_CFG0_SYNC1_PDI_IRQEN_MASK))
382 | (ESC_GPR_CFG0_SYNC0_PDI_IRQEN_SET(sync0_irq))
383 | (ESC_GPR_CFG0_SYNC1_PDI_IRQEN_SET(sync1_irq));
387 #if defined(HPM_IP_FEATURE_ESC_PORT_DIS) && HPM_IP_FEATURE_ESC_PORT_DIS
398 static inline void esc_change_port_description(
ESC_Type *ptr,
bool port0,
bool port1,
bool port2)
400 ptr->
GPR_CFG0 = (ptr->
GPR_CFG0 & ~(ESC_GPR_CFG0_PORT0_DIS_MASK | ESC_GPR_CFG0_PORT1_DIS_MASK | ESC_GPR_CFG0_PORT2_DIS_MASK))
401 | (ESC_GPR_CFG0_PORT0_DIS_SET(port0))
402 | (ESC_GPR_CFG0_PORT1_DIS_SET(port1))
403 | (ESC_GPR_CFG0_PORT2_DIS_SET(port2));
uint32_t hpm_stat_t
Definition: hpm_common.h:126
#define MAKE_STATUS(group, code)
Definition: hpm_common.h:135
@ status_group_esc
Definition: hpm_common.h:166
static void esc_core_enable_clock(ESC_Type *ptr, bool enable)
ESC peripheral clock.
Definition: hpm_esc_drv.h:75
static uint64_t esc_read_eeprom_data(ESC_Type *ptr)
ESC read eeprom data from register, this function is using in eeprom emulation function.
Definition: hpm_esc_drv.h:323
static void esc_enable_pdi_access_mii_management(ESC_Type *ptr)
ESC enable PDI to access MII management.
Definition: hpm_esc_drv.h:216
hpm_stat_t esc_mdio_write(ESC_Type *ptr, uint8_t phy_addr, uint8_t reg_addr, uint16_t data)
ESc write PHY register via ESC MII Management Interface.
Definition: hpm_esc_drv.c:66
esc_eeprom_cmd_t
Definition: hpm_esc_drv.h:37
esc_ctrl_signal_function_t
Definition: hpm_esc_drv.h:44
static uint32_t esc_get_eeprom_word_address(ESC_Type *ptr)
ESC get eeprom word(2 bytes) address.
Definition: hpm_esc_drv.h:312
static void esc_config_latch0_source(ESC_Type *ptr, bool latch0_from_ntm)
ESC config latch0 signal source.
Definition: hpm_esc_drv.h:345
static uint32_t esc_get_eeprom_byte_address(ESC_Type *ptr)
ESC get eeprom byte address.
Definition: hpm_esc_drv.h:301
static void esc_config_latch1_source(ESC_Type *ptr, bool latch0_from_trigmux)
ESC config latch1 signal source.
Definition: hpm_esc_drv.h:360
static void esc_pdi_reset(ESC_Type *ptr)
ESC generate reset signal to ESC_RESET interrupt and RESET_OUT pin.
Definition: hpm_esc_drv.h:193
static uint8_t esc_get_eeprom_cmd(ESC_Type *ptr)
ESC get eeprom cmd, this using in eeprom emulation function.
Definition: hpm_esc_drv.h:269
hpm_stat_t esc_check_eeprom_loading(ESC_Type *ptr)
ESC check eeprom loading data status.
Definition: hpm_esc_drv.c:114
static void esc_phy_enable_clock(ESC_Type *ptr, bool enable)
ESC PHY clock.
Definition: hpm_esc_drv.h:90
static void esc_write_eeprom_data(ESC_Type *ptr, uint64_t data)
ESC write eeprom data to register, this function is using in eeprom emulation function.
Definition: hpm_esc_drv.h:334
hpm_stat_t esc_mdio_read(ESC_Type *ptr, uint8_t phy_addr, uint8_t reg_addr, uint16_t *data)
ESC read PHY register via ESC MII Management Interface.
Definition: hpm_esc_drv.c:14
static void esc_config_reset_source(ESC_Type *ptr, bool reset_from_ecat_core)
ESC config reset signal source.
Definition: hpm_esc_drv.h:178
static void esc_disable_pdi_access_mii_management(ESC_Type *ptr)
ESC disable PDI to access MII management.
Definition: hpm_esc_drv.h:226
static void esc_config_eeprom_and_clock(ESC_Type *ptr, esc_eeprom_clock_config_t *config)
ESC config eeprom attributes(emulation and size) and peripheral clock.
Definition: hpm_esc_drv.h:105
esc_latch_source_t
Definition: hpm_esc_drv.h:32
static void esc_config_ctrl_signal_function(ESC_Type *ptr, uint8_t index, esc_ctrl_signal_function_t func, bool invert)
ESC assign specific function to CTRL signal.
Definition: hpm_esc_drv.h:134
static void esc_eeprom_emulation_ack(ESC_Type *ptr, esc_eeprom_cmd_t cmd, bool ack_err, bool crc_err)
ESC ack eeprom cmd in eeprom emualtion function.
Definition: hpm_esc_drv.h:282
static void esc_config_nmii_link_source(ESC_Type *ptr, bool link0_from_io, bool link1_from_io, bool link2_from_io)
ESC config nmii_link signal source.
Definition: hpm_esc_drv.h:147
static void esc_set_phy_offset(ESC_Type *ptr, uint8_t offset)
ESC set phy offset.
Definition: hpm_esc_drv.h:206
@ status_esc_eeprom_ack_error
Definition: hpm_esc_drv.h:27
@ status_esc_eeprom_checksum_error
Definition: hpm_esc_drv.h:28
@ esc_eeprom_write_cmd
Definition: hpm_esc_drv.h:40
@ esc_eeprom_read_cmd
Definition: hpm_esc_drv.h:39
@ esc_eeprom_idle_cmd
Definition: hpm_esc_drv.h:38
@ esc_eeprom_reload_cmd
Definition: hpm_esc_drv.h:41
@ esc_ctrl_signal_func_alt_led_err
Definition: hpm_esc_drv.h:52
@ esc_ctrl_signal_func_alt_reset_out
Definition: hpm_esc_drv.h:53
@ esc_ctrl_signal_func_alt_link_act1
Definition: hpm_esc_drv.h:49
@ esc_ctrl_signal_func_alt_link_act0
Definition: hpm_esc_drv.h:48
@ esc_ctrl_signal_func_alt_nmii_link2
Definition: hpm_esc_drv.h:47
@ esc_ctrl_signal_func_alt_led_run
Definition: hpm_esc_drv.h:51
@ esc_ctrl_signal_func_alt_link_act2
Definition: hpm_esc_drv.h:50
@ esc_ctrl_signal_func_alt_nmii_link0
Definition: hpm_esc_drv.h:45
@ esc_ctrl_signal_func_alt_nmii_link1
Definition: hpm_esc_drv.h:46
@ latch_source_from_ntm
Definition: hpm_esc_drv.h:33
@ latch_source_from_trigger_mux
Definition: hpm_esc_drv.h:34
#define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK
Definition: hpm_esc_regs.h:4034
#define ESC_EEPROM_CTRL_STAT_CMD_SET(x)
Definition: hpm_esc_regs.h:1807
#define ESC_GPR_CFG2_NMII_LINK2_GPR_MASK
Definition: hpm_esc_regs.h:4025
#define ESC_GPR_CFG0_CLK100_EN_MASK
Definition: hpm_esc_regs.h:3891
#define ESC_IO_CFG_INVERT_SET(x)
Definition: hpm_esc_regs.h:4459
#define ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK
Definition: hpm_esc_regs.h:4081
#define ESC_GPR_CFG0_EEPROM_EMU_MASK
Definition: hpm_esc_regs.h:3901
#define ESC_GPR_CFG2_NMII_LINK1_GPR_MASK
Definition: hpm_esc_regs.h:4043
#define ESC_GPR_CFG1_LATCH1_FROM_IO_MASK
Definition: hpm_esc_regs.h:3978
#define ESC_GPR_CFG1_LATCH0_FROM_IO_MASK
Definition: hpm_esc_regs.h:3988
#define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK
Definition: hpm_esc_regs.h:4016
#define ESC_GPR_CFG2_NMII_LINK0_GPR_MASK
Definition: hpm_esc_regs.h:4061
#define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK
Definition: hpm_esc_regs.h:4052
#define ESC_PHY_CFG1_REFCK_25M_OE_MASK
Definition: hpm_esc_regs.h:4164
#define ESC_EEPROM_CTRL_STAT_CMD_GET(x)
Definition: hpm_esc_regs.h:1808
#define ESC_MIIM_PDI_ACC_STAT_ACC_MASK
Definition: hpm_esc_regs.h:2107
#define ESC_IO_CFG_FUNC_ALT_SET(x)
Definition: hpm_esc_regs.h:4478
#define ESC_GPR_CFG0_I2C_SCLK_EN_MASK
Definition: hpm_esc_regs.h:3910
#define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK
Definition: hpm_esc_regs.h:1758
#define ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT
Definition: hpm_esc_regs.h:4082
#define ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK
Definition: hpm_esc_regs.h:1785
#define ESC_GPR_CFG0_PROM_SIZE_MASK
Definition: hpm_esc_regs.h:3922
#define ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK
Definition: hpm_esc_regs.h:4006
Definition: hpm_esc_regs.h:12
__RW uint32_t GPR_CFG2
Definition: hpm_esc_regs.h:186
__RW uint32_t EEPROM_ADDR
Definition: hpm_esc_regs.h:85
__RW uint8_t ESC_RST_PDI
Definition: hpm_esc_regs.h:32
__RW uint32_t PHY_CFG0
Definition: hpm_esc_regs.h:188
__RW uint16_t EEPROM_CTRL_STAT
Definition: hpm_esc_regs.h:84
__RW uint32_t IO_CFG[9]
Definition: hpm_esc_regs.h:202
__RW uint64_t EEPROM_DATA
Definition: hpm_esc_regs.h:86
__RW uint32_t GPR_CFG0
Definition: hpm_esc_regs.h:184
__RW uint32_t GPR_CFG1
Definition: hpm_esc_regs.h:185
__RW uint8_t MIIM_PDI_ACC_STAT
Definition: hpm_esc_regs.h:92
__RW uint32_t PHY_CFG1
Definition: hpm_esc_regs.h:189
Definition: hpm_esc_drv.h:57
bool phy_refclk_en
Definition: hpm_esc_drv.h:61
bool eeprom_size_over_16kbit
Definition: hpm_esc_drv.h:59
bool eeprom_emulation
Definition: hpm_esc_drv.h:58
bool core_clock_en
Definition: hpm_esc_drv.h:60