![]() |
Synergy Software Package User's Manual
|
Functions | |
| d1_device * | d1_opendevice (d1_long_t flags) |
| Creates a device handle to access hardware. This function initializes the D1 device handle, supply module clock to D/AVE 2D hardware and enables the D/AVE 2D interrupt. It is called by the D/AVE 2D driver function d2_inithw() to initialize the D/AVE 2D hardware. More... | |
| d1_int_t | d1_closedevice (d1_device *handle) |
| Close a device handle. It is called by the D/AVE 2D driver function d2_deinithw to de-initialize the D/AVE 2D hardware. Disables the D/AVE 2D interrupt and stop the module clock supply. More... | |
| void | d1_setregister (d1_device *handle, d1_int_t deviceid, d1_int_t index, d1_long_t value) |
| Write data to the D/AVE 2D hardware register. More... | |
| d1_long_t | d1_getregister (d1_device *handle, d1_int_t deviceid, d1_int_t index) |
| Read data from hardware register. Reading a register from an invalid or unsupported device ID will always return 0. More... | |
| d1_int_t | d1_devicesupported (d1_device *handle, d1_int_t deviceid) |
| Check if the specified device ID is valid for the D/AVE 2D implemented for Synergy. Use this function to verify that a specific hardware interface is available on the current host system. More... | |
| void | drw_int_isr (void) |
| DRW ISR. More... | |
| d1_int_t | d1_initirq_intern (d1_device_synergy *handle) |
| Initialize IRQ for D/AVE 2D hardware. More... | |
| d1_int_t | d1_shutdownirq_intern (d1_device_synergy *handle) |
| De-initialize IRQ for D/AVE 2D hardware. More... | |
| d1_int_t | d1_queryirq (d1_device *handle, d1_int_t irqmask, d1_int_t timeout) |
| Wait for next IRQ being happened. More... | |
| void * | d1_allocmem (d1_uint_t size) |
| Allocates memory in the driver heap. More... | |
| void | d1_freemem (void *ptr) |
| Free the specified memory area in the driver heap. More... | |
| d1_uint_t | d1_memsize (void *ptr) |
| This function intends to return the size of the given memory block but we don't return valid value. This function returns always 1. More... | |
| void * | d1_allocvidmem (d1_device *handle, d1_int_t memtype, d1_uint_t size) |
| Allocate video memory. Synergy does not use the virtual memory space so this function exactly works same as d1_allocmem. More... | |
| void | d1_freevidmem (d1_device *handle, d1_int_t memtype, void *ptr) |
| Free video memory. Synergy does not use the virtual memory space so this function exactly works same as d1_freemem. More... | |
| d1_int_t | d1_queryvidmem (d1_device *handle, d1_int_t memtype, d1_int_t query) |
| Get current memory status. This function does not do anything special. More... | |
| d1_int_t | d1_queryarchitecture (d1_device *handle) |
| Return hints about systems memory architecture. More... | |
| void * | d1_mapvidmem (d1_device *handle, void *ptr, d1_int_t flags) |
| Map video memory for direct CPU access. Synergy does not use the virtual memory space so this function does not do anything special. More... | |
| d1_int_t | d1_unmapvidmem (d1_device *handle, void *ptr) |
| Release memory mapping. Synergy does not use the virtual memory space so this function does not do anything special. More... | |
| void * | d1_maptovidmem (d1_device *handle, void *ptr) |
| Map CPU accessible address of a video memory block back to video memory address. Synergy does not use the virtual memory space so this function does not do anything special. More... | |
| void * | d1_mapfromvidmem (d1_device *handle, void *ptr) |
| Map already allocated video memory address to an address for direct CPU access. More... | |
| d1_int_t | d1_copytovidmem (d1_device *handle, void *dst, const void *src, d1_uint_t size, d1_int_t flags) |
| Copy data to video memory. Destination (video) memory area has to be allocated by d1_allocvidmem. More... | |
| d1_int_t | d1_copyfromvidmem (d1_device *handle, void *dst, const void *src, d1_uint_t size, d1_int_t flags) |
| Copy data from video memory. Source (video) memory area has to be allocated by d1_allocvidmem. More... | |
| d1_int_t | d1_cacheflush (d1_device *handle, d1_int_t memtype) |
| Flush CPU data caches. Synergy does not have a cache memory so does not do anything special. More... | |
| d1_int_t | d1_cacheblockflush (d1_device *handle, d1_int_t memtype, const void *ptr, d1_uint_t size) |
| Flush part of CPU data caches. Synergy does not have a cache memory so does not do anything special. More... | |
| void* d1_allocmem | ( | d1_uint_t | size | ) |
Allocates memory in the driver heap.
| [in] | size | Size of the memory to be allocated. |
| Non-NULL | The function returns the pointer to memory chunk if memory allocation was successful. |
| NULL | The function returns NULL if memory allocation was failed. |
Create a byte memory pool in the driver heap if this function call is the first time.
Allocate memory from a byte memory pool.
| void* d1_allocvidmem | ( | d1_device * | handle, |
| d1_int_t | memtype, | ||
| d1_uint_t | size | ||
| ) |
Allocate video memory. Synergy does not use the virtual memory space so this function exactly works same as d1_allocmem.
| [in] | handle | Pointer to the d1_device object. |
| [in] | memtype | Type of memory. |
| [in] | size | Number of bytes. |
| Non-NULL | The function returns the pointer to memory chunk if memory allocation was successful. |
| NULL | The function returns Null if memory allocation was failed. |
| d1_int_t d1_cacheblockflush | ( | d1_device * | handle, |
| d1_int_t | memtype, | ||
| const void * | ptr, | ||
| d1_uint_t | size | ||
| ) |
Flush part of CPU data caches. Synergy does not have a cache memory so does not do anything special.
| [in] | handle | Pointer to the d1_device object. |
| [in] | memtype | Memory pools to flush (can be ored together). |
| [in] | ptr | Start address of memory to be flushed. |
| [in] | size | Size of memory to be flushed. |
| 1 | The function always return 1. |
| d1_int_t d1_cacheflush | ( | d1_device * | handle, |
| d1_int_t | memtype | ||
| ) |
Flush CPU data caches. Synergy does not have a cache memory so does not do anything special.
| [in] | handle | Pointer to the d1_device object. |
| [in] | memtype | Memory pools to flush (can be ored together). |
| 1 | The function always return 1. |
| d1_int_t d1_closedevice | ( | d1_device * | handle | ) |
Close a device handle. It is called by the D/AVE 2D driver function d2_deinithw to de-initialize the D/AVE 2D hardware. Disables the D/AVE 2D interrupt and stop the module clock supply.
| [in] | handle | Pointer to the d1_device object. |
| 0 | The function returns 0 if error occurred, NULL is passed to the argument handle. |
| 1 | The function returns 1 if successfully device handle was closed. |
Disable the D/AVE 2D interrupt.
Stop clock supply to the D/AVE 2D hardware.
Delete used semaphore
| d1_int_t d1_copyfromvidmem | ( | d1_device * | handle, |
| void * | dst, | ||
| const void * | src, | ||
| d1_uint_t | size, | ||
| d1_int_t | flags | ||
| ) |
Copy data from video memory. Source (video) memory area has to be allocated by d1_allocvidmem.
| [in] | handle | Pointer to the d1_device object. |
| [in] | dst | pointer into system memory (destination). |
| [in] | src | Pointer into video memory (source). |
| [in] | size | Number of bytes to copy. |
| [in] | flags | Reserved for future use. |
| 1 | The function always return 1. |
Simply use C standard memcpy.
| d1_int_t d1_copytovidmem | ( | d1_device * | handle, |
| void * | dst, | ||
| const void * | src, | ||
| d1_uint_t | size, | ||
| d1_int_t | flags | ||
| ) |
Copy data to video memory. Destination (video) memory area has to be allocated by d1_allocvidmem.
| [in] | handle | Pointer to the d1_device object. |
| [in] | dst | pointer into video memory (destination). |
| [in] | src | Pointer into system memory (source). |
| [in] | size | Number of bytes to copy. |
| [in] | flags | Bitfield containing additional information on data to be copied. |
| 1 | The function always return 1. |
Simply use C standard memcpy.
| d1_int_t d1_devicesupported | ( | d1_device * | handle, |
| d1_int_t | deviceid | ||
| ) |
Check if the specified device ID is valid for the D/AVE 2D implemented for Synergy. Use this function to verify that a specific hardware interface is available on the current host system.
| [in] | handle | Pointer to a device handle. |
| [in] | deviceid | D1_DAVE2D(Rendering core). The others are ignored. |
| 0 | The function returns 0 if specified device ID not supported. |
| 1 | The function returns 1 if specified device ID supported. |
Check the deviceid.
Return 1 in case of valid deviceid.
Return 0 in case of Unknown device ID.
| void d1_freemem | ( | void * | ptr | ) |
Free the specified memory area in the driver heap.
| [in] | ptr | Pointer to the memory area to be freed. |
Free specified memory allocated by d1_allocmem.
| void d1_freevidmem | ( | d1_device * | handle, |
| d1_int_t | memtype, | ||
| void * | ptr | ||
| ) |
Free video memory. Synergy does not use the virtual memory space so this function exactly works same as d1_freemem.
| [in] | handle | Pointer to the d1_device object. |
| [in] | memtype | Type of memory. |
| [in] | ptr | Address returned by d1_allocvidmem. |
| d1_long_t d1_getregister | ( | d1_device * | handle, |
| d1_int_t | deviceid, | ||
| d1_int_t | index | ||
| ) |
Read data from hardware register. Reading a register from an invalid or unsupported device ID will always return 0.
| [in] | handle | Pointer to a device handle. |
| [in] | deviceid | D1_DAVE2D(Rendering core) or D1_DLISTINDIRECT(Lists of dlist support). The others are ignored. |
| [in] | index | Register index (starts with 0). |
| Value | The function returns 32-bit value of the register. |
Check the deviceid to see whether Register addressing or dlist mode is being used.
If Register addressing is used return the value stored in specified D/AVE 2D register.
If dlist mode is used return the dlist address.
If neither Register addressing nor dlist mode is used return 0.
| d1_int_t d1_initirq_intern | ( | d1_device_synergy * | handle | ) |
Initialize IRQ for D/AVE 2D hardware.
| [in] | handle | Pointer to the d1_device object. |
| 0 | The function returns 0 if failed in the IRQ initialization. |
| 1 | The function returns 1 if successfully IRQ is initialized. |
Clear all the D/AVE 2D IRQs and enable Display list IRQ.
Access to FMI through the eventInfoGet interface and get the D/AVE 2D IRQ information.
Check return value of eventInfoGet API, if SUCCESS Enable the D/AVE 2D IRQ Vector
Set D/AVE 2D interrupt priority in NVIC if the IRQ vector is valid.
Enable D/AVE 2D interrupt in NVIC if the IRQ vector is valid.
| void* d1_mapfromvidmem | ( | d1_device * | handle, |
| void * | ptr | ||
| ) |
Map already allocated video memory address to an address for direct CPU access.
| [in] | handle | Pointer to the d1_device object. |
| [in] | ptr | Video memory address returned by d1_allocvidmem. |
| ptr | The function just returns ptr back since no mapping required for Synergy. |
| void* d1_maptovidmem | ( | d1_device * | handle, |
| void * | ptr | ||
| ) |
Map CPU accessible address of a video memory block back to video memory address. Synergy does not use the virtual memory space so this function does not do anything special.
| [in] | handle | Pointer to the d1_device object. |
| [in] | ptr | CPU accessible address pointing to a video memory block originally allocated using d1_allocvidmem. |
| ptr | The function just returns ptr back since no mapping required for Synergy. |
| void* d1_mapvidmem | ( | d1_device * | handle, |
| void * | ptr, | ||
| d1_int_t | flags | ||
| ) |
Map video memory for direct CPU access. Synergy does not use the virtual memory space so this function does not do anything special.
| [in] | handle | Pointer to the d1_device object. |
| [in] | ptr | Video memory address returned by d1_allocvidmem. |
| [in] | flags | Memory mapping flags. |
| ptr | The function just returns ptr back since no mapping required for Synergy. |
| d1_uint_t d1_memsize | ( | void * | ptr | ) |
This function intends to return the size of the given memory block but we don't return valid value. This function returns always 1.
| [in] | ptr | Pointer to a memory block in Heap. |
| 1 | The function always return 1. |
Always return 1.
| d1_device* d1_opendevice | ( | d1_long_t | flags | ) |
Creates a device handle to access hardware. This function initializes the D1 device handle, supply module clock to D/AVE 2D hardware and enables the D/AVE 2D interrupt. It is called by the D/AVE 2D driver function d2_inithw() to initialize the D/AVE 2D hardware.
| [in] | flags | Reserved. Not used in this function. |
| Non-NULL | The function returns the pointer to a d1_device object if the D1 device handle was successfully initialized. |
| NULL | The function returns NULL if failed to create the display list synchronization semaphore. |
Get new device handle.
Initialize device data.
Access to FMI through the productFeatureGet interface and get the D/AVE 2D hardware information.
If failed to get the D/AVE 2D information from FMI, set NULL to handle and return.
Initialize the D/AVE 2D hardware bass address in the device context.
Supply clock to the D/AVE 2D hardware.
Create the semaphore to notify the completion of display list execution.
Enable the D/AVE 2D interrupt if semaphore creation was successful.
If failed to enable the D/AVE 2D interrupt, set NULL to handle.
If failed to create the semaphore, set NULL to handle.
Returns the pointer to the d1_device object.
| d1_int_t d1_queryarchitecture | ( | d1_device * | handle | ) |
Return hints about systems memory architecture.
| [in] | handle | Pointer to the d1_device object. |
| d1_ma_unified | The function always return d1_ma_unified (Unified memory architecture). |
Return d1_ma_unified as Memory architecture is such that CPU can directly access pointers returned by allocvidmem.
| d1_int_t d1_queryirq | ( | d1_device * | handle, |
| d1_int_t | irqmask, | ||
| d1_int_t | timeout | ||
| ) |
Wait for next IRQ being happened.
| [in] | handle | Pointer to the d1_device object (Not used). |
| [in] | irqmask | Interrupt ID (Not used. Synergy only uses Display list IRQ). |
| [in] | timeout | Timeout value. |
| 0 | The function returns 0 if wait through semaphore is not successful |
| 1 | The function returns 1 if wait through semaphore is successful. |
Wait for dlist processing to complete.
| d1_int_t d1_queryvidmem | ( | d1_device * | handle, |
| d1_int_t | memtype, | ||
| d1_int_t | query | ||
| ) |
Get current memory status. This function does not do anything special.
| [in] | handle | Pointer to the d1_device object. |
| [in] | memtype | Type of memory. |
| [in] | query | Type of requested information. |
| 0 | The function always return 0. |
| void d1_setregister | ( | d1_device * | handle, |
| d1_int_t | deviceid, | ||
| d1_int_t | index, | ||
| d1_long_t | value | ||
| ) |
Write data to the D/AVE 2D hardware register.
| [in] | handle | Pointer to a device handle. |
| [in] | deviceid | D1_DAVE2D(Rendering core) or D1_DLISTINDIRECT(Lists of dlist support). The others are ignored. |
| [in] | index | Register index (word offset from the D/AVE 2D base address). |
| [in] | value | 32-bit value to write. |
Write data to specified D/AVE 2D register.
| d1_int_t d1_shutdownirq_intern | ( | d1_device_synergy * | handle | ) |
De-initialize IRQ for D/AVE 2D hardware.
| [in] | handle | Pointer to the d1_device object. |
| 0 | The function returns 0 if failed in the IRQ de-initialization. |
| 1 | The function returns 1 if successfully IRQ is de-initialized. |
Access to FMI through the eventInfoGet interface and get the D/AVE 2D IRQ information.
Check return value of eventInfoGet API, if SUCCESS disable the D/AVE 2D IRQ Vector
Disable D/AVE 2D interrupt in NVIC if the IRQ vector is valid.
Clear all the D/AVE 2D IRQs and disable Display list IRQ.
| d1_int_t d1_unmapvidmem | ( | d1_device * | handle, |
| void * | ptr | ||
| ) |
Release memory mapping. Synergy does not use the virtual memory space so this function does not do anything special.
| [in] | handle | Pointer to the d1_device object. |
| [in] | ptr | Mapped video memory address returned by d1_mapvidmem. |
| 1 | The function always return 1. |
| void drw_int_isr | ( | void | ) |
DRW ISR.
Just in case, check if the driver initialization done.
Get D/AVE 2D interrupt status.
Clear all the D/AVE 2D interrupts (keep the Display list interrupt enable).
Display list interrupt?
Signal semaphore for driver.
Clear IRQ status.