Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
189 changes: 189 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
x64/
build/
bld/
[Bb]in/
[Oo]bj/

# Roslyn cache directories
*.ide/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml

# NuGet Packages Directory
packages/*
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config

# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
# This line needs to be after the ignore of the build folder
# (and the packages folder if the line above has been uncommented)
!packages/build/

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
7 changes: 6 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# ST7565-LCD

This fork of the Adafruit ST7565-LCD library includes the changes required to run the library on an Intel Galileo using Windows. It also includes changes to enable you to choose either HW or SW SPI (using spi.h).

=== Original Readme ===
There are two 'versions' of the LCD library - one is straightup avr-gcc and the other is an Arduino Library. They're essentially the same.

You can create new icons for bitmapdisplaying using bmp2glcd

for More Information see http://www.ladyada.net/learn/lcd/st7565.html

have fun!
limor
limor
24 changes: 20 additions & 4 deletions ST7565/ST7565.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

//#include <Wire.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <stdlib.h>
#if defined (WIN32)
#include "arduino.h"
#include <stdlib.h>
#else
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <stdlib.h>
#endif

// Turn on HW SPI by defining the _HWSPI_ identifier
#define _HWSPI_

#include "ST7565.h"

Expand All @@ -37,7 +45,7 @@ uint8_t is_reversed = 0;
const uint8_t pagemap[] = { 3, 2, 1, 0, 7, 6, 5, 4 };

// a 5x7 font table
const extern uint8_t PROGMEM font[];
extern "C" const uint8_t PROGMEM font[];

// the memory buffer for the LCD
uint8_t st7565_buffer[1024] = {
Expand Down Expand Up @@ -387,6 +395,10 @@ void ST7565::st7565_init(void) {
pinMode(rst, OUTPUT);
pinMode(cs, OUTPUT);

#ifdef _HWSPI_
SPI.begin();
#endif

// toggle RST low to reset; CS low so it'll listen to us
if (cs > 0)
digitalWrite(cs, LOW);
Expand Down Expand Up @@ -433,7 +445,11 @@ void ST7565::st7565_init(void) {
}

inline void ST7565::spiwrite(uint8_t c) {
#ifdef _HWSPI_
SPI.transfer(c);
#else
shiftOut(sid, sclk, MSBFIRST, c);
#endif
/*
int8_t i;
for (i=7; i>=0; i--) {
Expand Down
12 changes: 12 additions & 0 deletions ST7565/ST7565.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "WProgram.h"
#endif

#if defined(WIN32)
#define PROGMEM
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
typedef unsigned char prog_uchar;
#define _delay_ms(int) delay(int)
#endif

#if defined(_HWSPI_)
#include "spi.h"
#endif

#define swap(a, b) { uint8_t t = a; a = b; b = t; }

#define BLACK 1
Expand Down
24 changes: 24 additions & 0 deletions ST7565/examples/Galileo-st7565lcd/Galileo-st7565lcd.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Galileo-st7565lcd", "Galileo-st7565lcd\Galileo-st7565lcd.vcxproj", "{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}.Debug|Win32.ActiveCfg = Debug|Win32
{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}.Debug|Win32.Build.0 = Debug|Win32
{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}.Debug|Win32.Deploy.0 = Debug|Win32
{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}.Release|Win32.ActiveCfg = Release|Win32
{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}.Release|Win32.Build.0 = Release|Win32
{7E7264F1-FDB7-4506-83BB-EFE838FD90BE}.Release|Win32.Deploy.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading