diff --git a/master/master/config.h b/master/master/config.h --- a/master/master/config.h +++ b/master/master/config.h @@ -11,6 +11,6 @@ #define F_CPU 11059200 #define USART_BAUDRATE 19200 -#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) -1 ) + #endif /* CONFIG_H_ */ \ No newline at end of file diff --git a/master/master/lib/led.c b/master/master/lib/led.c new file mode 100644 --- /dev/null +++ b/master/master/lib/led.c @@ -0,0 +1,24 @@ +/* + * led.c + * + * Created: 10/25/2012 3:34:03 PM + * Author: ethanzonca + */ + +#include + +void led_Configure() { + // Configure ports/pins for LEDs +} + +void led_On(uint8_t led) { + // Turn the specified LED on +} + +void led_Off(uint8_t led) { + // Turn the specified LED off +} + +void led_Toggle(uint8_t led) { + // Toggle the specified LED +} \ No newline at end of file diff --git a/master/master/lib/led.h b/master/master/lib/led.h new file mode 100644 --- /dev/null +++ b/master/master/lib/led.h @@ -0,0 +1,23 @@ +/* + * led.h + * + * Created: 10/25/2012 3:34:10 PM + * Author: ethanzonca + */ + + +#ifndef LED_H_ +#define LED_H_ + +#define POWER 1 +#define ERROR 2 +#define STAT 2 +#define OK 2 + +void led_Configure(); +void led_On(uint8_t led); +void led_Off(uint8_t led); +void led_Toggle(uint8_t led); + + +#endif /* LED_H_ */ diff --git a/master/master/lib/serial.c b/master/master/lib/serial.c --- a/master/master/lib/serial.c +++ b/master/master/lib/serial.c @@ -41,5 +41,19 @@ void serial_SendResponseData(){ void serial_Configure() { // Set registers! + + // from mnl + // uart + //UBRRH = (BAUD_PRESCALE >> 8); // 0 + //UBRRL = BAUD_PRESCALE; // 8 + //UCSRA = 0; + //UCSRB = 0x18; + //UCSRC = 0x06; + //OCR0B = 0xff; + //OCR0A = 0xff; + //OCR1AL = 0xff; + //OCR1BL = 0xff; + + } diff --git a/master/master/lib/serial.h b/master/master/lib/serial.h --- a/master/master/lib/serial.h +++ b/master/master/lib/serial.h @@ -9,6 +9,8 @@ #ifndef SERIAL_H_ #define SERIAL_H_ +#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) -1 ) + void serial_SendChar( char byte ); void serial_SendCommand( char moduleID, char measureType, uint8_t dataLength, char* data ); void serial_SendResponseData(); diff --git a/master/master/master.c b/master/master/master.c --- a/master/master/master.c +++ b/master/master/master.c @@ -13,9 +13,16 @@ #include "lib/serial.h" + +void micro_Configure() { + // Generic microcontroller config options +} + int main(void) { // Initialize + micro_Configure(); + led_Configure(); serial_Configure(); // Config serial ports while(1) diff --git a/master/master/master.cproj b/master/master/master.cproj --- a/master/master/master.cproj +++ b/master/master/master.cproj @@ -85,6 +85,12 @@ compile + + compile + + + compile + compile