#ifndef PCA9956B_ASYNC_BANK_H
#define PCA9956B_ASYNC_BANK_H
#include "pca9956b_fault_monitor.h"
typedef struct {
 bool (*begin)(void *,uint8_t,uint8_t,uint32_t);
 void (*poll)(void *,uint32_t);
 bool (*take)(void *,uint32_t,uint8_t *);
 bool (*failed)(void *);
 void (*cancel)(void *);
} pca_async_ops;
typedef struct {pca_fault_snapshot chip[3];uint32_t first_read_ms,completed_ms,sequence;} pca_async_snapshot;
typedef struct {
 void *ctx;pca_async_ops ops;
 uint32_t eligible[3],first[3],completed[3],first_read,last_poll,request_started,sequence;
 uint8_t raw[3][8],reads;
 bool bound,pending,failed,valid;
 pca_async_snapshot snapshot;
} pca_async_bank;
/* One exclusive, nonblocking transport owner; callback false means pending
 * unless failed reports true. No register writes, output enable or health grant.
 * Eligible masks must describe independently qualified powered loads. */
bool pca_async_init(pca_async_bank *,void *,pca_async_ops,const uint32_t eligible[3],uint32_t now);
void pca_async_poll(pca_async_bank *,uint32_t now);
bool pca_async_get(const pca_async_bank *,uint32_t now,pca_async_snapshot *);
#endif
