#ifndef _MISC_H
#define _MISC_H

#include <stdint.h>
 


typedef union
{
    struct{
        unsigned genOn          :1;
        unsigned genReady       :1;
        unsigned voltage12Good  :1;
        unsigned accData        :1;
        unsigned opAck          :1;
        unsigned overCurrent    :1;
        unsigned overHeat       :1;
        unsigned                :1;
    };
    uint8_t rawData;
}GEN_STATUS;


void DelayReset(uint16_t *DelayCounter);
bool HasDelayElapsed(uint16_t Delay,uint16_t *DelayCounter);
void GEN_UpdateStatus(void);
void GEN_NotReady(void);
void GEN_Ready(void);
void GEN_OpAck(void);
void GEN_OpNack(void);
void GEN_OverheatClear(void);
void GEN_OverCurrentSet(void);
void GEN_OverCurrentClear(void);
void GEN_OverheatSet(void);
uint8_t GEN_GetStatusByte( void);
uint8_t GEN_GetTemp(void);
void SPI2_CallbackTemp(uint8_t temp);

#endif