Changeset - f57e8277266e
[Not reviewed]
default
0 5 2
ethanzonca@CL-SEC241-08.cedarville.edu - 12 years ago 2012-10-25 15:50:18
ethanzonca@CL-SEC241-08.cedarville.edu
Added additional libraries
7 files changed with 77 insertions and 1 deletions:
0 comments (0 inline, 0 general)
master/master/config.h
Show inline comments
 
@@ -2,15 +2,15 @@
 
 * config.h
 
 *
 
 * Created: 10/25/2012 3:28:22 PM
 
 *  Author: ethanzonca
 
 */ 
 
 
 
#ifndef CONFIG_H_
 
#define CONFIG_H_
 
 
#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
master/master/lib/led.c
Show inline comments
 
new file 100644
 
/*
 
 * led.c
 
 *
 
 * Created: 10/25/2012 3:34:03 PM
 
 *  Author: ethanzonca
 
 */ 
 
 
#include <avr/io.h>
 
 
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
master/master/lib/led.h
Show inline comments
 
new file 100644
 
/*
 
 * 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_ */
master/master/lib/serial.c
Show inline comments
 
@@ -32,14 +32,28 @@ void serial_SendCommand( char moduleID, 
 
	}
 
	
 
	serial_SendChar(checkSum);
 
	serial_SendChar(']'); //bracket indicates end of command
 
}
 
 
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;
 
 
 
 
}
master/master/lib/serial.h
Show inline comments
 
/*
 
 * serial.h
 
 *
 
 * Created: 10/25/2012 3:19:42 PM
 
 *  Author: ethanzonca
 
 */ 
 
 
 
#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();
 
void serial_Configure();
 
 
#endif /* SERIAL_H_ */
 
\ No newline at end of file
master/master/master.c
Show inline comments
 
@@ -4,22 +4,29 @@
 
 * Created: 10/25/2012 2:48:04 PM
 
 *  Author: mkanning
 
 */ 
 
 
 
#include "config.h"
 
 
#include <avr/io.h>
 
#include <util/delay.h>
 
 
#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)
 
    {
 
        serial_SendCommand('0','A',0,0);
 
    }
 
}
 
\ No newline at end of file
master/master/master.cproj
Show inline comments
 
@@ -76,24 +76,30 @@
 
          <ListValues>
 
            <Value>m</Value>
 
          </ListValues>
 
        </avrgcc.linker.libraries.Libraries>
 
        <avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
 
      </AvrGcc>
 
    </ToolchainSettings>
 
  </PropertyGroup>
 
  <ItemGroup>
 
    <Compile Include="config.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\led.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\led.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\serial.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\serial.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="master.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
  </ItemGroup>
 
  <ItemGroup>
 
    <Folder Include="lib" />
0 comments (0 inline, 0 general)