Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
NuMaker-mbed-NuBrick/NuBrickMasterAHRS.cpp@0:a67fc999dd68, 2017-09-29 (annotated)
- Committer:
- shliu1
- Date:
- Fri Sep 29 05:44:02 2017 +0000
- Revision:
- 0:a67fc999dd68
main.cpp adds the setting of TARGET_NUMAKER_PFM_M487 for M487
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shliu1 | 0:a67fc999dd68 | 1 | /* mbed Microcontroller Library |
shliu1 | 0:a67fc999dd68 | 2 | * Copyright (c) 2016 ARM Limited |
shliu1 | 0:a67fc999dd68 | 3 | * |
shliu1 | 0:a67fc999dd68 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
shliu1 | 0:a67fc999dd68 | 5 | * you may not use this file except in compliance with the License. |
shliu1 | 0:a67fc999dd68 | 6 | * You may obtain a copy of the License at |
shliu1 | 0:a67fc999dd68 | 7 | * |
shliu1 | 0:a67fc999dd68 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
shliu1 | 0:a67fc999dd68 | 9 | * |
shliu1 | 0:a67fc999dd68 | 10 | * Unless required by applicable law or agreed to in writing, software |
shliu1 | 0:a67fc999dd68 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
shliu1 | 0:a67fc999dd68 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
shliu1 | 0:a67fc999dd68 | 13 | * See the License for the specific language governing permissions and |
shliu1 | 0:a67fc999dd68 | 14 | * limitations under the License. |
shliu1 | 0:a67fc999dd68 | 15 | */ |
shliu1 | 0:a67fc999dd68 | 16 | #include "NuBrickMasterAHRS.h" |
shliu1 | 0:a67fc999dd68 | 17 | |
shliu1 | 0:a67fc999dd68 | 18 | NuBrickMasterAHRS::NuBrickMasterAHRS(I2C &i2c, bool debug) : |
shliu1 | 0:a67fc999dd68 | 19 | NuBrickMaster(i2c, NuBrick_I2CAddr_AHRS, debug) { |
shliu1 | 0:a67fc999dd68 | 20 | |
shliu1 | 0:a67fc999dd68 | 21 | static const NuBrickField::IndexName ahrs_feature_field_index_name_arr[] = { |
shliu1 | 0:a67fc999dd68 | 22 | NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex1_Plus1, "sleep_period"), |
shliu1 | 0:a67fc999dd68 | 23 | NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex2_Plus1, "pre_vibration_AT") |
shliu1 | 0:a67fc999dd68 | 24 | }; |
shliu1 | 0:a67fc999dd68 | 25 | |
shliu1 | 0:a67fc999dd68 | 26 | static const NuBrickField::IndexName ahrs_input_field_index_name_arr[] = { |
shliu1 | 0:a67fc999dd68 | 27 | NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex1_Plus1, "vibration"), |
shliu1 | 0:a67fc999dd68 | 28 | NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex2_Plus1, "over_flag") |
shliu1 | 0:a67fc999dd68 | 29 | }; |
shliu1 | 0:a67fc999dd68 | 30 | |
shliu1 | 0:a67fc999dd68 | 31 | // Add fields of feature report |
shliu1 | 0:a67fc999dd68 | 32 | add_feature_fields(ahrs_feature_field_index_name_arr, |
shliu1 | 0:a67fc999dd68 | 33 | sizeof (ahrs_feature_field_index_name_arr) / sizeof (ahrs_feature_field_index_name_arr[0])); |
shliu1 | 0:a67fc999dd68 | 34 | |
shliu1 | 0:a67fc999dd68 | 35 | // Add fields of input report |
shliu1 | 0:a67fc999dd68 | 36 | add_input_fields(ahrs_input_field_index_name_arr, |
shliu1 | 0:a67fc999dd68 | 37 | sizeof (ahrs_input_field_index_name_arr) / sizeof (ahrs_input_field_index_name_arr[0])); |
shliu1 | 0:a67fc999dd68 | 38 | |
shliu1 | 0:a67fc999dd68 | 39 | // Add fields of output report |
shliu1 | 0:a67fc999dd68 | 40 | |
shliu1 | 0:a67fc999dd68 | 41 | // No lock needed in the constructor |
shliu1 | 0:a67fc999dd68 | 42 | |
shliu1 | 0:a67fc999dd68 | 43 | } |