diff --git a/master/master/config.h b/master/master/config.h --- a/master/master/config.h +++ b/master/master/config.h @@ -10,7 +10,6 @@ #define CONFIG_H_ #define F_CPU 11059200 -#define USART_BAUDRATE 19200 #define MODULE_ID '1' #endif /* CONFIG_H_ */ \ No newline at end of file diff --git a/master/master/lib/ax25.c b/master/master/lib/ax25.c --- a/master/master/lib/ax25.c +++ b/master/master/lib/ax25.c @@ -133,4 +133,5 @@ void ax25_flush_frame() // Key the transmitter and send the frame afsk_send(packet, packet_size); afsk_start(); -}*/ \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/master/master/lib/ax25.h b/master/master/lib/ax25.h --- a/master/master/lib/ax25.h +++ b/master/master/lib/ax25.h @@ -9,8 +9,11 @@ #ifndef AX25_H_ #define AX25_H_ - - - +void ax25_send_byte(uint8_t a_byte); +void ax25_send_flag(); +void ax25_send_string(const char *string); +void ax25_send_header(const struct s_address *addresses, int num_addresses); +void ax25_send_footer(); +void ax25_flush_frame(); #endif /* AX25_H_ */ \ No newline at end of file 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 @@ -5,8 +5,38 @@ * Author: ethanzonca */ +#include "serial.h" +#include "../config.h" #include + +void serial_setup() { + // 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; + + + /* Set baud rate */ + UBRR0H = (unsigned char)(BAUD_PRESCALE>>8); + UBRR0L = (unsigned char)BAUD_PRESCALE; + /* Enable receiver and transmitter */ + UCSR0B = (1<> 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,9 @@ #ifndef SERIAL_H_ #define SERIAL_H_ +#include + +#define USART_BAUDRATE 19200 #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) -1 ) void serial_SendChar( char byte ); diff --git a/master/master/master.c b/master/master/master.c --- a/master/master/master.c +++ b/master/master/master.c @@ -8,34 +8,34 @@ * Kyle Ripperger * Matthew Kroening * - */ - - -#include "config.h" - -#include -#include - -#include "lib/serial.h" -#include "lib/afsk.h" -#include "lib/led.h" - -void micro_setup() { - // Generic microcontroller config options - -} - -int main(void) -{ - // Initialize - micro_setup(); - led_setup(); - serial_setup(); // Config serial ports - afsk_setup(); - - while(1) - { - afsk_test(); - //serial_SendCommand('0','A',0,0); - } + */ + + +#include "config.h" + +#include +#include + +#include "lib/serial.h" +#include "lib/afsk.h" +#include "lib/led.h" + +void micro_setup() { + // Generic microcontroller config options + +} + +int main(void) +{ + // Initialize + micro_setup(); + led_setup(); + serial_setup(); // Config serial ports + afsk_setup(); + + while(1) + { + afsk_test(); + serial_SendCommand('0','A',0,0); + } } \ No newline at end of file