ESC driver APIs. More...
Data Structures | |
| struct | esc_eeprom_clock_config_t |
Enumerations | |
| enum | { status_esc_eeprom_ack_error = ((uint32_t)( status_group_esc )*1000U + (uint32_t)( 0 )) , status_esc_eeprom_checksum_error = ((uint32_t)( status_group_esc )*1000U + (uint32_t)( 1 )) } |
| ESC error codes. More... | |
| enum | esc_latch_source_t { latch_source_from_ntm = 0 , latch_source_from_trigger_mux = 1 } |
| enum | esc_eeprom_cmd_t { esc_eeprom_idle_cmd = 0 , esc_eeprom_read_cmd = 1 , esc_eeprom_write_cmd = 2 , esc_eeprom_reload_cmd = 4 } |
| enum | esc_ctrl_signal_function_t { esc_ctrl_signal_func_alt_nmii_link0 = 0 , esc_ctrl_signal_func_alt_nmii_link1 = 1 , esc_ctrl_signal_func_alt_nmii_link2 = 2 , esc_ctrl_signal_func_alt_link_act0 = 3 , esc_ctrl_signal_func_alt_link_act1 = 4 , esc_ctrl_signal_func_alt_link_act2 = 5 , esc_ctrl_signal_func_alt_led_run = 6 , esc_ctrl_signal_func_alt_led_err = 7 , esc_ctrl_signal_func_alt_reset_out = 8 } |
Functions | |
| static void | esc_core_enable_clock (ESC_Type *ptr, bool enable) |
| ESC peripheral clock. More... | |
| static void | esc_phy_enable_clock (ESC_Type *ptr, bool enable) |
| ESC PHY clock. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| static void | esc_config_reset_source (ESC_Type *ptr, bool reset_from_ecat_core) |
| ESC config reset signal source. More... | |
| static void | esc_pdi_reset (ESC_Type *ptr) |
| ESC generate reset signal to ESC_RESET interrupt and RESET_OUT pin. More... | |
| static void | esc_set_phy_offset (ESC_Type *ptr, uint8_t offset) |
| ESC set phy offset. More... | |
| static void | esc_enable_pdi_access_mii_management (ESC_Type *ptr) |
| ESC enable PDI to access MII management. More... | |
| static void | esc_disable_pdi_access_mii_management (ESC_Type *ptr) |
| ESC disable PDI to access MII management. More... | |
| 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. More... | |
| 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. More... | |
| hpm_stat_t | esc_check_eeprom_loading (ESC_Type *ptr) |
| ESC check eeprom loading data status. More... | |
| static uint8_t | esc_get_eeprom_cmd (ESC_Type *ptr) |
| ESC get eeprom cmd, this using in eeprom emulation function. More... | |
| 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. More... | |
| static uint32_t | esc_get_eeprom_byte_address (ESC_Type *ptr) |
| ESC get eeprom byte address. More... | |
| static uint32_t | esc_get_eeprom_word_address (ESC_Type *ptr) |
| ESC get eeprom word(2 bytes) address. More... | |
| static uint64_t | esc_read_eeprom_data (ESC_Type *ptr) |
| ESC read eeprom data from register, this function is using in eeprom emulation function. More... | |
| 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. More... | |
| static void | esc_config_latch0_source (ESC_Type *ptr, bool latch0_from_ntm) |
| ESC config latch0 signal source. More... | |
| static void | esc_config_latch1_source (ESC_Type *ptr, bool latch0_from_trigmux) |
| ESC config latch1 signal source. More... | |
ESC driver APIs.
| anonymous enum |
#include <drivers/inc/hpm_esc_drv.h>
ESC error codes.
| Enumerator | |
|---|---|
| status_esc_eeprom_ack_error | ESC EEPROM ack error |
| status_esc_eeprom_checksum_error | ESC EEPROM checksum error |
#include <drivers/inc/hpm_esc_drv.h>
| enum esc_eeprom_cmd_t |
#include <drivers/inc/hpm_esc_drv.h>
| Enumerator | |
|---|---|
| esc_eeprom_idle_cmd | |
| esc_eeprom_read_cmd | |
| esc_eeprom_write_cmd | |
| esc_eeprom_reload_cmd | |
| enum esc_latch_source_t |
#include <drivers/inc/hpm_esc_drv.h>
| Enumerator | |
|---|---|
| latch_source_from_ntm | |
| latch_source_from_trigger_mux | |
| hpm_stat_t esc_check_eeprom_loading | ( | ESC_Type * | ptr | ) |
#include <drivers/inc/hpm_esc_drv.h>
ESC check eeprom loading data status.
| [in] | ptr | ESC base address. |
| status_success | loding data successfully and correctlly. |
| status_esc_eeprom_ack_error | loding data checksum error(eeprom blank). |
| status_esc_eeprom_checksum_error | no ack error. |
| status_timeout | loding data timeout. |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC assign specific function to CTRL signal.
| [in] | ptr | ESC base address |
| [in] | index | CTRL signal index(0-8) |
| [in] | func | specific function |
| [in] | invert | invert signal |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC config eeprom attributes(emulation and size) and peripheral clock.
| [in] | ptr | ESC base address |
| [in] | config | esc_eeprom_clock_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC config latch0 signal source.
| [in] | ptr | ESC base address |
| [in] | latch0_from_ntm | true for signal from ntm system, false for signal from IO |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC config latch1 signal source.
| [in] | ptr | ESC base address |
| [in] | latch0_from_trigmux | true for signal from trigmux system, false for signal from IO |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC config nmii_link signal source.
| [in] | ptr | ESC base address |
| [in] | link0_from_io | true for signal from configured IO; false for signal from register(GPR_CFG2) value |
| [in] | link1_from_io | true for signal from configured IO; false for signal from register(GPR_CFG2) value |
| [in] | link2_from_io | true for signal from configured IO; false for signal from register(GPR_CFG2) value |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC config reset signal source.
| [in] | ptr | ESC base address |
| [in] | reset_from_ecat_core | true for reset signal from ecat core; false for reset signal from register(GPR_CFG1) value |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC peripheral clock.
| [in] | ptr | ESC base address |
| [in] | enable | Set true to enable or false to disable |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC disable PDI to access MII management.
| [in] | ptr | ESC base address |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC ack eeprom cmd in eeprom emualtion function.
| [in] | ptr | ESC base address |
| [in] | cmd | esc_eeprom_cmd_t |
| [in] | ack_err | eeprom ack error occurrred |
| [in] | crc_err | eeprom checksum error occurrred |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC enable PDI to access MII management.
| [in] | ptr | ESC base address |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC get eeprom byte address.
| [in] | ptr | ESC base address |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC get eeprom cmd, this using in eeprom emulation function.
| [in] | ptr | ESC base address |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC get eeprom word(2 bytes) address.
| [in] | ptr | ESC base address |
| hpm_stat_t esc_mdio_read | ( | ESC_Type * | ptr, |
| uint8_t | phy_addr, | ||
| uint8_t | reg_addr, | ||
| uint16_t * | data | ||
| ) |
#include <drivers/inc/hpm_esc_drv.h>
ESC read PHY register via ESC MII Management Interface.
| [in] | ptr | ESC base address |
| [in] | phy_addr | PHY address. |
| [in] | reg_addr | Register address. |
| [in] | data | PHY data returned. |
| hpm_stat_t esc_mdio_write | ( | ESC_Type * | ptr, |
| uint8_t | phy_addr, | ||
| uint8_t | reg_addr, | ||
| uint16_t | data | ||
| ) |
#include <drivers/inc/hpm_esc_drv.h>
ESc write PHY register via ESC MII Management Interface.
| [in] | ptr | ESC base address |
| [in] | phy_addr | PHY address. |
| [in] | reg_addr | Register address. |
| [in] | data | Write to PHY register. |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC generate reset signal to ESC_RESET interrupt and RESET_OUT pin.
| [in] | ptr | ESC base address |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC PHY clock.
| [in] | ptr | ESC base address |
| [in] | enable | Set true to enable or false to disable |
< enable PHY 25M refck
< disable PHY 25M refck
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC read eeprom data from register, this function is using in eeprom emulation function.
| [in] | ptr | ESC base address |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC set phy offset.
| [in] | ptr | ESC base address |
| [in] | offset | PHY register offset |
|
inlinestatic |
#include <drivers/inc/hpm_esc_drv.h>
ESC write eeprom data to register, this function is using in eeprom emulation function.
| [in] | ptr | ESC base address |
| [in] | data | eeprom data |