![]() |
RX Flexible Software Package Documentation
Release v1.0.0
|
|
Interface for PCIF functions.
Phase Counting Interface(PCIF) interface provides APIs and definitions for motor communication.
Data Structures | |
| struct | pcif_callback_args_t |
| struct | pcif_phc_counter_info_t |
| struct | pcif_status_t |
| struct | pcif_cfg_t |
| struct | pcif_api_t |
| struct | pcif_instance_t |
Typedefs | |
| typedef void | pcif_ctrl_t |
Enumerations | |
| enum | pcif_error_t |
| enum | pcif_state_t |
| enum | pcif_mode_t |
| enum | pcif_clock_source_t |
| enum | pcif_clock_div_t |
| enum | pcif_phase_polarity_t |
| enum | pcif_stop_mode_t |
| enum | pcif_rotation_direction_t |
| struct pcif_callback_args_t |
Callback parameter data
| Data Fields | ||
|---|---|---|
| void const * | p_context |
Placeholder for user data. Set in pcif_api_t::open function in pcif_cfg_t. |
| pcif_error_t | error | |
| struct pcif_phc_counter_info_t |
| struct pcif_status_t |
Current PCIF status.
| Data Fields | ||
|---|---|---|
| pcif_state_t | state | Current PCIF state (stopped or running) |
| pcif_rotation_direction_t | rotation_direction | Rotation direction (clockwise or counter-clockwise) |
| uint16_t | current_position_value | Current output counter value (PHCPOSCNTM or INCOCNTM) |
| uint16_t | position_write_value | Latest PHCPCWDR write value (0 in incremental mode) |
| uint8_t | input_counter_value | Incremental input counter value (INCICNTM, 0 in phase-counting mode) |
| struct pcif_cfg_t |
User configuration structure, used in open function
Data Fields | |
| pcif_mode_t | mode |
| Select enumerated value from pcif_mode_t. | |
| uint8_t | channel |
| pcif_clock_source_t | clock_src |
| Source clock selection. | |
| pcif_clock_div_t | clock_div |
| Source clock divider. | |
| pcif_phase_polarity_t | a_phase_polarity |
| A phase polarity output. More... | |
| pcif_phase_polarity_t | b_phase_polarity |
| B phase polarity output. | |
| pcif_phase_polarity_t | z_phase_polarity |
| Z phase polarity output. | |
| uint16_t | max_count_position |
| Maximum position value. | |
| timer_instance_t const * | p_lower_lvl_timer |
| Pointer to the timer instance structs. | |
| void(* | p_callback )(pcif_callback_args_t *p_args) |
| void * | p_context |
| void const * | p_extend |
| Extension parameter for hardware specific settings. | |
| uint8_t pcif_cfg_t::channel |
Select a channel corresponding to the channel number of the hardware.
| pcif_phase_polarity_t pcif_cfg_t::a_phase_polarity |
A phase polarity output.
Common setting
| void(* pcif_cfg_t::p_callback) (pcif_callback_args_t *p_args) |
Callback provided when an PCIF carrier period occurs. Set to NULL if not use.
| void* pcif_cfg_t::p_context |
Placeholder for user data. Passed to the user callback in pcif_callback_args_t.
| struct pcif_api_t |
PCIF_API functions implemented at the HAL layer will follow this API.
Data Fields | |
| fsp_err_t(* | open )(pcif_ctrl_t *const p_ctrl, pcif_cfg_t const *const p_cfg) |
| fsp_err_t(* | start )(pcif_ctrl_t *const p_ctrl) |
| fsp_err_t(* | stop )(pcif_ctrl_t *const p_ctrl, pcif_stop_mode_t stop_mode) |
| fsp_err_t(* | setCounter )(pcif_ctrl_t *const p_ctrl, pcif_phc_counter_info_t const *const p_counter_info, bool pos_reset) |
| fsp_err_t(* | statusGet )(pcif_ctrl_t *const p_ctrl, pcif_status_t *const p_status) |
| fsp_err_t(* | softwareEventGenerate )(pcif_ctrl_t *const p_ctrl) |
| fsp_err_t(* | close )(pcif_ctrl_t *const p_ctrl) |
| fsp_err_t(* pcif_api_t::open) (pcif_ctrl_t *const p_ctrl, pcif_cfg_t const *const p_cfg) |
Initial configuration.
| [in] | p_ctrl | Pointer to control structure. Must be declared by user. Elements set here. |
| [in] | p_cfg | Pointer to pin configuration structure. All elements of this structure must be set by user. |
| fsp_err_t(* pcif_api_t::start) (pcif_ctrl_t *const p_ctrl) |
Start the output waveform.
| [in] | p_ctrl | Control block set in pcif_api_t::open call for this module. |
| fsp_err_t(* pcif_api_t::stop) (pcif_ctrl_t *const p_ctrl, pcif_stop_mode_t stop_mode) |
Stop the output waveform.
| [in] | p_ctrl | Control block set in pcif_api_t::open call for this module. |
| [in] | stop_mode | Stop mode |
| fsp_err_t(* pcif_api_t::setCounter) (pcif_ctrl_t *const p_ctrl, pcif_phc_counter_info_t const *const p_counter_info, bool pos_reset) |
Set the counter and the initial value.
| [in] | p_ctrl | Control block set in pcif_api_t::open call for this module. |
| [in] | p_counter_info | Pointer to counter info structure. All elements of this structure must be set by user. |
| [in] | pos_reset | Reset counter position. |
| fsp_err_t(* pcif_api_t::statusGet) (pcif_ctrl_t *const p_ctrl, pcif_status_t *const p_status) |
Stores current status in p_status.
| [in] | p_ctrl | Control block set in pcif_api_t::open call for this module. |
| [out] | p_status | Current status for this module. |
| fsp_err_t(* pcif_api_t::softwareEventGenerate) (pcif_ctrl_t *const p_ctrl) |
Generates a software event to trigger the PCIF.
| [in] | p_ctrl | Control block set in pcif_api_t::open call for this module. |
| fsp_err_t(* pcif_api_t::close) (pcif_ctrl_t *const p_ctrl) |
Closes the driver and allows reconfiguration. May reduce power consumption.
| [in] | p_ctrl | Control block set in pcif_api_t::open call for this module. |
| struct pcif_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| pcif_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| pcif_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| pcif_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void pcif_ctrl_t |
PCIF_API control block. Allocate an instance specific control block to pass into the PCIF_API API calls.
| enum pcif_error_t |
| enum pcif_state_t |
| enum pcif_mode_t |
| enum pcif_clock_source_t |
| enum pcif_clock_div_t |
Division clock ratio for source clock
| enum pcif_stop_mode_t |