#include "secbus.h"

static volatile uint32_t *_secbus_addr;

void __secbus_init(uint32_t *addr)
{
    _secbus_addr = (volatile uint32_t*)addr;
}

int __secbus_read(int register_index, uint32_t *buffer)
{
    //if (register_index < 6) return -1;

    *buffer = _secbus_addr[register_index];
    return 0;
}
int __secbus_write(int register_index, uint32_t value)
{
    //if (register_index > 5) return -1;

    _secbus_addr[register_index] = value;
    return 0;
}
