1
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
5
Copyright (c) 2001-2007 Octasic Inc.
9
This file contains the functions provided by the user.
11
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API is
12
free software; you can redistribute it and/or modify it under the terms of
13
the GNU General Public License as published by the Free Software Foundation;
14
either version 2 of the License, or (at your option) any later version.
16
The OCT6100 GPL API is distributed in the hope that it will be useful, but
17
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
You should have received a copy of the GNU General Public License
22
along with the OCT6100 GPL API; if not, write to the Free Software
23
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
25
$Octasic_Release: OCT612xAPI-01.00-PR49 $
27
$Octasic_Revision: 28 $
29
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
32
/***************************** INCLUDE FILES *******************************/
35
#include "oct6100api/oct6100_apiud.h"
36
#include "oct6100api/oct6100_errors.h"
40
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
42
Function: Oct6100UserGetTime
44
Description: Returns the system time in us.
46
-------------------------------------------------------------------------------
47
| Argument | Description
48
-------------------------------------------------------------------------------
49
f_pTime Pointer to structure in which the time is returned.
51
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
52
#if !SKIP_Oct6100UserGetTime
53
UINT32 Oct6100UserGetTime(
54
IN OUT tPOCT6100_GET_TIME f_pTime )
57
return cOCT6100_ERR_OK;
65
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
67
Function: Oct6100UserMemSet
69
Description: Sets f_ulLength bytes pointed to by f_pAddress to f_ulPattern.
71
-------------------------------------------------------------------------------
72
| Argument | Description
73
-------------------------------------------------------------------------------
75
f_pAddress Address in host memory where data should be set.
76
f_ulPattern Pattern to apply at the address. This value will never
78
f_ulLength Length in bytes to set.
80
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
81
#if !SKIP_Oct6100UserMemSet
82
UINT32 Oct6100UserMemSet(
84
IN UINT32 f_ulPattern,
85
IN UINT32 f_ulLength )
88
return cOCT6100_ERR_OK;
93
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
95
Function: Oct6100UserMemCopy
97
Description: Copy f_ulLength bytes from f_pSource to f_pDestination.
99
-------------------------------------------------------------------------------
100
| Argument | Description
101
-------------------------------------------------------------------------------
103
f_pDestination Host data destination address.
104
f_pSource Host data source address.
105
f_ulLength Length in bytes to copy.
107
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
108
#if !SKIP_Oct6100UserMemCopy
109
UINT32 Oct6100UserMemCopy(
110
IN PVOID f_pDestination,
111
IN const void *f_pSource,
112
IN UINT32 f_ulLength )
115
return cOCT6100_ERR_OK;
120
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
122
Function: Oct6100UserCreateSerializeObject
124
Description: Creates a serialization object. The serialization object is
125
seized via the Oct6100UserSeizeSerializeObject function.
127
-------------------------------------------------------------------------------
128
| Argument | Description
129
-------------------------------------------------------------------------------
130
f_pCreate Pointer to structure in which the serialization object's
133
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
134
#if !SKIP_Oct6100UserCreateSerializeObject
135
UINT32 Oct6100UserCreateSerializeObject(
136
IN OUT tPOCT6100_CREATE_SERIALIZE_OBJECT f_pCreate )
140
return cOCT6100_ERR_OK;
145
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
147
Function: Oct6100UserDestroySerializeObject
149
Description: Destroys the indicated serialization object.
151
-------------------------------------------------------------------------------
152
| Argument | Description
153
-------------------------------------------------------------------------------
154
f_pDestroy Pointer to structure containing the handle of the
155
serialization object.
157
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
158
#if !SKIP_Oct6100UserDestroySerializeObject
159
UINT32 Oct6100UserDestroySerializeObject(
160
IN tPOCT6100_DESTROY_SERIALIZE_OBJECT f_pDestroy )
164
return cOCT6100_ERR_OK;
169
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
171
Function: Oct6100UserSeizeSerializeObject
173
Description: Seizes the indicated serialization object.
175
-------------------------------------------------------------------------------
176
| Argument | Description
177
-------------------------------------------------------------------------------
178
f_pSeize Pointer to structure containing the handle of the
179
serialization object.
181
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
182
#if !SKIP_Oct6100UserSeizeSerializeObject
183
UINT32 Oct6100UserSeizeSerializeObject(
184
IN tPOCT6100_SEIZE_SERIALIZE_OBJECT f_pSeize )
188
return cOCT6100_ERR_OK;
193
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
195
Function: Oct6100UserReleaseSerializeObject
197
Description: Releases the indicated serialization object.
199
-------------------------------------------------------------------------------
200
| Argument | Description
201
-------------------------------------------------------------------------------
202
f_pRelease Pointer to structure containing the handle of the
203
serialization object.
205
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
206
#if !SKIP_Oct6100UserReleaseSerializeObject
207
UINT32 Oct6100UserReleaseSerializeObject(
208
IN tPOCT6100_RELEASE_SERIALIZE_OBJECT f_pRelease )
212
return cOCT6100_ERR_OK;
217
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
219
Function: Oct6100UserDriverWriteApi
221
Description: Performs a write access to the chip. This function is
222
accessible only from the API code entity (i.e. not from the
225
-------------------------------------------------------------------------------
226
| Argument | Description
227
-------------------------------------------------------------------------------
228
f_pWriteParams Pointer to structure containing the Params to the
231
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
232
#if !SKIP_Oct6100UserDriverWriteApi
233
UINT32 Oct6100UserDriverWriteApi(
234
IN tPOCT6100_WRITE_PARAMS f_pWriteParams )
240
return cOCT6100_ERR_OK;
245
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
247
Function: Oct6100UserDriverWriteOs
249
Description: Performs a write access to the chip. This function is
250
accessible only from the APIMI code entity (i.e. not from the
253
-------------------------------------------------------------------------------
254
| Argument | Description
255
-------------------------------------------------------------------------------
256
f_pWriteParams Pointer to structure containing the Params to the
259
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
260
#if !SKIP_Oct6100UserDriverWriteOs
261
UINT32 Oct6100UserDriverWriteOs(
262
IN tPOCT6100_WRITE_PARAMS f_pWriteParams )
265
return cOCT6100_ERR_OK;
270
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
272
Function: Oct6100UserDriverWriteSmearApi
274
Description: Performs a series of write accesses to the chip. The same data
275
word is written to a series of addresses. The writes begin at
276
the start address, and the address is incremented by the
277
indicated amount for each subsequent write. This function is
278
accessible only from the API code entity (i.e. not from the
281
-------------------------------------------------------------------------------
282
| Argument | Description
283
-------------------------------------------------------------------------------
284
f_pSmearParams Pointer to structure containing the parameters to the
285
write smear function.
287
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
288
#if !SKIP_Oct6100UserDriverWriteSmearApi
289
UINT32 Oct6100UserDriverWriteSmearApi(
290
IN tPOCT6100_WRITE_SMEAR_PARAMS f_pSmearParams )
296
return cOCT6100_ERR_OK;
301
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
303
Function: Oct6100UserDriverWriteSmearOs
305
Description: Performs a series of write accesses to the chip. The same data
306
word is written to a series of addresses. The writes begin at
307
the start address, and the address is incremented by the
308
indicated amount for each subsequent write. This function is
309
accessible only from the APIMI code entity (i.e. not from the
312
-------------------------------------------------------------------------------
313
| Argument | Description
314
-------------------------------------------------------------------------------
315
f_pSmearParams Pointer to structure containing the parameters to the
316
write smear function.
318
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
319
#if !SKIP_Oct6100UserDriverWriteSmearOs
320
UINT32 Oct6100UserDriverWriteSmearOs(
321
IN tPOCT6100_WRITE_SMEAR_PARAMS f_pSmearParams )
325
return cOCT6100_ERR_OK;
330
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
332
Function: Oct6100UserDriverWriteBurstApi
334
Description: Performs a series of write accesses to the chip. An array of
335
data words is written to a series of consecutive addresses.
336
The writes begin at the start address with element 0 of the
337
provided array as the data word. The address is incremented by
338
two for each subsequent write. This function is accessible only
339
from the API code entity (i.e. not from the APIMI code entity).
341
-------------------------------------------------------------------------------
342
| Argument | Description
343
-------------------------------------------------------------------------------
344
f_pBurstParams Pointer to structure containing the parameters to the
345
write burst function.
347
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
348
#if !SKIP_Oct6100UserDriverWriteBurstApi
349
UINT32 Oct6100UserDriverWriteBurstApi(
350
IN tPOCT6100_WRITE_BURST_PARAMS f_pBurstParams )
356
return cOCT6100_ERR_OK;
361
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
363
Function: Oct6100UserDriverWriteBurstOs
365
Description: Performs a series of write accesses to the chip. An array of
366
data words is written to a series of consecutive addresses.
367
The writes begin at the start address with element 0 of the
368
provided array as the data word. The address is incremented by
369
two for each subsequent write. This function is accessible only
370
from the API code entity (i.e. not from the APIMI code entity).
372
-------------------------------------------------------------------------------
373
| Argument | Description
374
-------------------------------------------------------------------------------
375
f_pBurstParams Pointer to structure containing the parameters to the
376
write burst function.
378
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
379
#if !SKIP_Oct6100UserDriverWriteBurstOs
380
UINT32 Oct6100UserDriverWriteBurstOs(
381
IN tPOCT6100_WRITE_BURST_PARAMS f_pBurstParams )
385
return cOCT6100_ERR_OK;
390
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
392
Function: Oct6100UserDriverReadApi
394
Description: Performs a read access to the chip. This function is accessible
395
only from the API code entity (i.e. not from the APIMI code
398
-------------------------------------------------------------------------------
399
| Argument | Description
400
-------------------------------------------------------------------------------
401
f_pReadParams Pointer to structure containing the parameters to the
404
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
405
#if !SKIP_Oct6100UserDriverReadApi
406
UINT32 Oct6100UserDriverReadApi(
407
IN OUT tPOCT6100_READ_PARAMS f_pReadParams )
413
return cOCT6100_ERR_OK;
418
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
420
Function: Oct6100UserDriverReadOs
422
Description: Performs a read access to the chip. This function is accessible
423
only from the APIMI code entity (i.e. not from the API code
426
-------------------------------------------------------------------------------
427
| Argument | Description
428
-------------------------------------------------------------------------------
429
f_pReadParams Pointer to structure containing the parameters to the
432
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
433
#if !SKIP_Oct6100UserDriverReadOs
434
UINT32 Oct6100UserDriverReadOs(
435
IN OUT tPOCT6100_READ_PARAMS f_pReadParams )
439
return cOCT6100_ERR_OK;
444
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
446
Function: Oct6100UserDriverReadBurstApi
448
Description: Performs a burst of read accesses to the chip. The first read
449
is performed at the start address, and the address is
450
incremented by two for each subsequent read. The data is
451
retunred in an array provided by the user. This function is
452
accessible only from the API code entity (i.e. not from the
455
-------------------------------------------------------------------------------
456
| Argument | Description
457
-------------------------------------------------------------------------------
458
f_pBurstParams Pointer to structure containing the parameters to the
461
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
462
#if !SKIP_Oct6100UserDriverReadBurstApi
463
UINT32 Oct6100UserDriverReadBurstApi(
464
IN OUT tPOCT6100_READ_BURST_PARAMS f_pBurstParams )
470
return cOCT6100_ERR_OK;
475
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
477
Function: Oct6100UserDriverReadBurstOs
479
Description: Performs a burst of read accesses to the chip. The first read
480
is performed at the start address, and the address is
481
incremented by two for each subsequent read. The data is
482
retunred in an array provided by the user. This function is
483
accessible only from the APIMI code entity (i.e. not from the
486
-------------------------------------------------------------------------------
487
| Argument | Description
488
-------------------------------------------------------------------------------
489
f_pBurstParams Pointer to structure containing the parameters to the
492
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
493
#if !SKIP_Oct6100UserDriverReadBurstOs
494
UINT32 Oct6100UserDriverReadBurstOs(
495
IN OUT tPOCT6100_READ_BURST_PARAMS f_pBurstParams )
499
return cOCT6100_ERR_OK;