diff --git a/tools/include/atrf.h b/tools/include/atrf.h index 2c768d0..e9ef2e6 100644 --- a/tools/include/atrf.h +++ b/tools/include/atrf.h @@ -52,6 +52,9 @@ uint8_t atrf_reg_read(struct atrf_dsc *dsc, uint8_t reg); void atrf_buf_write(struct atrf_dsc *dsc, const void *buf, int size); int atrf_buf_read(struct atrf_dsc *dsc, void *buf, int size); +void atrf_sram_write(struct atrf_dsc *dsc, uint8_t addr, uint8_t value); +uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr); + int atrf_interrupt(struct atrf_dsc *dsc); #endif /* !ATRF_H */ diff --git a/tools/lib/atrf.c b/tools/lib/atrf.c index 682d2f9..306ab53 100644 --- a/tools/lib/atrf.c +++ b/tools/lib/atrf.c @@ -305,6 +305,18 @@ int atrf_buf_read(struct atrf_dsc *dsc, void *buf, int size) } +void atrf_sram_write(struct atrf_dsc *dsc, uint8_t addr, uint8_t value) +{ + dsc->driver->sram_write(dsc->handle, addr, value); +} + + +uint8_t atrf_sram_read(struct atrf_dsc *dsc, uint8_t addr) +{ + return dsc->driver->sram_read(dsc->handle, addr); +} + + int atrf_interrupt(struct atrf_dsc *dsc) { return diff --git a/tools/lib/driver.h b/tools/lib/driver.h index 40a1d6a..55e8fa2 100644 --- a/tools/lib/driver.h +++ b/tools/lib/driver.h @@ -33,6 +33,8 @@ struct atrf_driver { uint8_t (*reg_read)(void *dsc, uint8_t reg); void (*buf_write)(void *dsc, const void *buf, int size); int (*buf_read)(void *dsc, void *buf, int size); + void (*sram_write)(void *dsc, uint8_t addr, uint8_t value); + uint8_t (*sram_read)(void *dsc, uint8_t addr); int (*interrupt)(void *dsc); };