summaryrefslogtreecommitdiff
path: root/nuttx/configs/detron/src/detron_internal.h
blob: 4b00c803271572676698a8baac410890b436fdee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/************************************************************************************
 * configs/detron/src/detron_internal.h
 * arch/arm/src/board/detron_internal.n
 *
 *   Copyright (C) 2010 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ************************************************************************************/

/************************************************************************************
 *
 * Pin used in the Internet Radio Detron Board
 *
 * Graphic Display
 *
 * Pin 	Port	Function
 * 58   	P0(20)	DI
 * 59   	P0(19)	RW
 * 49    P0(11)  ENABLE
 * 78    P0(7)   D0
 * 79    P0(6)   D1
 * 78    P0(5)   D2
 * 81    P0(4)   D3
 * 94    P1(1)   D4
 * 95    P1(0)   D5
 * 47    P0(1)   D6
 * 46    P0(0)   D7
 *
 * VS1003
 *
 * Pin	Port	Function
 * 65	P2(8)	xreset
 * 85	P4(29)	dreq
 * 82	P4(28)	xdcs
 * 63	P0(16)	xcs
 * 62	P0(15)	sclk
 * 60	P0(18)	si
 * 61	P0(17)	so
 *
 * USB
 *
 * Pin	Port	Function
 * 29			D+
 * 30			D-
 */

#ifndef _CONFIGS_DETRON_SRC_DETRON_INTERNAL_H
#define _CONFIGS_DETRON_SRC_DETRON_INTERNAL_H

/************************************************************************************
 * Included Files
 ************************************************************************************/

#include <nuttx/config.h>
#include <nuttx/compiler.h>

/************************************************************************************
 * Definitions
 ************************************************************************************/

/* Detron GPIO Pin Definitions ******************************************************/
/* Pinos do Display grafico */

#define pin_di              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN20)
#define pin_rw              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN19)
#define pin_enable          (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN11)
#define pin_d0              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN7)
#define pin_d1              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN6)
#define pin_d2              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN5)
#define pin_d3              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN4)
#define pin_d4              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT1 | GPIO_PIN1)
#define pin_d5              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT1 | GPIO_PIN0)
#define pin_d6              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN1)
#define pin_d7              (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN0)
#define pin_cs1             (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN10)
#define pin_cs2             (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN9)
#define pin_rst             (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN8)

/* VS1003 pins
 * xdcs = SPI in mode SDI (data)
 * xcs =  SPI in mode SCI (comand)
 *
 * sclk = SPI clock
 * si   = SPI in
 * so   = SPI out
 *
 * dreq = SPI status   1 - free   0 - busy
 * xreset = hardware reset
 */

#define pin_vs1003_xreset   (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN8)
#define pin_vs1003_dreq     (GPIO_INPUT  | GPIO_VALUE_ZERO | GPIO_PORT4 | GPIO_PIN29)
#define pin_vs1003_xdcs     (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT4 | GPIO_PIN28)
#define pin_vs1003_xcs      (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN16)
#define pin_vs1003_sclk     (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN15)
#define pin_vs1003_si       (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN18)
#define pin_vs1003_so       (GPIO_INPUT  | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN17)

/************************************************************************************
 * Public Types
 ************************************************************************************/

/************************************************************************************
 * Public data
 ************************************************************************************/

#ifndef __ASSEMBLY__

/************************************************************************************
 * Public Functions
 ************************************************************************************/
 
#endif /* __ASSEMBLY__ */
#endif /* _CONFIGS_DETRON_SRC_DETRON_INTERNAL_H */