#ifndef DI_DRV_HL854X_ERROR_H_ #define DI_DRV_HL854X_ERROR_H_ #ifdef __cplusplus extern "C" { #endif /** * Errors */ enum di_drv_hl854x_error { HL854X_ERROR_UNKNOWN = 0, HL854X_ERROR_CME, /**< CME Error (ctx.cme_error field is set) */ HL854X_ERROR_KTCP_NOTIF, /**< KTCP_NOTIF Error (ctx.ktcp_notif field is set) */ HL854X_ERROR_DATA_OVERRUN, /**< Serial port data overrun error */ HL854X_ERROR_FRAMING_ERROR, /**< Serial port framing error */ HL854X_ERROR_PARITY_ERROR, /**< Serial port data parity error */ HL854X_ERROR_REPLY_TIMEOUT /**< Command reply timeout */ }; /** * Error callback * @param ctx Configuration context * @param offset Write offset in bytes * @param data Address of data to write * @param size Size of data in bytes */ typedef void (*di_drv_hl854x_error_cb_t)(struct di_drv_hl854x_ctx *ctx); void di_drv_hl854x_error_set(struct di_drv_hl854x_ctx *ctx, enum di_drv_hl854x_error error); void di_drv_hl854x_error_reset(struct di_drv_hl854x_ctx *ctx); /** * Set application specific Error callback */ void di_drv_hl854x_error_set_callback(struct di_drv_hl854x_ctx *ctx, di_drv_hl854x_error_cb_t cb); #ifdef __cplusplus } #endif #endif /* DI_DRV_HL854X_ERROR_H_ */