2 * Copyright © 2017 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
18 /* From the rn4678 pictail board
20 1 SW_BTN 0-off/1-on 2 P2_0 1-app/0-test (boot time)
21 3 P2_4 1-app/0-WF 4 EAN 0-app/1-WF (reboots)
28 17 P0_5 1 (NC) 18 RST_N 1 run/0 reset
29 19 WAKE_UP 1 run/0 btn 20
31 23 P1_5 1 (NC) 24 P3_1 1 (NC)
38 Not connected to microcontroller:
41 P2_4 0 write-flash 1-app
44 EAN 1-WF (reboots) 0-run
47 Connected to microcontroller:
55 Other connections -- LDO33_O to VDD_IO
59 #define AO_RN_REBOOT_MSG "REBOOT"
61 #define AO_RN_CMD_TIMEOUT AO_MS_TO_TICKS(200)
63 #define AO_RN_REBOOT_TIMEOUT AO_MS_TO_TICKS(2000)
65 #define AO_RN_MAX_REPLY_LEN 10
67 #define AO_RN_SET_NAME_CMD "SN,"
68 #define AO_RN_GET_NAME_CMD "GN"
70 #define AO_RN_SET_STATUS_STRING "so,"
71 #define AO_RN_STATUS_STRING_DISABLE " "
72 #define AO_RN_STATUS_STRING_ENABLE "%,%"
74 #define AO_RN_REBOOT_CMD "R,1"
76 #define AO_RN_VERSION_CMD "V"
78 #define AO_RN_TIMEOUT -1
82 #define AO_RN_SET_COMMAND_PIN "SX,07,0B"
84 #define AO_RN_SET_AUTH_JUST_WORKS "SA,2"
85 #define AO_RN_SET_FAST_MODE "SQ,9000"
87 /* This pin is configured to control cmd/data mode */
88 #define AO_RN_CMD_PORT AO_RN_P3_7_PORT
89 #define AO_RN_CMD_PIN AO_RN_P3_7_PIN
91 #define AO_RN_CMD_CMD 0
92 #define AO_RN_CMD_DATA 1
94 /* This pin indicates BT connection status */
95 #define AO_RN_CONNECTED_PORT AO_RN_P1_5_PORT
96 #define AO_RN_CONNECTED_PIN AO_RN_P1_5_PIN
101 #endif /* _AO_RN_H_ */