xref: /btstack/chipset/cc256x/ant_cmd.h (revision 80e33422a96c028b3a9c308fc4b9b874712dafb4)
175a994c4SMatthias Ringwald /*
275a994c4SMatthias Ringwald  * This software is subject to the ANT+ Shared Source License
375a994c4SMatthias Ringwald  * www.thisisant.com/developer/ant/licensing
475a994c4SMatthias Ringwald  *
575a994c4SMatthias Ringwald  * Copyright © Dynastream Innovations,
675a994c4SMatthias Ringwald  * Inc. 2012 All rights reserved.
775a994c4SMatthias Ringwald  *
875a994c4SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
975a994c4SMatthias Ringwald  * modification, are permitted provided that the following conditions are met:
1075a994c4SMatthias Ringwald  *
1175a994c4SMatthias Ringwald  * Redistributions of source code must retain the above copyright notice, this
1275a994c4SMatthias Ringwald  * list of conditions and the following disclaimer. Redistributions in binary
1375a994c4SMatthias Ringwald  * form must reproduce the above copyright notice, this list of conditions and
1475a994c4SMatthias Ringwald  * the following disclaimer in the documentation and/or other materials provided
1575a994c4SMatthias Ringwald  * with the distribution. Neither the name of Dynastream nor the names of its
1675a994c4SMatthias Ringwald  * contributors may be used to endorse or promote products derived from this
1775a994c4SMatthias Ringwald  * software without specific prior written permission. The following actions are
1875a994c4SMatthias Ringwald  * prohibited:
1975a994c4SMatthias Ringwald  *
2075a994c4SMatthias Ringwald  * Redistribution of source code containing the ANT+ Network Key. The ANT+
2175a994c4SMatthias Ringwald  * Network Key is available to ANT+ Adopters. Please refer to
2275a994c4SMatthias Ringwald  * http://thisisant.com to become an ANT+ Adopter and access the key. Reverse
2375a994c4SMatthias Ringwald  * engineering, decompilation, and/or disassembly of software provided in binary
2475a994c4SMatthias Ringwald  * form under this license. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
2575a994c4SMatthias Ringwald  * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
2675a994c4SMatthias Ringwald  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
2775a994c4SMatthias Ringwald  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
2875a994c4SMatthias Ringwald  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2975a994c4SMatthias Ringwald  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
3075a994c4SMatthias Ringwald  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
3175a994c4SMatthias Ringwald  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
3275a994c4SMatthias Ringwald  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3375a994c4SMatthias Ringwald  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3475a994c4SMatthias Ringwald  * POSSIBILITY OF SUCH DAMAGE.
3575a994c4SMatthias Ringwald  *
3675a994c4SMatthias Ringwald  */
3775a994c4SMatthias Ringwald 
38*80e33422SMatthias Ringwald #ifndef ANT_CMDS_H
39*80e33422SMatthias Ringwald #define ANT_CMDS_H
4075a994c4SMatthias Ringwald 
4175a994c4SMatthias Ringwald #include <stdint.h>
4275a994c4SMatthias Ringwald #include "hci_cmd.h"
4375a994c4SMatthias Ringwald 
4475a994c4SMatthias Ringwald #if defined __cplusplus
4575a994c4SMatthias Ringwald extern "C" {
4675a994c4SMatthias Ringwald #endif
4775a994c4SMatthias Ringwald 
4875a994c4SMatthias Ringwald typedef uint8_t UCHAR;
4975a994c4SMatthias Ringwald 
5075a994c4SMatthias Ringwald //////////////////////////////////////////////
5175a994c4SMatthias Ringwald // Message IDs from antmessage.h
5275a994c4SMatthias Ringwald //////////////////////////////////////////////
5375a994c4SMatthias Ringwald #define MESG_INVALID_ID                      ((UCHAR)0x00)
5475a994c4SMatthias Ringwald #define MESG_EVENT_ID                        ((UCHAR)0x01)
5575a994c4SMatthias Ringwald 
5675a994c4SMatthias Ringwald #define MESG_VERSION_ID                      ((UCHAR)0x3E)
5775a994c4SMatthias Ringwald #define MESG_RESPONSE_EVENT_ID               ((UCHAR)0x40)
5875a994c4SMatthias Ringwald 
5975a994c4SMatthias Ringwald #define MESG_UNASSIGN_CHANNEL_ID             ((UCHAR)0x41)
6075a994c4SMatthias Ringwald #define MESG_ASSIGN_CHANNEL_ID               ((UCHAR)0x42)
6175a994c4SMatthias Ringwald #define MESG_CHANNEL_MESG_PERIOD_ID          ((UCHAR)0x43)
6275a994c4SMatthias Ringwald #define MESG_CHANNEL_SEARCH_TIMEOUT_ID       ((UCHAR)0x44)
6375a994c4SMatthias Ringwald #define MESG_CHANNEL_RADIO_FREQ_ID           ((UCHAR)0x45)
6475a994c4SMatthias Ringwald #define MESG_NETWORK_KEY_ID                  ((UCHAR)0x46)
6575a994c4SMatthias Ringwald #define MESG_RADIO_TX_POWER_ID               ((UCHAR)0x47)
6675a994c4SMatthias Ringwald #define MESG_RADIO_CW_MODE_ID                ((UCHAR)0x48)
6775a994c4SMatthias Ringwald #define MESG_SYSTEM_RESET_ID                 ((UCHAR)0x4A)
6875a994c4SMatthias Ringwald #define MESG_OPEN_CHANNEL_ID                 ((UCHAR)0x4B)
6975a994c4SMatthias Ringwald #define MESG_CLOSE_CHANNEL_ID                ((UCHAR)0x4C)
7075a994c4SMatthias Ringwald #define MESG_REQUEST_ID                      ((UCHAR)0x4D)
7175a994c4SMatthias Ringwald 
7275a994c4SMatthias Ringwald #define MESG_BROADCAST_DATA_ID               ((UCHAR)0x4E)
7375a994c4SMatthias Ringwald #define MESG_ACKNOWLEDGED_DATA_ID            ((UCHAR)0x4F)
7475a994c4SMatthias Ringwald #define MESG_BURST_DATA_ID                   ((UCHAR)0x50)
7575a994c4SMatthias Ringwald 
7675a994c4SMatthias Ringwald #define MESG_CHANNEL_ID_ID                   ((UCHAR)0x51)
7775a994c4SMatthias Ringwald #define MESG_CHANNEL_STATUS_ID               ((UCHAR)0x52)
7875a994c4SMatthias Ringwald #define MESG_RADIO_CW_INIT_ID                ((UCHAR)0x53)
7975a994c4SMatthias Ringwald #define MESG_CAPABILITIES_ID                 ((UCHAR)0x54)
8075a994c4SMatthias Ringwald 
8175a994c4SMatthias Ringwald #define MESG_STACKLIMIT_ID                   ((UCHAR)0x55)
8275a994c4SMatthias Ringwald 
8375a994c4SMatthias Ringwald #define MESG_SCRIPT_DATA_ID                  ((UCHAR)0x56)
8475a994c4SMatthias Ringwald #define MESG_SCRIPT_CMD_ID                   ((UCHAR)0x57)
8575a994c4SMatthias Ringwald 
8675a994c4SMatthias Ringwald #define MESG_ID_LIST_ADD_ID                  ((UCHAR)0x59)
8775a994c4SMatthias Ringwald #define MESG_ID_LIST_CONFIG_ID               ((UCHAR)0x5A)
8875a994c4SMatthias Ringwald #define MESG_OPEN_RX_SCAN_ID                 ((UCHAR)0x5B)
8975a994c4SMatthias Ringwald 
9075a994c4SMatthias Ringwald #define MESG_EXT_CHANNEL_RADIO_FREQ_ID       ((UCHAR)0x5C)  // OBSOLETE: (for 905 radio)
9175a994c4SMatthias Ringwald #define MESG_EXT_BROADCAST_DATA_ID           ((UCHAR)0x5D)
9275a994c4SMatthias Ringwald #define MESG_EXT_ACKNOWLEDGED_DATA_ID        ((UCHAR)0x5E)
9375a994c4SMatthias Ringwald #define MESG_EXT_BURST_DATA_ID               ((UCHAR)0x5F)
9475a994c4SMatthias Ringwald 
9575a994c4SMatthias Ringwald #define MESG_CHANNEL_RADIO_TX_POWER_ID       ((UCHAR)0x60)
9675a994c4SMatthias Ringwald #define MESG_GET_SERIAL_NUM_ID               ((UCHAR)0x61)
9775a994c4SMatthias Ringwald #define MESG_GET_TEMP_CAL_ID                 ((UCHAR)0x62)
9875a994c4SMatthias Ringwald #define MESG_SET_LP_SEARCH_TIMEOUT_ID        ((UCHAR)0x63)
9975a994c4SMatthias Ringwald #define MESG_SET_TX_SEARCH_ON_NEXT_ID        ((UCHAR)0x64)
10075a994c4SMatthias Ringwald #define MESG_SERIAL_NUM_SET_CHANNEL_ID_ID    ((UCHAR)0x65)
10175a994c4SMatthias Ringwald #define MESG_RX_EXT_MESGS_ENABLE_ID          ((UCHAR)0x66)
10275a994c4SMatthias Ringwald #define MESG_RADIO_CONFIG_ALWAYS_ID          ((UCHAR)0x67)
10375a994c4SMatthias Ringwald #define MESG_ENABLE_LED_FLASH_ID             ((UCHAR)0x68)
10475a994c4SMatthias Ringwald 
10575a994c4SMatthias Ringwald #define MESG_XTAL_ENABLE_ID                  ((UCHAR)0x6D)
10675a994c4SMatthias Ringwald 
10775a994c4SMatthias Ringwald #define MESG_STARTUP_MESG_ID                 ((UCHAR)0x6F)
10875a994c4SMatthias Ringwald #define MESG_AUTO_FREQ_CONFIG_ID             ((UCHAR)0x70)
10975a994c4SMatthias Ringwald #define MESG_PROX_SEARCH_CONFIG_ID           ((UCHAR)0x71)
11075a994c4SMatthias Ringwald 
11175a994c4SMatthias Ringwald #define MESG_SET_SEARCH_CH_PRIORITY_ID       ((UCHAR)0x75)
11275a994c4SMatthias Ringwald 
11375a994c4SMatthias Ringwald #define MESG_CUBE_CMD_ID                     ((UCHAR)0x80)
11475a994c4SMatthias Ringwald 
11575a994c4SMatthias Ringwald #define MESG_GET_PIN_DIODE_CONTROL_ID        ((UCHAR)0x8D)
11675a994c4SMatthias Ringwald #define MESG_PIN_DIODE_CONTROL_ID            ((UCHAR)0x8E)
11775a994c4SMatthias Ringwald #define MESG_FIT1_SET_AGC_ID                 ((UCHAR)0x8F)
11875a994c4SMatthias Ringwald 
11975a994c4SMatthias Ringwald #define MESG_FIT1_SET_EQUIP_STATE_ID         ((UCHAR)0x91)  // *** CONFLICT: w/ Sensrcore, Fit1 will never have sensrcore enabled
12075a994c4SMatthias Ringwald 
12175a994c4SMatthias Ringwald // Sensrcore Messages
12275a994c4SMatthias Ringwald #define MESG_SET_CHANNEL_INPUT_MASK_ID       ((UCHAR)0x90)
12375a994c4SMatthias Ringwald #define MESG_SET_CHANNEL_DATA_TYPE_ID        ((UCHAR)0x91)
12475a994c4SMatthias Ringwald #define MESG_READ_PINS_FOR_SECT_ID           ((UCHAR)0x92)
12575a994c4SMatthias Ringwald #define MESG_TIMER_SELECT_ID                 ((UCHAR)0x93)
12675a994c4SMatthias Ringwald #define MESG_ATOD_SETTINGS_ID                ((UCHAR)0x94)
12775a994c4SMatthias Ringwald #define MESG_SET_SHARED_ADDRESS_ID           ((UCHAR)0x95)
12875a994c4SMatthias Ringwald #define MESG_ATOD_EXTERNAL_ENABLE_ID         ((UCHAR)0x96)
12975a994c4SMatthias Ringwald #define MESG_ATOD_PIN_SETUP_ID               ((UCHAR)0x97)
13075a994c4SMatthias Ringwald #define MESG_SETUP_ALARM_ID                  ((UCHAR)0x98)
13175a994c4SMatthias Ringwald #define MESG_ALARM_VARIABLE_MODIFY_TEST_ID   ((UCHAR)0x99)
13275a994c4SMatthias Ringwald #define MESG_PARTIAL_RESET_ID                ((UCHAR)0x9A)
13375a994c4SMatthias Ringwald #define MESG_OVERWRITE_TEMP_CAL_ID           ((UCHAR)0x9B)
13475a994c4SMatthias Ringwald #define MESG_SERIAL_PASSTHRU_SETTINGS_ID     ((UCHAR)0x9C)
13575a994c4SMatthias Ringwald 
13675a994c4SMatthias Ringwald #define MESG_BIST_ID                         ((UCHAR)0xAA)
13775a994c4SMatthias Ringwald #define MESG_UNLOCK_INTERFACE_ID             ((UCHAR)0xAD)
13875a994c4SMatthias Ringwald #define MESG_SERIAL_ERROR_ID                 ((UCHAR)0xAE)
13975a994c4SMatthias Ringwald #define MESG_SET_ID_STRING_ID                ((UCHAR)0xAF)
14075a994c4SMatthias Ringwald 
14175a994c4SMatthias Ringwald #define MESG_PORT_GET_IO_STATE_ID            ((UCHAR)0xB4)
14275a994c4SMatthias Ringwald #define MESG_PORT_SET_IO_STATE_ID            ((UCHAR)0xB5)
14375a994c4SMatthias Ringwald 
14475a994c4SMatthias Ringwald #define MESG_SLEEP_ID                        ((UCHAR)0xC5)
14575a994c4SMatthias Ringwald #define MESG_GET_GRMN_ESN_ID                 ((UCHAR)0xC6)
14675a994c4SMatthias Ringwald #define MESG_SET_USB_INFO_ID                 ((UCHAR)0xC7)
14775a994c4SMatthias Ringwald 
14875a994c4SMatthias Ringwald // ANT HCI Commands - see ant_cmds.c for info on parameters
14975a994c4SMatthias Ringwald extern const hci_cmd_t btstack_get_state;
15075a994c4SMatthias Ringwald 
15175a994c4SMatthias Ringwald /**
15275a994c4SMatthias Ringwald  * compact ANT HCI Command packet description
15375a994c4SMatthias Ringwald  */
15475a994c4SMatthias Ringwald  typedef struct {
15575a994c4SMatthias Ringwald     const uint8_t    message_id;
15675a994c4SMatthias Ringwald     const char *format;
15775a994c4SMatthias Ringwald } ant_cmd_t;
15875a994c4SMatthias Ringwald 
15975a994c4SMatthias Ringwald uint16_t ant_create_cmd(uint8_t *hci_cmd_buffer, const ant_cmd_t *cmd, ...);
16075a994c4SMatthias Ringwald int ant_send_cmd(const ant_cmd_t *cmd, ...);
16175a994c4SMatthias Ringwald 
16275a994c4SMatthias Ringwald const ant_cmd_t ant_reset;
16375a994c4SMatthias Ringwald const ant_cmd_t ant_assign_channel;
16475a994c4SMatthias Ringwald const ant_cmd_t ant_un_assign_channel;
16575a994c4SMatthias Ringwald const ant_cmd_t ant_search_timeout;
16675a994c4SMatthias Ringwald const ant_cmd_t ant_lp_search_timeout;
16775a994c4SMatthias Ringwald const ant_cmd_t ant_network_key;
16875a994c4SMatthias Ringwald const ant_cmd_t ant_channel_id;
16975a994c4SMatthias Ringwald const ant_cmd_t ant_channel_power;
17075a994c4SMatthias Ringwald const ant_cmd_t ant_channel_period;
17175a994c4SMatthias Ringwald const ant_cmd_t ant_prox_search_config;
17275a994c4SMatthias Ringwald const ant_cmd_t ant_broadcast;
17375a994c4SMatthias Ringwald const ant_cmd_t ant_acknowledged;
17475a994c4SMatthias Ringwald const ant_cmd_t ant_burst_packet;
17575a994c4SMatthias Ringwald const ant_cmd_t ant_open_channel;
17675a994c4SMatthias Ringwald const ant_cmd_t ant_close_channel;
17775a994c4SMatthias Ringwald const ant_cmd_t ant_request_message;
17875a994c4SMatthias Ringwald 
17975a994c4SMatthias Ringwald #if defined __cplusplus
18075a994c4SMatthias Ringwald }
18175a994c4SMatthias Ringwald #endif
18275a994c4SMatthias Ringwald 
183*80e33422SMatthias Ringwald #endif // ANT_CMDS_H
184