-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsst25.h
64 lines (55 loc) · 1.69 KB
/
sst25.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
/**
* @file sst25.h
* @brief FLASH25 SST25 driver
* @author Vladimir Ermakov Copyright (C) 2014.
*/
/*
* chibios-flash
* Copyright (c) 2014, Vlidimir Ermakov, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
#ifndef SST25_H
#define SST25_H
#include "flash-mtd.h"
#define _sst25_driver_data \
_base_mtd_driver_data \
uint32_t jdec_id;
typedef struct {
SPIDriver *spip;
const SPIConfig *spicfg;
} SST25Config;
typedef struct {
const struct BaseMTDDriverVMT *vmt;
_sst25_driver_data
const SST25Config *config;
} SST25Driver;
struct sst25_partition {
SST25Driver *partp;
struct mtd_partition definition;
};
#define sst25GetJdecID(flp) ((flp)->jdec_id)
#ifdef __cplusplus
extern "C" {
#endif
void sst25Init(void);
void sst25ObjectInit(SST25Driver *flp);
void sst25Start(SST25Driver *flp, const SST25Config *config);
void sst25Stop(SST25Driver *flp);
void sst25InitPartition(SST25Driver *flp, SST25Driver *part_flp, const struct mtd_partition *part_def);
void sst25InitPartitionTable(SST25Driver *flp, const struct sst25_partition *part_defs);
#ifdef __cplusplus
}
#endif
#endif /* SST25_H */