diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2012-01-07 22:04:12 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2012-01-07 22:04:12 +0000 |
commit | 28d1af853c5e853e69991b29b5acc6b2e3b1abfe (patch) | |
tree | 834e0fc6f66569d500e60b036a66e0bcb01dc259 /firmware/target/arm | |
parent | 12ef8723f8f69ab70e2af7ac8a2cc4b7bf319b96 (diff) | |
download | rockbox-28d1af853c5e853e69991b29b5acc6b2e3b1abfe.tar.gz rockbox-28d1af853c5e853e69991b29b5acc6b2e3b1abfe.zip |
Clean spi.h and spi-target.h
Only target-specific (list of SPI targets) go in spi-target.h
API go into spi.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31615 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
5 files changed, 9 insertions, 19 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c index e6d9e034ed..204a99f87c 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include "string-extra.h" /* memset16() */ | 28 | #include "string-extra.h" /* memset16() */ |
29 | #include "cpu.h" | 29 | #include "cpu.h" |
30 | #include "spi.h" | 30 | #include "spi.h" |
31 | #include "spi-target.h" | ||
32 | #include "lcd-target.h" | 31 | #include "lcd-target.h" |
33 | #include "ltv350qv.h" | 32 | #include "ltv350qv.h" |
34 | 33 | ||
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c index fe94cf4be4..0cebc1bd5c 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "backlight.h" | 26 | #include "backlight.h" |
27 | #include "lcd.h" | 27 | #include "lcd.h" |
28 | #include "power.h" | 28 | #include "power.h" |
29 | #include "spi-target.h" | 29 | #include "spi.h" |
30 | #include "lcd-target.h" | 30 | #include "lcd-target.h" |
31 | 31 | ||
32 | short read_brightness = 0x0; | 32 | short read_brightness = 0x0; |
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c index 50301c0237..4104c21e52 100644 --- a/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c +++ b/firmware/target/arm/tms320dm320/sansa-connect/backlight-sansaconnect.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "backlight.h" | 26 | #include "backlight.h" |
27 | #include "lcd.h" | 27 | #include "lcd.h" |
28 | #include "power.h" | 28 | #include "power.h" |
29 | #include "spi-target.h" | ||
30 | #include "lcd-target.h" | 29 | #include "lcd-target.h" |
31 | 30 | ||
32 | static void _backlight_write_brightness(int brightness) | 31 | static void _backlight_write_brightness(int brightness) |
diff --git a/firmware/target/arm/tms320dm320/spi-dm320.c b/firmware/target/arm/tms320dm320/spi-dm320.c index c2e774462a..e9a097b0ea 100644 --- a/firmware/target/arm/tms320dm320/spi-dm320.c +++ b/firmware/target/arm/tms320dm320/spi-dm320.c | |||
@@ -43,9 +43,12 @@ struct SPI_info { | |||
43 | bool clk_invert; | 43 | bool clk_invert; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static const struct SPI_info spi_targets[] = | 46 | static const struct SPI_info spi_targets[SPI_MAX_TARGETS] = |
47 | { | 47 | { |
48 | #ifndef CREATIVE_ZVx | 48 | #if defined(CREATIVE_ZVx) |
49 | [SPI_target_LTV250QV] = { &IO_GIO_BITCLR2, &IO_GIO_BITSET2, | ||
50 | GIO_LCD_ENABLE, true, 0x07}, | ||
51 | #elif defined(MROBE_500) | ||
49 | [SPI_target_TSC2100] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, | 52 | [SPI_target_TSC2100] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, |
50 | GIO_TS_ENABLE, 0x260D, true}, | 53 | GIO_TS_ENABLE, 0x260D, true}, |
51 | /* RTC seems to have timing problems if the CLK idles low */ | 54 | /* RTC seems to have timing problems if the CLK idles low */ |
@@ -54,9 +57,6 @@ static const struct SPI_info spi_targets[] = | |||
54 | /* This appears to work properly idling low, idling high is very glitchy */ | 57 | /* This appears to work properly idling low, idling high is very glitchy */ |
55 | [SPI_target_BACKLIGHT] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, | 58 | [SPI_target_BACKLIGHT] = { &IO_GIO_BITCLR1, &IO_GIO_BITSET1, |
56 | GIO_BL_ENABLE, 0x2656, false}, | 59 | GIO_BL_ENABLE, 0x2656, false}, |
57 | #else | ||
58 | [SPI_target_LTV250QV] = { &IO_GIO_BITCLR2, &IO_GIO_BITSET2, | ||
59 | GIO_LCD_ENABLE, true, 0x07}, | ||
60 | #endif | 60 | #endif |
61 | }; | 61 | }; |
62 | 62 | ||
diff --git a/firmware/target/arm/tms320dm320/spi-target.h b/firmware/target/arm/tms320dm320/spi-target.h index 013737b291..965d499377 100644 --- a/firmware/target/arm/tms320dm320/spi-target.h +++ b/firmware/target/arm/tms320dm320/spi-target.h | |||
@@ -22,23 +22,15 @@ | |||
22 | #ifndef SPI_TARGET_H | 22 | #ifndef SPI_TARGET_H |
23 | #define SPI_TARGET_H | 23 | #define SPI_TARGET_H |
24 | 24 | ||
25 | #include <inttypes.h> | ||
26 | #include <stdbool.h> | ||
27 | |||
28 | enum SPI_target { | 25 | enum SPI_target { |
29 | #ifndef CREATIVE_ZVx | 26 | #if defined(CREATIVE_ZVx) |
27 | SPI_target_LTV250QV = 0, | ||
28 | #elif defined(MROBE_500) | ||
30 | SPI_target_TSC2100 = 0, | 29 | SPI_target_TSC2100 = 0, |
31 | SPI_target_RX5X348AB, | 30 | SPI_target_RX5X348AB, |
32 | SPI_target_BACKLIGHT, | 31 | SPI_target_BACKLIGHT, |
33 | #else | ||
34 | SPI_target_LTV250QV = 0, | ||
35 | #endif | 32 | #endif |
36 | SPI_MAX_TARGETS, | 33 | SPI_MAX_TARGETS, |
37 | }; | 34 | }; |
38 | 35 | ||
39 | void spi_init(void); | ||
40 | int spi_block_transfer(enum SPI_target target, | ||
41 | const uint8_t *tx_bytes, unsigned int tx_size, | ||
42 | uint8_t *rx_bytes, unsigned int rx_size); | ||
43 | |||
44 | #endif | 36 | #endif |