您的位置: OpenADSP社区论坛 -> Blackfin专区 -> 新手上路 -> bf609库函数使用的问题
本帖共有1999个阅读者
发表帖子 发表投票 回复主题
bf609库函数使用的问题
逝去日子(论坛新手)
逝去日子
头衔:社区公民
帮派:无帮无派
帖数:22
金钱:248
积分:22
注册时间:2014/1/2
楼主信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
bf609库函数使用的问题
新手刚学ADSP用的bf609想用自带的函数库,cces在配置好外设之后比如spi、gpio、uart会在工作目录中出现相应的.c文件。比如adi_spi.c、adi_gpio.c、adi_uart.c、在这些文件中会有相应的库函数ADI_UART_RESULT adi_uart_Open(
    uint32_t                      nDeviceNum,
    ADI_UART_DIRECTION            eDirection,
    void                   *const pMemory,
    uint32_t                      nMemSize,
    ADI_UART_HANDLE        *const phDevice
)
这些库函数的功能,还有参数的配置怎么配。都不太明白,希望大神能解答

这家伙很懒,什么也没有留下!
等级:论坛新手 参考IP地址:*.*.*.*
2014/1/8 10:37:12
逝去日子(论坛新手)
逝去日子
头衔:社区公民
帮派:无帮无派
帖数:22
金钱:248
积分:22
注册时间:2014/1/2
1信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
ADI_SPI_RESULT adi_spi_ReadWrite(ADI_SPI_HANDLE const hDevice, ADI_SPI_TRANSCEIVER *pTransceiver)给解答一下这个函数的意思吧,实在没看懂

这家伙很懒,什么也没有留下!
等级:论坛新手 参考IP地址:*.*.*.*
2014/1/9 14:49:25
尊贵身份标志
andy(论坛版主)
andy
头衔:社区公民
帮派:无帮无派
帖数:2287
金钱:11132
积分:2263
注册时间:2011/6/8
2信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
ADI现在的例子代码都是以操作系统接口的方式写的,不是很好理解,我们都不用这样的代码。通常都是直接对寄存器做配置。BF609的这些我也没看过,所以不知。

在CCES的帮助文件里,搜索adi_spi_ReadWrite ,找到以下信息,你也可以在帮助文件里找找看,如果这里面找不到,估计其他地方很难找到解释了:


ADI_SPI_RESULT adi_spi_ReadWrite (ADI_SPI_HANDLE const hDevice,
ADI_SPI_TRANSCEIVER * pTransceiver
)

The adi_spi_ReadWrite API submits transceiver buffers that transfers blocking
SPI data via either interrupts or the DMA controller depending on the state
bDmaMode.

Parameters:


[in]hDeviceThe handle of the SPI device.
[in]pTransceiverThe pointer to the SPI's transceiver
data.
Returns:
Status

This function read/writes a transceiver under interrupt control or DMA
control depending on the configuration of bDMAMode parameter. bDMAMode is
configurable via the adi_spi_EnableDmaMode API. The transceiver transfer takes
place via a blocking mechanism. The transceiver includes a prologue buffer and
size, a transmit buffer and size and a receive buffer and size. The transmission
/ reception of each of these buffers is optional.

The prologue buffer is optional (set to NULL with a zero size if not
required) and can be used to send common SPI header or protocol fields.

The transmit buffer is optional (set to NULL with a zero size if not
required) and defines the transmit buffer and its size in bytes.

The receive buffer is optional (set to NULL with a zero size if not required)
and defines the receive buffer and its size in bytes.

See also:
adi_spi_SubmitBuffers.
adi_spi_EnableDmaMode

这家伙很懒,什么也没有留下!
等级:论坛版主 参考IP地址:*.*.*.*
2014/1/9 17:43:51
逝去日子(论坛新手)
逝去日子
头衔:社区公民
帮派:无帮无派
帖数:22
金钱:248
积分:22
注册时间:2014/1/2
3信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
我也看过这个帮助文件了就是没弄懂他这个库函数文件具体是怎么操作的,就是SPI的收发等等,是完全可以通过他本是的库函数就可以完成一个功能不用去管寄存器呢,还是他给的库函数要依靠别的寄存器配合才行,谢谢版主的回复,同时希望使用库函数的兄弟姐妹们能指点一下,谢谢啦

这家伙很懒,什么也没有留下!
等级:论坛新手 参考IP地址:*.*.*.*
2014/1/10 13:07:05
Powered by OpenADSP Copyright © 2010 www.Openadsp.com. All rights reserved.159185 Call, 1 Queries, Processed in 0.046875 second(s),