simon e5db0b21c7 Add optional BMA456 accelerometer init on shared I2C bus.
Probe and configure the sensor when present; log and continue boot if
init fails so boards without BMA456 still run normally.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:51:32 +02:00

1949 lines
89 KiB
C

/**
* Copyright (c) 2023 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
* 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 of the copyright holder 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 HOLDER 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.
*
* @file bma456mm.c
* @date 2023-07-05
* @version V2.29.0
*
*/
/*! \file bma456mm.c
* \brief Sensor Driver for BMA456MM sensor
*/
#include "bma456mm.h"
/**\name Feature configuration file */
const uint8_t bma456mm_config_file[] = {
0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x99,
0x00, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x56, 0x01, 0x50, 0x39, 0x21, 0x2e, 0xb0, 0xf0,
0x10, 0x30, 0x21, 0x2e, 0x16, 0xf0, 0x80, 0x2e, 0xfb, 0x00, 0x81, 0x50, 0x75, 0x52, 0x01, 0x42, 0x3b, 0x80, 0x41,
0x30, 0x01, 0x42, 0x3c, 0x80, 0x00, 0x2e, 0x01, 0x40, 0x01, 0x42, 0x21, 0x2e, 0xff, 0xaf, 0xb8, 0x2e, 0x9f, 0xab,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0xfd, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x01,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x9a, 0x01, 0x34, 0x03, 0x00, 0x00, 0x00, 0x00, 0x09, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x70, 0x50, 0xf1, 0x7f, 0xe0, 0x7f, 0xd2, 0x7f, 0xcb, 0x7f, 0x98, 0x2e, 0xc8, 0x00, 0x00, 0xb2, 0x75,
0x50, 0x1b, 0x30, 0x05, 0x2f, 0x03, 0x2e, 0x03, 0xf0, 0x9d, 0xbc, 0x9f, 0xb8, 0x40, 0x90, 0x07, 0x2f, 0x37, 0x2e,
0x65, 0x00, 0x0b, 0x30, 0x37, 0x2e, 0x6d, 0x00, 0x21, 0x2e, 0xbc, 0xf0, 0x0e, 0x2d, 0x51, 0x52, 0x77, 0x50, 0xb5,
0x7f, 0xa4, 0x7f, 0x93, 0x7f, 0x98, 0x2e, 0xe5, 0x00, 0x10, 0x30, 0x21, 0x2e, 0x4c, 0x00, 0x93, 0x6f, 0xa4, 0x6f,
0xb5, 0x6f, 0x75, 0x50, 0x21, 0x2e, 0xb8, 0xf0, 0xf1, 0x6f, 0xd2, 0x6f, 0xe0, 0x6f, 0xcb, 0x6f, 0x90, 0x5f, 0xc8,
0x2e, 0x01, 0x2e, 0x09, 0x01, 0x0f, 0xbd, 0x8e, 0xbc, 0x2f, 0xb9, 0x9f, 0xb8, 0x51, 0x0a, 0x0d, 0xbc, 0x0f, 0xb8,
0x05, 0x2e, 0x18, 0x01, 0x2f, 0xb9, 0x08, 0x0a, 0x02, 0x0a, 0x00, 0xb2, 0x10, 0x30, 0x03, 0x2f, 0x03, 0x2e, 0x4d,
0x00, 0x44, 0xb2, 0x01, 0x2f, 0x00, 0x30, 0xb8, 0x2e, 0xb8, 0x2e, 0x01, 0x2e, 0x09, 0x01, 0xc0, 0x2e, 0x0c, 0xbc,
0x0f, 0xb8, 0x05, 0x2e, 0x01, 0xf0, 0x2e, 0xbd, 0xae, 0xb9, 0x34, 0x30, 0x43, 0x84, 0xe3, 0x04, 0x25, 0x40, 0x04,
0x40, 0xd8, 0xbe, 0x2c, 0x0b, 0x23, 0x11, 0x54, 0x42, 0x03, 0x80, 0x4a, 0x0e, 0xf6, 0x2f, 0xb8, 0x2e, 0x01, 0x2e,
0x55, 0xf0, 0xc0, 0x2e, 0x21, 0x2e, 0x55, 0xf0, 0x1a, 0x24, 0x26, 0x00, 0x80, 0x2e, 0x00, 0xb0, 0x44, 0x47, 0xcc,
0x00, 0x05, 0x00, 0xcc, 0x00, 0x64, 0x00, 0x30, 0x0a, 0x80, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x30, 0x00, 0x00,
0x06, 0x00, 0x09, 0x00, 0x82, 0x00, 0x06, 0x00, 0x06, 0x00, 0x08, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4c, 0x04, 0x02,
0x00, 0x03, 0x00, 0x00, 0x00, 0x91, 0x41, 0x00, 0x0c, 0x00, 0x71, 0x04, 0x00, 0x33, 0x01, 0x96, 0x00, 0x32, 0x00,
0x40, 0x5c, 0x88, 0x00, 0x77, 0x00, 0x00, 0x01, 0x81, 0x00, 0x02, 0x01, 0x06, 0x01, 0x17, 0x01, 0x52, 0x00, 0x75,
0x00, 0x45, 0x00, 0x48, 0x00, 0xaf, 0x00, 0xff, 0x00, 0xec, 0x00, 0xff, 0xb7, 0x00, 0x02, 0x00, 0xb0, 0x05, 0x80,
0xfc, 0x0f, 0x00, 0xe0, 0xff, 0x1f, 0xff, 0xdf, 0xff, 0xbf, 0xff, 0x7f, 0xc9, 0xf0, 0x59, 0xf0, 0x01, 0x01, 0x03,
0x01, 0x80, 0x00, 0x39, 0xf0, 0x89, 0xf0, 0x00, 0x40, 0x00, 0x80, 0x88, 0x00, 0x5e, 0xf0, 0x00, 0x20, 0x00, 0x10,
0x00, 0x08, 0x53, 0x00, 0x5a, 0x00, 0x9a, 0x01, 0x60, 0x00, 0x00, 0x0c, 0x8c, 0x00, 0x00, 0xf8, 0xa0, 0x00, 0xe8,
0x03, 0x01, 0x80, 0xb8, 0x7e, 0xe1, 0x7a, 0x1a, 0x01, 0x66, 0x00, 0xf0, 0x00, 0x6e, 0x00, 0x71, 0x00, 0x71, 0x00,
0x80, 0x50, 0xf1, 0x7f, 0xd0, 0x7f, 0xe2, 0x7f, 0xcb, 0x7f, 0x00, 0x2e, 0x03, 0x2e, 0x01, 0x01, 0x01, 0x2e, 0x03,
0x01, 0x05, 0x2e, 0x04, 0x01, 0x9d, 0xb8, 0x0d, 0xb8, 0x2f, 0xbd, 0x08, 0x0a, 0x2f, 0xb9, 0x02, 0x0a, 0x05, 0x2e,
0x1b, 0x01, 0x03, 0x2e, 0x07, 0x01, 0x26, 0xbd, 0x2f, 0xb9, 0x93, 0xbc, 0x9f, 0xb8, 0x02, 0x0a, 0x81, 0x0a, 0x80,
0xb2, 0x10, 0x2f, 0xb7, 0x7f, 0x83, 0x7f, 0x94, 0x7f, 0xa5, 0x7f, 0x72, 0x25, 0x79, 0x50, 0x4f, 0x52, 0x98, 0x2e,
0xe5, 0x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 0x6f, 0xd0, 0x5f, 0xb8, 0x2e,
0x10, 0x50, 0xfb, 0x7f, 0x21, 0x25, 0x98, 0x2e, 0xee, 0xb1, 0xfb, 0x6f, 0x21, 0x25, 0xf0, 0x5f, 0x10, 0x25, 0x80,
0x2e, 0xa2, 0x01, 0x03, 0x30, 0x15, 0x40, 0xd9, 0x04, 0x2b, 0x0e, 0x1d, 0x23, 0x29, 0x0f, 0x15, 0x40, 0x0c, 0x23,
0x2b, 0x0e, 0x9d, 0x23, 0x29, 0x0f, 0x4e, 0x23, 0x00, 0x40, 0x03, 0x0e, 0xd8, 0x22, 0x01, 0x0f, 0x94, 0x42, 0x4b,
0x22, 0x95, 0x42, 0x81, 0x42, 0xb8, 0x2e, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, 0x6d, 0x52,
0x53, 0x50, 0x60, 0x42, 0x00, 0x3f, 0x55, 0x54, 0x42, 0x42, 0x69, 0x82, 0x57, 0x54, 0x42, 0x42, 0x42, 0x82, 0x0b,
0x31, 0x42, 0x40, 0x10, 0x08, 0x50, 0x42, 0x7e, 0x80, 0x4b, 0x42, 0xf1, 0x31, 0x01, 0x42, 0x10, 0x50, 0x08, 0x80,
0xf0, 0x7f, 0x30, 0x30, 0x03, 0x2e, 0x40, 0xf0, 0x56, 0x90, 0x1f, 0x2f, 0x03, 0x30, 0x5f, 0x52, 0x59, 0x54, 0x54,
0x34, 0x06, 0x30, 0x5b, 0x50, 0x55, 0x32, 0x1d, 0x1a, 0xe3, 0x22, 0x18, 0x1a, 0x5d, 0x58, 0xe3, 0x22, 0x04, 0x30,
0xd5, 0x40, 0xb5, 0x0d, 0xe1, 0xbe, 0x6f, 0xbb, 0x80, 0x91, 0xa9, 0x0d, 0x01, 0x89, 0xb5, 0x23, 0x10, 0xa1, 0xf7,
0x2f, 0xda, 0x0e, 0x54, 0x34, 0xeb, 0x2f, 0x01, 0x2e, 0x25, 0x00, 0x70, 0x1a, 0x00, 0x30, 0x21, 0x30, 0x08, 0x22,
0x00, 0xb2, 0x06, 0x2f, 0x21, 0x2e, 0x59, 0xf0, 0x98, 0x2e, 0xf6, 0x00, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0xf0,
0x6f, 0x01, 0x31, 0x20, 0x26, 0x01, 0x42, 0x10, 0x30, 0x21, 0x2e, 0x59, 0xf0, 0x98, 0x2e, 0xf6, 0x00, 0x3f, 0x50,
0x41, 0x52, 0x98, 0x2e, 0xfa, 0xb2, 0x3f, 0x50, 0x05, 0x84, 0x14, 0x30, 0x43, 0x50, 0x63, 0x30, 0x45, 0x52, 0x94,
0x42, 0x83, 0x42, 0x98, 0x2e, 0xfa, 0xb2, 0x43, 0x50, 0x73, 0x30, 0x06, 0x80, 0x49, 0x54, 0x47, 0x52, 0x03, 0x42,
0x25, 0x2e, 0x98, 0x00, 0x6f, 0x50, 0x23, 0x2e, 0x8b, 0x00, 0xf0, 0x7f, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0x01,
0x2e, 0x16, 0x01, 0x83, 0xbc, 0x9f, 0xb8, 0x01, 0xbc, 0x23, 0x2e, 0x74, 0x00, 0x8e, 0xb8, 0x01, 0x2e, 0x74, 0x00,
0x23, 0x2e, 0x4e, 0x00, 0x00, 0x90, 0x02, 0x2f, 0x40, 0x30, 0x21, 0x2e, 0x4d, 0x00, 0x98, 0x2e, 0x4d, 0xb2, 0x01,
0x2e, 0x4b, 0x00, 0x00, 0xb2, 0x90, 0x2e, 0x64, 0xb1, 0x01, 0x2e, 0x4d, 0x00, 0x03, 0xa0, 0x7b, 0x2f, 0x03, 0xb2,
0x06, 0x2f, 0x71, 0x52, 0x73, 0x50, 0x21, 0x2e, 0x8a, 0x00, 0x23, 0x2e, 0x80, 0x00, 0x5b, 0x2d, 0x07, 0x2e, 0x01,
0x01, 0xb2, 0xbc, 0x9f, 0xb8, 0x10, 0x30, 0x88, 0x08, 0x09, 0x2e, 0x52, 0x00, 0x67, 0x52, 0x21, 0x09, 0x2d, 0xbd,
0x22, 0x0b, 0x31, 0xbd, 0x2f, 0xb9, 0x29, 0x2e, 0x52, 0x00, 0x50, 0x09, 0x09, 0x2e, 0x52, 0x00, 0x69, 0x54, 0xde,
0xbe, 0x22, 0x09, 0x25, 0x0b, 0x29, 0x2e, 0x52, 0x00, 0xbf, 0xba, 0x07, 0x2e, 0x52, 0x00, 0x6b, 0x58, 0x68, 0x09,
0x1c, 0x09, 0xdf, 0xbe, 0x25, 0x0b, 0x07, 0x2e, 0x03, 0x01, 0xb2, 0xbe, 0xdf, 0xba, 0x29, 0x2e, 0x52, 0x00, 0x28,
0x09, 0x0b, 0x2e, 0x4e, 0x00, 0x56, 0x30, 0x75, 0x05, 0x33, 0xbf, 0x63, 0xbb, 0x75, 0x13, 0x40, 0xb3, 0x45, 0x23,
0x65, 0x5c, 0x6e, 0x09, 0x0d, 0x2e, 0x75, 0x00, 0x63, 0x5e, 0xb7, 0x09, 0x75, 0x0b, 0x2b, 0x2e, 0x75, 0x00, 0x0b,
0x2e, 0x75, 0x00, 0x4d, 0xbe, 0x69, 0x08, 0x0c, 0x0b, 0xb1, 0xbc, 0x9f, 0xb8, 0x29, 0x2e, 0x75, 0x00, 0x08, 0x09,
0x03, 0x2e, 0x75, 0x00, 0x4e, 0xbe, 0x4a, 0x08, 0x4c, 0x0a, 0x23, 0x2e, 0x75, 0x00, 0xbf, 0xb8, 0x88, 0x08, 0x01,
0x2e, 0x75, 0x00, 0x6b, 0x52, 0x01, 0x08, 0x2f, 0xbd, 0x02, 0x0a, 0x4b, 0x54, 0x4d, 0x52, 0x21, 0x2e, 0x75, 0x00,
0x25, 0x2e, 0x80, 0x00, 0x23, 0x2e, 0x8a, 0x00, 0x4f, 0x50, 0x98, 0x2e, 0x0d, 0xb2, 0x4f, 0x50, 0x3f, 0x52, 0x98,
0x2e, 0x0b, 0xb3, 0x4f, 0x50, 0x43, 0x52, 0x98, 0x2e, 0x0b, 0xb3, 0x01, 0x2e, 0x4d, 0x00, 0x04, 0x90, 0x08, 0x2f,
0x4f, 0x50, 0x98, 0x2e, 0x85, 0xb6, 0x4f, 0x50, 0x98, 0x2e, 0xe9, 0xb4, 0x4f, 0x50, 0x98, 0x2e, 0x8a, 0xb3, 0x05,
0x2e, 0x4d, 0x00, 0x82, 0xb2, 0x51, 0x2f, 0x80, 0xb2, 0x4f, 0x2f, 0x81, 0xb2, 0x61, 0x50, 0x41, 0x2f, 0x83, 0xb2,
0x03, 0x2e, 0x7e, 0x00, 0x2f, 0x2f, 0x84, 0x90, 0x53, 0x2f, 0x05, 0x2e, 0x74, 0x00, 0x80, 0x90, 0x03, 0x2f, 0x00,
0x30, 0x21, 0x2e, 0x50, 0x00, 0x4c, 0x2d, 0x07, 0x2e, 0x88, 0x00, 0x05, 0x2e, 0x16, 0x01, 0xc0, 0xb2, 0x06, 0x2f,
0x13, 0x30, 0xd3, 0x08, 0xc0, 0xb2, 0x02, 0x2f, 0x03, 0x30, 0x27, 0x2e, 0x4d, 0x00, 0x07, 0x2e, 0x78, 0x00, 0x59,
0x0a, 0x40, 0xb2, 0x02, 0x2f, 0x01, 0x30, 0x23, 0x2e, 0x50, 0x00, 0x21, 0x30, 0x51, 0x08, 0x40, 0xb2, 0x32, 0x2f,
0x03, 0x2e, 0x50, 0x00, 0x10, 0x08, 0x41, 0x82, 0x02, 0xb8, 0x23, 0x2e, 0x50, 0x00, 0x48, 0x0e, 0x29, 0x2f, 0x00,
0x30, 0x21, 0x2e, 0x4d, 0x00, 0x26, 0x2d, 0x40, 0xb2, 0x23, 0x2f, 0x11, 0x30, 0x40, 0x30, 0x02, 0x30, 0x23, 0x2e,
0x77, 0x00, 0x23, 0x2e, 0x81, 0x00, 0x21, 0x2e, 0x4d, 0x00, 0x25, 0x2e, 0x50, 0x00, 0x18, 0x2d, 0x01, 0x2e, 0x51,
0x00, 0x3f, 0x80, 0x21, 0x2e, 0x51, 0x00, 0x00, 0xaa, 0x10, 0x2f, 0x30, 0x30, 0x21, 0x2e, 0x4d, 0x00, 0x0d, 0x2d,
0x03, 0x2e, 0x4e, 0x00, 0x02, 0x32, 0x10, 0x30, 0x51, 0x10, 0x21, 0x2e, 0x77, 0x00, 0x21, 0x2e, 0x81, 0x00, 0x21,
0x2e, 0x4d, 0x00, 0x23, 0x2e, 0x51, 0x00, 0x03, 0x30, 0x27, 0x2e, 0x4b, 0x00, 0x01, 0x2e, 0x00, 0xf0, 0x09, 0x2e,
0x16, 0x01, 0x05, 0x2e, 0x74, 0x00, 0x4f, 0xba, 0x80, 0x90, 0x03, 0x2e, 0x4f, 0x00, 0x06, 0x2f, 0x40, 0xb2, 0x00,
0x30, 0x29, 0x2f, 0x27, 0x2e, 0x4f, 0x00, 0x27, 0x2c, 0x01, 0x25, 0x40, 0x90, 0x01, 0x2f, 0x21, 0x2e, 0x4f, 0x00,
0x03, 0x2e, 0x4d, 0x00, 0x40, 0xb2, 0x12, 0x2f, 0x44, 0x90, 0x00, 0x30, 0x1a, 0x2f, 0x00, 0xb3, 0x01, 0x2e, 0x4f,
0x00, 0x16, 0x2f, 0x98, 0x2e, 0xc8, 0x00, 0x00, 0xb2, 0x70, 0x32, 0x11, 0x2f, 0x91, 0x31, 0x98, 0x2e, 0xe0, 0x00,
0x00, 0x90, 0x90, 0x30, 0x0c, 0x2c, 0x08, 0x22, 0x00, 0x91, 0x01, 0x2f, 0x21, 0x2e, 0x4f, 0x00, 0x21, 0x33, 0x22,
0x30, 0x01, 0x2e, 0x4e, 0x00, 0x01, 0x00, 0x25, 0x2e, 0x4d, 0x00, 0x00, 0xb2, 0x01, 0x2f, 0x21, 0x2e, 0x00, 0xf0,
0x01, 0x2e, 0x4c, 0x00, 0x00, 0x90, 0x03, 0x2f, 0x01, 0x2e, 0x65, 0x00, 0x00, 0xb2, 0x09, 0x2f, 0x51, 0x50, 0x98,
0x2e, 0x0d, 0xb2, 0x51, 0x50, 0x98, 0x2e, 0x30, 0xb5, 0x51, 0x50, 0x98, 0x2e, 0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0x12, 0xbd, 0x52, 0xbc, 0x6e, 0xbb, 0xa2, 0x0a, 0x9e, 0xb5, 0xde, 0xb6, 0x30, 0x0b, 0xf7, 0x7f,
0x98, 0x2e, 0xcb, 0xb1, 0xf5, 0x6f, 0x31, 0x25, 0xd1, 0x6f, 0x92, 0x6f, 0xab, 0x6f, 0x50, 0x43, 0x43, 0x43, 0x90,
0x5f, 0x6b, 0x56, 0x80, 0x2e, 0xf8, 0xb1, 0x10, 0x50, 0x03, 0x40, 0x19, 0x18, 0x7d, 0x56, 0x19, 0x05, 0x36, 0x25,
0xf7, 0x7f, 0x4a, 0x17, 0x54, 0x18, 0xec, 0x18, 0x09, 0x17, 0x01, 0x30, 0x0c, 0x07, 0xe2, 0x18, 0xde, 0x00, 0xf2,
0x6f, 0x97, 0x02, 0x7b, 0x58, 0xdc, 0x00, 0x91, 0x02, 0xbf, 0xb8, 0x21, 0xbd, 0x8a, 0x0a, 0xc0, 0x2e, 0x02, 0x42,
0xf0, 0x5f, 0x0a, 0x86, 0x02, 0x30, 0x12, 0x42, 0x43, 0x0e, 0xfc, 0x2f, 0x36, 0x80, 0x13, 0x30, 0x13, 0x42, 0x12,
0x42, 0x12, 0x42, 0x12, 0x42, 0x02, 0x42, 0x04, 0x80, 0x41, 0x84, 0x11, 0x42, 0x02, 0x42, 0xb8, 0x2e, 0x46, 0x86,
0x80, 0x50, 0xe4, 0x40, 0xc4, 0x84, 0xbe, 0x8e, 0x85, 0x40, 0xf4, 0x7f, 0x42, 0x88, 0x42, 0x41, 0x2d, 0xbb, 0x02,
0x30, 0xc2, 0x43, 0x80, 0xb3, 0xc3, 0x40, 0xe6, 0x7f, 0xd0, 0x7f, 0xc4, 0x7f, 0x68, 0x2f, 0x41, 0x25, 0x57, 0x40,
0xb1, 0x7f, 0xc1, 0x91, 0x0e, 0x2f, 0x02, 0x43, 0x00, 0x2e, 0xc1, 0x6f, 0x13, 0x40, 0x53, 0x42, 0x00, 0x2e, 0x13,
0x40, 0x53, 0x42, 0x00, 0x2e, 0x00, 0x40, 0x40, 0x42, 0x7d, 0x80, 0xc0, 0x2e, 0x02, 0x42, 0x80, 0x5f, 0x08, 0x89,
0x11, 0x30, 0x07, 0x41, 0xa7, 0x7f, 0x3a, 0x89, 0xc7, 0x41, 0x45, 0x41, 0xd3, 0xbe, 0xf5, 0xbf, 0xd3, 0xba, 0xf5,
0xbb, 0x85, 0x7f, 0x97, 0x7f, 0x05, 0x30, 0xca, 0x15, 0xf7, 0x09, 0xc0, 0xb3, 0x0a, 0x2f, 0x06, 0x40, 0x07, 0x41,
0xb7, 0x05, 0x07, 0x30, 0x80, 0xa9, 0xfe, 0x05, 0xb7, 0x23, 0x97, 0x6f, 0x77, 0x0f, 0x4d, 0x23, 0xe6, 0x6f, 0xc0,
0xb2, 0x06, 0x2f, 0xa7, 0x6f, 0x85, 0x5c, 0xc7, 0x41, 0xbe, 0x09, 0x80, 0xb3, 0xe6, 0x6f, 0x01, 0x2f, 0x07, 0x40,
0x07, 0x43, 0x81, 0x84, 0x01, 0x80, 0x01, 0x89, 0x83, 0xa2, 0xe0, 0x2f, 0xb0, 0x6f, 0x2b, 0x1a, 0x02, 0x2f, 0x01,
0x30, 0x25, 0x2c, 0x01, 0x42, 0x02, 0x40, 0x91, 0x28, 0x83, 0x6f, 0x02, 0x42, 0x53, 0x0e, 0x1d, 0x2f, 0xf2, 0x6f,
0x80, 0xb2, 0x03, 0x2f, 0xbf, 0x84, 0x8a, 0x14, 0x25, 0x2e, 0x5e, 0xf0, 0xd4, 0x6f, 0xc3, 0x6f, 0x12, 0x41, 0xd2,
0x42, 0x02, 0x30, 0x15, 0x41, 0xd5, 0x42, 0x00, 0x2e, 0x04, 0x41, 0xc4, 0x42, 0xc3, 0x86, 0xa5, 0x6f, 0x87, 0x58,
0x45, 0x41, 0x2c, 0x09, 0xc1, 0x42, 0x00, 0xb3, 0x04, 0x2f, 0x00, 0x2e, 0x03, 0x2c, 0x02, 0x42, 0x10, 0x30, 0x40,
0x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00, 0x08, 0x2c, 0x75, 0x25, 0x30,
0x30, 0x21, 0x2e, 0x58, 0x00, 0x03, 0x2d, 0x10, 0x30, 0x21, 0x2e, 0x58, 0x00, 0xc0, 0x91, 0xf2, 0x6f, 0x01, 0x2e,
0x57, 0x00, 0x03, 0x2f, 0x03, 0x30, 0x27, 0x2e, 0x59, 0x00, 0x12, 0x2d, 0x8d, 0x56, 0x63, 0x0f, 0x03, 0x2f, 0x82,
0xb9, 0x27, 0x2e, 0x59, 0x00, 0x0b, 0x2d, 0x82, 0x88, 0x13, 0x30, 0x04, 0x41, 0x00, 0xad, 0x02, 0x2f, 0x27, 0x2e,
0x59, 0x00, 0x03, 0x2d, 0x03, 0x30, 0x27, 0x2e, 0x59, 0x00, 0x35, 0x30, 0x07, 0x2e, 0x58, 0x00, 0x09, 0x2e, 0x59,
0x00, 0xdd, 0x08, 0x42, 0xbe, 0xdc, 0x0a, 0x03, 0x1a, 0xd3, 0x7f, 0x00, 0x30, 0x2f, 0x2f, 0x40, 0xa4, 0x2d, 0x2f,
0x43, 0x90, 0x03, 0x30, 0x10, 0x2f, 0x09, 0x2e, 0x5f, 0x00, 0x10, 0x30, 0x60, 0x29, 0x09, 0x2e, 0x5d, 0x00, 0xd7,
0x6f, 0x27, 0x1a, 0x2b, 0x2e, 0x5f, 0x00, 0x01, 0x2f, 0x27, 0x2e, 0x5f, 0x00, 0x09, 0x2e, 0x5f, 0x00, 0x05, 0xa3,
0x03, 0x22, 0x00, 0x90, 0x04, 0x2f, 0x8b, 0x56, 0x98, 0x2e, 0xa2, 0xb4, 0xf2, 0x6f, 0x03, 0x30, 0x00, 0x90, 0x10,
0x2f, 0x01, 0x2e, 0x5e, 0x00, 0x62, 0x7f, 0x1a, 0x25, 0xc2, 0x6f, 0x72, 0x7f, 0x83, 0x7f, 0x76, 0x82, 0x90, 0x7f,
0x98, 0x2e, 0x67, 0xb4, 0x01, 0xb2, 0x21, 0x2e, 0x5e, 0x00, 0x11, 0x30, 0x00, 0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, 0x5f, 0xb8, 0x2e, 0x81, 0x8a, 0x82, 0x88, 0x41,
0xb2, 0x01, 0x2f, 0x00, 0x2e, 0x02, 0x2d, 0x24, 0x2c, 0x00, 0x30, 0x42, 0xb2, 0x01, 0x2f, 0x43, 0x90, 0x37, 0x2f,
0x80, 0x40, 0xc6, 0x40, 0x86, 0x05, 0x7e, 0x80, 0x8f, 0x52, 0xc8, 0x01, 0x00, 0x30, 0x80, 0xa9, 0x46, 0x04, 0xc7,
0x41, 0x71, 0x22, 0x4f, 0x0f, 0x28, 0x2f, 0xc1, 0x8c, 0x41, 0x41, 0x86, 0x41, 0x4e, 0x04, 0x40, 0xa8, 0x81, 0x05,
0x4e, 0x22, 0x4f, 0x0f, 0x1f, 0x2f, 0xc2, 0x82, 0x03, 0x41, 0x41, 0x40, 0xd9, 0x04, 0xc0, 0xa8, 0x43, 0x04, 0xd9,
0x22, 0x5f, 0x0f, 0x16, 0x2f, 0x82, 0x40, 0x80, 0xa8, 0xc2, 0x04, 0x93, 0x22, 0x91, 0x56, 0x53, 0x0f, 0x0d, 0x2f,
0x42, 0x41, 0x80, 0xa8, 0xc2, 0x04, 0x93, 0x22, 0x91, 0x56, 0x53, 0x0f, 0x06, 0x2f, 0x02, 0x41, 0x80, 0xa8, 0xc2,
0x04, 0x93, 0x22, 0x91, 0x56, 0xd3, 0x0e, 0x05, 0x2f, 0x10, 0x30, 0xb8, 0x2e, 0x10, 0x30, 0xb8, 0x2e, 0x00, 0x30,
0xb8, 0x2e, 0xb8, 0x2e, 0x05, 0x2e, 0x8b, 0x00, 0x81, 0x82, 0x40, 0x50, 0x41, 0x40, 0x93, 0xbd, 0xbf, 0xb9, 0xfb,
0x7f, 0xc0, 0xb2, 0x0b, 0x30, 0x36, 0x2f, 0x07, 0x2e, 0x62, 0x00, 0xc0, 0x90, 0x04, 0x2f, 0xc1, 0x86, 0x27, 0x2e,
0x62, 0x00, 0x37, 0x2e, 0x63, 0x00, 0x82, 0x86, 0x82, 0x40, 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21, 0x2e, 0x5e, 0xf0, 0x06, 0x2d, 0x03, 0x30, 0x93, 0x50, 0x98, 0x2e, 0x68,
0xb5, 0x27, 0x2e, 0x65, 0x00, 0xfb, 0x6f, 0xd0, 0x5f, 0xb8, 0x2e, 0x0c, 0x82, 0x02, 0x30, 0x12, 0x42, 0x41, 0x0e,
0xfc, 0x2f, 0x35, 0x80, 0x87, 0x52, 0x11, 0x42, 0x00, 0x2e, 0x95, 0x52, 0x01, 0x42, 0xb8, 0x2e, 0x07, 0x88, 0x47,
0x8e, 0x06, 0x41, 0x3c, 0x8b, 0x32, 0x1a, 0x42, 0x41, 0xc7, 0x41, 0x16, 0x2f, 0x80, 0x91, 0x23, 0x2f, 0x57, 0x0f,
0x16, 0x30, 0x0c, 0x2f, 0x06, 0x80, 0x00, 0x2e, 0x00, 0x40, 0x00, 0xb2, 0x04, 0x2f, 0x46, 0x82, 0x00, 0x2e, 0x41,
0x40, 0xd1, 0x0f, 0x02, 0x2f, 0x06, 0x30, 0x06, 0x43, 0x46, 0x43, 0x80, 0xb3, 0x11, 0x2f, 0x03, 0x43, 0x47, 0x43,
0xb8, 0x2e, 0xd7, 0x0e, 0x0c, 0x2f, 0x44, 0x82, 0x17, 0x04, 0x41, 0x40, 0x41, 0x0f, 0x07, 0x2f, 0x03, 0x43, 0x42,
0x83, 0x47, 0x43, 0x00, 0x2e, 0x43, 0x40, 0xc1, 0x86, 0x43, 0x42, 0xb8, 0x2e, 0xb8, 0x2e, 0x89, 0x88, 0xc0, 0x50,
0x39, 0x8d, 0x88, 0x81, 0xe2, 0x7f, 0x02, 0x30, 0x05, 0x40, 0xf2, 0x7f, 0x41, 0xab, 0x22, 0x30, 0x95, 0x22, 0x86,
0x41, 0x97, 0x5e, 0x9a, 0x00, 0x04, 0x41, 0x37, 0x18, 0x66, 0x01, 0x99, 0x56, 0xeb, 0x00, 0xc1, 0x7f, 0xb3, 0x7f,
0xd5, 0x7f, 0x48, 0x82, 0x39, 0x80, 0x82, 0x40, 0xa0, 0x7f, 0x91, 0x7f, 0x8b, 0x7f, 0x06, 0x30, 0x7b, 0x5a, 0x9b,
0x58, 0x7b, 0x56, 0x98, 0x2e, 0x71, 0xb2, 0x91, 0x6f, 0x7b, 0x82, 0xc6, 0x6f, 0x42, 0x40, 0x81, 0x84, 0x42, 0x42,
0x43, 0x82, 0x83, 0x8b, 0x42, 0x40, 0x86, 0x89, 0x7b, 0x82, 0x84, 0x87, 0x71, 0x7f, 0x80, 0xb2, 0x95, 0x7f, 0x64,
0x7f, 0x50, 0x7f, 0x02, 0x2f, 0xc5, 0x40, 0x41, 0x8b, 0xc5, 0x42, 0x87, 0x89, 0x67, 0x40, 0x07, 0x0f, 0x85, 0x8b,
0x41, 0x7f, 0x82, 0x8d, 0x47, 0x40, 0x3d, 0x2f, 0x81, 0x41, 0x01, 0x0e, 0xe1, 0x6f, 0x2e, 0x2f, 0x47, 0x8c, 0x90,
0x6f, 0x86, 0x41, 0x07, 0x40, 0xfe, 0x0e, 0x02, 0x2f, 0x04, 0x41, 0x00, 0xb3, 0x22, 0x2f, 0x45, 0x82, 0x04, 0x30,
0x41, 0x40, 0x71, 0x00, 0xf9, 0x0e, 0x37, 0x2f, 0x46, 0x41, 0x80, 0xa7, 0x01, 0x30, 0x04, 0x30, 0x0e, 0x2f, 0xe4,
0x6f, 0x01, 0x89, 0x00, 0x2e, 0x04, 0x41, 0x74, 0x0f, 0x04, 0x30, 0x07, 0x2f, 0x80, 0x90, 0x00, 0x2f, 0xc1, 0x42,
0x03, 0x86, 0x81, 0x84, 0xc2, 0x42, 0x01, 0x42, 0x14, 0x30, 0x42, 0x85, 0x41, 0x43, 0xa1, 0x42, 0x00, 0x2e, 0x82,
0x40, 0x80, 0x90, 0x1c, 0x2f, 0x01, 0x42, 0x1b, 0x2d, 0x06, 0x42, 0x19, 0x2c, 0x04, 0x30, 0xb2, 0x6f, 0xba, 0x04,
0x02, 0x1e, 0x80, 0x43, 0x12, 0x30, 0xc0, 0x6f, 0x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2f, 0x01, 0x2e, 0x00, 0xf0, 0x0c, 0xbc, 0x0c, 0xb8, 0x05, 0xa2, 0x46, 0x2f, 0x97, 0x50, 0x30,
0x0a, 0x12, 0x30, 0x27, 0x2e, 0x69, 0x00, 0x21, 0x2e, 0x00, 0xf0, 0x25, 0x2e, 0x6a, 0x00, 0x3d, 0x2d, 0x20, 0x30,
0x21, 0x2e, 0x6b, 0x00, 0x2f, 0x2e, 0x6c, 0x00, 0xf2, 0x6f, 0xa3, 0x50, 0x91, 0x40, 0x11, 0x42, 0x00, 0x2e, 0x91,
0x40, 0x11, 0x42, 0x00, 0x2e, 0x82, 0x40, 0x2e, 0x2c, 0x02, 0x42, 0x41, 0x90, 0xd5, 0x7f, 0x07, 0x2f, 0xa5, 0x50,
0x20, 0x08, 0x06, 0x0a, 0x0b, 0x30, 0x21, 0x2e, 0x00, 0xf0, 0x37, 0x2e, 0x6a, 0x00, 0xf1, 0x6f, 0x98, 0x2e, 0x26,
0xb7, 0x00, 0xb2, 0x05, 0x2f, 0xd2, 0x6f, 0x10, 0x30, 0x25, 0x2e, 0x6c, 0x00, 0x21, 0x2e, 0x6b, 0x00, 0xf2, 0x6f,
0xa3, 0x50, 0x91, 0x40, 0x11, 0x42, 0x00, 0x2e, 0x91, 0x40, 0x11, 0x42, 0x00, 0x2e, 0x82, 0x40, 0xeb, 0x6f, 0x0c,
0x2c, 0x02, 0x42, 0x41, 0x90, 0x00, 0x30, 0x03, 0x2f, 0x29, 0x2e, 0x00, 0xf0, 0x21, 0x2e, 0x6a, 0x00, 0x21, 0x2e,
0x6b, 0x00, 0x21, 0x2e, 0x6c, 0x00, 0xd0, 0x5f, 0xb8, 0x2e, 0xa3, 0x58, 0x00, 0x30, 0x15, 0x41, 0x56, 0x40, 0xc6,
0x05, 0x13, 0x41, 0x56, 0x40, 0x04, 0x41, 0x6f, 0x29, 0x41, 0x40, 0xc6, 0x05, 0x41, 0x04, 0x61, 0x28, 0x85, 0x05,
0x40, 0xa9, 0x30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, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00,
0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18,
0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e,
0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80,
0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00
};
/***************************************************************************/
/*! Static Function Declarations */
/***************************************************************************/
/*!
* @brief This API update the settings of tap into write array.
*
* @param[in] setting : Pointer to structure variable which stores the
* settings parameter1 to parameter12.
* @param[in] index : Value for array traversing.
* @param[out] feature_config : Pointer to store the settings
*
* @return none
*/
static void update_tap_parameter(const struct bma456mm_multitap_settings *setting,
uint8_t index,
uint8_t *feature_config);
/*!
* @brief This API copy the settings of tap into the
* structure of bma456mm_multitap_settings, which is read from sensor.
*
* @param[out] setting : Pointer to structure variable which stores the
* settings parameter1 to parameter12 read from sensor.
* @param[in] data_p : Pointer of array which stores the parameters.
*
* @return none
*/
static void extract_tap_parameter(struct bma456mm_multitap_settings *setting, const uint16_t *data_p);
/*!
* @brief This API enables the features of sensor.
*
* @param[in] feature : Variable to specify the features which are to be set in
* the sensor.
* @param[in] len : Length to read and write
* @param[in] feature_config : Array address which stores the feature
* configuration data
* @param[in] dev : Structure instance of bma4_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
static int8_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev);
/*!
* @brief This API disables the features of sensor.
*
* @param[in] feature : Variable to specify the features which are to be unset
* in the sensor.
* @param[in] len : Length to read and write
* @param[in] feature_config : Array address which stores the feature
* configuration data
* @param[in] dev : Structure instance of bma4_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
static int8_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev);
/***************************************************************************/
/*! Global Function Definitions */
/***************************************************************************/
/*!
* @brief This API is the entry point.
* Call this API before using all other APIs.
* This API reads the chip-id of the sensor and sets the resolution.
*/
int8_t bma456mm_init(struct bma4_dev *dev)
{
int8_t rslt;
/* Structure to define the default values for axes re-mapping */
struct bma4_axes_remap axes_remap = {
.x_axis = BMA4_MAP_X_AXIS, .x_axis_sign = BMA4_MAP_POSITIVE, .y_axis = BMA4_MAP_Y_AXIS,
.y_axis_sign = BMA4_MAP_POSITIVE, .z_axis = BMA4_MAP_Z_AXIS, .z_axis_sign = BMA4_MAP_POSITIVE
};
if (dev != NULL)
{
rslt = bma4_init(dev);
if (rslt == BMA4_OK)
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
/* Resolution of BMA456MM sensor is 16 bit */
dev->resolution = BMA4_16_BIT_RESOLUTION;
dev->feature_len = BMA456MM_FEATURE_SIZE;
dev->config_size = sizeof(bma456mm_config_file);
/* Set the default values for axis
* re-mapping in the device structure
*/
dev->remap = axes_remap;
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API is used to upload the configuration file to enable the
* features of the sensor.
*/
int8_t bma456mm_write_config_file(struct bma4_dev *dev)
{
int8_t rslt = BMA4_OK;
if (dev != NULL)
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
/* Configuration stream read/write length boundary
* check
*/
if ((dev->read_write_len >= BMA456MM_RD_WR_MIN_LEN) && (dev->read_write_len <= BMA456MM_RD_WR_MAX_LEN))
{
/* Even or odd check */
if ((dev->read_write_len % 2) != 0)
{
dev->read_write_len = dev->read_write_len - 1;
}
/* Assign stream data */
dev->config_file_ptr = bma456mm_config_file;
rslt = bma4_write_config_file(dev);
}
else
{
rslt = BMA4_E_RD_WR_LENGTH_INVALID;
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API is used to get the config file major and minor information.
*/
int8_t bma456mm_get_version_config(uint16_t *config_major, uint16_t *config_minor, struct bma4_dev *dev)
{
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to config file version */
uint8_t index = BMA456MM_CONFIG_ID_OFFSET;
/* Variable to define LSB */
uint8_t lsb = 0;
/* Variable to define MSB */
uint8_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
/* Result of api are returned to this variable */
int8_t rslt = BMA4_OK;
if ((config_major != NULL) && (config_minor != NULL))
{
rslt = bma4_set_advance_power_save(BMA4_DISABLE, dev);
if (rslt == BMA4_OK)
{
/* Wait for sensor time synchronization. Refer the data-sheet for
* more information
*/
dev->delay_us(450, dev->intf_ptr);
/* Get config file identification from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Get word to calculate config file identification */
lsb = feature_config[index++];
msb = feature_config[index++];
lsb_msb = (uint16_t)(msb << 8 | lsb);
/* Get major and minor version */
*config_major = BMA4_GET_BITSLICE(lsb_msb, BMA4_CONFIG_MAJOR);
*config_minor = BMA4_GET_BITS_POS_0(lsb, BMA4_CONFIG_MINOR);
}
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API is used to get the configuration id of the sensor.
*/
int8_t bma456mm_get_config_id(uint16_t *config_id, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_CONFIG_ID_OFFSET;
int8_t rslt = BMA4_OK;
uint16_t config_id_lsb = 0;
uint16_t config_id_msb = 0;
if ((dev != NULL) && (config_id != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
config_id_lsb = (uint16_t)feature_config[index];
config_id_msb = ((uint16_t)feature_config[index + 1]) << 8;
*config_id = config_id_lsb | config_id_msb;
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets/un-sets the user provided interrupt to either interrupt
* pin1 or pin2 in the sensor.
*/
int8_t bma456mm_map_interrupt(uint8_t int_line, uint16_t int_map, uint8_t enable, struct bma4_dev *dev)
{
int8_t rslt = BMA4_OK;
if (dev != NULL)
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
if (int_line <= 1)
{
/* Map/Unmap the interrupt */
rslt = bma4_map_interrupt(int_line, int_map, enable, dev);
}
else
{
rslt = BMA4_E_INT_LINE_INVALID;
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API reads the interrupt status from the sensor.
*/
int8_t bma456mm_read_int_status(uint16_t *int_status, struct bma4_dev *dev)
{
int8_t rslt = BMA4_OK;
if ((dev != NULL) && (int_status != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
/* Read the interrupt status */
rslt = bma4_read_int_status(int_status, dev);
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API enables/disables the features of the sensor.
*/
int8_t bma456mm_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
int8_t rslt = BMA4_OK;
uint8_t len = BMA456MM_FEATURE_SIZE;
if (dev != NULL)
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
/* Read feature configuration data */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
if (rslt == BMA4_OK)
{
if (enable == TRUE)
{
/* Enables the feature */
rslt = feature_enable(feature, len, feature_config, dev);
}
else
{
/* Disables the feature */
rslt = feature_disable(feature, len, feature_config, dev);
}
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API performs x, y and z axis remapping in the sensor.
*/
int8_t bma456mm_set_remap_axes(const struct bma4_remap *remap_axes, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_AXES_REMAP_OFFSET;
int8_t rslt = BMA4_OK;
if (remap_axes != NULL)
{
rslt = bma4_set_remap_axes(remap_axes, feature_config, index, BMA456MM_FEATURE_SIZE, dev);
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API reads the x, y and z axis remap data from the sensor.
*/
int8_t bma456mm_get_remap_axes(struct bma4_remap *remap_axes, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_AXES_REMAP_OFFSET;
int8_t rslt = BMA4_OK;
if (remap_axes != NULL)
{
rslt = bma4_get_remap_axes(remap_axes, feature_config, index, BMA456MM_FEATURE_SIZE, dev);
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the configuration of any-motion feature in the sensor.
* This API enables/disables the any-motion feature according to the axis set.
*/
int8_t bma456mm_set_any_mot_config(const struct bma456mm_any_no_mot_config *any_mot, struct bma4_dev *dev)
{
/* Variable to define error */
int8_t rslt = BMA4_OK;
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to configure any-motion axes */
uint8_t index = BMA456MM_ANY_MOT_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if (any_mot != NULL)
{
/* Get any-motion configuration from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_ANY_MOT_LEN, dev);
if (rslt == BMA4_OK)
{
/* Set threshold value in feature configuration array */
feature_config[index] = BMA4_GET_LSB(any_mot->threshold);
feature_config[index + 1] = BMA4_GET_MSB(any_mot->threshold);
feature_config[index + 1] = BMA4_SET_BITSLICE(feature_config[index + 1],
BMA456MM_ANY_NO_MOTION_INTR_BHVR_EN,
any_mot->intr_bhvr);
feature_config[index + 1] = BMA4_SET_BITSLICE(feature_config[index + 1],
BMA456MM_ANY_MOTION_SLOPE_EN,
any_mot->slope);
/* Extract the word where duration and axes enable
* resides
*/
lsb = feature_config[index + 2];
msb = feature_config[index + 3] << 8;
lsb_msb = lsb | msb;
/* Set the duration in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_ANY_NO_MOT_DUR, any_mot->duration);
/* Set the axes in the same word */
lsb_msb = BMA4_SET_BITSLICE(lsb_msb, BMA456MM_ANY_NO_MOT_AXIS_EN, any_mot->axes_en);
/* Assign the word with set duration and axes enable
* value back to feature configuration array
*/
feature_config[index + 2] = BMA4_GET_LSB(lsb_msb);
feature_config[index + 3] = BMA4_GET_MSB(lsb_msb);
/* Set any-motion configuration to the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_ANY_MOT_LEN, dev);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the configuration of any-motion feature from the
* sensor.
*/
int8_t bma456mm_get_any_mot_config(struct bma456mm_any_no_mot_config *any_mot, struct bma4_dev *dev)
{
/* Variable to define error */
int8_t rslt = BMA4_OK;
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to configure any-motion axes */
uint8_t index = BMA456MM_ANY_MOT_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if (any_mot != NULL)
{
/* Get any-motion configuration from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_ANY_MOT_LEN, dev);
if (rslt == BMA4_OK)
{
/* Get word to calculate threshold and any-motion
* select
*/
lsb = (uint16_t)feature_config[index];
msb = (uint16_t)((feature_config[index + 1] << 8));
lsb_msb = lsb | msb;
/* Get word to calculate intr_bhvr */
any_mot->intr_bhvr = BMA4_GET_BITSLICE(feature_config[index + 1], BMA456MM_ANY_NO_MOTION_INTR_BHVR_EN);
/* Get word to calculate slope */
any_mot->slope = BMA4_GET_BITSLICE(feature_config[index + 1], BMA456MM_ANY_MOTION_SLOPE_EN);
/* Extract threshold value */
any_mot->threshold = lsb_msb & BMA456MM_ANY_NO_MOT_THRES_MSK;
/* Get word to calculate duration and axes enable */
lsb = (uint16_t)feature_config[index + 2];
msb = (uint16_t)((feature_config[index + 3] << 8));
lsb_msb = lsb | msb;
/* Extract duration value */
any_mot->duration = lsb_msb & BMA456MM_ANY_NO_MOT_DUR_MSK;
/* Extract axes enable value */
any_mot->axes_en = BMA4_GET_BITSLICE(lsb_msb, BMA456MM_ANY_NO_MOT_AXIS_EN);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the configuration of no-motion feature in the sensor.
* This API enables/disables the no-motion feature according to the axis set.
*/
int8_t bma456mm_set_no_mot_config(const struct bma456mm_any_no_mot_config *no_mot, struct bma4_dev *dev)
{
/* Variable to define error */
int8_t rslt = BMA4_OK;
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to configure no-motion axes */
uint8_t index = BMA456MM_NO_MOT_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if (no_mot != NULL)
{
/* Get no-motion configuration from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_NO_MOT_RD_WR_LEN, dev);
if (rslt == BMA4_OK)
{
/* Set threshold value in feature configuration array */
feature_config[index] = BMA4_GET_LSB(no_mot->threshold);
feature_config[index + 1] = BMA4_GET_MSB(no_mot->threshold);
feature_config[index + 1] = BMA4_SET_BITSLICE(feature_config[index + 1],
BMA456MM_ANY_NO_MOTION_INTR_BHVR_EN,
no_mot->intr_bhvr);
/* Extract the word where duration and axes enable
* resides
*/
lsb = feature_config[index + 2];
msb = feature_config[index + 3] << 8;
lsb_msb = lsb | msb;
/* Set the duration in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_ANY_NO_MOT_DUR, no_mot->duration);
/* Set the axes in the same word */
lsb_msb = BMA4_SET_BITSLICE(lsb_msb, BMA456MM_ANY_NO_MOT_AXIS_EN, no_mot->axes_en);
/* Assign the word with set duration and axes enable
* value back to feature configuration array
*/
feature_config[index + 2] = BMA4_GET_LSB(lsb_msb);
feature_config[index + 3] = BMA4_GET_MSB(lsb_msb);
/* Set no-motion configuration to the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_NO_MOT_RD_WR_LEN, dev);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the configuration of no-motion feature from the
* sensor.
*/
int8_t bma456mm_get_no_mot_config(struct bma456mm_any_no_mot_config *no_mot, struct bma4_dev *dev)
{
/* Variable to define error */
int8_t rslt = BMA4_OK;
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to configure no-motion axes */
uint8_t index = BMA456MM_NO_MOT_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if (no_mot != NULL)
{
/* Get no-motion configuration from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_NO_MOT_RD_WR_LEN, dev);
if (rslt == BMA4_OK)
{
/* Get word to calculate threshold and no-motion
* select
*/
lsb = (uint16_t)feature_config[index];
msb = ((uint16_t)feature_config[index + 1] << 8);
lsb_msb = lsb | msb;
/* Get word to calculate intr_bhvr */
no_mot->intr_bhvr = BMA4_GET_BITSLICE(feature_config[index + 1], BMA456MM_ANY_NO_MOTION_INTR_BHVR_EN);
/* Extract threshold value */
no_mot->threshold = lsb_msb & BMA456MM_ANY_NO_MOT_THRES_MSK;
/* Get word to calculate duration and axes enable */
lsb = (uint16_t)feature_config[index + 2];
msb = (uint16_t)((feature_config[index + 3] << 8));
lsb_msb = lsb | msb;
/* Extract duration value */
no_mot->duration = lsb_msb & BMA456MM_ANY_NO_MOT_DUR_MSK;
/* Extract axes enable value */
no_mot->axes_en = BMA4_GET_BITSLICE(lsb_msb, BMA456MM_ANY_NO_MOT_AXIS_EN);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the parameter1 to parameter12 settings of the
* tap feature.
*/
int8_t bma456mm_tap_get_parameter(struct bma456mm_multitap_settings *setting, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint16_t *data_p = (uint16_t *)(void *)feature_config;
int8_t rslt = BMA4_OK;
if ((dev != NULL) && (setting != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* To convert 8bit to 16 bit address */
data_p = data_p + ((BMA456MM_TAP_DETECTOR_OFFSET + 2) / 2);
extract_tap_parameter(setting, data_p);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the parameter1 to parameter12 settings of the
* tap feature in the sensor.
*/
int8_t bma456mm_tap_set_parameter(const struct bma456mm_multitap_settings *setting, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_TAP_DETECTOR_OFFSET + 2;
int8_t rslt = BMA4_OK;
if ((dev != NULL) && (setting != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
update_tap_parameter(setting, index, feature_config);
/* Writes tap parameter settings
* in the sensor
*/
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the output for activity feature.
*/
int8_t bma456mm_output_state(struct bma456mm_out_state *out_state, struct bma4_dev *dev)
{
uint8_t data[3] = { 0 };
int8_t rslt = BMA4_OK;
if ((dev != NULL) && (out_state != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
/* Reads the activity output from the gpio register */
rslt = bma4_read_regs(BMA456MM_FEAT_OUT_ADDR, data, 3, dev);
if (rslt == BMA4_OK)
{
out_state->orientation_out = BMA4_GET_BITS_POS_0(data[0], BMA456MM_ORIENT_OUT);
out_state->orientation_faceup_down = BMA4_GET_BITSLICE(data[0], BMA456MM_ORIENT_FACEUP_DOWN);
out_state->high_g_detect_x = BMA4_GET_BITS_POS_0(data[1], BMA456MM_HIGH_G_DETECT_X);
out_state->high_g_detect_y = BMA4_GET_BITSLICE(data[1], BMA456MM_HIGH_G_DETECT_Y);
out_state->high_g_detect_z = BMA4_GET_BITSLICE(data[1], BMA456MM_HIGH_G_DETECT_Z);
out_state->high_g_detect_sign = BMA4_GET_BITSLICE(data[1], BMA456MM_HIGH_G_DETECT_SIGN);
out_state->s_tap = BMA4_GET_BITS_POS_0(data[2], BMA456MM_SINGLE_TAP_OUT);
out_state->d_tap = BMA4_GET_BITSLICE(data[2], BMA456MM_DOUBLE_TAP_OUT);
out_state->t_tap = BMA4_GET_BITSLICE(data[2], BMA456MM_TRIPLE_TAP_OUT);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the configuration for orientation feature of the sensor.
*/
int8_t bma456mm_set_orientation_config(const struct bma456mm_orientation_config *orientation, struct bma4_dev *dev)
{
/* variable used to return the status of communication result*/
int8_t rslt = BMA4_OK;
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0, };
uint8_t index = BMA456MM_ORIENTATION_OFFSET;
uint16_t orient_settings_1_lsb = 0;
uint16_t orient_settings_1_msb = 0;
uint16_t orient_settings_1 = 0;
if ((dev != NULL) && (orientation != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Extract upside/down, mode, block and theta */
orient_settings_1_lsb = feature_config[index];
orient_settings_1_msb = feature_config[index + 1] << 8;
orient_settings_1 = orient_settings_1_lsb | orient_settings_1_msb;
orient_settings_1 = BMA4_SET_BITSLICE(orient_settings_1, BMA456MM_ORIENT_UD, orientation->upside_down);
orient_settings_1 = BMA4_SET_BITSLICE(orient_settings_1, BMA456MM_ORIENT_MODE, orientation->mode);
orient_settings_1 = BMA4_SET_BITSLICE(orient_settings_1, BMA456MM_ORIENT_BLOCK, orientation->blocking);
orient_settings_1 = BMA4_SET_BITSLICE(orient_settings_1, BMA456MM_ORIENT_THETA, orientation->theta);
/* Assign upside/down, mode, block and theta value in feature config array*/
feature_config[index++] = BMA4_GET_LSB(orient_settings_1);
feature_config[index++] = BMA4_GET_MSB(orient_settings_1);
/* Assign hysteresis value in feature config array */
feature_config[index++] = BMA4_GET_LSB(orientation->hysteresis);
feature_config[index++] = BMA4_GET_MSB(orientation->hysteresis);
/* Writes orientation settings value in the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the configuration of orientation feature from the sensor
*/
int8_t bma456mm_get_orientation_config(struct bma456mm_orientation_config *orientation, struct bma4_dev *dev)
{
/* variable used to return the status of communication result*/
int8_t rslt = BMA4_OK;
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_ORIENTATION_OFFSET;
uint16_t orient_settings_lsb = 0;
uint16_t orient_settings_msb = 0;
uint16_t orient_settings = 0;
if ((dev != NULL) && (orientation != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Extract upside/down, mode, block and theta */
orient_settings_lsb = feature_config[index];
orient_settings_msb = feature_config[index + 1] << 8;
orient_settings = orient_settings_lsb | orient_settings_msb;
orientation->upside_down = BMA4_GET_BITSLICE(orient_settings, BMA456MM_ORIENT_UD);
orientation->mode = BMA4_GET_BITSLICE(orient_settings, BMA456MM_ORIENT_MODE);
orientation->blocking = BMA4_GET_BITSLICE(orient_settings, BMA456MM_ORIENT_BLOCK);
orientation->theta = BMA4_GET_BITSLICE(orient_settings, BMA456MM_ORIENT_THETA);
/* Extract hysteresis */
orient_settings_lsb = feature_config[index + 2];
orient_settings_msb = feature_config[index + 3] << 8;
orient_settings = orient_settings_lsb | orient_settings_msb;
orientation->hysteresis = BMA4_GET_BITS_POS_0(orient_settings, BMA456MM_ORIENT_HYST);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the configuration for low-g feature of the sensor.
*/
int8_t bma456mm_set_low_g_config(const struct bma456mm_low_g_config *low_g, struct bma4_dev *dev)
{
/* variable used to return the status of communication result*/
int8_t rslt = BMA4_OK;
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0, };
uint8_t index = BMA456MM_LOW_G_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if ((dev != NULL) && (low_g != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Threshold */
lsb = feature_config[index];
msb = feature_config[index + 1] << 8;
lsb_msb = lsb | msb;
/* Set the threshold in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_LOW_G_THRES, low_g->threshold);
/* Set threshold value in feature configuration array */
feature_config[index++] = BMA4_GET_LSB(lsb_msb);
feature_config[index++] = BMA4_GET_MSB(lsb_msb);
/* Hysteresis */
lsb = feature_config[index];
msb = feature_config[index + 1] << 8;
lsb_msb = lsb | msb;
/* Set the hysteresis in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_LOW_G_HYST, low_g->hysteresis);
/* Set hysteresis value in feature configuration array */
feature_config[index++] = BMA4_GET_LSB(lsb_msb);
feature_config[index++] = BMA4_GET_MSB(lsb_msb);
/* Duration */
lsb = feature_config[index];
msb = feature_config[index + 1] << 8;
lsb_msb = lsb | msb;
/* Set the duration in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_LOW_G_HYST, low_g->duration);
/* Set duration value in feature configuration array */
feature_config[index++] = BMA4_GET_LSB(lsb_msb);
feature_config[index++] = BMA4_GET_MSB(lsb_msb);
/* Writes orientation settings value in the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the configuration of low-g feature from the sensor
*/
int8_t bma456mm_get_low_g_config(struct bma456mm_low_g_config *low_g, struct bma4_dev *dev)
{
/* variable used to return the status of communication result*/
int8_t rslt = BMA4_OK;
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_LOW_G_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if ((dev != NULL) && (low_g != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Get threshold */
lsb = (uint16_t)feature_config[index++];
msb = ((uint16_t)feature_config[index++] << 8);
lsb_msb = lsb | msb;
/* Extract threshold value */
low_g->threshold = lsb_msb & BMA456MM_LOW_G_THRES_MSK;
/* Get hysteresis */
lsb = (uint16_t)feature_config[index++];
msb = ((uint16_t)feature_config[index++] << 8);
lsb_msb = lsb | msb;
/* Extract hysteresis value */
low_g->hysteresis = lsb_msb & BMA456MM_LOW_G_HYST_MSK;
/* Get duration */
lsb = (uint16_t)feature_config[index++];
msb = ((uint16_t)feature_config[index++] << 8);
lsb_msb = lsb | msb;
/* Extract duration value */
low_g->duration = lsb_msb & BMA456MM_LOW_G_DUR_MSK;
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets auto sleep configurations
*/
int8_t bma456mm_get_auto_low_power_config(struct bma456mm_auto_low_power *auto_low_power, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
int8_t rslt = BMA4_OK;
uint16_t msb_lsb;
if ((dev != NULL) && (auto_low_power != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
auto_low_power->no_motion = BMA4_GET_BITS_POS_0(feature_config[BMA456MM_AUTO_LOW_POWER_OFFSET],
BMA456MM_NO_MOT_AUTO_LOW_POWER);
auto_low_power->time_out = BMA4_GET_BITSLICE(feature_config[BMA456MM_AUTO_LOW_POWER_OFFSET],
BMA456MM_AUTO_LOW_POWER_TIME_OUT);
msb_lsb =
(uint16_t)(feature_config[BMA456MM_AUTO_LOW_POWER_OFFSET] |
(uint16_t)(feature_config[BMA456MM_AUTO_LOW_POWER_OFFSET + 1] << 8));
auto_low_power->time_out_dur = BMA4_GET_BITSLICE(msb_lsb, BMA456MM_TIME_OUT_DUR);
auto_low_power->lp_odr = BMA4_GET_BITSLICE(feature_config[BMA456MM_AUTO_LOW_POWER_OFFSET + 1],
BMA456MM_LOW_POW_ODR);
auto_low_power->pwr_mgt = BMA4_GET_BITSLICE(feature_config[BMA456MM_AUTO_LOW_POWER_OFFSET + 1],
BMA456MM_PWR_MGT_ENABLE);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets power mode management configuration.
*/
int8_t bma456mm_set_auto_low_power_config(const struct bma456mm_auto_low_power *auto_low_power, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_AUTO_LOW_POWER_OFFSET;
int8_t rslt = BMA4_OK;
uint16_t msb_lsb;
if ((dev != NULL) && (auto_low_power != NULL))
{
if (dev->chip_id == BMA456MM_CHIP_ID)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
msb_lsb = (uint16_t)((feature_config[index]) | (uint16_t)(feature_config[index + 1] << 8));
msb_lsb = BMA4_SET_BITS_POS_0(msb_lsb, BMA456MM_NO_MOT_AUTO_LOW_POWER_WORD, auto_low_power->no_motion);
msb_lsb = BMA4_SET_BITSLICE(msb_lsb, BMA456MM_AUTO_LOW_POWER_TIME_OUT_WORD, auto_low_power->time_out);
msb_lsb = BMA4_SET_BITSLICE(msb_lsb, BMA456MM_TIME_OUT_DUR_WORD, auto_low_power->time_out_dur);
msb_lsb = BMA4_SET_BITSLICE(msb_lsb, BMA456MM_LOW_POW_ODR_WORD, auto_low_power->lp_odr);
msb_lsb = BMA4_SET_BITSLICE(msb_lsb, BMA456MM_PWR_MGT_ENABLE_WORD, auto_low_power->pwr_mgt);
feature_config[index] = BMA4_GET_LSB(msb_lsb);
feature_config[index + 1] = BMA4_GET_MSB(msb_lsb);
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
}
}
else
{
rslt = BMA4_E_INVALID_SENSOR;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This api reads the auto low power state output status
*/
int8_t bma456mm_get_auto_low_power_state(uint8_t *auto_low_power_state, struct bma4_dev *dev)
{
int8_t rslt = BMA4_OK;
uint8_t data;
if ((dev != NULL) && (auto_low_power_state != NULL))
{
rslt = bma4_read_regs(BMA4_INTERNAL_STAT, &data, 1, dev);
*auto_low_power_state = BMA4_GET_BITSLICE(data, BMA456MM_AUTO_LOW_POWER_STATE);
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the configuration of high-g feature in the sensor.
* This API enables/disables the high-g feature according to the axis set.
*/
int8_t bma456mm_set_high_g_config(const struct bma456mm_high_g_config *high_g, struct bma4_dev *dev)
{
/* Variable to define error */
int8_t rslt;
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to configure high-g feature */
uint8_t index = BMA456MM_HIGH_G_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if (high_g != NULL)
{
/* Get high-g configuration from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Assign threshold value in feature config array */
lsb = feature_config[index];
msb = feature_config[index + 1] << 8;
lsb_msb = lsb | msb;
/* Set the threshold in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_HIGH_G_THRES, high_g->threshold);
/* Set threshold and motion selection value in feature configuration array */
feature_config[index++] = BMA4_GET_LSB(lsb_msb);
feature_config[index++] = BMA4_GET_MSB(lsb_msb);
lsb = (uint16_t)feature_config[index];
msb = ((uint16_t)feature_config[index + 1] << 8);
lsb_msb = lsb | msb;
/* Set the hysteresis in the same word */
lsb_msb = BMA4_SET_BITS_POS_0(lsb_msb, BMA456MM_HIGH_G_HYST, high_g->hysteresis);
/* Set the axes enable in the same word */
lsb_msb = BMA4_SET_BITSLICE(lsb_msb, BMA456MM_HIGH_G_AXIS_EN, high_g->axes_en);
/* Set hysteresis and and axes enable in the same word */
feature_config[index++] = BMA4_GET_LSB(lsb_msb);
feature_config[index++] = BMA4_GET_MSB(lsb_msb);
/* Assign duration value in feature config array */
feature_config[index] = BMA4_GET_LSB(high_g->duration);
feature_config[index + 1] = BMA4_GET_MSB(high_g->duration);
/* Set high-g configuration to the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API gets the configuration of high-g feature in the sensor.
* This API enables/disables the high-g feature according to the axis set.
*/
int8_t bma456mm_get_high_g_config(struct bma456mm_high_g_config *high_g, struct bma4_dev *dev)
{
/* Variable to define error */
int8_t rslt;
/* Initialize configuration file */
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
/* Update index to configure high_g */
uint8_t index = BMA456MM_HIGH_G_OFFSET;
/* Variable to define LSB */
uint16_t lsb = 0;
/* Variable to define MSB */
uint16_t msb = 0;
/* Variable to define LSB and MSB */
uint16_t lsb_msb = 0;
if (high_g != NULL)
{
/* Get high-g configuration from the sensor */
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Get word to calculate threshold selection
* select
*/
lsb = (uint16_t)feature_config[index++];
msb = ((uint16_t)feature_config[index++] << 8);
lsb_msb = lsb | msb;
/* Extract threshold value */
high_g->threshold = lsb_msb & BMA456MM_HIGH_G_THRES_MSK;
/* Get word to calculate hysteresis and axis selection selection
* select
*/
lsb = (uint16_t)feature_config[index++];
msb = ((uint16_t)feature_config[index++] << 8);
lsb_msb = lsb | msb;
/* Extract select the hysteresis and axis enable value */
high_g->hysteresis = lsb_msb & BMA456MM_HIGH_G_HYST_MSK;
/* Extract axes enable value */
high_g->axes_en = BMA4_GET_BITSLICE(lsb_msb, BMA456MM_HIGH_G_AXIS_EN);
/* Get word to calculate duration */
lsb = (uint16_t)feature_config[index++];
msb = ((uint16_t)feature_config[index++] << 8);
lsb_msb = lsb | msb;
/* Extract duration value */
high_g->duration = lsb_msb & BMA456MM_HIGH_G_DUR_MSK;
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*!
* @brief This API sets the configuration of significant motion
* in the sensor.
*/
int8_t bma456mm_set_sig_motion_config(const struct bma456mm_sig_motion_config *sig_motion, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint8_t index = BMA456MM_SIG_MOTION_OFFSET;
uint16_t skiptime_msb = 0;
uint16_t skiptime_lsb = 0;
uint16_t skiptime = 0;
int8_t rslt = BMA4_OK;
if (sig_motion != NULL)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* Assigns threshold value */
feature_config[index++] = BMA4_GET_LSB(sig_motion->threshold);
feature_config[index++] = BMA4_GET_MSB(sig_motion->threshold);
/* Gets skip time data bytes and sets only
* skip time bits
*/
skiptime_lsb = feature_config[index];
skiptime_msb = feature_config[index + 1] << 8;
skiptime = skiptime_lsb | skiptime_msb;
skiptime = BMA4_SET_BITS_POS_0(skiptime, BMA456MM_SIG_MOTION_SKIPTIME, sig_motion->skiptime);
/* Assigns skip time value */
feature_config[index++] = BMA4_GET_LSB(skiptime);
feature_config[index++] = BMA4_GET_MSB(skiptime);
/* Assigns proof time value */
feature_config[index] = sig_motion->prooftime & BMA456MM_SIG_MOTION_PROOFTIME_MSK;
/* Writes significant motion settings
* in the sensor
*/
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*! @brief This API gets the configuration of significant motion feature
* from the sensor.
*/
int8_t bma456mm_get_sig_motion_config(struct bma456mm_sig_motion_config *sig_motion, struct bma4_dev *dev)
{
uint8_t feature_config[BMA456MM_FEATURE_SIZE] = { 0 };
uint16_t *data_p = (uint16_t *)(void *)feature_config;
int8_t rslt = BMA4_OK;
if (sig_motion != NULL)
{
rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456MM_FEATURE_SIZE, dev);
if (rslt == BMA4_OK)
{
/* To convert 8bit to 16 bit address */
data_p = data_p + BMA456MM_SIG_MOTION_OFFSET / 2;
/* Extracts threshold value */
sig_motion->threshold = (*(data_p++)) & BMA456MM_SIG_MOTION_THRES_MSK;
/* Extracts skip time value */
sig_motion->skiptime = (*(data_p++)) & BMA456MM_SIG_MOTION_SKIPTIME_MSK;
/* Extracts proof time value */
sig_motion->prooftime = (uint8_t)((*data_p) & BMA456MM_SIG_MOTION_PROOFTIME_MSK);
}
}
else
{
rslt = BMA4_E_NULL_PTR;
}
return rslt;
}
/*! @cond DOXYGEN_SUPRESS */
/* Suppressing doxygen warnings triggered for same static function names present across various sensor variant
* directories */
/***************************************************************************/
/*! Static Function Definitions */
/***************************************************************************/
/*!
* @brief This API update the settings of tap.
*/
static void update_tap_parameter(const struct bma456mm_multitap_settings *setting,
uint8_t index,
uint8_t *feature_config)
{
uint8_t param_num;
uint8_t max_tap_param = 12;
const uint16_t *tap_param = &setting->reserved_1;
/* Number of tap detection parameter is 12 */
for (param_num = 1; param_num <= max_tap_param; param_num++)
{
feature_config[index++] = BMA4_GET_LSB(*tap_param);
feature_config[index++] = BMA4_GET_MSB(*tap_param);
tap_param++;
}
}
/*!
* @brief This API copy the settings of tap into the structure of
* bma456mm_multitap_settings, which is read from sensor.
*/
static void extract_tap_parameter(struct bma456mm_multitap_settings *setting, const uint16_t *data_p)
{
uint8_t param_num;
uint8_t max_tap_param = 12;
uint16_t *tap_param = &setting->reserved_1;
/* Number of tap detection parameter is 12 */
for (param_num = 1; param_num <= max_tap_param; param_num++)
{
*tap_param = *(data_p++);
tap_param++;
}
}
/*!
* @brief This API enables the features of the sensor.
*/
static int8_t feature_enable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
{
uint8_t index = 0;
int8_t rslt = BMA4_OK;
if ((dev != NULL) && (feature_config != NULL))
{
/* Enable Low-G */
if ((feature & BMA456MM_LOW_G) > 0)
{
index = BMA456MM_LOW_G_OFFSET + BMA456MM_LOW_G_FEAT_EN_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_LOW_G_EN_MSK;
}
/* Enable orientation */
if ((feature & BMA456MM_ORIENT) > 0)
{
index = BMA456MM_ORIENTATION_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_ORIENT_EN_MSK;
}
/* Enable single - tap */
if ((feature & BMA456MM_SINGLE_TAP) > 0)
{
index = BMA456MM_TAP_DETECTOR_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_SINGLE_TAP_EN_MSK;
}
/* Enable double - tap */
if ((feature & BMA456MM_DOUBLE_TAP) > 0)
{
index = BMA456MM_TAP_DETECTOR_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_DOUBLE_TAP_EN_MSK;
}
/* Enable triple - tap */
if ((feature & BMA456MM_TRIPLE_TAP) > 0)
{
index = BMA456MM_TAP_DETECTOR_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_TRIPLE_TAP_EN_MSK;
}
/* Enable auto-low-power */
if ((feature & BMA456MM_AUTO_LOW_POWER) > 0)
{
index = BMA456MM_AUTO_LOW_POWER_EN_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_AUTO_LOW_POWER_ALP_EN_MSK;
}
/* Enable high_g */
if ((feature & BMA456MM_HIGH_G) > 0)
{
index = BMA456MM_HIGH_G_EN_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_HIGH_G_EN_MSK;
}
/* Enable significant motion */
if (feature & BMA456MM_SIG_MOTION)
{
index = BMA456MM_SIG_MOTION_EN_OFFSET;
feature_config[index] = feature_config[index] | BMA456MM_SIG_MOTION_EN_MSK;
}
/* Write the feature enable settings in the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
}
return rslt;
}
/*!
* @brief This API disables the features of the sensor.
*/
static int8_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
{
uint8_t index = 0;
int8_t rslt = BMA4_OK;
if ((dev != NULL) && (feature_config != NULL))
{
/* Disable Low-G */
if ((feature & BMA456MM_LOW_G) > 0)
{
index = BMA456MM_LOW_G_OFFSET + BMA456MM_LOW_G_FEAT_EN_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_LOW_G_EN_MSK);
}
/* Disable orientation */
if ((feature & BMA456MM_ORIENT) > 0)
{
index = BMA456MM_ORIENTATION_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_ORIENT_EN_MSK);
}
/* Disable single-tap */
if ((feature & BMA456MM_SINGLE_TAP) > 0)
{
index = BMA456MM_TAP_DETECTOR_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_SINGLE_TAP_EN_MSK);
}
/* Disable double-tap */
if ((feature & BMA456MM_DOUBLE_TAP) > 0)
{
index = BMA456MM_TAP_DETECTOR_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_DOUBLE_TAP_EN_MSK);
}
/* Disable triple-tap */
if ((feature & BMA456MM_TRIPLE_TAP) > 0)
{
index = BMA456MM_TAP_DETECTOR_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_TRIPLE_TAP_EN_MSK);
}
/* Disable auto-low-power */
if ((feature & BMA456MM_AUTO_LOW_POWER) > 0)
{
index = BMA456MM_AUTO_LOW_POWER_EN_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_AUTO_LOW_POWER_ALP_EN_MSK);
}
/* Disable high_g */
if ((feature & BMA456MM_HIGH_G) > 0)
{
index = BMA456MM_HIGH_G_EN_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_HIGH_G_EN_MSK);
}
/* Disable significant motion */
if ((feature & BMA456MM_SIG_MOTION) > 0)
{
index = BMA456MM_SIG_MOTION_EN_OFFSET;
feature_config[index] = feature_config[index] & (~BMA456MM_SIG_MOTION_EN_MSK);
}
/* Write the configured settings in the sensor */
rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
}
return rslt;
}
/*! @endcond */