Here is the list of APIs used for BiSSC encoder communication protocol
Functions | |
int32_t | bissc_command_process (struct bissc_priv *priv) |
Send the BiSSC command and wait till firmware acknowledges. More... | |
void | bissc_command_send (struct bissc_priv *priv) |
Trigger sending the BiSSC command in PRU. More... | |
int32_t | bissc_command_wait (struct bissc_priv *priv) |
Wait till PRU finishes BiSSC transaction. More... | |
int32_t | bissc_get_pos (struct bissc_priv *priv) |
Get single cycle BiSS-C position data. More... | |
void | bissc_config_clock (struct bissc_priv *priv, struct bissc_clk_cfg *clk_cfg) |
Configure EnDat clock. More... | |
void | bissc_config_channel (struct bissc_priv *priv, int32_t mask, int32_t totalch) |
Select channel to be used by BiSSC master. More... | |
void | bissc_config_load_share (struct bissc_priv *priv, int32_t mask) |
Configure the channels to be used by BiSSC master. More... | |
void | bissc_enable_load_share_mode (struct bissc_priv *priv) |
Enable load share mode for BiSSC master. More... | |
void | bissc_config_primary_core_mask (struct bissc_priv *priv, uint8_t mask) |
Configure the primary core for load share mode. More... | |
int32_t | bissc_wait_for_fw_initialization (struct bissc_priv *priv, uint32_t timeout, uint8_t mask) |
Wait for BiSSC master firmware to initialize. More... | |
void | bissc_hw_init (struct bissc_priv *priv) |
Initialize BiSSC hardware interface. More... | |
struct bissc_priv * | bissc_init (PRUICSS_Handle gPruIcssXHandle, int32_t slice, uint32_t frequency, uint32_t core_clk_freq, uint32_t uart_clk_freq) |
Initialize BiSSC firmware interface address and get the pointer to struct bissc_priv instance. More... | |
void | bissc_update_max_proc_delay (struct bissc_priv *priv) |
Update max processing time and bit index to poll in fifo data. More... | |
int32_t | bissc_wait_measure_proc_delay (struct bissc_priv *priv, uint32_t timeout) |
Wait for BiSSC master firmware to measure processing time. More... | |
void | bissc_set_default_initialization (struct bissc_priv *priv, uint64_t icssgclk) |
Set default configuration parameters for BiSSC Master firmware. More... | |
void | bissc_update_data_len (struct bissc_priv *priv, uint32_t single_turn_len[], uint32_t multi_turn_len[], int32_t num_pru) |
Update data length with encoder bit width for BiSSC Master firmware. More... | |
int32_t | bissc_set_ctrl_cmd_and_process (struct bissc_priv *priv, uint32_t ctrl_cmd[]) |
Set control command and process the ctrl communication read/write. More... | |
void | bissc_config_endat_mode (struct bissc_priv *priv) |
Configure the master for EnDat mode. More... | |
void | bissc_config_clr_cfg0 (struct bissc_priv *priv) |
Clear the channel specific frame size cfg registers. More... | |
void | bissc_get_enc_proc_delay (struct bissc_priv *priv) |
Get measured processing delay of individual channel. More... | |
int32_t | bissc_calc_clock (struct bissc_priv *priv, struct bissc_clk_cfg *clk_cfg) |
Calculate Rx and Tx divisors for given frequency. More... | |
int32_t bissc_command_process | ( | struct bissc_priv * | priv | ) |
Send the BiSSC command and wait till firmware acknowledges.
[in] | priv | cookie returned by bissc_init |
SystemP_SUCCESS | for success, SystemP_FAILURE for failure |
void bissc_command_send | ( | struct bissc_priv * | priv | ) |
Trigger sending the BiSSC command in PRU.
[in] | priv | cookie returned by bissc_init |
int32_t bissc_command_wait | ( | struct bissc_priv * | priv | ) |
Wait till PRU finishes BiSSC transaction.
[in] | priv | cookie returned by bissc_init |
int32_t bissc_get_pos | ( | struct bissc_priv * | priv | ) |
Get single cycle BiSS-C position data.
[in] | priv | cookie returned by bissc_init |
void bissc_config_clock | ( | struct bissc_priv * | priv, |
struct bissc_clk_cfg * | clk_cfg | ||
) |
Configure EnDat clock.
[in] | priv | cookie returned by bissc_init |
[in] | clk_cfg | pointer to structure containing clock configuration data |
void bissc_config_channel | ( | struct bissc_priv * | priv, |
int32_t | mask, | ||
int32_t | totalch | ||
) |
Select channel to be used by BiSSC master.
[in] | priv | cookie returned by bissc_init |
[in] | mask | channel mask |
[in] | totalch | total number of channels in use |
void bissc_config_load_share | ( | struct bissc_priv * | priv, |
int32_t | mask | ||
) |
Configure the channels to be used by BiSSC master.
[in] | priv | cookie returned by bissc_init |
[in] | mask | channel mask |
void bissc_enable_load_share_mode | ( | struct bissc_priv * | priv | ) |
Enable load share mode for BiSSC master.
[in] | priv | cookie returned by bissc_init |
void bissc_config_primary_core_mask | ( | struct bissc_priv * | priv, |
uint8_t | mask | ||
) |
Configure the primary core for load share mode.
[in] | priv | cookie returned by bissc_init |
[in] | mask | channel mask |
int32_t bissc_wait_for_fw_initialization | ( | struct bissc_priv * | priv, |
uint32_t | timeout, | ||
uint8_t | mask | ||
) |
Wait for BiSSC master firmware to initialize.
[in] | priv | cookie returned by bissc_init |
[in] | timeout | timeout to wait for initialization |
[in] | mask | channel mask |
SystemP_SUCCESS | for success, SystemP_FAILURE for failure |
void bissc_hw_init | ( | struct bissc_priv * | priv | ) |
Initialize BiSSC hardware interface.
[in] | priv | cookie returned by bissc_init |
struct bissc_priv* bissc_init | ( | PRUICSS_Handle | gPruIcssXHandle, |
int32_t | slice, | ||
uint32_t | frequency, | ||
uint32_t | core_clk_freq, | ||
uint32_t | uart_clk_freq | ||
) |
Initialize BiSSC firmware interface address and get the pointer to struct bissc_priv instance.
[in] | gPruIcssXHandle | BiSSC firmware interface address |
[in] | slice | ICSS PRU SLICE |
[in] | frequency | Input frequency |
[in] | core_clk_freq | Core clock frequency |
[in] | uart_clk_freq | Uart clock frequency |
priv | pointer to struct bissc_priv instance |
void bissc_update_max_proc_delay | ( | struct bissc_priv * | priv | ) |
Update max processing time and bit index to poll in fifo data.
[in] | priv | cookie returned by bissc_init |
int32_t bissc_wait_measure_proc_delay | ( | struct bissc_priv * | priv, |
uint32_t | timeout | ||
) |
Wait for BiSSC master firmware to measure processing time.
[in] | priv | cookie returned by bissc_init |
[in] | timeout | timeout to wait for initialization |
SystemP_SUCCESS | for success, SystemP_FAILURE for failure |
void bissc_set_default_initialization | ( | struct bissc_priv * | priv, |
uint64_t | icssgclk | ||
) |
Set default configuration parameters for BiSSC Master firmware.
[in] | priv | cookie returned by bissc_init |
[in] | icssgclk | ICSSG core clock for firmware reference |
void bissc_update_data_len | ( | struct bissc_priv * | priv, |
uint32_t | single_turn_len[], | ||
uint32_t | multi_turn_len[], | ||
int32_t | num_pru | ||
) |
Update data length with encoder bit width for BiSSC Master firmware.
[in] | priv | cookie returned by bissc_init |
[in] | single_turn_len | Encoder's single turn resolution |
[in] | multi_turn_len | Encoder's multi turn resolution |
[in] | num_pru | number(index) of PRU in use |
int32_t bissc_set_ctrl_cmd_and_process | ( | struct bissc_priv * | priv, |
uint32_t | ctrl_cmd[] | ||
) |
Set control command and process the ctrl communication read/write.
[in] | priv | cookie returned by bissc_init |
[in] | ctrl_cmd | Hex equivalent of control command |
SystemP_SUCCESS | for success, SystemP_FAILURE for failure |
void bissc_config_endat_mode | ( | struct bissc_priv * | priv | ) |
Configure the master for EnDat mode.
[in] | priv | cookie returned by bissc_init |
void bissc_config_clr_cfg0 | ( | struct bissc_priv * | priv | ) |
Clear the channel specific frame size cfg registers.
[in] | priv | cookie returned by bissc_init |
void bissc_get_enc_proc_delay | ( | struct bissc_priv * | priv | ) |
Get measured processing delay of individual channel.
[in] | priv | cookie returned by bissc_init |
int32_t bissc_calc_clock | ( | struct bissc_priv * | priv, |
struct bissc_clk_cfg * | clk_cfg | ||
) |
Calculate Rx and Tx divisors for given frequency.
[in] | priv | cookie returned by bissc_init |
[in] | clk_cfg | pointer to structure containing clock configuration data. |