/* Searches through the list of registers of the driver instance and retrieves a pointer to the register that matches the given address.  */
ad717x_st_reg* AD717X_GetReg(ad717x_dev *device, uint8_t reg_address)
/* Searches through the list of registers of the driver instance and retrieves a pointer to the register that matches the given address.  */
ad717x_st_reg* AD717X_GetReg(ad717x_dev *device, uint8_t reg_address)
{
        uint8_t i;
        ad717x_st_reg *reg = 0;
        if (!device || !device->regs)
                return 0;
        for (i = 0; i < device->num_regs; i++) {
                if (device->regs[i].addr == reg_address) {
                        reg = &device->regs[i];
                        break;
                }
        }
        return reg;
}