lib_ringfs_ram.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. #if USE_LIB_RINGFS_RAM==1
  9. #ifndef LIB_RINGFS_RAM_H
  10. #define LIB_RINGFS_RAM_H
  11. #include <stdint.h>
  12. //#include <unistd.h>
  13. struct rfs_dev_ram;
  14. extern struct rfs_dev_ram *ramHandle;
  15. extern struct ringfs_flash_partition rfs_disk_ram;
  16. void init_flash_driver_ram(void);
  17. struct rfs_dev_ram *rfs_dev_ram_open(const char *name, int size, int sector_size);
  18. void rfs_dev_ram_close(struct rfs_dev_ram *sim);
  19. void rfs_dev_ram_sector_erase(struct rfs_dev_ram *sim, int addr);
  20. void rfs_dev_ram_read(struct rfs_dev_ram *sim, int addr, uint8_t *buf, int len);
  21. void rfs_dev_ram_program(struct rfs_dev_ram *sim, int addr, const uint8_t *buf, int len);
  22. #endif //---------------------LIB_RINGFS_RAM_H-------------------------//
  23. #endif //----------------------USE_LIB_RINGFS_RAM==1-----------------------//
  24. /* vim: set ts=4 sw=4 et: */