Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
notro committed Jan 18, 2013
1 parent 2171c42 commit 4a441b8
Show file tree
Hide file tree
Showing 10 changed files with 1,933 additions and 17 deletions.
96 changes: 83 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,87 @@
# Object files
# This file is copied from the Linux kernel sources
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# Normal rules
#
.*
*.o

# Libraries
*.lib
*.o.*
*.a

# Shared objects (inc. Windows DLLs)
*.dll
*.s
*.ko
*.so
*.so.*
*.dylib
*.so.dbg
*.mod.c
*.i
*.lst
*.symtypes
*.order
modules.builtin
*.elf
*.bin
*.gz
*.bz2
*.lzma
*.xz
*.lzo
*.patch
*.gcno

#
# Top-level generic files
#
/tags
/TAGS
/linux
/vmlinux
/vmlinuz
/System.map
/Module.markers
/Module.symvers

#
# Debian directory (make deb-pkg)
#
/debian/

#
# git files that we don't want to ignore even it they are dot-files
#
!.gitignore
!.mailmap

#
# Generated include files
#
include/config
include/linux/version.h
include/generated
arch/*/include/generated

# stgit generated dirs
patches-*

# quilt's files
patches
series

# cscope files
cscope.*
ncscope.*

# gnu global files
GPATH
GRTAGS
GSYMS
GTAGS

# Executables
*.exe
*.out
*.app
*.orig
*~
\#*#
20 changes: 20 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
menuconfig FB_TFT_SUPPORT
tristate "Support for small TFT LCD display modules"
depends on FB && SPI && GPIOLIB
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
select FB_DEFERRED_IO

config FB_ADAFRUIT22
tristate "FB driver for the Adafruit 2.2\" LCD display"
depends on FB_TFT_SUPPORT
help
Framebuffer support for the Adafruit 2.2\" LCD display in 9-bit SPI mode.

config FB_SAINSMART18
tristate "FB driver for the Sainsmart 1.8\" LCD display"
depends on FB_TFT_SUPPORT
help
Framebuffer support for the Sainsmart 1.8\" LCD display in 8-bit SPI mode.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
obj-m := fbtft.o

obj-m += adafruit22fb.o
obj-m += sainsmart18fb.o

obj-m += spidevices.o

#obj-$(CONFIG_FB_TFT_SUPPORT) += fbtft.o
#obj-$(CONFIG_FB_ADAFRUIT22) += adafruit22fb.o
#obj-$(CONFIG_FB_SAINSMART18) += sainsmart18fb.o

# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
78 changes: 78 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
FBTFT
=========

Linux Framebuffer drivers for small TFT LCD display modules.
The drivers uses a module 'fbft' which makes writing these drivers very simple.

Development is done on a Raspberry Pi running the Raspbian "wheezy" distribution.

# uname -r
3.2.27+


SUPPORTED LCD MODULES
-----------------------------------------------------------------------------------------
| Module | Driver | SPI | Controller | URL |
-----------------------------------------------------------------------------------------
| Adafruit 2.2" | adafruit22fb | 9 bit | HX8340bn | adafruit.com |
| Sainsmart 1.8" | sainsmart18fb | 8 bit | ST7735Rn | www.sainsmart.com |
-----------------------------------------------------------------------------------------

adafruit22fb
GPIOS
reset (optional if handled by hardware)

sainsmart18fb
GPIOS
dc (required)
reset (optional if handled by hardware)


KERNEL CONFIG
The drivers require a kernel with SPI, GPIO, FB, FB_SYS_* and FB_DEFERRED_IO turned on.

Check with these commands:
grep "CONFIG_SPI[= ]\|CONFIG_FB[= ]\|CONFIG_FB_DEFERRED_IO\|CONFIG_FB_SYS" .config
grep GPIO .config


Set options with 'make menuconfig'

CONFIG_SPI=y
Device Drivers ---> [*] SPI support ---> <Some controller driver>

CONFIG_GENERIC_GPIO=y
CONFIG_BCM2708_GPIO=y
Device Drivers ---> -*- GPIO Support


CONFIG_FB=y
Device Drivers ---> Graphics support ---> <*> Support for frame buffer devices


The following options can not be set from menuconfig (can only be set by other config options)
Use 'sed' to set them.

CONFIG_FB_DEFERRED_IO=y
sed -i '/CONFIG_FB_DEFERRED_IO/s/# \([A-Z0-9_]*\) is not set/\1=y/' .config

CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
CONFIG_FB_SYS_FOPS=y
sed -i '/CONFIG_FB_SYS/s/# \([A-Z0-9_]*\) is not set/\1=y/' .config


TOOLS
spidevices
This module can add and delete SPI devices to simplify driver testing and development.
No need to change the arch/arm/mach-bcm2708/bcm2708.c (on rPi) platform file when testing.
Values are hardcoded.


KNOWN BUGS
'fbtft' can't be used by more than one driver at a time.


SOURCE CODE
https://github.com/notro/fbtft/
4 changes: 0 additions & 4 deletions README.md

This file was deleted.

Loading

0 comments on commit 4a441b8

Please sign in to comment.