summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/dev/spi_cfg.h
blob: 6a5d7b470ad327efd627621a84d2b7244d8fba41 (plain)
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
#include <stdint.h>

#define EOS_SPI_MAX_DEV         5

typedef struct {
    uint16_t div;
    int8_t csid;
    int8_t cspin;
    uint8_t flags;
    unsigned char evt;
} SPIConfig;

#define SPI_DEV_FLAG_9BIT       0x1
#define SPI_DEV_FLAG_CSFLOAT    0x2

static const SPIConfig spi_cfg[EOS_SPI_MAX_DEV] = {
    {   // DEV_NET
        .div = SPI_DIV_NET,
        .csid = SPI_CSID_NET,
        .cspin = SPI_CSPIN_NET,
        .flags = 0,
        .evt = 0,   // Not SPI event
    },
    {   // DEV_EVE
        .div = SPI_DIV_EVE,
        .csid = SPI_CSID_EVE,
        .cspin = SPI_CSPIN_EVE,
        .flags = 0,
        .evt = 0,
    },
    {   // DEV_SDC
        .div = SPI_DIV_SDC,
        .csid = SPI_CSID_SDC,
        .cspin = SPI_CSPIN_SDC,
        .flags = 0,
        .evt = EOS_SPI_EVT_SDC,
    },
    {   // DEV_CAM
        .div = SPI_DIV_CAM,
        .csid = SPI_CSID_CAM,
        .cspin = SPI_CSPIN_CAM,
        .flags = 0,
        .evt = EOS_SPI_EVT_CAM,
    },
    {   // DEV_LCD 9bit spi
        .div = 0,
        .csid = -1,
        .cspin = SPI_CSPIN_LCD,
        .flags = SPI_DEV_FLAG_9BIT | SPI_DEV_FLAG_CSFLOAT,
        .evt = 0,
    },
};