/* 
 * File:   types.h
 * Author: hamilton
 *
 * Created on July 19, 2015, 11:21 AM
 */

#ifndef TYPES_H
#define	TYPES_H

struct StatusBits {
    unsigned int Balancing : 5;   // Indicates number of batteries that are shunting power
    unsigned int StopCharge : 5;  // Indicates number of batteries requesting stop-charge
    unsigned int PowerSupply : 1;  //Indicates state of 24V load switch. 0 = off, 1 = on
    unsigned int Bender : 2;      // Indicates state of Bender operation.  0 = off, 1 = on, 2 = auto (cycling)
    unsigned int BenderRequest : 2;   //Indicates the Bender State request, changed only by CAN rcvd interrupt except for initialization.
    unsigned int BenderSwitchStatus : 1;  //Indicates a fault with the bender power switch
};

typedef  union
{
    unsigned int status;
    struct StatusBits bits;
}  STATUS;


#endif	/* TYPES_H */

