Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
; LCD.s ; Student names: change this to your names or look very silly ; Last modification date: change this to the last modification date or look very silly ; Runs on LM4F120/TM4C123 ; Use SSI0 to send an 8-bit code to the ST7735 160x128 pixel LCD. ; As part of Lab 7, students need to implement these LCD_WriteCommand and LCD_WriteData ; This driver assumes two low-level LCD functions ; Backlight (pin 10) connected to +3.3 V ; MISO (pin 9) unconnected ; SCK (pin 8) connected to PA2 (SSI0Clk) ; MOSI (pin 7) connected to PA5 (SSI0Tx) ; TFT_CS (pin 6) connected to PA3 (SSI0Fss) ; CARD_CS (pin 5) unconnected ; Data/Command (pin 4) connected to PA6 (GPIO) ; RESET (pin 3) connected to PA7 (GPIO) ; VCC (pin 2) connected to +3.3 V ; Gnd (pin 1) connected to ground GPIO_PORTA_DATA_R EQU 0x400043FC DC EQU 0x40004100 DC_COMMAND EQU 0 DC_DATA EQU 0x40 SSI0_DR_R EQU 0x40008008 SSI0_SR_R EQU 0x4000800C SSI_SR_RNE EQU 0x00000004 ; SSI Receive FIFO Not Empty SSI_SR_BSY EQU 0x00000010 ; SSI Busy Bit SSI_SR_TNF EQU 0x00000002 ; SSI Transmit FIFO Not Full EXPORT writecommand EXPORT writedata AREA |.text|, CODE, READONLY, ALIGN=2 THUMB ALIGN ; The Data/Command pin must be valid when the eighth bit is ; sent. The SSI module has hardware input and output FIFOs ; that are 8 locations deep. Based on the observation that ; the LCD interface tends to send a few commands and then a ; lot of data, the FIFOs are not used when writing ; commands, and they are used when writing data. This ; ensures that the Data/Command pin status matches the byte ; that is actually being transmitted. ; The write command operation waits until all data has been ; sent, configures the Data/Command pin for commands, sends ; the command, and then waits for the transmission to ; finish. ; The write data operation waits until there is room in the ; transmit FIFO, configures the Data/Command pin for data, ; and then adds the data to the transmit FIFO. ; NOTE: These functions will crash or stall indefinitely if ; the SSI0 module is not initialized and enabled. ; This is a helper function that sends an 8-bit command to the LCD. ; Input: R0 8-bit command to transmit ; Output: none ; Assumes: SSI0 and port A have already been initialized and enabled writecommand ;; --UUU-- Code to write a command to the LCD ;1) Read SSI0_SR_R and check bit 4, ;2) If bit 4 is high, loop back to step 1 (wait for BUSY bit to be low) ;3) Clear D/C=PA6 to zero ;4) Write the command to SSI0_DR_R ;5) Read SSI0_SR_R and check bit 4, ;6) If bit 4 is high, loop back to step 5 (wait for BUSY bit to be low) high LDR R1, =SSI0_SR_R; LDR R2, [R1]; read SSIA_SR_R into R2 AND R3, R2, #0x10; CMP R3, #0x10; check bit 4 if high go back to beginning BEQ high LDR R1, =DC ; Clear PA6 LDR R2, [R1] BIC R2, #0x40 ; Clear PA6 STR R2, [R1] ; Update PA6 LDR R1, =SSI0_DR_R STR R0, [R1] ; Write the command to SSIO_DR_R write command from R0 to SSIO_DR_R high2 LDR R1, =SSI0_SR_R; checking SSI0_DR_R again LDR R2, [R1] AND R3, R2, #0x10; Check bit 4 and return to high2 if high CMP R3, #0x10; BEQ high2 BX LR ; return ; This is a helper function that sends an 8-bit data to the LCD. ; Input: R0 8-bit data to transmit ; Output: none ; Assumes: SSI0 and port A have already been initialized and enabled writedata ;; --UUU-- Code to write data to the LCD ;1) Read SSI0_SR_R and check bit 1, ;2) If bit 1 is low loop back to step 1 (wait for TNF bit to be high) ;3) Set D/C=PA6 to one ;4) Write the 8-bit data to SSI0_DR_R low LDR R1, =SSI0_SR_R LDR R2, [R1] AND R2, #0x02; read and check bit 1 of SSIO_SR_R CMP R2, #0 BEQ low LDR R1, =DC LDR R2, [R1] ORR R2, #0x40; set PA6 1 STR R2, [R1] LDR R1, = SSI0_DR_R LDR R2, [R1] MOV R2, R0 STR R0, [R1]; store R0 to SSI0_DR_R BX LR ; return ;*************************************************** ; This is a library for the Adafruit 1.8" SPI display. ; This library works with the Adafruit 1.8" TFT Breakout w/SD card ; ----> http://www.adafruit.com/products/358 ; as well as Adafruit raw 1.8" TFT display ; ----> http://www.adafruit.com/products/618 ; ; Check out the links above for our tutorials and wiring diagrams ; These displays use SPI to communicate, 4 or 5 pins are required to ; interface (RST is optional) ; Adafruit invests time and resources providing this open source code, ; please support Adafruit and open-source hardware by purchasing ; products from Adafruit! ; ; Written by Limor Fried/Ladyada for Adafruit Industries. ; MIT license, all text above must be included in any redistribution ;**************************************************** ALIGN ; make sure the end of this section is aligned END ; end of file
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
SmartOS Zombie Zone Cleanup Script
Bash | 1 hour ago | 3.78 KB
Untitled
2 hours ago | 3.86 KB
Decentralized Money
2 hours ago | 0.42 KB
Change your mindset
2 hours ago | 0.08 KB
𝘉𝘐𝘗𝟥𝟤 𝘢𝘯𝘥 𝘉𝘐𝘗𝟦𝟦
3 hours ago | 2.01 KB
𝘌𝘵𝘩𝘦𝘳𝘦𝘶𝘮
3 hours ago | 1.64 KB
Bitcoin
4 hours ago | 0.23 KB
BIP32
5 hours ago | 0.35 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!