Silicon Software Logo

siso_auxport.h Source File

siso_auxport.h
Go to the documentation of this file.
1 
14 #pragma once
15 #ifndef SISO_AUX_PORT_H
16 #define SISO_AUX_PORT_H
17 
18 #include <cstring>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 
32 };
33 
35 
41 
53 int SisoAuxPortGetNumberOfPorts(unsigned int board_id, SisoAuxPortType port_type);
54 
69 int SisoAuxPortGetFirstNumberOfType(unsigned int board_id, SisoAuxPortType port_type);
70 
85 int SisoAuxPortGetType(unsigned int board_id, unsigned int port_num, SisoAuxPortType * type_ptr);
86 
92 typedef struct SisoAuxPort_Struct * SisoAuxPort;
93 
101 
119 int SisoAuxPortInit(unsigned int board_id, unsigned int port_num, SisoAuxPortType type, SisoAuxPort * handle_ptr);
120 
137 int SisoAuxPortOpen(SisoAuxPort handle);
138 
148 int SisoAuxPortClose(SisoAuxPort handle);
149 
161 int SisoAuxPortFree(SisoAuxPort handle);
162 
173 };
174 
176 
182 
183 /* Integer properties */
184 #define SISO_AUX_PORT_INT_PROPERTY_FREQUENCY "Frequency:Int"
186 /* Float properties */
187 #define SISO_AUX_PORT_FLOAT_PROPERTY_FREQUENCY "Frequency:Float"
189 /* String properties */
190 #define SISO_AUX_PORT_STRING_PROPERTY_NAME "Name:Str"
191 #define SISO_AUX_PORT_STRING_PROPERTY_TYPE "Type:Str"
193 /* JTAG port integer properties */
194 #define SISO_JTAG_PORT_INT_PROPERTY_NUM_TAPS "JTAGNumTaps:Int"
195 #define SISO_JTAG_PORT_INT_PROPERTY_STATE "JTAGState:Int"
197 /* JTAG port binary properties */
198 #define SISO_JTAG_PORT_BINARY_PROPERTY_CHAIN "JTAGChain:Bin"
200 /* UIQ port properties */
201 #define SISO_UIQ_PORT_INT_PROPERTY_TRANSMISSION_MODE "UiqTransmissionMode:Int"
202 #define SISO_UIQ_PORT_INT_PROPERTY_SPI_MODE "UiqSpiMode:Int"
203 #define SISO_UIQ_PORT_INT_PROPERTY_NUM_WORDS_AVAILABLE "UiqNumWords:Int"
206 
207 
209 
210 #define SISO_JTAG_PORT_STATE_RESET 0
211 #define SISO_JTAG_PORT_STATE_IDLE 1
212 #define SISO_JTAG_PORT_STATE_SHIFT_DR 2
213 #define SISO_JTAG_PORT_STATE_SHIFT_IR 3
216 
217 
219 
220 /* JTAG invalid device id */
221 #define SISO_JTAG_PORT_DEVICE_ID_NONE 0
222 #define SISO_JTAG_PORT_DEVICE_ID_INVALID (-1)
225 
226 
228  unsigned int ir_length;
229  unsigned int device_id;
230 };
231 
243  size_t num_taps;
245 };
246 
252 
272 int SisoAuxPortGetProperty(SisoAuxPort handle, const char * property, SisoAuxPortPropertyType type, void * value, unsigned int size);
273 
297 int SisoAuxPortSetProperty(SisoAuxPort handle, const char * property, SisoAuxPortPropertyType type, void * value, unsigned int size);
298 
308 
309 /* General transmission flags */
310 #define SISO_AUX_PORT_RWFLAGS_LENGTH_IN_BYTES (0x1)
311 #define SISO_AUX_PORT_RWFLAGS_LENGTH_IN_BITS (0x2)
313 /* JTAG port transmission flags */
314 #define SISO_JTAG_PORT_RWFLAGS_USE_DEVICE_ID 0
315 #define SISO_JTAG_PORT_RWFLAGS_USE_TAP_NUMBER (0x10)
316 #define SISO_JTAG_PORT_RWFLAGS_WAIT_ON_READ 0
317 #define SISO_JTAG_PORT_RWFLAGS_SEND_ZEROES_ON_READ (0x20)
318 #define SISO_JTAG_PORT_RWFLAGS_RAW_SEND_ZEROES_ON_OTHER SISO_JTAG_PORT_RWFLAGS_SEND_ZEROES_ON_READ
319 #define SISO_JTAG_PORT_RWFLAGS_SEND_ONES_ON_READ (0x40)
320 #define SISO_JTAG_PORT_RWFLAGS_RAW_SEND_ONES_ON_OTHER SISO_JTAG_PORT_RWFLAGS_SEND_ONES_ON_READ
321 #define SISO_JTAG_PORT_RWFLAGS_READ_MODE_MASK (0x60)
322 #define SISO_JTAG_PORT_RWFLAGS_RAW_MODE (0x80)
323 #define SISO_JTAG_PORT_RWFLAGS_STATE_IDLE (0x100)
324 #define SISO_JTAG_PORT_RWFLAGS_STATE_SHIFT_DR (0x200)
325 #define SISO_JTAG_PORT_RWFLAGS_STATE_SHIFT_IR (0x300)
326 #define SISO_JTAG_PORT_RWFLAGS_STATE_MASK (0x300)
327 #define SISO_JTAG_PORT_RWFLAGS_MSB_FIRST 0
328 #define SISO_JTAG_PORT_RWFLAGS_LSB_FIRST (0x400)
329 #define SISO_JTAG_PORT_RWFLAGS_RAW_WRITE_TDI_DATA 0
330 #define SISO_JTAG_PORT_RWFLAGS_RAW_WRITE_TMS_DATA (0x800)
332 /* I2C port transmission flags */
333 #define SISO_I2C_PORT_RWFLAGS_SEND_START 0
334 #define SISO_I2C_PORT_RWFLAGS_DONT_SEND_START (0x1000)
335 #define SISO_I2C_PORT_RWFLAGS_SEND_STOP 0
336 #define SISO_I2C_PORT_RWFLAGS_DONT_SEND_STOP (0x2000)
337 #define SISO_I2C_PORT_RWFLAGS_NAK_LAST_BYTE_READ 0
338 #define SISO_I2C_PORT_RWFLAGS_ACK_LAST_BYTE_READ (0x4000)
339 #define SISO_I2C_PORT_RWFLAGS_ACK_POLLING (0x8000)
342 
343 
348 };
349 
351 
357 
384 int SisoAuxPortWrite(SisoAuxPort handle, const void * data, unsigned int size, unsigned int * length_ptr, unsigned int flags, unsigned int timeout);
385 
410 int SisoAuxPortRead(SisoAuxPort handle, void * data, unsigned int size, unsigned int * length_ptr, unsigned int flags, unsigned int timeout);
411 
431 int SisoAuxPortFlush(SisoAuxPort handle, SisoAuxPortFlushType flush, unsigned int timeout);
432 
458 int SisoAuxPortBeginTransferBlock(SisoAuxPort handle, unsigned int timeout);
459 
474 
475 
476 
505 int SisoAuxPortSend(SisoAuxPort handle, unsigned int device_id, const void * data, unsigned int size, unsigned int * length_ptr, unsigned int flags, unsigned int timeout);
506 
534 int SisoAuxPortReceive(SisoAuxPort handle, unsigned int device_id, void * data, unsigned int size, unsigned int * length_ptr, unsigned int flags, unsigned int timeout);
535 
567 int SisoAuxPortTransmit(SisoAuxPort handle, unsigned int device_id, const void * data_out, unsigned int size_out, unsigned int * length_out_ptr, void * data_in, unsigned int size_in, unsigned int * length_in_ptr, unsigned int flags, unsigned int timeout);
568 
578 
579 #define SISO_AUX_PORT_SUCCESS 0
580 #define SISO_AUX_PORT_ERROR (-1)
581 #define SISO_AUX_PORT_ERROR_INVALID_POINTER (-2)
582 #define SISO_AUX_PORT_ERROR_INVALID_SIZE (-3)
583 #define SISO_AUX_PORT_ERROR_INVALID_BOARD_ID (-4)
584 #define SISO_AUX_PORT_ERROR_INVALID_PORT_TYPE (-5)
585 #define SISO_AUX_PORT_ERROR_INVALID_PORT_NUMBER (-6)
586 #define SISO_AUX_PORT_ERROR_INVALID_PORT_HANDLE (-7)
587 #define SISO_AUX_PORT_ERROR_BUSY (-8)
588 #define SISO_AUX_PORT_ERROR_OUT_OF_MEMORY (-9)
589 #define SISO_AUX_PORT_ERROR_PORT_NOT_OPEN (-10)
590 #define SISO_AUX_PORT_ERROR_OVERFLOW (-11)
591 #define SISO_AUX_PORT_ERROR_NOT_IMPLEMENTED (-49)
592 #define SISO_AUX_PORT_ERROR_INVALID_RWFLAGS (-51)
593 #define SISO_AUX_PORT_ERROR_IO_FAILURE (-52)
594 #define SISO_AUX_PORT_ERROR_TIMEOUT (-53)
595 #define SISO_AUX_PORT_ERROR_INVALID_FLUSH_TYPE (-54)
596 #define SISO_AUX_PORT_ERROR_NO_DATA (-55)
597 #define SISO_AUX_PORT_ERROR_INVALID_PROPERTY (-101)
598 #define SISO_AUX_PORT_ERROR_INVALID_PROPERTY_TYPE (-102)
599 #define SISO_AUX_PORT_ERROR_READ_ONLY_PROPERTY (-103)
600 #define SISO_AUX_PORT_ERROR_FREQUENCY_TOO_LOW (-110)
601 #define SISO_AUX_PORT_ERROR_FREQUENCY_TOO_HIGH (-111)
602 #define SISO_JTAG_PORT_ERROR (-200)
603 #define SISO_JTAG_PORT_ERROR_INVALID_CHAIN (-201)
604 #define SISO_JTAG_PORT_ERROR_INVALID_IR_LENGTH (-202)
605 #define SISO_JTAG_PORT_ERROR_INVALID_DEVICE_ID (-203)
606 #define SISO_JTAG_PORT_ERROR_CHAIN_LENGTH_MISMATCH (-204)
607 #define SISO_JTAG_PORT_ERROR_NO_CHAIN_SET (-205)
608 #define SISO_JTAG_PORT_ERROR_DATA_LENGTH_MISMATCH (-206)
609 #define SISO_I2C_PORT_ERROR_ARBITRATION_LOST (-301)
610 #define SISO_I2C_PORT_ERROR_ACK_NAK_MISMATCH (-302)
611 #define SISO_UIQ_PORT_ERROR_INVALID_TRANSMISSION_MODE (-401)
612 #define SISO_UIQ_PORT_ERROR_INVALID_SPI_MODE (-402)
615 
616 
617 #ifdef __cplusplus
618 }
619 #endif
620 
621 #endif /* SISO_AUX_PORT_H */
Definition: siso_auxport.h:169
enum SisoAuxPortType_Enum SisoAuxPortType
Definition: siso_auxport.h:34
int SisoAuxPortRead(SisoAuxPort handle, void *data, unsigned int size, unsigned int *length_ptr, unsigned int flags, unsigned int timeout)
Definition: siso_auxport.h:242
Definition: siso_auxport.h:346
SisoAuxPortPropertyType_Enum
Definition: siso_auxport.h:168
enum SisoAuxPortFlushType_Enum SisoAuxPortFlushType
Definition: siso_auxport.h:350
Definition: siso_auxport.h:31
SisoAuxPortPropertyType_Enum SisoAuxPortPropertyType
Definition: siso_auxport.h:175
Definition: siso_auxport.h:170
int SisoAuxPortFree(SisoAuxPort handle)
Definition: siso_auxport.h:345
Definition: siso_auxport.h:172
Definition: siso_auxport.h:28
int SisoAuxPortEndTransferBlock(SisoAuxPort handle)
struct SisoAuxPort_Struct * SisoAuxPort
Definition: siso_auxport.h:92
Definition: siso_auxport.h:347
int SisoAuxPortReceive(SisoAuxPort handle, unsigned int device_id, void *data, unsigned int size, unsigned int *length_ptr, unsigned int flags, unsigned int timeout)
Definition: siso_auxport.h:27
Definition: siso_auxport.h:30
SisoAuxPortFlushType_Enum
Definition: siso_auxport.h:344
int SisoAuxPortGetNumberOfPorts(unsigned int board_id, SisoAuxPortType port_type)
int SisoAuxPortOpen(SisoAuxPort handle)
SisoAuxPortType_Enum
Definition: siso_auxport.h:26
int SisoAuxPortInit(unsigned int board_id, unsigned int port_num, SisoAuxPortType type, SisoAuxPort *handle_ptr)
size_t num_taps
Definition: siso_auxport.h:243
unsigned int ir_length
Definition: siso_auxport.h:228
int SisoAuxPortSetProperty(SisoAuxPort handle, const char *property, SisoAuxPortPropertyType type, void *value, unsigned int size)
int SisoAuxPortGetType(unsigned int board_id, unsigned int port_num, SisoAuxPortType *type_ptr)
SisoJTAGTAP_Struct tap[1]
Definition: siso_auxport.h:244
int SisoAuxPortSend(SisoAuxPort handle, unsigned int device_id, const void *data, unsigned int size, unsigned int *length_ptr, unsigned int flags, unsigned int timeout)
int SisoAuxPortFlush(SisoAuxPort handle, SisoAuxPortFlushType flush, unsigned int timeout)
Definition: siso_auxport.h:29
int SisoAuxPortTransmit(SisoAuxPort handle, unsigned int device_id, const void *data_out, unsigned int size_out, unsigned int *length_out_ptr, void *data_in, unsigned int size_in, unsigned int *length_in_ptr, unsigned int flags, unsigned int timeout)
int SisoAuxPortGetFirstNumberOfType(unsigned int board_id, SisoAuxPortType port_type)
int SisoAuxPortClose(SisoAuxPort handle)
int SisoAuxPortGetProperty(SisoAuxPort handle, const char *property, SisoAuxPortPropertyType type, void *value, unsigned int size)
unsigned int device_id
Definition: siso_auxport.h:229
Definition: siso_auxport.h:171
int SisoAuxPortWrite(SisoAuxPort handle, const void *data, unsigned int size, unsigned int *length_ptr, unsigned int flags, unsigned int timeout)
int SisoAuxPortBeginTransferBlock(SisoAuxPort handle, unsigned int timeout)
Definition: siso_auxport.h:227