GPIO_OPEN and CLOSE
来源:互联网 发布:小米盒子直播软件 编辑:程序博客网 时间:2024/05/04 09:51
Resource Management
CSL provides a limited set of functions that enable resourcemanagement for applications which may support multiple algorithms,such as two McBSP or two TIMERs, and may reuse the same type ofperipheral device. Resource management in CSL is achieved throughAPI calls to the PER_open() and PER_close() functions. The PER_open()function normally takes a device number and a reset flag as theprimary arguments and returns a pointer to a handle structure thatcontains information about which channel (DMA) orport (McBSP) was opened, then set “Allocate” flag defined in thehandle structure to 1, meaning the channel or port is in use. Whengiven a specific device number, the open function checks a global“allocate” flag to determine its availability. If the device/channel is available, then it returns apointer to a predefined handle structure for this device. If thedevice has already been opened by another process, then an invalidhandle is returned whose value is equal to theCSL symbolic constant, INV. Note that CSL does nothing otherthan return an invalid handle from PER_open(). You must use this to insure that noresource-usage conflicts occur. It is left to the user to check the value returned from the PER_open() function to guarantee that theresource has been allocated.
A device/channel may be freed for use by other processes by acall to PER_close() . PER_close() clears the allocate flag defined under the handlestructure object and resets the device/channel. All CSL modulesthat support multiple devices or channels, such as McBSP and DMA,require a device handle as a primary argument to most APIfunctions. For these APIs, the definition of aPER_Handle object is required.
Using CSL Handles
Handles are required only for peripherals that have multiple channels orports, such as DMA, EDMA, GPIO, McBSP, TIMER, I2C, and VP.You obtain a handle by calling the PER_open()function.
When you no longer need a particular channel, free thoseresources by calling the PER_close() function.The PER_open() andPER_close() functions ensure that you do notinitialize the same channel more than once. CSL handleobjects are used to uniquely identify an open peripheralchannel/port or device. Handle objects must bedeclared in the C source, and initialized by a call to a PER_open() function before calling any other APIfunctions that require a handle object as an argument. PER_open()returns a value of “INV” if the resource is alreadyallocated.
DMA_Handle myDma;
Once defined, the CSL handle object is initialized by a callto PER_open .
The call to DMA_open initializes the handle, myDma. This handle canthen be
used in calls to other API functions.
DMA_start (myDma);
- GPIO_OPEN and CLOSE
- Zero mean and unit norm
- Zero mean and unit norm
- android SQLite - close() was nev…
- SEGMENT SHRINK and details
- about googleMap and googleEarth
- Time and Time Again
- openssh and X11 forwarding
- PROCESS J000 And …
- NOR_FLASH and NAND_FLASH
- strtok and strtok_s
- SQLite and Java
- Ansoft and Ansys
- link_to and url_for
- Click and Drag
- PDU and TPDU
- Practice and Knowledge
- TCP and UDP
- NOR_FLASH and NAND_FLASH
- 寄存器书记类型长度
- gel文件的作用——摘自百度
- 系统初始化
- MEMORY
- GPIO_OPEN and CLOSE
- 理想滤波
- static--摘自度娘
- 定时器中断模拟pwm输出声音文件
- 收集的重要的T-SQL语句
- static静态变量的理解 百度
- 构造二叉树并输出
- ESX 4.1 中linux虚拟机磁盘空间(LVM)扩容
- 如何启动bochs