2014-08-01 10:57:39 +02:00
|
|
|
/**
|
2013-11-27 17:54:30 +01:00
|
|
|
* @defgroup flashrom Flash memory driver
|
|
|
|
* @ingroup drivers
|
|
|
|
* @brief Generic flash memory driver
|
|
|
|
* @{
|
|
|
|
*
|
2014-08-01 10:57:39 +02:00
|
|
|
* @file
|
2013-11-27 17:54:30 +01:00
|
|
|
*
|
2014-08-01 10:57:39 +02:00
|
|
|
* @brief Generic flash memory driver
|
2013-11-27 17:54:30 +01:00
|
|
|
* @author unknown
|
2013-11-27 16:28:31 +01:00
|
|
|
*/
|
|
|
|
|
2010-12-03 22:22:58 +01:00
|
|
|
#ifndef FLASHROM_H
|
2013-06-21 22:36:48 +02:00
|
|
|
#define FLASHROM_H
|
2010-12-03 22:22:58 +01:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-08-01 10:57:39 +02:00
|
|
|
/**
|
2010-12-03 22:22:58 +01:00
|
|
|
* @brief Erase sector
|
|
|
|
*
|
2014-08-01 10:57:39 +02:00
|
|
|
* @param[out] addr Address within a flash sector to erase
|
2010-12-03 22:22:58 +01:00
|
|
|
*
|
|
|
|
* @return 1 on success, 0 otherwise
|
|
|
|
*/
|
2013-11-27 17:54:30 +01:00
|
|
|
uint8_t flashrom_erase(uint8_t *addr);
|
2010-12-03 22:22:58 +01:00
|
|
|
|
2014-08-01 10:57:39 +02:00
|
|
|
/**
|
|
|
|
* @brief Write buffer from ram to flash
|
2010-12-03 22:22:58 +01:00
|
|
|
*
|
2014-08-01 10:57:39 +02:00
|
|
|
* @param[out] dst Address within a flash sector to write, must be a 256 byte boundary
|
|
|
|
* @param[in] src Address within ram, must be a word boundary
|
|
|
|
* @param[in] size Bytes to write
|
2010-12-03 22:22:58 +01:00
|
|
|
*
|
|
|
|
* @return 1 on success, 0 otherwise
|
|
|
|
*/
|
2014-06-25 20:50:43 +02:00
|
|
|
uint8_t flashrom_write(uint8_t *dst, const uint8_t *src, size_t size);
|
2010-12-03 22:22:58 +01:00
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-12-03 22:22:58 +01:00
|
|
|
#endif /* FLASHROM_H */
|
2014-08-01 10:57:39 +02:00
|
|
|
/** @} */
|