// ----------------------------------------------------------------------------------------
//
//  avr/can/can_messages.h
//    
//  Bob Cook Development, Robotics Library
//  http://www.bobcookdev.com/rl/
//    
//  This file provides various definitions for a Controller Area Network driver.
//
//  Copyright (C) 2007 Bob Cook
//
//      This program is free software; you can redistribute it and/or modify it
//      under the terms of the GNU General Public License as published by the
//      Free Software Foundation; either version 2 of the License, or (at your
//      option) any later version.
//    
//      This program is distributed in the hope that it will be useful, but 
//      WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
//      or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
//      for more details.
//    
//      You should have received a copy of the GNU General Public License along
//      with this program; if not, write to the Free Software Foundation, Inc., 
//      51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//
// ----------------------------------------------------------------------------------------


#if !defined( BCDRL_AVR_CAN_CAN_MESSAGES_H )
#define BCDRL_AVR_CAN_CAN_MESSAGES_H


#include <inttypes.h>

#include "packages/common/util/fixedpoint.h"


// ----------------------------------------------------------------------------------------
//  debug_out
//

const uint8_t can_datatype_debug_out = 0x0001;


// ----------------------------------------------------------------------------------------
//  stdio
//

const uint8_t can_datatype_stdio = 0x0004;


// ----------------------------------------------------------------------------------------
//  utc_timestamp
//

const uint8_t can_datatype_utc_timestamp = 0x0005;

typedef struct
{
    uint8_t packed_time[ 6 ];

} can_msgdata_utc_timestamp;


// ----------------------------------------------------------------------------------------
//  latitude
//

const uint8_t can_datatype_latitude = 0x0006;

typedef struct
{
    int16_t      degrees;
    fixed16dot16 minutes;

} can_msgdata_latitude;


// ----------------------------------------------------------------------------------------
//  longitude
//

const uint8_t can_datatype_longitude = 0x0007;

typedef struct
{
    int16_t      degrees;
    fixed16dot16 minutes;

} can_msgdata_longitude;


// ----------------------------------------------------------------------------------------
//  heatbeat
//

const uint8_t  can_datatype_heatbeat = 0x0010;
const uint32_t can_heatbeat_data     = 0x54414542;


#endif  // #if !defined( BCDRL_AVR_CAN_CAN_MESSAGES_H )
// ----------------------------------------------------------------------------------------
//  end of can_messages.h
// ----------------------------------------------------------------------------------------

