-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi.h
65 lines (58 loc) · 1.19 KB
/
spi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
// types definition
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "sdkconfig.h"
#if CONFIG_MINI_PRODUCT == 3
// BnW powerstep01 SPI pins
// CLK - GPIO14
# define PIN_CLK 14
// MOSI - GPIO 13
# define PIN_MOSI 13
// MISO - GPIO
# define PIN_MISO -1
// RESET - unused
# define PIN_RESET -1
// CS - GPIO 32
# define PIN_CS 32
#elif CONFIG_MINI_PRODUCT == 4
// BeerPULL ePaper display pins
// CLK - GPIO14
# define PIN_CLK 14
// MOSI - GPIO 13
# define PIN_MOSI 12
// MISO - GPIO
# define PIN_MISO -1
// RESET - unused
# define PIN_RESET -1
// CS - GPIO 32
# define PIN_CS 8
#elif CONFIG_MINI_PRODUCT == 2
// IOLink SPI pins
// CLK - GPIO14
# define PIN_CLK 14
// MOSI - GPIO 13
# define PIN_MOSI 13
// MISO - GPIO
# define PIN_MISO 12
// RESET - unused
# define PIN_RESET -1
// CS - GPIO 32
# define PIN_CS -1
#else
// DEFAUT
// CLK - GPIO14
# define PIN_CLK -1
// MOSI - GPIO 13
# define PIN_MOSI -1
// MISO - GPIO
# define PIN_MISO -1
// RESET - unused
# define PIN_RESET -1
// CS - GPIO 32
# define PIN_CS -1
#endif
uint8_t spi_xferbyte( uint8_t byte );
void spi_xfer( uint8_t cmd, uint8_t * data, size_t len) ;
void spi_init( void );