Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
avrkurs
avrkurs
Commits
55bcbee3
Commit
55bcbee3
authored
Mar 24, 2018
by
Petter Breedveld
Browse files
OLED fix
OLD now working again. EXT header can be selected through a define in spi.h
parent
f0484545
Changes
8
Hide whitespace changes
Inline
Side-by-side
Session3-LF/Task2_LF/Task2_LF/Task2_LF.componentinfo.xml
View file @
55bcbee3
<?xml version="1.0" encoding="utf-8"?>
<Store
xmlns:i=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"AtmelPackComponentManagement"
>
<ProjectComponents>
<ProjectComponent
z:Id=
"i1"
xmlns:z=
"http://schemas.microsoft.com/2003/10/Serialization/"
>
<CApiVersion></CApiVersion>
<CBundle></CBundle>
<CClass>
Device
</CClass>
<CGroup>
Startup
</CGroup>
<CSub></CSub>
<CVariant></CVariant>
<CVendor>
Atmel
</CVendor>
<CVersion>
1.1.0
</CVersion>
<DefaultRepoPath>
D:/Atmel\7.0\Packs
</DefaultRepoPath>
<DependentComponents
xmlns:d4p1=
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"
/>
<Description></Description>
<Files
xmlns:d4p1=
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"
>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\include
</AbsolutePath>
<Attribute></Attribute>
<Category>
include
</Category>
<Condition>
C
</Condition>
<FileContentHash
i:nil=
"true"
/>
<FileVersion></FileVersion>
<Name>
include
</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\include\avr\iotn817.h
</AbsolutePath>
<Attribute></Attribute>
<Category>
header
</Category>
<Condition>
C
</Condition>
<FileContentHash>
GzsE/dwQAz37AkZENa/sHg==
</FileContentHash>
<FileVersion></FileVersion>
<Name>
include/avr/iotn817.h
</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\templates\main.c
</AbsolutePath>
<Attribute>
template
</Attribute>
<Category>
source
</Category>
<Condition>
C Exe
</Condition>
<FileContentHash>
RtJJIrracgoBJUhAmsGN5g==
</FileContentHash>
<FileVersion></FileVersion>
<Name>
templates/main.c
</Name>
<SelectString>
Main file (.c)
</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\templates\main.cpp
</AbsolutePath>
<Attribute>
template
</Attribute>
<Category>
source
</Category>
<Condition>
C Exe
</Condition>
<FileContentHash>
YXFphlh0CtZJU+ebktABgQ==
</FileContentHash>
<FileVersion></FileVersion>
<Name>
templates/main.cpp
</Name>
<SelectString>
Main file (.cpp)
</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny817
</AbsolutePath>
<Attribute></Attribute>
<Category>
libraryPrefix
</Category>
<Condition>
GCC
</Condition>
<FileContentHash
i:nil=
"true"
/>
<FileVersion></FileVersion>
<Name>
gcc/dev/attiny817
</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
</Files>
<PackName>
ATtiny_DFP
</PackName>
<PackPath>
D:/Atmel/7.0/Packs/atmel/ATtiny_DFP/1.1.102/Atmel.ATtiny_DFP.pdsc
</PackPath>
<PackVersion>
1.1.102
</PackVersion>
<PresentInProject>
true
</PresentInProject>
<ReferenceConditionId>
ATtiny817
</ReferenceConditionId>
<RteComponents
xmlns:d4p1=
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"
>
<d4p1:string></d4p1:string>
</RteComponents>
<Status>
Resolved
</Status>
<VersionMode>
Fixed
</VersionMode>
<IsComponentInAtProject>
true
</IsComponentInAtProject>
</ProjectComponent>
</ProjectComponents>
<?xml version="1.0" encoding="utf-8"?>
<Store
xmlns:i=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"AtmelPackComponentManagement"
>
<ProjectComponents>
<ProjectComponent
z:Id=
"i1"
xmlns:z=
"http://schemas.microsoft.com/2003/10/Serialization/"
>
<CApiVersion></CApiVersion>
<CBundle></CBundle>
<CClass>
Device
</CClass>
<CGroup>
Startup
</CGroup>
<CSub></CSub>
<CVariant></CVariant>
<CVendor>
Atmel
</CVendor>
<CVersion>
1.1.0
</CVersion>
<DefaultRepoPath>
D:/Atmel\7.0\Packs
</DefaultRepoPath>
<DependentComponents
xmlns:d4p1=
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"
/>
<Description></Description>
<Files
xmlns:d4p1=
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"
>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\include
</AbsolutePath>
<Attribute></Attribute>
<Category>
include
</Category>
<Condition>
C
</Condition>
<FileContentHash
i:nil=
"true"
/>
<FileVersion></FileVersion>
<Name>
include
</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\include\avr\iotn817.h
</AbsolutePath>
<Attribute></Attribute>
<Category>
header
</Category>
<Condition>
C
</Condition>
<FileContentHash>
GzsE/dwQAz37AkZENa/sHg==
</FileContentHash>
<FileVersion></FileVersion>
<Name>
include/avr/iotn817.h
</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\templates\main.c
</AbsolutePath>
<Attribute>
template
</Attribute>
<Category>
source
</Category>
<Condition>
C Exe
</Condition>
<FileContentHash>
RtJJIrracgoBJUhAmsGN5g==
</FileContentHash>
<FileVersion></FileVersion>
<Name>
templates/main.c
</Name>
<SelectString>
Main file (.c)
</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\templates\main.cpp
</AbsolutePath>
<Attribute>
template
</Attribute>
<Category>
source
</Category>
<Condition>
C Exe
</Condition>
<FileContentHash>
YXFphlh0CtZJU+ebktABgQ==
</FileContentHash>
<FileVersion></FileVersion>
<Name>
templates/main.cpp
</Name>
<SelectString>
Main file (.cpp)
</SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
<d4p1:anyType
i:type=
"FileInfo"
>
<AbsolutePath>
D:/Atmel\7.0\Packs\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny817
</AbsolutePath>
<Attribute></Attribute>
<Category>
libraryPrefix
</Category>
<Condition>
GCC
</Condition>
<FileContentHash
i:nil=
"true"
/>
<FileVersion></FileVersion>
<Name>
gcc/dev/attiny817
</Name>
<SelectString></SelectString>
<SourcePath></SourcePath>
</d4p1:anyType>
</Files>
<PackName>
ATtiny_DFP
</PackName>
<PackPath>
D:/Atmel/7.0/Packs/atmel/ATtiny_DFP/1.1.102/Atmel.ATtiny_DFP.pdsc
</PackPath>
<PackVersion>
1.1.102
</PackVersion>
<PresentInProject>
true
</PresentInProject>
<ReferenceConditionId>
ATtiny817
</ReferenceConditionId>
<RteComponents
xmlns:d4p1=
"http://schemas.microsoft.com/2003/10/Serialization/Arrays"
>
<d4p1:string></d4p1:string>
</RteComponents>
<Status>
Resolved
</Status>
<VersionMode>
Fixed
</VersionMode>
<IsComponentInAtProject>
true
</IsComponentInAtProject>
</ProjectComponent>
</ProjectComponents>
</Store>
\ No newline at end of file
Session3-LF/Task2_LF/Task2_LF/Task2_LF.cproj
View file @
55bcbee3
<?xml version="1.0" encoding="utf-8"?>
<Project
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion=
"14.0"
>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
<ProjectVersion>
7.0
</ProjectVersion>
<ToolchainName>
com.Atmel.AVRGCC8.C
</ToolchainName>
<ProjectGuid>
dce6c7e3-ee26-4d79-826b-08594b9ad897
</ProjectGuid>
<avrdevice>
ATtiny817
</avrdevice>
<avrdeviceseries>
none
</avrdeviceseries>
<OutputType>
Executable
</OutputType>
<Language>
C
</Language>
<OutputFileName>
$(MSBuildProjectName)
</OutputFileName>
<OutputFileExtension>
.elf
</OutputFileExtension>
<OutputDirectory>
$(MSBuildProjectDirectory)\$(Configuration)
</OutputDirectory>
<AssemblyName>
Task2_LF
</AssemblyName>
<Name>
Task2_LF
</Name>
<RootNamespace>
Task2_LF
</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>
0
</eraseonlaunchrule>
<AsfFrameworkConfig>
<framework-data
xmlns=
""
>
<options
/>
<configurations
/>
<files
/>
<documentation
help=
""
/>
<offline-documentation
help=
""
/>
<dependencies>
<content-extension
eid=
"atmel.asf"
uuidref=
"Atmel.ASF"
version=
"3.32.0"
/>
</dependencies>
</framework-data>
</AsfFrameworkConfig>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)' == 'Release' "
>
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>
-mmcu=attiny817 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny817"
</avrgcc.common.Device>
<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.directories.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<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.assembler.general.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)' == 'Debug' "
>
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>
-mmcu=attiny817 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny817"
</avrgcc.common.Device>
<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.directories.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<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.general.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>
Default (-Wa,-g)
</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"display.c"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"display.h"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"font8x8.h"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"main.c"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"spi.c"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"spi.h"
>
<SubType>
compile
</SubType>
</Compile>
</ItemGroup>
<Import
Project=
"$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets"
/>
<?xml version="1.0" encoding="utf-8"?>
<Project
DefaultTargets=
"Build"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion=
"14.0"
>
<PropertyGroup>
<SchemaVersion>
2.0
</SchemaVersion>
<ProjectVersion>
7.0
</ProjectVersion>
<ToolchainName>
com.Atmel.AVRGCC8.C
</ToolchainName>
<ProjectGuid>
dce6c7e3-ee26-4d79-826b-08594b9ad897
</ProjectGuid>
<avrdevice>
ATtiny817
</avrdevice>
<avrdeviceseries>
none
</avrdeviceseries>
<OutputType>
Executable
</OutputType>
<Language>
C
</Language>
<OutputFileName>
$(MSBuildProjectName)
</OutputFileName>
<OutputFileExtension>
.elf
</OutputFileExtension>
<OutputDirectory>
$(MSBuildProjectDirectory)\$(Configuration)
</OutputDirectory>
<AssemblyName>
Task2_LF
</AssemblyName>
<Name>
Task2_LF
</Name>
<RootNamespace>
Task2_LF
</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>
0
</eraseonlaunchrule>
<AsfFrameworkConfig>
<framework-data
xmlns=
""
>
<options
/>
<configurations
/>
<files
/>
<documentation
help=
""
/>
<offline-documentation
help=
""
/>
<dependencies>
<content-extension
eid=
"atmel.asf"
uuidref=
"Atmel.ASF"
version=
"3.32.0"
/>
</dependencies>
</framework-data>
</AsfFrameworkConfig>
<ResetRule>
0
</ResetRule>
<EraseKey
/>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)' == 'Release' "
>
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>
-mmcu=attiny817 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny817"
</avrgcc.common.Device>
<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.directories.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<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.assembler.general.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)' == 'Debug' "
>
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>
-mmcu=attiny817 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\gcc\dev\attiny817"
</avrgcc.common.Device>
<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.directories.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<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.general.IncludePaths>
<ListValues>
<Value>
%24(PackRepoDir)\atmel\ATtiny_DFP\1.1.102\include
</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>
Default (-Wa,-g)
</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"display.c"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"display.h"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"font8x8.h"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"main.c"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"spi.c"
>
<SubType>
compile
</SubType>
</Compile>
<Compile
Include=
"spi.h"
>
<SubType>
compile
</SubType>
</Compile>
</ItemGroup>
<Import
Project=
"$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets"
/>
</Project>
\ No newline at end of file
Session3-LF/Task2_LF/Task2_LF/display.c
View file @
55bcbee3
...
...
@@ -4,14 +4,6 @@
#define F_CPU 3333333UL
#define DSP_MODE_bm 1<<5
#define DSP_MODE_PORT PORTC
#define DSP_RST_bm 1<<5
#define DSP_RST_PORT PORTB
// System headers
#include <avr/io.h>
#include <util/delay.h>
...
...
@@ -23,6 +15,27 @@
#include "font8x8.h"
//From spi.h:
#ifndef EXT3 // for using EXT1 header:
#define DSP_MODE_bm (1 << 7)
#define DSP_MODE_PORT PORTB
#define DSP_RST_bm (1 << 4)
#define DSP_RST_PORT PORTA
#else //For using EXT3 header:
#define DSP_MODE_bm (1 << 5)
#define DSP_MODE_PORT PORTC
#define DSP_RST_bm (1 << 5)
#define DSP_RST_PORT PORTB
#endif
/* EXT3 */
// This file contains a simple driver for the display so that one can print characters and strings.
// You shouldn't need to do anything in this file for things to work.
// Of course, you're welcome to check it out if you want to see how things work under the hood.
...
...
Session3-LF/Task2_LF/Task2_LF/main.c
View file @
55bcbee3
...
...
@@ -11,20 +11,6 @@
#include "display.h"
/*
In this exercise you will write a driver for the SPI module. You will connect the OLED screen to the EXT3 header
and use your SPI driver to write bitmaps and text to the screen.
A finished driver for the screen is provided (display.c), as as a font for it. These build uppon the SPI driver.
You can read display.h to see what functions you can use with the screen.
No help beyond the function headers is provided. To start, it's recommend you:
a) glance over the chapter on SPI in the ATtiny817 datasheet
b) find out what pins of the ATtiny the screen is connected to
*/
const
uint8_t
bitmap
[
512
]
PROGMEM
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
...
...
@@ -64,14 +50,16 @@ const uint8_t bitmap[512] PROGMEM =
int
main
(
void
)
{
// The EXT header can be selected though a define in spi.h
DISP_init
();
DISP_write_bitmap
(
bitmap
);
//Printing Bitmap
//DISP_print("Hello World!"); //Printing text
while
(
1
)
{
}
}
Session3-LF/Task2_LF/Task2_LF/spi.c
View file @
55bcbee3
...
...
@@ -9,17 +9,30 @@
// Project headers
#include "spi.h"
// In this file, you will need to write the contents of the SPI communication routines.
// You need to setup SPI communication in SPI_MasterInit() and
// transmit data in SPI_MasterTransmit(...).
//
// HINT: Check out the defines in the file defines.h to see defines
// such as data direction registers and bit positions, and as always:
// RTFD
//Oled is connected to alternate SPI pins
#define MOSI_bm 1<<2 //on port C
#define SCK_bm 1<<0 //on port C
#define SS_bm 1<<3 //on port A
#define SPI_PORT PORTC //We can now use SPI_PORT.DIR, .OUT etc.
#define SS_PORT PORTA //SS is on a different port
#define MOSI_bm (1 << 2) //on port C
#define SCK_bm (1 << 0) //on port C
#define SPI_PORT PORTC //
//We could also have defined bit positions for MOSI, SCL and SS.
#ifndef EXT3 // for using EXT1 header:
#define SS_bm (1 << 3)
#define SS_PORT PORTC
#else // for using EXT3 header:
#define SS_bm (1 << 3)
#define SS_PORT PORTA
#endif
/* EXT3 */
void
SPI_MasterInit
()
...
...
@@ -27,42 +40,38 @@ void SPI_MasterInit()
// Initialize the SPI port as master
// You will need to set MOSI, SCK, SS (slave select) as outputs
//Connect OLED to EXT3
PORTMUX
.
CTRLB
|=
PORTMUX_SPI0_bm
;
//To use alternative SPI pins
PORTMUX
.
CTRLB
|=
(
PORTMUX_SPI0_bm
);
//To use alternative SPI pins
SPI_PORT
.
DIR
|
=
MOSI_bm
|
SCK_bm
;
//Set pins as output
SS_PORT
.
DIR
|
=
SS_bm
;
SPI_PORT
.
DIR
SET
=
(
MOSI_bm
)
|
(
SCK_bm
)
;
//Set pins as output
SS_PORT
.
DIR
SET
=
(
SS_bm
)
;
SS_PORT
.
OUTSET
=
SS_bm
;
//Set SS high -> OLED inactive
SS_PORT
.
OUTSET
=
(
SS_bm
)
;
//Set SS high -> OLED inactive
// Now enable SPI, Master and set clock rate
SPI0
.
CTRLA
|=
SPI_ENABLE_bm
|
SPI_MASTER_bm
;
//Default clock divisor of 4 is fine
SPI0
.
CTRLA
|=
(
SPI_ENABLE_bm
)
|
(
SPI_MASTER_bm
)
;
//Default clock divisor of 4 is fine
//Make sure SS does not disable master mode
(Possibly not required)
SPI0
.
CTRLB
|=
SPI_SSD_bm
;
//Make sure SS does not disable master mode
SPI0
.
CTRLB
|=
(
SPI_SSD_bm
)
;
}
void
SPI_MasterTransmit
(
char
cData
)
{
// First select the correct slave by setting
its
slave select (SS) LOW
SS_PORT
.
OUTCLR
=
SS_bm
;
// First select the correct slave by setting
the
slave select (SS)
bit
LOW
SS_PORT
.
OUTCLR
=
(
SS_bm
)
;