Hi,
I was able to create a device driver support for a DAC, model TI DAC80501Z.
In the first place I put the driver in zephyr/drivers/sensors.
I works fine.
Then I made some effort to move the driver in zephyr/drivers/dac, which seems more appropriate for a DAC.
When the driver reads the I2C peripheral, Zephyr complains the TWIM driver is not initialized:
ASSERTION FAIL [p_cb->state == NRFX_DRV_STATE_INITIALIZED] @ WEST_TOPDIR/modules/hal/nordic/nrfx/drivers/src/nrfx_twim.c:326<CR><LF>
E: r0/a1: 0x00000004 r1/a2: 0x00000146 r2/a3: 0x00000040<CR><LF>
E: r3/a4: 0x00013a15 r12/ip: 0x00000000 r14/lr: 0x0000b7d7<CR><LF>
E: xpsr: 0x69000000<CR><LF>
E: Faulting instruction address (r15/pc): 0x0000fb4a<CR><LF>
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0<CR><LF>
E: Current thread: 0x20001050 (unknown)<CR><LF>
E: Resetting system<CR><LF>
I don't know why.
In the .config file I already have
CONFIG_NRFX_TWIM=y
CONFIG_NRFX_TWIM1=y
Thanks
Gabriele