Files
motor/Common/spi/RAMTRON.h
T
2024-09-26 22:32:20 +08:00

36 lines
597 B
C

#ifndef __RAMTRON_H__
#define __RAMTRON_H__
#include "SPIDevice.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct AP_RAMTRON {
SPI_DEV_t *dev;
uint8_t id;
} RAMTRON;
// initialise the driver
int RAMTRON_init(RAMTRON* fram, SPI_DEV_t *dev);
// get size in bytes
uint32_t RAMTRON_size(RAMTRON* fram);
// read from device
bool RAMTRON_read(RAMTRON* fram, uint32_t offset, uint8_t *buf, uint32_t size);
// write to device
bool RAMTRON_write(RAMTRON* fram, uint32_t offset, uint8_t *buf, uint32_t size);
#ifdef __cplusplus
}
#endif
#endif /* __RAMTRON_H__ */