aboutsummaryrefslogtreecommitdiff
path: root/hal_io_eim.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-10-04 15:39:08 -0400
committerRob Austein <sra@hactrn.net>2015-10-04 15:39:08 -0400
commite164eecc55dd96efc98d2c723e96aaaecdcfda13 (patch)
treee7f9b5b5c82c893ac92a76417bab22af51206fa7 /hal_io_eim.c
parent60cce0124f2fc3eddca03ed3950da9238247a612 (diff)
off_t => hal_addr_t.
Diffstat (limited to 'hal_io_eim.c')
-rw-r--r--hal_io_eim.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/hal_io_eim.c b/hal_io_eim.c
index 3687b95..c0f70f4 100644
--- a/hal_io_eim.c
+++ b/hal_io_eim.c
@@ -72,7 +72,7 @@ static hal_error_t init(void)
*
* sss ccccc rrrrrrrr => 00001000000000 sss 0 ccccc rrrrrrrr 00
*/
-static off_t eim_offset(off_t offset)
+static hal_addr_t eim_offset(hal_addr_t offset)
{
return EIM_BASE_ADDR + ((offset & ~0x1fff) << 3) + ((offset & 0x1fff) << 2);
}
@@ -93,7 +93,7 @@ static void dump(char *label, const uint8_t *buf, size_t len)
}
}
-hal_error_t hal_io_write(off_t offset, const uint8_t *buf, size_t len)
+hal_error_t hal_io_write(hal_addr_t offset, const uint8_t *buf, size_t len)
{
hal_error_t err;
@@ -115,7 +115,7 @@ hal_error_t hal_io_write(off_t offset, const uint8_t *buf, size_t len)
return HAL_OK;
}
-hal_error_t hal_io_read(off_t offset, uint8_t *buf, size_t len)
+hal_error_t hal_io_read(hal_addr_t offset, uint8_t *buf, size_t len)
{
uint8_t *rbuf = buf;
int rlen = len;
@@ -139,7 +139,7 @@ hal_error_t hal_io_read(off_t offset, uint8_t *buf, size_t len)
return HAL_OK;
}
-hal_error_t hal_io_expected(off_t offset, const uint8_t *expected, size_t len)
+hal_error_t hal_io_expected(hal_addr_t offset, const uint8_t *expected, size_t len)
{
hal_error_t err;
uint8_t buf[4];
@@ -160,19 +160,19 @@ hal_error_t hal_io_expected(off_t offset, const uint8_t *expected, size_t len)
return HAL_OK;
}
-hal_error_t hal_io_init(off_t offset)
+hal_error_t hal_io_init(hal_addr_t offset)
{
uint8_t buf[4] = { 0, 0, 0, CTRL_INIT };
return hal_io_write(offset, buf, sizeof(buf));
}
-hal_error_t hal_io_next(off_t offset)
+hal_error_t hal_io_next(hal_addr_t offset)
{
uint8_t buf[4] = { 0, 0, 0, CTRL_NEXT };
return hal_io_write(offset, buf, sizeof(buf));
}
-hal_error_t hal_io_wait(off_t offset, uint8_t status, int *count)
+hal_error_t hal_io_wait(hal_addr_t offset, uint8_t status, int *count)
{
hal_error_t err;
uint8_t buf[4];
@@ -194,13 +194,13 @@ hal_error_t hal_io_wait(off_t offset, uint8_t status, int *count)
}
}
-hal_error_t hal_io_wait_ready(off_t offset)
+hal_error_t hal_io_wait_ready(hal_addr_t offset)
{
int limit = EIM_IO_TIMEOUT;
return hal_io_wait(offset, STATUS_READY, &limit);
}
-hal_error_t hal_io_wait_valid(off_t offset)
+hal_error_t hal_io_wait_valid(hal_addr_t offset)
{
int limit = EIM_IO_TIMEOUT;
return hal_io_wait(offset, STATUS_VALID, &limit);