SPIINIT

From MCS Wiki AVR
Revision as of 18:25, 12 February 2013 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Action

Initiate the SPI pins.

 

 

Syntax

SPIINIT

 

 

Remarks

After the configuration of the SPI pins, you must initialize the SPI pins to set them for the right data direction. When the pins are not used by other hardware/software, you only need to use SPIINIT once.

When the SPI bus is used in master mode, the MOSI, CLOCK and SS pins will be set to output.

When the SPI bus is used in slave mode, the MISO is set to output mode.

 

If you need to change the logic levels of the SPI pins, you need to disable the SPI. You can do this by setting the SPE bit to 0 in SPCR.

 

When other routines change the state of the SPI pins, use SPIINIT again before using SPIIN and SPIOUT.

 

 

See also

SPIIN , SPIOUTconfig spi

 

 

ASM

Calls _init_spi

 

 

Example

See SPIIN


Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language