Technical Support
On-Line Manuals
RL-ARM User's Guide (MDK v4)
#include <file_config.h> BOOL BusSpeed ( U32 kbaud); /* Bus speed in kilo-baud */
The function BusSpeed sets the transfer speed on the SPI interface to the requested baud rate.
The parameter kbaud specifies the requested baud rate.
The function is part of the SPI Driver. The prototype is defined in the file File_Config.h. Developers must customize the function.
spi.CheckMedia, spi.Init, spi.RecBuf, spi.Send, spi.SendBuf, spi.SetSS, spi.UnInit
/* SPI Device Driver Control Block */ SPI_DRV spi0_drv = { Init, UnInit, Send, SendBuf, RecBuf, BusSpeed, SetSS, CheckMedia }; /* Set an SPI clock to required baud rate. */ static BOOL BusSpeed (U32 kbaud) { U32 div; div = (__PCLK/1000 + kbaud - 1) / kbaud; if (div == 0) { div = 0x02; } if (div & 1) { div++; } if (div > 0xFE) { div = 0xFE; } SSPCPSR = div; return (__TRUE); }
Cookie Settings | Terms of Use | Privacy | Accessibility | Trademarks | Contact Us | Feedback
Copyright © 2005-2019 Arm Limited (or its affiliates). All rights reserved.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
Change Settings
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.