pentabug/firmware/lib/bughal.h

38 lines
714 B
C
Raw Normal View History

#ifndef BUGHAL_H
#define BUGHAL_H
2012-10-01 22:11:28 +02:00
#include <stdbool.h>
/* Hardware abstraction layer for Pentabug hardware */
enum { BUZZR_OUT, //initialize buzzer for OUTPUT mode (emmiting soundwaves)
BUZZR_IN //initialize buzzer for INPUT mode (registering soundwaves)
};
2012-09-06 23:09:20 +02:00
#define LED_L (1 << PORTC0)
#define LED_R (1 << PORTC2)
#define MOTOR_ON (0<<PORTB1)
#define MOTOR_OFF (1<<PORTB1)
void init_leds(void);
2012-09-06 23:09:20 +02:00
void led_on(int);
void led_off(int);
2012-10-01 04:32:00 +02:00
void init_buzzr(void);
void buzzr_up(void);
void buzzr_down(void);
void buzzr_off(void);
void buzzr_inv(void);
2012-09-06 23:09:20 +02:00
void init_switch(void);
2012-10-01 22:11:28 +02:00
bool switch_l(void); //switch pressed?
bool switch_r(void); //switch pressed?
void init_motor(void);
2012-09-06 23:09:20 +02:00
void set_motor(int);
2012-10-01 22:11:28 +02:00
#endif