BoardController.h

Go to the documentation of this file.
00001 //
00002 // C++ Interface: BoardController
00003 //
00004 // Description: description of the board controller class
00005 //
00006 //
00007 // Author: Michel Tokic <michel@tokic.com>, (C) 2009
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 
00013 #ifndef _BOARD_CONTROLLER_H_
00014 #define _BOARD_CONTROLLER_H_
00015 
00016 
00017 #include "global.h"
00018 
00019 
00020 #define LED_POWER   0x00
00021 #define LED_WALK    0x01
00022 #define LED_LEARN   0x02
00023 #define LED_EXPLORATION  0x03
00024 
00025 #define SWITCH_WALK           1
00026 #define SWITCH_RANDOM_STATE        2
00027 #define SWITCH_INV_FB_0            3
00028 #define SWITCH_ENABLE_EXPLORATION  4
00029 #define SWITCH_FULL_EXP_AT_START   5
00030 #define SWITCH_V24            6
00031 #define SWITCH_VDBE_EGREEDY        7
00032 #define SWITCH_GAMMA               8
00033 
00034 // possible future pin assignments
00035 #define SWITCH_RAM            9
00036 #define SWITCH_RAM_VALUE      1 // 1:serial RAM (64kB) - 0:internal memoryRAM (2kB)
00037 
00038 // serial ports
00039 #define RTS PC3
00040 #define CTS PC2
00041 #define EN_TXD_BIOLOID   PC7
00042 #define EN_RXD_BIOLOID   PC6
00043 #define EN_AIR_V24  PC5
00044 
00045 // baud rates 
00046 #define BIOLOID_UBRR 1   /* 1Mbps at 16 MHz */
00047 #define V24_UBRR 103     /* 19.2kbps at 16 MHz */
00048 
00049 
00050 class BoardController {
00051 
00052      public:
00053           static void msDelay (int n);
00054           static void powerOnLED(unsigned char _ledID, bool _status);
00055           static unsigned char getSwitchState (unsigned char _switch);
00056           static void blinkLED (unsigned char led_id, unsigned int count, unsigned int delay);
00057 
00058           static void enableSerialBioloidInterface();
00059           static void enableSerialV24Interface();
00060           static void disableSerialInterfaces();
00061 
00062           static void initPorts();
00063 
00064           static void enableV24Interrupt();
00065           static void disableV24Interrupt();
00066 };
00067 
00068 #endif

Generated on Wed Nov 25 11:27:41 2009 for Crawling Robot Microcontroller Software by  doxygen 1.5.5