AM263Px Motor Control SDK  2025.00.00
bissc_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023-2026 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef BISSC_API_H_
34 #define BISSC_API_H_
35 
36 /* ========================================================================== */
37 /* Include Files */
38 /* ========================================================================== */
39 
40 #include "bissc_drv.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /* ========================================================================== */
47 /* Function Declarations */
48 /* ========================================================================== */
49 
77 
100 
112 
138 
152 
173 
190 int32_t bissc_get_pos(bissc_handle handle);
191 
206 
221 int32_t bissc_config_channel(bissc_handle handle, uint8_t mask, uint8_t total_channels);
222 
223 
252 int32_t bissc_wait_for_fw_initialization(bissc_handle handle, uint32_t loop_count);
253 
267 int32_t bissc_hw_init(bissc_handle handle);
268 
269 
281 
300 int32_t bissc_wait_measure_proc_delay(bissc_handle handle, uint32_t loop_count);
301 
313 
352 int32_t bissc_update_data_len(bissc_handle handle, uint32_t single_turn_len[], uint32_t multi_turn_len[], uint32_t ch_num);
353 
379 int32_t bissc_set_ctrl_cmd_and_process(bissc_handle handle, uint32_t ctrl_cmd[]);
380 
381 
394 
408 int32_t bissc_calc_clock(bissc_handle handle, bissc_clk_cfg *clk_cfg);
409 
428 
441 
464  uint8_t ls_ch,
465  uint8_t ctrl_write_status,
466  uint32_t ctrl_reg_address,
467  uint32_t ctrl_reg_data,
468  uint32_t ctrl_enc_id);
481 uint32_t bissc_get_current_channel(bissc_handle handle, uint32_t ch_idx);
482 
494 
508 
521 int32_t bissc_update_clock_freq(bissc_handle handle, uint32_t frequency);
522 
546 int32_t bissc_clock_config(bissc_handle handle, uint32_t frequency, uint32_t loop_count);
547 
562 int32_t bissc_enable_safety(bissc_handle handle, uint32_t enc_num, uint32_t ch_num);
563 
576 
589 
602 
618 int32_t bissc_set_encoder_timeout(bissc_handle handle, uint32_t ch_num, uint32_t encoder_timeout);
619 
634 uint32_t bissc_get_encoder_timeout(bissc_handle handle, uint32_t ch_num);
635 
655 
674 int32_t bissc_config_iep_cap_event(bissc_handle handle, uint8_t channel, uint8_t event_num);
675 
693 int32_t bissc_config_iep_cmp_event(bissc_handle handle, uint8_t channel, uint8_t event_num);
694 
697 #ifdef __cplusplus
698 }
699 #endif
700 
701 #endif
bissc_config_iep_cap_event
int32_t bissc_config_iep_cap_event(bissc_handle handle, uint8_t channel, uint8_t event_num)
Configure IEP CAP event for periodic trigger (DMEM configuration only)
bissc_enable_safety
int32_t bissc_enable_safety(bissc_handle handle, uint32_t enc_num, uint32_t ch_num)
Enable Safety for connected BiSS-C encoder.
bissc_calc_clock
int32_t bissc_calc_clock(bissc_handle handle, bissc_clk_cfg *clk_cfg)
Calculate Rx and Tx divisors for given frequency.
bissc_config_clock
int32_t bissc_config_clock(bissc_handle handle, bissc_clk_cfg *clk_cfg)
Configure BiSS-C clock configuration into PRU-ICSS register, enable load share (if needed),...
bissc_wait_for_fw_initialization
int32_t bissc_wait_for_fw_initialization(bissc_handle handle, uint32_t loop_count)
Wait for BiSS-C receiver firmware to initialize.
bissc_deinit
void bissc_deinit(bissc_handle handle)
De-initialize a BiSS-C instance.
bissc_priv
BiSS-C private data structure (runtime state and configuration)
Definition: bissc_drv.h:479
bissc_clear_data_len
int32_t bissc_clear_data_len(bissc_handle handle)
Clears all the encoder resolution parameters.
bissc_get_attrs
const bissc_attrs * bissc_get_attrs(bissc_handle handle)
Get pointer to BiSS-C attributes structure.
bissc_update_max_proc_delay
int32_t bissc_update_max_proc_delay(bissc_handle handle)
Update maximum processing delay value.
bissc_generate_ctrl_cmd
uint32_t bissc_generate_ctrl_cmd(bissc_handle handle, uint8_t ls_ch, uint8_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.
bissc_clock_config
int32_t bissc_clock_config(bissc_handle handle, uint32_t frequency, uint32_t loop_count)
Configure BiSS-C clock frequency.
bissc_get_current_channel
uint32_t bissc_get_current_channel(bissc_handle handle, uint32_t ch_idx)
Retrieves the current channel in use.
bissc_wait_measure_proc_delay
int32_t bissc_wait_measure_proc_delay(bissc_handle handle, uint32_t loop_count)
Wait for BiSS-C receiver firmware to measure processing time.
bissc_update_data_len
int32_t bissc_update_data_len(bissc_handle handle, uint32_t single_turn_len[], uint32_t multi_turn_len[], uint32_t ch_num)
Update data length with encoder bit width for BiSS-C receiver firmware.
bissc_command_wait
int32_t bissc_command_wait(bissc_handle handle)
Wait till PRU finishes BiSS-C transaction.
bissc_update_clock_freq
int32_t bissc_update_clock_freq(bissc_handle handle, uint32_t frequency)
Update the operating baud rate as specified by the user.
bissc_get_pos
int32_t bissc_get_pos(bissc_handle handle)
Get single cycle BiSS-C position data.
bissc_command_send
int32_t bissc_command_send(bissc_handle handle)
Trigger sending the BiSS-C command in PRU.
bissc_get_enc_proc_delay
int32_t bissc_get_enc_proc_delay(bissc_handle handle)
Get measured processing delay of individual channel.
bissc_config_periodic_trigger_cmp_mode
int32_t bissc_config_periodic_trigger_cmp_mode(bissc_handle handle)
Configure periodic trigger operation mode using IEP compare event.
bissc_params
Structure defining BiSS-C initialization parameters.
Definition: bissc_drv.h:445
bissc_disable_safety
int32_t bissc_disable_safety(bissc_handle handle)
Disable Safety for connected BiSS-C encoder.
bissc_init
bissc_handle bissc_init(uint32_t index, const bissc_params *bissc_params)
Initialize a BiSS-C instance.
bissc_config_host_trigger
int32_t bissc_config_host_trigger(bissc_handle handle)
Configure host trigger operation mode.
bissc_config_iep_cmp_event
int32_t bissc_config_iep_cmp_event(bissc_handle handle, uint8_t channel, uint8_t event_num)
Configure IEP CMP event for periodic trigger (DMEM configuration only)
bissc_set_encoder_timeout
int32_t bissc_set_encoder_timeout(bissc_handle handle, uint32_t ch_num, uint32_t encoder_timeout)
Set encoder timeout value for a specific channel.
bissc_attrs
Structure defining BiSS-C attributes (compile-time/SysConfig configuration data)
Definition: bissc_drv.h:604
bissc_set_default_initialization
int32_t bissc_set_default_initialization(bissc_handle handle)
Set default configuration parameters for BiSS-C receiver firmware.
bissc_get_total_channels
uint32_t bissc_get_total_channels(bissc_handle handle)
Retrieves total number of channels configured.
bissc_clk_cfg
Structure defining BiSS-C clock configuration for selected frequency.
Definition: bissc_drv.h:371
bissc_get_encoder_timeout
uint32_t bissc_get_encoder_timeout(bissc_handle handle, uint32_t ch_num)
Get encoder timeout value for a specific channel.
bissc_params_init
void bissc_params_init(bissc_params *params)
Initialize the parameters data structure with defaults.
bissc_config_channel
int32_t bissc_config_channel(bissc_handle handle, uint8_t mask, uint8_t total_channels)
Select channel to be used by BiSS-C receiver.
bissc_hw_init
int32_t bissc_hw_init(bissc_handle handle)
Initialize BiSS-C hardware interface.
bissc_drv.h
bissc_config
Structure defining BiSS-C configuration handle.
Definition: bissc_drv.h:693
bissc_set_ctrl_cmd_and_process
int32_t bissc_set_ctrl_cmd_and_process(bissc_handle handle, uint32_t ctrl_cmd[])
Set control command and process the ctrl communication read/write.
bissc_get_priv
bissc_priv * bissc_get_priv(bissc_handle handle)
Get pointer to BiSS-C private data structure.
bissc_command_process
int32_t bissc_command_process(bissc_handle handle)
Send the BiSS-C command and wait till firmware acknowledges.
bissc_config_periodic_trigger_cap_mode
int32_t bissc_config_periodic_trigger_cap_mode(bissc_handle handle)
Configure periodic trigger CAP mode.