Here is the list of APIs used for HDSL Encoder communication protocol
Data Structures | |
struct | HDSL_Interface |
struct | HDSL_Config |
Functions | |
void | hdsl_enable_load_share_mode (void *gPru_cfg, uint32_t PRU_SLICE) |
enable load share mode for multi-channel HDSL More... | |
HDSL_Handle | HDSL_open (PRUICSS_Handle icssgHandle, uint32_t icssCore, uint8_t PRU_mode) |
Open HDSL handle for the specified core (interrupt mapping should already be completed) More... | |
void | HDSL_iep_init (HDSL_Handle hdslHandle) |
Initialize IEP and Use OCP as IEP CLK src. More... | |
int | HDSL_enable_sync_signal (uint8_t ES, uint32_t period) |
Enable IEP *Enable SYNC0 and program pulse width Enable cyclic mod Program CMP1 TSR configuration More... | |
uint64_t | HDSL_get_pos (HDSL_Handle hdslHandle, int position_id) |
Calculate fast position,safe position1,safe position2. More... | |
uint8_t | HDSL_get_qm (HDSL_Handle hdslHandle) |
Getting quality monitoring value. More... | |
uint16_t | HDSL_get_events (HDSL_Handle hdslHandle) |
Taking values of High bytes event (EVENT_H) and Low bytes event(EVENT_L) More... | |
uint8_t | HDSL_get_safe_events (HDSL_Handle hdslHandle) |
Taking values of Safe Event (EVENT_S) register. More... | |
uint16_t | HDSL_get_online_status_d (HDSL_Handle hdslHandle) |
Taking values of Online Status D (ONLINE_STATUS_D) register. More... | |
uint16_t | HDSL_get_online_status_1 (HDSL_Handle hdslHandle) |
Taking values of Online Status D (ONLINE_STATUS_D) register. More... | |
uint16_t | HDSL_get_online_status_2 (HDSL_Handle hdslHandle) |
Taking values of Online Status D (ONLINE_STATUS_D) register. More... | |
uint8_t | HDSL_get_sum (HDSL_Handle hdslHandle) |
Getting Summarized slave status. More... | |
uint8_t | HDSL_get_acc_err_cnt (HDSL_Handle hdslHandle) |
Acceleration error counter. More... | |
uint8_t | HDSL_get_rssi (HDSL_Handle hdslHandle) |
Read RSSI value. More... | |
int32_t | HDSL_write_pc_short_msg (HDSL_Handle hdslHandle, uint8_t addr, uint8_t data, uint64_t timeout) |
Write Response of Short message parameters channel Read for safe1 channel(S_PC_DATA) with gPc_data and Short message control value(SLAVE_REG_CTRL) in hdsl interface. More... | |
int32_t | HDSL_read_pc_short_msg (HDSL_Handle hdslHandle, uint8_t addr, uint8_t *data, uint64_t timeout) |
Read Response of Short message parameters channel Read for safe1 channel(S_PC_DATA) and write Short message control value(SLAVE_REG_CTRL) with gPc_addr in hdsl interface. More... | |
void | HDSL_set_pc_addr (HDSL_Handle hdslHandle, uint8_t pc_addrh, uint8_t pc_addrl, uint8_t pc_offh, uint8_t pc_offl) |
Write PC_AAD_L ,PC_ADD_H ,PC_OFF_L,PC_OFF_H and PC_CTRL values in hdsl interface. More... | |
void | HDSL_set_pc_ctrl (HDSL_Handle hdslHandle, uint8_t value) |
To set the direction read/write for long message communication. More... | |
void | HDSL_write_pc_buffer (HDSL_Handle hdslHandle, uint8_t pc_buf0, uint8_t pc_buf1, uint8_t pc_buf2, uint8_t pc_buf3, uint8_t pc_buf4, uint8_t pc_buf5, uint8_t pc_buf6, uint8_t pc_buf7) |
Write Parameters channel buffer for different bytes(bytes 0-7) More... | |
uint8_t | HDSL_read_pc_buffer (HDSL_Handle hdslHandle, uint8_t buff_off) |
Returns Parameters channel buffer for different bytes(bytes 0-7) More... | |
uint8_t | HDSL_get_sync_ctrl (HDSL_Handle hdslHandle) |
Returns Synchronization control value. More... | |
void | HDSL_set_sync_ctrl (HDSL_Handle hdslHandle, uint8_t val) |
Writes Synchronization control value. More... | |
uint8_t | HDSL_get_master_qm (HDSL_Handle hdslHandle) |
Returns Quality monitoring value. More... | |
uint8_t | HDSL_get_edges (HDSL_Handle hdslHandle) |
Returns Cable bit sampling time control. More... | |
uint8_t | HDSL_get_delay (HDSL_Handle hdslHandle) |
Returns Run time delay of system cable and signal strength. More... | |
uint8_t | HDSL_get_enc_id (HDSL_Handle hdslHandle, int byte) |
Read encoder id bytes(byte no. 0-2) More... | |
void | HDSL_generate_memory_image (HDSL_Handle hdslHandle) |
Generates memory image. More... | |
void * | HDSL_get_src_loc (HDSL_Handle hdslHandle) |
Get memory location for HDSL interface struct. More... | |
uint32_t | HDSL_get_length (HDSL_Handle hdslHandle) |
Get size of memory used by HDSL interface struct. More... | |
Typedefs | |
typedef struct HDSL_Config_s * | HDSL_Handle |
Macros | |
#define | MAX_WAIT 20000 |
#define | HDSL_ICSSG0_INST 0U |
#define | HDSL_ICSSG1_INST 1U |
#define | HWREG(x) (*((volatile uint32_t *)(x))) |
#define | HWREGB(x) (*((volatile uint8_t *)(x))) |
#define | HWREGH(x) (*((volatile uint16_t *)(x))) |
#define | SYNCEVENT_INTRTR_IN_27 27 |
#define | SYNCEVT_RTR_SYNC28_EVT 0x64 |
#define | SYNCEVT_RTR_SYNC29_EVT 0x68 |
#define | SYNCEVT_RTR_SYNC30_EVT 0x6C |
#define | SYNCEVT_RTR_SYNC31_EVT 0x70 |
#define | SYNCEVT_RTR_SYNC10_EVT 0x2C |
#define MAX_WAIT 20000 |
#define HDSL_ICSSG0_INST 0U |
#define HDSL_ICSSG1_INST 1U |
#define HWREG | ( | x | ) | (*((volatile uint32_t *)(x))) |
#define HWREGB | ( | x | ) | (*((volatile uint8_t *)(x))) |
#define HWREGH | ( | x | ) | (*((volatile uint16_t *)(x))) |
#define SYNCEVENT_INTRTR_IN_27 27 |
#define SYNCEVT_RTR_SYNC28_EVT 0x64 |
#define SYNCEVT_RTR_SYNC29_EVT 0x68 |
#define SYNCEVT_RTR_SYNC30_EVT 0x6C |
#define SYNCEVT_RTR_SYNC31_EVT 0x70 |
#define SYNCEVT_RTR_SYNC10_EVT 0x2C |
typedef struct HDSL_Config_s* HDSL_Handle |
anonymous enum |
void hdsl_enable_load_share_mode | ( | void * | gPru_cfg, |
uint32_t | PRU_SLICE | ||
) |
enable load share mode for multi-channel HDSL
[in] | gPru_cfg | Cfg base register address |
[in] | PRU_SLICE | PRU slice, 1 for PRU1 and 0 for PRU0 |
HDSL_Handle HDSL_open | ( | PRUICSS_Handle | icssgHandle, |
uint32_t | icssCore, | ||
uint8_t | PRU_mode | ||
) |
Open HDSL handle for the specified core (interrupt mapping should already be completed)
[in] | icssgHandle | PRUICSS_Handle for the ICSS instance |
[in] | icssCore | Core to map in ICSSG instance |
[in] | PRU_mode | 0 for dissabled load share mode, 1 for enabled load share mode |
HDSL_Handle |
void HDSL_iep_init | ( | HDSL_Handle | hdslHandle | ) |
Initialize IEP and Use OCP as IEP CLK src.
[in] | hdslHandle |
int HDSL_enable_sync_signal | ( | uint8_t | ES, |
uint32_t | period | ||
) |
Enable IEP
*Enable SYNC0 and program pulse width
Enable cyclic mod
Program CMP1
TSR configuration
[in] | ES | |
[in] | period |
1 | for successful enable sync signal |
uint64_t HDSL_get_pos | ( | HDSL_Handle | hdslHandle, |
int | position_id | ||
) |
Calculate fast position,safe position1,safe position2.
[in] | hdslHandle | |
[in] | position_id |
position | value in integer for successful position return, -1 for error in position return |
uint8_t HDSL_get_qm | ( | HDSL_Handle | hdslHandle | ) |
Getting quality monitoring value.
[in] | hdslHandle |
8 | bit integer QM value |
uint16_t HDSL_get_events | ( | HDSL_Handle | hdslHandle | ) |
Taking values of High bytes event (EVENT_H) and Low bytes event(EVENT_L)
[in] | hdslHandle |
16 | bit integer concatenated values of both EVENT_H,EVENT_L |
uint8_t HDSL_get_safe_events | ( | HDSL_Handle | hdslHandle | ) |
Taking values of Safe Event (EVENT_S) register.
[in] | hdslHandle |
8 | bit integer values of EVENT_S |
uint16_t HDSL_get_online_status_d | ( | HDSL_Handle | hdslHandle | ) |
Taking values of Online Status D (ONLINE_STATUS_D) register.
[in] | hdslHandle |
16 | bit integer value of ONLINE_STATUS_D |
uint16_t HDSL_get_online_status_1 | ( | HDSL_Handle | hdslHandle | ) |
Taking values of Online Status D (ONLINE_STATUS_D) register.
[in] | hdslHandle |
16 | bit integer value of ONLINE_STATUS_D |
uint16_t HDSL_get_online_status_2 | ( | HDSL_Handle | hdslHandle | ) |
Taking values of Online Status D (ONLINE_STATUS_D) register.
[in] | hdslHandle |
16 | bit integer value of ONLINE_STATUS_D |
uint8_t HDSL_get_sum | ( | HDSL_Handle | hdslHandle | ) |
Getting Summarized slave status.
[in] | hdslHandle |
8 | bit integer value of summarized status |
uint8_t HDSL_get_acc_err_cnt | ( | HDSL_Handle | hdslHandle | ) |
Acceleration error counter.
[in] | hdslHandle |
8 | bit integer value of acceleration error counter |
uint8_t HDSL_get_rssi | ( | HDSL_Handle | hdslHandle | ) |
Read RSSI value.
[in] | hdslHandle |
8 | bit RSSI integer value |
int32_t HDSL_write_pc_short_msg | ( | HDSL_Handle | hdslHandle, |
uint8_t | addr, | ||
uint8_t | data, | ||
uint64_t | timeout | ||
) |
Write Response of Short message parameters channel Read for safe1 channel(S_PC_DATA) with gPc_data and Short message control value(SLAVE_REG_CTRL) in hdsl interface.
[in] | hdslHandle | |
[in] | addr | Address |
[in] | data | Data |
[in] | timeout | Timeout in microseconds |
int32_t HDSL_read_pc_short_msg | ( | HDSL_Handle | hdslHandle, |
uint8_t | addr, | ||
uint8_t * | data, | ||
uint64_t | timeout | ||
) |
Read Response of Short message parameters channel Read for safe1 channel(S_PC_DATA) and write Short message control value(SLAVE_REG_CTRL) with gPc_addr in hdsl interface.
[in] | hdslHandle | |
[in] | addr | Address |
[in] | data | Pointer to data buffer where read data will be stored |
[in] | timeout | Timeout in microseconds |
void HDSL_set_pc_addr | ( | HDSL_Handle | hdslHandle, |
uint8_t | pc_addrh, | ||
uint8_t | pc_addrl, | ||
uint8_t | pc_offh, | ||
uint8_t | pc_offl | ||
) |
Write PC_AAD_L ,PC_ADD_H ,PC_OFF_L,PC_OFF_H and PC_CTRL values in hdsl interface.
[in] | hdslHandle | |
[in] | pc_addrh | |
[in] | pc_addrl | |
[in] | pc_offh | |
[in] | pc_offl |
void HDSL_set_pc_ctrl | ( | HDSL_Handle | hdslHandle, |
uint8_t | value | ||
) |
To set the direction read/write for long message communication.
[in] | hdslHandle | |
[in] | value |
void HDSL_write_pc_buffer | ( | HDSL_Handle | hdslHandle, |
uint8_t | pc_buf0, | ||
uint8_t | pc_buf1, | ||
uint8_t | pc_buf2, | ||
uint8_t | pc_buf3, | ||
uint8_t | pc_buf4, | ||
uint8_t | pc_buf5, | ||
uint8_t | pc_buf6, | ||
uint8_t | pc_buf7 | ||
) |
Write Parameters channel buffer for different bytes(bytes 0-7)
[in] | hdslHandle | |
[in] | pc_buf0 | |
[in] | pc_buf1 | |
[in] | pc_buf2 | |
[in] | pc_buf3 | |
[in] | pc_buf4 | |
[in] | pc_buf5 | |
[in] | pc_buf6 | |
[in] | pc_buf7 |
uint8_t HDSL_read_pc_buffer | ( | HDSL_Handle | hdslHandle, |
uint8_t | buff_off | ||
) |
Returns Parameters channel buffer for different bytes(bytes 0-7)
[in] | hdslHandle | |
[in] | buff_off |
8 | bit integer value of PC_BUFFER from hdsl interface |
uint8_t HDSL_get_sync_ctrl | ( | HDSL_Handle | hdslHandle | ) |
Returns Synchronization control value.
[in] | hdslHandle |
8 | bit integer value of SYNC_CTRL from hdsl interface |
void HDSL_set_sync_ctrl | ( | HDSL_Handle | hdslHandle, |
uint8_t | val | ||
) |
Writes Synchronization control value.
[in] | hdslHandle | |
[in] | val |
uint8_t HDSL_get_master_qm | ( | HDSL_Handle | hdslHandle | ) |
Returns Quality monitoring value.
[in] | hdslHandle |
8 | bit integer value of MASTER_QM from hdsl interface |
uint8_t HDSL_get_edges | ( | HDSL_Handle | hdslHandle | ) |
Returns Cable bit sampling time control.
[in] | hdslHandle |
8 | bit integer value of EDGES from hdsl interface |
uint8_t HDSL_get_delay | ( | HDSL_Handle | hdslHandle | ) |
Returns Run time delay of system cable and signal strength.
[in] | hdslHandle |
8 | bit integer value of DELAY from hdsl interface |
uint8_t HDSL_get_enc_id | ( | HDSL_Handle | hdslHandle, |
int | byte | ||
) |
Read encoder id bytes(byte no. 0-2)
[in] | hdslHandle | |
[in] | byte |
8 | bit encoder bytes data from hdsl interface |
void HDSL_generate_memory_image | ( | HDSL_Handle | hdslHandle | ) |
Generates memory image.
[in] | hdslHandle |
void* HDSL_get_src_loc | ( | HDSL_Handle | hdslHandle | ) |
Get memory location for HDSL interface struct.
[in] | hdslHandle |
Pointer | containing base memeory address |
uint32_t HDSL_get_length | ( | HDSL_Handle | hdslHandle | ) |
Get size of memory used by HDSL interface struct.
[in] | hdslHandle |
Size | of the struct |