Out-of-office display, GFX
 All Classes Files Functions Variables Enumerations Enumerator Groups
sst39FlashDriver.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Andreas Misje
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
25 #ifndef _SST39FLASHDRIVER_H
26 #define _SST39FLASHDRIVER_H
27 
28 #include <stdint.h>
29 #include <stddef.h>
30 
36 #define SST_EPMP_CS_BASE_ADDRESS GFX_EPMP_CS2_BASE_ADDRESS
37 
45 #define SST_FLASH_SIZE 0x40000
46 
50 #define SST_ENABLE_STDOUT_ERRORS
51 
66 int sst39_writeWord( uint32_t address, uint16_t data );
67 
82 int sst39_writeBytes( uint32_t address, const uint8_t *data, size_t len );
83 
95 uint16_t sst39_readWord( uint32_t address );
96 
108 void sst39_readBytes( uint32_t address, uint8_t *buffer, size_t bufferLen );
109 
121 void sst39_readBytesBlocking( uint32_t address, uint8_t *buffer,
122  size_t bufferLen );
123 
127 void sst39_eraseChip();
128 
134 void sst39_eraseSector( uint32_t address );
135 
142 int sst39_size();
143 
147 int sst39_test();
148 
149 #endif // _SST39FLASHDRIVER_H
150