Catalin Patulea | c3126e0 | 2007-09-21 09:06:02 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
Karl Kurbjun | bebbac8 | 2007-09-22 15:43:38 +0000 | [diff] [blame] | 8 | * $Id$ |
Catalin Patulea | c3126e0 | 2007-09-21 09:06:02 +0000 | [diff] [blame] | 9 | * |
| 10 | * Copyright (C) 2007 by Catalin Patulea |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Catalin Patulea | c3126e0 | 2007-09-21 09:06:02 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef SPI_TARGET_H |
| 23 | #define SPI_TARGET_H |
| 24 | |
| 25 | #include <inttypes.h> |
Jonathan Gordon | 03f45d3 | 2007-10-01 05:27:43 +0000 | [diff] [blame] | 26 | #include <stdbool.h> |
| 27 | |
| 28 | enum SPI_target { |
Maurus Cuelenaere | e031db4 | 2008-05-14 18:55:19 +0000 | [diff] [blame] | 29 | #ifndef CREATIVE_ZVx |
Jonathan Gordon | 03f45d3 | 2007-10-01 05:27:43 +0000 | [diff] [blame] | 30 | SPI_target_TSC2100 = 0, |
| 31 | SPI_target_RX5X348AB, |
Catalin Patulea | 574b100 | 2007-11-02 05:07:52 +0000 | [diff] [blame] | 32 | SPI_target_BACKLIGHT, |
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 33 | #else |
| 34 | SPI_target_LTV250QV = 0, |
| 35 | #endif |
Jonathan Gordon | 03f45d3 | 2007-10-01 05:27:43 +0000 | [diff] [blame] | 36 | SPI_MAX_TARGETS, |
| 37 | }; |
Catalin Patulea | c3126e0 | 2007-09-21 09:06:02 +0000 | [diff] [blame] | 38 | |
Jonathan Gordon | d331d00 | 2007-09-22 14:21:07 +0000 | [diff] [blame] | 39 | void spi_init(void); |
Jonathan Gordon | 03f45d3 | 2007-10-01 05:27:43 +0000 | [diff] [blame] | 40 | int spi_block_transfer(enum SPI_target target, |
| 41 | const uint8_t *tx_bytes, unsigned int tx_size, |
Jonathan Gordon | d331d00 | 2007-09-22 14:21:07 +0000 | [diff] [blame] | 42 | uint8_t *rx_bytes, unsigned int rx_size); |
Catalin Patulea | c3126e0 | 2007-09-21 09:06:02 +0000 | [diff] [blame] | 43 | |
| 44 | #endif |