00001
00002
00003
00004
00005
00006
00007
00008
00009
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
00035 #define SWITCH_RAM 9
00036 #define SWITCH_RAM_VALUE 1 // 1:serial RAM (64kB) - 0:internal memoryRAM (2kB)
00037
00038
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
00046 #define BIOLOID_UBRR 1
00047 #define V24_UBRR 103
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