flashsim.h 848 B

123456789101112131415161718192021222324252627
  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. #ifndef FLASHSIM_H
  9. #define FLASHSIM_H
  10. #include <stdint.h>
  11. #include <unistd.h>
  12. struct flashsim;
  13. struct flashsim *flashsim_open(const char *name, int size, int sector_size);
  14. void flashsim_close(struct flashsim *sim);
  15. void flashsim_sector_erase(struct flashsim *sim, int addr);
  16. void flashsim_read(struct flashsim *sim, int addr, uint8_t *buf, int len);
  17. void flashsim_program(struct flashsim *sim, int addr, const uint8_t *buf, int len);
  18. #endif
  19. /* vim: set ts=4 sw=4 et: */