Changeset - dc014539e59f
[Not reviewed]
default
0 6 0
ethanzonca@CL-SEC241-08.cedarville.edu - 12 years ago 2012-11-07 20:32:23
ethanzonca@CL-SEC241-08.cedarville.edu
Slightly modified AX25 library and mods
6 files changed with 42 insertions and 24 deletions:
0 comments (0 inline, 0 general)
master/master/config.h
Show inline comments
 
@@ -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
master/master/lib/ax25.c
Show inline comments
 
@@ -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
master/master/lib/ax25.h
Show inline comments
 
@@ -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
master/master/lib/serial.c
Show inline comments
 
@@ -5,8 +5,38 @@
 
 *  Author: ethanzonca
 
 */ 
 
 
#include "serial.h"
 
#include "../config.h"
 
#include <avr/io.h>
 
 
 
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<<RXEN0)|(1<<TXEN0);
 
	/* Set frame format: 8data, 2stop bit */
 
	UCSR0C = (3<<UCSZ00);
 
 
}
 
 
 
void serial_SendChar( char byte )
 
{
 
	while (!(UCSR0A & (1<<UDRE0)));
 
@@ -39,21 +69,3 @@ void serial_SendResponseData(){
 
	
 
}
 
 
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;
 
 
 
 
}
master/master/lib/serial.h
Show inline comments
 
@@ -9,6 +9,9 @@
 
#ifndef SERIAL_H_
 
#define SERIAL_H_
 
 
#include <inttypes.h>
 
 
#define USART_BAUDRATE 19200
 
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) -1 )
 
 
void serial_SendChar( char byte );
master/master/master.c
Show inline comments
 
@@ -36,6 +36,6 @@ int main(void)
 
    while(1)
 
    {
 
		afsk_test();
 
        //serial_SendCommand('0','A',0,0);
 
        serial_SendCommand('0','A',0,0);
 
    }
 
}
 
\ No newline at end of file
0 comments (0 inline, 0 general)