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
 
@@ -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
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
 
@@ -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;
 
 
 
 
}
master/master/lib/serial.h
Show inline comments
 
@@ -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();
master/master/master.c
Show inline comments
 
@@ -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)
master/master/master.cproj
Show inline comments
 
@@ -85,6 +85,12 @@
 
    <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>
0 comments (0 inline, 0 general)