Technical Support
On-Line Manuals
RL-ARM User's Guide (MDK v4)
#include <file_config.h> BOOL Init ( void);
The function Init initializes the SPI serial interface. It is invoked by the function finit upon system startup.
The function is part of the SPI Driver. The prototype is defined in the file File_Config.h. Developers must customize the function.
spi.BusSpeed, spi.CheckMedia, 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 }; /* Initialize and enable the SSP Interface module. */ static BOOL Init (void) { /* SSEL is GPIO, output set to high. */ IODIR0 |= 1<<20; IOSET0 = 1<<20; PINSEL1 = (PINSEL1 & ~0x000003FC) | 0x000000A8; /* Enable SPI in Master Mode, CPOL=0, CPHA=0. */ SSPCR0 = 0x0007; SSPCR1 = 0x0002; SSPCPSR = 0xFE; 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.