This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/AVR_Studio/Soccer/hal/board.h

54 lines
931 B
C
Raw Normal View History

#ifndef _BOARD_H_
#define _BOARD_H_
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdlib.h>
#include "uart.h"
//#define abs(a) ((a < 0)? -a : a)
#define BEEPER_PIN PG2
2007-02-13 19:43:03 +00:00
// Definiere Konstanten f<>r die Motoren/Dribbler
#define MOTOR0_PORT PORTD
#define MOTOR0_PWM OCR3A
#define MOTOR0_A (1 << 5)
#define MOTOR0_B (1 << 4)
#define MOTOR1_PORT PORTD
#define MOTOR1_PWM OCR3B
#define MOTOR1_A (1 << 6)
#define MOTOR1_B (1 << 7)
#define MOTOR2_PORT PORTB
#define MOTOR2_PWM OCR1A
#define MOTOR2_A (1 << 0)
#define MOTOR2_B (1 << 1)
#define DRIBBLER_PORT PORTB
#define DRIBBLER_PWM OCR1C
#define DRIBBLER_A (1 << 2)
#define DRIBBLER_B (1 << 3)
#define UART_BAUD_RATE 9600
class Board
{
private:
public:
Board();
~Board();
int GetADC(uint8_t channel);
void beep(int freq);
void ledOn();
void ledOff();
void led(bool status);
void motor(int i, int speed);
};
#endif