![]() |
![]() |
VCP2 API implementation. More...
#include <ti/csl/csl_vcp2.h>
#include <ti/csl/csl_vcp2Aux.h>
Functions | |
Uint32 | VCP2GetBaseAddress (int vcp2Num, VCP2BaseAddress *pBaseAddress) |
VCP2Handle | VCP2_init (VCP2Obj *pVcp2Obj, int instNum, int *pStatus) |
CSL_Status | VCP2_Close (VCP2Handle hVcp2) |
VCP2 API implementation.
===========================================================================
CSL_Status VCP2_Close | ( | VCP2Handle | hVcp2 | ) |
============================================================================
VCP2_Close
Description
Unreserves the VCP2 identified by the handle passed.
Arguments
hVcp2 VCP2 handle returned by successful VCP2_init
Return Value CSL_Status
Pre Condition
VCP2_init must be called successfully before VCP2_Close can be called.
Post Condition
The VCP2 CSL APIs can not be called until the VCP2 CSL is reopened again using VCP2_init
Writes
None
Example
VCP2Handle hVcp2; ... VCP2_Close(hVcp2);
=============================================================================
VCP2Handle VCP2_init | ( | VCP2Obj * | pVcp2Obj, |
int | instNum, | ||
int * | pStatus | ||
) |
============================================================================
VCP2_init
Description
Reserves the specified VCP2 for use. The device can be re-opened anytime after it has been normally closed, if so required. The VCP2 handle returned by this call is input as an essential argument for the rest of the APIs in VCP2 module.
Arguments
vcp2Obj Vcp2 Module Object pointer instNum VCP2 instance number. status Status of the function call
Return Value
VCP2Handle Valid Vcp2 handle will be returned if status value is equal to CSL_SOK.
Pre Condition
None
Post Condition
1. The status is returned in the status variable. If status returned is
2. Vcp2 object structure is populated
Writes
None
Example
VCP2Handle hVcp2; VCP2Obj vcp2Obj; int status; ... hVcp2 = VCP2_init(&vcp2Obj, CSL_VCP2_0, &status);
===========================================================================
Uint32 VCP2GetBaseAddress | ( | int | vcp2Num, |
VCP2BaseAddress * | pBaseAddress | ||
) |
============================================================================
VCP2GetBaseAddress
Description
Function to get the base address of the peripheral instance. This function is used for getting the base address of the peripheral instance. This function will be called inside the VCP2_init() function call. This function is open for re-implementing if the user wants to modify the base address of the peripheral object to point to a different location and there by allow CSL initiated write/reads into peripheral. MMR's go to an alternate location.
Arguments
vcp2Num Specifies the instance of the VCP2 to be opened. pBaseAddress Pointer to baseaddress structure containing base address details.
Return Value CSL_Status
Pre Condition
None
Post Condition
Base Address structure is populated and appropriate status is returned.
Writes
None
Example
int status; VCP2BaseAddress baseAddress; ... status = VCP2GetBaseAddress(CSL_VCP2_0, &baseAddress);
===========================================================================