 |
AM261x Motor Control SDK
10.02.00
|
|
Go to the documentation of this file.
52 #include <kernel/dpl/DebugP.h>
54 #include <drivers/pruicss.h>
55 #include <drivers/hw_include/cslr_soc.h>
56 #include <drivers/hw_include/hw_types.h>
67 #define HDSL_MAX_CHANNELS (3U)
68 #define CHANNEL_0_ENABLED (1<<0)
69 #define CHANNEL_1_ENABLED (1<<1)
70 #define CHANNEL_2_ENABLED (1<<2)
80 #define HDSL_LONG_MSG_ADDR_DIRECT (0U)
82 #define HDSL_LONG_MSG_ADDR_INDIRECT (1U)
93 #define HDSL_LONG_MSG_ADDR_WITHOUT_OFFSET (0U)
95 #define HDSL_LONG_MSG_ADDR_WITH_OFFSET (1U)
107 #define HDSL_LONG_MSG_LENGTH_0 (0U)
109 #define HDSL_LONG_MSG_LENGTH_2 (1U)
111 #define HDSL_LONG_MSG_LENGTH_4 (2U)
113 #define HDSL_LONG_MSG_LENGTH_8 (3U)
116 #define MAX_WAIT 20000
122 #define SYNCEVENT_INTRTR_IN_27 27
126 #define SYNCEVT_RTR_SYNC28_EVT 0x64
128 #define SYNCEVT_RTR_SYNC29_EVT 0x68
130 #define SYNCEVT_RTR_SYNC30_EVT 0x6C
132 #define SYNCEVT_RTR_SYNC31_EVT 0x70
134 #define SYNCEVT_RTR_SYNC10_EVT 0x2C
263 typedef struct HDSL_Config_s {
292 typedef struct HDSL_CopyTable_s {
Definition: hdsl_drv.h:263
volatile uint8_t POSTX
Definition: hdsl_drv.h:246
volatile uint8_t resvd3
Definition: hdsl_drv.h:215
@ MENU_SAFE_POSITION
Definition: hdsl_drv.h:137
volatile uint8_t VPOSCRC2_L
Definition: hdsl_drv.h:245
volatile uint8_t PC_OFF_H
Definition: hdsl_drv.h:209
volatile uint8_t VERSION
Definition: hdsl_drv.h:178
int32_t HDSL_read_pc_long_msg(HDSL_Handle hdslHandle, uint16_t addr, uint8_t offsetEnable, uint8_t addrType, uint8_t length, uint16_t offset, uint64_t timeout)
Trigger a long message read operation using parameters channel If this API returns SystemP_SUCCESS,...
volatile uint8_t resvd2
Definition: hdsl_drv.h:191
volatile uint8_t ONLINE_STATUS_D_H
Definition: hdsl_drv.h:249
volatile uint8_t VPOS20
Definition: hdsl_drv.h:243
uint32_t reserved2
Definition: hdsl_drv.h:297
volatile uint8_t VPOS23
Definition: hdsl_drv.h:240
uint32_t * baseMemAddr
Definition: hdsl_drv.h:270
@ MENU_DIRECT_READ_RID81_LENGTH8
Definition: hdsl_drv.h:146
volatile uint8_t SAFE_CTRL
Definition: hdsl_drv.h:220
volatile uint8_t EVENT_L
Definition: hdsl_drv.h:172
volatile uint8_t resvd14
Definition: hdsl_drv.h:247
volatile uint8_t resvd11
Definition: hdsl_drv.h:227
uint32_t icssCore
Definition: hdsl_drv.h:266
volatile uint8_t resvd1
Definition: hdsl_drv.h:179
volatile uint8_t EDGES
Definition: hdsl_drv.h:176
void HDSL_write_pc_buffer(HDSL_Handle hdslHandle, uint8_t buff_off, uint8_t data)
Write Parameters channel buffer for different bytes(bytes 0-7)
volatile uint8_t PC_BUFFER5
Definition: hdsl_drv.h:204
uint8_t HDSL_get_sync_ctrl(HDSL_Handle hdslHandle)
Returns Synchronization control value.
uint64_t mask
Definition: hdsl_drv.h:278
volatile uint8_t PC_ADD_H
Definition: hdsl_drv.h:207
@ MENU_PC_SHORT_MSG_WRITE
Definition: hdsl_drv.h:143
volatile uint8_t ONLINE_STATUS_1_H
Definition: hdsl_drv.h:251
volatile uint8_t VPOS0
Definition: hdsl_drv.h:196
volatile uint8_t resvd10
Definition: hdsl_drv.h:226
Definition: hdsl_drv.h:166
volatile uint8_t VPOSCRC_H
Definition: hdsl_drv.h:197
volatile uint8_t VPOS3
Definition: hdsl_drv.h:193
volatile uint8_t resvd0
Definition: hdsl_drv.h:169
@ MENU_DIRECT_READ_RID0_LENGTH4
Definition: hdsl_drv.h:145
int32_t HDSL_config_channel_mask(HDSL_Handle hdslHandle, uint8_t channelMask)
Configure the channel mask.
uint32_t res
Definition: hdsl_drv.h:276
uint32_t loadAddr2
Definition: hdsl_drv.h:298
uint8_t HDSL_get_acc_err_cnt(HDSL_Handle hdslHandle)
Acceleration error counter.
volatile uint8_t resvd6
Definition: hdsl_drv.h:218
void HDSL_set_sync_ctrl(HDSL_Handle hdslHandle, uint8_t val)
Writes Synchronization control value.
volatile uint8_t ENC_ID2
Definition: hdsl_drv.h:180
uint8_t HDSL_get_sum(HDSL_Handle hdslHandle)
Getting Summarized slave status.
volatile uint8_t ONLINE_STATUS_2_H
Definition: hdsl_drv.h:253
volatile uint8_t POS0
Definition: hdsl_drv.h:187
volatile uint8_t PC_DATA
Definition: hdsl_drv.h:214
volatile uint8_t S_PC_DATA
Definition: hdsl_drv.h:222
volatile uint8_t MASTER_QM
Definition: hdsl_drv.h:170
volatile uint8_t SAFE_SUM
Definition: hdsl_drv.h:221
volatile uint8_t EVENT_H
Definition: hdsl_drv.h:171
void * HDSL_get_src_loc(HDSL_Handle hdslHandle)
Get memory location for HDSL interface struct.
volatile uint8_t ONLINE_STATUS_1_L
Definition: hdsl_drv.h:252
@ MENU_HDSL_REG_INTO_MEMORY
Definition: hdsl_drv.h:150
volatile uint8_t resvd5
Definition: hdsl_drv.h:217
volatile uint8_t PIPE_S
Definition: hdsl_drv.h:212
@ MENU_EVENTS
Definition: hdsl_drv.h:139
volatile uint8_t resvd4
Definition: hdsl_drv.h:216
volatile uint8_t ACC_ERR_CNT
Definition: hdsl_drv.h:223
uint8_t HDSL_get_edges(HDSL_Handle hdslHandle)
Returns Cable bit sampling time control.
volatile uint8_t PC_OFF_L
Definition: hdsl_drv.h:210
uint32_t multi_turn
Definition: hdsl_drv.h:274
volatile uint8_t VPOS1
Definition: hdsl_drv.h:195
volatile uint8_t SLAVE_REG_CTRL
Definition: hdsl_drv.h:231
PRUICSS_Handle icssHandle
Definition: hdsl_drv.h:264
@ MENU_INVALID
Definition: hdsl_drv.h:152
uint64_t HDSL_get_pos(HDSL_Handle hdslHandle, int position_id)
Calculate fast position,safe position1,safe position2.
volatile uint8_t PC_BUFFER2
Definition: hdsl_drv.h:201
volatile uint8_t VPOS24
Definition: hdsl_drv.h:239
volatile uint8_t VPOSCRC_L
Definition: hdsl_drv.h:198
volatile uint8_t MASK_H
Definition: hdsl_drv.h:173
volatile uint8_t MASK_S
Definition: hdsl_drv.h:229
volatile uint8_t resvd7
Definition: hdsl_drv.h:219
uint8_t HDSL_get_enc_id(HDSL_Handle hdslHandle, int byte)
Read encoder id bytes(byte no. 0-2)
volatile uint8_t PC_BUFFER1
Definition: hdsl_drv.h:200
@ MENU_INDIRECT_WRITE_RID0_LENGTH8
Definition: hdsl_drv.h:149
volatile uint8_t PC_BUFFER6
Definition: hdsl_drv.h:205
volatile uint8_t PC_BUFFER0
Definition: hdsl_drv.h:199
uint8_t HDSL_get_rssi(HDSL_Handle hdslHandle)
Read RSSI value.
volatile uint8_t resvd13
Definition: hdsl_drv.h:234
volatile uint8_t ENC_ID0
Definition: hdsl_drv.h:182
volatile uint8_t PIPE_D
Definition: hdsl_drv.h:213
HDSL_Handle HDSL_open(PRUICSS_Handle icssHandle, uint32_t icssCore, uint8_t pruMode)
Open HDSL handle for the specified core (interrupt mapping should already be completed)
volatile uint8_t ONLINE_STATUS_D_L
Definition: hdsl_drv.h:250
int32_t HDSL_config_copy_table(HDSL_Handle hdslHandle, HDSL_CopyTable *copyTable)
Configure the copy table entries for two overlayed firmware parts for channel 2.
struct HDSL_Config_s * HDSL_Handle
Definition: hdsl_drv.h:155
@ MENU_INDIRECT_WRITE_RID0_LENGTH8_OFFSET0
Definition: hdsl_drv.h:148
volatile uint8_t resvd9
Definition: hdsl_drv.h:225
uint8_t HDSL_get_qm(HDSL_Handle hdslHandle)
Getting quality monitoring value.
volatile uint8_t VERSION2
Definition: hdsl_drv.h:236
uint32_t HDSL_get_length(HDSL_Handle hdslHandle)
Get size of memory used by HDSL interface struct.
uint32_t size1
Definition: hdsl_drv.h:296
int32_t HDSL_write_pc_long_msg(HDSL_Handle hdslHandle, uint16_t addr, uint8_t offsetEnable, uint8_t addrType, uint8_t length, uint16_t offset, uint64_t timeout)
Trigger a long message write operation using parameters channel. Call HDSL_write_pc_buffer before thi...
volatile uint8_t MASK_SUM
Definition: hdsl_drv.h:175
uint16_t HDSL_get_online_status_d(HDSL_Handle hdslHandle)
Taking values of Online Status D (ONLINE_STATUS_D) register.
volatile uint8_t EVENT_S
Definition: hdsl_drv.h:228
volatile uint8_t DELAY
Definition: hdsl_drv.h:177
volatile uint8_t ENC_ID1
Definition: hdsl_drv.h:181
volatile uint8_t VPOS2
Definition: hdsl_drv.h:194
volatile uint8_t PC_ADD_L
Definition: hdsl_drv.h:208
volatile uint8_t ACC_ERR_CNT_THRESH
Definition: hdsl_drv.h:232
uint32_t loadAddr1
Definition: hdsl_drv.h:294
uint16_t HDSL_get_online_status_1(HDSL_Handle hdslHandle)
Taking values of Online Status D (ONLINE_STATUS_D) register.
volatile uint8_t POS3
Definition: hdsl_drv.h:184
volatile uint8_t PC_BUFFER4
Definition: hdsl_drv.h:203
volatile uint8_t resvd8
Definition: hdsl_drv.h:224
uint8_t HDSL_read_pc_buffer(HDSL_Handle hdslHandle, uint8_t buff_off)
Returns Parameters channel buffer for different bytes(bytes 0-7)
uint8_t HDSL_get_safe_events(HDSL_Handle hdslHandle)
Taking values of Safe Event (EVENT_S) register.
uint32_t runAddr1
Definition: hdsl_drv.h:295
uint16_t HDSL_get_online_status_2(HDSL_Handle hdslHandle)
Taking values of Online Status D (ONLINE_STATUS_D) register.
volatile uint8_t VPOS4
Definition: hdsl_drv.h:192
volatile uint8_t VEL1
Definition: hdsl_drv.h:189
volatile uint8_t resvd12
Definition: hdsl_drv.h:233
volatile uint8_t ONLINE_STATUS_2_L
Definition: hdsl_drv.h:254
int32_t HDSL_read_pc_short_msg(HDSL_Handle hdslHandle, uint8_t addr, uint8_t *data, uint64_t timeout)
Trigger a short message read operation using parameters channel. After the required registers are wri...
uint32_t runAddr2
Definition: hdsl_drv.h:299
@ MENU_SUMMARY
Definition: hdsl_drv.h:140
Definition: hdsl_drv.h:292
void hdsl_enable_load_share_mode(void *pruCfg, uint32_t pruSlice)
enable load share mode for multi-channel HDSL
uint8_t HDSL_get_delay(HDSL_Handle hdslHandle)
Returns Run time delay of system cable and signal strength.
HDSL_Interface * hdslInterface
Definition: hdsl_drv.h:272
@ MENU_LIMIT
Definition: hdsl_drv.h:151
@ MENU_DIRECT_READ_RID81_LENGTH2
Definition: hdsl_drv.h:147
volatile uint8_t SYS_CTRL
Definition: hdsl_drv.h:167
volatile uint8_t POS2
Definition: hdsl_drv.h:185
@ MENU_RSSI
Definition: hdsl_drv.h:142
volatile uint8_t PC_CTRL
Definition: hdsl_drv.h:211
volatile uint8_t POS4
Definition: hdsl_drv.h:183
volatile uint8_t PC_BUFFER7
Definition: hdsl_drv.h:206
volatile uint8_t POS1
Definition: hdsl_drv.h:186
volatile uint8_t VPOS21
Definition: hdsl_drv.h:242
void HDSL_generate_memory_image(HDSL_Handle hdslHandle)
Generates memory image.
volatile uint8_t SYNC_CTRL
Definition: hdsl_drv.h:168
volatile uint8_t ENC2_ID
Definition: hdsl_drv.h:237
uint16_t HDSL_get_events(HDSL_Handle hdslHandle)
Taking values of High bytes event (EVENT_H) and Low bytes event(EVENT_L)
@ MENU_QUALITY_MONITORING
Definition: hdsl_drv.h:138
volatile uint8_t PC_BUFFER3
Definition: hdsl_drv.h:202
@ MENU_ACC_ERR_CNT
Definition: hdsl_drv.h:141
volatile uint8_t VEL0
Definition: hdsl_drv.h:190
uint32_t reserved1
Definition: hdsl_drv.h:293
volatile uint8_t MASK_L
Definition: hdsl_drv.h:174
@ MENU_PC_SHORT_MSG_READ
Definition: hdsl_drv.h:144
volatile uint8_t DUMMY
Definition: hdsl_drv.h:230
uint32_t size2
Definition: hdsl_drv.h:300
volatile uint8_t VPOSCRC2_H
Definition: hdsl_drv.h:244
int32_t HDSL_write_pc_short_msg(HDSL_Handle hdslHandle, uint8_t addr, uint8_t data, uint64_t timeout)
Trigger a short message write operation using parameters channel After the required registers are wri...
volatile uint8_t STATUS2
Definition: hdsl_drv.h:238
volatile uint8_t VPOS22
Definition: hdsl_drv.h:241
uint8_t HDSL_get_master_qm(HDSL_Handle hdslHandle)
Returns Quality monitoring value.
volatile uint8_t VEL2
Definition: hdsl_drv.h:188