Contiki 2.5
sam7s-spi.h
1 #ifndef __CORE_SPI_H__KBMMOKI6CG__
2 #define __CORE_SPI_H__KBMMOKI6CG__
3 #include <stdint.h>
4 
5 void
6 spi_init();
7 
8 #define SPI_POLARITY_INACTIVE_HIGH 1
9 #define SPI_POLARITY_INACTIVE_LOW 1
10 
11 #define SPI_PHASE_CHANGE_CAPTURE 0
12 #define SPI_PHASE_CAPTURE_CHANGE 1
13 
14 struct spi_block {
15  const uint8_t *send; /* NULL for receive only */
16  uint8_t *receive; /* NULL for send only */
17  uint16_t len; /* transfer length, non-zero */
18 };
19 
20 void
21 spi_transfer(unsigned int chip, const struct spi_block *block, unsigned int blocks);
22 
23 void
24 spi_init_chip_select(unsigned int chip, unsigned int speed,
25  unsigned int dlybct,
26  unsigned int dlybs, unsigned int phase,
27  unsigned int polarity);
28 
29 #endif /* __CORE_SPI_H__KBMMOKI6CG__ */