-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst25v16.h
58 lines (38 loc) · 1.42 KB
/
sst25v16.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
#ifndef __SST25V16_H__
#define __SST25V16_H__
#include "rtdevice.h"
#include "rtthread.h"
#include "spibus.h"
/* hardware platform -------------------------*/
//#define USE_WILDFIRE_TEST //use wild fire hardware platform
/* device name -------------------------*/
#define SPI2_CS1_NAME1 ("sst25")
#define SPI2_BUS_NAME ("spi2bus")
#define FLASH1_DEVICE_NAME ("flash1")
#ifdef USE_WILDFIRE_TEST
/* hardware define pin port clock -------------*/
#define SPI2_SCK_PIN GPIO_Pin_5
#define SPI2_MISO_PIN GPIO_Pin_6
#define SPI2_MOSI_PIN GPIO_Pin_7
#define SPI2_GPIO_PORT GPIOA
#define SPI2_CLOCK RCC_APB2Periph_SPI1
#define SPI2_CS1_PIN GPIO_Pin_4
#define SPI2_CS1_PORT GPIOA
#define SPI2_CS1_CLOCK RCC_APB2Periph_GPIOA
#define GPIO_RCC RCC_APB2Periph_GPIOA
#define SPI_PORT SPI1
#else
/* hardware define pin port clock -------------*/
#define SPI2_SCK_PIN GPIO_Pin_13
#define SPI2_MISO_PIN GPIO_Pin_14
#define SPI2_MOSI_PIN GPIO_Pin_15
#define SPI2_GPIO_PORT GPIOB
#define SPI2_CLOCK RCC_APB1Periph_SPI2
#define SPI2_CS1_PIN GPIO_Pin_12
#define SPI2_CS1_PORT GPIOB
#define SPI2_CS1_CLOCK RCC_APB2Periph_GPIOB
#define GPIO_RCC RCC_APB2Periph_GPIOB
#define SPI_PORT SPI2
#endif
void rt_hw_spi_flash_init(void);
#endif