ringfs
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
flashsim.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Kosma Moczek <kosma@cloudyourcar.com>
3  * This program is free software. It comes without any warranty, to the extent
4  * permitted by applicable law. You can redistribute it and/or modify it under
5  * the terms of the Do What The Fuck You Want To Public License, Version 2, as
6  * published by Sam Hocevar. See the COPYING file for more details.
7  */
8 
9 #ifndef FLASHSIM_H
10 #define FLASHSIM_H
11 
12 #include <stdint.h>
13 #include <unistd.h>
14 
15 struct flashsim;
16 
17 struct flashsim *flashsim_open(const char *name, int size, int sector_size);
18 void flashsim_close(struct flashsim *sim);
19 
20 void flashsim_sector_erase(struct flashsim *sim, int addr);
21 void flashsim_read(struct flashsim *sim, int addr, uint8_t *buf, int len);
22 void flashsim_program(struct flashsim *sim, int addr, const uint8_t *buf, int len);
23 
24 #endif
25 
26 /* vim: set ts=4 sw=4 et: */
void flashsim_read(struct flashsim *sim, int addr, uint8_t *buf, int len)
Definition: flashsim.c:70
struct flashsim * flashsim_open(const char *name, int size, int sector_size)
Definition: flashsim.c:36
void flashsim_close(struct flashsim *sim)
Definition: flashsim.c:49
static END_TEST struct flashsim * sim
Definition: tests.c:61
void flashsim_program(struct flashsim *sim, int addr, const uint8_t *buf, int len)
Definition: flashsim.c:86
int size
Definition: flashsim.c:30
int sector_size
Definition: flashsim.c:31
void flashsim_sector_erase(struct flashsim *sim, int addr)
Definition: flashsim.c:55