-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi_conf.h
79 lines (68 loc) · 1.66 KB
/
spi_conf.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* spi_conf.h
*
* Created on: Mar 28, 2020
* Author: Luczia
*/
#ifndef SPI_CONF_H_
#define SPI_CONF_H_
#define PORT_SPI1_CS GPIOA
#define PIN_SPI1_CS 4
#define PORT_SPI1_SCK GPIOA
#define PIN_SPI1_SCK 5
#define PORT_SPI1_MISO GPIOA
#define PIN_SPI1_MISO 6
#define PORT_SPI1_MOSI GPIOA
#define PIN_SPI1_MOSI 7
#define PORT_SPI2_CS GPIOB
#define PIN_SPI2_CS 12
#define PORT_SPI2_SCK GPIOB
#define PIN_SPI2_SCK 13
#define PORT_SPI2_MISO GPIOB
#define PIN_SPI2_MISO 14
#define PORT_SPI2_MOSI GPIOB
#define PIN_SPI2_MOSI 15
/*Low speed SPI configuration (164.125kHz, CPHA=0, CPOL=0, MSb first).
*/
static const SPIConfig ls_spicfg = {
false,
NULL,
PORT_SPI1_CS, //activate if SPI_SELECT_MODE == SPI_SELECT_MODE_PAD in chconf.h
PIN_SPI1_CS,
SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0,
0
};
/*
* Custom speed SPI configuration (1.3MHz, CPHA=0, CPOL=0, MSb first).
*/
static const SPIConfig cs_spicfg = {
false,
NULL,
PORT_SPI1_CS,
PIN_SPI1_CS,
SPI_CR1_BR_2 , // | SPI_CR1_CPOL, //mask definition in C:\ChibiStudio\chibios_trunk\os\common\ext\ST\STM32F4xx\stm32f401xe.h
0
};
/*
* Custom speed SPI configuration (656kHz, CPHA=0, CPOL=0, MSb first).
*/
static const SPIConfig cs_spicfg1 = {
false,
NULL,
PORT_SPI1_CS,
PIN_SPI1_CS,
SPI_CR1_BR_2 | SPI_CR1_BR_0, // | SPI_CR1_CPOL, //mask definition in C:\ChibiStudio\chibios_trunk\os\common\ext\ST\STM32F4xx\stm32f401xe.h
0
};
/*
* Maximum speed SPI configuration (42MHz, CPHA=0, CPOL=0, MSb first).
*/ //Fonctionne avec SPI_SELECT_MODE_NONE
static const SPIConfig hs_spicfg = {
false,
NULL,
PORT_SPI1_CS,
PIN_SPI1_CS,
0,
0
};
#endif /* SPI_CONF_H_ */