blob: 013737b291e7dca5c12a589884191861a41c61c8 [file] [log] [blame]
Catalin Patuleac3126e02007-09-21 09:06:02 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Karl Kurbjunbebbac82007-09-22 15:43:38 +00008 * $Id$
Catalin Patuleac3126e02007-09-21 09:06:02 +00009 *
10 * Copyright (C) 2007 by Catalin Patulea
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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 Patuleac3126e02007-09-21 09:06:02 +000016 *
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 Gordon03f45d32007-10-01 05:27:43 +000026#include <stdbool.h>
27
28enum SPI_target {
Maurus Cuelenaeree031db42008-05-14 18:55:19 +000029#ifndef CREATIVE_ZVx
Jonathan Gordon03f45d32007-10-01 05:27:43 +000030 SPI_target_TSC2100 = 0,
31 SPI_target_RX5X348AB,
Catalin Patulea574b1002007-11-02 05:07:52 +000032 SPI_target_BACKLIGHT,
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000033#else
34 SPI_target_LTV250QV = 0,
35#endif
Jonathan Gordon03f45d32007-10-01 05:27:43 +000036 SPI_MAX_TARGETS,
37};
Catalin Patuleac3126e02007-09-21 09:06:02 +000038
Jonathan Gordond331d002007-09-22 14:21:07 +000039void spi_init(void);
Jonathan Gordon03f45d32007-10-01 05:27:43 +000040int spi_block_transfer(enum SPI_target target,
41 const uint8_t *tx_bytes, unsigned int tx_size,
Jonathan Gordond331d002007-09-22 14:21:07 +000042 uint8_t *rx_bytes, unsigned int rx_size);
Catalin Patuleac3126e02007-09-21 09:06:02 +000043
44#endif