end
This commit is contained in:
parent
294a5b9ac8
commit
7658cd2db5
@ -17,7 +17,42 @@ void setup()
|
|||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
char data[] = {0x06, 0xF1, 0x04, 0x05, 0x16, 0x12, 0x18, 0x11, 0x00, 0x15, 0x49, 0x50, 0x59, 0x69, 0};
|
// All clear
|
||||||
|
// 0x00 - черный, остальное белое
|
||||||
|
// char data[] = {0x01, 0x00, 0};
|
||||||
|
|
||||||
|
// Setpage 1
|
||||||
|
// 0x00 - 0x07
|
||||||
|
// char data[] = {0x02, 0x01, 0};
|
||||||
|
|
||||||
|
// Add symbol
|
||||||
|
// char data[] = {0x03, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0F, 0};
|
||||||
|
|
||||||
|
// Delete symbol
|
||||||
|
// Кол-во символов
|
||||||
|
// char data[] = {0x04, 0x04, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0};
|
||||||
|
|
||||||
|
// Draw Pixel
|
||||||
|
// x, y, color
|
||||||
|
// char data[] = {0x05, 0x15, 0x15, 0x01, 0};
|
||||||
|
|
||||||
|
// Draw Line
|
||||||
|
// x1, y1, x2, y2, color
|
||||||
|
// char data[] = {0x06, 0x15, 0x15, 0x45, 0x45, 0x01, 0};
|
||||||
|
|
||||||
|
// Draw Circle
|
||||||
|
// x, y, r, color, fill
|
||||||
|
// char data[] = {0x07, 0x15, 0x15, 0x15, 0x01, 0x00, 0};
|
||||||
|
|
||||||
|
// Draw Rectangle
|
||||||
|
// x, y, width, height, color, fill
|
||||||
|
// char data[] = {0x08, 0x15, 0x15, 0x25, 0x25, 0x01, 0x00, 0};
|
||||||
|
|
||||||
|
// Draw Char
|
||||||
|
// x, y, charIndex, fill
|
||||||
|
// char data[] = {0x09, 0x15, 0x15, 0x05, 0x00, 0};
|
||||||
|
|
||||||
|
char data[] = {0x01, 0x00, 0};
|
||||||
int length = sizeof(data);
|
int length = sizeof(data);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.print("Start: ");
|
Serial.print("Start: ");
|
||||||
@ -34,5 +69,5 @@ void loop()
|
|||||||
Serial.println();
|
Serial.println();
|
||||||
|
|
||||||
SPI_MasterTransmit(data, length);
|
SPI_MasterTransmit(data, length);
|
||||||
_delay_ms(1000);
|
_delay_ms(5000);
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
// #include <avr/io.h>
|
|
||||||
// #include <GyverOLED.h>
|
|
||||||
#include "SPISlave.h"
|
#include "SPISlave.h"
|
||||||
|
// #include <GyverOLED.h>
|
||||||
|
#include <GyverOLED.h>
|
||||||
|
GyverOLED<SSD1306_128x64, OLED_NO_BUFFER> oled;
|
||||||
|
|
||||||
#define DDR_SPI DDRB
|
#define DDR_SPI DDRB
|
||||||
#define DD_MOSI PB3
|
#define DD_MOSI PB3
|
||||||
@ -8,6 +10,7 @@
|
|||||||
#define DD_SCK PB5
|
#define DD_SCK PB5
|
||||||
#define DD_SS PB2
|
#define DD_SS PB2
|
||||||
|
|
||||||
|
|
||||||
// GyverOLED<SSD1306_128x64, OLED_NO_BUFFER> oled;
|
// GyverOLED<SSD1306_128x64, OLED_NO_BUFFER> oled;
|
||||||
|
|
||||||
static int index = 0;
|
static int index = 0;
|
||||||
@ -20,6 +23,183 @@ static char data[64];
|
|||||||
// SPCR = (1 << SPE) | (1 << SPIE);
|
// SPCR = (1 << SPE) | (1 << SPIE);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// biblary
|
||||||
|
|
||||||
|
|
||||||
|
// внутренние константы
|
||||||
|
#define OLED_WIDTH 128
|
||||||
|
#define OLED_HEIGHT_64 0x12
|
||||||
|
#define OLED_64 0x3F
|
||||||
|
#define OLED_32 0x1F
|
||||||
|
|
||||||
|
#define OLED_DISPLAY_OFF 0xAE
|
||||||
|
#define OLED_DISPLAY_ON 0xAF
|
||||||
|
|
||||||
|
#define OLED_COMMAND_MODE 0x00
|
||||||
|
#define OLED_ONE_COMMAND_MODE 0x80
|
||||||
|
#define OLED_DATA_MODE 0x40
|
||||||
|
#define OLED_ONE_DATA_MODE 0xC0
|
||||||
|
|
||||||
|
#define OLED_ADDRESSING_MODE 0x20
|
||||||
|
#define OLED_HORIZONTAL 0x00
|
||||||
|
#define OLED_VERTICAL 0x01
|
||||||
|
|
||||||
|
#define OLED_NORMAL_V 0xC8
|
||||||
|
#define OLED_FLIP_V 0xC0
|
||||||
|
#define OLED_NORMAL_H 0xA1
|
||||||
|
#define OLED_FLIP_H 0xA0
|
||||||
|
|
||||||
|
#define OLED_CONTRAST 0x81
|
||||||
|
#define OLED_SETCOMPINS 0xDA
|
||||||
|
#define OLED_SETVCOMDETECT 0xDB
|
||||||
|
#define OLED_CLOCKDIV 0xD5
|
||||||
|
#define OLED_SETMULTIPLEX 0xA8
|
||||||
|
#define OLED_COLUMNADDR 0x21
|
||||||
|
#define OLED_PAGEADDR 0x22
|
||||||
|
#define OLED_CHARGEPUMP 0x8D
|
||||||
|
|
||||||
|
#define OLED_NORMALDISPLAY 0xA6
|
||||||
|
#define OLED_INVERTDISPLAY 0xA7
|
||||||
|
|
||||||
|
#define BUFSIZE_128x64 (128*64/8)
|
||||||
|
|
||||||
|
#define SCREEN_WIDTH 128
|
||||||
|
#define SCREEN_HEIGHT 64
|
||||||
|
|
||||||
|
#define OLED_ADDR 0x3C
|
||||||
|
|
||||||
|
const uint8_t _maxRow = 7;
|
||||||
|
const uint8_t _maxY = SCREEN_HEIGHT - 1;
|
||||||
|
const uint8_t _maxX = SCREEN_WIDTH - 1;
|
||||||
|
|
||||||
|
// ========== I2C ==========
|
||||||
|
#define I2C_FREQ 100000UL
|
||||||
|
|
||||||
|
void i2c_begin(uint8_t address)
|
||||||
|
{
|
||||||
|
TWBR = ((F_CPU / I2C_FREQ) - 16) / 2; // Расчет предделителя для заданной частоты
|
||||||
|
TWAR = (address << 1); // Установка адреса устройства
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_endTransaction()
|
||||||
|
{
|
||||||
|
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO); // Отправка условия STOP
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_beginTransmission(uint8_t address)
|
||||||
|
{
|
||||||
|
TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN); // Отправка условия START
|
||||||
|
while (!(TWCR & (1 << TWINT))); // Ожидание завершения START
|
||||||
|
|
||||||
|
TWDR = (address << 1); // Отправка адреса устройства
|
||||||
|
TWCR = (1 << TWINT) | (1 << TWEN); // Отправка адреса
|
||||||
|
while (!(TWCR & (1 << TWINT))); // Ожидание завершения передачи адреса
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_write(uint8_t data)
|
||||||
|
{
|
||||||
|
TWDR = data; // Запись данных
|
||||||
|
TWCR = (1 << TWINT) | (1 << TWEN); // Отправка данных
|
||||||
|
while (!(TWCR & (1 << TWINT))); // Ожидание завершения передачи данных
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== Sender ==========
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t _writes = 0;
|
||||||
|
|
||||||
|
void sendData(uint8_t data) {
|
||||||
|
sendByteRaw(data);
|
||||||
|
_writes++;
|
||||||
|
if (_writes >= 16) {
|
||||||
|
endTransm();
|
||||||
|
beginData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sendByteRaw(uint8_t data) {
|
||||||
|
i2c_write(data);
|
||||||
|
}
|
||||||
|
void sendCommand(uint8_t cmd1) {
|
||||||
|
beginOneCommand();
|
||||||
|
sendByteRaw(cmd1);
|
||||||
|
endTransm();
|
||||||
|
}
|
||||||
|
|
||||||
|
void sendCommand(uint8_t cmd1, uint8_t cmd2) {
|
||||||
|
beginCommand();
|
||||||
|
sendByteRaw(cmd1);
|
||||||
|
sendByteRaw(cmd2);
|
||||||
|
endTransm();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setWindow(int x0, int y0, int x1, int y1) {
|
||||||
|
beginCommand();
|
||||||
|
sendByteRaw(OLED_COLUMNADDR);
|
||||||
|
sendByteRaw(constrain(x0, 0, _maxX));
|
||||||
|
sendByteRaw(constrain(x1, 0, _maxX));
|
||||||
|
sendByteRaw(OLED_PAGEADDR);
|
||||||
|
sendByteRaw(constrain(y0, 0, _maxRow));
|
||||||
|
sendByteRaw(constrain(y1, 0, _maxRow));
|
||||||
|
endTransm();
|
||||||
|
}
|
||||||
|
|
||||||
|
void beginData() {
|
||||||
|
startTransm();
|
||||||
|
sendByteRaw(OLED_DATA_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void beginCommand() {
|
||||||
|
startTransm();
|
||||||
|
sendByteRaw(OLED_COMMAND_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void beginOneCommand() {
|
||||||
|
startTransm();
|
||||||
|
sendByteRaw(OLED_ONE_COMMAND_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void endTransm() {
|
||||||
|
i2c_endTransaction();
|
||||||
|
_writes = 0;
|
||||||
|
}
|
||||||
|
void startTransm() {
|
||||||
|
i2c_beginTransmission(OLED_ADDR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_init(){
|
||||||
|
i2c_begin(OLED_ADDR);
|
||||||
|
beginCommand();
|
||||||
|
|
||||||
|
// 15
|
||||||
|
sendData(OLED_DISPLAY_OFF);
|
||||||
|
sendData(OLED_CLOCKDIV);
|
||||||
|
sendData(0x80);
|
||||||
|
sendData(OLED_CHARGEPUMP);
|
||||||
|
sendData(0x14);
|
||||||
|
sendData(OLED_ADDRESSING_MODE);
|
||||||
|
sendData(OLED_VERTICAL);
|
||||||
|
sendData(OLED_NORMAL_H);
|
||||||
|
sendData(OLED_NORMAL_V);
|
||||||
|
sendData(OLED_CONTRAST);
|
||||||
|
sendData(0x7F);
|
||||||
|
sendData(OLED_SETVCOMDETECT);
|
||||||
|
sendData(0x40);
|
||||||
|
sendData(OLED_NORMALDISPLAY);
|
||||||
|
sendData(OLED_DISPLAY_ON);
|
||||||
|
// 15
|
||||||
|
|
||||||
|
endTransm();
|
||||||
|
beginCommand();
|
||||||
|
sendData(OLED_SETCOMPINS);
|
||||||
|
sendData(OLED_HEIGHT_64);
|
||||||
|
sendData(OLED_SETMULTIPLEX);
|
||||||
|
sendData(OLED_64);
|
||||||
|
endTransm();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ISR(SPI_STC_vect)
|
ISR(SPI_STC_vect)
|
||||||
{
|
{
|
||||||
char received = SPDR;
|
char received = SPDR;
|
||||||
@ -32,6 +212,11 @@ void setup()
|
|||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
SPI_SlaveInit();
|
SPI_SlaveInit();
|
||||||
|
|
||||||
|
oled_init();
|
||||||
|
oled.fill(0);
|
||||||
|
oled.setScale(3);
|
||||||
|
oled.home();
|
||||||
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println("Initialization ");
|
Serial.println("Initialization ");
|
||||||
}
|
}
|
||||||
@ -40,19 +225,44 @@ void SetCommand(char *data2, int length){
|
|||||||
char command = data2[0];
|
char command = data2[0];
|
||||||
// Отрезать 1 элемент от оставшихся
|
// Отрезать 1 элемент от оставшихся
|
||||||
|
|
||||||
|
|
||||||
Serial.print("\nReceived command: ");
|
Serial.print("\nReceived command: ");
|
||||||
Serial.println(command, HEX);
|
Serial.println(command, HEX);
|
||||||
switch (command){
|
switch (command){
|
||||||
case 6:
|
case 1:
|
||||||
AddSymbol(&data2[1], length-1);
|
AllClear(&data2[1], length-1);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
SetPage(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
// case 6:
|
||||||
|
// PrintMassive(&data2[1], length-1);
|
||||||
|
// break;
|
||||||
|
case 4:
|
||||||
|
AddSymbol(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
DelSymbol(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
DrawPixel(&data2[1], length-1);
|
||||||
|
PrintMassive(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
DrawLine(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
DrawCircle(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
DrawRectangle(&data2[1], length-1);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddSymbol(uint8_t *symbols, int lenght){
|
void PrintMassive(uint8_t *symbols, int lenght){
|
||||||
Serial.print("Received Add: ");
|
Serial.print("Received Add: ");
|
||||||
|
|
||||||
// oled.setScale(3); // масштаб текста (1..4)
|
// oled.setScale(3); // масштаб текста (1..4)
|
||||||
@ -66,6 +276,75 @@ void AddSymbol(uint8_t *symbols, int lenght){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Another
|
||||||
|
// command 1
|
||||||
|
void AllClear(char *symbols, int lenght){
|
||||||
|
int param = symbols[0];
|
||||||
|
if (param == 1){
|
||||||
|
oled.fill(0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
oled.fill(255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 2
|
||||||
|
void SetPage(char *symbols, int lenght){
|
||||||
|
int x = symbols[0];
|
||||||
|
int y = symbols[1];
|
||||||
|
oled.setCursor(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 4
|
||||||
|
void AddSymbol(char *symbols, int lenght) {
|
||||||
|
for (int i = 0; i < lenght - 1; i++) {
|
||||||
|
oled.print(symbols[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 5
|
||||||
|
void DelSymbol(char *symbols, int lenght) {
|
||||||
|
for (int i = 0; i < lenght - 1; i++) {
|
||||||
|
oled.print(symbols[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 6
|
||||||
|
void DrawPixel(char *symbols, int lenght){
|
||||||
|
int x = symbols[0];
|
||||||
|
int y = symbols[1];
|
||||||
|
int color = symbols[2];
|
||||||
|
oled.dot(x,y,color);
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 7
|
||||||
|
void DrawLine(char *symbols, int lenght){
|
||||||
|
int x = symbols[0];
|
||||||
|
int y = symbols[1];
|
||||||
|
int x1 = symbols[2];
|
||||||
|
int y1 = symbols[3];
|
||||||
|
int color = symbols[4];
|
||||||
|
oled.line(x,y,x1,y1,color);
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 8
|
||||||
|
void DrawCircle(char *symbols, int lenght){
|
||||||
|
int x = symbols[0];
|
||||||
|
int y = symbols[1];
|
||||||
|
int r = symbols[2];
|
||||||
|
int color = symbols[3];
|
||||||
|
oled.circle(x,y,r,color);
|
||||||
|
}
|
||||||
|
|
||||||
|
// command 9
|
||||||
|
void DrawRectangle(char *symbols, int lenght){
|
||||||
|
int x = symbols[0];
|
||||||
|
int y = symbols[1];
|
||||||
|
int x1 = symbols[2];
|
||||||
|
int y1 = symbols[3];
|
||||||
|
int color = symbols[4];
|
||||||
|
oled.rect(x,y,x1,y1,color);
|
||||||
|
}
|
||||||
|
|
||||||
// Функция для вычисления контрольной суммы XOR
|
// Функция для вычисления контрольной суммы XOR
|
||||||
// char CRC8(char *data, int length) {
|
// char CRC8(char *data, int length) {
|
||||||
@ -128,12 +407,9 @@ void loop() {
|
|||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println("Старт вывода массивов");
|
Serial.println("Старт вывода массивов");
|
||||||
Serial.println(sum, HEX);
|
Serial.println(sum, HEX);
|
||||||
// checkNull = checkArray(data, index);
|
|
||||||
|
|
||||||
// if(checkNull == 1){
|
|
||||||
|
|
||||||
// }
|
|
||||||
SetCommand(data, index);
|
SetCommand(data, index);
|
||||||
|
// oled.print(data[0]);
|
||||||
Serial.println("Стоп вывода массивов");
|
Serial.println("Стоп вывода массивов");
|
||||||
index = 0;
|
index = 0;
|
||||||
return;
|
return;
|
||||||
|
BIN
SPI/slave/slave.rar
Normal file
BIN
SPI/slave/slave.rar
Normal file
Binary file not shown.
20
SPI_/SPI_.atsln
Normal file
20
SPI_/SPI_.atsln
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Atmel Studio Solution File, Format Version 11.00
|
||||||
|
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "SPI_", "SPI_\SPI_.cproj", "{37275DFD-0CE5-467A-9F25-7A9E49FF51C2}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|AVR = Debug|AVR
|
||||||
|
Release|AVR = Release|AVR
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{37275DFD-0CE5-467A-9F25-7A9E49FF51C2}.Debug|AVR.ActiveCfg = Debug|AVR
|
||||||
|
{37275DFD-0CE5-467A-9F25-7A9E49FF51C2}.Debug|AVR.Build.0 = Debug|AVR
|
||||||
|
{37275DFD-0CE5-467A-9F25-7A9E49FF51C2}.Release|AVR.ActiveCfg = Release|AVR
|
||||||
|
{37275DFD-0CE5-467A-9F25-7A9E49FF51C2}.Release|AVR.Build.0 = Release|AVR
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
BIN
SPI_/SPI_.atsuo
Normal file
BIN
SPI_/SPI_.atsuo
Normal file
Binary file not shown.
136
SPI_/SPI_/Debug/Makefile
Normal file
136
SPI_/SPI_/Debug/Makefile
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
################################################################################
|
||||||
|
# Automatically-generated file. Do not edit!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
SHELL := cmd.exe
|
||||||
|
RM := rm -rf
|
||||||
|
|
||||||
|
USER_OBJS :=
|
||||||
|
|
||||||
|
LIBS :=
|
||||||
|
PROJ :=
|
||||||
|
|
||||||
|
O_SRCS :=
|
||||||
|
C_SRCS :=
|
||||||
|
S_SRCS :=
|
||||||
|
S_UPPER_SRCS :=
|
||||||
|
OBJ_SRCS :=
|
||||||
|
ASM_SRCS :=
|
||||||
|
PREPROCESSING_SRCS :=
|
||||||
|
OBJS :=
|
||||||
|
OBJS_AS_ARGS :=
|
||||||
|
C_DEPS :=
|
||||||
|
C_DEPS_AS_ARGS :=
|
||||||
|
EXECUTABLES :=
|
||||||
|
OUTPUT_FILE_PATH :=
|
||||||
|
OUTPUT_FILE_PATH_AS_ARGS :=
|
||||||
|
AVR_APP_PATH :=$$$AVR_APP_PATH$$$
|
||||||
|
QUOTE := "
|
||||||
|
ADDITIONAL_DEPENDENCIES:=
|
||||||
|
OUTPUT_FILE_DEP:=
|
||||||
|
LIB_DEP:=
|
||||||
|
LINKER_SCRIPT_DEP:=
|
||||||
|
|
||||||
|
# Every subdirectory with source files must be described here
|
||||||
|
SUBDIRS :=
|
||||||
|
|
||||||
|
|
||||||
|
# Add inputs and outputs from these tool invocations to the build variables
|
||||||
|
C_SRCS += \
|
||||||
|
../SPIMaster.c \
|
||||||
|
../SPI_.c
|
||||||
|
|
||||||
|
|
||||||
|
PREPROCESSING_SRCS +=
|
||||||
|
|
||||||
|
|
||||||
|
ASM_SRCS +=
|
||||||
|
|
||||||
|
|
||||||
|
OBJS += \
|
||||||
|
SPIMaster.o \
|
||||||
|
SPI_.o
|
||||||
|
|
||||||
|
OBJS_AS_ARGS += \
|
||||||
|
SPIMaster.o \
|
||||||
|
SPI_.o
|
||||||
|
|
||||||
|
C_DEPS += \
|
||||||
|
SPIMaster.d \
|
||||||
|
SPI_.d
|
||||||
|
|
||||||
|
C_DEPS_AS_ARGS += \
|
||||||
|
SPIMaster.d \
|
||||||
|
SPI_.d
|
||||||
|
|
||||||
|
OUTPUT_FILE_PATH +=SPI_.elf
|
||||||
|
|
||||||
|
OUTPUT_FILE_PATH_AS_ARGS +=SPI_.elf
|
||||||
|
|
||||||
|
ADDITIONAL_DEPENDENCIES:=
|
||||||
|
|
||||||
|
OUTPUT_FILE_DEP:= ./makedep.mk
|
||||||
|
|
||||||
|
LIB_DEP+=
|
||||||
|
|
||||||
|
LINKER_SCRIPT_DEP+=
|
||||||
|
|
||||||
|
|
||||||
|
# AVR32/GNU C Compiler
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
./%.o: .././%.c
|
||||||
|
@echo Building file: $<
|
||||||
|
@echo Invoking: AVR/GNU C Compiler : 4.8.1
|
||||||
|
$(QUOTE)E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
|
||||||
|
@echo Finished building: $<
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# AVR32/GNU Preprocessing Assembler
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# AVR32/GNU Assembler
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
ifneq ($(strip $(C_DEPS)),)
|
||||||
|
-include $(C_DEPS)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Add inputs and outputs from these tool invocations to the build variables
|
||||||
|
|
||||||
|
# All Target
|
||||||
|
all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)
|
||||||
|
|
||||||
|
$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)
|
||||||
|
@echo Building target: $@
|
||||||
|
@echo Invoking: AVR/GNU Linker : 4.8.1
|
||||||
|
$(QUOTE)E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="SPI_.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega328p
|
||||||
|
@echo Finished building target: $@
|
||||||
|
"E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "SPI_.elf" "SPI_.hex"
|
||||||
|
"E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "SPI_.elf" "SPI_.eep" || exit 0
|
||||||
|
"E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "SPI_.elf" > "SPI_.lss"
|
||||||
|
"E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "SPI_.elf" "SPI_.srec"
|
||||||
|
"E:\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-size.exe" "SPI_.elf"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Other Targets
|
||||||
|
clean:
|
||||||
|
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
|
||||||
|
-$(RM) $(C_DEPS_AS_ARGS)
|
||||||
|
rm -rf "SPI_.elf" "SPI_.a" "SPI_.hex" "SPI_.lss" "SPI_.eep" "SPI_.map" "SPI_.srec" "SPI_.usersignatures"
|
||||||
|
|
45
SPI_/SPI_/Debug/SPIMaster.d
Normal file
45
SPI_/SPI_/Debug/SPIMaster.d
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
SPIMaster.d SPIMaster.o: .././SPIMaster.c .././SPIMaster.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\io.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\inttypes.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\lib\gcc\avr\4.8.1\include\stdint.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\stdint.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\iom328p.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\portpins.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\common.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\version.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\fuse.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\lock.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\util\delay.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\util\delay_basic.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\math.h
|
||||||
|
|
||||||
|
.././SPIMaster.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\io.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\inttypes.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\lib\gcc\avr\4.8.1\include\stdint.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\stdint.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\iom328p.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\portpins.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\common.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\version.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\fuse.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\lock.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\util\delay.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\util\delay_basic.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\math.h:
|
BIN
SPI_/SPI_/Debug/SPIMaster.o
Normal file
BIN
SPI_/SPI_/Debug/SPIMaster.o
Normal file
Binary file not shown.
37
SPI_/SPI_/Debug/SPI_.d
Normal file
37
SPI_/SPI_/Debug/SPI_.d
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
SPI_.d SPI_.o: .././SPI_.c \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\io.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\inttypes.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\lib\gcc\avr\4.8.1\include\stdint.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\stdint.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\iom328p.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\portpins.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\common.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\version.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\fuse.h \
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\lock.h \
|
||||||
|
.././SPIMaster.h
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\io.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\inttypes.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\lib\gcc\avr\4.8.1\include\stdint.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\stdint.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\iom328p.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\portpins.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\common.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\version.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\fuse.h:
|
||||||
|
|
||||||
|
e:\atmel\ toolchain\avr8\ gcc\native\3.4.1061\avr8-gnu-toolchain\avr\include\avr\lock.h:
|
||||||
|
|
||||||
|
.././SPIMaster.h:
|
1
SPI_/SPI_/Debug/SPI_.eep
Normal file
1
SPI_/SPI_/Debug/SPI_.eep
Normal file
@ -0,0 +1 @@
|
|||||||
|
:00000001FF
|
BIN
SPI_/SPI_/Debug/SPI_.elf
Normal file
BIN
SPI_/SPI_/Debug/SPI_.elf
Normal file
Binary file not shown.
23
SPI_/SPI_/Debug/SPI_.hex
Normal file
23
SPI_/SPI_/Debug/SPI_.hex
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
:100000000C9434000C9449000C9449000C94490061
|
||||||
|
:100010000C9449000C9449000C9449000C9449003C
|
||||||
|
:100020000C9449000C9449000C9449000C9449002C
|
||||||
|
:100030000C9449000C9449000C9449000C9449001C
|
||||||
|
:100040000C9449000C9449000C9449000C9449000C
|
||||||
|
:100050000C9449000C9449000C9449000C944900FC
|
||||||
|
:100060000C9449000C94490011241FBECFEFD8E036
|
||||||
|
:10007000DEBFCDBF11E0A0E0B1E0E6E4F1E002C0F8
|
||||||
|
:1000800005900D92A031B107D9F70E947D000C9424
|
||||||
|
:10009000A1000C9400008CE284B9229A82E58CBD08
|
||||||
|
:1000A00008952A98161617065CF4FC01860F971F10
|
||||||
|
:1000B00021912EBD0DB407FEFDCFE817F907C1F75A
|
||||||
|
:1000C0002A9A0895FC01680F791F80E058E040E00B
|
||||||
|
:1000D00097E00FC021918227252F342F88231CF40D
|
||||||
|
:1000E000880F892701C0880F21503109211531055A
|
||||||
|
:1000F000A9F7E617F70771F70895CF93DF93CDB708
|
||||||
|
:10010000DEB72F970FB6F894DEBF0FBECDBF0E94AB
|
||||||
|
:100110004B001FE0E0E0F1E0DE011196812F01903D
|
||||||
|
:100120000D928A95E1F76EE070E0CE0101960E9493
|
||||||
|
:1001300062008F876FE070E0CE0101960E9451004F
|
||||||
|
:06014000E9CFF894FFCFA7
|
||||||
|
:1001460004110405161218110015495059690000CA
|
||||||
|
:00000001FF
|
277
SPI_/SPI_/Debug/SPI_.lss
Normal file
277
SPI_/SPI_/Debug/SPI_.lss
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
|
||||||
|
SPI_.elf: file format elf32-avr
|
||||||
|
|
||||||
|
Sections:
|
||||||
|
Idx Name Size VMA LMA File off Algn
|
||||||
|
0 .data 00000010 00800100 00000146 000001ba 2**0
|
||||||
|
CONTENTS, ALLOC, LOAD, DATA
|
||||||
|
1 .text 00000146 00000000 00000000 00000074 2**1
|
||||||
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||||
|
2 .comment 00000030 00000000 00000000 000001ca 2**0
|
||||||
|
CONTENTS, READONLY
|
||||||
|
3 .debug_aranges 00000068 00000000 00000000 000001fa 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
4 .debug_info 0000039a 00000000 00000000 00000262 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
5 .debug_abbrev 00000275 00000000 00000000 000005fc 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
6 .debug_line 00000173 00000000 00000000 00000871 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
7 .debug_frame 000000a8 00000000 00000000 000009e4 2**2
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
8 .debug_str 000001ac 00000000 00000000 00000a8c 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
9 .debug_loc 00000303 00000000 00000000 00000c38 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
10 .debug_ranges 00000090 00000000 00000000 00000f3b 2**0
|
||||||
|
CONTENTS, READONLY, DEBUGGING
|
||||||
|
|
||||||
|
Disassembly of section .text:
|
||||||
|
|
||||||
|
00000000 <__vectors>:
|
||||||
|
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
|
||||||
|
4: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
8: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
10: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
14: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
18: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
1c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
20: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
24: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
28: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
2c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
30: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
34: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
38: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
3c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
40: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
44: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
48: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
4c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
50: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
54: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
58: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
5c: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
60: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
64: 0c 94 49 00 jmp 0x92 ; 0x92 <__bad_interrupt>
|
||||||
|
|
||||||
|
00000068 <__ctors_end>:
|
||||||
|
68: 11 24 eor r1, r1
|
||||||
|
6a: 1f be out 0x3f, r1 ; 63
|
||||||
|
6c: cf ef ldi r28, 0xFF ; 255
|
||||||
|
6e: d8 e0 ldi r29, 0x08 ; 8
|
||||||
|
70: de bf out 0x3e, r29 ; 62
|
||||||
|
72: cd bf out 0x3d, r28 ; 61
|
||||||
|
|
||||||
|
00000074 <__do_copy_data>:
|
||||||
|
74: 11 e0 ldi r17, 0x01 ; 1
|
||||||
|
76: a0 e0 ldi r26, 0x00 ; 0
|
||||||
|
78: b1 e0 ldi r27, 0x01 ; 1
|
||||||
|
7a: e6 e4 ldi r30, 0x46 ; 70
|
||||||
|
7c: f1 e0 ldi r31, 0x01 ; 1
|
||||||
|
7e: 02 c0 rjmp .+4 ; 0x84 <__do_copy_data+0x10>
|
||||||
|
80: 05 90 lpm r0, Z+
|
||||||
|
82: 0d 92 st X+, r0
|
||||||
|
84: a0 31 cpi r26, 0x10 ; 16
|
||||||
|
86: b1 07 cpc r27, r17
|
||||||
|
88: d9 f7 brne .-10 ; 0x80 <__do_copy_data+0xc>
|
||||||
|
8a: 0e 94 7d 00 call 0xfa ; 0xfa <main>
|
||||||
|
8e: 0c 94 a1 00 jmp 0x142 ; 0x142 <_exit>
|
||||||
|
|
||||||
|
00000092 <__bad_interrupt>:
|
||||||
|
92: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
||||||
|
|
||||||
|
00000096 <SPI_MasterInit>:
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
void SPI_MasterInit(void)
|
||||||
|
{
|
||||||
|
DDR_SPI = (1 << DD_MOSI) | (1 << DD_SCK) | (1 << DD_SS);
|
||||||
|
96: 8c e2 ldi r24, 0x2C ; 44
|
||||||
|
98: 84 b9 out 0x04, r24 ; 4
|
||||||
|
DDRB |= (1<<DDB2);
|
||||||
|
9a: 22 9a sbi 0x04, 2 ; 4
|
||||||
|
SPCR = (1 << SPE) | (1 << MSTR) | (1 << SPR1);
|
||||||
|
9c: 82 e5 ldi r24, 0x52 ; 82
|
||||||
|
9e: 8c bd out 0x2c, r24 ; 44
|
||||||
|
a0: 08 95 ret
|
||||||
|
|
||||||
|
000000a2 <SPI_MasterTransmit>:
|
||||||
|
// SPCR = (1 << SPE) | (1 << MSTR) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SPI_MasterTransmit(char *data, int length)
|
||||||
|
{
|
||||||
|
PORTB &= ~(1<<2);
|
||||||
|
a2: 2a 98 cbi 0x05, 2 ; 5
|
||||||
|
|
||||||
|
for(int i = 0; i < length; i++) {
|
||||||
|
a4: 16 16 cp r1, r22
|
||||||
|
a6: 17 06 cpc r1, r23
|
||||||
|
a8: 5c f4 brge .+22 ; 0xc0 <SPI_MasterTransmit+0x1e>
|
||||||
|
aa: fc 01 movw r30, r24
|
||||||
|
ac: 86 0f add r24, r22
|
||||||
|
ae: 97 1f adc r25, r23
|
||||||
|
SPDR = data[i]; // îòïðàâëÿåì áàéò ìàññèâà
|
||||||
|
b0: 21 91 ld r18, Z+
|
||||||
|
b2: 2e bd out 0x2e, r18 ; 46
|
||||||
|
while (!(SPSR & (1 << SPIF))); // æäåì, ïîêà áàéò ïåðåäàñòñÿ
|
||||||
|
b4: 0d b4 in r0, 0x2d ; 45
|
||||||
|
b6: 07 fe sbrs r0, 7
|
||||||
|
b8: fd cf rjmp .-6 ; 0xb4 <SPI_MasterTransmit+0x12>
|
||||||
|
|
||||||
|
void SPI_MasterTransmit(char *data, int length)
|
||||||
|
{
|
||||||
|
PORTB &= ~(1<<2);
|
||||||
|
|
||||||
|
for(int i = 0; i < length; i++) {
|
||||||
|
ba: e8 17 cp r30, r24
|
||||||
|
bc: f9 07 cpc r31, r25
|
||||||
|
be: c1 f7 brne .-16 ; 0xb0 <SPI_MasterTransmit+0xe>
|
||||||
|
SPDR = data[i]; // îòïðàâëÿåì áàéò ìàññèâà
|
||||||
|
while (!(SPSR & (1 << SPIF))); // æäåì, ïîêà áàéò ïåðåäàñòñÿ
|
||||||
|
}
|
||||||
|
|
||||||
|
PORTB |= (1<<2);
|
||||||
|
c0: 2a 9a sbi 0x05, 2 ; 5
|
||||||
|
c2: 08 95 ret
|
||||||
|
|
||||||
|
000000c4 <crc8>:
|
||||||
|
}
|
||||||
|
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
char crc8(char *data, int len) {
|
||||||
|
c4: fc 01 movw r30, r24
|
||||||
|
c6: 68 0f add r22, r24
|
||||||
|
c8: 79 1f adc r23, r25
|
||||||
|
char crc = 0x00;
|
||||||
|
ca: 80 e0 ldi r24, 0x00 ; 0
|
||||||
|
while (len--) {
|
||||||
|
crc ^= *data++;
|
||||||
|
cc: 58 e0 ldi r21, 0x08 ; 8
|
||||||
|
ce: 40 e0 ldi r20, 0x00 ; 0
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
if (crc & 0x80) {
|
||||||
|
crc = (crc << 1) ^ 0x07;
|
||||||
|
d0: 97 e0 ldi r25, 0x07 ; 7
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
char crc8(char *data, int len) {
|
||||||
|
char crc = 0x00;
|
||||||
|
while (len--) {
|
||||||
|
d2: 0f c0 rjmp .+30 ; 0xf2 <crc8+0x2e>
|
||||||
|
crc ^= *data++;
|
||||||
|
d4: 21 91 ld r18, Z+
|
||||||
|
d6: 82 27 eor r24, r18
|
||||||
|
d8: 25 2f mov r18, r21
|
||||||
|
da: 34 2f mov r19, r20
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
if (crc & 0x80) {
|
||||||
|
dc: 88 23 and r24, r24
|
||||||
|
de: 1c f4 brge .+6 ; 0xe6 <crc8+0x22>
|
||||||
|
crc = (crc << 1) ^ 0x07;
|
||||||
|
e0: 88 0f add r24, r24
|
||||||
|
e2: 89 27 eor r24, r25
|
||||||
|
e4: 01 c0 rjmp .+2 ; 0xe8 <crc8+0x24>
|
||||||
|
} else {
|
||||||
|
crc <<= 1;
|
||||||
|
e6: 88 0f add r24, r24
|
||||||
|
e8: 21 50 subi r18, 0x01 ; 1
|
||||||
|
ea: 31 09 sbc r19, r1
|
||||||
|
|
||||||
|
char crc8(char *data, int len) {
|
||||||
|
char crc = 0x00;
|
||||||
|
while (len--) {
|
||||||
|
crc ^= *data++;
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
ec: 21 15 cp r18, r1
|
||||||
|
ee: 31 05 cpc r19, r1
|
||||||
|
f0: a9 f7 brne .-22 ; 0xdc <crc8+0x18>
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
char crc8(char *data, int len) {
|
||||||
|
char crc = 0x00;
|
||||||
|
while (len--) {
|
||||||
|
f2: e6 17 cp r30, r22
|
||||||
|
f4: f7 07 cpc r31, r23
|
||||||
|
f6: 71 f7 brne .-36 ; 0xd4 <crc8+0x10>
|
||||||
|
crc <<= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
f8: 08 95 ret
|
||||||
|
|
||||||
|
000000fa <main>:
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
fa: cf 93 push r28
|
||||||
|
fc: df 93 push r29
|
||||||
|
fe: cd b7 in r28, 0x3d ; 61
|
||||||
|
100: de b7 in r29, 0x3e ; 62
|
||||||
|
102: 2f 97 sbiw r28, 0x0f ; 15
|
||||||
|
104: 0f b6 in r0, 0x3f ; 63
|
||||||
|
106: f8 94 cli
|
||||||
|
108: de bf out 0x3e, r29 ; 62
|
||||||
|
10a: 0f be out 0x3f, r0 ; 63
|
||||||
|
10c: cd bf out 0x3d, r28 ; 61
|
||||||
|
// Serial.begin(9600);
|
||||||
|
SPI_MasterInit();
|
||||||
|
10e: 0e 94 4b 00 call 0x96 ; 0x96 <SPI_MasterInit>
|
||||||
|
// Serial.println("Master Initialization ");
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
char data[] = {0x04, 0x11, 0x04, 0x05, 0x16, 0x12, 0x18, 0x11, 0x00, 0x15, 0x49, 0x50, 0x59, 0x69, 0};
|
||||||
|
112: 1f e0 ldi r17, 0x0F ; 15
|
||||||
|
114: e0 e0 ldi r30, 0x00 ; 0
|
||||||
|
116: f1 e0 ldi r31, 0x01 ; 1
|
||||||
|
118: de 01 movw r26, r28
|
||||||
|
11a: 11 96 adiw r26, 0x01 ; 1
|
||||||
|
11c: 81 2f mov r24, r17
|
||||||
|
11e: 01 90 ld r0, Z+
|
||||||
|
120: 0d 92 st X+, r0
|
||||||
|
122: 8a 95 dec r24
|
||||||
|
124: e1 f7 brne .-8 ; 0x11e <main+0x24>
|
||||||
|
// Serial.println();
|
||||||
|
// Serial.print("Start: ");
|
||||||
|
// Print(data, length);
|
||||||
|
// Serial.println();
|
||||||
|
|
||||||
|
char checking = crc8(data, length-1);
|
||||||
|
126: 6e e0 ldi r22, 0x0E ; 14
|
||||||
|
128: 70 e0 ldi r23, 0x00 ; 0
|
||||||
|
12a: ce 01 movw r24, r28
|
||||||
|
12c: 01 96 adiw r24, 0x01 ; 1
|
||||||
|
12e: 0e 94 62 00 call 0xc4 ; 0xc4 <crc8>
|
||||||
|
int size = sizeof(data) / sizeof(data[0]);
|
||||||
|
data[size - 1] = checking;
|
||||||
|
132: 8f 87 std Y+15, r24 ; 0x0f
|
||||||
|
|
||||||
|
// Serial.print("End: ");
|
||||||
|
// Print(data, length);
|
||||||
|
// Serial.println();
|
||||||
|
|
||||||
|
SPI_MasterTransmit(data, length);
|
||||||
|
134: 6f e0 ldi r22, 0x0F ; 15
|
||||||
|
136: 70 e0 ldi r23, 0x00 ; 0
|
||||||
|
138: ce 01 movw r24, r28
|
||||||
|
13a: 01 96 adiw r24, 0x01 ; 1
|
||||||
|
13c: 0e 94 51 00 call 0xa2 ; 0xa2 <SPI_MasterTransmit>
|
||||||
|
140: e9 cf rjmp .-46 ; 0x114 <main+0x1a>
|
||||||
|
|
||||||
|
00000142 <_exit>:
|
||||||
|
142: f8 94 cli
|
||||||
|
|
||||||
|
00000144 <__stop_program>:
|
||||||
|
144: ff cf rjmp .-2 ; 0x144 <__stop_program>
|
446
SPI_/SPI_/Debug/SPI_.map
Normal file
446
SPI_/SPI_/Debug/SPI_.map
Normal file
@ -0,0 +1,446 @@
|
|||||||
|
Archive member included because of file (symbol)
|
||||||
|
|
||||||
|
e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o (exit)
|
||||||
|
e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
SPI_.o (__do_copy_data)
|
||||||
|
|
||||||
|
Discarded input sections
|
||||||
|
|
||||||
|
.data 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
.bss 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
.text 0x00000000 0x0 SPIMaster.o
|
||||||
|
.data 0x00000000 0x0 SPIMaster.o
|
||||||
|
.bss 0x00000000 0x0 SPIMaster.o
|
||||||
|
.text.CRC8 0x00000000 0x44 SPIMaster.o
|
||||||
|
.text 0x00000000 0x0 SPI_.o
|
||||||
|
.data 0x00000000 0x0 SPI_.o
|
||||||
|
.bss 0x00000000 0x0 SPI_.o
|
||||||
|
.text.Print 0x00000000 0x14 SPI_.o
|
||||||
|
.text.setup 0x00000000 0x2 SPI_.o
|
||||||
|
.text 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.data 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.bss 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc.mul
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc.div
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc.prologue
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc.builtins
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc.fmul
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text.libgcc.fixed
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
.text 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.data 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.bss 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc.mul
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc.div
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc 0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc.prologue
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc.builtins
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc.fmul
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
.text.libgcc.fixed
|
||||||
|
0x00000000 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
|
||||||
|
Memory Configuration
|
||||||
|
|
||||||
|
Name Origin Length Attributes
|
||||||
|
text 0x00000000 0x00020000 xr
|
||||||
|
data 0x00800060 0x0000ffa0 rw !x
|
||||||
|
eeprom 0x00810000 0x00010000 rw !x
|
||||||
|
fuse 0x00820000 0x00000400 rw !x
|
||||||
|
lock 0x00830000 0x00000400 rw !x
|
||||||
|
signature 0x00840000 0x00000400 rw !x
|
||||||
|
user_signatures 0x00850000 0x00000400 rw !x
|
||||||
|
*default* 0x00000000 0xffffffff
|
||||||
|
|
||||||
|
Linker script and memory map
|
||||||
|
|
||||||
|
Address of section .data set to 0x800100
|
||||||
|
LOAD e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
LOAD SPIMaster.o
|
||||||
|
LOAD SPI_.o
|
||||||
|
START GROUP
|
||||||
|
LOAD e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libm.a
|
||||||
|
END GROUP
|
||||||
|
START GROUP
|
||||||
|
LOAD e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a
|
||||||
|
LOAD e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libm.a
|
||||||
|
LOAD e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5\libc.a
|
||||||
|
END GROUP
|
||||||
|
|
||||||
|
.hash
|
||||||
|
*(.hash)
|
||||||
|
|
||||||
|
.dynsym
|
||||||
|
*(.dynsym)
|
||||||
|
|
||||||
|
.dynstr
|
||||||
|
*(.dynstr)
|
||||||
|
|
||||||
|
.gnu.version
|
||||||
|
*(.gnu.version)
|
||||||
|
|
||||||
|
.gnu.version_d
|
||||||
|
*(.gnu.version_d)
|
||||||
|
|
||||||
|
.gnu.version_r
|
||||||
|
*(.gnu.version_r)
|
||||||
|
|
||||||
|
.rel.init
|
||||||
|
*(.rel.init)
|
||||||
|
|
||||||
|
.rela.init
|
||||||
|
*(.rela.init)
|
||||||
|
|
||||||
|
.rel.text
|
||||||
|
*(.rel.text)
|
||||||
|
*(.rel.text.*)
|
||||||
|
*(.rel.gnu.linkonce.t*)
|
||||||
|
|
||||||
|
.rela.text
|
||||||
|
*(.rela.text)
|
||||||
|
*(.rela.text.*)
|
||||||
|
*(.rela.gnu.linkonce.t*)
|
||||||
|
|
||||||
|
.rel.fini
|
||||||
|
*(.rel.fini)
|
||||||
|
|
||||||
|
.rela.fini
|
||||||
|
*(.rela.fini)
|
||||||
|
|
||||||
|
.rel.rodata
|
||||||
|
*(.rel.rodata)
|
||||||
|
*(.rel.rodata.*)
|
||||||
|
*(.rel.gnu.linkonce.r*)
|
||||||
|
|
||||||
|
.rela.rodata
|
||||||
|
*(.rela.rodata)
|
||||||
|
*(.rela.rodata.*)
|
||||||
|
*(.rela.gnu.linkonce.r*)
|
||||||
|
|
||||||
|
.rel.data
|
||||||
|
*(.rel.data)
|
||||||
|
*(.rel.data.*)
|
||||||
|
*(.rel.gnu.linkonce.d*)
|
||||||
|
|
||||||
|
.rela.data
|
||||||
|
*(.rela.data)
|
||||||
|
*(.rela.data.*)
|
||||||
|
*(.rela.gnu.linkonce.d*)
|
||||||
|
|
||||||
|
.rel.ctors
|
||||||
|
*(.rel.ctors)
|
||||||
|
|
||||||
|
.rela.ctors
|
||||||
|
*(.rela.ctors)
|
||||||
|
|
||||||
|
.rel.dtors
|
||||||
|
*(.rel.dtors)
|
||||||
|
|
||||||
|
.rela.dtors
|
||||||
|
*(.rela.dtors)
|
||||||
|
|
||||||
|
.rel.got
|
||||||
|
*(.rel.got)
|
||||||
|
|
||||||
|
.rela.got
|
||||||
|
*(.rela.got)
|
||||||
|
|
||||||
|
.rel.bss
|
||||||
|
*(.rel.bss)
|
||||||
|
|
||||||
|
.rela.bss
|
||||||
|
*(.rela.bss)
|
||||||
|
|
||||||
|
.rel.plt
|
||||||
|
*(.rel.plt)
|
||||||
|
|
||||||
|
.rela.plt
|
||||||
|
*(.rela.plt)
|
||||||
|
|
||||||
|
.text 0x00000000 0x146
|
||||||
|
*(.vectors)
|
||||||
|
.vectors 0x00000000 0x68 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
0x00000000 __vector_default
|
||||||
|
0x00000000 __vectors
|
||||||
|
*(.vectors)
|
||||||
|
*(.progmem.gcc*)
|
||||||
|
0x00000068 . = ALIGN (0x2)
|
||||||
|
0x00000068 __trampolines_start = .
|
||||||
|
*(.trampolines)
|
||||||
|
.trampolines 0x00000068 0x0 linker stubs
|
||||||
|
*(.trampolines*)
|
||||||
|
0x00000068 __trampolines_end = .
|
||||||
|
*(.progmem*)
|
||||||
|
0x00000068 . = ALIGN (0x2)
|
||||||
|
*(.jumptables)
|
||||||
|
*(.jumptables*)
|
||||||
|
*(.lowtext)
|
||||||
|
*(.lowtext*)
|
||||||
|
0x00000068 __ctors_start = .
|
||||||
|
*(.ctors)
|
||||||
|
0x00000068 __ctors_end = .
|
||||||
|
0x00000068 __dtors_start = .
|
||||||
|
*(.dtors)
|
||||||
|
0x00000068 __dtors_end = .
|
||||||
|
SORT(*)(.ctors)
|
||||||
|
SORT(*)(.dtors)
|
||||||
|
*(.init0)
|
||||||
|
.init0 0x00000068 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
0x00000068 __init
|
||||||
|
*(.init0)
|
||||||
|
*(.init1)
|
||||||
|
*(.init1)
|
||||||
|
*(.init2)
|
||||||
|
.init2 0x00000068 0xc e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
*(.init2)
|
||||||
|
*(.init3)
|
||||||
|
*(.init3)
|
||||||
|
*(.init4)
|
||||||
|
.init4 0x00000074 0x16 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_copy_data.o)
|
||||||
|
0x00000074 __do_copy_data
|
||||||
|
*(.init4)
|
||||||
|
*(.init5)
|
||||||
|
*(.init5)
|
||||||
|
*(.init6)
|
||||||
|
*(.init6)
|
||||||
|
*(.init7)
|
||||||
|
*(.init7)
|
||||||
|
*(.init8)
|
||||||
|
*(.init8)
|
||||||
|
*(.init9)
|
||||||
|
.init9 0x0000008a 0x8 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
*(.init9)
|
||||||
|
*(.text)
|
||||||
|
.text 0x00000092 0x4 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtm328p.o
|
||||||
|
0x00000092 __vector_22
|
||||||
|
0x00000092 __vector_1
|
||||||
|
0x00000092 __vector_24
|
||||||
|
0x00000092 __vector_12
|
||||||
|
0x00000092 __bad_interrupt
|
||||||
|
0x00000092 __vector_6
|
||||||
|
0x00000092 __vector_3
|
||||||
|
0x00000092 __vector_23
|
||||||
|
0x00000092 __vector_25
|
||||||
|
0x00000092 __vector_11
|
||||||
|
0x00000092 __vector_13
|
||||||
|
0x00000092 __vector_17
|
||||||
|
0x00000092 __vector_19
|
||||||
|
0x00000092 __vector_7
|
||||||
|
0x00000092 __vector_5
|
||||||
|
0x00000092 __vector_4
|
||||||
|
0x00000092 __vector_9
|
||||||
|
0x00000092 __vector_2
|
||||||
|
0x00000092 __vector_21
|
||||||
|
0x00000092 __vector_15
|
||||||
|
0x00000092 __vector_8
|
||||||
|
0x00000092 __vector_14
|
||||||
|
0x00000092 __vector_10
|
||||||
|
0x00000092 __vector_16
|
||||||
|
0x00000092 __vector_18
|
||||||
|
0x00000092 __vector_20
|
||||||
|
0x00000096 . = ALIGN (0x2)
|
||||||
|
*(.text.*)
|
||||||
|
.text.SPI_MasterInit
|
||||||
|
0x00000096 0xc SPIMaster.o
|
||||||
|
0x00000096 SPI_MasterInit
|
||||||
|
.text.SPI_MasterTransmit
|
||||||
|
0x000000a2 0x22 SPIMaster.o
|
||||||
|
0x000000a2 SPI_MasterTransmit
|
||||||
|
.text.crc8 0x000000c4 0x36 SPIMaster.o
|
||||||
|
0x000000c4 crc8
|
||||||
|
.text.main 0x000000fa 0x48 SPI_.o
|
||||||
|
0x000000fa main
|
||||||
|
0x00000142 . = ALIGN (0x2)
|
||||||
|
*(.fini9)
|
||||||
|
.fini9 0x00000142 0x0 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
0x00000142 _exit
|
||||||
|
0x00000142 exit
|
||||||
|
*(.fini9)
|
||||||
|
*(.fini8)
|
||||||
|
*(.fini8)
|
||||||
|
*(.fini7)
|
||||||
|
*(.fini7)
|
||||||
|
*(.fini6)
|
||||||
|
*(.fini6)
|
||||||
|
*(.fini5)
|
||||||
|
*(.fini5)
|
||||||
|
*(.fini4)
|
||||||
|
*(.fini4)
|
||||||
|
*(.fini3)
|
||||||
|
*(.fini3)
|
||||||
|
*(.fini2)
|
||||||
|
*(.fini2)
|
||||||
|
*(.fini1)
|
||||||
|
*(.fini1)
|
||||||
|
*(.fini0)
|
||||||
|
.fini0 0x00000142 0x4 e:/atmel toolchain/avr8 gcc/native/3.4.1061/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.8.1/avr5\libgcc.a(_exit.o)
|
||||||
|
*(.fini0)
|
||||||
|
0x00000146 _etext = .
|
||||||
|
|
||||||
|
.data 0x00800100 0x10 load address 0x00000146
|
||||||
|
0x00800100 PROVIDE (__data_start, .)
|
||||||
|
*(.data)
|
||||||
|
*(.data*)
|
||||||
|
*(.rodata)
|
||||||
|
.rodata 0x00800100 0xf SPI_.o
|
||||||
|
*(.rodata*)
|
||||||
|
*(.gnu.linkonce.d*)
|
||||||
|
0x00800110 . = ALIGN (0x2)
|
||||||
|
*fill* 0x0080010f 0x1
|
||||||
|
0x00800110 _edata = .
|
||||||
|
0x00800110 PROVIDE (__data_end, .)
|
||||||
|
|
||||||
|
.bss 0x00800110 0x0
|
||||||
|
0x00800110 PROVIDE (__bss_start, .)
|
||||||
|
*(.bss)
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
0x00800110 PROVIDE (__bss_end, .)
|
||||||
|
0x00000146 __data_load_start = LOADADDR (.data)
|
||||||
|
0x00000156 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||||
|
|
||||||
|
.noinit 0x00800110 0x0
|
||||||
|
0x00800110 PROVIDE (__noinit_start, .)
|
||||||
|
*(.noinit*)
|
||||||
|
0x00800110 PROVIDE (__noinit_end, .)
|
||||||
|
0x00800110 _end = .
|
||||||
|
0x00800110 PROVIDE (__heap_start, .)
|
||||||
|
|
||||||
|
.eeprom 0x00810000 0x0
|
||||||
|
*(.eeprom*)
|
||||||
|
0x00810000 __eeprom_end = .
|
||||||
|
|
||||||
|
.fuse
|
||||||
|
*(.fuse)
|
||||||
|
*(.lfuse)
|
||||||
|
*(.hfuse)
|
||||||
|
*(.efuse)
|
||||||
|
|
||||||
|
.lock
|
||||||
|
*(.lock*)
|
||||||
|
|
||||||
|
.signature
|
||||||
|
*(.signature*)
|
||||||
|
|
||||||
|
.user_signatures
|
||||||
|
*(.user_signatures*)
|
||||||
|
|
||||||
|
.stab
|
||||||
|
*(.stab)
|
||||||
|
|
||||||
|
.stabstr
|
||||||
|
*(.stabstr)
|
||||||
|
|
||||||
|
.stab.excl
|
||||||
|
*(.stab.excl)
|
||||||
|
|
||||||
|
.stab.exclstr
|
||||||
|
*(.stab.exclstr)
|
||||||
|
|
||||||
|
.stab.index
|
||||||
|
*(.stab.index)
|
||||||
|
|
||||||
|
.stab.indexstr
|
||||||
|
*(.stab.indexstr)
|
||||||
|
|
||||||
|
.comment 0x00000000 0x30
|
||||||
|
*(.comment)
|
||||||
|
.comment 0x00000000 0x30 SPIMaster.o
|
||||||
|
0x31 (size before relaxing)
|
||||||
|
.comment 0x00000000 0x31 SPI_.o
|
||||||
|
|
||||||
|
.note.gnu.build-id
|
||||||
|
*(.note.gnu.build-id)
|
||||||
|
|
||||||
|
.debug
|
||||||
|
*(.debug)
|
||||||
|
|
||||||
|
.line
|
||||||
|
*(.line)
|
||||||
|
|
||||||
|
.debug_srcinfo
|
||||||
|
*(.debug_srcinfo)
|
||||||
|
|
||||||
|
.debug_sfnames
|
||||||
|
*(.debug_sfnames)
|
||||||
|
|
||||||
|
.debug_aranges 0x00000000 0x68
|
||||||
|
*(.debug_aranges)
|
||||||
|
.debug_aranges
|
||||||
|
0x00000000 0x38 SPIMaster.o
|
||||||
|
.debug_aranges
|
||||||
|
0x00000038 0x30 SPI_.o
|
||||||
|
|
||||||
|
.debug_pubnames
|
||||||
|
*(.debug_pubnames)
|
||||||
|
|
||||||
|
.debug_info 0x00000000 0x39a
|
||||||
|
*(.debug_info .gnu.linkonce.wi.*)
|
||||||
|
.debug_info 0x00000000 0x1bf SPIMaster.o
|
||||||
|
.debug_info 0x000001bf 0x1db SPI_.o
|
||||||
|
|
||||||
|
.debug_abbrev 0x00000000 0x275
|
||||||
|
*(.debug_abbrev)
|
||||||
|
.debug_abbrev 0x00000000 0x105 SPIMaster.o
|
||||||
|
.debug_abbrev 0x00000105 0x170 SPI_.o
|
||||||
|
|
||||||
|
.debug_line 0x00000000 0x173
|
||||||
|
*(.debug_line .debug_line.* .debug_line_end)
|
||||||
|
.debug_line 0x00000000 0xee SPIMaster.o
|
||||||
|
.debug_line 0x000000ee 0x85 SPI_.o
|
||||||
|
|
||||||
|
.debug_frame 0x00000000 0xa8
|
||||||
|
*(.debug_frame)
|
||||||
|
.debug_frame 0x00000000 0x54 SPIMaster.o
|
||||||
|
.debug_frame 0x00000054 0x54 SPI_.o
|
||||||
|
|
||||||
|
.debug_str 0x00000000 0x1ac
|
||||||
|
*(.debug_str)
|
||||||
|
.debug_str 0x00000000 0x16b SPIMaster.o
|
||||||
|
0x1a4 (size before relaxing)
|
||||||
|
.debug_str 0x0000016b 0x41 SPI_.o
|
||||||
|
0x1c2 (size before relaxing)
|
||||||
|
|
||||||
|
.debug_loc 0x00000000 0x303
|
||||||
|
*(.debug_loc)
|
||||||
|
.debug_loc 0x00000000 0x253 SPIMaster.o
|
||||||
|
.debug_loc 0x00000253 0xb0 SPI_.o
|
||||||
|
|
||||||
|
.debug_macinfo
|
||||||
|
*(.debug_macinfo)
|
||||||
|
|
||||||
|
.debug_weaknames
|
||||||
|
*(.debug_weaknames)
|
||||||
|
|
||||||
|
.debug_funcnames
|
||||||
|
*(.debug_funcnames)
|
||||||
|
|
||||||
|
.debug_typenames
|
||||||
|
*(.debug_typenames)
|
||||||
|
|
||||||
|
.debug_varnames
|
||||||
|
*(.debug_varnames)
|
||||||
|
|
||||||
|
.debug_pubtypes
|
||||||
|
*(.debug_pubtypes)
|
||||||
|
|
||||||
|
.debug_ranges 0x00000000 0x90
|
||||||
|
*(.debug_ranges)
|
||||||
|
.debug_ranges 0x00000000 0x70 SPIMaster.o
|
||||||
|
.debug_ranges 0x00000070 0x20 SPI_.o
|
||||||
|
|
||||||
|
.debug_macro
|
||||||
|
*(.debug_macro)
|
||||||
|
OUTPUT(SPI_.elf elf32-avr)
|
||||||
|
LOAD linker stubs
|
BIN
SPI_/SPI_/Debug/SPI_.o
Normal file
BIN
SPI_/SPI_/Debug/SPI_.o
Normal file
Binary file not shown.
24
SPI_/SPI_/Debug/SPI_.srec
Normal file
24
SPI_/SPI_/Debug/SPI_.srec
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
S00C00005350495F2E73726563CD
|
||||||
|
S11300000C9434000C9449000C9449000C9449005D
|
||||||
|
S11300100C9449000C9449000C9449000C94490038
|
||||||
|
S11300200C9449000C9449000C9449000C94490028
|
||||||
|
S11300300C9449000C9449000C9449000C94490018
|
||||||
|
S11300400C9449000C9449000C9449000C94490008
|
||||||
|
S11300500C9449000C9449000C9449000C944900F8
|
||||||
|
S11300600C9449000C94490011241FBECFEFD8E032
|
||||||
|
S1130070DEBFCDBF11E0A0E0B1E0E6E4F1E002C0F4
|
||||||
|
S113008005900D92A031B107D9F70E947D000C9420
|
||||||
|
S1130090A1000C9400008CE284B9229A82E58CBD04
|
||||||
|
S11300A008952A98161617065CF4FC01860F971F0C
|
||||||
|
S11300B021912EBD0DB407FEFDCFE817F907C1F756
|
||||||
|
S11300C02A9A0895FC01680F791F80E058E040E007
|
||||||
|
S11300D097E00FC021918227252F342F88231CF409
|
||||||
|
S11300E0880F892701C0880F215031092115310556
|
||||||
|
S11300F0A9F7E617F70771F70895CF93DF93CDB704
|
||||||
|
S1130100DEB72F970FB6F894DEBF0FBECDBF0E94A7
|
||||||
|
S11301104B001FE0E0E0F1E0DE011196812F019039
|
||||||
|
S11301200D928A95E1F76EE070E0CE0101960E948F
|
||||||
|
S113013062008F876FE070E0CE0101960E9451004B
|
||||||
|
S1090140E9CFF894FFCFA3
|
||||||
|
S113014604110405161218110015495059690000C6
|
||||||
|
S9030000FC
|
8
SPI_/SPI_/Debug/makedep.mk
Normal file
8
SPI_/SPI_/Debug/makedep.mk
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
################################################################################
|
||||||
|
# Automatically-generated file. Do not edit or delete the file
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
SPIMaster.c
|
||||||
|
|
||||||
|
SPI_.c
|
||||||
|
|
65
SPI_/SPI_/SPIMaster.c
Normal file
65
SPI_/SPI_/SPIMaster.c
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* SPIMaster.c
|
||||||
|
*
|
||||||
|
* Created: 22.05.2023 14:36:51
|
||||||
|
* Author: asus
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SPIMaster.h"
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
void SPI_MasterInit(void)
|
||||||
|
{
|
||||||
|
DDR_SPI = (1 << DD_MOSI) | (1 << DD_SCK) | (1 << DD_SS);
|
||||||
|
DDRB |= (1<<DDB2);
|
||||||
|
SPCR = (1 << SPE) | (1 << MSTR) | (1 << SPR1);
|
||||||
|
// SPCR = (1 << SPE) | (1 << MSTR) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SPI_MasterTransmit(char *data, int length)
|
||||||
|
{
|
||||||
|
PORTB &= ~(1<<2);
|
||||||
|
|
||||||
|
for(int i = 0; i < length; i++) {
|
||||||
|
SPDR = data[i]; // îòïðàâëÿåì áàéò ìàññèâà
|
||||||
|
while (!(SPSR & (1 << SPIF))); // æäåì, ïîêà áàéò ïåðåäàñòñÿ
|
||||||
|
}
|
||||||
|
|
||||||
|
PORTB |= (1<<2);
|
||||||
|
}
|
||||||
|
|
||||||
|
char CRC8(char *data, int length) {
|
||||||
|
char crc = 0x00;
|
||||||
|
char poly = 0x07; // ïîëèíîì äëÿ CRC8
|
||||||
|
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
crc ^= data[i]; // XOR òåêóùåãî áàéòà ñ crc
|
||||||
|
|
||||||
|
for (int j = 0; j < length; j++) {
|
||||||
|
if (crc & 0x80) { // åñëè ñòàðøèé áèò crc ðàâåí 1
|
||||||
|
crc = (crc << 1) ^ poly; // ñäâèãàåì crc íà 1 áèò âëåâî è XOR ñ ïîëèíîìîì
|
||||||
|
} else {
|
||||||
|
crc <<= 1; // èíà÷å ïðîñòî ñäâèãàåì íà 1 áèò âëåâî
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
char crc8(char *data, int len) {
|
||||||
|
char crc = 0x00;
|
||||||
|
while (len--) {
|
||||||
|
crc ^= *data++;
|
||||||
|
for (int i = 0; i < 8; i++) {
|
||||||
|
if (crc & 0x80) {
|
||||||
|
crc = (crc << 1) ^ 0x07;
|
||||||
|
} else {
|
||||||
|
crc <<= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return crc;
|
||||||
|
}
|
30
SPI_/SPI_/SPIMaster.h
Normal file
30
SPI_/SPI_/SPIMaster.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* SPIMaster.h
|
||||||
|
*
|
||||||
|
* Created: 22.05.2023 14:36:20
|
||||||
|
* Author: asus
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SPIMaster_h
|
||||||
|
#define SPIMaster_h
|
||||||
|
|
||||||
|
#define DDR_SPI DDRB
|
||||||
|
#define DD_MOSI PB3
|
||||||
|
#define DD_MISO PB4
|
||||||
|
#define DD_SCK PB5
|
||||||
|
#define DD_SS PB2
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void SPI_MasterInit(void);
|
||||||
|
void SPI_MasterTransmit(char *data, int length);
|
||||||
|
char CRC8(char *data, int length);
|
||||||
|
char crc8(char *data, int len);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
70
SPI_/SPI_/SPI_.c
Normal file
70
SPI_/SPI_/SPI_.c
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* SPI_.c
|
||||||
|
*
|
||||||
|
* Created: 22.05.2023 14:31:15
|
||||||
|
* Author: asus
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include "SPIMaster.h"
|
||||||
|
|
||||||
|
|
||||||
|
void Print(char *data2, int lenght){
|
||||||
|
for(int i = 0; i < lenght; i++) {
|
||||||
|
// Serial.print(data2[i], HEX);
|
||||||
|
// Serial.print(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int printf( const char * format, ... )
|
||||||
|
{
|
||||||
|
char buffer[16];
|
||||||
|
va_list args;
|
||||||
|
va_start (args, format);
|
||||||
|
size_t s = vsprintf (buffer,format, args);
|
||||||
|
for(size_t i = 0; i < s; i++){
|
||||||
|
while (!(UCSR0A & (1<<UDREn)));
|
||||||
|
UDR0 = buffer[i];
|
||||||
|
}
|
||||||
|
va_end (args);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
// Serial.begin(9600);
|
||||||
|
SPI_MasterInit();
|
||||||
|
printf("MAster Init .....");
|
||||||
|
// Serial.println("Master Initialization ");
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
char data[] = {0x04, 0x11, 0x04, 0x05, 0x16, 0x12, 0x18, 0x11, 0x00, 0x15, 0x49, 0x50, 0x59, 0x69, 0};
|
||||||
|
int length = sizeof(data);
|
||||||
|
printf(data);
|
||||||
|
// Serial.println();
|
||||||
|
// Serial.print("Start: ");
|
||||||
|
// Print(data, length);
|
||||||
|
// Serial.println();
|
||||||
|
|
||||||
|
char checking = crc8(data, length-1);
|
||||||
|
int size = sizeof(data) / sizeof(data[0]);
|
||||||
|
data[size - 1] = checking;
|
||||||
|
// Serial.println(checking, HEX);
|
||||||
|
|
||||||
|
// Serial.print("End: ");
|
||||||
|
// Print(data, length);
|
||||||
|
// Serial.println();
|
||||||
|
|
||||||
|
SPI_MasterTransmit(data, length);
|
||||||
|
// delay(1000);
|
||||||
|
}
|
||||||
|
}
|
110
SPI_/SPI_/SPI_.cproj
Normal file
110
SPI_/SPI_/SPI_.cproj
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectVersion>6.2</ProjectVersion>
|
||||||
|
<ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
|
||||||
|
<ProjectGuid>{37275dfd-0ce5-467a-9f25-7a9e49ff51c2}</ProjectGuid>
|
||||||
|
<avrdevice>ATmega328P</avrdevice>
|
||||||
|
<avrdeviceseries>none</avrdeviceseries>
|
||||||
|
<OutputType>Executable</OutputType>
|
||||||
|
<Language>C</Language>
|
||||||
|
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||||
|
<OutputFileExtension>.elf</OutputFileExtension>
|
||||||
|
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||||
|
<AssemblyName>SPI_</AssemblyName>
|
||||||
|
<Name>SPI_</Name>
|
||||||
|
<RootNamespace>SPI_</RootNamespace>
|
||||||
|
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||||
|
<KeepTimersRunning>true</KeepTimersRunning>
|
||||||
|
<OverrideVtor>false</OverrideVtor>
|
||||||
|
<CacheFlash>true</CacheFlash>
|
||||||
|
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||||
|
<RamSnippetAddress />
|
||||||
|
<UncachedRange />
|
||||||
|
<preserveEEPROM>true</preserveEEPROM>
|
||||||
|
<OverrideVtorValue />
|
||||||
|
<BootSegment>2</BootSegment>
|
||||||
|
<eraseonlaunchrule>1</eraseonlaunchrule>
|
||||||
|
<AsfFrameworkConfig>
|
||||||
|
<framework-data xmlns="">
|
||||||
|
<options />
|
||||||
|
<configurations />
|
||||||
|
<files />
|
||||||
|
<documentation help="" />
|
||||||
|
<offline-documentation help="" />
|
||||||
|
<dependencies>
|
||||||
|
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.21.0" />
|
||||||
|
</dependencies>
|
||||||
|
</framework-data>
|
||||||
|
</AsfFrameworkConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<ToolchainSettings>
|
||||||
|
<AvrGcc>
|
||||||
|
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||||
|
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||||
|
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||||
|
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||||
|
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||||
|
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||||
|
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||||
|
<avrgcc.compiler.symbols.DefSymbols>
|
||||||
|
<ListValues>
|
||||||
|
<Value>NDEBUG</Value>
|
||||||
|
</ListValues>
|
||||||
|
</avrgcc.compiler.symbols.DefSymbols>
|
||||||
|
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
||||||
|
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||||
|
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||||
|
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||||
|
<avrgcc.linker.libraries.Libraries>
|
||||||
|
<ListValues>
|
||||||
|
<Value>libm</Value>
|
||||||
|
</ListValues>
|
||||||
|
</avrgcc.linker.libraries.Libraries>
|
||||||
|
</AvrGcc>
|
||||||
|
</ToolchainSettings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
|
<ToolchainSettings>
|
||||||
|
<AvrGcc>
|
||||||
|
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||||
|
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||||
|
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||||
|
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||||
|
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||||
|
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||||
|
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||||
|
<avrgcc.compiler.symbols.DefSymbols>
|
||||||
|
<ListValues>
|
||||||
|
<Value>DEBUG</Value>
|
||||||
|
</ListValues>
|
||||||
|
</avrgcc.compiler.symbols.DefSymbols>
|
||||||
|
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
||||||
|
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||||
|
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||||
|
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
|
||||||
|
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||||
|
<avrgcc.linker.libraries.Libraries>
|
||||||
|
<ListValues>
|
||||||
|
<Value>libm</Value>
|
||||||
|
</ListValues>
|
||||||
|
</avrgcc.linker.libraries.Libraries>
|
||||||
|
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
|
||||||
|
</AvrGcc>
|
||||||
|
</ToolchainSettings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="SPIMaster.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SPIMaster.h">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SPI_.c">
|
||||||
|
<SubType>compile</SubType>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user