Hi Ti Folks,
Thanks for quick answers for my previous questions on PA. I was searching for a way to close/delete/flush the PA configurations/setup. I found this API
paReturn_t Pa_close (Pa_Handle handle, void* bases[])
few questions on above
1. i will pass the PA handle to the function as its first argument
2. what is expectation from Application in terms of bases. it would be really great if you have any example for it.
3. i see the comments for Pa_close as below.
/**
* @ingroup palld_api_functions
* @brief Pa_close decativates the PA driver instance
*
* @details This function deactivates the PA driver instance, all the associated
* memory buffers can be freed after this call.
*
* @param[in] handle The PA LLD instance identifier
* @param[out] bases Array of the memory buffer base addresses
* @retval Value (@ref ReturnValues)
paReturn_t Pa_close (Pa_Handle handle, void* bases[])
{
paInst_t *paInst = (paInst_t *)handle;
int i;
uint32_t mtCsKey;
/* Refresh PA Instance for read only */
Pa_osalMtCsEnter(&mtCsKey);
Pa_osalBeginMemAccess (paInst, sizeof(paInst_t));
for ( i = 0; i < pa_N_BUFS; i++)
{
bases[i] = paInst->paBufs[i].base;
}
Pa_osalEndMemAccess (paInst, sizeof(paInst_t));
Pa_osalMtCsExit(mtCsKey);
return (pa_OK);
} /* Pa_close */
Taking the comments one by one
1. There is nothing de-activation happening inside the Pa_close function. please clarify on this.?
2. If i understand associated buffers needs to be freed..means
bases[0] = (Void *)paInst;
bases[1] = (Void *)memL2Ram;
bases[2] = (Void *)memL3Ram;
if i set the bases to NULL, will that do the clean-up activity.
or should i reset the paInst, memL2Ram, memL3Ram to zeros..
in anyway, i want to make sure that i shuld be able to call Pa_create again [after Pa_close and extra code] without being returned error. Kindly help me.
Thanks
RC Reddy