#include "drv8316.h"
#include <assert.h>
#include <stdio.h>
static bool awake=true, off=true;
static bool transfer(void *ctx,uint16_t tx,uint16_t *rx) {
 (void)ctx;
 unsigned a=(tx>>9)&63u;
 assert(a<3);
 *rx=(uint16_t)(0x0800u|(a==0?0x08u:0u)); /* TI IC_STAT NPOR=1; other bits zero */
 return true;
}
static void setoff(void *ctx,bool b) {(void)ctx;off=b;}
static void setawake(void *ctx,bool b) {(void)ctx;awake=b;}
static void delay(void *ctx,uint32_t u) {(void)ctx;(void)u;}
int main(void) {
 drv8316_hal h={NULL,transfer,setoff,setawake,delay};
 drv8316_report r={.configured=true};
 assert(drv8316_poll_faults(&h,&r)==DRV_OK);
 assert(r.configured && off && awake && r.status[0]==8 && r.last_header==8);
 puts("PASS: healthy NPOR=1 header and IC_STAT accepted by actual poll function.");
}
