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
 
@@ -7,10 +7,9 @@
 
 
 
#ifndef CONFIG_H_
 
#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
 
@@ -130,7 +130,8 @@ void ax25_send_footer()
 

	
 
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
 
@@ -6,11 +6,14 @@
 
 */ 
 
 
 
#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
 
@@ -2,14 +2,44 @@
 
 * serial.c
 
 *
 
 * Created: 10/25/2012 3:19:49 PM
 
 *  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)));
 
	UDR0 = byte;
 
}
 
 
@@ -36,24 +66,6 @@ void serial_SendCommand( char moduleID, 
 
}
 
 
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
 
@@ -6,12 +6,15 @@
 
 */ 
 
 
 
#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 );
 
void serial_SendCommand( char moduleID, char sensorID, uint8_t dataLength, char* data );
 
void serial_SendResponseData();
 
void serial_setup();
master/master/master.c
Show inline comments
 
@@ -33,9 +33,9 @@ int main(void)
 
	serial_setup(); // Config serial ports
 
	afsk_setup();
 
	
 
    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)