//*****************************************************************************
//
// Common.h - Common project varibles, structures and methods definitions
//         and prototypes 
//
//*****************************************************************************

#ifndef __Common_H__
#define __Common_H__


//*****************************************************************************
//
// Includes
//
//*****************************************************************************
#include <hw_memmap.h>
#include <hw_types.h>
#include <hw_ints.h>
#include <hw_gpio.h>
#include <hw_ints.h>
#include <hw_sysctl.h>
#include <sysctl.h>
#include <systick.h>
#include <gpio.h>
#include <debug.h>
#include <interrupt.h>

  
//#include <lm3s2276.h>

//*****************************************************************************
//
// Flags 
//
//*****************************************************************************
// Set of system flags
typedef union
{
  struct
  {
    // System messages
    unsigned char clock_error      	: 1;    // 1 = Clock operation fails    
    unsigned char uart_message_unknown	: 1;    // 1 = Received UART message unknown     
  } flag;
  unsigned char all_flags;            // Shortcut to all display flags (for reset)
} s_system_flags;
extern volatile s_system_flags sys;
  
// Set of request flags
typedef union
{
  struct
  {
    // Request messages
    unsigned char uart_message_received	: 1;            // 1 = Received UART message   
    unsigned char can_message_status_req_received : 1;  // 1 = Received CAN message   
    unsigned char can_message_reset_req_received : 1;   // 1 = Received CAN message   
    unsigned char can_message_settings_received : 1;    // 1 = Received CAN message   
    unsigned char can_message_data_send : 1;            // 1 = CAN data message send request  
    unsigned char can_message_status_send : 1;          // 1 = CAN status message send request
  } flag;
  unsigned char all_flags;            // Shortcut to all display flags (for reset)
} s_request_flags;
extern volatile s_request_flags request;
  
//*****************************************************************************
//
// Function Prototypes
//
//*****************************************************************************

  


#endif // __Common_H__
