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 receiver. More... | |
void | bissc_config_load_share (struct bissc_priv *priv, int32_t mask) |
Configure the channels to be used by BiSSC receiver. More... | |
void | bissc_enable_load_share_mode (struct bissc_priv *priv) |
Enable load share mode for BiSSC receiver. 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 receiver 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 receiver firmware to measure processing time. More... | |
void | bissc_set_default_initialization (struct bissc_priv *priv, uint64_t icssgclk) |
Set default configuration parameters for BiSSC receiver firmware. More... | |
void | bissc_update_data_len (struct bissc_priv *priv, uint32_t single_turn_len[], uint32_t multi_turn_len[], int32_t ch_num) |
Update data length with encoder bit width for BiSSC receiver 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 receiver 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... | |
void | bissc_config_periodic_trigger (struct bissc_priv *priv) |
Configure periodic trigger operation mode. More... | |
void | bissc_config_host_trigger (struct bissc_priv *priv) |
Configure host trigger operation mode. More... | |
uint32_t | bissc_generate_ctrl_cmd (struct bissc_priv *priv, int8_t ls_ch, uint32_t ctrl_write_status, uint32_t ctrl_reg_address, uint32_t ctrl_reg_data, uint32_t ctrl_enc_id) |
Generate control communication Hex equivalent command. More... | |
uint32_t | bissc_get_current_channel (struct bissc_priv *priv, uint32_t ch_idx) |
Retrives the current channel in use. More... | |
uint32_t | bissc_get_totalchannels (struct bissc_priv *priv) |
Retrives total number of channels configured. More... | |
void | bissc_clear_data_len (struct bissc_priv *priv) |
Clears all the encoder resolution parameters. More... | |
void | bissc_update_clock_freq (struct bissc_priv *priv, uint32_t frequency) |
Update the operating bud rate as specified by the user. More... | |
void | bissc_enable_safety (struct bissc_priv *priv, uint32_t enc_num, uint32_t ch_num) |
Enable Safety for connected BiSS-C encoder. More... | |
void | bissc_disable_safety (struct bissc_priv *priv) |
Disable Safety for connected BiSS-C encoder. 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 receiver.
[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 receiver.
[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 receiver.
[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 receiver 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 receiver 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 receiver 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 | ch_num | ||
) |
Update data length with encoder bit width for BiSSC receiver 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] | ch_num | 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 receiver 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. |
void bissc_config_periodic_trigger | ( | struct bissc_priv * | priv | ) |
Configure periodic trigger operation mode.
[in] | priv | cookie returned by bissc_init |
void bissc_config_host_trigger | ( | struct bissc_priv * | priv | ) |
Configure host trigger operation mode.
[in] | priv | cookie returned by bissc_init |
uint32_t bissc_generate_ctrl_cmd | ( | struct bissc_priv * | priv, |
int8_t | ls_ch, | ||
uint32_t | ctrl_write_status, | ||
uint32_t | ctrl_reg_address, | ||
uint32_t | ctrl_reg_data, | ||
uint32_t | ctrl_enc_id | ||
) |
Generate control communication Hex equivalent command.
[in] | priv | cookie returned by bissc_init |
[in] | ls_ch | channel in use for load share |
[in] | ctrl_write_status | status for control commmunication write access |
[in] | ctrl_reg_address | address of encoder's register for control commuincation access |
[in] | ctrl_reg_data | data to write in encoder's register in control communication |
[in] | ctrl_enc_id | ID of encoder based on it's place in daisy chain |
ctrl_cmd | Hex equivalent control communication 32 bit command |
uint32_t bissc_get_current_channel | ( | struct bissc_priv * | priv, |
uint32_t | ch_idx | ||
) |
Retrives the current channel in use.
[in] | priv | cookie returned by bissc_init |
[in] | ch_idx | index of current channel to be selected |
channel[ch_idx] | current channel in use |
uint32_t bissc_get_totalchannels | ( | struct bissc_priv * | priv | ) |
Retrives total number of channels configured.
[in] | priv | cookie returned by bissc_init |
totalchannels | total number of channels configured |
void bissc_clear_data_len | ( | struct bissc_priv * | priv | ) |
Clears all the encoder resolution parameters.
[in] | priv | cookie returned by bissc_init |
void bissc_update_clock_freq | ( | struct bissc_priv * | priv, |
uint32_t | frequency | ||
) |
Update the operating bud rate as specified by the user.
[in] | priv | cookie returned by bissc_init |
[in] | frequency | frequency specified by the user through UART menu |
void bissc_enable_safety | ( | struct bissc_priv * | priv, |
uint32_t | enc_num, | ||
uint32_t | ch_num | ||
) |
Enable Safety for connected BiSS-C encoder.
[in] | priv | cookie returned by bissc_init |
[in] | enc_num | number(index) of encoder in use |
[in] | ch_num | number(index) of PRU in use |
void bissc_disable_safety | ( | struct bissc_priv * | priv | ) |
Disable Safety for connected BiSS-C encoder.
[in] | priv | cookie returned by bissc_init |