SAM3S8/SD8 Software Package: examples/spi_slave/main.c File Reference

SAM3S8/SD8 Software Package 1.2
Defines | Functions

# main.c File Reference

`#include "board.h"`
`#include <stdio.h>`
`#include <stdarg.h>`

Go to the source code of this file.

## Defines

#define | SPI_MASTER_BASE SPI
#define | SPI_SLAVE_BASE SPI
#define | SLAVE_STATE_IDLE 0
#define | SLAVE_STATE_TEST 1
#define | SLAVE_STATE_DATA 2
#define | SLAVE_STATE_STATUS_ENTRY 3
#define | SLAVE_STATE_STATUS 4
#define | SLAVE_STATE_END 5
#define | CMD_TEST 0x10101010
#define | CMD_DATA 0x29380000
#define | CMD_STATUS 0x68390384
#define | CMD_END 0x68390484
#define | RC_SYN 0x55AA55AA
#define | RC_RDY 0x12345678
#define | NB_STATUS_CMD 20
#define | NUM_SPCK_CONFIGURATIONS 4

## Functions

void | SPI_IrqHandler (void)
| Interrupt handler for the SPI slave.
int | main (void)
| Application entry point for spi_slave example.

## Detailed Description

This file contains all the specific code for the spi slave example.

Definition in file main.c.

## Define Documentation

#define CMD_DATA 0x29380000

slave data state, begin to return last data block

Definition at line 133 of file main.c.

#define CMD_END 0x68390484

slave idle state, begin to return RC_SYN

Definition at line 137 of file main.c.

#define CMD_STATUS 0x68390384

slave status state, begin to return RC_RDY + RC_STATUS

Definition at line 135 of file main.c.

#define CMD_TEST 0x10101010

SPI example commands for this example slave test state, begin to return RC_RDY

Definition at line 131 of file main.c.

#define NB_STATUS_CMD 20

Number of commands logged in status

Definition at line 143 of file main.c.

#define NUM_SPCK_CONFIGURATIONS 4

Number of SPI clock configurations

Definition at line 145 of file main.c.

#define RC_RDY 0x12345678

Ready status

Definition at line 141 of file main.c.

#define RC_SYN 0x55AA55AA

General return value

Definition at line 139 of file main.c.

#define SLAVE_STATE_IDLE 0

SPI slave states for this example

Definition at line 122 of file main.c.

#define SPI_MASTER_BASE SPI

SPI base address for SPI master mode

Definition at line 117 of file main.c.

#define SPI_SLAVE_BASE SPI

SPI base address for SPI slave mode, (on different board)

Definition at line 119 of file main.c.

## Function Documentation

int main | ( | void | ) |

Application entry point for spi_slave example.

Returns:
  Unused (ANSI-C compatibility).

Definition at line 572 of file main.c.

Here is the call graph for this function:

void SPI_IrqHandler | ( | void | ) |

Interrupt handler for the SPI slave.

Default interrupt handler for SPI.

Definition at line 325 of file main.c.

Here is the call graph for this function:
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines