// ----------------------------------------------------------------------------------------
//
//  avr/redir/redir.h
//    
//  Bob Cook Development, Robotics Library
//  http://www.bobcookdev.com/rl/
//    
//  This file provides redirection support for the C library standard input/output.
//
//  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_REDIR_REDIR_H )
#define BCDRL_AVR_REDIR_REDIR_H


#include <stdint.h>


// ----------------------------------------------------------------------------------------
//  definitions from "project_defs.h"
//
//  define only one (or none) of the following:
//
//      PRJ_REDIR_VIA_UART0
//      PRJ_REDIR_VIA_UART1
//      PRJ_REDIR_VIA_MCP2515_CAN
//
//  for any option, optionally define these values:
//
//      PRJ_REDIR_CALLER_WILL_INIT_TRANSPORT_PKG
//      PRJ_REDIR_OUTPUT_DO_AUTO_CRLF
//
//  for the UART options, optionally define these values:
//
//      PRJ_REDIR_UART_BAUDRATE <int>
//      PRJ_REDIR_INPUT_BLOCKING_GETCHAR
//
//  for the CAN options, define these required values:
//
//      PRJ_REDIR_CAN_PUTCHAR_NODE
//      PRJ_REDIR_CAN_THIS_NODE
//
//  for the CAN options, optionally define these values:
//
//      PRJ_REDIR_CAN_BUFFER_SIZE <int>
//
// ----------------------------------------------------------------------------------------


// ----------------------------------------------------------------------------------------
//  redir_initialize
//
//      Initialize the STDIO handlers according to the project_defs.h specification.
//

void redir_initialize();


// ----------------------------------------------------------------------------------------
//  redir_recv_can_stdio
//
//      Process the reception of a CAN message id: can_msgid_stdio.
//

void redir_recv_can_stdio( const uint8_t* data_ptr, uint8_t len );


#endif  // #if !defined( BCDRL_AVR_REDIR_REDIR_H )
// ----------------------------------------------------------------------------------------
//  end of redir.h
// ----------------------------------------------------------------------------------------

