Maxim Integrated / Mbed OS MAX11410BOB_Serial_Tester

Dependencies:   MaximTinyTester MAX11410 CmdLine USBDevice

Committer:
whismanoid
Date:
Mon Apr 06 11:19:35 2020 +0000
Revision:
61:38ec81c33b7a
Parent:
60:f38c54a91794
Child:
63:708490d6a29f
futility_countdown_limit readAllStatusList readAllStatusListLen cleanup SelfTest

Who changed what in which revision?

UserRevisionLine numberNew contents of line
whismanoid 52:d3fb6f1722bf 1 // /*******************************************************************************
whismanoid 52:d3fb6f1722bf 2 // * Copyright (C) 2020 Maxim Integrated Products, Inc., All Rights Reserved.
whismanoid 52:d3fb6f1722bf 3 // *
whismanoid 52:d3fb6f1722bf 4 // * Permission is hereby granted, free of charge, to any person obtaining a
whismanoid 52:d3fb6f1722bf 5 // * copy of this software and associated documentation files (the "Software"),
whismanoid 52:d3fb6f1722bf 6 // * to deal in the Software without restriction, including without limitation
whismanoid 52:d3fb6f1722bf 7 // * the rights to use, copy, modify, merge, publish, distribute, sublicense,
whismanoid 52:d3fb6f1722bf 8 // * and/or sell copies of the Software, and to permit persons to whom the
whismanoid 52:d3fb6f1722bf 9 // * Software is furnished to do so, subject to the following conditions:
whismanoid 52:d3fb6f1722bf 10 // *
whismanoid 52:d3fb6f1722bf 11 // * The above copyright notice and this permission notice shall be included
whismanoid 52:d3fb6f1722bf 12 // * in all copies or substantial portions of the Software.
whismanoid 52:d3fb6f1722bf 13 // *
whismanoid 52:d3fb6f1722bf 14 // * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
whismanoid 52:d3fb6f1722bf 15 // * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
whismanoid 52:d3fb6f1722bf 16 // * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
whismanoid 52:d3fb6f1722bf 17 // * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
whismanoid 52:d3fb6f1722bf 18 // * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
whismanoid 52:d3fb6f1722bf 19 // * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
whismanoid 52:d3fb6f1722bf 20 // * OTHER DEALINGS IN THE SOFTWARE.
whismanoid 52:d3fb6f1722bf 21 // *
whismanoid 52:d3fb6f1722bf 22 // * Except as contained in this notice, the name of Maxim Integrated
whismanoid 52:d3fb6f1722bf 23 // * Products, Inc. shall not be used except as stated in the Maxim Integrated
whismanoid 52:d3fb6f1722bf 24 // * Products, Inc. Branding Policy.
whismanoid 52:d3fb6f1722bf 25 // *
whismanoid 52:d3fb6f1722bf 26 // * The mere transfer of this software does not imply any licenses
whismanoid 52:d3fb6f1722bf 27 // * of trade secrets, proprietary technology, copyrights, patents,
whismanoid 52:d3fb6f1722bf 28 // * trademarks, maskwork rights, or any other form of intellectual
whismanoid 52:d3fb6f1722bf 29 // * property whatsoever. Maxim Integrated Products, Inc. retains all
whismanoid 52:d3fb6f1722bf 30 // * ownership rights.
whismanoid 52:d3fb6f1722bf 31 // *******************************************************************************
whismanoid 52:d3fb6f1722bf 32 // */
whismanoid 52:d3fb6f1722bf 33 //---------- CODE GENERATOR: testMainCppCodeList
whismanoid 52:d3fb6f1722bf 34 // CODE GENERATOR: example code includes
whismanoid 52:d3fb6f1722bf 35
whismanoid 52:d3fb6f1722bf 36 // example code includes
whismanoid 52:d3fb6f1722bf 37 // standard include for target platform -- Platform_Include_Boilerplate
whismanoid 52:d3fb6f1722bf 38 #include "mbed.h"
whismanoid 52:d3fb6f1722bf 39 // Platforms:
whismanoid 52:d3fb6f1722bf 40 // - MAX32625MBED
whismanoid 52:d3fb6f1722bf 41 // - supports mbed-os-5.11, requires USBDevice library
whismanoid 52:d3fb6f1722bf 42 // - add https://developer.mbed.org/teams/MaximIntegrated/code/USBDevice/
whismanoid 52:d3fb6f1722bf 43 // - remove max32630fthr library (if present)
whismanoid 52:d3fb6f1722bf 44 // - remove MAX32620FTHR library (if present)
whismanoid 52:d3fb6f1722bf 45 // - MAX32600MBED
whismanoid 52:d3fb6f1722bf 46 // - remove max32630fthr library (if present)
whismanoid 52:d3fb6f1722bf 47 // - remove MAX32620FTHR library (if present)
whismanoid 52:d3fb6f1722bf 48 // - Windows 10 note: Don't connect HDK until you are ready to load new firmware into the board.
whismanoid 52:d3fb6f1722bf 49 // - NUCLEO_F446RE
whismanoid 52:d3fb6f1722bf 50 // - remove USBDevice library
whismanoid 52:d3fb6f1722bf 51 // - remove max32630fthr library (if present)
whismanoid 52:d3fb6f1722bf 52 // - remove MAX32620FTHR library (if present)
whismanoid 52:d3fb6f1722bf 53 // - NUCLEO_F401RE
whismanoid 52:d3fb6f1722bf 54 // - remove USBDevice library
whismanoid 52:d3fb6f1722bf 55 // - remove max32630fthr library (if present)
whismanoid 52:d3fb6f1722bf 56 // - remove MAX32620FTHR library (if present)
whismanoid 52:d3fb6f1722bf 57 // - MAX32630FTHR
whismanoid 52:d3fb6f1722bf 58 // - #include "max32630fthr.h"
whismanoid 52:d3fb6f1722bf 59 // - add http://os.mbed.org/teams/MaximIntegrated/code/max32630fthr/
whismanoid 52:d3fb6f1722bf 60 // - remove MAX32620FTHR library (if present)
whismanoid 52:d3fb6f1722bf 61 // - MAX32620FTHR
whismanoid 52:d3fb6f1722bf 62 // - #include "MAX32620FTHR.h"
whismanoid 52:d3fb6f1722bf 63 // - remove max32630fthr library (if present)
whismanoid 52:d3fb6f1722bf 64 // - add https://os.mbed.com/teams/MaximIntegrated/code/MAX32620FTHR/
whismanoid 52:d3fb6f1722bf 65 // - not tested yet
whismanoid 52:d3fb6f1722bf 66 // - MAX32625PICO
whismanoid 52:d3fb6f1722bf 67 // - remove max32630fthr library (if present)
whismanoid 52:d3fb6f1722bf 68 // - remove MAX32620FTHR library (if present)
whismanoid 52:d3fb6f1722bf 69 // - not tested yet
whismanoid 52:d3fb6f1722bf 70 //
whismanoid 52:d3fb6f1722bf 71 // end Platform_Include_Boilerplate
whismanoid 52:d3fb6f1722bf 72 #include "MAX11410.h"
whismanoid 52:d3fb6f1722bf 73 #include "CmdLine.h"
whismanoid 52:d3fb6f1722bf 74 #include "MaximTinyTester.h"
whismanoid 52:d3fb6f1722bf 75
whismanoid 52:d3fb6f1722bf 76 // optional: serial port
whismanoid 52:d3fb6f1722bf 77 // note: some platforms such as Nucleo-F446RE do not support the USBSerial library.
whismanoid 52:d3fb6f1722bf 78 // In those cases, remove the USBDevice lib from the project and rebuild.
whismanoid 52:d3fb6f1722bf 79 #if defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 80 #include "USBSerial.h"
whismanoid 52:d3fb6f1722bf 81 USBSerial serial; // virtual serial port over USB (DEV connector)
whismanoid 58:78b67549e069 82 #elif defined(TARGET_MAX32600MBED)
whismanoid 58:78b67549e069 83 #include "USBSerial.h"
whismanoid 58:78b67549e069 84 USBSerial serial; // virtual serial port over USB (DEV connector)
whismanoid 52:d3fb6f1722bf 85 #elif defined(TARGET_MAX32630MBED)
whismanoid 52:d3fb6f1722bf 86 #include "USBSerial.h"
whismanoid 52:d3fb6f1722bf 87 USBSerial serial; // virtual serial port over USB (DEV connector)
whismanoid 52:d3fb6f1722bf 88 #else
whismanoid 52:d3fb6f1722bf 89 //#include "USBSerial.h"
whismanoid 52:d3fb6f1722bf 90 Serial serial(USBTX, USBRX); // tx, rx
whismanoid 52:d3fb6f1722bf 91 #endif
whismanoid 52:d3fb6f1722bf 92
whismanoid 52:d3fb6f1722bf 93 void on_immediate_0x21(); // Unicode (U+0021) ! EXCLAMATION MARK
whismanoid 52:d3fb6f1722bf 94 void on_immediate_0x7b(); // Unicode (U+007B) { LEFT CURLY BRACKET
whismanoid 52:d3fb6f1722bf 95 void on_immediate_0x7d(); // Unicode (U+007D) } RIGHT CURLY BRACKET
whismanoid 52:d3fb6f1722bf 96
whismanoid 52:d3fb6f1722bf 97 #include "CmdLine.h"
whismanoid 52:d3fb6f1722bf 98
whismanoid 52:d3fb6f1722bf 99 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 100 CmdLine cmdLine_DAPLINKserial(DAPLINKserial, "DAPLINK");
whismanoid 52:d3fb6f1722bf 101 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 102 CmdLine cmdLine_serial(serial, "serial");
whismanoid 52:d3fb6f1722bf 103
whismanoid 52:d3fb6f1722bf 104
whismanoid 52:d3fb6f1722bf 105 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 106
whismanoid 52:d3fb6f1722bf 107
whismanoid 52:d3fb6f1722bf 108 #if defined(TARGET)
whismanoid 52:d3fb6f1722bf 109 // TARGET_NAME macros from targets/TARGET_Maxim/TARGET_MAX32625/device/mxc_device.h
whismanoid 52:d3fb6f1722bf 110 // Create a string definition for the TARGET
whismanoid 52:d3fb6f1722bf 111 #define STRING_ARG(arg) #arg
whismanoid 52:d3fb6f1722bf 112 #define STRING_NAME(name) STRING_ARG(name)
whismanoid 52:d3fb6f1722bf 113 #define TARGET_NAME STRING_NAME(TARGET)
whismanoid 52:d3fb6f1722bf 114 #elif defined(TARGET_MAX32600)
whismanoid 52:d3fb6f1722bf 115 #define TARGET_NAME "MAX32600"
whismanoid 52:d3fb6f1722bf 116 #elif defined(TARGET_LPC1768)
whismanoid 52:d3fb6f1722bf 117 #define TARGET_NAME "LPC1768"
whismanoid 52:d3fb6f1722bf 118 #elif defined(TARGET_NUCLEO_F446RE)
whismanoid 52:d3fb6f1722bf 119 #define TARGET_NAME "NUCLEO_F446RE"
whismanoid 52:d3fb6f1722bf 120 #elif defined(TARGET_NUCLEO_F401RE)
whismanoid 52:d3fb6f1722bf 121 #define TARGET_NAME "NUCLEO_F401RE"
whismanoid 52:d3fb6f1722bf 122 #else
whismanoid 52:d3fb6f1722bf 123 #error TARGET NOT DEFINED
whismanoid 52:d3fb6f1722bf 124 #endif
whismanoid 52:d3fb6f1722bf 125 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 126 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 127 // TARGET=MAX32630FTHR ARM Cortex-M4F 96MHz 2048kB Flash 512kB SRAM
whismanoid 52:d3fb6f1722bf 128 // +-------------[microUSB]-------------+
whismanoid 52:d3fb6f1722bf 129 // | J1 MAX32630FTHR J2 |
whismanoid 52:d3fb6f1722bf 130 // ______ | [ ] RST GND [ ] |
whismanoid 52:d3fb6f1722bf 131 // ______ | [ ] 3V3 BAT+[ ] |
whismanoid 52:d3fb6f1722bf 132 // ______ | [ ] 1V8 reset SW1 |
whismanoid 52:d3fb6f1722bf 133 // ______ | [ ] GND J4 J3 |
whismanoid 52:d3fb6f1722bf 134 // analogIn0/4 | [a] AIN_0 1.2Vfs (bat) SYS [ ] | switched BAT+
whismanoid 52:d3fb6f1722bf 135 // analogIn1/5 | [a] AIN_1 1.2Vfs PWR [ ] | external pwr btn
whismanoid 52:d3fb6f1722bf 136 // analogIn2 | [a] AIN_2 1.2Vfs +5V VBUS [ ] | USB +5V power
whismanoid 52:d3fb6f1722bf 137 // analogIn3 | [a] AIN_3 1.2Vfs 1-WIRE P4_0 [d] | D0 dig9
whismanoid 52:d3fb6f1722bf 138 // (I2C2.SDA) | [d] P5_7 SDA2 SRN P5_6 [d] | D1 dig8
whismanoid 52:d3fb6f1722bf 139 // (I2C2.SCL) | [d] P6_0 SCL2 SDIO3 P5_5 [d] | D2 dig7
whismanoid 52:d3fb6f1722bf 140 // D13/SCLK | [s] P5_0 SCLK SDIO2 P5_4 [d] | D3 dig6
whismanoid 52:d3fb6f1722bf 141 // D11/MOSI | [s] P5_1 MOSI SSEL P5_3 [d] | D4 dig5
whismanoid 52:d3fb6f1722bf 142 // D12/MISO | [s] P5_2 MISO RTS P3_3 [d] | D5 dig4
whismanoid 52:d3fb6f1722bf 143 // D10/CS | [s] P3_0 RX CTS P3_2 [d] | D6 dig3
whismanoid 52:d3fb6f1722bf 144 // D9 dig0 | [d] P3_1 TX SCL P3_5 [d] | D7 dig2
whismanoid 52:d3fb6f1722bf 145 // ______ | [ ] GND SDA P3_4 [d] | D8 dig1
whismanoid 52:d3fb6f1722bf 146 // | |
whismanoid 52:d3fb6f1722bf 147 // | XIP Flash MAX14690N |
whismanoid 52:d3fb6f1722bf 148 // | XIP_SCLK P1_0 SDA2 P5_7 |
whismanoid 52:d3fb6f1722bf 149 // | XIP_MOSI P1_1 SCL2 P6_0 |
whismanoid 52:d3fb6f1722bf 150 // | XIP_MISO P1_2 PMIC_INIT P3_7 |
whismanoid 52:d3fb6f1722bf 151 // | XIP_SSEL P1_3 MPC P2_7 |
whismanoid 52:d3fb6f1722bf 152 // | XIP_DIO2 P1_4 MON AIN_0 |
whismanoid 52:d3fb6f1722bf 153 // | XIP_DIO3 P1_5 |
whismanoid 52:d3fb6f1722bf 154 // | |
whismanoid 52:d3fb6f1722bf 155 // | PAN1326B MicroSD LED |
whismanoid 52:d3fb6f1722bf 156 // | BT_RX P0_0 SD_SCLK P0_4 r P2_4 |
whismanoid 52:d3fb6f1722bf 157 // | BT_TX P0_1 SD_MOSI P0_5 g P2_5 |
whismanoid 52:d3fb6f1722bf 158 // | BT_CTS P0_2 SD_MISO P0_6 b P2_6 |
whismanoid 52:d3fb6f1722bf 159 // | BT_RTS P0_3 SD_SSEL P0_7 |
whismanoid 52:d3fb6f1722bf 160 // | BT_RST P1_6 DETECT P2_2 |
whismanoid 52:d3fb6f1722bf 161 // | BT_CLK P1_7 SW2 P2_3 |
whismanoid 52:d3fb6f1722bf 162 // +------------------------------------+
whismanoid 52:d3fb6f1722bf 163 // MAX32630FTHR board has MAX14690 PMIC on I2C bus (P5_7 SDA, P6_0 SCL) at slave address 0101_000r 0x50 (or 0x28 for 7 MSbit address).
whismanoid 52:d3fb6f1722bf 164 // MAX32630FTHR board has BMI160 accelerometer on I2C bus (P5_7 SDA, P6_0 SCL) at slave address 1101_000r 0xD0 (or 0x68 for 7 MSbit address).
whismanoid 52:d3fb6f1722bf 165 // AIN_0 = AIN0 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 166 // AIN_1 = AIN1 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 167 // AIN_2 = AIN2 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 168 // AIN_3 = AIN3 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 169 // AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 170 // AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 171 // AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 172 // AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 173 // AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 174 // AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 175 // AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 176 // AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 177 // AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 178 //
whismanoid 52:d3fb6f1722bf 179 #include "max32630fthr.h"
whismanoid 52:d3fb6f1722bf 180 MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
whismanoid 52:d3fb6f1722bf 181 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 1
whismanoid 52:d3fb6f1722bf 182 // MAX32630FTHR board supports only internal VREF = 1.200V at bypass capacitor C15
whismanoid 52:d3fb6f1722bf 183 const float ADC_FULL_SCALE_VOLTAGE = 1.200;
whismanoid 52:d3fb6f1722bf 184 // Arduino connector
whismanoid 52:d3fb6f1722bf 185 #ifndef A0
whismanoid 52:d3fb6f1722bf 186 #define A0 AIN_0
whismanoid 52:d3fb6f1722bf 187 #endif
whismanoid 52:d3fb6f1722bf 188 #ifndef A1
whismanoid 52:d3fb6f1722bf 189 #define A1 AIN_1
whismanoid 52:d3fb6f1722bf 190 #endif
whismanoid 52:d3fb6f1722bf 191 #ifndef A2
whismanoid 52:d3fb6f1722bf 192 #define A2 AIN_2
whismanoid 52:d3fb6f1722bf 193 #endif
whismanoid 52:d3fb6f1722bf 194 #ifndef A3
whismanoid 52:d3fb6f1722bf 195 #define A3 AIN_3
whismanoid 52:d3fb6f1722bf 196 #endif
whismanoid 52:d3fb6f1722bf 197 #ifndef D0
whismanoid 52:d3fb6f1722bf 198 #define D0 P4_0
whismanoid 52:d3fb6f1722bf 199 #endif
whismanoid 52:d3fb6f1722bf 200 #ifndef D1
whismanoid 52:d3fb6f1722bf 201 #define D1 P5_6
whismanoid 52:d3fb6f1722bf 202 #endif
whismanoid 52:d3fb6f1722bf 203 #ifndef D2
whismanoid 52:d3fb6f1722bf 204 #define D2 P5_5
whismanoid 52:d3fb6f1722bf 205 #endif
whismanoid 52:d3fb6f1722bf 206 #ifndef D3
whismanoid 52:d3fb6f1722bf 207 #define D3 P5_4
whismanoid 52:d3fb6f1722bf 208 #endif
whismanoid 52:d3fb6f1722bf 209 #ifndef D4
whismanoid 52:d3fb6f1722bf 210 #define D4 P5_3
whismanoid 52:d3fb6f1722bf 211 #endif
whismanoid 52:d3fb6f1722bf 212 #ifndef D5
whismanoid 52:d3fb6f1722bf 213 #define D5 P3_3
whismanoid 52:d3fb6f1722bf 214 #endif
whismanoid 52:d3fb6f1722bf 215 #ifndef D6
whismanoid 52:d3fb6f1722bf 216 #define D6 P3_2
whismanoid 52:d3fb6f1722bf 217 #endif
whismanoid 52:d3fb6f1722bf 218 #ifndef D7
whismanoid 52:d3fb6f1722bf 219 #define D7 P3_5
whismanoid 52:d3fb6f1722bf 220 #endif
whismanoid 52:d3fb6f1722bf 221 #ifndef D8
whismanoid 52:d3fb6f1722bf 222 #define D8 P3_4
whismanoid 52:d3fb6f1722bf 223 #endif
whismanoid 52:d3fb6f1722bf 224 #ifndef D9
whismanoid 52:d3fb6f1722bf 225 #define D9 P3_1
whismanoid 52:d3fb6f1722bf 226 #endif
whismanoid 52:d3fb6f1722bf 227 #ifndef D10
whismanoid 52:d3fb6f1722bf 228 #define D10 P3_0
whismanoid 52:d3fb6f1722bf 229 #endif
whismanoid 52:d3fb6f1722bf 230 #ifndef D11
whismanoid 52:d3fb6f1722bf 231 #define D11 P5_1
whismanoid 52:d3fb6f1722bf 232 #endif
whismanoid 52:d3fb6f1722bf 233 #ifndef D12
whismanoid 52:d3fb6f1722bf 234 #define D12 P5_2
whismanoid 52:d3fb6f1722bf 235 #endif
whismanoid 52:d3fb6f1722bf 236 #ifndef D13
whismanoid 52:d3fb6f1722bf 237 #define D13 P5_0
whismanoid 52:d3fb6f1722bf 238 #endif
whismanoid 52:d3fb6f1722bf 239 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 240 #elif defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 241 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 242 // TARGET=MAX32625MBED ARM Cortex-M4F 96MHz 512kB Flash 160kB SRAM
whismanoid 52:d3fb6f1722bf 243 // +-------------------------------------+
whismanoid 52:d3fb6f1722bf 244 // | MAX32625MBED Arduino UNO header |
whismanoid 52:d3fb6f1722bf 245 // | |
whismanoid 52:d3fb6f1722bf 246 // | A5/SCL[ ] | P1_7 dig15
whismanoid 52:d3fb6f1722bf 247 // | A4/SDA[ ] | P1_6 dig14
whismanoid 52:d3fb6f1722bf 248 // | AREF=N/C[ ] |
whismanoid 52:d3fb6f1722bf 249 // | GND[ ] |
whismanoid 52:d3fb6f1722bf 250 // | [ ]N/C SCK/13[ ] | P1_0 dig13
whismanoid 52:d3fb6f1722bf 251 // | [ ]IOREF=3V3 MISO/12[ ] | P1_2 dig12
whismanoid 52:d3fb6f1722bf 252 // | [ ]RST MOSI/11[ ]~| P1_1 dig11
whismanoid 52:d3fb6f1722bf 253 // | [ ]3V3 CS/10[ ]~| P1_3 dig10
whismanoid 52:d3fb6f1722bf 254 // | [ ]5V0 9[ ]~| P1_5 dig9
whismanoid 52:d3fb6f1722bf 255 // | [ ]GND 8[ ] | P1_4 dig8
whismanoid 52:d3fb6f1722bf 256 // | [ ]GND |
whismanoid 52:d3fb6f1722bf 257 // | [ ]Vin 7[ ] | P0_7 dig7
whismanoid 52:d3fb6f1722bf 258 // | 6[ ]~| P0_6 dig6
whismanoid 52:d3fb6f1722bf 259 // AIN_0 | [ ]A0 5[ ]~| P0_5 dig5
whismanoid 52:d3fb6f1722bf 260 // AIN_1 | [ ]A1 4[ ] | P0_4 dig4
whismanoid 52:d3fb6f1722bf 261 // AIN_2 | [ ]A2 INT1/3[ ]~| P0_3 dig3
whismanoid 52:d3fb6f1722bf 262 // AIN_3 | [ ]A3 INT0/2[ ] | P0_2 dig2
whismanoid 52:d3fb6f1722bf 263 // dig16 P3_4 | [ ]A4/SDA RST SCK MISO TX>1[ ] | P0_1 dig1
whismanoid 52:d3fb6f1722bf 264 // dig17 P3_5 | [ ]A5/SCL [ ] [ ] [ ] RX<0[ ] | P0_0 dig0
whismanoid 52:d3fb6f1722bf 265 // | [ ] [ ] [ ] |
whismanoid 52:d3fb6f1722bf 266 // | UNO_R3 GND MOSI 5V ____________/
whismanoid 52:d3fb6f1722bf 267 // \_______________________/
whismanoid 52:d3fb6f1722bf 268 //
whismanoid 52:d3fb6f1722bf 269 // +------------------------+
whismanoid 52:d3fb6f1722bf 270 // | |
whismanoid 52:d3fb6f1722bf 271 // | MicroSD LED |
whismanoid 52:d3fb6f1722bf 272 // | SD_SCLK P2_4 r P3_0 |
whismanoid 52:d3fb6f1722bf 273 // | SD_MOSI P2_5 g P3_1 |
whismanoid 52:d3fb6f1722bf 274 // | SD_MISO P2_6 b P3_2 |
whismanoid 52:d3fb6f1722bf 275 // | SD_SSEL P2_7 y P3_3 |
whismanoid 52:d3fb6f1722bf 276 // | |
whismanoid 52:d3fb6f1722bf 277 // | DAPLINK BUTTONS |
whismanoid 52:d3fb6f1722bf 278 // | TX P2_1 SW3 P2_3 |
whismanoid 52:d3fb6f1722bf 279 // | RX P2_0 SW2 P2_2 |
whismanoid 52:d3fb6f1722bf 280 // +------------------------+
whismanoid 52:d3fb6f1722bf 281 //
whismanoid 52:d3fb6f1722bf 282 // AIN_0 = AIN0 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 283 // AIN_1 = AIN1 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 284 // AIN_2 = AIN2 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 285 // AIN_3 = AIN3 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 286 // AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 287 // AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 288 // AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 289 // AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 290 // AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 291 // AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 292 // AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 293 // AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 294 // AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 295 //
whismanoid 52:d3fb6f1722bf 296 //#include "max32625mbed.h" // ?
whismanoid 52:d3fb6f1722bf 297 //MAX32625MBED mbed(MAX32625MBED::VIO_3V3); // ?
whismanoid 52:d3fb6f1722bf 298 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 1
whismanoid 52:d3fb6f1722bf 299 // MAX32630FTHR board supports only internal VREF = 1.200V at bypass capacitor C15
whismanoid 52:d3fb6f1722bf 300 const float ADC_FULL_SCALE_VOLTAGE = 1.200; // TODO: ADC_FULL_SCALE_VOLTAGE Pico?
whismanoid 52:d3fb6f1722bf 301 // Arduino connector
whismanoid 52:d3fb6f1722bf 302 #ifndef A0
whismanoid 52:d3fb6f1722bf 303 #define A0 AIN_0
whismanoid 52:d3fb6f1722bf 304 #endif
whismanoid 52:d3fb6f1722bf 305 #ifndef A1
whismanoid 52:d3fb6f1722bf 306 #define A1 AIN_1
whismanoid 52:d3fb6f1722bf 307 #endif
whismanoid 52:d3fb6f1722bf 308 #ifndef A2
whismanoid 52:d3fb6f1722bf 309 #define A2 AIN_2
whismanoid 52:d3fb6f1722bf 310 #endif
whismanoid 52:d3fb6f1722bf 311 #ifndef A3
whismanoid 52:d3fb6f1722bf 312 #define A3 AIN_3
whismanoid 52:d3fb6f1722bf 313 #endif
whismanoid 52:d3fb6f1722bf 314 #ifndef D0
whismanoid 52:d3fb6f1722bf 315 #define D0 P0_0
whismanoid 52:d3fb6f1722bf 316 #endif
whismanoid 52:d3fb6f1722bf 317 #ifndef D1
whismanoid 52:d3fb6f1722bf 318 #define D1 P0_1
whismanoid 52:d3fb6f1722bf 319 #endif
whismanoid 52:d3fb6f1722bf 320 #ifndef D2
whismanoid 52:d3fb6f1722bf 321 #define D2 P0_2
whismanoid 52:d3fb6f1722bf 322 #endif
whismanoid 52:d3fb6f1722bf 323 #ifndef D3
whismanoid 52:d3fb6f1722bf 324 #define D3 P0_3
whismanoid 52:d3fb6f1722bf 325 #endif
whismanoid 52:d3fb6f1722bf 326 #ifndef D4
whismanoid 52:d3fb6f1722bf 327 #define D4 P0_4
whismanoid 52:d3fb6f1722bf 328 #endif
whismanoid 52:d3fb6f1722bf 329 #ifndef D5
whismanoid 52:d3fb6f1722bf 330 #define D5 P0_5
whismanoid 52:d3fb6f1722bf 331 #endif
whismanoid 52:d3fb6f1722bf 332 #ifndef D6
whismanoid 52:d3fb6f1722bf 333 #define D6 P0_6
whismanoid 52:d3fb6f1722bf 334 #endif
whismanoid 52:d3fb6f1722bf 335 #ifndef D7
whismanoid 52:d3fb6f1722bf 336 #define D7 P0_7
whismanoid 52:d3fb6f1722bf 337 #endif
whismanoid 52:d3fb6f1722bf 338 #ifndef D8
whismanoid 52:d3fb6f1722bf 339 #define D8 P1_4
whismanoid 52:d3fb6f1722bf 340 #endif
whismanoid 52:d3fb6f1722bf 341 #ifndef D9
whismanoid 52:d3fb6f1722bf 342 #define D9 P1_5
whismanoid 52:d3fb6f1722bf 343 #endif
whismanoid 52:d3fb6f1722bf 344 #ifndef D10
whismanoid 52:d3fb6f1722bf 345 #define D10 P1_3
whismanoid 52:d3fb6f1722bf 346 #endif
whismanoid 52:d3fb6f1722bf 347 #ifndef D11
whismanoid 52:d3fb6f1722bf 348 #define D11 P1_1
whismanoid 52:d3fb6f1722bf 349 #endif
whismanoid 52:d3fb6f1722bf 350 #ifndef D12
whismanoid 52:d3fb6f1722bf 351 #define D12 P1_2
whismanoid 52:d3fb6f1722bf 352 #endif
whismanoid 52:d3fb6f1722bf 353 #ifndef D13
whismanoid 52:d3fb6f1722bf 354 #define D13 P1_0
whismanoid 52:d3fb6f1722bf 355 #endif
whismanoid 52:d3fb6f1722bf 356 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 357 #elif defined(TARGET_MAX32600)
whismanoid 52:d3fb6f1722bf 358 // target MAX32600
whismanoid 52:d3fb6f1722bf 359 //
whismanoid 52:d3fb6f1722bf 360 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 0
whismanoid 52:d3fb6f1722bf 361 const float ADC_FULL_SCALE_VOLTAGE = 1.500;
whismanoid 52:d3fb6f1722bf 362 //
whismanoid 52:d3fb6f1722bf 363 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 364 #elif defined(TARGET_MAX32620FTHR)
whismanoid 52:d3fb6f1722bf 365 #warning "TARGET_MAX32620FTHR not previously tested; need to define pins..."
whismanoid 52:d3fb6f1722bf 366 #include "MAX32620FTHR.h"
whismanoid 52:d3fb6f1722bf 367 // Initialize I/O voltages on MAX32620FTHR board
whismanoid 52:d3fb6f1722bf 368 MAX32620FTHR fthr(MAX32620FTHR::VIO_3V3);
whismanoid 52:d3fb6f1722bf 369 //#define USE_LEDS 0 ?
whismanoid 52:d3fb6f1722bf 370 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 1
whismanoid 52:d3fb6f1722bf 371 #warning "TARGET_MAX32620FTHR not previously tested; need to verify ADC_FULL_SCALE_VOLTAGE..."
whismanoid 52:d3fb6f1722bf 372 const float ADC_FULL_SCALE_VOLTAGE = 1.200;
whismanoid 52:d3fb6f1722bf 373 //
whismanoid 52:d3fb6f1722bf 374 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 375 #elif defined(TARGET_MAX32625PICO)
whismanoid 52:d3fb6f1722bf 376 #warning "TARGET_MAX32625PICO not previously tested; need to define pins..."
whismanoid 52:d3fb6f1722bf 377 //#define USE_LEDS 0 ?
whismanoid 52:d3fb6f1722bf 378 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 1
whismanoid 52:d3fb6f1722bf 379 #warning "TARGET_MAX32625PICO not previously tested; need to verify ADC_FULL_SCALE_VOLTAGE..."
whismanoid 52:d3fb6f1722bf 380 const float ADC_FULL_SCALE_VOLTAGE = 1.200;
whismanoid 52:d3fb6f1722bf 381 //
whismanoid 52:d3fb6f1722bf 382 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 383 #elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_F401RE)
whismanoid 52:d3fb6f1722bf 384 // TODO1: target NUCLEO_F446RE
whismanoid 52:d3fb6f1722bf 385 //
whismanoid 52:d3fb6f1722bf 386 // USER_BUTTON PC13
whismanoid 52:d3fb6f1722bf 387 // LED1 is shared with SPI_SCK on NUCLEO_F446RE PA_5, so don't use LED1.
whismanoid 52:d3fb6f1722bf 388 #define USE_LEDS 0
whismanoid 52:d3fb6f1722bf 389 // SPI spi(SPI_MOSI, SPI_MISO, SPI_SCK);
whismanoid 52:d3fb6f1722bf 390 // Serial serial(SERIAL_TX, SERIAL_RX);
whismanoid 52:d3fb6f1722bf 391 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 0
whismanoid 52:d3fb6f1722bf 392 const float ADC_FULL_SCALE_VOLTAGE = 3.300; // TODO: ADC_FULL_SCALE_VOLTAGE Pico?
whismanoid 52:d3fb6f1722bf 393 //
whismanoid 52:d3fb6f1722bf 394 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 395 #elif defined(TARGET_LPC1768)
whismanoid 52:d3fb6f1722bf 396 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 397 // TARGET=LPC1768 ARM Cortex-M3 100 MHz 512kB flash 64kB SRAM
whismanoid 52:d3fb6f1722bf 398 // +-------------[microUSB]-------------+
whismanoid 52:d3fb6f1722bf 399 // ______ | [ ] GND +3.3V VOUT [ ] | ______
whismanoid 52:d3fb6f1722bf 400 // ______ | [ ] 4.5V<VIN<9.0V +5.0V VU [ ] | ______
whismanoid 52:d3fb6f1722bf 401 // ______ | [ ] VB USB.IF- [ ] | ______
whismanoid 52:d3fb6f1722bf 402 // ______ | [ ] nR USB.IF+ [ ] | ______
whismanoid 52:d3fb6f1722bf 403 // digitalInOut0 | [ ] p5 MOSI ETHERNET.RD- [ ] | ______
whismanoid 52:d3fb6f1722bf 404 // digitalInOut1 | [ ] p6 MISO ETHERNET.RD+ [ ] | ______
whismanoid 52:d3fb6f1722bf 405 // digitalInOut2 | [ ] p7 SCLK ETHERNET.TD- [ ] | ______
whismanoid 52:d3fb6f1722bf 406 // digitalInOut3 | [ ] p8 ETHERNET.TD+ [ ] | ______
whismanoid 52:d3fb6f1722bf 407 // digitalInOut4 | [ ] p9 TX SDA USB.D- [ ] | ______
whismanoid 52:d3fb6f1722bf 408 // digitalInOut5 | [ ] p10 RX SCL USB.D+ [ ] | ______
whismanoid 52:d3fb6f1722bf 409 // digitalInOut6 | [ ] p11 MOSI CAN-RD p30 [ ] | digitalInOut13
whismanoid 52:d3fb6f1722bf 410 // digitalInOut7 | [ ] p12 MISO CAN-TD p29 [ ] | digitalInOut12
whismanoid 52:d3fb6f1722bf 411 // digitalInOut8 | [ ] p13 TX SCLK SDA TX p28 [ ] | digitalInOut11
whismanoid 52:d3fb6f1722bf 412 // digitalInOut9 | [ ] p14 RX SCL RX p27 [ ] | digitalInOut10
whismanoid 52:d3fb6f1722bf 413 // analogIn0 | [ ] p15 AIN0 3.3Vfs PWM1 p26 [ ] | pwmDriver1
whismanoid 52:d3fb6f1722bf 414 // analogIn1 | [ ] p16 AIN1 3.3Vfs PWM2 p25 [ ] | pwmDriver2
whismanoid 52:d3fb6f1722bf 415 // analogIn2 | [ ] p17 AIN2 3.3Vfs PWM3 p24 [ ] | pwmDriver3
whismanoid 52:d3fb6f1722bf 416 // analogIn3 | [ ] p18 AIN3 AOUT PWM4 p23 [ ] | pwmDriver4
whismanoid 52:d3fb6f1722bf 417 // analogIn4 | [ ] p19 AIN4 3.3Vfs PWM5 p22 [ ] | pwmDriver5
whismanoid 52:d3fb6f1722bf 418 // analogIn5 | [ ] p20 AIN5 3.3Vfs PWM6 p21 [ ] | pwmDriver6
whismanoid 52:d3fb6f1722bf 419 // +------------------------------------+
whismanoid 52:d3fb6f1722bf 420 // AIN6 = P0.3 = TGT_SBL_RXD?
whismanoid 52:d3fb6f1722bf 421 // AIN7 = P0.2 = TGT_SBL_TXD?
whismanoid 52:d3fb6f1722bf 422 //
whismanoid 52:d3fb6f1722bf 423 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 424 // LPC1768 board uses VREF = 3.300V +A3,3V thru L1 to bypass capacitor C14
whismanoid 52:d3fb6f1722bf 425 #define analogIn4_IS_HIGH_RANGE_OF_analogIn0 0
whismanoid 52:d3fb6f1722bf 426 const float ADC_FULL_SCALE_VOLTAGE = 3.300;
whismanoid 52:d3fb6f1722bf 427 #else // not defined(TARGET_LPC1768 etc.)
whismanoid 52:d3fb6f1722bf 428 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 429 // unknown target
whismanoid 52:d3fb6f1722bf 430 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 431 #endif // target definition
whismanoid 52:d3fb6f1722bf 432
whismanoid 52:d3fb6f1722bf 433
whismanoid 52:d3fb6f1722bf 434 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 435 // Option to dedicate SPI port pins
whismanoid 52:d3fb6f1722bf 436 //
whismanoid 52:d3fb6f1722bf 437 // SPI2_MOSI = P5_1
whismanoid 52:d3fb6f1722bf 438 // SPI2_MISO = P5_2
whismanoid 52:d3fb6f1722bf 439 // SPI2_SCK = P5_0
whismanoid 52:d3fb6f1722bf 440 // On this board I'm using P3_0 as spi_cs
whismanoid 52:d3fb6f1722bf 441 // SPI2_SS = P5_3
whismanoid 52:d3fb6f1722bf 442 // SPI2_SDIO2 = P5_4
whismanoid 52:d3fb6f1722bf 443 // SPI2_SDIO3 = P5_5
whismanoid 52:d3fb6f1722bf 444 // SPI2_SRN = P5_6
whismanoid 52:d3fb6f1722bf 445 //
whismanoid 52:d3fb6f1722bf 446 #ifndef HAS_SPI
whismanoid 52:d3fb6f1722bf 447 #define HAS_SPI 1
whismanoid 52:d3fb6f1722bf 448 #endif
whismanoid 52:d3fb6f1722bf 449 #if HAS_SPI
whismanoid 52:d3fb6f1722bf 450 #define SPI_MODE0 0
whismanoid 52:d3fb6f1722bf 451 #define SPI_MODE1 1
whismanoid 52:d3fb6f1722bf 452 #define SPI_MODE2 2
whismanoid 52:d3fb6f1722bf 453 #define SPI_MODE3 3
whismanoid 52:d3fb6f1722bf 454 //
whismanoid 52:d3fb6f1722bf 455 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 456 // Before setting global variables g_SPI_SCLK_Hz and g_SPI_dataMode,
whismanoid 52:d3fb6f1722bf 457 // workaround for TARGET_MAX32630 SPI_MODE2 SPI_MODE3 problem (issue #30)
whismanoid 52:d3fb6f1722bf 458 #warning "MAX32630 SPI workaround..."
whismanoid 52:d3fb6f1722bf 459 // replace SPI_MODE2 (CPOL=1,CPHA=0) with SPI_MODE1 (CPOL=0,CPHA=1) Falling Edge stable
whismanoid 52:d3fb6f1722bf 460 // replace SPI_MODE3 (CPOL=1,CPHA=1) with SPI_MODE0 (CPOL=0,CPHA=0) Rising Edge stable
whismanoid 52:d3fb6f1722bf 461 # if ((SPI_dataMode) == (SPI_MODE2))
whismanoid 52:d3fb6f1722bf 462 #warning "MAX32630 SPI_MODE2 workaround, changing SPI_dataMode to SPI_MODE1..."
whismanoid 52:d3fb6f1722bf 463 // SPI_dataMode SPI_MODE2 // CPOL=1,CPHA=0: Falling Edge stable; SCLK idle High
whismanoid 52:d3fb6f1722bf 464 # undef SPI_dataMode
whismanoid 52:d3fb6f1722bf 465 # define SPI_dataMode SPI_MODE1 // CPOL=0,CPHA=1: Falling Edge stable; SCLK idle Low
whismanoid 52:d3fb6f1722bf 466 # elif ((SPI_dataMode) == (SPI_MODE3))
whismanoid 52:d3fb6f1722bf 467 #warning "MAX32630 SPI_MODE3 workaround, changing SPI_dataMode to SPI_MODE0..."
whismanoid 52:d3fb6f1722bf 468 // SPI_dataMode SPI_MODE3 // CPOL=1,CPHA=1: Rising Edge stable; SCLK idle High
whismanoid 52:d3fb6f1722bf 469 # undef SPI_dataMode
whismanoid 52:d3fb6f1722bf 470 # define SPI_dataMode SPI_MODE0 // CPOL=0,CPHA=0: Rising Edge stable; SCLK idle Low
whismanoid 52:d3fb6f1722bf 471 # endif // workaround for TARGET_MAX32630 SPI_MODE2 SPI_MODE3 problem
whismanoid 52:d3fb6f1722bf 472 // workaround for TARGET_MAX32630 SPI_MODE2 SPI_MODE3 problem (issue #30)
whismanoid 52:d3fb6f1722bf 473 // limit SPI SCLK speed to 6MHz or less
whismanoid 52:d3fb6f1722bf 474 # if ((SPI_SCLK_Hz) > (6000000))
whismanoid 52:d3fb6f1722bf 475 #warning "MAX32630 SPI speed workaround, changing SPI_SCLK_Hz to 6000000 or 6MHz..."
whismanoid 52:d3fb6f1722bf 476 # undef SPI_SCLK_Hz
whismanoid 52:d3fb6f1722bf 477 # define SPI_SCLK_Hz 6000000 // 6MHz
whismanoid 52:d3fb6f1722bf 478 # endif
whismanoid 52:d3fb6f1722bf 479 #endif
whismanoid 52:d3fb6f1722bf 480 //
whismanoid 53:bf2793cd194b 481 uint32_t g_SPI_SCLK_Hz = 24000000; // platform limit 24MHz intSPI_SCLK_Platform_Max_MHz * 1000000
whismanoid 52:d3fb6f1722bf 482 // TODO1: validate g_SPI_SCLK_Hz against system clock frequency SystemCoreClock F_CPU
whismanoid 52:d3fb6f1722bf 483 #if defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_F401RE)
whismanoid 52:d3fb6f1722bf 484 // Nucleo SPI frequency isn't working quite as expected...
whismanoid 52:d3fb6f1722bf 485 // Looks like STMF4 has an spi clock prescaler (2,4,8,16,32,64,128,256)
whismanoid 52:d3fb6f1722bf 486 // so 180MHz->[90.0, 45.0, 22.5, 11.25, 5.625, 2.8125, 1.40625, 0.703125]
whismanoid 52:d3fb6f1722bf 487 // %SC SCLK=1MHz sets spi frequency 703.125kHz
whismanoid 52:d3fb6f1722bf 488 // %SC SCLK=2MHz sets spi frequency 1.40625MHz
whismanoid 52:d3fb6f1722bf 489 // %SC SCLK=3MHz sets spi frequency 2.8125MHz
whismanoid 52:d3fb6f1722bf 490 // %SC SCLK=6MHz sets spi frequency 5.625MHz
whismanoid 52:d3fb6f1722bf 491 // %SC SCLK=12MHz sets spi frequency 11.25MHz
whismanoid 52:d3fb6f1722bf 492 // %SC SCLK=23MHz sets spi frequency 22.5MHz
whismanoid 52:d3fb6f1722bf 493 // %SC SCLK=45MHz sets spi frequency 45.0MHz
whismanoid 52:d3fb6f1722bf 494 // Don't know why I can't reach spi frequency 90.0MHz, but ok whatever.
whismanoid 52:d3fb6f1722bf 495 const uint32_t limit_min_SPI_SCLK_divisor = 2;
whismanoid 52:d3fb6f1722bf 496 const uint32_t limit_max_SPI_SCLK_divisor = 256;
whismanoid 52:d3fb6f1722bf 497 // not really a divisor, just a powers-of-two prescaler with no intermediate divisors.
whismanoid 52:d3fb6f1722bf 498 #else
whismanoid 52:d3fb6f1722bf 499 const uint32_t limit_min_SPI_SCLK_divisor = 2;
whismanoid 52:d3fb6f1722bf 500 const uint32_t limit_max_SPI_SCLK_divisor = 8191;
whismanoid 52:d3fb6f1722bf 501 #endif
whismanoid 52:d3fb6f1722bf 502 const uint32_t limit_max_SPI_SCLK_Hz = (SystemCoreClock / limit_min_SPI_SCLK_divisor); // F_CPU / 2; // 8MHz / 2 = 4MHz
whismanoid 52:d3fb6f1722bf 503 const uint32_t limit_min_SPI_SCLK_Hz = (SystemCoreClock / limit_max_SPI_SCLK_divisor); // F_CPU / 128; // 8MHz / 128 = 62.5kHz
whismanoid 52:d3fb6f1722bf 504 //
whismanoid 52:d3fb6f1722bf 505 uint8_t g_SPI_dataMode = SPI_MODE0; // TODO: missing definition SPI_dataMode;
whismanoid 52:d3fb6f1722bf 506 uint8_t g_SPI_cs_state = 1;
whismanoid 52:d3fb6f1722bf 507 //
whismanoid 52:d3fb6f1722bf 508 #endif
whismanoid 52:d3fb6f1722bf 509
whismanoid 52:d3fb6f1722bf 510
whismanoid 54:ba810c1d6264 511 // uncrustify-0.66.1 *INDENT-OFF*
whismanoid 54:ba810c1d6264 512 //--------------------------------------------------
whismanoid 54:ba810c1d6264 513 // Declare the DigitalInOut GPIO pins
whismanoid 54:ba810c1d6264 514 // Optional digitalInOut support. If there is only one it should be digitalInOut1.
whismanoid 54:ba810c1d6264 515 // D) Digital High/Low/Input Pin
whismanoid 54:ba810c1d6264 516 #if defined(TARGET_MAX32630)
whismanoid 54:ba810c1d6264 517 // +-------------[microUSB]-------------+
whismanoid 54:ba810c1d6264 518 // | J1 MAX32630FTHR J2 |
whismanoid 54:ba810c1d6264 519 // | [ ] RST GND [ ] |
whismanoid 54:ba810c1d6264 520 // | [ ] 3V3 BAT+[ ] |
whismanoid 54:ba810c1d6264 521 // | [ ] 1V8 reset SW1 |
whismanoid 54:ba810c1d6264 522 // | [ ] GND J4 J3 |
whismanoid 54:ba810c1d6264 523 // | [ ] AIN_0 1.2Vfs (bat) SYS [ ] |
whismanoid 54:ba810c1d6264 524 // | [ ] AIN_1 1.2Vfs PWR [ ] |
whismanoid 54:ba810c1d6264 525 // | [ ] AIN_2 1.2Vfs +5V VBUS [ ] |
whismanoid 54:ba810c1d6264 526 // | [ ] AIN_3 1.2Vfs 1-WIRE P4_0 [ ] | dig9
whismanoid 54:ba810c1d6264 527 // dig10 | [x] P5_7 SDA2 SRN P5_6 [ ] | dig8
whismanoid 54:ba810c1d6264 528 // dig11 | [x] P6_0 SCL2 SDIO3 P5_5 [ ] | dig7
whismanoid 54:ba810c1d6264 529 // dig12 | [x] P5_0 SCLK SDIO2 P5_4 [ ] | dig6
whismanoid 54:ba810c1d6264 530 // dig13 | [x] P5_1 MOSI SSEL P5_3 [x] | dig5
whismanoid 54:ba810c1d6264 531 // dig14 | [ ] P5_2 MISO RTS P3_3 [ ] | dig4
whismanoid 54:ba810c1d6264 532 // dig15 | [ ] P3_0 RX CTS P3_2 [ ] | dig3
whismanoid 54:ba810c1d6264 533 // dig0 | [ ] P3_1 TX SCL P3_5 [x] | dig2
whismanoid 54:ba810c1d6264 534 // | [ ] GND SDA P3_4 [x] | dig1
whismanoid 54:ba810c1d6264 535 // +------------------------------------+
whismanoid 54:ba810c1d6264 536 #define HAS_digitalInOut0 1 // P3_1 TARGET_MAX32630 J1.15
whismanoid 54:ba810c1d6264 537 #define HAS_digitalInOut1 1 // P3_4 TARGET_MAX32630 J3.12
whismanoid 54:ba810c1d6264 538 #define HAS_digitalInOut2 1 // P3_5 TARGET_MAX32630 J3.11
whismanoid 54:ba810c1d6264 539 #define HAS_digitalInOut3 1 // P3_2 TARGET_MAX32630 J3.10
whismanoid 54:ba810c1d6264 540 #define HAS_digitalInOut4 1 // P3_3 TARGET_MAX32630 J3.9
whismanoid 54:ba810c1d6264 541 #define HAS_digitalInOut5 1 // P5_3 TARGET_MAX32630 J3.8
whismanoid 54:ba810c1d6264 542 #define HAS_digitalInOut6 1 // P5_4 TARGET_MAX32630 J3.7
whismanoid 54:ba810c1d6264 543 #define HAS_digitalInOut7 1 // P5_5 TARGET_MAX32630 J3.6
whismanoid 54:ba810c1d6264 544 #define HAS_digitalInOut8 1 // P5_6 TARGET_MAX32630 J3.5
whismanoid 54:ba810c1d6264 545 #define HAS_digitalInOut9 1 // P4_0 TARGET_MAX32630 J3.4
whismanoid 54:ba810c1d6264 546 #if HAS_I2C
whismanoid 54:ba810c1d6264 547 // avoid resource conflict between P5_7, P6_0 I2C and DigitalInOut
whismanoid 54:ba810c1d6264 548 #define HAS_digitalInOut10 0 // P5_7 TARGET_MAX32630 J1.9
whismanoid 54:ba810c1d6264 549 #define HAS_digitalInOut11 0 // P6_0 TARGET_MAX32630 J1.10
whismanoid 54:ba810c1d6264 550 #else // HAS_I2C
whismanoid 54:ba810c1d6264 551 #define HAS_digitalInOut10 1 // P5_7 TARGET_MAX32630 J1.9
whismanoid 54:ba810c1d6264 552 #define HAS_digitalInOut11 1 // P6_0 TARGET_MAX32630 J1.10
whismanoid 54:ba810c1d6264 553 #endif // HAS_I2C
whismanoid 54:ba810c1d6264 554 #if HAS_SPI
whismanoid 54:ba810c1d6264 555 // avoid resource conflict between P5_0, P5_1, P5_2 SPI and DigitalInOut
whismanoid 54:ba810c1d6264 556 #define HAS_digitalInOut12 0 // P5_0 TARGET_MAX32630 J1.11
whismanoid 54:ba810c1d6264 557 #define HAS_digitalInOut13 0 // P5_1 TARGET_MAX32630 J1.12
whismanoid 54:ba810c1d6264 558 #define HAS_digitalInOut14 0 // P5_2 TARGET_MAX32630 J1.13
whismanoid 54:ba810c1d6264 559 #define HAS_digitalInOut15 0 // P3_0 TARGET_MAX32630 J1.14
whismanoid 54:ba810c1d6264 560 #else // HAS_SPI
whismanoid 54:ba810c1d6264 561 #define HAS_digitalInOut12 1 // P5_0 TARGET_MAX32630 J1.11
whismanoid 54:ba810c1d6264 562 #define HAS_digitalInOut13 1 // P5_1 TARGET_MAX32630 J1.12
whismanoid 54:ba810c1d6264 563 #define HAS_digitalInOut14 1 // P5_2 TARGET_MAX32630 J1.13
whismanoid 54:ba810c1d6264 564 #define HAS_digitalInOut15 1 // P3_0 TARGET_MAX32630 J1.14
whismanoid 54:ba810c1d6264 565 #endif // HAS_SPI
whismanoid 54:ba810c1d6264 566 #if HAS_digitalInOut0
whismanoid 54:ba810c1d6264 567 DigitalInOut digitalInOut0(P3_1, PIN_INPUT, PullUp, 1); // P3_1 TARGET_MAX32630 J1.15
whismanoid 54:ba810c1d6264 568 #endif
whismanoid 54:ba810c1d6264 569 #if HAS_digitalInOut1
whismanoid 54:ba810c1d6264 570 DigitalInOut digitalInOut1(P3_4, PIN_INPUT, PullUp, 1); // P3_4 TARGET_MAX32630 J3.12
whismanoid 54:ba810c1d6264 571 #endif
whismanoid 54:ba810c1d6264 572 #if HAS_digitalInOut2
whismanoid 54:ba810c1d6264 573 DigitalInOut digitalInOut2(P3_5, PIN_INPUT, PullUp, 1); // P3_5 TARGET_MAX32630 J3.11
whismanoid 54:ba810c1d6264 574 #endif
whismanoid 54:ba810c1d6264 575 #if HAS_digitalInOut3
whismanoid 54:ba810c1d6264 576 DigitalInOut digitalInOut3(P3_2, PIN_INPUT, PullUp, 1); // P3_2 TARGET_MAX32630 J3.10
whismanoid 54:ba810c1d6264 577 #endif
whismanoid 54:ba810c1d6264 578 #if HAS_digitalInOut4
whismanoid 54:ba810c1d6264 579 DigitalInOut digitalInOut4(P3_3, PIN_INPUT, PullUp, 1); // P3_3 TARGET_MAX32630 J3.9
whismanoid 54:ba810c1d6264 580 #endif
whismanoid 54:ba810c1d6264 581 #if HAS_digitalInOut5
whismanoid 54:ba810c1d6264 582 DigitalInOut digitalInOut5(P5_3, PIN_INPUT, PullUp, 1); // P5_3 TARGET_MAX32630 J3.8
whismanoid 54:ba810c1d6264 583 #endif
whismanoid 54:ba810c1d6264 584 #if HAS_digitalInOut6
whismanoid 54:ba810c1d6264 585 DigitalInOut digitalInOut6(P5_4, PIN_INPUT, PullUp, 1); // P5_4 TARGET_MAX32630 J3.7
whismanoid 54:ba810c1d6264 586 #endif
whismanoid 54:ba810c1d6264 587 #if HAS_digitalInOut7
whismanoid 54:ba810c1d6264 588 DigitalInOut digitalInOut7(P5_5, PIN_INPUT, PullUp, 1); // P5_5 TARGET_MAX32630 J3.6
whismanoid 54:ba810c1d6264 589 #endif
whismanoid 54:ba810c1d6264 590 #if HAS_digitalInOut8
whismanoid 54:ba810c1d6264 591 DigitalInOut digitalInOut8(P5_6, PIN_INPUT, PullUp, 1); // P5_6 TARGET_MAX32630 J3.5
whismanoid 54:ba810c1d6264 592 #endif
whismanoid 54:ba810c1d6264 593 #if HAS_digitalInOut9
whismanoid 54:ba810c1d6264 594 DigitalInOut digitalInOut9(P4_0, PIN_INPUT, PullUp, 1); // P4_0 TARGET_MAX32630 J3.4
whismanoid 54:ba810c1d6264 595 #endif
whismanoid 54:ba810c1d6264 596 #if HAS_digitalInOut10
whismanoid 54:ba810c1d6264 597 DigitalInOut digitalInOut10(P5_7, PIN_INPUT, PullUp, 1); // P5_7 TARGET_MAX32630 J1.9
whismanoid 54:ba810c1d6264 598 #endif
whismanoid 54:ba810c1d6264 599 #if HAS_digitalInOut11
whismanoid 54:ba810c1d6264 600 DigitalInOut digitalInOut11(P6_0, PIN_INPUT, PullUp, 1); // P6_0 TARGET_MAX32630 J1.10
whismanoid 54:ba810c1d6264 601 #endif
whismanoid 54:ba810c1d6264 602 #if HAS_digitalInOut12
whismanoid 54:ba810c1d6264 603 DigitalInOut digitalInOut12(P5_0, PIN_INPUT, PullUp, 1); // P5_0 TARGET_MAX32630 J1.11
whismanoid 54:ba810c1d6264 604 #endif
whismanoid 54:ba810c1d6264 605 #if HAS_digitalInOut13
whismanoid 54:ba810c1d6264 606 DigitalInOut digitalInOut13(P5_1, PIN_INPUT, PullUp, 1); // P5_1 TARGET_MAX32630 J1.12
whismanoid 54:ba810c1d6264 607 #endif
whismanoid 54:ba810c1d6264 608 #if HAS_digitalInOut14
whismanoid 54:ba810c1d6264 609 DigitalInOut digitalInOut14(P5_2, PIN_INPUT, PullUp, 1); // P5_2 TARGET_MAX32630 J1.13
whismanoid 54:ba810c1d6264 610 #endif
whismanoid 54:ba810c1d6264 611 #if HAS_digitalInOut15
whismanoid 54:ba810c1d6264 612 DigitalInOut digitalInOut15(P3_0, PIN_INPUT, PullUp, 1); // P3_0 TARGET_MAX32630 J1.14
whismanoid 54:ba810c1d6264 613 #endif
whismanoid 54:ba810c1d6264 614 //--------------------------------------------------
whismanoid 54:ba810c1d6264 615 #elif defined(TARGET_MAX32625MBED)
whismanoid 54:ba810c1d6264 616 // TARGET=MAX32625MBED ARM Cortex-M4F 96MHz 512kB Flash 160kB SRAM
whismanoid 54:ba810c1d6264 617 // +-------------------------------------+
whismanoid 54:ba810c1d6264 618 // | MAX32625MBED Arduino UNO header |
whismanoid 54:ba810c1d6264 619 // | |
whismanoid 54:ba810c1d6264 620 // | A5/SCL[ ] | P1_7 dig15
whismanoid 54:ba810c1d6264 621 // | A4/SDA[ ] | P1_6 dig14
whismanoid 54:ba810c1d6264 622 // | AREF=N/C[ ] |
whismanoid 54:ba810c1d6264 623 // | GND[ ] |
whismanoid 54:ba810c1d6264 624 // | [ ]N/C SCK/13[ ] | P1_0 dig13
whismanoid 54:ba810c1d6264 625 // | [ ]IOREF=3V3 MISO/12[ ] | P1_2 dig12
whismanoid 54:ba810c1d6264 626 // | [ ]RST MOSI/11[ ]~| P1_1 dig11
whismanoid 54:ba810c1d6264 627 // | [ ]3V3 CS/10[ ]~| P1_3 dig10
whismanoid 54:ba810c1d6264 628 // | [ ]5V0 9[ ]~| P1_5 dig9
whismanoid 54:ba810c1d6264 629 // | [ ]GND 8[ ] | P1_4 dig8
whismanoid 54:ba810c1d6264 630 // | [ ]GND |
whismanoid 54:ba810c1d6264 631 // | [ ]Vin 7[ ] | P0_7 dig7
whismanoid 54:ba810c1d6264 632 // | 6[ ]~| P0_6 dig6
whismanoid 54:ba810c1d6264 633 // AIN_0 | [ ]A0 5[ ]~| P0_5 dig5
whismanoid 54:ba810c1d6264 634 // AIN_1 | [ ]A1 4[ ] | P0_4 dig4
whismanoid 54:ba810c1d6264 635 // AIN_2 | [ ]A2 INT1/3[ ]~| P0_3 dig3
whismanoid 54:ba810c1d6264 636 // AIN_3 | [ ]A3 INT0/2[ ] | P0_2 dig2
whismanoid 54:ba810c1d6264 637 // dig16 P3_4 | [ ]A4/SDA RST SCK MISO TX>1[ ] | P0_1 dig1
whismanoid 54:ba810c1d6264 638 // dig17 P3_5 | [ ]A5/SCL [ ] [ ] [ ] RX<0[ ] | P0_0 dig0
whismanoid 54:ba810c1d6264 639 // | [ ] [ ] [ ] |
whismanoid 54:ba810c1d6264 640 // | UNO_R3 GND MOSI 5V ____________/
whismanoid 54:ba810c1d6264 641 // \_______________________/
whismanoid 54:ba810c1d6264 642 //
whismanoid 54:ba810c1d6264 643 #define HAS_digitalInOut0 1 // P0_0 TARGET_MAX32625MBED D0
whismanoid 54:ba810c1d6264 644 #define HAS_digitalInOut1 1 // P0_1 TARGET_MAX32625MBED D1
whismanoid 54:ba810c1d6264 645 #if APPLICATION_MAX11131
whismanoid 54:ba810c1d6264 646 #define HAS_digitalInOut2 0 // P0_2 TARGET_MAX32625MBED D2 -- MAX11131 EOC DigitalIn
whismanoid 54:ba810c1d6264 647 #else
whismanoid 54:ba810c1d6264 648 #define HAS_digitalInOut2 1 // P0_2 TARGET_MAX32625MBED D2
whismanoid 54:ba810c1d6264 649 #endif
whismanoid 54:ba810c1d6264 650 #define HAS_digitalInOut3 1 // P0_3 TARGET_MAX32625MBED D3
whismanoid 54:ba810c1d6264 651 #define HAS_digitalInOut4 1 // P0_4 TARGET_MAX32625MBED D4
whismanoid 54:ba810c1d6264 652 #define HAS_digitalInOut5 1 // P0_5 TARGET_MAX32625MBED D5
whismanoid 54:ba810c1d6264 653 #define HAS_digitalInOut6 1 // P0_6 TARGET_MAX32625MBED D6
whismanoid 54:ba810c1d6264 654 #define HAS_digitalInOut7 1 // P0_7 TARGET_MAX32625MBED D7
whismanoid 54:ba810c1d6264 655 #define HAS_digitalInOut8 1 // P1_4 TARGET_MAX32625MBED D8
whismanoid 54:ba810c1d6264 656 #if APPLICATION_MAX11131
whismanoid 54:ba810c1d6264 657 #define HAS_digitalInOut9 0 // P1_5 TARGET_MAX32625MBED D9 -- MAX11131 CNVST DigitalOut
whismanoid 54:ba810c1d6264 658 #else
whismanoid 54:ba810c1d6264 659 #define HAS_digitalInOut9 1 // P1_5 TARGET_MAX32625MBED D9
whismanoid 54:ba810c1d6264 660 #endif
whismanoid 54:ba810c1d6264 661 #if HAS_SPI
whismanoid 54:ba810c1d6264 662 // avoid resource conflict between P5_0, P5_1, P5_2 SPI and DigitalInOut
whismanoid 54:ba810c1d6264 663 #define HAS_digitalInOut10 0 // P1_3 TARGET_MAX32635MBED CS/10
whismanoid 54:ba810c1d6264 664 #define HAS_digitalInOut11 0 // P1_1 TARGET_MAX32635MBED MOSI/11
whismanoid 54:ba810c1d6264 665 #define HAS_digitalInOut12 0 // P1_2 TARGET_MAX32635MBED MISO/12
whismanoid 54:ba810c1d6264 666 #define HAS_digitalInOut13 0 // P1_0 TARGET_MAX32635MBED SCK/13
whismanoid 54:ba810c1d6264 667 #else // HAS_SPI
whismanoid 54:ba810c1d6264 668 #define HAS_digitalInOut10 1 // P1_3 TARGET_MAX32635MBED CS/10
whismanoid 54:ba810c1d6264 669 #define HAS_digitalInOut11 1 // P1_1 TARGET_MAX32635MBED MOSI/11
whismanoid 54:ba810c1d6264 670 #define HAS_digitalInOut12 1 // P1_2 TARGET_MAX32635MBED MISO/12
whismanoid 54:ba810c1d6264 671 #define HAS_digitalInOut13 1 // P1_0 TARGET_MAX32635MBED SCK/13
whismanoid 54:ba810c1d6264 672 #endif // HAS_SPI
whismanoid 54:ba810c1d6264 673 #if HAS_I2C
whismanoid 54:ba810c1d6264 674 // avoid resource conflict between P5_7, P6_0 I2C and DigitalInOut
whismanoid 54:ba810c1d6264 675 #define HAS_digitalInOut14 0 // P1_6 TARGET_MAX32635MBED A4/SDA (10pin digital connector)
whismanoid 54:ba810c1d6264 676 #define HAS_digitalInOut15 0 // P1_7 TARGET_MAX32635MBED A5/SCL (10pin digital connector)
whismanoid 54:ba810c1d6264 677 #define HAS_digitalInOut16 0 // P3_4 TARGET_MAX32635MBED A4/SDA (6pin analog connector)
whismanoid 54:ba810c1d6264 678 #define HAS_digitalInOut17 0 // P3_5 TARGET_MAX32635MBED A5/SCL (6pin analog connector)
whismanoid 54:ba810c1d6264 679 #else // HAS_I2C
whismanoid 54:ba810c1d6264 680 #define HAS_digitalInOut14 1 // P1_6 TARGET_MAX32635MBED A4/SDA (10pin digital connector)
whismanoid 54:ba810c1d6264 681 #define HAS_digitalInOut15 1 // P1_7 TARGET_MAX32635MBED A5/SCL (10pin digital connector)
whismanoid 54:ba810c1d6264 682 #define HAS_digitalInOut16 1 // P3_4 TARGET_MAX32635MBED A4/SDA (6pin analog connector)
whismanoid 54:ba810c1d6264 683 #define HAS_digitalInOut17 1 // P3_5 TARGET_MAX32635MBED A5/SCL (6pin analog connector)
whismanoid 54:ba810c1d6264 684 #endif // HAS_I2C
whismanoid 54:ba810c1d6264 685 #if HAS_digitalInOut0
whismanoid 54:ba810c1d6264 686 DigitalInOut digitalInOut0(P0_0, PIN_INPUT, PullUp, 1); // P0_0 TARGET_MAX32625MBED D0
whismanoid 54:ba810c1d6264 687 #endif
whismanoid 54:ba810c1d6264 688 #if HAS_digitalInOut1
whismanoid 54:ba810c1d6264 689 DigitalInOut digitalInOut1(P0_1, PIN_INPUT, PullUp, 1); // P0_1 TARGET_MAX32625MBED D1
whismanoid 54:ba810c1d6264 690 #endif
whismanoid 54:ba810c1d6264 691 #if HAS_digitalInOut2
whismanoid 54:ba810c1d6264 692 DigitalInOut digitalInOut2(P0_2, PIN_INPUT, PullUp, 1); // P0_2 TARGET_MAX32625MBED D2
whismanoid 54:ba810c1d6264 693 #endif
whismanoid 54:ba810c1d6264 694 #if HAS_digitalInOut3
whismanoid 54:ba810c1d6264 695 DigitalInOut digitalInOut3(P0_3, PIN_INPUT, PullUp, 1); // P0_3 TARGET_MAX32625MBED D3
whismanoid 54:ba810c1d6264 696 #endif
whismanoid 54:ba810c1d6264 697 #if HAS_digitalInOut4
whismanoid 54:ba810c1d6264 698 DigitalInOut digitalInOut4(P0_4, PIN_INPUT, PullUp, 1); // P0_4 TARGET_MAX32625MBED D4
whismanoid 54:ba810c1d6264 699 #endif
whismanoid 54:ba810c1d6264 700 #if HAS_digitalInOut5
whismanoid 54:ba810c1d6264 701 DigitalInOut digitalInOut5(P0_5, PIN_INPUT, PullUp, 1); // P0_5 TARGET_MAX32625MBED D5
whismanoid 54:ba810c1d6264 702 #endif
whismanoid 54:ba810c1d6264 703 #if HAS_digitalInOut6
whismanoid 54:ba810c1d6264 704 DigitalInOut digitalInOut6(P0_6, PIN_INPUT, PullUp, 1); // P0_6 TARGET_MAX32625MBED D6
whismanoid 54:ba810c1d6264 705 #endif
whismanoid 54:ba810c1d6264 706 #if HAS_digitalInOut7
whismanoid 54:ba810c1d6264 707 DigitalInOut digitalInOut7(P0_7, PIN_INPUT, PullUp, 1); // P0_7 TARGET_MAX32625MBED D7
whismanoid 54:ba810c1d6264 708 #endif
whismanoid 54:ba810c1d6264 709 #if HAS_digitalInOut8
whismanoid 54:ba810c1d6264 710 DigitalInOut digitalInOut8(P1_4, PIN_INPUT, PullUp, 1); // P1_4 TARGET_MAX32625MBED D8
whismanoid 54:ba810c1d6264 711 #endif
whismanoid 54:ba810c1d6264 712 #if HAS_digitalInOut9
whismanoid 54:ba810c1d6264 713 DigitalInOut digitalInOut9(P1_5, PIN_INPUT, PullUp, 1); // P1_5 TARGET_MAX32625MBED D9
whismanoid 54:ba810c1d6264 714 #endif
whismanoid 54:ba810c1d6264 715 #if HAS_digitalInOut10
whismanoid 54:ba810c1d6264 716 DigitalInOut digitalInOut10(P1_3, PIN_INPUT, PullUp, 1); // P1_3 TARGET_MAX32635MBED CS/10
whismanoid 54:ba810c1d6264 717 #endif
whismanoid 54:ba810c1d6264 718 #if HAS_digitalInOut11
whismanoid 54:ba810c1d6264 719 DigitalInOut digitalInOut11(P1_1, PIN_INPUT, PullUp, 1); // P1_1 TARGET_MAX32635MBED MOSI/11
whismanoid 54:ba810c1d6264 720 #endif
whismanoid 54:ba810c1d6264 721 #if HAS_digitalInOut12
whismanoid 54:ba810c1d6264 722 DigitalInOut digitalInOut12(P1_2, PIN_INPUT, PullUp, 1); // P1_2 TARGET_MAX32635MBED MISO/12
whismanoid 54:ba810c1d6264 723 #endif
whismanoid 54:ba810c1d6264 724 #if HAS_digitalInOut13
whismanoid 54:ba810c1d6264 725 DigitalInOut digitalInOut13(P1_0, PIN_INPUT, PullUp, 1); // P1_0 TARGET_MAX32635MBED SCK/13
whismanoid 54:ba810c1d6264 726 #endif
whismanoid 54:ba810c1d6264 727 #if HAS_digitalInOut14
whismanoid 54:ba810c1d6264 728 // Ensure that the unused I2C pins do not interfere with analog inputs A4 and A5
whismanoid 54:ba810c1d6264 729 // DigitalInOut mode can be one of PullUp, PullDown, PullNone, OpenDrain
whismanoid 54:ba810c1d6264 730 DigitalInOut digitalInOut14(P1_6, PIN_INPUT, OpenDrain, 1); // P1_6 TARGET_MAX32635MBED A4/SDA (10pin digital connector)
whismanoid 54:ba810c1d6264 731 #endif
whismanoid 54:ba810c1d6264 732 #if HAS_digitalInOut15
whismanoid 54:ba810c1d6264 733 // Ensure that the unused I2C pins do not interfere with analog inputs A4 and A5
whismanoid 54:ba810c1d6264 734 DigitalInOut digitalInOut15(P1_7, PIN_INPUT, OpenDrain, 1); // P1_7 TARGET_MAX32635MBED A5/SCL (10pin digital connector)
whismanoid 54:ba810c1d6264 735 #endif
whismanoid 54:ba810c1d6264 736 #if HAS_digitalInOut16
whismanoid 54:ba810c1d6264 737 // Ensure that the unused I2C pins do not interfere with analog inputs A4 and A5
whismanoid 54:ba810c1d6264 738 // DigitalInOut mode can be one of PullUp, PullDown, PullNone, OpenDrain
whismanoid 54:ba810c1d6264 739 // PullUp-->3.4V, PullDown-->1.7V, PullNone-->3.5V, OpenDrain-->0.00V
whismanoid 54:ba810c1d6264 740 DigitalInOut digitalInOut16(P3_4, PIN_INPUT, OpenDrain, 0); // P3_4 TARGET_MAX32635MBED A4/SDA (6pin analog connector)
whismanoid 54:ba810c1d6264 741 #endif
whismanoid 54:ba810c1d6264 742 #if HAS_digitalInOut17
whismanoid 54:ba810c1d6264 743 // Ensure that the unused I2C pins do not interfere with analog inputs A4 and A5
whismanoid 54:ba810c1d6264 744 DigitalInOut digitalInOut17(P3_5, PIN_INPUT, OpenDrain, 0); // P3_5 TARGET_MAX32635MBED A5/SCL (6pin analog connector)
whismanoid 54:ba810c1d6264 745 #endif
whismanoid 54:ba810c1d6264 746 //--------------------------------------------------
whismanoid 54:ba810c1d6264 747 #elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_F401RE)
whismanoid 57:dc118969c848 748 #define HAS_digitalInOut0 0
whismanoid 57:dc118969c848 749 #define HAS_digitalInOut1 0
whismanoid 54:ba810c1d6264 750 #if APPLICATION_MAX11131
whismanoid 57:dc118969c848 751 // D2 -- MAX11131 EOC DigitalIn
whismanoid 57:dc118969c848 752 #define HAS_digitalInOut2 0
whismanoid 54:ba810c1d6264 753 #else
whismanoid 57:dc118969c848 754 #define HAS_digitalInOut2 1
whismanoid 57:dc118969c848 755 #endif
whismanoid 57:dc118969c848 756 #define HAS_digitalInOut3 1
whismanoid 57:dc118969c848 757 #define HAS_digitalInOut4 1
whismanoid 57:dc118969c848 758 #define HAS_digitalInOut5 1
whismanoid 57:dc118969c848 759 #define HAS_digitalInOut6 1
whismanoid 57:dc118969c848 760 #define HAS_digitalInOut7 1
whismanoid 54:ba810c1d6264 761 #if APPLICATION_MAX5715
whismanoid 57:dc118969c848 762 // D8 -- MAX5715 CLRb DigitalOut
whismanoid 57:dc118969c848 763 #define HAS_digitalInOut8 0
whismanoid 54:ba810c1d6264 764 #else
whismanoid 57:dc118969c848 765 #define HAS_digitalInOut8 1
whismanoid 54:ba810c1d6264 766 #endif
whismanoid 54:ba810c1d6264 767 #if APPLICATION_MAX5715
whismanoid 57:dc118969c848 768 // D9 -- MAX5715 LDACb DigitalOut
whismanoid 57:dc118969c848 769 #define HAS_digitalInOut9 0
whismanoid 54:ba810c1d6264 770 #elif APPLICATION_MAX11131
whismanoid 57:dc118969c848 771 // D9 -- MAX11131 CNVST DigitalOut
whismanoid 57:dc118969c848 772 #define HAS_digitalInOut9 0
whismanoid 54:ba810c1d6264 773 #else
whismanoid 57:dc118969c848 774 #define HAS_digitalInOut9 1
whismanoid 54:ba810c1d6264 775 #endif
whismanoid 54:ba810c1d6264 776 #if HAS_SPI
whismanoid 54:ba810c1d6264 777 // avoid resource conflict between P5_0, P5_1, P5_2 SPI and DigitalInOut
whismanoid 54:ba810c1d6264 778 // Arduino digital pin D10 SPI function is CS/10
whismanoid 54:ba810c1d6264 779 // Arduino digital pin D11 SPI function is MOSI/11
whismanoid 54:ba810c1d6264 780 // Arduino digital pin D12 SPI function is MISO/12
whismanoid 54:ba810c1d6264 781 // Arduino digital pin D13 SPI function is SCK/13
whismanoid 54:ba810c1d6264 782 #define HAS_digitalInOut10 0
whismanoid 54:ba810c1d6264 783 #define HAS_digitalInOut11 0
whismanoid 54:ba810c1d6264 784 #define HAS_digitalInOut12 0
whismanoid 54:ba810c1d6264 785 #define HAS_digitalInOut13 0
whismanoid 54:ba810c1d6264 786 #else // HAS_SPI
whismanoid 54:ba810c1d6264 787 #define HAS_digitalInOut10 1
whismanoid 54:ba810c1d6264 788 #define HAS_digitalInOut11 1
whismanoid 54:ba810c1d6264 789 #define HAS_digitalInOut12 1
whismanoid 54:ba810c1d6264 790 #define HAS_digitalInOut13 1
whismanoid 54:ba810c1d6264 791 #endif // HAS_SPI
whismanoid 54:ba810c1d6264 792 #if HAS_I2C
whismanoid 54:ba810c1d6264 793 // avoid resource conflict between P5_7, P6_0 I2C and DigitalInOut
whismanoid 54:ba810c1d6264 794 // Arduino digital pin D14 I2C function is A4/SDA (10pin digital connector)
whismanoid 54:ba810c1d6264 795 // Arduino digital pin D15 I2C function is A5/SCL (10pin digital connector)
whismanoid 54:ba810c1d6264 796 // Arduino digital pin D16 I2C function is A4/SDA (6pin analog connector)
whismanoid 54:ba810c1d6264 797 // Arduino digital pin D17 I2C function is A5/SCL (6pin analog connector)
whismanoid 54:ba810c1d6264 798 #define HAS_digitalInOut14 0
whismanoid 54:ba810c1d6264 799 #define HAS_digitalInOut15 0
whismanoid 54:ba810c1d6264 800 #define HAS_digitalInOut16 0
whismanoid 54:ba810c1d6264 801 #define HAS_digitalInOut17 0
whismanoid 54:ba810c1d6264 802 #else // HAS_I2C
whismanoid 54:ba810c1d6264 803 #define HAS_digitalInOut14 1
whismanoid 54:ba810c1d6264 804 #define HAS_digitalInOut15 1
whismanoid 54:ba810c1d6264 805 #define HAS_digitalInOut16 0
whismanoid 54:ba810c1d6264 806 #define HAS_digitalInOut17 0
whismanoid 54:ba810c1d6264 807 #endif // HAS_I2C
whismanoid 54:ba810c1d6264 808 #if HAS_digitalInOut0
whismanoid 54:ba810c1d6264 809 DigitalInOut digitalInOut0(D0, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 810 #endif
whismanoid 54:ba810c1d6264 811 #if HAS_digitalInOut1
whismanoid 54:ba810c1d6264 812 DigitalInOut digitalInOut1(D1, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 813 #endif
whismanoid 54:ba810c1d6264 814 #if HAS_digitalInOut2
whismanoid 54:ba810c1d6264 815 DigitalInOut digitalInOut2(D2, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 816 #endif
whismanoid 54:ba810c1d6264 817 #if HAS_digitalInOut3
whismanoid 54:ba810c1d6264 818 DigitalInOut digitalInOut3(D3, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 819 #endif
whismanoid 54:ba810c1d6264 820 #if HAS_digitalInOut4
whismanoid 54:ba810c1d6264 821 DigitalInOut digitalInOut4(D4, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 822 #endif
whismanoid 54:ba810c1d6264 823 #if HAS_digitalInOut5
whismanoid 54:ba810c1d6264 824 DigitalInOut digitalInOut5(D5, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 825 #endif
whismanoid 54:ba810c1d6264 826 #if HAS_digitalInOut6
whismanoid 54:ba810c1d6264 827 DigitalInOut digitalInOut6(D6, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 828 #endif
whismanoid 54:ba810c1d6264 829 #if HAS_digitalInOut7
whismanoid 54:ba810c1d6264 830 DigitalInOut digitalInOut7(D7, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 831 #endif
whismanoid 54:ba810c1d6264 832 #if HAS_digitalInOut8
whismanoid 54:ba810c1d6264 833 DigitalInOut digitalInOut8(D8, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 834 #endif
whismanoid 54:ba810c1d6264 835 #if HAS_digitalInOut9
whismanoid 54:ba810c1d6264 836 DigitalInOut digitalInOut9(D9, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 837 #endif
whismanoid 54:ba810c1d6264 838 #if HAS_digitalInOut10
whismanoid 54:ba810c1d6264 839 // Arduino digital pin D10 SPI function is CS/10
whismanoid 54:ba810c1d6264 840 DigitalInOut digitalInOut10(D10, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 841 #endif
whismanoid 54:ba810c1d6264 842 #if HAS_digitalInOut11
whismanoid 54:ba810c1d6264 843 // Arduino digital pin D11 SPI function is MOSI/11
whismanoid 54:ba810c1d6264 844 DigitalInOut digitalInOut11(D11, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 845 #endif
whismanoid 54:ba810c1d6264 846 #if HAS_digitalInOut12
whismanoid 54:ba810c1d6264 847 // Arduino digital pin D12 SPI function is MISO/12
whismanoid 54:ba810c1d6264 848 DigitalInOut digitalInOut12(D12, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 849 #endif
whismanoid 54:ba810c1d6264 850 #if HAS_digitalInOut13
whismanoid 54:ba810c1d6264 851 // Arduino digital pin D13 SPI function is SCK/13
whismanoid 54:ba810c1d6264 852 DigitalInOut digitalInOut13(D13, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 853 #endif
whismanoid 54:ba810c1d6264 854 #if HAS_digitalInOut14
whismanoid 54:ba810c1d6264 855 // Arduino digital pin D14 I2C function is A4/SDA (10pin digital connector)
whismanoid 54:ba810c1d6264 856 DigitalInOut digitalInOut14(D14, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 857 #endif
whismanoid 54:ba810c1d6264 858 #if HAS_digitalInOut15
whismanoid 54:ba810c1d6264 859 // Arduino digital pin D15 I2C function is A5/SCL (10pin digital connector)
whismanoid 54:ba810c1d6264 860 DigitalInOut digitalInOut15(D15, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 861 #endif
whismanoid 54:ba810c1d6264 862 #if HAS_digitalInOut16
whismanoid 54:ba810c1d6264 863 // Arduino digital pin D16 I2C function is A4/SDA (6pin analog connector)
whismanoid 54:ba810c1d6264 864 DigitalInOut digitalInOut16(D16, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 865 #endif
whismanoid 54:ba810c1d6264 866 #if HAS_digitalInOut17
whismanoid 54:ba810c1d6264 867 // Arduino digital pin D17 I2C function is A5/SCL (6pin analog connector)
whismanoid 54:ba810c1d6264 868 DigitalInOut digitalInOut17(D17, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 869 #endif
whismanoid 54:ba810c1d6264 870 //--------------------------------------------------
whismanoid 54:ba810c1d6264 871 #elif defined(TARGET_LPC1768)
whismanoid 54:ba810c1d6264 872 #define HAS_digitalInOut0 1
whismanoid 54:ba810c1d6264 873 #define HAS_digitalInOut1 1
whismanoid 54:ba810c1d6264 874 #define HAS_digitalInOut2 1
whismanoid 54:ba810c1d6264 875 #define HAS_digitalInOut3 1
whismanoid 54:ba810c1d6264 876 #define HAS_digitalInOut4 1
whismanoid 54:ba810c1d6264 877 #define HAS_digitalInOut5 1
whismanoid 54:ba810c1d6264 878 #define HAS_digitalInOut6 1
whismanoid 54:ba810c1d6264 879 #define HAS_digitalInOut7 1
whismanoid 54:ba810c1d6264 880 #define HAS_digitalInOut8 1
whismanoid 54:ba810c1d6264 881 #define HAS_digitalInOut9 1
whismanoid 54:ba810c1d6264 882 // #define HAS_digitalInOut10 1
whismanoid 54:ba810c1d6264 883 // #define HAS_digitalInOut11 1
whismanoid 54:ba810c1d6264 884 // #define HAS_digitalInOut12 1
whismanoid 54:ba810c1d6264 885 // #define HAS_digitalInOut13 1
whismanoid 54:ba810c1d6264 886 // #define HAS_digitalInOut14 1
whismanoid 54:ba810c1d6264 887 // #define HAS_digitalInOut15 1
whismanoid 54:ba810c1d6264 888 #if HAS_digitalInOut0
whismanoid 54:ba810c1d6264 889 DigitalInOut digitalInOut0(p5, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.9/I2STX_SDA/MOSI1/MAT2.3
whismanoid 54:ba810c1d6264 890 #endif
whismanoid 54:ba810c1d6264 891 #if HAS_digitalInOut1
whismanoid 54:ba810c1d6264 892 DigitalInOut digitalInOut1(p6, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.8/I2STX_WS/MISO1/MAT2.2
whismanoid 54:ba810c1d6264 893 #endif
whismanoid 54:ba810c1d6264 894 #if HAS_digitalInOut2
whismanoid 54:ba810c1d6264 895 DigitalInOut digitalInOut2(p7, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.7/I2STX_CLK/SCK1/MAT2.1
whismanoid 54:ba810c1d6264 896 #endif
whismanoid 54:ba810c1d6264 897 #if HAS_digitalInOut3
whismanoid 54:ba810c1d6264 898 DigitalInOut digitalInOut3(p8, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.6/I2SRX_SDA/SSEL1/MAT2.0
whismanoid 54:ba810c1d6264 899 #endif
whismanoid 54:ba810c1d6264 900 #if HAS_digitalInOut4
whismanoid 54:ba810c1d6264 901 DigitalInOut digitalInOut4(p9, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.0/CAN_RX1/TXD3/SDA1
whismanoid 54:ba810c1d6264 902 #endif
whismanoid 54:ba810c1d6264 903 #if HAS_digitalInOut5
whismanoid 54:ba810c1d6264 904 DigitalInOut digitalInOut5(p10, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.1/CAN_TX1/RXD3/SCL1
whismanoid 54:ba810c1d6264 905 #endif
whismanoid 54:ba810c1d6264 906 #if HAS_digitalInOut6
whismanoid 54:ba810c1d6264 907 DigitalInOut digitalInOut6(p11, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.18/DCD1/MOSI0/MOSI1
whismanoid 54:ba810c1d6264 908 #endif
whismanoid 54:ba810c1d6264 909 #if HAS_digitalInOut7
whismanoid 54:ba810c1d6264 910 DigitalInOut digitalInOut7(p12, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.17/CTS1/MISO0/MISO
whismanoid 54:ba810c1d6264 911 #endif
whismanoid 54:ba810c1d6264 912 #if HAS_digitalInOut8
whismanoid 54:ba810c1d6264 913 DigitalInOut digitalInOut8(p13, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.15/TXD1/SCK0/SCK
whismanoid 54:ba810c1d6264 914 #endif
whismanoid 54:ba810c1d6264 915 #if HAS_digitalInOut9
whismanoid 54:ba810c1d6264 916 DigitalInOut digitalInOut9(p14, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.16/RXD1/SSEL0/SSEL
whismanoid 54:ba810c1d6264 917 #endif
whismanoid 54:ba810c1d6264 918 //
whismanoid 54:ba810c1d6264 919 // these pins support analog input analogIn0 .. analogIn5
whismanoid 54:ba810c1d6264 920 //DigitalInOut digitalInOut_(p15, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.23/AD0.0/I2SRX_CLK/CAP3.0
whismanoid 54:ba810c1d6264 921 //DigitalInOut digitalInOut_(p16, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.24/AD0.1/I2SRX_WS/CAP3.1
whismanoid 54:ba810c1d6264 922 //DigitalInOut digitalInOut_(p17, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.25/AD0.2/I2SRX_SDA/TXD3
whismanoid 54:ba810c1d6264 923 //DigitalInOut digitalInOut_(p18, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.26/AD0.3/AOUT/RXD3
whismanoid 54:ba810c1d6264 924 //DigitalInOut digitalInOut_(p19, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P1.30/VBUS/AD0.4
whismanoid 54:ba810c1d6264 925 //DigitalInOut digitalInOut_(p20, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P1.31/SCK1/AD0.5
whismanoid 54:ba810c1d6264 926 //
whismanoid 54:ba810c1d6264 927 // these pins support PWM pwmDriver1 .. pwmDriver6
whismanoid 54:ba810c1d6264 928 //DigitalInOut digitalInOut_(p21, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P2.5/PWM1.6/DTR1/TRACEDATA0
whismanoid 54:ba810c1d6264 929 //DigitalInOut digitalInOut_(p22, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P2.4/PWM1.5/DSR1/TRACEDATA1
whismanoid 54:ba810c1d6264 930 //DigitalInOut digitalInOut_(p23, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P2.3/PWM1.4/DCD1/TRACEDATA2
whismanoid 54:ba810c1d6264 931 //DigitalInOut digitalInOut_(p24, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P2.2/PWM1.3/CTS1/TRACEDATA3
whismanoid 54:ba810c1d6264 932 //DigitalInOut digitalInOut_(p25, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P2.1/PWM1.2/RXD1
whismanoid 54:ba810c1d6264 933 //DigitalInOut digitalInOut_(p26, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P2.0/PWM1.1/TXD1/TRACECLK
whismanoid 54:ba810c1d6264 934 //
whismanoid 54:ba810c1d6264 935 // these could be additional digitalInOut pins
whismanoid 54:ba810c1d6264 936 #if HAS_digitalInOut10
whismanoid 54:ba810c1d6264 937 DigitalInOut digitalInOut10(p27, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.11/RXD2/SCL2/MAT3.1
whismanoid 54:ba810c1d6264 938 #endif
whismanoid 54:ba810c1d6264 939 #if HAS_digitalInOut11
whismanoid 54:ba810c1d6264 940 DigitalInOut digitalInOut11(p28, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.10/TXD2/SDA2/MAT3.0
whismanoid 54:ba810c1d6264 941 #endif
whismanoid 54:ba810c1d6264 942 #if HAS_digitalInOut12
whismanoid 54:ba810c1d6264 943 DigitalInOut digitalInOut12(p29, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.5/I2SRX_WS/CAN_TX2/CAP2.1
whismanoid 54:ba810c1d6264 944 #endif
whismanoid 54:ba810c1d6264 945 #if HAS_digitalInOut13
whismanoid 54:ba810c1d6264 946 DigitalInOut digitalInOut13(p30, PIN_INPUT, PullUp, 1); // TARGET_LPC1768 P0.4/I2SRX_CLK/CAN_RX2/CAP2.0
whismanoid 54:ba810c1d6264 947 #endif
whismanoid 54:ba810c1d6264 948 #if HAS_digitalInOut14
whismanoid 54:ba810c1d6264 949 DigitalInOut digitalInOut14(___, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 950 #endif
whismanoid 54:ba810c1d6264 951 #if HAS_digitalInOut15
whismanoid 54:ba810c1d6264 952 DigitalInOut digitalInOut15(___, PIN_INPUT, PullUp, 1);
whismanoid 54:ba810c1d6264 953 #endif
whismanoid 54:ba810c1d6264 954 #else
whismanoid 54:ba810c1d6264 955 // unknown target
whismanoid 54:ba810c1d6264 956 #endif
whismanoid 54:ba810c1d6264 957 // uncrustify-0.66.1 *INDENT-ON*
whismanoid 54:ba810c1d6264 958 #if HAS_digitalInOut0 || HAS_digitalInOut1 \
whismanoid 54:ba810c1d6264 959 || HAS_digitalInOut2 || HAS_digitalInOut3 \
whismanoid 54:ba810c1d6264 960 || HAS_digitalInOut4 || HAS_digitalInOut5 \
whismanoid 54:ba810c1d6264 961 || HAS_digitalInOut6 || HAS_digitalInOut7 \
whismanoid 54:ba810c1d6264 962 || HAS_digitalInOut8 || HAS_digitalInOut9 \
whismanoid 54:ba810c1d6264 963 || HAS_digitalInOut10 || HAS_digitalInOut11 \
whismanoid 54:ba810c1d6264 964 || HAS_digitalInOut12 || HAS_digitalInOut13 \
whismanoid 54:ba810c1d6264 965 || HAS_digitalInOut14 || HAS_digitalInOut15 \
whismanoid 54:ba810c1d6264 966 || HAS_digitalInOut16 || HAS_digitalInOut17
whismanoid 54:ba810c1d6264 967 #define HAS_digitalInOuts 1
whismanoid 57:dc118969c848 968 #else
whismanoid 57:dc118969c848 969 #warning "Note: There are no digitalInOut resources defined"
whismanoid 54:ba810c1d6264 970 #endif
whismanoid 52:d3fb6f1722bf 971
whismanoid 52:d3fb6f1722bf 972 // uncrustify-0.66.1 *INDENT-OFF*
whismanoid 52:d3fb6f1722bf 973 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 974 // Declare the AnalogIn driver
whismanoid 52:d3fb6f1722bf 975 // Optional analogIn support. If there is only one it should be analogIn1.
whismanoid 52:d3fb6f1722bf 976 // A) analog input
whismanoid 52:d3fb6f1722bf 977 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 978 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 979 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 980 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 981 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 982 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 983 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 984 #define HAS_analogIn6 1
whismanoid 52:d3fb6f1722bf 985 #define HAS_analogIn7 1
whismanoid 52:d3fb6f1722bf 986 #define HAS_analogIn8 1
whismanoid 52:d3fb6f1722bf 987 #define HAS_analogIn9 1
whismanoid 52:d3fb6f1722bf 988 // #define HAS_analogIn10 0
whismanoid 52:d3fb6f1722bf 989 // #define HAS_analogIn11 0
whismanoid 52:d3fb6f1722bf 990 // #define HAS_analogIn12 0
whismanoid 52:d3fb6f1722bf 991 // #define HAS_analogIn13 0
whismanoid 52:d3fb6f1722bf 992 // #define HAS_analogIn14 0
whismanoid 52:d3fb6f1722bf 993 // #define HAS_analogIn15 0
whismanoid 52:d3fb6f1722bf 994 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 995 AnalogIn analogIn0(AIN_0); // TARGET_MAX32630 J1.5 AIN_0 = AIN0 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 996 #endif
whismanoid 52:d3fb6f1722bf 997 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 998 AnalogIn analogIn1(AIN_1); // TARGET_MAX32630 J1.6 AIN_1 = AIN1 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 999 #endif
whismanoid 52:d3fb6f1722bf 1000 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1001 AnalogIn analogIn2(AIN_2); // TARGET_MAX32630 J1.7 AIN_2 = AIN2 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1002 #endif
whismanoid 52:d3fb6f1722bf 1003 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1004 AnalogIn analogIn3(AIN_3); // TARGET_MAX32630 J1.8 AIN_3 = AIN3 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1005 #endif
whismanoid 52:d3fb6f1722bf 1006 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1007 AnalogIn analogIn4(AIN_4); // TARGET_MAX32630 J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1008 #endif
whismanoid 52:d3fb6f1722bf 1009 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1010 AnalogIn analogIn5(AIN_5); // TARGET_MAX32630 J1.6 AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1011 #endif
whismanoid 52:d3fb6f1722bf 1012 #if HAS_analogIn6
whismanoid 52:d3fb6f1722bf 1013 AnalogIn analogIn6(AIN_6); // TARGET_MAX32630 AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1014 #endif
whismanoid 52:d3fb6f1722bf 1015 #if HAS_analogIn7
whismanoid 52:d3fb6f1722bf 1016 AnalogIn analogIn7(AIN_7); // TARGET_MAX32630 AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1017 #endif
whismanoid 52:d3fb6f1722bf 1018 #if HAS_analogIn8
whismanoid 52:d3fb6f1722bf 1019 AnalogIn analogIn8(AIN_8); // TARGET_MAX32630 AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1020 #endif
whismanoid 52:d3fb6f1722bf 1021 #if HAS_analogIn9
whismanoid 52:d3fb6f1722bf 1022 AnalogIn analogIn9(AIN_9); // TARGET_MAX32630 AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 1023 #endif
whismanoid 52:d3fb6f1722bf 1024 #if HAS_analogIn10
whismanoid 52:d3fb6f1722bf 1025 AnalogIn analogIn10(____); // TARGET_MAX32630 AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 1026 #endif
whismanoid 52:d3fb6f1722bf 1027 #if HAS_analogIn11
whismanoid 52:d3fb6f1722bf 1028 AnalogIn analogIn11(____); // TARGET_MAX32630 AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1029 #endif
whismanoid 52:d3fb6f1722bf 1030 #if HAS_analogIn12
whismanoid 52:d3fb6f1722bf 1031 AnalogIn analogIn12(____); // TARGET_MAX32630 AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1032 #endif
whismanoid 52:d3fb6f1722bf 1033 #if HAS_analogIn13
whismanoid 52:d3fb6f1722bf 1034 AnalogIn analogIn13(____);
whismanoid 52:d3fb6f1722bf 1035 #endif
whismanoid 52:d3fb6f1722bf 1036 #if HAS_analogIn14
whismanoid 52:d3fb6f1722bf 1037 AnalogIn analogIn14(____);
whismanoid 52:d3fb6f1722bf 1038 #endif
whismanoid 52:d3fb6f1722bf 1039 #if HAS_analogIn15
whismanoid 52:d3fb6f1722bf 1040 AnalogIn analogIn15(____);
whismanoid 52:d3fb6f1722bf 1041 #endif
whismanoid 52:d3fb6f1722bf 1042 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1043 #elif defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 1044 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1045 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1046 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1047 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1048 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1049 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1050 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1051 AnalogIn analogIn0(AIN_0); // TARGET_MAX32630 J1.5 AIN_0 = AIN0 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1052 #endif
whismanoid 52:d3fb6f1722bf 1053 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1054 AnalogIn analogIn1(AIN_1); // TARGET_MAX32630 J1.6 AIN_1 = AIN1 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1055 #endif
whismanoid 52:d3fb6f1722bf 1056 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1057 AnalogIn analogIn2(AIN_2); // TARGET_MAX32630 J1.7 AIN_2 = AIN2 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1058 #endif
whismanoid 52:d3fb6f1722bf 1059 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1060 AnalogIn analogIn3(AIN_3); // TARGET_MAX32630 J1.8 AIN_3 = AIN3 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1061 #endif
whismanoid 52:d3fb6f1722bf 1062 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1063 AnalogIn analogIn4(AIN_4); // TARGET_MAX32630 J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1064 #endif
whismanoid 52:d3fb6f1722bf 1065 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1066 AnalogIn analogIn5(AIN_5); // TARGET_MAX32630 J1.6 AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1067 #endif
whismanoid 52:d3fb6f1722bf 1068 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1069 #elif defined(TARGET_MAX32620FTHR)
whismanoid 52:d3fb6f1722bf 1070 #warning "TARGET_MAX32620FTHR not previously tested; need to verify analogIn0..."
whismanoid 52:d3fb6f1722bf 1071 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1072 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1073 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1074 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1075 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1076 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1077 #define HAS_analogIn6 1
whismanoid 52:d3fb6f1722bf 1078 #define HAS_analogIn7 1
whismanoid 52:d3fb6f1722bf 1079 #define HAS_analogIn8 1
whismanoid 52:d3fb6f1722bf 1080 #define HAS_analogIn9 1
whismanoid 52:d3fb6f1722bf 1081 // #define HAS_analogIn10 0
whismanoid 52:d3fb6f1722bf 1082 // #define HAS_analogIn11 0
whismanoid 52:d3fb6f1722bf 1083 // #define HAS_analogIn12 0
whismanoid 52:d3fb6f1722bf 1084 // #define HAS_analogIn13 0
whismanoid 52:d3fb6f1722bf 1085 // #define HAS_analogIn14 0
whismanoid 52:d3fb6f1722bf 1086 // #define HAS_analogIn15 0
whismanoid 52:d3fb6f1722bf 1087 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1088 AnalogIn analogIn0(AIN_0); // TARGET_MAX32620FTHR J1.5 AIN_0 = AIN0 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1089 #endif
whismanoid 52:d3fb6f1722bf 1090 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1091 AnalogIn analogIn1(AIN_1); // TARGET_MAX32620FTHR J1.6 AIN_1 = AIN1 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1092 #endif
whismanoid 52:d3fb6f1722bf 1093 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1094 AnalogIn analogIn2(AIN_2); // TARGET_MAX32620FTHR J1.7 AIN_2 = AIN2 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1095 #endif
whismanoid 52:d3fb6f1722bf 1096 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1097 AnalogIn analogIn3(AIN_3); // TARGET_MAX32620FTHR J1.8 AIN_3 = AIN3 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1098 #endif
whismanoid 52:d3fb6f1722bf 1099 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1100 AnalogIn analogIn4(AIN_4); // TARGET_MAX32620FTHR J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1101 #endif
whismanoid 52:d3fb6f1722bf 1102 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1103 AnalogIn analogIn5(AIN_5); // TARGET_MAX32620FTHR J1.6 AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1104 #endif
whismanoid 52:d3fb6f1722bf 1105 #if HAS_analogIn6
whismanoid 52:d3fb6f1722bf 1106 AnalogIn analogIn6(AIN_6); // TARGET_MAX32620FTHR AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1107 #endif
whismanoid 52:d3fb6f1722bf 1108 #if HAS_analogIn7
whismanoid 52:d3fb6f1722bf 1109 AnalogIn analogIn7(AIN_7); // TARGET_MAX32620FTHR AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1110 #endif
whismanoid 52:d3fb6f1722bf 1111 #if HAS_analogIn8
whismanoid 52:d3fb6f1722bf 1112 AnalogIn analogIn8(AIN_8); // TARGET_MAX32620FTHR AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1113 #endif
whismanoid 52:d3fb6f1722bf 1114 #if HAS_analogIn9
whismanoid 52:d3fb6f1722bf 1115 AnalogIn analogIn9(AIN_9); // TARGET_MAX32620FTHR AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 1116 #endif
whismanoid 52:d3fb6f1722bf 1117 #if HAS_analogIn10
whismanoid 52:d3fb6f1722bf 1118 AnalogIn analogIn10(____); // TARGET_MAX32620FTHR AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 1119 #endif
whismanoid 52:d3fb6f1722bf 1120 #if HAS_analogIn11
whismanoid 52:d3fb6f1722bf 1121 AnalogIn analogIn11(____); // TARGET_MAX32620FTHR AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1122 #endif
whismanoid 52:d3fb6f1722bf 1123 #if HAS_analogIn12
whismanoid 52:d3fb6f1722bf 1124 AnalogIn analogIn12(____); // TARGET_MAX32620FTHR AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1125 #endif
whismanoid 52:d3fb6f1722bf 1126 #if HAS_analogIn13
whismanoid 52:d3fb6f1722bf 1127 AnalogIn analogIn13(____);
whismanoid 52:d3fb6f1722bf 1128 #endif
whismanoid 52:d3fb6f1722bf 1129 #if HAS_analogIn14
whismanoid 52:d3fb6f1722bf 1130 AnalogIn analogIn14(____);
whismanoid 52:d3fb6f1722bf 1131 #endif
whismanoid 52:d3fb6f1722bf 1132 #if HAS_analogIn15
whismanoid 52:d3fb6f1722bf 1133 AnalogIn analogIn15(____);
whismanoid 52:d3fb6f1722bf 1134 #endif
whismanoid 52:d3fb6f1722bf 1135 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1136 #elif defined(TARGET_MAX32625PICO)
whismanoid 52:d3fb6f1722bf 1137 #warning "TARGET_MAX32625PICO not previously tested; need to verify analogIn0..."
whismanoid 52:d3fb6f1722bf 1138 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1139 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1140 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1141 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1142 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1143 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1144 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1145 AnalogIn analogIn0(AIN_0); // TARGET_MAX32630 J1.5 AIN_0 = AIN0 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1146 #endif
whismanoid 52:d3fb6f1722bf 1147 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1148 AnalogIn analogIn1(AIN_1); // TARGET_MAX32630 J1.6 AIN_1 = AIN1 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1149 #endif
whismanoid 52:d3fb6f1722bf 1150 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1151 AnalogIn analogIn2(AIN_2); // TARGET_MAX32630 J1.7 AIN_2 = AIN2 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1152 #endif
whismanoid 52:d3fb6f1722bf 1153 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1154 AnalogIn analogIn3(AIN_3); // TARGET_MAX32630 J1.8 AIN_3 = AIN3 pin fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1155 #endif
whismanoid 52:d3fb6f1722bf 1156 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1157 AnalogIn analogIn4(AIN_4); // TARGET_MAX32630 J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1158 #endif
whismanoid 52:d3fb6f1722bf 1159 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1160 AnalogIn analogIn5(AIN_5); // TARGET_MAX32630 J1.6 AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1161 #endif
whismanoid 52:d3fb6f1722bf 1162 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1163 #elif defined(TARGET_MAX32600)
whismanoid 52:d3fb6f1722bf 1164 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1165 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1166 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1167 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1168 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1169 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1170 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1171 AnalogIn analogIn0(A0);
whismanoid 52:d3fb6f1722bf 1172 #endif
whismanoid 52:d3fb6f1722bf 1173 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1174 AnalogIn analogIn1(A1);
whismanoid 52:d3fb6f1722bf 1175 #endif
whismanoid 52:d3fb6f1722bf 1176 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1177 AnalogIn analogIn2(A2);
whismanoid 52:d3fb6f1722bf 1178 #endif
whismanoid 52:d3fb6f1722bf 1179 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1180 AnalogIn analogIn3(A3);
whismanoid 52:d3fb6f1722bf 1181 #endif
whismanoid 52:d3fb6f1722bf 1182 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1183 AnalogIn analogIn4(A4);
whismanoid 52:d3fb6f1722bf 1184 #endif
whismanoid 52:d3fb6f1722bf 1185 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1186 AnalogIn analogIn5(A5);
whismanoid 52:d3fb6f1722bf 1187 #endif
whismanoid 52:d3fb6f1722bf 1188 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1189 #elif defined(TARGET_NUCLEO_F446RE)
whismanoid 52:d3fb6f1722bf 1190 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1191 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1192 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1193 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1194 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1195 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1196 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1197 AnalogIn analogIn0(A0);
whismanoid 52:d3fb6f1722bf 1198 #endif
whismanoid 52:d3fb6f1722bf 1199 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1200 AnalogIn analogIn1(A1);
whismanoid 52:d3fb6f1722bf 1201 #endif
whismanoid 52:d3fb6f1722bf 1202 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1203 AnalogIn analogIn2(A2);
whismanoid 52:d3fb6f1722bf 1204 #endif
whismanoid 52:d3fb6f1722bf 1205 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1206 AnalogIn analogIn3(A3);
whismanoid 52:d3fb6f1722bf 1207 #endif
whismanoid 52:d3fb6f1722bf 1208 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1209 AnalogIn analogIn4(A4);
whismanoid 52:d3fb6f1722bf 1210 #endif
whismanoid 52:d3fb6f1722bf 1211 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1212 AnalogIn analogIn5(A5);
whismanoid 52:d3fb6f1722bf 1213 #endif
whismanoid 52:d3fb6f1722bf 1214 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1215 #elif defined(TARGET_NUCLEO_F401RE)
whismanoid 52:d3fb6f1722bf 1216 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1217 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1218 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1219 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1220 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1221 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1222 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1223 AnalogIn analogIn0(A0);
whismanoid 52:d3fb6f1722bf 1224 #endif
whismanoid 52:d3fb6f1722bf 1225 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1226 AnalogIn analogIn1(A1);
whismanoid 52:d3fb6f1722bf 1227 #endif
whismanoid 52:d3fb6f1722bf 1228 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1229 AnalogIn analogIn2(A2);
whismanoid 52:d3fb6f1722bf 1230 #endif
whismanoid 52:d3fb6f1722bf 1231 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1232 AnalogIn analogIn3(A3);
whismanoid 52:d3fb6f1722bf 1233 #endif
whismanoid 52:d3fb6f1722bf 1234 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1235 AnalogIn analogIn4(A4);
whismanoid 52:d3fb6f1722bf 1236 #endif
whismanoid 52:d3fb6f1722bf 1237 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1238 AnalogIn analogIn5(A5);
whismanoid 52:d3fb6f1722bf 1239 #endif
whismanoid 52:d3fb6f1722bf 1240 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1241 // TODO1: TARGET=MAX32625MBED ARM Cortex-M4F 96MHz 512kB Flash 160kB SRAM
whismanoid 52:d3fb6f1722bf 1242 #elif defined(TARGET_LPC1768)
whismanoid 52:d3fb6f1722bf 1243 #define HAS_analogIn0 1
whismanoid 52:d3fb6f1722bf 1244 #define HAS_analogIn1 1
whismanoid 52:d3fb6f1722bf 1245 #define HAS_analogIn2 1
whismanoid 52:d3fb6f1722bf 1246 #define HAS_analogIn3 1
whismanoid 52:d3fb6f1722bf 1247 #define HAS_analogIn4 1
whismanoid 52:d3fb6f1722bf 1248 #define HAS_analogIn5 1
whismanoid 52:d3fb6f1722bf 1249 // #define HAS_analogIn6 1
whismanoid 52:d3fb6f1722bf 1250 // #define HAS_analogIn7 1
whismanoid 52:d3fb6f1722bf 1251 // #define HAS_analogIn8 1
whismanoid 52:d3fb6f1722bf 1252 // #define HAS_analogIn9 1
whismanoid 52:d3fb6f1722bf 1253 // #define HAS_analogIn10 1
whismanoid 52:d3fb6f1722bf 1254 // #define HAS_analogIn11 1
whismanoid 52:d3fb6f1722bf 1255 // #define HAS_analogIn12 1
whismanoid 52:d3fb6f1722bf 1256 // #define HAS_analogIn13 1
whismanoid 52:d3fb6f1722bf 1257 // #define HAS_analogIn14 1
whismanoid 52:d3fb6f1722bf 1258 // #define HAS_analogIn15 1
whismanoid 52:d3fb6f1722bf 1259 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1260 AnalogIn analogIn0(p15); // TARGET_LPC1768 P0.23/AD0.0/I2SRX_CLK/CAP3.0
whismanoid 52:d3fb6f1722bf 1261 #endif
whismanoid 52:d3fb6f1722bf 1262 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1263 AnalogIn analogIn1(p16); // TARGET_LPC1768 P0.24/AD0.1/I2SRX_WS/CAP3.1
whismanoid 52:d3fb6f1722bf 1264 #endif
whismanoid 52:d3fb6f1722bf 1265 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1266 AnalogIn analogIn2(p17); // TARGET_LPC1768 P0.25/AD0.2/I2SRX_SDA/TXD3
whismanoid 52:d3fb6f1722bf 1267 #endif
whismanoid 52:d3fb6f1722bf 1268 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1269 AnalogIn analogIn3(p18); // TARGET_LPC1768 P0.26/AD0.3/AOUT/RXD3
whismanoid 52:d3fb6f1722bf 1270 #endif
whismanoid 52:d3fb6f1722bf 1271 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1272 AnalogIn analogIn4(p19); // TARGET_LPC1768 P1.30/VBUS/AD0.4
whismanoid 52:d3fb6f1722bf 1273 #endif
whismanoid 52:d3fb6f1722bf 1274 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1275 AnalogIn analogIn5(p20); // TARGET_LPC1768 P1.31/SCK1/AD0.5
whismanoid 52:d3fb6f1722bf 1276 #endif
whismanoid 52:d3fb6f1722bf 1277 #if HAS_analogIn6
whismanoid 52:d3fb6f1722bf 1278 AnalogIn analogIn6(____);
whismanoid 52:d3fb6f1722bf 1279 #endif
whismanoid 52:d3fb6f1722bf 1280 #if HAS_analogIn7
whismanoid 52:d3fb6f1722bf 1281 AnalogIn analogIn7(____);
whismanoid 52:d3fb6f1722bf 1282 #endif
whismanoid 52:d3fb6f1722bf 1283 #if HAS_analogIn8
whismanoid 52:d3fb6f1722bf 1284 AnalogIn analogIn8(____);
whismanoid 52:d3fb6f1722bf 1285 #endif
whismanoid 52:d3fb6f1722bf 1286 #if HAS_analogIn9
whismanoid 52:d3fb6f1722bf 1287 AnalogIn analogIn9(____);
whismanoid 52:d3fb6f1722bf 1288 #endif
whismanoid 52:d3fb6f1722bf 1289 #if HAS_analogIn10
whismanoid 52:d3fb6f1722bf 1290 AnalogIn analogIn10(____);
whismanoid 52:d3fb6f1722bf 1291 #endif
whismanoid 52:d3fb6f1722bf 1292 #if HAS_analogIn11
whismanoid 52:d3fb6f1722bf 1293 AnalogIn analogIn11(____);
whismanoid 52:d3fb6f1722bf 1294 #endif
whismanoid 52:d3fb6f1722bf 1295 #if HAS_analogIn12
whismanoid 52:d3fb6f1722bf 1296 AnalogIn analogIn12(____);
whismanoid 52:d3fb6f1722bf 1297 #endif
whismanoid 52:d3fb6f1722bf 1298 #if HAS_analogIn13
whismanoid 52:d3fb6f1722bf 1299 AnalogIn analogIn13(____);
whismanoid 52:d3fb6f1722bf 1300 #endif
whismanoid 52:d3fb6f1722bf 1301 #if HAS_analogIn14
whismanoid 52:d3fb6f1722bf 1302 AnalogIn analogIn14(____);
whismanoid 52:d3fb6f1722bf 1303 #endif
whismanoid 52:d3fb6f1722bf 1304 #if HAS_analogIn15
whismanoid 52:d3fb6f1722bf 1305 AnalogIn analogIn15(____);
whismanoid 52:d3fb6f1722bf 1306 #endif
whismanoid 52:d3fb6f1722bf 1307 #else
whismanoid 52:d3fb6f1722bf 1308 // unknown target
whismanoid 52:d3fb6f1722bf 1309 #endif
whismanoid 52:d3fb6f1722bf 1310 // uncrustify-0.66.1 *INDENT-ON*
whismanoid 52:d3fb6f1722bf 1311 #if HAS_analogIn0 || HAS_analogIn1 \
whismanoid 52:d3fb6f1722bf 1312 || HAS_analogIn2 || HAS_analogIn3 \
whismanoid 52:d3fb6f1722bf 1313 || HAS_analogIn4 || HAS_analogIn5 \
whismanoid 52:d3fb6f1722bf 1314 || HAS_analogIn6 || HAS_analogIn7 \
whismanoid 52:d3fb6f1722bf 1315 || HAS_analogIn8 || HAS_analogIn9 \
whismanoid 52:d3fb6f1722bf 1316 || HAS_analogIn10 || HAS_analogIn11 \
whismanoid 52:d3fb6f1722bf 1317 || HAS_analogIn12 || HAS_analogIn13 \
whismanoid 52:d3fb6f1722bf 1318 || HAS_analogIn14 || HAS_analogIn15
whismanoid 52:d3fb6f1722bf 1319 #define HAS_analogIns 1
whismanoid 57:dc118969c848 1320 #else
whismanoid 57:dc118969c848 1321 #warning "Note: There are no analogIn resources defined"
whismanoid 52:d3fb6f1722bf 1322 #endif
whismanoid 52:d3fb6f1722bf 1323
whismanoid 54:ba810c1d6264 1324 // DigitalInOut pin resource: print the pin index names to serial
whismanoid 54:ba810c1d6264 1325 #if HAS_digitalInOuts
whismanoid 54:ba810c1d6264 1326 void list_digitalInOutPins(Stream& serialStream)
whismanoid 54:ba810c1d6264 1327 {
whismanoid 54:ba810c1d6264 1328 #if HAS_digitalInOut0
whismanoid 54:ba810c1d6264 1329 serialStream.printf(" 0");
whismanoid 54:ba810c1d6264 1330 #endif
whismanoid 54:ba810c1d6264 1331 #if HAS_digitalInOut1
whismanoid 54:ba810c1d6264 1332 serialStream.printf(" 1");
whismanoid 54:ba810c1d6264 1333 #endif
whismanoid 54:ba810c1d6264 1334 #if HAS_digitalInOut2
whismanoid 54:ba810c1d6264 1335 serialStream.printf(" 2");
whismanoid 54:ba810c1d6264 1336 #endif
whismanoid 54:ba810c1d6264 1337 #if HAS_digitalInOut3
whismanoid 54:ba810c1d6264 1338 serialStream.printf(" 3");
whismanoid 54:ba810c1d6264 1339 #endif
whismanoid 54:ba810c1d6264 1340 #if HAS_digitalInOut4
whismanoid 54:ba810c1d6264 1341 serialStream.printf(" 4");
whismanoid 54:ba810c1d6264 1342 #endif
whismanoid 54:ba810c1d6264 1343 #if HAS_digitalInOut5
whismanoid 54:ba810c1d6264 1344 serialStream.printf(" 5");
whismanoid 54:ba810c1d6264 1345 #endif
whismanoid 54:ba810c1d6264 1346 #if HAS_digitalInOut6
whismanoid 54:ba810c1d6264 1347 serialStream.printf(" 6");
whismanoid 54:ba810c1d6264 1348 #endif
whismanoid 54:ba810c1d6264 1349 #if HAS_digitalInOut7
whismanoid 54:ba810c1d6264 1350 serialStream.printf(" 7");
whismanoid 54:ba810c1d6264 1351 #endif
whismanoid 54:ba810c1d6264 1352 #if HAS_digitalInOut8
whismanoid 54:ba810c1d6264 1353 serialStream.printf(" 8");
whismanoid 54:ba810c1d6264 1354 #endif
whismanoid 54:ba810c1d6264 1355 #if HAS_digitalInOut9
whismanoid 54:ba810c1d6264 1356 serialStream.printf(" 9");
whismanoid 54:ba810c1d6264 1357 #endif
whismanoid 54:ba810c1d6264 1358 #if HAS_digitalInOut10
whismanoid 54:ba810c1d6264 1359 serialStream.printf(" 10");
whismanoid 54:ba810c1d6264 1360 #endif
whismanoid 54:ba810c1d6264 1361 #if HAS_digitalInOut11
whismanoid 54:ba810c1d6264 1362 serialStream.printf(" 11");
whismanoid 54:ba810c1d6264 1363 #endif
whismanoid 54:ba810c1d6264 1364 #if HAS_digitalInOut12
whismanoid 54:ba810c1d6264 1365 serialStream.printf(" 12");
whismanoid 54:ba810c1d6264 1366 #endif
whismanoid 54:ba810c1d6264 1367 #if HAS_digitalInOut13
whismanoid 54:ba810c1d6264 1368 serialStream.printf(" 13");
whismanoid 54:ba810c1d6264 1369 #endif
whismanoid 54:ba810c1d6264 1370 #if HAS_digitalInOut14
whismanoid 54:ba810c1d6264 1371 serialStream.printf(" 14");
whismanoid 54:ba810c1d6264 1372 #endif
whismanoid 54:ba810c1d6264 1373 #if HAS_digitalInOut15
whismanoid 54:ba810c1d6264 1374 serialStream.printf(" 15");
whismanoid 54:ba810c1d6264 1375 #endif
whismanoid 54:ba810c1d6264 1376 #if HAS_digitalInOut16
whismanoid 54:ba810c1d6264 1377 serialStream.printf(" 16");
whismanoid 54:ba810c1d6264 1378 #endif
whismanoid 54:ba810c1d6264 1379 #if HAS_digitalInOut17
whismanoid 54:ba810c1d6264 1380 serialStream.printf(" 17");
whismanoid 54:ba810c1d6264 1381 #endif
whismanoid 54:ba810c1d6264 1382 }
whismanoid 54:ba810c1d6264 1383 #endif
whismanoid 54:ba810c1d6264 1384
whismanoid 54:ba810c1d6264 1385
whismanoid 54:ba810c1d6264 1386 // DigitalInOut pin resource: search index
whismanoid 54:ba810c1d6264 1387 #if HAS_digitalInOuts
whismanoid 54:ba810c1d6264 1388 DigitalInOut& find_digitalInOutPin(int cPinIndex)
whismanoid 54:ba810c1d6264 1389 {
whismanoid 54:ba810c1d6264 1390 switch (cPinIndex)
whismanoid 54:ba810c1d6264 1391 {
whismanoid 54:ba810c1d6264 1392 default: // default to the first defined digitalInOut pin
whismanoid 54:ba810c1d6264 1393 #if HAS_digitalInOut0
whismanoid 54:ba810c1d6264 1394 case '0': case 0x00: return digitalInOut0;
whismanoid 54:ba810c1d6264 1395 #endif
whismanoid 54:ba810c1d6264 1396 #if HAS_digitalInOut1
whismanoid 54:ba810c1d6264 1397 case '1': case 0x01: return digitalInOut1;
whismanoid 54:ba810c1d6264 1398 #endif
whismanoid 54:ba810c1d6264 1399 #if HAS_digitalInOut2
whismanoid 54:ba810c1d6264 1400 case '2': case 0x02: return digitalInOut2;
whismanoid 54:ba810c1d6264 1401 #endif
whismanoid 54:ba810c1d6264 1402 #if HAS_digitalInOut3
whismanoid 54:ba810c1d6264 1403 case '3': case 0x03: return digitalInOut3;
whismanoid 54:ba810c1d6264 1404 #endif
whismanoid 54:ba810c1d6264 1405 #if HAS_digitalInOut4
whismanoid 54:ba810c1d6264 1406 case '4': case 0x04: return digitalInOut4;
whismanoid 54:ba810c1d6264 1407 #endif
whismanoid 54:ba810c1d6264 1408 #if HAS_digitalInOut5
whismanoid 54:ba810c1d6264 1409 case '5': case 0x05: return digitalInOut5;
whismanoid 54:ba810c1d6264 1410 #endif
whismanoid 54:ba810c1d6264 1411 #if HAS_digitalInOut6
whismanoid 54:ba810c1d6264 1412 case '6': case 0x06: return digitalInOut6;
whismanoid 54:ba810c1d6264 1413 #endif
whismanoid 54:ba810c1d6264 1414 #if HAS_digitalInOut7
whismanoid 54:ba810c1d6264 1415 case '7': case 0x07: return digitalInOut7;
whismanoid 54:ba810c1d6264 1416 #endif
whismanoid 54:ba810c1d6264 1417 #if HAS_digitalInOut8
whismanoid 54:ba810c1d6264 1418 case '8': case 0x08: return digitalInOut8;
whismanoid 54:ba810c1d6264 1419 #endif
whismanoid 54:ba810c1d6264 1420 #if HAS_digitalInOut9
whismanoid 54:ba810c1d6264 1421 case '9': case 0x09: return digitalInOut9;
whismanoid 54:ba810c1d6264 1422 #endif
whismanoid 54:ba810c1d6264 1423 #if HAS_digitalInOut10
whismanoid 54:ba810c1d6264 1424 case 'a': case 0x0a: return digitalInOut10;
whismanoid 54:ba810c1d6264 1425 #endif
whismanoid 54:ba810c1d6264 1426 #if HAS_digitalInOut11
whismanoid 54:ba810c1d6264 1427 case 'b': case 0x0b: return digitalInOut11;
whismanoid 54:ba810c1d6264 1428 #endif
whismanoid 54:ba810c1d6264 1429 #if HAS_digitalInOut12
whismanoid 54:ba810c1d6264 1430 case 'c': case 0x0c: return digitalInOut12;
whismanoid 54:ba810c1d6264 1431 #endif
whismanoid 54:ba810c1d6264 1432 #if HAS_digitalInOut13
whismanoid 54:ba810c1d6264 1433 case 'd': case 0x0d: return digitalInOut13;
whismanoid 54:ba810c1d6264 1434 #endif
whismanoid 54:ba810c1d6264 1435 #if HAS_digitalInOut14
whismanoid 54:ba810c1d6264 1436 case 'e': case 0x0e: return digitalInOut14;
whismanoid 54:ba810c1d6264 1437 #endif
whismanoid 54:ba810c1d6264 1438 #if HAS_digitalInOut15
whismanoid 54:ba810c1d6264 1439 case 'f': case 0x0f: return digitalInOut15;
whismanoid 54:ba810c1d6264 1440 #endif
whismanoid 54:ba810c1d6264 1441 #if HAS_digitalInOut16
whismanoid 54:ba810c1d6264 1442 case 'g': case 0x10: return digitalInOut16;
whismanoid 54:ba810c1d6264 1443 #endif
whismanoid 54:ba810c1d6264 1444 #if HAS_digitalInOut17
whismanoid 54:ba810c1d6264 1445 case 'h': case 0x11: return digitalInOut17;
whismanoid 54:ba810c1d6264 1446 #endif
whismanoid 54:ba810c1d6264 1447 }
whismanoid 54:ba810c1d6264 1448 }
whismanoid 54:ba810c1d6264 1449 #endif
whismanoid 52:d3fb6f1722bf 1450
whismanoid 52:d3fb6f1722bf 1451
whismanoid 52:d3fb6f1722bf 1452 // AnalogIn pin resource: search index
whismanoid 52:d3fb6f1722bf 1453 #if HAS_analogIns
whismanoid 52:d3fb6f1722bf 1454 AnalogIn& find_analogInPin(int cPinIndex)
whismanoid 52:d3fb6f1722bf 1455 {
whismanoid 52:d3fb6f1722bf 1456 switch (cPinIndex)
whismanoid 52:d3fb6f1722bf 1457 {
whismanoid 52:d3fb6f1722bf 1458 default: // default to the first defined analogIn pin
whismanoid 52:d3fb6f1722bf 1459 #if HAS_analogIn0
whismanoid 52:d3fb6f1722bf 1460 case '0': case 0x00: return analogIn0;
whismanoid 52:d3fb6f1722bf 1461 #endif
whismanoid 52:d3fb6f1722bf 1462 #if HAS_analogIn1
whismanoid 52:d3fb6f1722bf 1463 case '1': case 0x01: return analogIn1;
whismanoid 52:d3fb6f1722bf 1464 #endif
whismanoid 52:d3fb6f1722bf 1465 #if HAS_analogIn2
whismanoid 52:d3fb6f1722bf 1466 case '2': case 0x02: return analogIn2;
whismanoid 52:d3fb6f1722bf 1467 #endif
whismanoid 52:d3fb6f1722bf 1468 #if HAS_analogIn3
whismanoid 52:d3fb6f1722bf 1469 case '3': case 0x03: return analogIn3;
whismanoid 52:d3fb6f1722bf 1470 #endif
whismanoid 52:d3fb6f1722bf 1471 #if HAS_analogIn4
whismanoid 52:d3fb6f1722bf 1472 case '4': case 0x04: return analogIn4;
whismanoid 52:d3fb6f1722bf 1473 #endif
whismanoid 52:d3fb6f1722bf 1474 #if HAS_analogIn5
whismanoid 52:d3fb6f1722bf 1475 case '5': case 0x05: return analogIn5;
whismanoid 52:d3fb6f1722bf 1476 #endif
whismanoid 52:d3fb6f1722bf 1477 #if HAS_analogIn6
whismanoid 52:d3fb6f1722bf 1478 case '6': case 0x06: return analogIn6;
whismanoid 52:d3fb6f1722bf 1479 #endif
whismanoid 52:d3fb6f1722bf 1480 #if HAS_analogIn7
whismanoid 52:d3fb6f1722bf 1481 case '7': case 0x07: return analogIn7;
whismanoid 52:d3fb6f1722bf 1482 #endif
whismanoid 52:d3fb6f1722bf 1483 #if HAS_analogIn8
whismanoid 52:d3fb6f1722bf 1484 case '8': case 0x08: return analogIn8;
whismanoid 52:d3fb6f1722bf 1485 #endif
whismanoid 52:d3fb6f1722bf 1486 #if HAS_analogIn9
whismanoid 52:d3fb6f1722bf 1487 case '9': case 0x09: return analogIn9;
whismanoid 52:d3fb6f1722bf 1488 #endif
whismanoid 52:d3fb6f1722bf 1489 #if HAS_analogIn10
whismanoid 52:d3fb6f1722bf 1490 case 'a': case 0x0a: return analogIn10;
whismanoid 52:d3fb6f1722bf 1491 #endif
whismanoid 52:d3fb6f1722bf 1492 #if HAS_analogIn11
whismanoid 52:d3fb6f1722bf 1493 case 'b': case 0x0b: return analogIn11;
whismanoid 52:d3fb6f1722bf 1494 #endif
whismanoid 52:d3fb6f1722bf 1495 #if HAS_analogIn12
whismanoid 52:d3fb6f1722bf 1496 case 'c': case 0x0c: return analogIn12;
whismanoid 52:d3fb6f1722bf 1497 #endif
whismanoid 52:d3fb6f1722bf 1498 #if HAS_analogIn13
whismanoid 52:d3fb6f1722bf 1499 case 'd': case 0x0d: return analogIn13;
whismanoid 52:d3fb6f1722bf 1500 #endif
whismanoid 52:d3fb6f1722bf 1501 #if HAS_analogIn14
whismanoid 52:d3fb6f1722bf 1502 case 'e': case 0x0e: return analogIn14;
whismanoid 52:d3fb6f1722bf 1503 #endif
whismanoid 52:d3fb6f1722bf 1504 #if HAS_analogIn15
whismanoid 52:d3fb6f1722bf 1505 case 'f': case 0x0f: return analogIn15;
whismanoid 52:d3fb6f1722bf 1506 #endif
whismanoid 52:d3fb6f1722bf 1507 }
whismanoid 52:d3fb6f1722bf 1508 }
whismanoid 52:d3fb6f1722bf 1509 #endif
whismanoid 52:d3fb6f1722bf 1510
whismanoid 52:d3fb6f1722bf 1511 #if HAS_analogIns
whismanoid 52:d3fb6f1722bf 1512 const float analogInPin_fullScaleVoltage[] = {
whismanoid 52:d3fb6f1722bf 1513 # if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 1514 ADC_FULL_SCALE_VOLTAGE, // analogIn0
whismanoid 52:d3fb6f1722bf 1515 ADC_FULL_SCALE_VOLTAGE, // analogIn1
whismanoid 52:d3fb6f1722bf 1516 ADC_FULL_SCALE_VOLTAGE, // analogIn2
whismanoid 52:d3fb6f1722bf 1517 ADC_FULL_SCALE_VOLTAGE, // analogIn3
whismanoid 52:d3fb6f1722bf 1518 ADC_FULL_SCALE_VOLTAGE * 5.0f, // analogIn4 // AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1519 ADC_FULL_SCALE_VOLTAGE * 5.0f, // analogIn4 // AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1520 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn6 // AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1521 ADC_FULL_SCALE_VOLTAGE, // analogIn7 // AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1522 ADC_FULL_SCALE_VOLTAGE, // analogIn8 // AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1523 ADC_FULL_SCALE_VOLTAGE * 2.0f, // analogIn9 // AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 1524 ADC_FULL_SCALE_VOLTAGE, // analogIn10 // AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 1525 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn11 // AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1526 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn12 // AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1527 ADC_FULL_SCALE_VOLTAGE, // analogIn13
whismanoid 52:d3fb6f1722bf 1528 ADC_FULL_SCALE_VOLTAGE, // analogIn14
whismanoid 52:d3fb6f1722bf 1529 ADC_FULL_SCALE_VOLTAGE // analogIn15
whismanoid 52:d3fb6f1722bf 1530 # elif defined(TARGET_MAX32620FTHR)
whismanoid 52:d3fb6f1722bf 1531 #warning "TARGET_MAX32620FTHR not previously tested; need to verify analogIn0..."
whismanoid 52:d3fb6f1722bf 1532 ADC_FULL_SCALE_VOLTAGE, // analogIn0
whismanoid 52:d3fb6f1722bf 1533 ADC_FULL_SCALE_VOLTAGE, // analogIn1
whismanoid 52:d3fb6f1722bf 1534 ADC_FULL_SCALE_VOLTAGE, // analogIn2
whismanoid 52:d3fb6f1722bf 1535 ADC_FULL_SCALE_VOLTAGE, // analogIn3
whismanoid 52:d3fb6f1722bf 1536 ADC_FULL_SCALE_VOLTAGE * 5.0f, // analogIn4 // AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1537 ADC_FULL_SCALE_VOLTAGE * 5.0f, // analogIn4 // AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1538 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn6 // AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1539 ADC_FULL_SCALE_VOLTAGE, // analogIn7 // AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1540 ADC_FULL_SCALE_VOLTAGE, // analogIn8 // AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1541 ADC_FULL_SCALE_VOLTAGE * 2.0f, // analogIn9 // AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 1542 ADC_FULL_SCALE_VOLTAGE, // analogIn10 // AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 1543 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn11 // AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1544 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn12 // AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1545 ADC_FULL_SCALE_VOLTAGE, // analogIn13
whismanoid 52:d3fb6f1722bf 1546 ADC_FULL_SCALE_VOLTAGE, // analogIn14
whismanoid 52:d3fb6f1722bf 1547 ADC_FULL_SCALE_VOLTAGE // analogIn15
whismanoid 52:d3fb6f1722bf 1548 #elif defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 1549 ADC_FULL_SCALE_VOLTAGE * 1.0f, // analogIn0 // fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1550 ADC_FULL_SCALE_VOLTAGE * 1.0f, // analogIn1 // fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1551 ADC_FULL_SCALE_VOLTAGE * 1.0f, // analogIn2 // fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1552 ADC_FULL_SCALE_VOLTAGE * 1.0f, // analogIn3 // fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1553 ADC_FULL_SCALE_VOLTAGE * 5.0f, // analogIn4 // AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1554 ADC_FULL_SCALE_VOLTAGE * 5.0f, // analogIn4 // AIN_5 = AIN1 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 1555 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn6 // AIN_6 = VDDB / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1556 ADC_FULL_SCALE_VOLTAGE, // analogIn7 // AIN_7 = VDD18 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1557 ADC_FULL_SCALE_VOLTAGE, // analogIn8 // AIN_8 = VDD12 fullscale is 1.2V
whismanoid 52:d3fb6f1722bf 1558 ADC_FULL_SCALE_VOLTAGE * 2.0f, // analogIn9 // AIN_9 = VRTC / 2.0 fullscale is 2.4V
whismanoid 52:d3fb6f1722bf 1559 ADC_FULL_SCALE_VOLTAGE, // analogIn10 // AIN_10 = x undefined?
whismanoid 52:d3fb6f1722bf 1560 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn11 // AIN_11 = VDDIO / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1561 ADC_FULL_SCALE_VOLTAGE * 4.0f, // analogIn12 // AIN_12 = VDDIOH / 4.0 fullscale is 4.8V
whismanoid 52:d3fb6f1722bf 1562 ADC_FULL_SCALE_VOLTAGE, // analogIn13
whismanoid 52:d3fb6f1722bf 1563 ADC_FULL_SCALE_VOLTAGE, // analogIn14
whismanoid 52:d3fb6f1722bf 1564 ADC_FULL_SCALE_VOLTAGE // analogIn15
whismanoid 52:d3fb6f1722bf 1565 #elif defined(TARGET_NUCLEO_F446RE)
whismanoid 52:d3fb6f1722bf 1566 ADC_FULL_SCALE_VOLTAGE, // analogIn0
whismanoid 52:d3fb6f1722bf 1567 ADC_FULL_SCALE_VOLTAGE, // analogIn1
whismanoid 52:d3fb6f1722bf 1568 ADC_FULL_SCALE_VOLTAGE, // analogIn2
whismanoid 52:d3fb6f1722bf 1569 ADC_FULL_SCALE_VOLTAGE, // analogIn3
whismanoid 52:d3fb6f1722bf 1570 ADC_FULL_SCALE_VOLTAGE, // analogIn4
whismanoid 52:d3fb6f1722bf 1571 ADC_FULL_SCALE_VOLTAGE, // analogIn5
whismanoid 52:d3fb6f1722bf 1572 ADC_FULL_SCALE_VOLTAGE, // analogIn6
whismanoid 52:d3fb6f1722bf 1573 ADC_FULL_SCALE_VOLTAGE, // analogIn7
whismanoid 52:d3fb6f1722bf 1574 ADC_FULL_SCALE_VOLTAGE, // analogIn8
whismanoid 52:d3fb6f1722bf 1575 ADC_FULL_SCALE_VOLTAGE, // analogIn9
whismanoid 52:d3fb6f1722bf 1576 ADC_FULL_SCALE_VOLTAGE, // analogIn10
whismanoid 52:d3fb6f1722bf 1577 ADC_FULL_SCALE_VOLTAGE, // analogIn11
whismanoid 52:d3fb6f1722bf 1578 ADC_FULL_SCALE_VOLTAGE, // analogIn12
whismanoid 52:d3fb6f1722bf 1579 ADC_FULL_SCALE_VOLTAGE, // analogIn13
whismanoid 52:d3fb6f1722bf 1580 ADC_FULL_SCALE_VOLTAGE, // analogIn14
whismanoid 52:d3fb6f1722bf 1581 ADC_FULL_SCALE_VOLTAGE // analogIn15
whismanoid 52:d3fb6f1722bf 1582 #elif defined(TARGET_NUCLEO_F401RE)
whismanoid 52:d3fb6f1722bf 1583 ADC_FULL_SCALE_VOLTAGE, // analogIn0
whismanoid 52:d3fb6f1722bf 1584 ADC_FULL_SCALE_VOLTAGE, // analogIn1
whismanoid 52:d3fb6f1722bf 1585 ADC_FULL_SCALE_VOLTAGE, // analogIn2
whismanoid 52:d3fb6f1722bf 1586 ADC_FULL_SCALE_VOLTAGE, // analogIn3
whismanoid 52:d3fb6f1722bf 1587 ADC_FULL_SCALE_VOLTAGE, // analogIn4
whismanoid 52:d3fb6f1722bf 1588 ADC_FULL_SCALE_VOLTAGE, // analogIn5
whismanoid 52:d3fb6f1722bf 1589 ADC_FULL_SCALE_VOLTAGE, // analogIn6
whismanoid 52:d3fb6f1722bf 1590 ADC_FULL_SCALE_VOLTAGE, // analogIn7
whismanoid 52:d3fb6f1722bf 1591 ADC_FULL_SCALE_VOLTAGE, // analogIn8
whismanoid 52:d3fb6f1722bf 1592 ADC_FULL_SCALE_VOLTAGE, // analogIn9
whismanoid 52:d3fb6f1722bf 1593 ADC_FULL_SCALE_VOLTAGE, // analogIn10
whismanoid 52:d3fb6f1722bf 1594 ADC_FULL_SCALE_VOLTAGE, // analogIn11
whismanoid 52:d3fb6f1722bf 1595 ADC_FULL_SCALE_VOLTAGE, // analogIn12
whismanoid 52:d3fb6f1722bf 1596 ADC_FULL_SCALE_VOLTAGE, // analogIn13
whismanoid 52:d3fb6f1722bf 1597 ADC_FULL_SCALE_VOLTAGE, // analogIn14
whismanoid 52:d3fb6f1722bf 1598 ADC_FULL_SCALE_VOLTAGE // analogIn15
whismanoid 52:d3fb6f1722bf 1599 //#elif defined(TARGET_LPC1768)
whismanoid 52:d3fb6f1722bf 1600 #else
whismanoid 52:d3fb6f1722bf 1601 // unknown target
whismanoid 52:d3fb6f1722bf 1602 ADC_FULL_SCALE_VOLTAGE, // analogIn0
whismanoid 52:d3fb6f1722bf 1603 ADC_FULL_SCALE_VOLTAGE, // analogIn1
whismanoid 52:d3fb6f1722bf 1604 ADC_FULL_SCALE_VOLTAGE, // analogIn2
whismanoid 52:d3fb6f1722bf 1605 ADC_FULL_SCALE_VOLTAGE, // analogIn3
whismanoid 52:d3fb6f1722bf 1606 ADC_FULL_SCALE_VOLTAGE, // analogIn4
whismanoid 52:d3fb6f1722bf 1607 ADC_FULL_SCALE_VOLTAGE, // analogIn5
whismanoid 52:d3fb6f1722bf 1608 ADC_FULL_SCALE_VOLTAGE, // analogIn6
whismanoid 52:d3fb6f1722bf 1609 ADC_FULL_SCALE_VOLTAGE, // analogIn7
whismanoid 52:d3fb6f1722bf 1610 ADC_FULL_SCALE_VOLTAGE, // analogIn8
whismanoid 52:d3fb6f1722bf 1611 ADC_FULL_SCALE_VOLTAGE, // analogIn9
whismanoid 52:d3fb6f1722bf 1612 ADC_FULL_SCALE_VOLTAGE, // analogIn10
whismanoid 52:d3fb6f1722bf 1613 ADC_FULL_SCALE_VOLTAGE, // analogIn11
whismanoid 52:d3fb6f1722bf 1614 ADC_FULL_SCALE_VOLTAGE, // analogIn12
whismanoid 52:d3fb6f1722bf 1615 ADC_FULL_SCALE_VOLTAGE, // analogIn13
whismanoid 52:d3fb6f1722bf 1616 ADC_FULL_SCALE_VOLTAGE, // analogIn14
whismanoid 52:d3fb6f1722bf 1617 ADC_FULL_SCALE_VOLTAGE // analogIn15
whismanoid 52:d3fb6f1722bf 1618 # endif
whismanoid 52:d3fb6f1722bf 1619 };
whismanoid 52:d3fb6f1722bf 1620 #endif
whismanoid 52:d3fb6f1722bf 1621
whismanoid 52:d3fb6f1722bf 1622
whismanoid 52:d3fb6f1722bf 1623
whismanoid 52:d3fb6f1722bf 1624
whismanoid 52:d3fb6f1722bf 1625 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1626 // Option to use LEDs to show status
whismanoid 52:d3fb6f1722bf 1627 #ifndef USE_LEDS
whismanoid 52:d3fb6f1722bf 1628 #define USE_LEDS 1
whismanoid 52:d3fb6f1722bf 1629 #endif
whismanoid 52:d3fb6f1722bf 1630 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 1631 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 1632 # define LED_ON 0
whismanoid 52:d3fb6f1722bf 1633 # define LED_OFF 1
whismanoid 52:d3fb6f1722bf 1634 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1635 #elif defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 1636 # define LED_ON 0
whismanoid 52:d3fb6f1722bf 1637 # define LED_OFF 1
whismanoid 52:d3fb6f1722bf 1638 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1639 // TODO1: TARGET=MAX32625MBED ARM Cortex-M4F 96MHz 512kB Flash 160kB SRAM
whismanoid 52:d3fb6f1722bf 1640 #elif defined(TARGET_LPC1768)
whismanoid 52:d3fb6f1722bf 1641 # define LED_ON 1
whismanoid 52:d3fb6f1722bf 1642 # define LED_OFF 0
whismanoid 52:d3fb6f1722bf 1643 #else // not defined(TARGET_LPC1768 etc.)
whismanoid 52:d3fb6f1722bf 1644 // USE_LEDS with some platform other than MAX32630, MAX32625MBED, LPC1768
whismanoid 52:d3fb6f1722bf 1645 // bugfix for MAX32600MBED LED blink pattern: check if LED_ON/LED_OFF already defined
whismanoid 52:d3fb6f1722bf 1646 # ifndef LED_ON
whismanoid 52:d3fb6f1722bf 1647 # define LED_ON 0
whismanoid 52:d3fb6f1722bf 1648 # endif
whismanoid 52:d3fb6f1722bf 1649 # ifndef LED_OFF
whismanoid 52:d3fb6f1722bf 1650 # define LED_OFF 1
whismanoid 52:d3fb6f1722bf 1651 # endif
whismanoid 52:d3fb6f1722bf 1652 //# define LED_ON 1
whismanoid 52:d3fb6f1722bf 1653 //# define LED_OFF 0
whismanoid 52:d3fb6f1722bf 1654 #endif // target definition
whismanoid 52:d3fb6f1722bf 1655 DigitalOut led1(LED1, LED_OFF); // MAX32630FTHR: LED1 = LED_RED
whismanoid 52:d3fb6f1722bf 1656 DigitalOut led2(LED2, LED_OFF); // MAX32630FTHR: LED2 = LED_GREEN
whismanoid 52:d3fb6f1722bf 1657 DigitalOut led3(LED3, LED_OFF); // MAX32630FTHR: LED3 = LED_BLUE
whismanoid 52:d3fb6f1722bf 1658 DigitalOut led4(LED4, LED_OFF);
whismanoid 52:d3fb6f1722bf 1659 #else // USE_LEDS=0
whismanoid 52:d3fb6f1722bf 1660 // issue #41 support Nucleo_F446RE
whismanoid 52:d3fb6f1722bf 1661 // there are no LED indicators on the board, LED1 interferes with SPI;
whismanoid 52:d3fb6f1722bf 1662 // but we still need placeholders led1 led2 led3 led4.
whismanoid 52:d3fb6f1722bf 1663 // Declare DigitalOut led1 led2 led3 led4 targeting safe pins.
whismanoid 52:d3fb6f1722bf 1664 // PinName NC means NOT_CONNECTED; DigitalOut::is_connected() returns false
whismanoid 52:d3fb6f1722bf 1665 # define LED_ON 0
whismanoid 52:d3fb6f1722bf 1666 # define LED_OFF 1
whismanoid 52:d3fb6f1722bf 1667 DigitalOut led1(NC, LED_OFF);
whismanoid 52:d3fb6f1722bf 1668 DigitalOut led2(NC, LED_OFF);
whismanoid 52:d3fb6f1722bf 1669 DigitalOut led3(NC, LED_OFF);
whismanoid 52:d3fb6f1722bf 1670 DigitalOut led4(NC, LED_OFF);
whismanoid 52:d3fb6f1722bf 1671 #endif // USE_LEDS
whismanoid 52:d3fb6f1722bf 1672 #define led1_RFailLED led1
whismanoid 52:d3fb6f1722bf 1673 #define led2_GPassLED led2
whismanoid 52:d3fb6f1722bf 1674 #define led3_BBusyLED led3
whismanoid 52:d3fb6f1722bf 1675
whismanoid 52:d3fb6f1722bf 1676 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1677
whismanoid 52:d3fb6f1722bf 1678
whismanoid 52:d3fb6f1722bf 1679 // example code board support
whismanoid 52:d3fb6f1722bf 1680 //MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
whismanoid 52:d3fb6f1722bf 1681 //DigitalOut rLED(LED1);
whismanoid 52:d3fb6f1722bf 1682 //DigitalOut gLED(LED2);
whismanoid 52:d3fb6f1722bf 1683 //DigitalOut bLED(LED3);
whismanoid 52:d3fb6f1722bf 1684 //
whismanoid 52:d3fb6f1722bf 1685 // Arduino "shield" connector port definitions (MAX32625MBED shown)
whismanoid 52:d3fb6f1722bf 1686 #if defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 1687 #define A0 AIN_0
whismanoid 52:d3fb6f1722bf 1688 #define A1 AIN_1
whismanoid 52:d3fb6f1722bf 1689 #define A2 AIN_2
whismanoid 52:d3fb6f1722bf 1690 #define A3 AIN_3
whismanoid 52:d3fb6f1722bf 1691 #define D0 P0_0
whismanoid 52:d3fb6f1722bf 1692 #define D1 P0_1
whismanoid 52:d3fb6f1722bf 1693 #define D2 P0_2
whismanoid 52:d3fb6f1722bf 1694 #define D3 P0_3
whismanoid 52:d3fb6f1722bf 1695 #define D4 P0_4
whismanoid 52:d3fb6f1722bf 1696 #define D5 P0_5
whismanoid 52:d3fb6f1722bf 1697 #define D6 P0_6
whismanoid 52:d3fb6f1722bf 1698 #define D7 P0_7
whismanoid 52:d3fb6f1722bf 1699 #define D8 P1_4
whismanoid 52:d3fb6f1722bf 1700 #define D9 P1_5
whismanoid 52:d3fb6f1722bf 1701 #define D10 P1_3
whismanoid 52:d3fb6f1722bf 1702 #define D11 P1_1
whismanoid 52:d3fb6f1722bf 1703 #define D12 P1_2
whismanoid 52:d3fb6f1722bf 1704 #define D13 P1_0
whismanoid 52:d3fb6f1722bf 1705 #endif
whismanoid 52:d3fb6f1722bf 1706
whismanoid 57:dc118969c848 1707 // example code declare SPI interface (GPIO controlled CS)
whismanoid 52:d3fb6f1722bf 1708 #if defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 1709 SPI spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK); // mosi, miso, sclk spi1 TARGET_MAX32625MBED: P1_1 P1_2 P1_0 Arduino 10-pin header D11 D12 D13
whismanoid 52:d3fb6f1722bf 1710 DigitalOut spi_cs(SPI1_SS); // TARGET_MAX32625MBED: P1_3 Arduino 10-pin header D10
whismanoid 52:d3fb6f1722bf 1711 #elif defined(TARGET_MAX32600MBED)
whismanoid 52:d3fb6f1722bf 1712 SPI spi(SPI2_MOSI, SPI2_MISO, SPI2_SCK); // mosi, miso, sclk spi1 TARGET_MAX32600MBED: Arduino 10-pin header D11 D12 D13
whismanoid 52:d3fb6f1722bf 1713 DigitalOut spi_cs(SPI2_SS); // Generic: Arduino 10-pin header D10
whismanoid 57:dc118969c848 1714 #elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_NUCLEO_F401RE)
whismanoid 57:dc118969c848 1715 // TODO1: avoid resource conflict between P5_0, P5_1, P5_2 SPI and DigitalInOut
whismanoid 57:dc118969c848 1716 // void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel)
whismanoid 57:dc118969c848 1717 //
whismanoid 57:dc118969c848 1718 // TODO1: NUCLEO_F446RE SPI not working; CS and MOSI data looks OK but no SCLK clock pulses.
whismanoid 57:dc118969c848 1719 SPI spi(SPI_MOSI, SPI_MISO, SPI_SCK); // mosi, miso, sclk spi1 TARGET_NUCLEO_F446RE: Arduino 10-pin header D11 D12 D13
whismanoid 57:dc118969c848 1720 DigitalOut spi_cs(SPI_CS); // TARGET_NUCLEO_F446RE: PB_6 Arduino 10-pin header D10
whismanoid 57:dc118969c848 1721 //
whismanoid 52:d3fb6f1722bf 1722 #else
whismanoid 52:d3fb6f1722bf 1723 SPI spi(D11, D12, D13); // mosi, miso, sclk spi1 TARGET_MAX32600MBED: Arduino 10-pin header D11 D12 D13
whismanoid 52:d3fb6f1722bf 1724 DigitalOut spi_cs(D10); // Generic: Arduino 10-pin header D10
whismanoid 52:d3fb6f1722bf 1725 #endif
whismanoid 52:d3fb6f1722bf 1726
whismanoid 52:d3fb6f1722bf 1727 // example code declare GPIO interface pins
whismanoid 52:d3fb6f1722bf 1728 // example code declare device instance
whismanoid 52:d3fb6f1722bf 1729 MAX11410 g_MAX11410_device(spi, spi_cs, MAX11410::MAX11410_IC);
whismanoid 52:d3fb6f1722bf 1730
whismanoid 52:d3fb6f1722bf 1731
whismanoid 52:d3fb6f1722bf 1732 //----------------------------------------
whismanoid 52:d3fb6f1722bf 1733 // Global SPI options
whismanoid 52:d3fb6f1722bf 1734 //
whismanoid 52:d3fb6f1722bf 1735
whismanoid 52:d3fb6f1722bf 1736 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1737 // Optional Diagnostic function to print SPI transactions
whismanoid 52:d3fb6f1722bf 1738 #ifndef MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 1739 #define MAX11410_ONSPIPRINT 1
whismanoid 52:d3fb6f1722bf 1740 #endif // MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 1741
whismanoid 52:d3fb6f1722bf 1742 #define APPLICATION_ArduinoPinsMonitor 1
whismanoid 52:d3fb6f1722bf 1743
whismanoid 52:d3fb6f1722bf 1744 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1745 // use BUTTON1 trigger some action
whismanoid 52:d3fb6f1722bf 1746 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 1747 #define HAS_BUTTON1_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1748 #define HAS_BUTTON2_DEMO 0
whismanoid 52:d3fb6f1722bf 1749 #define HAS_BUTTON2_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1750 #elif defined(TARGET_MAX32625PICO)
whismanoid 52:d3fb6f1722bf 1751 #warning "TARGET_MAX32625PICO not previously tested; need to define buttons..."
whismanoid 52:d3fb6f1722bf 1752 #define HAS_BUTTON1_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1753 #define HAS_BUTTON2_DEMO 0
whismanoid 52:d3fb6f1722bf 1754 #define HAS_BUTTON2_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1755 #elif defined(TARGET_MAX32625)
whismanoid 52:d3fb6f1722bf 1756 #define HAS_BUTTON1_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1757 #define HAS_BUTTON2_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1758 #elif defined(TARGET_MAX32620FTHR)
whismanoid 52:d3fb6f1722bf 1759 #warning "TARGET_MAX32620FTHR not previously tested; need to define buttons..."
whismanoid 52:d3fb6f1722bf 1760 #define BUTTON1 SW1
whismanoid 52:d3fb6f1722bf 1761 #define HAS_BUTTON1_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1762 #define HAS_BUTTON2_DEMO 0
whismanoid 52:d3fb6f1722bf 1763 #define HAS_BUTTON2_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1764 #elif defined(TARGET_NUCLEO_F446RE)
whismanoid 52:d3fb6f1722bf 1765 #define HAS_BUTTON1_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1766 #define HAS_BUTTON2_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1767 #elif defined(TARGET_NUCLEO_F401RE)
whismanoid 52:d3fb6f1722bf 1768 #define HAS_BUTTON1_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1769 #define HAS_BUTTON2_DEMO_INTERRUPT 0
whismanoid 52:d3fb6f1722bf 1770 #else
whismanoid 52:d3fb6f1722bf 1771 #warning "target not previously tested; need to define buttons..."
whismanoid 52:d3fb6f1722bf 1772 #endif
whismanoid 52:d3fb6f1722bf 1773 //
whismanoid 52:d3fb6f1722bf 1774 #ifndef HAS_BUTTON1_DEMO
whismanoid 52:d3fb6f1722bf 1775 #define HAS_BUTTON1_DEMO 0
whismanoid 52:d3fb6f1722bf 1776 #endif
whismanoid 52:d3fb6f1722bf 1777 #ifndef HAS_BUTTON2_DEMO
whismanoid 52:d3fb6f1722bf 1778 #define HAS_BUTTON2_DEMO 0
whismanoid 52:d3fb6f1722bf 1779 #endif
whismanoid 52:d3fb6f1722bf 1780 //
whismanoid 52:d3fb6f1722bf 1781 // avoid runtime error on button1 press [mbed-os-5.11]
whismanoid 52:d3fb6f1722bf 1782 // instead of using InterruptIn, use DigitalIn and poll in main while(1)
whismanoid 52:d3fb6f1722bf 1783 #ifndef HAS_BUTTON1_DEMO_INTERRUPT_POLLING
whismanoid 52:d3fb6f1722bf 1784 #define HAS_BUTTON1_DEMO_INTERRUPT_POLLING 1
whismanoid 52:d3fb6f1722bf 1785 #endif
whismanoid 52:d3fb6f1722bf 1786 //
whismanoid 52:d3fb6f1722bf 1787 #ifndef HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1788 #define HAS_BUTTON1_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1789 #endif
whismanoid 52:d3fb6f1722bf 1790 #ifndef HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1791 #define HAS_BUTTON2_DEMO_INTERRUPT 1
whismanoid 52:d3fb6f1722bf 1792 #endif
whismanoid 52:d3fb6f1722bf 1793 //
whismanoid 52:d3fb6f1722bf 1794 #if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1795 # if HAS_BUTTON1_DEMO_INTERRUPT_POLLING
whismanoid 52:d3fb6f1722bf 1796 // avoid runtime error on button1 press [mbed-os-5.11]
whismanoid 52:d3fb6f1722bf 1797 // instead of using InterruptIn, use DigitalIn and poll in main while(1)
whismanoid 52:d3fb6f1722bf 1798 DigitalIn button1(BUTTON1);
whismanoid 52:d3fb6f1722bf 1799 # else
whismanoid 52:d3fb6f1722bf 1800 InterruptIn button1(BUTTON1);
whismanoid 52:d3fb6f1722bf 1801 # endif
whismanoid 52:d3fb6f1722bf 1802 #elif HAS_BUTTON1_DEMO
whismanoid 52:d3fb6f1722bf 1803 DigitalIn button1(BUTTON1);
whismanoid 52:d3fb6f1722bf 1804 #endif
whismanoid 52:d3fb6f1722bf 1805 #if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1806 # if HAS_BUTTON1_DEMO_INTERRUPT_POLLING
whismanoid 52:d3fb6f1722bf 1807 // avoid runtime error on button1 press [mbed-os-5.11]
whismanoid 52:d3fb6f1722bf 1808 // instead of using InterruptIn, use DigitalIn and poll in main while(1)
whismanoid 52:d3fb6f1722bf 1809 DigitalIn button2(BUTTON2);
whismanoid 52:d3fb6f1722bf 1810 # else
whismanoid 52:d3fb6f1722bf 1811 InterruptIn button2(BUTTON2);
whismanoid 52:d3fb6f1722bf 1812 # endif
whismanoid 52:d3fb6f1722bf 1813 #elif HAS_BUTTON2_DEMO
whismanoid 52:d3fb6f1722bf 1814 DigitalIn button2(BUTTON2);
whismanoid 52:d3fb6f1722bf 1815 #endif
whismanoid 52:d3fb6f1722bf 1816
whismanoid 52:d3fb6f1722bf 1817 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1818 // functions tested by SelfTest()
whismanoid 59:c0376adb6ebc 1819 extern uint8_t fn_MAX11410_Init(void);
whismanoid 60:f38c54a91794 1820 extern uint8_t fn_MAX11410_RegRead(int commandByte, uint32_t* ptrRegData);
whismanoid 59:c0376adb6ebc 1821 extern uint8_t fn_MAX11410_RegWrite(int commandByte, int regData);
whismanoid 59:c0376adb6ebc 1822 extern uint8_t fn_MAX11410_Configure_CTRL_REF(int ref_sel);
whismanoid 59:c0376adb6ebc 1823 extern uint8_t fn_MAX11410_Configure_PGA(int sigpath, int gain);
whismanoid 59:c0376adb6ebc 1824 extern double fn_MAX11410_VoltageOfCode_Unipolar(int value_u24);
whismanoid 59:c0376adb6ebc 1825 extern double fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary(int value_u24);
whismanoid 59:c0376adb6ebc 1826 extern double fn_MAX11410_VoltageOfCode_Bipolar_2sComplement(int value_u24);
whismanoid 52:d3fb6f1722bf 1827 extern double fn_MAX11410_TemperatureOfRTD_PT1000(double rtd_resistance);
whismanoid 56:6e9c52cc9abe 1828 extern double fn_MAX11410_TemperatureOfRTD_PT100(double rtd_resistance);
whismanoid 56:6e9c52cc9abe 1829 extern double fn_MAX11410_TemperatureOfRTD(double rtd_resistance);
whismanoid 52:d3fb6f1722bf 1830 extern double fn_MAX11410_TemperatureOfTC_TypeK(double tc_voltage);
whismanoid 52:d3fb6f1722bf 1831
whismanoid 52:d3fb6f1722bf 1832 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 1833 // optional self-test groups for self test function SelfTest()
whismanoid 52:d3fb6f1722bf 1834 // enable by changing the #define value from 0 to 1
whismanoid 59:c0376adb6ebc 1835
whismanoid 59:c0376adb6ebc 1836 // SelfTest group UNIPOLAR description:
whismanoid 61:38ec81c33b7a 1837 // Verify function VoltageOfCode_Unipolar
whismanoid 52:d3fb6f1722bf 1838 #ifndef MAX11410_SELFTEST_UNIPOLAR
whismanoid 52:d3fb6f1722bf 1839 #define MAX11410_SELFTEST_UNIPOLAR 1
whismanoid 52:d3fb6f1722bf 1840 #endif
whismanoid 52:d3fb6f1722bf 1841
whismanoid 59:c0376adb6ebc 1842 // SelfTest group BIPOB description:
whismanoid 61:38ec81c33b7a 1843 // Verify function VoltageOfCode_Bipolar_OffsetBinary
whismanoid 52:d3fb6f1722bf 1844 #ifndef MAX11410_SELFTEST_BIPOB
whismanoid 52:d3fb6f1722bf 1845 #define MAX11410_SELFTEST_BIPOB 1
whismanoid 52:d3fb6f1722bf 1846 #endif
whismanoid 52:d3fb6f1722bf 1847
whismanoid 59:c0376adb6ebc 1848 // SelfTest group BIP2C description:
whismanoid 61:38ec81c33b7a 1849 // Verify function VoltageOfCode_Bipolar_2sComplement
whismanoid 52:d3fb6f1722bf 1850 #ifndef MAX11410_SELFTEST_BIP2C
whismanoid 52:d3fb6f1722bf 1851 #define MAX11410_SELFTEST_BIP2C 1
whismanoid 52:d3fb6f1722bf 1852 #endif
whismanoid 52:d3fb6f1722bf 1853
whismanoid 59:c0376adb6ebc 1854 // SelfTest group RTD_PT1000 description:
whismanoid 61:38ec81c33b7a 1855 // PT1000 type Resistive Temperature Device (RTD)
whismanoid 52:d3fb6f1722bf 1856 #ifndef MAX11410_SELFTEST_RTD_PT1000
whismanoid 52:d3fb6f1722bf 1857 #define MAX11410_SELFTEST_RTD_PT1000 1
whismanoid 52:d3fb6f1722bf 1858 #endif
whismanoid 52:d3fb6f1722bf 1859
whismanoid 59:c0376adb6ebc 1860 // SelfTest group RTD_PT100 description:
whismanoid 61:38ec81c33b7a 1861 // PT100 type Resistive Temperature Device (RTD)
whismanoid 56:6e9c52cc9abe 1862 #ifndef MAX11410_SELFTEST_RTD_PT100
whismanoid 56:6e9c52cc9abe 1863 #define MAX11410_SELFTEST_RTD_PT100 1
whismanoid 56:6e9c52cc9abe 1864 #endif
whismanoid 56:6e9c52cc9abe 1865
whismanoid 59:c0376adb6ebc 1866 // SelfTest group RTD description:
whismanoid 59:c0376adb6ebc 1867 // Verify function TemperatureOfRTD
whismanoid 56:6e9c52cc9abe 1868 #ifndef MAX11410_SELFTEST_RTD
whismanoid 56:6e9c52cc9abe 1869 #define MAX11410_SELFTEST_RTD 1
whismanoid 56:6e9c52cc9abe 1870 #endif
whismanoid 56:6e9c52cc9abe 1871
whismanoid 59:c0376adb6ebc 1872 // SelfTest group TC_1 description:
whismanoid 61:38ec81c33b7a 1873 // Verify Thermocouple function TemperatureOfTC_TypeK
whismanoid 52:d3fb6f1722bf 1874 #ifndef MAX11410_SELFTEST_TC_1
whismanoid 52:d3fb6f1722bf 1875 #define MAX11410_SELFTEST_TC_1 1
whismanoid 52:d3fb6f1722bf 1876 #endif
whismanoid 52:d3fb6f1722bf 1877
whismanoid 59:c0376adb6ebc 1878 // SelfTest group TC_2 description:
whismanoid 61:38ec81c33b7a 1879 // Verify Thermocouple function TemperatureOfTC_TypeK in more detail
whismanoid 52:d3fb6f1722bf 1880 #ifndef MAX11410_SELFTEST_TC_2
whismanoid 52:d3fb6f1722bf 1881 #define MAX11410_SELFTEST_TC_2 1
whismanoid 52:d3fb6f1722bf 1882 #endif
whismanoid 52:d3fb6f1722bf 1883
whismanoid 52:d3fb6f1722bf 1884 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1885 // When user presses button BUTTON1, perform self test
whismanoid 52:d3fb6f1722bf 1886 #if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1887 void onButton1FallingEdge(void)
whismanoid 52:d3fb6f1722bf 1888 {
whismanoid 52:d3fb6f1722bf 1889 void SelfTest(CmdLine & cmdLine);
whismanoid 52:d3fb6f1722bf 1890 SelfTest(cmdLine_serial);
whismanoid 52:d3fb6f1722bf 1891 }
whismanoid 52:d3fb6f1722bf 1892 #endif // HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1893
whismanoid 52:d3fb6f1722bf 1894 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1895 // When user presses button BUTTON2, perform demo configuration
whismanoid 52:d3fb6f1722bf 1896 #if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1897 void onButton2FallingEdge(void)
whismanoid 52:d3fb6f1722bf 1898 {
whismanoid 52:d3fb6f1722bf 1899 // TBD demo configuration
whismanoid 55:73d886c105f5 1900 // CODE GENERATOR: example code: has no member function Configure_Demo
whismanoid 52:d3fb6f1722bf 1901 // TODO diagnostic LED
whismanoid 55:73d886c105f5 1902 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 1903 }
whismanoid 52:d3fb6f1722bf 1904 #endif // HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1905
whismanoid 52:d3fb6f1722bf 1906 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1907 void SelfTest(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 1908 {
whismanoid 52:d3fb6f1722bf 1909 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1910 #if analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 1911 // Platform board uses AIN4,AIN5,.. as high range of AIN0,AIN1,..
whismanoid 52:d3fb6f1722bf 1912 MaximTinyTester tinyTester(cmdLine, analogIn4, analogIn5, analogIn2, analogIn3, analogIn0, analogIn4, led1_RFailLED, led2_GPassLED, led3_BBusyLED);
whismanoid 52:d3fb6f1722bf 1913 tinyTester.analogInPin_fullScaleVoltage[0] = analogInPin_fullScaleVoltage[4]; // board support
whismanoid 52:d3fb6f1722bf 1914 tinyTester.analogInPin_fullScaleVoltage[1] = analogInPin_fullScaleVoltage[5]; // board support
whismanoid 52:d3fb6f1722bf 1915 tinyTester.analogInPin_fullScaleVoltage[2] = analogInPin_fullScaleVoltage[2]; // board support
whismanoid 52:d3fb6f1722bf 1916 tinyTester.analogInPin_fullScaleVoltage[3] = analogInPin_fullScaleVoltage[3]; // board support
whismanoid 52:d3fb6f1722bf 1917 tinyTester.analogInPin_fullScaleVoltage[4] = analogInPin_fullScaleVoltage[0]; // board support
whismanoid 52:d3fb6f1722bf 1918 tinyTester.analogInPin_fullScaleVoltage[5] = analogInPin_fullScaleVoltage[1]; // board support
whismanoid 52:d3fb6f1722bf 1919 // low range channels AIN0, AIN1, AIN2, AIN3
whismanoid 52:d3fb6f1722bf 1920 #else // analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 1921 // Platform board uses simple analog inputs
whismanoid 52:d3fb6f1722bf 1922 MaximTinyTester tinyTester(cmdLine, analogIn0, analogIn1, analogIn2, analogIn3, analogIn4, analogIn5, led1_RFailLED, led2_GPassLED, led3_BBusyLED);
whismanoid 52:d3fb6f1722bf 1923 tinyTester.analogInPin_fullScaleVoltage[0] = analogInPin_fullScaleVoltage[0]; // board support
whismanoid 52:d3fb6f1722bf 1924 tinyTester.analogInPin_fullScaleVoltage[1] = analogInPin_fullScaleVoltage[1]; // board support
whismanoid 52:d3fb6f1722bf 1925 tinyTester.analogInPin_fullScaleVoltage[2] = analogInPin_fullScaleVoltage[2]; // board support
whismanoid 52:d3fb6f1722bf 1926 tinyTester.analogInPin_fullScaleVoltage[3] = analogInPin_fullScaleVoltage[3]; // board support
whismanoid 52:d3fb6f1722bf 1927 tinyTester.analogInPin_fullScaleVoltage[4] = analogInPin_fullScaleVoltage[4]; // board support
whismanoid 52:d3fb6f1722bf 1928 tinyTester.analogInPin_fullScaleVoltage[5] = analogInPin_fullScaleVoltage[5]; // board support
whismanoid 52:d3fb6f1722bf 1929 #endif
whismanoid 52:d3fb6f1722bf 1930 tinyTester.clear();
whismanoid 52:d3fb6f1722bf 1931
whismanoid 52:d3fb6f1722bf 1932 // CODE GENERATOR: generate SelfTest based on function docstrings @test lines
whismanoid 52:d3fb6f1722bf 1933
whismanoid 61:38ec81c33b7a 1934 // @test Init() expect 1
whismanoid 59:c0376adb6ebc 1935 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 1936 // docTest_item['action'] = 'Init() expect 1'
whismanoid 59:c0376adb6ebc 1937 // docTest_item['funcName'] = 'Init'
whismanoid 59:c0376adb6ebc 1938 // docTest_item['expect-value'] = '1'
whismanoid 59:c0376adb6ebc 1939 // call-function
whismanoid 59:c0376adb6ebc 1940 // ASSERT_EQ(g_MAX11410_device.Init(()), (uint8_t)1); //
whismanoid 59:c0376adb6ebc 1941 tinyTester.FunctionCall_Expect("MAX11410.Init", fn_MAX11410_Init, /* empty docTest_argList */ /* expect: */ (uint8_t)1); //
whismanoid 59:c0376adb6ebc 1942
whismanoid 61:38ec81c33b7a 1943 // @test RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02
whismanoid 60:f38c54a91794 1944 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 1945 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02'
whismanoid 60:f38c54a91794 1946 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 1947 // docTest_item['arglist'] = 'MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer'
whismanoid 60:f38c54a91794 1948 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 1949 // docTest_item['expect-buffer-value'] = '0x000F02'
whismanoid 60:f38c54a91794 1950 // call-function
whismanoid 60:f38c54a91794 1951 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 1952 { // expect-buffer 0x000F02
whismanoid 60:f38c54a91794 1953 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 1954 //
whismanoid 60:f38c54a91794 1955 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x000F02); //
whismanoid 60:f38c54a91794 1956 } // expect-buffer 0x000F02
whismanoid 60:f38c54a91794 1957
whismanoid 61:38ec81c33b7a 1958 // @test RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 1959 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 1960 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1961 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 1962 // docTest_item['arglist'] = 'MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer'
whismanoid 60:f38c54a91794 1963 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 1964 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 60:f38c54a91794 1965 // call-function
whismanoid 60:f38c54a91794 1966 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 1967 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 1968 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 1969 //
whismanoid 60:f38c54a91794 1970 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00); //
whismanoid 60:f38c54a91794 1971 } // expect-buffer 0x00
whismanoid 60:f38c54a91794 1972
whismanoid 61:38ec81c33b7a 1973 // @test RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 1974 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 1975 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1976 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 1977 // docTest_item['arglist'] = 'MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer'
whismanoid 60:f38c54a91794 1978 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 1979 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 60:f38c54a91794 1980 // call-function
whismanoid 60:f38c54a91794 1981 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 1982 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 1983 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 1984 //
whismanoid 60:f38c54a91794 1985 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00); //
whismanoid 60:f38c54a91794 1986 } // expect-buffer 0x00
whismanoid 60:f38c54a91794 1987
whismanoid 61:38ec81c33b7a 1988 // @test RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a
whismanoid 60:f38c54a91794 1989 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 1990 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a'
whismanoid 60:f38c54a91794 1991 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 1992 // docTest_item['arglist'] = 'MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer'
whismanoid 60:f38c54a91794 1993 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 1994 // docTest_item['expect-buffer-value'] = '0x00003a'
whismanoid 60:f38c54a91794 1995 // call-function
whismanoid 60:f38c54a91794 1996 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 1997 { // expect-buffer 0x00003a
whismanoid 60:f38c54a91794 1998 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 1999 //
whismanoid 60:f38c54a91794 2000 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00003a); //
whismanoid 60:f38c54a91794 2001 } // expect-buffer 0x00003a
whismanoid 60:f38c54a91794 2002
whismanoid 61:38ec81c33b7a 2003 // @test RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2004 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2005 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2006 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2007 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer'
whismanoid 60:f38c54a91794 2008 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2009 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 60:f38c54a91794 2010 // call-function
whismanoid 60:f38c54a91794 2011 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2012 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2013 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2014 //
whismanoid 60:f38c54a91794 2015 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00); //
whismanoid 60:f38c54a91794 2016 } // expect-buffer 0x00
whismanoid 60:f38c54a91794 2017
whismanoid 61:38ec81c33b7a 2018 // @test RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001
whismanoid 60:f38c54a91794 2019 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2020 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001'
whismanoid 60:f38c54a91794 2021 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2022 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer'
whismanoid 60:f38c54a91794 2023 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2024 // docTest_item['expect-buffer-value'] = '0x000001'
whismanoid 60:f38c54a91794 2025 // call-function
whismanoid 60:f38c54a91794 2026 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1001_dddd_dddd_CTRL, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2027 { // expect-buffer 0x000001
whismanoid 60:f38c54a91794 2028 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2029 //
whismanoid 60:f38c54a91794 2030 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1001_dddd_dddd_CTRL, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x000001); //
whismanoid 60:f38c54a91794 2031 } // expect-buffer 0x000001
whismanoid 60:f38c54a91794 2032
whismanoid 61:38ec81c33b7a 2033 // @test RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2034 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2035 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2036 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2037 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer'
whismanoid 60:f38c54a91794 2038 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2039 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 60:f38c54a91794 2040 // call-function
whismanoid 60:f38c54a91794 2041 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2042 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2043 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2044 //
whismanoid 60:f38c54a91794 2045 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00); //
whismanoid 60:f38c54a91794 2046 } // expect-buffer 0x00
whismanoid 60:f38c54a91794 2047
whismanoid 61:38ec81c33b7a 2048 // @test RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2049 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2050 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 2051 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2052 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer'
whismanoid 60:f38c54a91794 2053 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2054 // docTest_item['expect-buffer-value'] = '0x0000ff'
whismanoid 60:f38c54a91794 2055 // call-function
whismanoid 60:f38c54a91794 2056 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2057 { // expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2058 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2059 //
whismanoid 60:f38c54a91794 2060 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x0000ff); //
whismanoid 60:f38c54a91794 2061 } // expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2062
whismanoid 61:38ec81c33b7a 2063 // @test RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2064 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2065 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 2066 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2067 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer'
whismanoid 60:f38c54a91794 2068 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2069 // docTest_item['expect-buffer-value'] = '0x0000ff'
whismanoid 60:f38c54a91794 2070 // call-function
whismanoid 60:f38c54a91794 2071 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2072 { // expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2073 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2074 //
whismanoid 60:f38c54a91794 2075 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x0000ff); //
whismanoid 60:f38c54a91794 2076 } // expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2077
whismanoid 61:38ec81c33b7a 2078 // @test RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2079 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2080 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2081 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2082 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer'
whismanoid 60:f38c54a91794 2083 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2084 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 60:f38c54a91794 2085 // call-function
whismanoid 60:f38c54a91794 2086 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2087 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2088 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2089 //
whismanoid 60:f38c54a91794 2090 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00); //
whismanoid 60:f38c54a91794 2091 } // expect-buffer 0x00
whismanoid 60:f38c54a91794 2092
whismanoid 61:38ec81c33b7a 2093 // @test RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2094 // docTest_item['actionType'] = 'call-function'
whismanoid 60:f38c54a91794 2095 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2096 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2097 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer'
whismanoid 60:f38c54a91794 2098 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2099 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 60:f38c54a91794 2100 // call-function
whismanoid 60:f38c54a91794 2101 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1110_xxdd_xddd_PGA, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 60:f38c54a91794 2102 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2103 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2104 //
whismanoid 60:f38c54a91794 2105 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)MAX11410::CMD_r000_1110_xxdd_xddd_PGA, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x00); //
whismanoid 60:f38c54a91794 2106 } // expect-buffer 0x00
whismanoid 59:c0376adb6ebc 2107
whismanoid 61:38ec81c33b7a 2108 // @test tinyTester.print("check filter register is writeable")
whismanoid 59:c0376adb6ebc 2109 // docTest_item['actionType'] = 'print-string'
whismanoid 59:c0376adb6ebc 2110 // docTest_item['action'] = 'tinyTester.print("check filter register is writeable")'
whismanoid 59:c0376adb6ebc 2111 // docTest_item['arglist'] = 'check filter register is writeable'
whismanoid 59:c0376adb6ebc 2112 // print-string
whismanoid 59:c0376adb6ebc 2113 // tinyTesterFuncName = "tinyTester.print"
whismanoid 59:c0376adb6ebc 2114 // tinyTesterPrintStringLiteral = "check filter register is writeable"
whismanoid 59:c0376adb6ebc 2115 tinyTester.print("check filter register is writeable");
whismanoid 59:c0376adb6ebc 2116
whismanoid 61:38ec81c33b7a 2117 // @test RegWrite(0x08, 0x34) expect 1
whismanoid 59:c0376adb6ebc 2118 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 2119 // docTest_item['action'] = 'RegWrite(0x08, 0x34) expect 1'
whismanoid 59:c0376adb6ebc 2120 // docTest_item['funcName'] = 'RegWrite'
whismanoid 59:c0376adb6ebc 2121 // docTest_item['arglist'] = '0x08, 0x34'
whismanoid 59:c0376adb6ebc 2122 // docTest_item['expect-value'] = '1'
whismanoid 59:c0376adb6ebc 2123 // call-function
whismanoid 59:c0376adb6ebc 2124 // ASSERT_EQ(g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)0x08, (uint32_t)0x34), (uint8_t)1); //
whismanoid 59:c0376adb6ebc 2125 tinyTester.FunctionCall_Expect("MAX11410.RegWrite", fn_MAX11410_RegWrite, (MAX11410::MAX11410_CMD_enum_t)0x08, (uint32_t)0x34, /* expect: */ (uint8_t)1); //
whismanoid 59:c0376adb6ebc 2126
whismanoid 61:38ec81c33b7a 2127 // @test tinyTester.print("check filter register is readable")
whismanoid 59:c0376adb6ebc 2128 // docTest_item['actionType'] = 'print-string'
whismanoid 59:c0376adb6ebc 2129 // docTest_item['action'] = 'tinyTester.print("check filter register is readable")'
whismanoid 59:c0376adb6ebc 2130 // docTest_item['arglist'] = 'check filter register is readable'
whismanoid 59:c0376adb6ebc 2131 // print-string
whismanoid 59:c0376adb6ebc 2132 // tinyTesterFuncName = "tinyTester.print"
whismanoid 59:c0376adb6ebc 2133 // tinyTesterPrintStringLiteral = "check filter register is readable"
whismanoid 59:c0376adb6ebc 2134 tinyTester.print("check filter register is readable");
whismanoid 59:c0376adb6ebc 2135
whismanoid 61:38ec81c33b7a 2136 // @test RegRead(0x08, buffer) expect 1 expect-buffer 0x34
whismanoid 59:c0376adb6ebc 2137 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 2138 // docTest_item['action'] = 'RegRead(0x08, buffer) expect 1 expect-buffer 0x34'
whismanoid 59:c0376adb6ebc 2139 // docTest_item['funcName'] = 'RegRead'
whismanoid 59:c0376adb6ebc 2140 // docTest_item['arglist'] = '0x08, buffer'
whismanoid 59:c0376adb6ebc 2141 // docTest_item['expect-value'] = '1'
whismanoid 59:c0376adb6ebc 2142 // docTest_item['expect-buffer-value'] = '0x34'
whismanoid 59:c0376adb6ebc 2143 // call-function
whismanoid 59:c0376adb6ebc 2144 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)0x08, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 59:c0376adb6ebc 2145 { // expect-buffer 0x34
whismanoid 59:c0376adb6ebc 2146 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 59:c0376adb6ebc 2147 //
whismanoid 59:c0376adb6ebc 2148 tinyTester.FunctionCall_i_pi_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)0x08, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x34); //
whismanoid 59:c0376adb6ebc 2149 } // expect-buffer 0x34
whismanoid 59:c0376adb6ebc 2150
whismanoid 61:38ec81c33b7a 2151 // @test tinyTester.settle_time_msec = 250 // default 250
whismanoid 59:c0376adb6ebc 2152 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 59:c0376adb6ebc 2153 // docTest_item['action'] = 'tinyTester.settle_time_msec = 250'
whismanoid 59:c0376adb6ebc 2154 // docTest_item['remarks'] = 'default 250'
whismanoid 59:c0376adb6ebc 2155 // docTest_item['propName'] = 'tinyTester.settle_time_msec'
whismanoid 59:c0376adb6ebc 2156 // docTest_item['propValue'] = '250'
whismanoid 59:c0376adb6ebc 2157 // assign-propname-value
whismanoid 59:c0376adb6ebc 2158 // tinyTesterPropName = "tinyTester.settle_time_msec"
whismanoid 59:c0376adb6ebc 2159 // tinyTesterPropValue = "250"
whismanoid 59:c0376adb6ebc 2160 tinyTester.settle_time_msec = 250;
whismanoid 59:c0376adb6ebc 2161
whismanoid 61:38ec81c33b7a 2162 // @test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 59:c0376adb6ebc 2163 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 59:c0376adb6ebc 2164 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 59:c0376adb6ebc 2165 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 2166 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 59:c0376adb6ebc 2167 // docTest_item['propValue'] = '75'
whismanoid 59:c0376adb6ebc 2168 // assign-propname-value
whismanoid 59:c0376adb6ebc 2169 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 59:c0376adb6ebc 2170 // tinyTesterPropValue = "75"
whismanoid 59:c0376adb6ebc 2171 tinyTester.blink_time_msec = 75;
whismanoid 59:c0376adb6ebc 2172
whismanoid 61:38ec81c33b7a 2173 // @test tinyTester.input_timeout_time_msec = 250 // default 250
whismanoid 59:c0376adb6ebc 2174 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2175 // docTest_item['action'] = 'tinyTester.input_timeout_time_msec = 250'
whismanoid 61:38ec81c33b7a 2176 // docTest_item['remarks'] = 'default 250'
whismanoid 61:38ec81c33b7a 2177 // docTest_item['propName'] = 'tinyTester.input_timeout_time_msec'
whismanoid 61:38ec81c33b7a 2178 // docTest_item['propValue'] = '250'
whismanoid 59:c0376adb6ebc 2179 // assign-propname-value
whismanoid 61:38ec81c33b7a 2180 // tinyTesterPropName = "tinyTester.input_timeout_time_msec"
whismanoid 61:38ec81c33b7a 2181 // tinyTesterPropValue = "250"
whismanoid 61:38ec81c33b7a 2182 tinyTester.input_timeout_time_msec = 250;
whismanoid 61:38ec81c33b7a 2183
whismanoid 61:38ec81c33b7a 2184 // @test tinyTester.settle_time_msec = 20 // default 250
whismanoid 59:c0376adb6ebc 2185 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2186 // docTest_item['action'] = 'tinyTester.settle_time_msec = 20'
whismanoid 61:38ec81c33b7a 2187 // docTest_item['remarks'] = 'default 250'
whismanoid 61:38ec81c33b7a 2188 // docTest_item['propName'] = 'tinyTester.settle_time_msec'
whismanoid 59:c0376adb6ebc 2189 // docTest_item['propValue'] = '20'
whismanoid 59:c0376adb6ebc 2190 // assign-propname-value
whismanoid 61:38ec81c33b7a 2191 // tinyTesterPropName = "tinyTester.settle_time_msec"
whismanoid 59:c0376adb6ebc 2192 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2193 tinyTester.settle_time_msec = 20;
whismanoid 61:38ec81c33b7a 2194
whismanoid 61:38ec81c33b7a 2195 // @test tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 59:c0376adb6ebc 2196 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 59:c0376adb6ebc 2197 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 59:c0376adb6ebc 2198 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 2199 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 59:c0376adb6ebc 2200 // docTest_item['propValue'] = '20'
whismanoid 59:c0376adb6ebc 2201 // assign-propname-value
whismanoid 59:c0376adb6ebc 2202 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 59:c0376adb6ebc 2203 // tinyTesterPropValue = "20"
whismanoid 59:c0376adb6ebc 2204 tinyTester.blink_time_msec = 20;
whismanoid 59:c0376adb6ebc 2205
whismanoid 61:38ec81c33b7a 2206 // @test tinyTester.input_timeout_time_msec = 100 // default 250
whismanoid 61:38ec81c33b7a 2207 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2208 // docTest_item['action'] = 'tinyTester.input_timeout_time_msec = 100'
whismanoid 61:38ec81c33b7a 2209 // docTest_item['remarks'] = 'default 250'
whismanoid 61:38ec81c33b7a 2210 // docTest_item['propName'] = 'tinyTester.input_timeout_time_msec'
whismanoid 61:38ec81c33b7a 2211 // docTest_item['propValue'] = '100'
whismanoid 61:38ec81c33b7a 2212 // assign-propname-value
whismanoid 61:38ec81c33b7a 2213 // tinyTesterPropName = "tinyTester.input_timeout_time_msec"
whismanoid 61:38ec81c33b7a 2214 // tinyTesterPropValue = "100"
whismanoid 61:38ec81c33b7a 2215 tinyTester.input_timeout_time_msec = 100;
whismanoid 61:38ec81c33b7a 2216
whismanoid 61:38ec81c33b7a 2217 // @test tinyTester.Wait_Output_Settling()
whismanoid 61:38ec81c33b7a 2218 // docTest_item['actionType'] = 'call-tinytester-function'
whismanoid 61:38ec81c33b7a 2219 // docTest_item['action'] = 'tinyTester.Wait_Output_Settling()'
whismanoid 61:38ec81c33b7a 2220 // docTest_item['propName'] = 'Wait_Output_Settling'
whismanoid 61:38ec81c33b7a 2221 // call-tinytester-function
whismanoid 61:38ec81c33b7a 2222 // tinyTesterFuncName = "tinyTester.Wait_Output_Settling"
whismanoid 61:38ec81c33b7a 2223 // docTest_argList = ""
whismanoid 61:38ec81c33b7a 2224 tinyTester.Wait_Output_Settling(); //
whismanoid 61:38ec81c33b7a 2225
whismanoid 61:38ec81c33b7a 2226 // @test group UNIPOLAR // Verify function VoltageOfCode_Unipolar
whismanoid 61:38ec81c33b7a 2227 // @test group UNIPOLAR tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2228 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2229 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2230 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 2231 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 2232 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2233 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 2234 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2235 // assign-propname-value
whismanoid 61:38ec81c33b7a 2236 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2237 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2238 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 2239 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2240
whismanoid 61:38ec81c33b7a 2241 // @test group UNIPOLAR Configure_CTRL_REF(2) expect 1 // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2242 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2243 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2244 // docTest_item['action'] = 'Configure_CTRL_REF(2) expect 1'
whismanoid 61:38ec81c33b7a 2245 // docTest_item['remarks'] = 'These tests require REF2 = 2.500V'
whismanoid 61:38ec81c33b7a 2246 // docTest_item['funcName'] = 'Configure_CTRL_REF'
whismanoid 61:38ec81c33b7a 2247 // docTest_item['arglist'] = '2'
whismanoid 61:38ec81c33b7a 2248 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2249 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR Configure_CTRL_REF These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2250 // call-function
whismanoid 61:38ec81c33b7a 2251 // ASSERT_EQ(g_MAX11410_device.Configure_CTRL_REF((uint8_t)2), (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2252 tinyTester.FunctionCall_Expect("MAX11410.Configure_CTRL_REF", fn_MAX11410_Configure_CTRL_REF, (uint8_t)2, /* expect: */ (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2253 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2254
whismanoid 61:38ec81c33b7a 2255 // @test group UNIPOLAR Configure_PGA(0,0) expect 1 // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2256 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2257 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2258 // docTest_item['action'] = 'Configure_PGA(0,0) expect 1'
whismanoid 61:38ec81c33b7a 2259 // docTest_item['remarks'] = 'These tests require PGA gain=1'
whismanoid 61:38ec81c33b7a 2260 // docTest_item['funcName'] = 'Configure_PGA'
whismanoid 61:38ec81c33b7a 2261 // docTest_item['arglist'] = '0,0'
whismanoid 61:38ec81c33b7a 2262 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2263 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR Configure_PGA These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2264 // call-function
whismanoid 61:38ec81c33b7a 2265 // ASSERT_EQ(g_MAX11410_device.Configure_PGA((uint8_t)0, (uint8_t)0), (uint8_t)1); // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2266 tinyTester.FunctionCall_Expect("MAX11410.Configure_PGA", fn_MAX11410_Configure_PGA, (uint8_t)0, (uint8_t)0, /* expect: */ (uint8_t)1); // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2267 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2268
whismanoid 61:38ec81c33b7a 2269 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xFFFFFF) expect 2.500 within 0.030 // Full Scale
whismanoid 61:38ec81c33b7a 2270 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2271 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2272 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xFFFFFF) expect 2.500 within 0.030'
whismanoid 61:38ec81c33b7a 2273 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2274 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2275 // docTest_item['arglist'] = '0xFFFFFF'
whismanoid 61:38ec81c33b7a 2276 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 2277 // docTest_item['within-value'] = '0.030'
whismanoid 61:38ec81c33b7a 2278 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Full Scale
whismanoid 61:38ec81c33b7a 2279 // call-function
whismanoid 61:38ec81c33b7a 2280 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xFFFFFF), (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2281 tinyTester.err_threshold = 0.030; // within 0.030
whismanoid 61:38ec81c33b7a 2282 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xFFFFFF, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2283 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2284
whismanoid 61:38ec81c33b7a 2285 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xFFFFFE) expect 2.500 // Full Scale
whismanoid 61:38ec81c33b7a 2286 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2287 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2288 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xFFFFFE) expect 2.500'
whismanoid 61:38ec81c33b7a 2289 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2290 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2291 // docTest_item['arglist'] = '0xFFFFFE'
whismanoid 61:38ec81c33b7a 2292 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 2293 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Full Scale
whismanoid 61:38ec81c33b7a 2294 // call-function
whismanoid 61:38ec81c33b7a 2295 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xFFFFFE), (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2296 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xFFFFFE, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2297 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2298
whismanoid 61:38ec81c33b7a 2299 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xCCCCCC) expect 2.000 // Two Volts
whismanoid 61:38ec81c33b7a 2300 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2301 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2302 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xCCCCCC) expect 2.000'
whismanoid 61:38ec81c33b7a 2303 // docTest_item['remarks'] = 'Two Volts'
whismanoid 61:38ec81c33b7a 2304 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2305 // docTest_item['arglist'] = '0xCCCCCC'
whismanoid 61:38ec81c33b7a 2306 // docTest_item['expect-value'] = '2.000'
whismanoid 61:38ec81c33b7a 2307 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Two Volts
whismanoid 61:38ec81c33b7a 2308 // call-function
whismanoid 61:38ec81c33b7a 2309 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xCCCCCC), (double)2.000); // Two Volts
whismanoid 61:38ec81c33b7a 2310 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xCCCCCC, /* expect: */ (double)2.000); // Two Volts
whismanoid 61:38ec81c33b7a 2311 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2312
whismanoid 61:38ec81c33b7a 2313 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xC00000) expect 1.875 // 75% Scale
whismanoid 61:38ec81c33b7a 2314 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2315 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2316 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xC00000) expect 1.875'
whismanoid 61:38ec81c33b7a 2317 // docTest_item['remarks'] = '75% Scale'
whismanoid 61:38ec81c33b7a 2318 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2319 // docTest_item['arglist'] = '0xC00000'
whismanoid 61:38ec81c33b7a 2320 // docTest_item['expect-value'] = '1.875'
whismanoid 61:38ec81c33b7a 2321 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 75% Scale
whismanoid 61:38ec81c33b7a 2322 // call-function
whismanoid 61:38ec81c33b7a 2323 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xC00000), (double)1.875); // 75% Scale
whismanoid 61:38ec81c33b7a 2324 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xC00000, /* expect: */ (double)1.875); // 75% Scale
whismanoid 61:38ec81c33b7a 2325 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2326
whismanoid 61:38ec81c33b7a 2327 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x800000) expect 1.250 // Mid Scale
whismanoid 61:38ec81c33b7a 2328 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2329 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2330 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x800000) expect 1.250'
whismanoid 61:38ec81c33b7a 2331 // docTest_item['remarks'] = 'Mid Scale'
whismanoid 61:38ec81c33b7a 2332 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2333 // docTest_item['arglist'] = '0x800000'
whismanoid 61:38ec81c33b7a 2334 // docTest_item['expect-value'] = '1.250'
whismanoid 61:38ec81c33b7a 2335 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Mid Scale
whismanoid 61:38ec81c33b7a 2336 // call-function
whismanoid 61:38ec81c33b7a 2337 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x800000), (double)1.250); // Mid Scale
whismanoid 61:38ec81c33b7a 2338 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x800000, /* expect: */ (double)1.250); // Mid Scale
whismanoid 61:38ec81c33b7a 2339 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2340
whismanoid 61:38ec81c33b7a 2341 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x666666) expect 1.000 // One Volt
whismanoid 61:38ec81c33b7a 2342 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2343 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2344 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x666666) expect 1.000'
whismanoid 61:38ec81c33b7a 2345 // docTest_item['remarks'] = 'One Volt'
whismanoid 61:38ec81c33b7a 2346 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2347 // docTest_item['arglist'] = '0x666666'
whismanoid 61:38ec81c33b7a 2348 // docTest_item['expect-value'] = '1.000'
whismanoid 61:38ec81c33b7a 2349 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar One Volt
whismanoid 61:38ec81c33b7a 2350 // call-function
whismanoid 61:38ec81c33b7a 2351 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x666666), (double)1.000); // One Volt
whismanoid 61:38ec81c33b7a 2352 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x666666, /* expect: */ (double)1.000); // One Volt
whismanoid 61:38ec81c33b7a 2353 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2354
whismanoid 61:38ec81c33b7a 2355 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x400000) expect 0.625 // 25% Scale
whismanoid 61:38ec81c33b7a 2356 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2357 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2358 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x400000) expect 0.625'
whismanoid 61:38ec81c33b7a 2359 // docTest_item['remarks'] = '25% Scale'
whismanoid 61:38ec81c33b7a 2360 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2361 // docTest_item['arglist'] = '0x400000'
whismanoid 61:38ec81c33b7a 2362 // docTest_item['expect-value'] = '0.625'
whismanoid 61:38ec81c33b7a 2363 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 25% Scale
whismanoid 61:38ec81c33b7a 2364 // call-function
whismanoid 61:38ec81c33b7a 2365 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x400000), (double)0.625); // 25% Scale
whismanoid 61:38ec81c33b7a 2366 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x400000, /* expect: */ (double)0.625); // 25% Scale
whismanoid 61:38ec81c33b7a 2367 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2368
whismanoid 61:38ec81c33b7a 2369 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x0A3D70) expect 0.100 // 100mV
whismanoid 61:38ec81c33b7a 2370 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2371 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2372 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x0A3D70) expect 0.100'
whismanoid 61:38ec81c33b7a 2373 // docTest_item['remarks'] = '100mV'
whismanoid 61:38ec81c33b7a 2374 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2375 // docTest_item['arglist'] = '0x0A3D70'
whismanoid 61:38ec81c33b7a 2376 // docTest_item['expect-value'] = '0.100'
whismanoid 61:38ec81c33b7a 2377 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 100mV
whismanoid 61:38ec81c33b7a 2378 // call-function
whismanoid 61:38ec81c33b7a 2379 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x0A3D70), (double)0.100); // 100mV
whismanoid 61:38ec81c33b7a 2380 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x0A3D70, /* expect: */ (double)0.100); // 100mV
whismanoid 61:38ec81c33b7a 2381 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2382
whismanoid 61:38ec81c33b7a 2383 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000064) expect 0.000014901162 // 100 LSB
whismanoid 61:38ec81c33b7a 2384 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2385 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2386 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000064) expect 0.000014901162'
whismanoid 61:38ec81c33b7a 2387 // docTest_item['remarks'] = '100 LSB'
whismanoid 61:38ec81c33b7a 2388 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2389 // docTest_item['arglist'] = '0x000064'
whismanoid 61:38ec81c33b7a 2390 // docTest_item['expect-value'] = '0.000014901162'
whismanoid 61:38ec81c33b7a 2391 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 100 LSB
whismanoid 61:38ec81c33b7a 2392 // call-function
whismanoid 61:38ec81c33b7a 2393 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000064), (double)0.000014901162); // 100 LSB
whismanoid 61:38ec81c33b7a 2394 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000064, /* expect: */ (double)0.000014901162); // 100 LSB
whismanoid 61:38ec81c33b7a 2395 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2396
whismanoid 61:38ec81c33b7a 2397 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x00000A) expect 0.0000014901162 // Ten LSB
whismanoid 61:38ec81c33b7a 2398 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2399 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2400 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x00000A) expect 0.0000014901162'
whismanoid 61:38ec81c33b7a 2401 // docTest_item['remarks'] = 'Ten LSB'
whismanoid 61:38ec81c33b7a 2402 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2403 // docTest_item['arglist'] = '0x00000A'
whismanoid 61:38ec81c33b7a 2404 // docTest_item['expect-value'] = '0.0000014901162'
whismanoid 61:38ec81c33b7a 2405 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Ten LSB
whismanoid 61:38ec81c33b7a 2406 // call-function
whismanoid 61:38ec81c33b7a 2407 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x00000A), (double)0.0000014901162); // Ten LSB
whismanoid 61:38ec81c33b7a 2408 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x00000A, /* expect: */ (double)0.0000014901162); // Ten LSB
whismanoid 61:38ec81c33b7a 2409 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2410
whismanoid 61:38ec81c33b7a 2411 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000003) expect 0.00000044703483 // Three LSB
whismanoid 61:38ec81c33b7a 2412 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2413 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2414 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000003) expect 0.00000044703483'
whismanoid 61:38ec81c33b7a 2415 // docTest_item['remarks'] = 'Three LSB'
whismanoid 61:38ec81c33b7a 2416 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2417 // docTest_item['arglist'] = '0x000003'
whismanoid 61:38ec81c33b7a 2418 // docTest_item['expect-value'] = '0.00000044703483'
whismanoid 61:38ec81c33b7a 2419 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Three LSB
whismanoid 61:38ec81c33b7a 2420 // call-function
whismanoid 61:38ec81c33b7a 2421 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000003), (double)0.00000044703483); // Three LSB
whismanoid 61:38ec81c33b7a 2422 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000003, /* expect: */ (double)0.00000044703483); // Three LSB
whismanoid 61:38ec81c33b7a 2423 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2424
whismanoid 61:38ec81c33b7a 2425 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000002) expect 0.00000029802326 // Two LSB
whismanoid 61:38ec81c33b7a 2426 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2427 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2428 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000002) expect 0.00000029802326'
whismanoid 61:38ec81c33b7a 2429 // docTest_item['remarks'] = 'Two LSB'
whismanoid 61:38ec81c33b7a 2430 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2431 // docTest_item['arglist'] = '0x000002'
whismanoid 61:38ec81c33b7a 2432 // docTest_item['expect-value'] = '0.00000029802326'
whismanoid 61:38ec81c33b7a 2433 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Two LSB
whismanoid 61:38ec81c33b7a 2434 // call-function
whismanoid 61:38ec81c33b7a 2435 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000002), (double)0.00000029802326); // Two LSB
whismanoid 61:38ec81c33b7a 2436 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000002, /* expect: */ (double)0.00000029802326); // Two LSB
whismanoid 61:38ec81c33b7a 2437 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2438
whismanoid 61:38ec81c33b7a 2439 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000001) expect 0.00000014901162 // One LSB
whismanoid 61:38ec81c33b7a 2440 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2441 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2442 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000001) expect 0.00000014901162'
whismanoid 61:38ec81c33b7a 2443 // docTest_item['remarks'] = 'One LSB'
whismanoid 61:38ec81c33b7a 2444 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2445 // docTest_item['arglist'] = '0x000001'
whismanoid 61:38ec81c33b7a 2446 // docTest_item['expect-value'] = '0.00000014901162'
whismanoid 61:38ec81c33b7a 2447 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar One LSB
whismanoid 61:38ec81c33b7a 2448 // call-function
whismanoid 61:38ec81c33b7a 2449 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000001), (double)0.00000014901162); // One LSB
whismanoid 61:38ec81c33b7a 2450 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000001, /* expect: */ (double)0.00000014901162); // One LSB
whismanoid 61:38ec81c33b7a 2451 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2452
whismanoid 61:38ec81c33b7a 2453 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000000) expect 0.0 // Zero Scale
whismanoid 61:38ec81c33b7a 2454 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2455 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2456 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000000) expect 0.0'
whismanoid 61:38ec81c33b7a 2457 // docTest_item['remarks'] = 'Zero Scale'
whismanoid 61:38ec81c33b7a 2458 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2459 // docTest_item['arglist'] = '0x000000'
whismanoid 61:38ec81c33b7a 2460 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 2461 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Zero Scale
whismanoid 61:38ec81c33b7a 2462 // call-function
whismanoid 61:38ec81c33b7a 2463 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000000), (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2464 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000000, /* expect: */ (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2465 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2466
whismanoid 61:38ec81c33b7a 2467 // @test group UNIPOLAR tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 2468 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2469 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2470 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 2471 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 2472 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2473 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 2474 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 2475 // assign-propname-value
whismanoid 61:38ec81c33b7a 2476 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2477 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 2478 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 2479 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2480
whismanoid 61:38ec81c33b7a 2481 // @test group BIPOB // Verify function VoltageOfCode_Bipolar_OffsetBinary
whismanoid 61:38ec81c33b7a 2482 // @test group BIPOB tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2483 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2484 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2485 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 2486 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 2487 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2488 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 2489 #if MAX11410_SELFTEST_BIPOB // group BIPOB None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2490 // assign-propname-value
whismanoid 61:38ec81c33b7a 2491 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2492 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2493 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 2494 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2495
whismanoid 61:38ec81c33b7a 2496 // @test group BIPOB Configure_CTRL_REF(2) expect 1 // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2497 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2498 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2499 // docTest_item['action'] = 'Configure_CTRL_REF(2) expect 1'
whismanoid 61:38ec81c33b7a 2500 // docTest_item['remarks'] = 'These tests require REF2 = 2.500V'
whismanoid 61:38ec81c33b7a 2501 // docTest_item['funcName'] = 'Configure_CTRL_REF'
whismanoid 61:38ec81c33b7a 2502 // docTest_item['arglist'] = '2'
whismanoid 61:38ec81c33b7a 2503 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2504 #if MAX11410_SELFTEST_BIPOB // group BIPOB Configure_CTRL_REF These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2505 // call-function
whismanoid 61:38ec81c33b7a 2506 // ASSERT_EQ(g_MAX11410_device.Configure_CTRL_REF((uint8_t)2), (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2507 tinyTester.FunctionCall_Expect("MAX11410.Configure_CTRL_REF", fn_MAX11410_Configure_CTRL_REF, (uint8_t)2, /* expect: */ (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2508 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2509
whismanoid 61:38ec81c33b7a 2510 // @test group BIPOB Configure_PGA(0,0) expect 1 // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2511 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2512 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2513 // docTest_item['action'] = 'Configure_PGA(0,0) expect 1'
whismanoid 61:38ec81c33b7a 2514 // docTest_item['remarks'] = 'These tests require PGA gain=1'
whismanoid 61:38ec81c33b7a 2515 // docTest_item['funcName'] = 'Configure_PGA'
whismanoid 61:38ec81c33b7a 2516 // docTest_item['arglist'] = '0,0'
whismanoid 61:38ec81c33b7a 2517 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2518 #if MAX11410_SELFTEST_BIPOB // group BIPOB Configure_PGA These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2519 // call-function
whismanoid 61:38ec81c33b7a 2520 // ASSERT_EQ(g_MAX11410_device.Configure_PGA((uint8_t)0, (uint8_t)0), (uint8_t)1); // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2521 tinyTester.FunctionCall_Expect("MAX11410.Configure_PGA", fn_MAX11410_Configure_PGA, (uint8_t)0, (uint8_t)0, /* expect: */ (uint8_t)1); // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2522 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2523
whismanoid 61:38ec81c33b7a 2524 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFF) expect 2.5 within 0.030 // Full Scale
whismanoid 61:38ec81c33b7a 2525 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2526 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2527 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFF) expect 2.5 within 0.030'
whismanoid 61:38ec81c33b7a 2528 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2529 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2530 // docTest_item['arglist'] = '0xFFFFFF'
whismanoid 61:38ec81c33b7a 2531 // docTest_item['expect-value'] = '2.5'
whismanoid 61:38ec81c33b7a 2532 // docTest_item['within-value'] = '0.030'
whismanoid 61:38ec81c33b7a 2533 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Full Scale
whismanoid 61:38ec81c33b7a 2534 // call-function
whismanoid 61:38ec81c33b7a 2535 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0xFFFFFF), (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2536 tinyTester.err_threshold = 0.030; // within 0.030
whismanoid 61:38ec81c33b7a 2537 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0xFFFFFF, /* expect: */ (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2538 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2539
whismanoid 61:38ec81c33b7a 2540 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFE) expect 2.5 // Full Scale
whismanoid 61:38ec81c33b7a 2541 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2542 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2543 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFE) expect 2.5'
whismanoid 61:38ec81c33b7a 2544 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2545 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2546 // docTest_item['arglist'] = '0xFFFFFE'
whismanoid 61:38ec81c33b7a 2547 // docTest_item['expect-value'] = '2.5'
whismanoid 61:38ec81c33b7a 2548 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Full Scale
whismanoid 61:38ec81c33b7a 2549 // call-function
whismanoid 61:38ec81c33b7a 2550 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0xFFFFFE), (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2551 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0xFFFFFE, /* expect: */ (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2552 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2553
whismanoid 61:38ec81c33b7a 2554 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0xC00000) expect 1.25 // Mid Scale
whismanoid 61:38ec81c33b7a 2555 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2556 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2557 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0xC00000) expect 1.25'
whismanoid 61:38ec81c33b7a 2558 // docTest_item['remarks'] = 'Mid Scale'
whismanoid 61:38ec81c33b7a 2559 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2560 // docTest_item['arglist'] = '0xC00000'
whismanoid 61:38ec81c33b7a 2561 // docTest_item['expect-value'] = '1.25'
whismanoid 61:38ec81c33b7a 2562 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Mid Scale
whismanoid 61:38ec81c33b7a 2563 // call-function
whismanoid 61:38ec81c33b7a 2564 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0xC00000), (double)1.25); // Mid Scale
whismanoid 61:38ec81c33b7a 2565 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0xC00000, /* expect: */ (double)1.25); // Mid Scale
whismanoid 61:38ec81c33b7a 2566 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2567
whismanoid 61:38ec81c33b7a 2568 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800003) expect 0.00000894069671 // Three LSB
whismanoid 61:38ec81c33b7a 2569 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2570 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2571 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800003) expect 0.00000894069671'
whismanoid 61:38ec81c33b7a 2572 // docTest_item['remarks'] = 'Three LSB'
whismanoid 61:38ec81c33b7a 2573 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2574 // docTest_item['arglist'] = '0x800003'
whismanoid 61:38ec81c33b7a 2575 // docTest_item['expect-value'] = '0.00000894069671'
whismanoid 61:38ec81c33b7a 2576 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Three LSB
whismanoid 61:38ec81c33b7a 2577 // call-function
whismanoid 61:38ec81c33b7a 2578 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800003), (double)0.00000894069671); // Three LSB
whismanoid 61:38ec81c33b7a 2579 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800003, /* expect: */ (double)0.00000894069671); // Three LSB
whismanoid 61:38ec81c33b7a 2580 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2581
whismanoid 61:38ec81c33b7a 2582 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800002) expect 0.00000596046447 // Two LSB
whismanoid 61:38ec81c33b7a 2583 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2584 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2585 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800002) expect 0.00000596046447'
whismanoid 61:38ec81c33b7a 2586 // docTest_item['remarks'] = 'Two LSB'
whismanoid 61:38ec81c33b7a 2587 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2588 // docTest_item['arglist'] = '0x800002'
whismanoid 61:38ec81c33b7a 2589 // docTest_item['expect-value'] = '0.00000596046447'
whismanoid 61:38ec81c33b7a 2590 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Two LSB
whismanoid 61:38ec81c33b7a 2591 // call-function
whismanoid 61:38ec81c33b7a 2592 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800002), (double)0.00000596046447); // Two LSB
whismanoid 61:38ec81c33b7a 2593 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800002, /* expect: */ (double)0.00000596046447); // Two LSB
whismanoid 61:38ec81c33b7a 2594 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2595
whismanoid 61:38ec81c33b7a 2596 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800001) expect 0.0000029802326 // One LSB
whismanoid 61:38ec81c33b7a 2597 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2598 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2599 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800001) expect 0.0000029802326'
whismanoid 61:38ec81c33b7a 2600 // docTest_item['remarks'] = 'One LSB'
whismanoid 61:38ec81c33b7a 2601 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2602 // docTest_item['arglist'] = '0x800001'
whismanoid 61:38ec81c33b7a 2603 // docTest_item['expect-value'] = '0.0000029802326'
whismanoid 61:38ec81c33b7a 2604 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary One LSB
whismanoid 61:38ec81c33b7a 2605 // call-function
whismanoid 61:38ec81c33b7a 2606 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800001), (double)0.0000029802326); // One LSB
whismanoid 61:38ec81c33b7a 2607 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800001, /* expect: */ (double)0.0000029802326); // One LSB
whismanoid 61:38ec81c33b7a 2608 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2609
whismanoid 61:38ec81c33b7a 2610 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800000) expect 0.0 // Zero Scale
whismanoid 61:38ec81c33b7a 2611 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2612 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2613 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800000) expect 0.0'
whismanoid 61:38ec81c33b7a 2614 // docTest_item['remarks'] = 'Zero Scale'
whismanoid 61:38ec81c33b7a 2615 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2616 // docTest_item['arglist'] = '0x800000'
whismanoid 61:38ec81c33b7a 2617 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 2618 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Zero Scale
whismanoid 61:38ec81c33b7a 2619 // call-function
whismanoid 61:38ec81c33b7a 2620 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800000), (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2621 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800000, /* expect: */ (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2622 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2623
whismanoid 61:38ec81c33b7a 2624 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFF) expect -0.0000029802326 // Negative One LSB
whismanoid 61:38ec81c33b7a 2625 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2626 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2627 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFF) expect -0.0000029802326'
whismanoid 61:38ec81c33b7a 2628 // docTest_item['remarks'] = 'Negative One LSB'
whismanoid 61:38ec81c33b7a 2629 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2630 // docTest_item['arglist'] = '0x7FFFFF'
whismanoid 61:38ec81c33b7a 2631 // docTest_item['expect-value'] = '-0.0000029802326'
whismanoid 61:38ec81c33b7a 2632 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative One LSB
whismanoid 61:38ec81c33b7a 2633 // call-function
whismanoid 61:38ec81c33b7a 2634 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x7FFFFF), (double)-0.0000029802326); // Negative One LSB
whismanoid 61:38ec81c33b7a 2635 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x7FFFFF, /* expect: */ (double)-0.0000029802326); // Negative One LSB
whismanoid 61:38ec81c33b7a 2636 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2637
whismanoid 61:38ec81c33b7a 2638 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFE) expect -0.0000059604644 // Negative Two LSB
whismanoid 61:38ec81c33b7a 2639 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2640 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2641 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFE) expect -0.0000059604644'
whismanoid 61:38ec81c33b7a 2642 // docTest_item['remarks'] = 'Negative Two LSB'
whismanoid 61:38ec81c33b7a 2643 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2644 // docTest_item['arglist'] = '0x7FFFFE'
whismanoid 61:38ec81c33b7a 2645 // docTest_item['expect-value'] = '-0.0000059604644'
whismanoid 61:38ec81c33b7a 2646 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Two LSB
whismanoid 61:38ec81c33b7a 2647 // call-function
whismanoid 61:38ec81c33b7a 2648 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x7FFFFE), (double)-0.0000059604644); // Negative Two LSB
whismanoid 61:38ec81c33b7a 2649 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x7FFFFE, /* expect: */ (double)-0.0000059604644); // Negative Two LSB
whismanoid 61:38ec81c33b7a 2650 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2651
whismanoid 61:38ec81c33b7a 2652 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFD) expect -0.0000089406967 // Negative Three LSB
whismanoid 61:38ec81c33b7a 2653 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2654 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2655 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFD) expect -0.0000089406967'
whismanoid 61:38ec81c33b7a 2656 // docTest_item['remarks'] = 'Negative Three LSB'
whismanoid 61:38ec81c33b7a 2657 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2658 // docTest_item['arglist'] = '0x7FFFFD'
whismanoid 61:38ec81c33b7a 2659 // docTest_item['expect-value'] = '-0.0000089406967'
whismanoid 61:38ec81c33b7a 2660 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Three LSB
whismanoid 61:38ec81c33b7a 2661 // call-function
whismanoid 61:38ec81c33b7a 2662 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x7FFFFD), (double)-0.0000089406967); // Negative Three LSB
whismanoid 61:38ec81c33b7a 2663 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x7FFFFD, /* expect: */ (double)-0.0000089406967); // Negative Three LSB
whismanoid 61:38ec81c33b7a 2664 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2665
whismanoid 61:38ec81c33b7a 2666 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x400000) expect -1.25 // Negative Mid Scale
whismanoid 61:38ec81c33b7a 2667 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2668 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2669 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x400000) expect -1.25'
whismanoid 61:38ec81c33b7a 2670 // docTest_item['remarks'] = 'Negative Mid Scale'
whismanoid 61:38ec81c33b7a 2671 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2672 // docTest_item['arglist'] = '0x400000'
whismanoid 61:38ec81c33b7a 2673 // docTest_item['expect-value'] = '-1.25'
whismanoid 61:38ec81c33b7a 2674 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Mid Scale
whismanoid 61:38ec81c33b7a 2675 // call-function
whismanoid 61:38ec81c33b7a 2676 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x400000), (double)-1.25); // Negative Mid Scale
whismanoid 61:38ec81c33b7a 2677 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x400000, /* expect: */ (double)-1.25); // Negative Mid Scale
whismanoid 61:38ec81c33b7a 2678 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2679
whismanoid 61:38ec81c33b7a 2680 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x000001) expect -2.5 // Negative Full Scale
whismanoid 61:38ec81c33b7a 2681 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2682 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2683 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x000001) expect -2.5'
whismanoid 61:38ec81c33b7a 2684 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 2685 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2686 // docTest_item['arglist'] = '0x000001'
whismanoid 61:38ec81c33b7a 2687 // docTest_item['expect-value'] = '-2.5'
whismanoid 61:38ec81c33b7a 2688 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Full Scale
whismanoid 61:38ec81c33b7a 2689 // call-function
whismanoid 61:38ec81c33b7a 2690 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x000001), (double)-2.5); // Negative Full Scale
whismanoid 61:38ec81c33b7a 2691 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x000001, /* expect: */ (double)-2.5); // Negative Full Scale
whismanoid 61:38ec81c33b7a 2692 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2693
whismanoid 61:38ec81c33b7a 2694 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x000000) expect -2.5 // Negative Full Scale
whismanoid 61:38ec81c33b7a 2695 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2696 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2697 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x000000) expect -2.5'
whismanoid 61:38ec81c33b7a 2698 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 2699 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2700 // docTest_item['arglist'] = '0x000000'
whismanoid 61:38ec81c33b7a 2701 // docTest_item['expect-value'] = '-2.5'
whismanoid 61:38ec81c33b7a 2702 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Full Scale
whismanoid 61:38ec81c33b7a 2703 // call-function
whismanoid 61:38ec81c33b7a 2704 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x000000), (double)-2.5); // Negative Full Scale
whismanoid 61:38ec81c33b7a 2705 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x000000, /* expect: */ (double)-2.5); // Negative Full Scale
whismanoid 61:38ec81c33b7a 2706 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2707
whismanoid 61:38ec81c33b7a 2708 // @test group BIPOB tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 2709 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2710 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2711 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 2712 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 2713 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2714 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 2715 #if MAX11410_SELFTEST_BIPOB // group BIPOB None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 2716 // assign-propname-value
whismanoid 61:38ec81c33b7a 2717 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2718 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 2719 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 2720 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2721
whismanoid 61:38ec81c33b7a 2722 // @test group BIP2C // Verify function VoltageOfCode_Bipolar_2sComplement
whismanoid 61:38ec81c33b7a 2723 // @test group BIP2C tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2724 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2725 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2726 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 2727 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 2728 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2729 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 2730 #if MAX11410_SELFTEST_BIP2C // group BIP2C None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2731 // assign-propname-value
whismanoid 61:38ec81c33b7a 2732 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2733 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2734 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 2735 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2736
whismanoid 61:38ec81c33b7a 2737 // @test group BIP2C Configure_CTRL_REF(2) expect 1 // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2738 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2739 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2740 // docTest_item['action'] = 'Configure_CTRL_REF(2) expect 1'
whismanoid 61:38ec81c33b7a 2741 // docTest_item['remarks'] = 'These tests require REF2 = 2.500V'
whismanoid 61:38ec81c33b7a 2742 // docTest_item['funcName'] = 'Configure_CTRL_REF'
whismanoid 61:38ec81c33b7a 2743 // docTest_item['arglist'] = '2'
whismanoid 61:38ec81c33b7a 2744 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2745 #if MAX11410_SELFTEST_BIP2C // group BIP2C Configure_CTRL_REF These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2746 // call-function
whismanoid 61:38ec81c33b7a 2747 // ASSERT_EQ(g_MAX11410_device.Configure_CTRL_REF((uint8_t)2), (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2748 tinyTester.FunctionCall_Expect("MAX11410.Configure_CTRL_REF", fn_MAX11410_Configure_CTRL_REF, (uint8_t)2, /* expect: */ (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2749 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2750
whismanoid 61:38ec81c33b7a 2751 // @test group BIP2C Configure_PGA(0,0) expect 1 // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2752 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2753 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2754 // docTest_item['action'] = 'Configure_PGA(0,0) expect 1'
whismanoid 61:38ec81c33b7a 2755 // docTest_item['remarks'] = 'These tests require PGA gain=1'
whismanoid 61:38ec81c33b7a 2756 // docTest_item['funcName'] = 'Configure_PGA'
whismanoid 61:38ec81c33b7a 2757 // docTest_item['arglist'] = '0,0'
whismanoid 61:38ec81c33b7a 2758 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2759 #if MAX11410_SELFTEST_BIP2C // group BIP2C Configure_PGA These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2760 // call-function
whismanoid 61:38ec81c33b7a 2761 // ASSERT_EQ(g_MAX11410_device.Configure_PGA((uint8_t)0, (uint8_t)0), (uint8_t)1); // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2762 tinyTester.FunctionCall_Expect("MAX11410.Configure_PGA", fn_MAX11410_Configure_PGA, (uint8_t)0, (uint8_t)0, /* expect: */ (uint8_t)1); // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2763 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2764
whismanoid 61:38ec81c33b7a 2765 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x7FFFFF) expect 2.500 within 0.030 // Full Scale
whismanoid 61:38ec81c33b7a 2766 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2767 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2768 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x7FFFFF) expect 2.500 within 0.030'
whismanoid 61:38ec81c33b7a 2769 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2770 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2771 // docTest_item['arglist'] = '0x7FFFFF'
whismanoid 61:38ec81c33b7a 2772 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 2773 // docTest_item['within-value'] = '0.030'
whismanoid 61:38ec81c33b7a 2774 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Full Scale
whismanoid 61:38ec81c33b7a 2775 // call-function
whismanoid 61:38ec81c33b7a 2776 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x7FFFFF), (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2777 tinyTester.err_threshold = 0.030; // within 0.030
whismanoid 61:38ec81c33b7a 2778 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x7FFFFF, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2779 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2780
whismanoid 61:38ec81c33b7a 2781 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x7FFFFE) expect 2.500 // Full Scale
whismanoid 61:38ec81c33b7a 2782 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2783 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2784 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x7FFFFE) expect 2.500'
whismanoid 61:38ec81c33b7a 2785 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2786 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2787 // docTest_item['arglist'] = '0x7FFFFE'
whismanoid 61:38ec81c33b7a 2788 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 2789 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Full Scale
whismanoid 61:38ec81c33b7a 2790 // call-function
whismanoid 61:38ec81c33b7a 2791 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x7FFFFE), (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2792 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x7FFFFE, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2793 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2794
whismanoid 61:38ec81c33b7a 2795 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x666666) expect 2.000 // Two Volts
whismanoid 61:38ec81c33b7a 2796 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2797 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2798 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x666666) expect 2.000'
whismanoid 61:38ec81c33b7a 2799 // docTest_item['remarks'] = 'Two Volts'
whismanoid 61:38ec81c33b7a 2800 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2801 // docTest_item['arglist'] = '0x666666'
whismanoid 61:38ec81c33b7a 2802 // docTest_item['expect-value'] = '2.000'
whismanoid 61:38ec81c33b7a 2803 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Two Volts
whismanoid 61:38ec81c33b7a 2804 // call-function
whismanoid 61:38ec81c33b7a 2805 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x666666), (double)2.000); // Two Volts
whismanoid 61:38ec81c33b7a 2806 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x666666, /* expect: */ (double)2.000); // Two Volts
whismanoid 61:38ec81c33b7a 2807 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2808
whismanoid 61:38ec81c33b7a 2809 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x600000) expect 1.875 // 75% Scale
whismanoid 61:38ec81c33b7a 2810 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2811 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2812 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x600000) expect 1.875'
whismanoid 61:38ec81c33b7a 2813 // docTest_item['remarks'] = '75% Scale'
whismanoid 61:38ec81c33b7a 2814 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2815 // docTest_item['arglist'] = '0x600000'
whismanoid 61:38ec81c33b7a 2816 // docTest_item['expect-value'] = '1.875'
whismanoid 61:38ec81c33b7a 2817 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement 75% Scale
whismanoid 61:38ec81c33b7a 2818 // call-function
whismanoid 61:38ec81c33b7a 2819 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x600000), (double)1.875); // 75% Scale
whismanoid 61:38ec81c33b7a 2820 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x600000, /* expect: */ (double)1.875); // 75% Scale
whismanoid 61:38ec81c33b7a 2821 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2822
whismanoid 61:38ec81c33b7a 2823 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x400000) expect 1.250 // Mid Scale
whismanoid 61:38ec81c33b7a 2824 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2825 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2826 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x400000) expect 1.250'
whismanoid 61:38ec81c33b7a 2827 // docTest_item['remarks'] = 'Mid Scale'
whismanoid 61:38ec81c33b7a 2828 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2829 // docTest_item['arglist'] = '0x400000'
whismanoid 61:38ec81c33b7a 2830 // docTest_item['expect-value'] = '1.250'
whismanoid 61:38ec81c33b7a 2831 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Mid Scale
whismanoid 61:38ec81c33b7a 2832 // call-function
whismanoid 61:38ec81c33b7a 2833 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x400000), (double)1.250); // Mid Scale
whismanoid 61:38ec81c33b7a 2834 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x400000, /* expect: */ (double)1.250); // Mid Scale
whismanoid 61:38ec81c33b7a 2835 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2836
whismanoid 61:38ec81c33b7a 2837 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x333333) expect 1.000 // One Volt
whismanoid 61:38ec81c33b7a 2838 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2839 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2840 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x333333) expect 1.000'
whismanoid 61:38ec81c33b7a 2841 // docTest_item['remarks'] = 'One Volt'
whismanoid 61:38ec81c33b7a 2842 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2843 // docTest_item['arglist'] = '0x333333'
whismanoid 61:38ec81c33b7a 2844 // docTest_item['expect-value'] = '1.000'
whismanoid 61:38ec81c33b7a 2845 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement One Volt
whismanoid 61:38ec81c33b7a 2846 // call-function
whismanoid 61:38ec81c33b7a 2847 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x333333), (double)1.000); // One Volt
whismanoid 61:38ec81c33b7a 2848 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x333333, /* expect: */ (double)1.000); // One Volt
whismanoid 61:38ec81c33b7a 2849 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2850
whismanoid 61:38ec81c33b7a 2851 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x200000) expect 0.625 // 25% Scale
whismanoid 61:38ec81c33b7a 2852 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2853 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2854 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x200000) expect 0.625'
whismanoid 61:38ec81c33b7a 2855 // docTest_item['remarks'] = '25% Scale'
whismanoid 61:38ec81c33b7a 2856 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2857 // docTest_item['arglist'] = '0x200000'
whismanoid 61:38ec81c33b7a 2858 // docTest_item['expect-value'] = '0.625'
whismanoid 61:38ec81c33b7a 2859 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement 25% Scale
whismanoid 61:38ec81c33b7a 2860 // call-function
whismanoid 61:38ec81c33b7a 2861 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x200000), (double)0.625); // 25% Scale
whismanoid 61:38ec81c33b7a 2862 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x200000, /* expect: */ (double)0.625); // 25% Scale
whismanoid 61:38ec81c33b7a 2863 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2864
whismanoid 61:38ec81c33b7a 2865 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x051eb8) expect 0.100 // 100mV
whismanoid 61:38ec81c33b7a 2866 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2867 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2868 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x051eb8) expect 0.100'
whismanoid 61:38ec81c33b7a 2869 // docTest_item['remarks'] = '100mV'
whismanoid 61:38ec81c33b7a 2870 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2871 // docTest_item['arglist'] = '0x051eb8'
whismanoid 61:38ec81c33b7a 2872 // docTest_item['expect-value'] = '0.100'
whismanoid 61:38ec81c33b7a 2873 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement 100mV
whismanoid 61:38ec81c33b7a 2874 // call-function
whismanoid 61:38ec81c33b7a 2875 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x051eb8), (double)0.100); // 100mV
whismanoid 61:38ec81c33b7a 2876 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x051eb8, /* expect: */ (double)0.100); // 100mV
whismanoid 61:38ec81c33b7a 2877 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2878
whismanoid 61:38ec81c33b7a 2879 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000003) expect 0.00000894069671 // Three LSB
whismanoid 61:38ec81c33b7a 2880 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2881 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2882 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000003) expect 0.00000894069671'
whismanoid 61:38ec81c33b7a 2883 // docTest_item['remarks'] = 'Three LSB'
whismanoid 61:38ec81c33b7a 2884 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2885 // docTest_item['arglist'] = '0x000003'
whismanoid 61:38ec81c33b7a 2886 // docTest_item['expect-value'] = '0.00000894069671'
whismanoid 61:38ec81c33b7a 2887 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Three LSB
whismanoid 61:38ec81c33b7a 2888 // call-function
whismanoid 61:38ec81c33b7a 2889 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000003), (double)0.00000894069671); // Three LSB
whismanoid 61:38ec81c33b7a 2890 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000003, /* expect: */ (double)0.00000894069671); // Three LSB
whismanoid 61:38ec81c33b7a 2891 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2892
whismanoid 61:38ec81c33b7a 2893 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000002) expect 0.00000596046447 // Two LSB
whismanoid 61:38ec81c33b7a 2894 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2895 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2896 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000002) expect 0.00000596046447'
whismanoid 61:38ec81c33b7a 2897 // docTest_item['remarks'] = 'Two LSB'
whismanoid 61:38ec81c33b7a 2898 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2899 // docTest_item['arglist'] = '0x000002'
whismanoid 61:38ec81c33b7a 2900 // docTest_item['expect-value'] = '0.00000596046447'
whismanoid 61:38ec81c33b7a 2901 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Two LSB
whismanoid 61:38ec81c33b7a 2902 // call-function
whismanoid 61:38ec81c33b7a 2903 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000002), (double)0.00000596046447); // Two LSB
whismanoid 61:38ec81c33b7a 2904 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000002, /* expect: */ (double)0.00000596046447); // Two LSB
whismanoid 61:38ec81c33b7a 2905 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2906
whismanoid 61:38ec81c33b7a 2907 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000001) expect 0.0000029802326 // One LSB
whismanoid 61:38ec81c33b7a 2908 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2909 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2910 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000001) expect 0.0000029802326'
whismanoid 61:38ec81c33b7a 2911 // docTest_item['remarks'] = 'One LSB'
whismanoid 61:38ec81c33b7a 2912 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2913 // docTest_item['arglist'] = '0x000001'
whismanoid 61:38ec81c33b7a 2914 // docTest_item['expect-value'] = '0.0000029802326'
whismanoid 61:38ec81c33b7a 2915 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement One LSB
whismanoid 61:38ec81c33b7a 2916 // call-function
whismanoid 61:38ec81c33b7a 2917 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000001), (double)0.0000029802326); // One LSB
whismanoid 61:38ec81c33b7a 2918 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000001, /* expect: */ (double)0.0000029802326); // One LSB
whismanoid 61:38ec81c33b7a 2919 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2920
whismanoid 61:38ec81c33b7a 2921 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000000) expect 0.0 // Zero Scale
whismanoid 61:38ec81c33b7a 2922 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2923 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2924 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000000) expect 0.0'
whismanoid 61:38ec81c33b7a 2925 // docTest_item['remarks'] = 'Zero Scale'
whismanoid 61:38ec81c33b7a 2926 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2927 // docTest_item['arglist'] = '0x000000'
whismanoid 61:38ec81c33b7a 2928 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 2929 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Zero Scale
whismanoid 61:38ec81c33b7a 2930 // call-function
whismanoid 61:38ec81c33b7a 2931 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000000), (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2932 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000000, /* expect: */ (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2933 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2934
whismanoid 61:38ec81c33b7a 2935 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFFFFFF) expect -0.0000029802326 // Negative One LSB
whismanoid 61:38ec81c33b7a 2936 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2937 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2938 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFFFFFF) expect -0.0000029802326'
whismanoid 61:38ec81c33b7a 2939 // docTest_item['remarks'] = 'Negative One LSB'
whismanoid 61:38ec81c33b7a 2940 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2941 // docTest_item['arglist'] = '0xFFFFFF'
whismanoid 61:38ec81c33b7a 2942 // docTest_item['expect-value'] = '-0.0000029802326'
whismanoid 61:38ec81c33b7a 2943 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative One LSB
whismanoid 61:38ec81c33b7a 2944 // call-function
whismanoid 61:38ec81c33b7a 2945 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFFFFFF), (double)-0.0000029802326); // Negative One LSB
whismanoid 61:38ec81c33b7a 2946 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFFFFFF, /* expect: */ (double)-0.0000029802326); // Negative One LSB
whismanoid 61:38ec81c33b7a 2947 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2948
whismanoid 61:38ec81c33b7a 2949 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFFFFFE) expect -0.0000059604644 // Negative Two LSB
whismanoid 61:38ec81c33b7a 2950 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2951 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2952 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFFFFFE) expect -0.0000059604644'
whismanoid 61:38ec81c33b7a 2953 // docTest_item['remarks'] = 'Negative Two LSB'
whismanoid 61:38ec81c33b7a 2954 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2955 // docTest_item['arglist'] = '0xFFFFFE'
whismanoid 61:38ec81c33b7a 2956 // docTest_item['expect-value'] = '-0.0000059604644'
whismanoid 61:38ec81c33b7a 2957 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Two LSB
whismanoid 61:38ec81c33b7a 2958 // call-function
whismanoid 61:38ec81c33b7a 2959 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFFFFFE), (double)-0.0000059604644); // Negative Two LSB
whismanoid 61:38ec81c33b7a 2960 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFFFFFE, /* expect: */ (double)-0.0000059604644); // Negative Two LSB
whismanoid 61:38ec81c33b7a 2961 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2962
whismanoid 61:38ec81c33b7a 2963 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFFFFFD) expect -0.0000089406967 // Negative Three LSB
whismanoid 61:38ec81c33b7a 2964 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2965 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2966 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFFFFFD) expect -0.0000089406967'
whismanoid 61:38ec81c33b7a 2967 // docTest_item['remarks'] = 'Negative Three LSB'
whismanoid 61:38ec81c33b7a 2968 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2969 // docTest_item['arglist'] = '0xFFFFFD'
whismanoid 61:38ec81c33b7a 2970 // docTest_item['expect-value'] = '-0.0000089406967'
whismanoid 61:38ec81c33b7a 2971 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Three LSB
whismanoid 61:38ec81c33b7a 2972 // call-function
whismanoid 61:38ec81c33b7a 2973 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFFFFFD), (double)-0.0000089406967); // Negative Three LSB
whismanoid 61:38ec81c33b7a 2974 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFFFFFD, /* expect: */ (double)-0.0000089406967); // Negative Three LSB
whismanoid 61:38ec81c33b7a 2975 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2976
whismanoid 61:38ec81c33b7a 2977 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFAE148) expect -0.100 // Negative 100mV
whismanoid 61:38ec81c33b7a 2978 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2979 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2980 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFAE148) expect -0.100'
whismanoid 61:38ec81c33b7a 2981 // docTest_item['remarks'] = 'Negative 100mV'
whismanoid 61:38ec81c33b7a 2982 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2983 // docTest_item['arglist'] = '0xFAE148'
whismanoid 61:38ec81c33b7a 2984 // docTest_item['expect-value'] = '-0.100'
whismanoid 61:38ec81c33b7a 2985 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative 100mV
whismanoid 61:38ec81c33b7a 2986 // call-function
whismanoid 61:38ec81c33b7a 2987 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFAE148), (double)-0.100); // Negative 100mV
whismanoid 61:38ec81c33b7a 2988 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFAE148, /* expect: */ (double)-0.100); // Negative 100mV
whismanoid 61:38ec81c33b7a 2989 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 2990
whismanoid 61:38ec81c33b7a 2991 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xE00000) expect -0.625 // Negative 25% Scale
whismanoid 61:38ec81c33b7a 2992 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2993 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 2994 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xE00000) expect -0.625'
whismanoid 61:38ec81c33b7a 2995 // docTest_item['remarks'] = 'Negative 25% Scale'
whismanoid 61:38ec81c33b7a 2996 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 2997 // docTest_item['arglist'] = '0xE00000'
whismanoid 61:38ec81c33b7a 2998 // docTest_item['expect-value'] = '-0.625'
whismanoid 61:38ec81c33b7a 2999 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative 25% Scale
whismanoid 61:38ec81c33b7a 3000 // call-function
whismanoid 61:38ec81c33b7a 3001 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xE00000), (double)-0.625); // Negative 25% Scale
whismanoid 61:38ec81c33b7a 3002 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xE00000, /* expect: */ (double)-0.625); // Negative 25% Scale
whismanoid 61:38ec81c33b7a 3003 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3004
whismanoid 61:38ec81c33b7a 3005 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xCCCCCD) expect -1.000 // Negative One Volt
whismanoid 61:38ec81c33b7a 3006 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3007 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3008 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xCCCCCD) expect -1.000'
whismanoid 61:38ec81c33b7a 3009 // docTest_item['remarks'] = 'Negative One Volt'
whismanoid 61:38ec81c33b7a 3010 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3011 // docTest_item['arglist'] = '0xCCCCCD'
whismanoid 61:38ec81c33b7a 3012 // docTest_item['expect-value'] = '-1.000'
whismanoid 61:38ec81c33b7a 3013 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative One Volt
whismanoid 61:38ec81c33b7a 3014 // call-function
whismanoid 61:38ec81c33b7a 3015 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xCCCCCD), (double)-1.000); // Negative One Volt
whismanoid 61:38ec81c33b7a 3016 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xCCCCCD, /* expect: */ (double)-1.000); // Negative One Volt
whismanoid 61:38ec81c33b7a 3017 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3018
whismanoid 61:38ec81c33b7a 3019 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xC00000) expect -1.250 // Negative Mid Scale
whismanoid 61:38ec81c33b7a 3020 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3021 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3022 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xC00000) expect -1.250'
whismanoid 61:38ec81c33b7a 3023 // docTest_item['remarks'] = 'Negative Mid Scale'
whismanoid 61:38ec81c33b7a 3024 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3025 // docTest_item['arglist'] = '0xC00000'
whismanoid 61:38ec81c33b7a 3026 // docTest_item['expect-value'] = '-1.250'
whismanoid 61:38ec81c33b7a 3027 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Mid Scale
whismanoid 61:38ec81c33b7a 3028 // call-function
whismanoid 61:38ec81c33b7a 3029 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xC00000), (double)-1.250); // Negative Mid Scale
whismanoid 61:38ec81c33b7a 3030 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xC00000, /* expect: */ (double)-1.250); // Negative Mid Scale
whismanoid 61:38ec81c33b7a 3031 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3032
whismanoid 61:38ec81c33b7a 3033 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xA00000) expect -1.875 // Negative 75% Scale
whismanoid 61:38ec81c33b7a 3034 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3035 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3036 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xA00000) expect -1.875'
whismanoid 61:38ec81c33b7a 3037 // docTest_item['remarks'] = 'Negative 75% Scale'
whismanoid 61:38ec81c33b7a 3038 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3039 // docTest_item['arglist'] = '0xA00000'
whismanoid 61:38ec81c33b7a 3040 // docTest_item['expect-value'] = '-1.875'
whismanoid 61:38ec81c33b7a 3041 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative 75% Scale
whismanoid 61:38ec81c33b7a 3042 // call-function
whismanoid 61:38ec81c33b7a 3043 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xA00000), (double)-1.875); // Negative 75% Scale
whismanoid 61:38ec81c33b7a 3044 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xA00000, /* expect: */ (double)-1.875); // Negative 75% Scale
whismanoid 61:38ec81c33b7a 3045 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3046
whismanoid 61:38ec81c33b7a 3047 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x99999A) expect -2.000 // Negative Two Volts
whismanoid 61:38ec81c33b7a 3048 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3049 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3050 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x99999A) expect -2.000'
whismanoid 61:38ec81c33b7a 3051 // docTest_item['remarks'] = 'Negative Two Volts'
whismanoid 61:38ec81c33b7a 3052 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3053 // docTest_item['arglist'] = '0x99999A'
whismanoid 61:38ec81c33b7a 3054 // docTest_item['expect-value'] = '-2.000'
whismanoid 61:38ec81c33b7a 3055 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Two Volts
whismanoid 61:38ec81c33b7a 3056 // call-function
whismanoid 61:38ec81c33b7a 3057 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x99999A), (double)-2.000); // Negative Two Volts
whismanoid 61:38ec81c33b7a 3058 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x99999A, /* expect: */ (double)-2.000); // Negative Two Volts
whismanoid 61:38ec81c33b7a 3059 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3060
whismanoid 61:38ec81c33b7a 3061 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x800001) expect -2.500 // Negative Full Scale
whismanoid 61:38ec81c33b7a 3062 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3063 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3064 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x800001) expect -2.500'
whismanoid 61:38ec81c33b7a 3065 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 3066 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3067 // docTest_item['arglist'] = '0x800001'
whismanoid 61:38ec81c33b7a 3068 // docTest_item['expect-value'] = '-2.500'
whismanoid 61:38ec81c33b7a 3069 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Full Scale
whismanoid 61:38ec81c33b7a 3070 // call-function
whismanoid 61:38ec81c33b7a 3071 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x800001), (double)-2.500); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3072 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x800001, /* expect: */ (double)-2.500); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3073 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3074
whismanoid 61:38ec81c33b7a 3075 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x800000) expect -2.500 // Negative Full Scale
whismanoid 61:38ec81c33b7a 3076 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3077 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3078 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x800000) expect -2.500'
whismanoid 61:38ec81c33b7a 3079 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 3080 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3081 // docTest_item['arglist'] = '0x800000'
whismanoid 61:38ec81c33b7a 3082 // docTest_item['expect-value'] = '-2.500'
whismanoid 61:38ec81c33b7a 3083 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Full Scale
whismanoid 61:38ec81c33b7a 3084 // call-function
whismanoid 61:38ec81c33b7a 3085 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x800000), (double)-2.500); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3086 tinyTester.FunctionCall_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x800000, /* expect: */ (double)-2.500); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3087 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3088
whismanoid 61:38ec81c33b7a 3089 // @test group BIP2C tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3090 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3091 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3092 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3093 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3094 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3095 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3096 #if MAX11410_SELFTEST_BIP2C // group BIP2C None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3097 // assign-propname-value
whismanoid 61:38ec81c33b7a 3098 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3099 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3100 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3101 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3102
whismanoid 61:38ec81c33b7a 3103 // @test group RTD_PT1000 // PT1000 type Resistive Temperature Device (RTD)
whismanoid 61:38ec81c33b7a 3104 // @test group RTD_PT1000 tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3105 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3106 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3107 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3108 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3109 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3110 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3111 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3112 // assign-propname-value
whismanoid 61:38ec81c33b7a 3113 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3114 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3115 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3116 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3117
whismanoid 61:38ec81c33b7a 3118 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(842.94) expect -40.0 within 0.1 // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3119 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3120 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3121 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(842.94) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3122 // docTest_item['remarks'] = 'PT-1000 RTD at -40C'
whismanoid 61:38ec81c33b7a 3123 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3124 // docTest_item['arglist'] = '842.94'
whismanoid 61:38ec81c33b7a 3125 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3126 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3127 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3128 // call-function
whismanoid 61:38ec81c33b7a 3129 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)842.94), (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3130 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3131 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)842.94, /* expect: */ (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3132 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3133
whismanoid 61:38ec81c33b7a 3134 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1000.0) expect 0.0 within 0.1 // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3135 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3136 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3137 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1000.0) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3138 // docTest_item['remarks'] = 'PT-1000 RTD at 0C'
whismanoid 61:38ec81c33b7a 3139 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3140 // docTest_item['arglist'] = '1000.0'
whismanoid 61:38ec81c33b7a 3141 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3142 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3143 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3144 // call-function
whismanoid 61:38ec81c33b7a 3145 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1000.0), (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3146 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3147 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1000.0, /* expect: */ (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3148 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3149
whismanoid 61:38ec81c33b7a 3150 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1097.3) expect 25.0 within 0.1 // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3151 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3152 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3153 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1097.3) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3154 // docTest_item['remarks'] = 'PT-1000 RTD at 25C'
whismanoid 61:38ec81c33b7a 3155 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3156 // docTest_item['arglist'] = '1097.3'
whismanoid 61:38ec81c33b7a 3157 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3158 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3159 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3160 // call-function
whismanoid 61:38ec81c33b7a 3161 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1097.3), (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3162 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3163 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1097.3, /* expect: */ (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3164 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3165
whismanoid 61:38ec81c33b7a 3166 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1328.1) expect 85.0 within 0.1 // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3167 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3168 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3169 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1328.1) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3170 // docTest_item['remarks'] = 'PT-1000 RTD at 85C'
whismanoid 61:38ec81c33b7a 3171 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3172 // docTest_item['arglist'] = '1328.1'
whismanoid 61:38ec81c33b7a 3173 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3174 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3175 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3176 // call-function
whismanoid 61:38ec81c33b7a 3177 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1328.1), (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3178 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3179 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1328.1, /* expect: */ (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3180 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3181
whismanoid 61:38ec81c33b7a 3182 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1479.5) expect 125.0 within 0.1 // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3183 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3184 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3185 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1479.5) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3186 // docTest_item['remarks'] = 'PT-1000 RTD at 125C'
whismanoid 61:38ec81c33b7a 3187 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3188 // docTest_item['arglist'] = '1479.5'
whismanoid 61:38ec81c33b7a 3189 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3190 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3191 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3192 // call-function
whismanoid 61:38ec81c33b7a 3193 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1479.5), (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3194 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3195 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1479.5, /* expect: */ (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3196 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3197
whismanoid 61:38ec81c33b7a 3198 // @test group RTD_PT1000 tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3199 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3200 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3201 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3202 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3203 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3204 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3205 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3206 // assign-propname-value
whismanoid 61:38ec81c33b7a 3207 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3208 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3209 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3210 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3211
whismanoid 61:38ec81c33b7a 3212 // @test group RTD_PT100 // PT100 type Resistive Temperature Device (RTD)
whismanoid 61:38ec81c33b7a 3213 // @test group RTD_PT100 tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3214 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3215 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3216 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3217 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3218 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3219 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3220 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3221 // assign-propname-value
whismanoid 61:38ec81c33b7a 3222 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3223 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3224 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3225 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3226
whismanoid 61:38ec81c33b7a 3227 // @test group RTD_PT100 TemperatureOfRTD_PT100(84.294) expect -40.0 within 0.1 // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3228 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3229 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3230 // docTest_item['action'] = 'TemperatureOfRTD_PT100(84.294) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3231 // docTest_item['remarks'] = 'PT-100 RTD at -40C'
whismanoid 61:38ec81c33b7a 3232 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3233 // docTest_item['arglist'] = '84.294'
whismanoid 61:38ec81c33b7a 3234 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3235 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3236 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3237 // call-function
whismanoid 61:38ec81c33b7a 3238 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)84.294), (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3239 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3240 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)84.294, /* expect: */ (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3241 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3242
whismanoid 61:38ec81c33b7a 3243 // @test group RTD_PT100 TemperatureOfRTD_PT100(100.00) expect 0.0 within 0.1 // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3244 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3245 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3246 // docTest_item['action'] = 'TemperatureOfRTD_PT100(100.00) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3247 // docTest_item['remarks'] = 'PT-100 RTD at 0C'
whismanoid 61:38ec81c33b7a 3248 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3249 // docTest_item['arglist'] = '100.00'
whismanoid 61:38ec81c33b7a 3250 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3251 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3252 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3253 // call-function
whismanoid 61:38ec81c33b7a 3254 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)100.00), (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3255 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3256 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)100.00, /* expect: */ (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3257 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3258
whismanoid 61:38ec81c33b7a 3259 // @test group RTD_PT100 TemperatureOfRTD_PT100(109.73) expect 25.0 within 0.1 // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3260 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3261 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3262 // docTest_item['action'] = 'TemperatureOfRTD_PT100(109.73) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3263 // docTest_item['remarks'] = 'PT-100 RTD at 25C'
whismanoid 61:38ec81c33b7a 3264 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3265 // docTest_item['arglist'] = '109.73'
whismanoid 61:38ec81c33b7a 3266 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3267 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3268 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3269 // call-function
whismanoid 61:38ec81c33b7a 3270 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)109.73), (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3271 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3272 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)109.73, /* expect: */ (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3273 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3274
whismanoid 61:38ec81c33b7a 3275 // @test group RTD_PT100 TemperatureOfRTD_PT100(132.81) expect 85.0 within 0.1 // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3276 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3277 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3278 // docTest_item['action'] = 'TemperatureOfRTD_PT100(132.81) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3279 // docTest_item['remarks'] = 'PT-100 RTD at 85C'
whismanoid 61:38ec81c33b7a 3280 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3281 // docTest_item['arglist'] = '132.81'
whismanoid 61:38ec81c33b7a 3282 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3283 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3284 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3285 // call-function
whismanoid 61:38ec81c33b7a 3286 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)132.81), (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3287 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3288 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)132.81, /* expect: */ (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3289 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3290
whismanoid 61:38ec81c33b7a 3291 // @test group RTD_PT100 TemperatureOfRTD_PT100(147.95) expect 125.0 within 0.1 // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3292 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3293 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3294 // docTest_item['action'] = 'TemperatureOfRTD_PT100(147.95) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3295 // docTest_item['remarks'] = 'PT-100 RTD at 125C'
whismanoid 61:38ec81c33b7a 3296 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3297 // docTest_item['arglist'] = '147.95'
whismanoid 61:38ec81c33b7a 3298 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3299 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3300 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3301 // call-function
whismanoid 61:38ec81c33b7a 3302 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)147.95), (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3303 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3304 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)147.95, /* expect: */ (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3305 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3306
whismanoid 61:38ec81c33b7a 3307 // @test group RTD_PT100 tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3308 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3309 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3310 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3311 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3312 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3313 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3314 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3315 // assign-propname-value
whismanoid 61:38ec81c33b7a 3316 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3317 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3318 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3319 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3320
whismanoid 61:38ec81c33b7a 3321 // @test group RTD // Verify function TemperatureOfRTD
whismanoid 61:38ec81c33b7a 3322 // @test group RTD tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3323 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3324 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3325 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3326 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3327 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3328 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3329 #if MAX11410_SELFTEST_RTD // group RTD None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3330 // assign-propname-value
whismanoid 61:38ec81c33b7a 3331 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3332 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3333 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3334 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3335
whismanoid 61:38ec81c33b7a 3336 // @test group RTD TemperatureOfRTD(84.294) expect -40.0 within 0.1 // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3337 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3338 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3339 // docTest_item['action'] = 'TemperatureOfRTD(84.294) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3340 // docTest_item['remarks'] = 'PT-100 RTD at -40C'
whismanoid 61:38ec81c33b7a 3341 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3342 // docTest_item['arglist'] = '84.294'
whismanoid 61:38ec81c33b7a 3343 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3344 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3345 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3346 // call-function
whismanoid 61:38ec81c33b7a 3347 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)84.294), (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3348 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3349 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)84.294, /* expect: */ (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3350 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3351
whismanoid 61:38ec81c33b7a 3352 // @test group RTD TemperatureOfRTD(100.00) expect 0.0 within 0.1 // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3353 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3354 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3355 // docTest_item['action'] = 'TemperatureOfRTD(100.00) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3356 // docTest_item['remarks'] = 'PT-100 RTD at 0C'
whismanoid 61:38ec81c33b7a 3357 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3358 // docTest_item['arglist'] = '100.00'
whismanoid 61:38ec81c33b7a 3359 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3360 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3361 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3362 // call-function
whismanoid 61:38ec81c33b7a 3363 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)100.00), (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3364 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3365 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)100.00, /* expect: */ (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3366 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3367
whismanoid 61:38ec81c33b7a 3368 // @test group RTD TemperatureOfRTD(109.73) expect 25.0 within 0.1 // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3369 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3370 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3371 // docTest_item['action'] = 'TemperatureOfRTD(109.73) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3372 // docTest_item['remarks'] = 'PT-100 RTD at 25C'
whismanoid 61:38ec81c33b7a 3373 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3374 // docTest_item['arglist'] = '109.73'
whismanoid 61:38ec81c33b7a 3375 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3376 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3377 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3378 // call-function
whismanoid 61:38ec81c33b7a 3379 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)109.73), (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3380 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3381 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)109.73, /* expect: */ (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3382 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3383
whismanoid 61:38ec81c33b7a 3384 // @test group RTD TemperatureOfRTD(132.81) expect 85.0 within 0.1 // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3385 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3386 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3387 // docTest_item['action'] = 'TemperatureOfRTD(132.81) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3388 // docTest_item['remarks'] = 'PT-100 RTD at 85C'
whismanoid 61:38ec81c33b7a 3389 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3390 // docTest_item['arglist'] = '132.81'
whismanoid 61:38ec81c33b7a 3391 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3392 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3393 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3394 // call-function
whismanoid 61:38ec81c33b7a 3395 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)132.81), (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3396 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3397 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)132.81, /* expect: */ (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3398 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3399
whismanoid 61:38ec81c33b7a 3400 // @test group RTD TemperatureOfRTD(147.95) expect 125.0 within 0.1 // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3401 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3402 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3403 // docTest_item['action'] = 'TemperatureOfRTD(147.95) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3404 // docTest_item['remarks'] = 'PT-100 RTD at 125C'
whismanoid 61:38ec81c33b7a 3405 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3406 // docTest_item['arglist'] = '147.95'
whismanoid 61:38ec81c33b7a 3407 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3408 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3409 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3410 // call-function
whismanoid 61:38ec81c33b7a 3411 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)147.95), (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3412 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3413 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)147.95, /* expect: */ (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3414 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3415
whismanoid 61:38ec81c33b7a 3416 // @test group RTD TemperatureOfRTD(842.94) expect -40.0 within 0.1 // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3417 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3418 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3419 // docTest_item['action'] = 'TemperatureOfRTD(842.94) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3420 // docTest_item['remarks'] = 'PT-1000 RTD at -40C'
whismanoid 61:38ec81c33b7a 3421 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3422 // docTest_item['arglist'] = '842.94'
whismanoid 61:38ec81c33b7a 3423 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3424 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3425 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3426 // call-function
whismanoid 61:38ec81c33b7a 3427 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)842.94), (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3428 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3429 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)842.94, /* expect: */ (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3430 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3431
whismanoid 61:38ec81c33b7a 3432 // @test group RTD TemperatureOfRTD(1000.0) expect 0.0 within 0.1 // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3433 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3434 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3435 // docTest_item['action'] = 'TemperatureOfRTD(1000.0) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3436 // docTest_item['remarks'] = 'PT-1000 RTD at 0C'
whismanoid 61:38ec81c33b7a 3437 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3438 // docTest_item['arglist'] = '1000.0'
whismanoid 61:38ec81c33b7a 3439 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3440 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3441 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3442 // call-function
whismanoid 61:38ec81c33b7a 3443 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1000.0), (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3444 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3445 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1000.0, /* expect: */ (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3446 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3447
whismanoid 61:38ec81c33b7a 3448 // @test group RTD TemperatureOfRTD(1097.3) expect 25.0 within 0.1 // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3449 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3450 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3451 // docTest_item['action'] = 'TemperatureOfRTD(1097.3) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3452 // docTest_item['remarks'] = 'PT-1000 RTD at 25C'
whismanoid 61:38ec81c33b7a 3453 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3454 // docTest_item['arglist'] = '1097.3'
whismanoid 61:38ec81c33b7a 3455 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3456 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3457 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3458 // call-function
whismanoid 61:38ec81c33b7a 3459 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1097.3), (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3460 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3461 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1097.3, /* expect: */ (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3462 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3463
whismanoid 61:38ec81c33b7a 3464 // @test group RTD TemperatureOfRTD(1328.1) expect 85.0 within 0.1 // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3465 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3466 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3467 // docTest_item['action'] = 'TemperatureOfRTD(1328.1) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3468 // docTest_item['remarks'] = 'PT-1000 RTD at 85C'
whismanoid 61:38ec81c33b7a 3469 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3470 // docTest_item['arglist'] = '1328.1'
whismanoid 61:38ec81c33b7a 3471 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3472 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3473 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3474 // call-function
whismanoid 61:38ec81c33b7a 3475 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1328.1), (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3476 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3477 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1328.1, /* expect: */ (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3478 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3479
whismanoid 61:38ec81c33b7a 3480 // @test group RTD TemperatureOfRTD(1479.5) expect 125.0 within 0.1 // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3481 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3482 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3483 // docTest_item['action'] = 'TemperatureOfRTD(1479.5) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3484 // docTest_item['remarks'] = 'PT-1000 RTD at 125C'
whismanoid 61:38ec81c33b7a 3485 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3486 // docTest_item['arglist'] = '1479.5'
whismanoid 61:38ec81c33b7a 3487 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3488 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3489 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3490 // call-function
whismanoid 61:38ec81c33b7a 3491 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1479.5), (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3492 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 61:38ec81c33b7a 3493 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1479.5, /* expect: */ (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3494 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3495
whismanoid 61:38ec81c33b7a 3496 // @test group RTD tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3497 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3498 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3499 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3500 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3501 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3502 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3503 #if MAX11410_SELFTEST_RTD // group RTD None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3504 // assign-propname-value
whismanoid 61:38ec81c33b7a 3505 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3506 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3507 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3508 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3509
whismanoid 61:38ec81c33b7a 3510 // @test group TC_1 // Verify Thermocouple function TemperatureOfTC_TypeK
whismanoid 61:38ec81c33b7a 3511 // @test group TC_2 // Verify Thermocouple function TemperatureOfTC_TypeK in more detail
whismanoid 61:38ec81c33b7a 3512 // @test group TC_1 tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3513 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3514 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 61:38ec81c33b7a 3515 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3516 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3517 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3518 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3519 #if MAX11410_SELFTEST_TC_1 // group TC_1 None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3520 // assign-propname-value
whismanoid 61:38ec81c33b7a 3521 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3522 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3523 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3524 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 61:38ec81c33b7a 3525
whismanoid 61:38ec81c33b7a 3526 // @test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV
whismanoid 59:c0376adb6ebc 3527 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3528 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3529 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1'
whismanoid 59:c0376adb6ebc 3530 // docTest_item['remarks'] = 'TC_TypeK at 0C = 0.000mV'
whismanoid 59:c0376adb6ebc 3531 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3532 // docTest_item['arglist'] = '0.000e-3'
whismanoid 59:c0376adb6ebc 3533 // docTest_item['expect-value'] = '0.0'
whismanoid 59:c0376adb6ebc 3534 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3535 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 0C = 0.000mV
whismanoid 59:c0376adb6ebc 3536 // call-function
whismanoid 59:c0376adb6ebc 3537 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.000e-3), (double)0.0); // TC_TypeK at 0C = 0.000mV
whismanoid 52:d3fb6f1722bf 3538 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3539 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.000e-3, /* expect: */ (double)0.0); // TC_TypeK at 0C = 0.000mV
whismanoid 52:d3fb6f1722bf 3540 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3541
whismanoid 61:38ec81c33b7a 3542 // @test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV
whismanoid 59:c0376adb6ebc 3543 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3544 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3545 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1'
whismanoid 59:c0376adb6ebc 3546 // docTest_item['remarks'] = 'TC_TypeK at 1C = 0.039mV'
whismanoid 59:c0376adb6ebc 3547 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3548 // docTest_item['arglist'] = '0.039e-3'
whismanoid 59:c0376adb6ebc 3549 // docTest_item['expect-value'] = '1.0'
whismanoid 59:c0376adb6ebc 3550 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3551 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 1C = 0.039mV
whismanoid 59:c0376adb6ebc 3552 // call-function
whismanoid 59:c0376adb6ebc 3553 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.039e-3), (double)1.0); // TC_TypeK at 1C = 0.039mV
whismanoid 52:d3fb6f1722bf 3554 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3555 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.039e-3, /* expect: */ (double)1.0); // TC_TypeK at 1C = 0.039mV
whismanoid 52:d3fb6f1722bf 3556 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3557
whismanoid 61:38ec81c33b7a 3558 // @test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3559 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3560 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3561 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1'
whismanoid 59:c0376adb6ebc 3562 // docTest_item['remarks'] = 'TC_TypeK at 2C = 0.079mV'
whismanoid 59:c0376adb6ebc 3563 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3564 // docTest_item['arglist'] = '0.079e-3'
whismanoid 59:c0376adb6ebc 3565 // docTest_item['expect-value'] = '2.0'
whismanoid 59:c0376adb6ebc 3566 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3567 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3568 // call-function
whismanoid 59:c0376adb6ebc 3569 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.079e-3), (double)2.0); // TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3570 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3571 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.079e-3, /* expect: */ (double)2.0); // TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3572 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3573
whismanoid 61:38ec81c33b7a 3574 // @test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV
whismanoid 59:c0376adb6ebc 3575 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3576 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3577 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1'
whismanoid 59:c0376adb6ebc 3578 // docTest_item['remarks'] = 'TC_TypeK at 3C = 0.119mV'
whismanoid 59:c0376adb6ebc 3579 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3580 // docTest_item['arglist'] = '0.119e-3'
whismanoid 59:c0376adb6ebc 3581 // docTest_item['expect-value'] = '3.0'
whismanoid 59:c0376adb6ebc 3582 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3583 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 3C = 0.119mV
whismanoid 59:c0376adb6ebc 3584 // call-function
whismanoid 59:c0376adb6ebc 3585 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.119e-3), (double)3.0); // TC_TypeK at 3C = 0.119mV
whismanoid 52:d3fb6f1722bf 3586 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3587 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.119e-3, /* expect: */ (double)3.0); // TC_TypeK at 3C = 0.119mV
whismanoid 59:c0376adb6ebc 3588 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3589
whismanoid 61:38ec81c33b7a 3590 // @test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV
whismanoid 59:c0376adb6ebc 3591 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3592 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3593 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1'
whismanoid 59:c0376adb6ebc 3594 // docTest_item['remarks'] = 'TC_TypeK at 4C = 0.158mV'
whismanoid 59:c0376adb6ebc 3595 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3596 // docTest_item['arglist'] = '0.158e-3'
whismanoid 59:c0376adb6ebc 3597 // docTest_item['expect-value'] = '4.0'
whismanoid 59:c0376adb6ebc 3598 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3599 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 4C = 0.158mV
whismanoid 59:c0376adb6ebc 3600 // call-function
whismanoid 59:c0376adb6ebc 3601 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.158e-3), (double)4.0); // TC_TypeK at 4C = 0.158mV
whismanoid 59:c0376adb6ebc 3602 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3603 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.158e-3, /* expect: */ (double)4.0); // TC_TypeK at 4C = 0.158mV
whismanoid 52:d3fb6f1722bf 3604 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3605
whismanoid 61:38ec81c33b7a 3606 // @test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV
whismanoid 59:c0376adb6ebc 3607 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3608 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3609 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1'
whismanoid 59:c0376adb6ebc 3610 // docTest_item['remarks'] = 'TC_TypeK at 5C = 0.198mV'
whismanoid 59:c0376adb6ebc 3611 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3612 // docTest_item['arglist'] = '0.198e-3'
whismanoid 59:c0376adb6ebc 3613 // docTest_item['expect-value'] = '5.0'
whismanoid 59:c0376adb6ebc 3614 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3615 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 5C = 0.198mV
whismanoid 59:c0376adb6ebc 3616 // call-function
whismanoid 59:c0376adb6ebc 3617 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.198e-3), (double)5.0); // TC_TypeK at 5C = 0.198mV
whismanoid 52:d3fb6f1722bf 3618 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3619 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.198e-3, /* expect: */ (double)5.0); // TC_TypeK at 5C = 0.198mV
whismanoid 52:d3fb6f1722bf 3620 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3621
whismanoid 61:38ec81c33b7a 3622 // @test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV
whismanoid 59:c0376adb6ebc 3623 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3624 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3625 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1'
whismanoid 59:c0376adb6ebc 3626 // docTest_item['remarks'] = 'TC_TypeK at 6C = 0.238mV'
whismanoid 59:c0376adb6ebc 3627 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3628 // docTest_item['arglist'] = '0.238e-3'
whismanoid 59:c0376adb6ebc 3629 // docTest_item['expect-value'] = '6.0'
whismanoid 59:c0376adb6ebc 3630 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3631 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 6C = 0.238mV
whismanoid 59:c0376adb6ebc 3632 // call-function
whismanoid 59:c0376adb6ebc 3633 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.238e-3), (double)6.0); // TC_TypeK at 6C = 0.238mV
whismanoid 52:d3fb6f1722bf 3634 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3635 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.238e-3, /* expect: */ (double)6.0); // TC_TypeK at 6C = 0.238mV
whismanoid 52:d3fb6f1722bf 3636 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3637
whismanoid 61:38ec81c33b7a 3638 // @test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV
whismanoid 59:c0376adb6ebc 3639 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3640 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3641 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1'
whismanoid 59:c0376adb6ebc 3642 // docTest_item['remarks'] = 'TC_TypeK at 7C = 0.2775mV'
whismanoid 59:c0376adb6ebc 3643 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3644 // docTest_item['arglist'] = '0.2775e-3'
whismanoid 59:c0376adb6ebc 3645 // docTest_item['expect-value'] = '7.0'
whismanoid 59:c0376adb6ebc 3646 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3647 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 7C = 0.2775mV
whismanoid 59:c0376adb6ebc 3648 // call-function
whismanoid 59:c0376adb6ebc 3649 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.2775e-3), (double)7.0); // TC_TypeK at 7C = 0.2775mV
whismanoid 52:d3fb6f1722bf 3650 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3651 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.2775e-3, /* expect: */ (double)7.0); // TC_TypeK at 7C = 0.2775mV
whismanoid 59:c0376adb6ebc 3652 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3653
whismanoid 61:38ec81c33b7a 3654 // @test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3655 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3656 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3657 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1'
whismanoid 59:c0376adb6ebc 3658 // docTest_item['remarks'] = 'TC_TypeK at 8C = 0.317mV'
whismanoid 59:c0376adb6ebc 3659 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3660 // docTest_item['arglist'] = '0.317e-3'
whismanoid 59:c0376adb6ebc 3661 // docTest_item['expect-value'] = '8.0'
whismanoid 59:c0376adb6ebc 3662 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3663 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3664 // call-function
whismanoid 59:c0376adb6ebc 3665 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.317e-3), (double)8.0); // TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3666 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3667 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.317e-3, /* expect: */ (double)8.0); // TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3668 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3669
whismanoid 61:38ec81c33b7a 3670 // @test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV
whismanoid 59:c0376adb6ebc 3671 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3672 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3673 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1'
whismanoid 59:c0376adb6ebc 3674 // docTest_item['remarks'] = 'TC_TypeK at 9C = 0.357mV'
whismanoid 59:c0376adb6ebc 3675 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3676 // docTest_item['arglist'] = '0.357e-3'
whismanoid 59:c0376adb6ebc 3677 // docTest_item['expect-value'] = '9.0'
whismanoid 59:c0376adb6ebc 3678 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3679 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 9C = 0.357mV
whismanoid 59:c0376adb6ebc 3680 // call-function
whismanoid 59:c0376adb6ebc 3681 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.357e-3), (double)9.0); // TC_TypeK at 9C = 0.357mV
whismanoid 52:d3fb6f1722bf 3682 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3683 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.357e-3, /* expect: */ (double)9.0); // TC_TypeK at 9C = 0.357mV
whismanoid 59:c0376adb6ebc 3684 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3685
whismanoid 61:38ec81c33b7a 3686 // @test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV
whismanoid 59:c0376adb6ebc 3687 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3688 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3689 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1'
whismanoid 59:c0376adb6ebc 3690 // docTest_item['remarks'] = 'TC_TypeK at 10C = 0.397mV'
whismanoid 59:c0376adb6ebc 3691 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3692 // docTest_item['arglist'] = '0.397e-3'
whismanoid 59:c0376adb6ebc 3693 // docTest_item['expect-value'] = '10.0'
whismanoid 59:c0376adb6ebc 3694 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3695 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 10C = 0.397mV
whismanoid 59:c0376adb6ebc 3696 // call-function
whismanoid 59:c0376adb6ebc 3697 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.397e-3), (double)10.0); // TC_TypeK at 10C = 0.397mV
whismanoid 59:c0376adb6ebc 3698 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3699 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.397e-3, /* expect: */ (double)10.0); // TC_TypeK at 10C = 0.397mV
whismanoid 52:d3fb6f1722bf 3700 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3701
whismanoid 61:38ec81c33b7a 3702 // @test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 3703 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3704 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3705 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1'
whismanoid 59:c0376adb6ebc 3706 // docTest_item['remarks'] = 'TC_TypeK at 20C = 0.798mV'
whismanoid 59:c0376adb6ebc 3707 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3708 // docTest_item['arglist'] = '0.798e-3'
whismanoid 59:c0376adb6ebc 3709 // docTest_item['expect-value'] = '20.0'
whismanoid 59:c0376adb6ebc 3710 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3711 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 3712 // call-function
whismanoid 59:c0376adb6ebc 3713 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.798e-3), (double)20.0); // TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 3714 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3715 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)0.798e-3, /* expect: */ (double)20.0); // TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 3716 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3717
whismanoid 61:38ec81c33b7a 3718 // @test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV
whismanoid 59:c0376adb6ebc 3719 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3720 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3721 // docTest_item['action'] = 'TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1'
whismanoid 59:c0376adb6ebc 3722 // docTest_item['remarks'] = 'TC_TypeK at 27C = 1.081mV'
whismanoid 59:c0376adb6ebc 3723 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3724 // docTest_item['arglist'] = '1.081e-3'
whismanoid 59:c0376adb6ebc 3725 // docTest_item['expect-value'] = '27.0'
whismanoid 59:c0376adb6ebc 3726 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3727 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 27C = 1.081mV
whismanoid 59:c0376adb6ebc 3728 // call-function
whismanoid 59:c0376adb6ebc 3729 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)1.081e-3), (double)27.0); // TC_TypeK at 27C = 1.081mV
whismanoid 52:d3fb6f1722bf 3730 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3731 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)1.081e-3, /* expect: */ (double)27.0); // TC_TypeK at 27C = 1.081mV
whismanoid 52:d3fb6f1722bf 3732 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3733
whismanoid 61:38ec81c33b7a 3734 // @test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV
whismanoid 59:c0376adb6ebc 3735 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3736 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3737 // docTest_item['action'] = 'TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1'
whismanoid 59:c0376adb6ebc 3738 // docTest_item['remarks'] = 'TC_TypeK at 30C = 1.203mV'
whismanoid 59:c0376adb6ebc 3739 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3740 // docTest_item['arglist'] = '1.203e-3'
whismanoid 59:c0376adb6ebc 3741 // docTest_item['expect-value'] = '30.0'
whismanoid 59:c0376adb6ebc 3742 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3743 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 30C = 1.203mV
whismanoid 59:c0376adb6ebc 3744 // call-function
whismanoid 59:c0376adb6ebc 3745 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)1.203e-3), (double)30.0); // TC_TypeK at 30C = 1.203mV
whismanoid 52:d3fb6f1722bf 3746 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3747 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)1.203e-3, /* expect: */ (double)30.0); // TC_TypeK at 30C = 1.203mV
whismanoid 52:d3fb6f1722bf 3748 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3749
whismanoid 61:38ec81c33b7a 3750 // @test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV
whismanoid 59:c0376adb6ebc 3751 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3752 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3753 // docTest_item['action'] = 'TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1'
whismanoid 59:c0376adb6ebc 3754 // docTest_item['remarks'] = 'TC_TypeK at 40C = 1.612mV'
whismanoid 59:c0376adb6ebc 3755 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3756 // docTest_item['arglist'] = '1.612e-3'
whismanoid 59:c0376adb6ebc 3757 // docTest_item['expect-value'] = '40.0'
whismanoid 59:c0376adb6ebc 3758 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3759 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 40C = 1.612mV
whismanoid 59:c0376adb6ebc 3760 // call-function
whismanoid 59:c0376adb6ebc 3761 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)1.612e-3), (double)40.0); // TC_TypeK at 40C = 1.612mV
whismanoid 52:d3fb6f1722bf 3762 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3763 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)1.612e-3, /* expect: */ (double)40.0); // TC_TypeK at 40C = 1.612mV
whismanoid 52:d3fb6f1722bf 3764 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3765
whismanoid 61:38ec81c33b7a 3766 // @test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV
whismanoid 59:c0376adb6ebc 3767 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3768 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3769 // docTest_item['action'] = 'TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1'
whismanoid 59:c0376adb6ebc 3770 // docTest_item['remarks'] = 'TC_TypeK at 50C = 2.023mV'
whismanoid 59:c0376adb6ebc 3771 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3772 // docTest_item['arglist'] = '2.023e-3'
whismanoid 59:c0376adb6ebc 3773 // docTest_item['expect-value'] = '50.0'
whismanoid 59:c0376adb6ebc 3774 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3775 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 50C = 2.023mV
whismanoid 59:c0376adb6ebc 3776 // call-function
whismanoid 59:c0376adb6ebc 3777 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)2.023e-3), (double)50.0); // TC_TypeK at 50C = 2.023mV
whismanoid 52:d3fb6f1722bf 3778 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3779 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)2.023e-3, /* expect: */ (double)50.0); // TC_TypeK at 50C = 2.023mV
whismanoid 59:c0376adb6ebc 3780 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3781
whismanoid 61:38ec81c33b7a 3782 // @test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV
whismanoid 59:c0376adb6ebc 3783 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3784 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3785 // docTest_item['action'] = 'TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1'
whismanoid 59:c0376adb6ebc 3786 // docTest_item['remarks'] = 'TC_TypeK at 60C = 2.436mV'
whismanoid 59:c0376adb6ebc 3787 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3788 // docTest_item['arglist'] = '2.436e-3'
whismanoid 59:c0376adb6ebc 3789 // docTest_item['expect-value'] = '60.0'
whismanoid 59:c0376adb6ebc 3790 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3791 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 60C = 2.436mV
whismanoid 59:c0376adb6ebc 3792 // call-function
whismanoid 59:c0376adb6ebc 3793 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)2.436e-3), (double)60.0); // TC_TypeK at 60C = 2.436mV
whismanoid 52:d3fb6f1722bf 3794 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3795 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)2.436e-3, /* expect: */ (double)60.0); // TC_TypeK at 60C = 2.436mV
whismanoid 59:c0376adb6ebc 3796 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3797
whismanoid 61:38ec81c33b7a 3798 // @test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV
whismanoid 59:c0376adb6ebc 3799 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3800 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3801 // docTest_item['action'] = 'TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1'
whismanoid 59:c0376adb6ebc 3802 // docTest_item['remarks'] = 'TC_TypeK at 70C = 2.851mV'
whismanoid 59:c0376adb6ebc 3803 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3804 // docTest_item['arglist'] = '2.851e-3'
whismanoid 59:c0376adb6ebc 3805 // docTest_item['expect-value'] = '70.0'
whismanoid 59:c0376adb6ebc 3806 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3807 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 70C = 2.851mV
whismanoid 59:c0376adb6ebc 3808 // call-function
whismanoid 59:c0376adb6ebc 3809 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)2.851e-3), (double)70.0); // TC_TypeK at 70C = 2.851mV
whismanoid 52:d3fb6f1722bf 3810 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3811 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)2.851e-3, /* expect: */ (double)70.0); // TC_TypeK at 70C = 2.851mV
whismanoid 59:c0376adb6ebc 3812 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3813
whismanoid 61:38ec81c33b7a 3814 // @test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV
whismanoid 59:c0376adb6ebc 3815 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3816 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3817 // docTest_item['action'] = 'TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1'
whismanoid 59:c0376adb6ebc 3818 // docTest_item['remarks'] = 'TC_TypeK at 80C = 3.267mV'
whismanoid 59:c0376adb6ebc 3819 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3820 // docTest_item['arglist'] = '3.267e-3'
whismanoid 59:c0376adb6ebc 3821 // docTest_item['expect-value'] = '80.0'
whismanoid 59:c0376adb6ebc 3822 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3823 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 80C = 3.267mV
whismanoid 59:c0376adb6ebc 3824 // call-function
whismanoid 59:c0376adb6ebc 3825 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)3.267e-3), (double)80.0); // TC_TypeK at 80C = 3.267mV
whismanoid 52:d3fb6f1722bf 3826 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3827 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)3.267e-3, /* expect: */ (double)80.0); // TC_TypeK at 80C = 3.267mV
whismanoid 59:c0376adb6ebc 3828 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3829
whismanoid 61:38ec81c33b7a 3830 // @test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV
whismanoid 59:c0376adb6ebc 3831 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3832 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3833 // docTest_item['action'] = 'TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1'
whismanoid 59:c0376adb6ebc 3834 // docTest_item['remarks'] = 'TC_TypeK at 90C = 3.682mV'
whismanoid 59:c0376adb6ebc 3835 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3836 // docTest_item['arglist'] = '3.682e-3'
whismanoid 59:c0376adb6ebc 3837 // docTest_item['expect-value'] = '90.0'
whismanoid 59:c0376adb6ebc 3838 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3839 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 90C = 3.682mV
whismanoid 59:c0376adb6ebc 3840 // call-function
whismanoid 59:c0376adb6ebc 3841 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)3.682e-3), (double)90.0); // TC_TypeK at 90C = 3.682mV
whismanoid 52:d3fb6f1722bf 3842 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3843 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)3.682e-3, /* expect: */ (double)90.0); // TC_TypeK at 90C = 3.682mV
whismanoid 59:c0376adb6ebc 3844 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3845
whismanoid 61:38ec81c33b7a 3846 // @test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV
whismanoid 59:c0376adb6ebc 3847 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3848 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3849 // docTest_item['action'] = 'TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1'
whismanoid 59:c0376adb6ebc 3850 // docTest_item['remarks'] = 'TC_TypeK at 100C = 4.096mV'
whismanoid 59:c0376adb6ebc 3851 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3852 // docTest_item['arglist'] = '4.096e-3'
whismanoid 59:c0376adb6ebc 3853 // docTest_item['expect-value'] = '100.0'
whismanoid 59:c0376adb6ebc 3854 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3855 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 100C = 4.096mV
whismanoid 59:c0376adb6ebc 3856 // call-function
whismanoid 59:c0376adb6ebc 3857 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)4.096e-3), (double)100.0); // TC_TypeK at 100C = 4.096mV
whismanoid 52:d3fb6f1722bf 3858 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3859 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)4.096e-3, /* expect: */ (double)100.0); // TC_TypeK at 100C = 4.096mV
whismanoid 52:d3fb6f1722bf 3860 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3861
whismanoid 61:38ec81c33b7a 3862 // @test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 3863 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3864 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3865 // docTest_item['action'] = 'TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1'
whismanoid 59:c0376adb6ebc 3866 // docTest_item['remarks'] = 'TC_TypeK at 110C = 4.509mV'
whismanoid 59:c0376adb6ebc 3867 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3868 // docTest_item['arglist'] = '4.509e-3'
whismanoid 59:c0376adb6ebc 3869 // docTest_item['expect-value'] = '110.0'
whismanoid 59:c0376adb6ebc 3870 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3871 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 3872 // call-function
whismanoid 59:c0376adb6ebc 3873 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)4.509e-3), (double)110.0); // TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 3874 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3875 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)4.509e-3, /* expect: */ (double)110.0); // TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 3876 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3877
whismanoid 61:38ec81c33b7a 3878 // @test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV
whismanoid 59:c0376adb6ebc 3879 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3880 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3881 // docTest_item['action'] = 'TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1'
whismanoid 59:c0376adb6ebc 3882 // docTest_item['remarks'] = 'TC_TypeK at 120C = 4.920mV'
whismanoid 59:c0376adb6ebc 3883 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3884 // docTest_item['arglist'] = '4.920e-3'
whismanoid 59:c0376adb6ebc 3885 // docTest_item['expect-value'] = '120.0'
whismanoid 59:c0376adb6ebc 3886 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3887 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 120C = 4.920mV
whismanoid 59:c0376adb6ebc 3888 // call-function
whismanoid 59:c0376adb6ebc 3889 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)4.920e-3), (double)120.0); // TC_TypeK at 120C = 4.920mV
whismanoid 52:d3fb6f1722bf 3890 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3891 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)4.920e-3, /* expect: */ (double)120.0); // TC_TypeK at 120C = 4.920mV
whismanoid 59:c0376adb6ebc 3892 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3893
whismanoid 61:38ec81c33b7a 3894 // @test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV
whismanoid 59:c0376adb6ebc 3895 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3896 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3897 // docTest_item['action'] = 'TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1'
whismanoid 59:c0376adb6ebc 3898 // docTest_item['remarks'] = 'TC_TypeK at 130C = 5.328mV'
whismanoid 59:c0376adb6ebc 3899 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3900 // docTest_item['arglist'] = '5.328e-3'
whismanoid 59:c0376adb6ebc 3901 // docTest_item['expect-value'] = '130.0'
whismanoid 59:c0376adb6ebc 3902 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3903 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 130C = 5.328mV
whismanoid 59:c0376adb6ebc 3904 // call-function
whismanoid 59:c0376adb6ebc 3905 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)5.328e-3), (double)130.0); // TC_TypeK at 130C = 5.328mV
whismanoid 52:d3fb6f1722bf 3906 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3907 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)5.328e-3, /* expect: */ (double)130.0); // TC_TypeK at 130C = 5.328mV
whismanoid 59:c0376adb6ebc 3908 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3909
whismanoid 61:38ec81c33b7a 3910 // @test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV
whismanoid 59:c0376adb6ebc 3911 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3912 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3913 // docTest_item['action'] = 'TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1'
whismanoid 59:c0376adb6ebc 3914 // docTest_item['remarks'] = 'TC_TypeK at 140C = 5.735mV'
whismanoid 59:c0376adb6ebc 3915 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3916 // docTest_item['arglist'] = '5.735e-3'
whismanoid 59:c0376adb6ebc 3917 // docTest_item['expect-value'] = '140.0'
whismanoid 59:c0376adb6ebc 3918 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3919 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 140C = 5.735mV
whismanoid 59:c0376adb6ebc 3920 // call-function
whismanoid 59:c0376adb6ebc 3921 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)5.735e-3), (double)140.0); // TC_TypeK at 140C = 5.735mV
whismanoid 52:d3fb6f1722bf 3922 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3923 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)5.735e-3, /* expect: */ (double)140.0); // TC_TypeK at 140C = 5.735mV
whismanoid 52:d3fb6f1722bf 3924 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3925
whismanoid 61:38ec81c33b7a 3926 // @test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV
whismanoid 59:c0376adb6ebc 3927 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3928 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3929 // docTest_item['action'] = 'TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1'
whismanoid 59:c0376adb6ebc 3930 // docTest_item['remarks'] = 'TC_TypeK at 150C = 6.138mV'
whismanoid 59:c0376adb6ebc 3931 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3932 // docTest_item['arglist'] = '6.138e-3'
whismanoid 59:c0376adb6ebc 3933 // docTest_item['expect-value'] = '150.0'
whismanoid 59:c0376adb6ebc 3934 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3935 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 150C = 6.138mV
whismanoid 59:c0376adb6ebc 3936 // call-function
whismanoid 59:c0376adb6ebc 3937 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)6.138e-3), (double)150.0); // TC_TypeK at 150C = 6.138mV
whismanoid 52:d3fb6f1722bf 3938 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3939 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)6.138e-3, /* expect: */ (double)150.0); // TC_TypeK at 150C = 6.138mV
whismanoid 52:d3fb6f1722bf 3940 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3941
whismanoid 61:38ec81c33b7a 3942 // @test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV
whismanoid 59:c0376adb6ebc 3943 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3944 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3945 // docTest_item['action'] = 'TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1'
whismanoid 59:c0376adb6ebc 3946 // docTest_item['remarks'] = 'TC_TypeK at 160C = 6.540mV'
whismanoid 59:c0376adb6ebc 3947 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3948 // docTest_item['arglist'] = '6.540e-3'
whismanoid 59:c0376adb6ebc 3949 // docTest_item['expect-value'] = '160.0'
whismanoid 59:c0376adb6ebc 3950 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3951 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 160C = 6.540mV
whismanoid 59:c0376adb6ebc 3952 // call-function
whismanoid 59:c0376adb6ebc 3953 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)6.540e-3), (double)160.0); // TC_TypeK at 160C = 6.540mV
whismanoid 52:d3fb6f1722bf 3954 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3955 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)6.540e-3, /* expect: */ (double)160.0); // TC_TypeK at 160C = 6.540mV
whismanoid 52:d3fb6f1722bf 3956 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3957
whismanoid 61:38ec81c33b7a 3958 // @test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV
whismanoid 59:c0376adb6ebc 3959 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3960 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3961 // docTest_item['action'] = 'TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1'
whismanoid 59:c0376adb6ebc 3962 // docTest_item['remarks'] = 'TC_TypeK at 170C = 6.941mV'
whismanoid 59:c0376adb6ebc 3963 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3964 // docTest_item['arglist'] = '6.941e-3'
whismanoid 59:c0376adb6ebc 3965 // docTest_item['expect-value'] = '170.0'
whismanoid 59:c0376adb6ebc 3966 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3967 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 170C = 6.941mV
whismanoid 59:c0376adb6ebc 3968 // call-function
whismanoid 59:c0376adb6ebc 3969 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)6.941e-3), (double)170.0); // TC_TypeK at 170C = 6.941mV
whismanoid 52:d3fb6f1722bf 3970 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3971 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)6.941e-3, /* expect: */ (double)170.0); // TC_TypeK at 170C = 6.941mV
whismanoid 52:d3fb6f1722bf 3972 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3973
whismanoid 61:38ec81c33b7a 3974 // @test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV
whismanoid 59:c0376adb6ebc 3975 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3976 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3977 // docTest_item['action'] = 'TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1'
whismanoid 59:c0376adb6ebc 3978 // docTest_item['remarks'] = 'TC_TypeK at 180C = 7.340mV'
whismanoid 59:c0376adb6ebc 3979 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3980 // docTest_item['arglist'] = '7.340e-3'
whismanoid 59:c0376adb6ebc 3981 // docTest_item['expect-value'] = '180.0'
whismanoid 59:c0376adb6ebc 3982 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3983 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 180C = 7.340mV
whismanoid 59:c0376adb6ebc 3984 // call-function
whismanoid 59:c0376adb6ebc 3985 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)7.340e-3), (double)180.0); // TC_TypeK at 180C = 7.340mV
whismanoid 52:d3fb6f1722bf 3986 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 3987 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)7.340e-3, /* expect: */ (double)180.0); // TC_TypeK at 180C = 7.340mV
whismanoid 52:d3fb6f1722bf 3988 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3989
whismanoid 61:38ec81c33b7a 3990 // @test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 3991 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3992 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3993 // docTest_item['action'] = 'TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1'
whismanoid 59:c0376adb6ebc 3994 // docTest_item['remarks'] = 'TC_TypeK at 190C = 7.739mV'
whismanoid 59:c0376adb6ebc 3995 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3996 // docTest_item['arglist'] = '7.739e-3'
whismanoid 59:c0376adb6ebc 3997 // docTest_item['expect-value'] = '190.0'
whismanoid 59:c0376adb6ebc 3998 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3999 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 4000 // call-function
whismanoid 59:c0376adb6ebc 4001 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)7.739e-3), (double)190.0); // TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 4002 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4003 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)7.739e-3, /* expect: */ (double)190.0); // TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 4004 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4005
whismanoid 61:38ec81c33b7a 4006 // @test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4007 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4008 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4009 // docTest_item['action'] = 'TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1'
whismanoid 59:c0376adb6ebc 4010 // docTest_item['remarks'] = 'TC_TypeK at 200C = 8.138mV'
whismanoid 59:c0376adb6ebc 4011 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4012 // docTest_item['arglist'] = '8.138e-3'
whismanoid 59:c0376adb6ebc 4013 // docTest_item['expect-value'] = '200.0'
whismanoid 59:c0376adb6ebc 4014 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4015 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4016 // call-function
whismanoid 59:c0376adb6ebc 4017 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)8.138e-3), (double)200.0); // TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4018 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4019 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)8.138e-3, /* expect: */ (double)200.0); // TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4020 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4021
whismanoid 61:38ec81c33b7a 4022 // @test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV
whismanoid 59:c0376adb6ebc 4023 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4024 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4025 // docTest_item['action'] = 'TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1'
whismanoid 59:c0376adb6ebc 4026 // docTest_item['remarks'] = 'TC_TypeK at 210C = 8.539mV'
whismanoid 59:c0376adb6ebc 4027 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4028 // docTest_item['arglist'] = '8.539e-3'
whismanoid 59:c0376adb6ebc 4029 // docTest_item['expect-value'] = '210.0'
whismanoid 59:c0376adb6ebc 4030 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4031 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 210C = 8.539mV
whismanoid 59:c0376adb6ebc 4032 // call-function
whismanoid 59:c0376adb6ebc 4033 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)8.539e-3), (double)210.0); // TC_TypeK at 210C = 8.539mV
whismanoid 52:d3fb6f1722bf 4034 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4035 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)8.539e-3, /* expect: */ (double)210.0); // TC_TypeK at 210C = 8.539mV
whismanoid 59:c0376adb6ebc 4036 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4037
whismanoid 61:38ec81c33b7a 4038 // @test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4039 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4040 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4041 // docTest_item['action'] = 'TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1'
whismanoid 59:c0376adb6ebc 4042 // docTest_item['remarks'] = 'TC_TypeK at 220C = 8.940mV'
whismanoid 59:c0376adb6ebc 4043 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4044 // docTest_item['arglist'] = '8.940e-3'
whismanoid 59:c0376adb6ebc 4045 // docTest_item['expect-value'] = '220.0'
whismanoid 59:c0376adb6ebc 4046 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4047 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4048 // call-function
whismanoid 59:c0376adb6ebc 4049 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)8.940e-3), (double)220.0); // TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4050 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4051 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)8.940e-3, /* expect: */ (double)220.0); // TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4052 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4053
whismanoid 61:38ec81c33b7a 4054 // @test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV
whismanoid 59:c0376adb6ebc 4055 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4056 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4057 // docTest_item['action'] = 'TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1'
whismanoid 59:c0376adb6ebc 4058 // docTest_item['remarks'] = 'TC_TypeK at 230C = 9.343mV'
whismanoid 59:c0376adb6ebc 4059 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4060 // docTest_item['arglist'] = '9.343e-3'
whismanoid 59:c0376adb6ebc 4061 // docTest_item['expect-value'] = '230.0'
whismanoid 59:c0376adb6ebc 4062 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4063 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 230C = 9.343mV
whismanoid 59:c0376adb6ebc 4064 // call-function
whismanoid 59:c0376adb6ebc 4065 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)9.343e-3), (double)230.0); // TC_TypeK at 230C = 9.343mV
whismanoid 59:c0376adb6ebc 4066 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4067 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)9.343e-3, /* expect: */ (double)230.0); // TC_TypeK at 230C = 9.343mV
whismanoid 52:d3fb6f1722bf 4068 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4069
whismanoid 61:38ec81c33b7a 4070 // @test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV
whismanoid 59:c0376adb6ebc 4071 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4072 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4073 // docTest_item['action'] = 'TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1'
whismanoid 59:c0376adb6ebc 4074 // docTest_item['remarks'] = 'TC_TypeK at 240C = 9.747mV'
whismanoid 59:c0376adb6ebc 4075 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4076 // docTest_item['arglist'] = '9.747e-3'
whismanoid 59:c0376adb6ebc 4077 // docTest_item['expect-value'] = '240.0'
whismanoid 59:c0376adb6ebc 4078 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4079 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 240C = 9.747mV
whismanoid 59:c0376adb6ebc 4080 // call-function
whismanoid 59:c0376adb6ebc 4081 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)9.747e-3), (double)240.0); // TC_TypeK at 240C = 9.747mV
whismanoid 52:d3fb6f1722bf 4082 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4083 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)9.747e-3, /* expect: */ (double)240.0); // TC_TypeK at 240C = 9.747mV
whismanoid 59:c0376adb6ebc 4084 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4085
whismanoid 61:38ec81c33b7a 4086 // @test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4087 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4088 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4089 // docTest_item['action'] = 'TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1'
whismanoid 59:c0376adb6ebc 4090 // docTest_item['remarks'] = 'TC_TypeK at 250C = 10.153mV'
whismanoid 59:c0376adb6ebc 4091 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4092 // docTest_item['arglist'] = '10.153e-3'
whismanoid 59:c0376adb6ebc 4093 // docTest_item['expect-value'] = '250.0'
whismanoid 59:c0376adb6ebc 4094 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4095 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4096 // call-function
whismanoid 59:c0376adb6ebc 4097 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)10.153e-3), (double)250.0); // TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4098 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4099 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)10.153e-3, /* expect: */ (double)250.0); // TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4100 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4101
whismanoid 61:38ec81c33b7a 4102 // @test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV
whismanoid 59:c0376adb6ebc 4103 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4104 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4105 // docTest_item['action'] = 'TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1'
whismanoid 59:c0376adb6ebc 4106 // docTest_item['remarks'] = 'TC_TypeK at 260C = 10.561mV'
whismanoid 59:c0376adb6ebc 4107 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4108 // docTest_item['arglist'] = '10.561e-3'
whismanoid 59:c0376adb6ebc 4109 // docTest_item['expect-value'] = '260.0'
whismanoid 59:c0376adb6ebc 4110 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4111 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 260C = 10.561mV
whismanoid 59:c0376adb6ebc 4112 // call-function
whismanoid 59:c0376adb6ebc 4113 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)10.561e-3), (double)260.0); // TC_TypeK at 260C = 10.561mV
whismanoid 59:c0376adb6ebc 4114 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4115 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)10.561e-3, /* expect: */ (double)260.0); // TC_TypeK at 260C = 10.561mV
whismanoid 52:d3fb6f1722bf 4116 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4117
whismanoid 61:38ec81c33b7a 4118 // @test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4119 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4120 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4121 // docTest_item['action'] = 'TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1'
whismanoid 59:c0376adb6ebc 4122 // docTest_item['remarks'] = 'TC_TypeK at 270C = 10.971mV'
whismanoid 59:c0376adb6ebc 4123 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4124 // docTest_item['arglist'] = '10.971e-3'
whismanoid 59:c0376adb6ebc 4125 // docTest_item['expect-value'] = '270.0'
whismanoid 59:c0376adb6ebc 4126 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4127 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4128 // call-function
whismanoid 59:c0376adb6ebc 4129 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)10.971e-3), (double)270.0); // TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4130 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4131 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)10.971e-3, /* expect: */ (double)270.0); // TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4132 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4133
whismanoid 61:38ec81c33b7a 4134 // @test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4135 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4136 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4137 // docTest_item['action'] = 'TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1'
whismanoid 59:c0376adb6ebc 4138 // docTest_item['remarks'] = 'TC_TypeK at 280C = 11.382mV'
whismanoid 59:c0376adb6ebc 4139 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4140 // docTest_item['arglist'] = '11.382e-3'
whismanoid 59:c0376adb6ebc 4141 // docTest_item['expect-value'] = '280.0'
whismanoid 59:c0376adb6ebc 4142 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4143 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4144 // call-function
whismanoid 59:c0376adb6ebc 4145 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)11.382e-3), (double)280.0); // TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4146 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4147 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)11.382e-3, /* expect: */ (double)280.0); // TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4148 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4149
whismanoid 61:38ec81c33b7a 4150 // @test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4151 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4152 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4153 // docTest_item['action'] = 'TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1'
whismanoid 59:c0376adb6ebc 4154 // docTest_item['remarks'] = 'TC_TypeK at 290C = 11.795mV'
whismanoid 59:c0376adb6ebc 4155 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4156 // docTest_item['arglist'] = '11.795e-3'
whismanoid 59:c0376adb6ebc 4157 // docTest_item['expect-value'] = '290.0'
whismanoid 59:c0376adb6ebc 4158 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4159 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4160 // call-function
whismanoid 59:c0376adb6ebc 4161 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)11.795e-3), (double)290.0); // TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4162 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4163 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)11.795e-3, /* expect: */ (double)290.0); // TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4164 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4165
whismanoid 61:38ec81c33b7a 4166 // @test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV
whismanoid 59:c0376adb6ebc 4167 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4168 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4169 // docTest_item['action'] = 'TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1'
whismanoid 59:c0376adb6ebc 4170 // docTest_item['remarks'] = 'TC_TypeK at 300C = 12.209mV'
whismanoid 59:c0376adb6ebc 4171 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4172 // docTest_item['arglist'] = '12.209e-3'
whismanoid 59:c0376adb6ebc 4173 // docTest_item['expect-value'] = '300.0'
whismanoid 59:c0376adb6ebc 4174 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4175 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 300C = 12.209mV
whismanoid 59:c0376adb6ebc 4176 // call-function
whismanoid 59:c0376adb6ebc 4177 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)12.209e-3), (double)300.0); // TC_TypeK at 300C = 12.209mV
whismanoid 52:d3fb6f1722bf 4178 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4179 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)12.209e-3, /* expect: */ (double)300.0); // TC_TypeK at 300C = 12.209mV
whismanoid 52:d3fb6f1722bf 4180 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4181
whismanoid 61:38ec81c33b7a 4182 // @test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV
whismanoid 59:c0376adb6ebc 4183 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4184 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4185 // docTest_item['action'] = 'TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1'
whismanoid 59:c0376adb6ebc 4186 // docTest_item['remarks'] = 'TC_TypeK at 350C = 14.293mV'
whismanoid 59:c0376adb6ebc 4187 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4188 // docTest_item['arglist'] = '14.293e-3'
whismanoid 59:c0376adb6ebc 4189 // docTest_item['expect-value'] = '350.0'
whismanoid 59:c0376adb6ebc 4190 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4191 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 350C = 14.293mV
whismanoid 59:c0376adb6ebc 4192 // call-function
whismanoid 59:c0376adb6ebc 4193 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)14.293e-3), (double)350.0); // TC_TypeK at 350C = 14.293mV
whismanoid 52:d3fb6f1722bf 4194 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4195 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)14.293e-3, /* expect: */ (double)350.0); // TC_TypeK at 350C = 14.293mV
whismanoid 52:d3fb6f1722bf 4196 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4197
whismanoid 61:38ec81c33b7a 4198 // @test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV
whismanoid 59:c0376adb6ebc 4199 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4200 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4201 // docTest_item['action'] = 'TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1'
whismanoid 59:c0376adb6ebc 4202 // docTest_item['remarks'] = 'TC_TypeK at 400C = 16.397mV'
whismanoid 59:c0376adb6ebc 4203 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4204 // docTest_item['arglist'] = '16.397e-3'
whismanoid 59:c0376adb6ebc 4205 // docTest_item['expect-value'] = '400.0'
whismanoid 59:c0376adb6ebc 4206 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4207 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 400C = 16.397mV
whismanoid 59:c0376adb6ebc 4208 // call-function
whismanoid 59:c0376adb6ebc 4209 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)16.397e-3), (double)400.0); // TC_TypeK at 400C = 16.397mV
whismanoid 52:d3fb6f1722bf 4210 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4211 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)16.397e-3, /* expect: */ (double)400.0); // TC_TypeK at 400C = 16.397mV
whismanoid 52:d3fb6f1722bf 4212 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4213
whismanoid 61:38ec81c33b7a 4214 // @test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV
whismanoid 59:c0376adb6ebc 4215 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4216 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4217 // docTest_item['action'] = 'TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1'
whismanoid 59:c0376adb6ebc 4218 // docTest_item['remarks'] = 'TC_TypeK at 450C = 18.516mV'
whismanoid 59:c0376adb6ebc 4219 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4220 // docTest_item['arglist'] = '18.516e-3'
whismanoid 59:c0376adb6ebc 4221 // docTest_item['expect-value'] = '450.0'
whismanoid 59:c0376adb6ebc 4222 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4223 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 450C = 18.516mV
whismanoid 59:c0376adb6ebc 4224 // call-function
whismanoid 59:c0376adb6ebc 4225 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)18.516e-3), (double)450.0); // TC_TypeK at 450C = 18.516mV
whismanoid 52:d3fb6f1722bf 4226 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 59:c0376adb6ebc 4227 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)18.516e-3, /* expect: */ (double)450.0); // TC_TypeK at 450C = 18.516mV
whismanoid 52:d3fb6f1722bf 4228 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4229
whismanoid 61:38ec81c33b7a 4230 // @test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV
whismanoid 59:c0376adb6ebc 4231 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4232 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4233 // docTest_item['action'] = 'TemperatureOfTC_TypeK(20.218e-3) expect 490.0'
whismanoid 59:c0376adb6ebc 4234 // docTest_item['remarks'] = 'TC_TypeK at 490C = 20.218mV'
whismanoid 59:c0376adb6ebc 4235 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4236 // docTest_item['arglist'] = '20.218e-3'
whismanoid 59:c0376adb6ebc 4237 // docTest_item['expect-value'] = '490.0'
whismanoid 61:38ec81c33b7a 4238 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 490C = 20.218mV
whismanoid 59:c0376adb6ebc 4239 // call-function
whismanoid 59:c0376adb6ebc 4240 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)20.218e-3), (double)490.0); // TC_TypeK at 490C = 20.218mV
whismanoid 59:c0376adb6ebc 4241 tinyTester.FunctionCall_Expect("MAX11410.TemperatureOfTC_TypeK", fn_MAX11410_TemperatureOfTC_TypeK, (double)20.218e-3, /* expect: */ (double)490.0); // TC_TypeK at 490C = 20.218mV
whismanoid 52:d3fb6f1722bf 4242 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4243
whismanoid 61:38ec81c33b7a 4244 // @test group TC_1 tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 59:c0376adb6ebc 4245 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 4246 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4247 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 59:c0376adb6ebc 4248 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 4249 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 59:c0376adb6ebc 4250 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 4251 #if MAX11410_SELFTEST_TC_1 // group TC_1 None default 75 resume hardware self test
whismanoid 59:c0376adb6ebc 4252 // assign-propname-value
whismanoid 59:c0376adb6ebc 4253 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 59:c0376adb6ebc 4254 // tinyTesterPropValue = "75"
whismanoid 59:c0376adb6ebc 4255 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 4256 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4257
whismanoid 52:d3fb6f1722bf 4258 //
whismanoid 52:d3fb6f1722bf 4259 #if INJECT_SELFTEST_FAIL
whismanoid 52:d3fb6f1722bf 4260 // Test of the pass/fail report mechanism
whismanoid 52:d3fb6f1722bf 4261 tinyTester.FAIL();
whismanoid 52:d3fb6f1722bf 4262 cmdLine.serial().print(F("injecting one false failure for test reporting"));
whismanoid 52:d3fb6f1722bf 4263 #endif
whismanoid 52:d3fb6f1722bf 4264 //
whismanoid 52:d3fb6f1722bf 4265 // Report number of pass and number of fail test results
whismanoid 52:d3fb6f1722bf 4266 tinyTester.Report_Summary();
whismanoid 52:d3fb6f1722bf 4267 }
whismanoid 52:d3fb6f1722bf 4268
whismanoid 52:d3fb6f1722bf 4269 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4270 // selfTestFunctionClosures[functionName]['functionName'] = 'Init'
whismanoid 59:c0376adb6ebc 4271 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'void'
whismanoid 59:c0376adb6ebc 4272 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4273 // selfTestFunctionClosures[functionName]['argNames'] = ''
whismanoid 59:c0376adb6ebc 4274 // CommandParamIn_declaration = 'void'
whismanoid 59:c0376adb6ebc 4275 // argNames_recast_implementation = ''
whismanoid 59:c0376adb6ebc 4276 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4277 // selftest: define function under test
whismanoid 59:c0376adb6ebc 4278 // uint8_t MAX11410::Init(void)
whismanoid 59:c0376adb6ebc 4279 uint8_t fn_MAX11410_Init(void)
whismanoid 55:73d886c105f5 4280 {
whismanoid 59:c0376adb6ebc 4281 return g_MAX11410_device.Init();
whismanoid 59:c0376adb6ebc 4282 }
whismanoid 59:c0376adb6ebc 4283
whismanoid 59:c0376adb6ebc 4284 //--------------------------------------------------
whismanoid 60:f38c54a91794 4285 // selfTestFunctionClosures[functionName]['functionName'] = 'RegRead'
whismanoid 60:f38c54a91794 4286 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t* ptrRegData'
whismanoid 60:f38c54a91794 4287 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 60:f38c54a91794 4288 // selfTestFunctionClosures[functionName]['argNames'] = 'commandByte, ptrRegData'
whismanoid 60:f38c54a91794 4289 // CommandParamIn_declaration = 'int commandByte, uint32_t* ptrRegData'
whismanoid 60:f38c54a91794 4290 // argNames_recast_implementation = '(MAX11410::MAX11410_CMD_enum_t)commandByte, /*(uint32_t*) */ ptrRegData'
whismanoid 60:f38c54a91794 4291 //--------------------------------------------------
whismanoid 60:f38c54a91794 4292 // selftest: define function under test
whismanoid 60:f38c54a91794 4293 // uint8_t MAX11410::RegRead(MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t* ptrRegData)
whismanoid 60:f38c54a91794 4294 uint8_t fn_MAX11410_RegRead(int commandByte, uint32_t* ptrRegData)
whismanoid 60:f38c54a91794 4295 {
whismanoid 60:f38c54a91794 4296 return g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)commandByte, /*(uint32_t*) */ ptrRegData);
whismanoid 60:f38c54a91794 4297 }
whismanoid 60:f38c54a91794 4298
whismanoid 60:f38c54a91794 4299 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4300 // selfTestFunctionClosures[functionName]['functionName'] = 'RegWrite'
whismanoid 59:c0376adb6ebc 4301 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t regData'
whismanoid 59:c0376adb6ebc 4302 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4303 // selfTestFunctionClosures[functionName]['argNames'] = 'commandByte, regData'
whismanoid 59:c0376adb6ebc 4304 // CommandParamIn_declaration = 'int commandByte, int regData'
whismanoid 59:c0376adb6ebc 4305 // argNames_recast_implementation = '(MAX11410::MAX11410_CMD_enum_t)commandByte, (uint32_t)regData'
whismanoid 59:c0376adb6ebc 4306 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4307 // selftest: define function under test
whismanoid 59:c0376adb6ebc 4308 // uint8_t MAX11410::RegWrite(MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t regData)
whismanoid 59:c0376adb6ebc 4309 uint8_t fn_MAX11410_RegWrite(int commandByte, int regData)
whismanoid 59:c0376adb6ebc 4310 {
whismanoid 59:c0376adb6ebc 4311 return g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)commandByte, (uint32_t)regData);
whismanoid 55:73d886c105f5 4312 }
whismanoid 55:73d886c105f5 4313
whismanoid 55:73d886c105f5 4314 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4315 // selfTestFunctionClosures[functionName]['functionName'] = 'Configure_CTRL_REF'
whismanoid 59:c0376adb6ebc 4316 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint8_t ref_sel'
whismanoid 59:c0376adb6ebc 4317 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4318 // selfTestFunctionClosures[functionName]['argNames'] = 'ref_sel'
whismanoid 59:c0376adb6ebc 4319 // CommandParamIn_declaration = 'int ref_sel'
whismanoid 59:c0376adb6ebc 4320 // argNames_recast_implementation = '(uint8_t)ref_sel'
whismanoid 59:c0376adb6ebc 4321 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4322 // selftest: define function under test
whismanoid 59:c0376adb6ebc 4323 // uint8_t MAX11410::Configure_CTRL_REF(uint8_t ref_sel)
whismanoid 59:c0376adb6ebc 4324 uint8_t fn_MAX11410_Configure_CTRL_REF(int ref_sel)
whismanoid 59:c0376adb6ebc 4325 {
whismanoid 59:c0376adb6ebc 4326 return g_MAX11410_device.Configure_CTRL_REF((uint8_t)ref_sel);
whismanoid 59:c0376adb6ebc 4327 }
whismanoid 59:c0376adb6ebc 4328
whismanoid 59:c0376adb6ebc 4329 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4330 // selfTestFunctionClosures[functionName]['functionName'] = 'Configure_PGA'
whismanoid 59:c0376adb6ebc 4331 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint8_t sigpath, uint8_t gain'
whismanoid 59:c0376adb6ebc 4332 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4333 // selfTestFunctionClosures[functionName]['argNames'] = 'sigpath, gain'
whismanoid 59:c0376adb6ebc 4334 // CommandParamIn_declaration = 'int sigpath, int gain'
whismanoid 59:c0376adb6ebc 4335 // argNames_recast_implementation = '(uint8_t)sigpath, (uint8_t)gain'
whismanoid 59:c0376adb6ebc 4336 //--------------------------------------------------
whismanoid 55:73d886c105f5 4337 // selftest: define function under test
whismanoid 56:6e9c52cc9abe 4338 // uint8_t MAX11410::Configure_PGA(uint8_t sigpath, uint8_t gain)
whismanoid 59:c0376adb6ebc 4339 uint8_t fn_MAX11410_Configure_PGA(int sigpath, int gain)
whismanoid 56:6e9c52cc9abe 4340 {
whismanoid 59:c0376adb6ebc 4341 return g_MAX11410_device.Configure_PGA((uint8_t)sigpath, (uint8_t)gain);
whismanoid 56:6e9c52cc9abe 4342 }
whismanoid 56:6e9c52cc9abe 4343
whismanoid 56:6e9c52cc9abe 4344 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4345 // selfTestFunctionClosures[functionName]['functionName'] = 'VoltageOfCode_Unipolar'
whismanoid 59:c0376adb6ebc 4346 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4347 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4348 // selfTestFunctionClosures[functionName]['argNames'] = 'value_u24'
whismanoid 59:c0376adb6ebc 4349 // CommandParamIn_declaration = 'int value_u24'
whismanoid 59:c0376adb6ebc 4350 // argNames_recast_implementation = '(uint32_t)value_u24'
whismanoid 59:c0376adb6ebc 4351 //--------------------------------------------------
whismanoid 56:6e9c52cc9abe 4352 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4353 // double MAX11410::VoltageOfCode_Unipolar(uint32_t value_u24)
whismanoid 59:c0376adb6ebc 4354 double fn_MAX11410_VoltageOfCode_Unipolar(int value_u24)
whismanoid 52:d3fb6f1722bf 4355 {
whismanoid 59:c0376adb6ebc 4356 return g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)value_u24);
whismanoid 52:d3fb6f1722bf 4357 }
whismanoid 52:d3fb6f1722bf 4358
whismanoid 52:d3fb6f1722bf 4359 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4360 // selfTestFunctionClosures[functionName]['functionName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 59:c0376adb6ebc 4361 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4362 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4363 // selfTestFunctionClosures[functionName]['argNames'] = 'value_u24'
whismanoid 59:c0376adb6ebc 4364 // CommandParamIn_declaration = 'int value_u24'
whismanoid 59:c0376adb6ebc 4365 // argNames_recast_implementation = '(uint32_t)value_u24'
whismanoid 59:c0376adb6ebc 4366 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4367 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4368 // double MAX11410::VoltageOfCode_Bipolar_OffsetBinary(uint32_t value_u24)
whismanoid 59:c0376adb6ebc 4369 double fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary(int value_u24)
whismanoid 52:d3fb6f1722bf 4370 {
whismanoid 59:c0376adb6ebc 4371 return g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)value_u24);
whismanoid 52:d3fb6f1722bf 4372 }
whismanoid 52:d3fb6f1722bf 4373
whismanoid 52:d3fb6f1722bf 4374 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4375 // selfTestFunctionClosures[functionName]['functionName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 59:c0376adb6ebc 4376 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4377 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4378 // selfTestFunctionClosures[functionName]['argNames'] = 'value_u24'
whismanoid 59:c0376adb6ebc 4379 // CommandParamIn_declaration = 'int value_u24'
whismanoid 59:c0376adb6ebc 4380 // argNames_recast_implementation = '(uint32_t)value_u24'
whismanoid 59:c0376adb6ebc 4381 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4382 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4383 // double MAX11410::VoltageOfCode_Bipolar_2sComplement(uint32_t value_u24)
whismanoid 59:c0376adb6ebc 4384 double fn_MAX11410_VoltageOfCode_Bipolar_2sComplement(int value_u24)
whismanoid 52:d3fb6f1722bf 4385 {
whismanoid 59:c0376adb6ebc 4386 return g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)value_u24);
whismanoid 52:d3fb6f1722bf 4387 }
whismanoid 52:d3fb6f1722bf 4388
whismanoid 52:d3fb6f1722bf 4389 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4390 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfRTD_PT1000'
whismanoid 59:c0376adb6ebc 4391 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double rtd_resistance'
whismanoid 59:c0376adb6ebc 4392 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4393 // selfTestFunctionClosures[functionName]['argNames'] = 'rtd_resistance'
whismanoid 59:c0376adb6ebc 4394 // CommandParamIn_declaration = 'double rtd_resistance'
whismanoid 59:c0376adb6ebc 4395 // argNames_recast_implementation = '(double)rtd_resistance'
whismanoid 59:c0376adb6ebc 4396 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4397 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4398 // double MAX11410::TemperatureOfRTD_PT1000(double rtd_resistance)
whismanoid 52:d3fb6f1722bf 4399 double fn_MAX11410_TemperatureOfRTD_PT1000(double rtd_resistance)
whismanoid 52:d3fb6f1722bf 4400 {
whismanoid 59:c0376adb6ebc 4401 return g_MAX11410_device.TemperatureOfRTD_PT1000((double)rtd_resistance);
whismanoid 52:d3fb6f1722bf 4402 }
whismanoid 52:d3fb6f1722bf 4403
whismanoid 52:d3fb6f1722bf 4404 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4405 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfRTD_PT100'
whismanoid 59:c0376adb6ebc 4406 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double rtd_resistance'
whismanoid 59:c0376adb6ebc 4407 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4408 // selfTestFunctionClosures[functionName]['argNames'] = 'rtd_resistance'
whismanoid 59:c0376adb6ebc 4409 // CommandParamIn_declaration = 'double rtd_resistance'
whismanoid 59:c0376adb6ebc 4410 // argNames_recast_implementation = '(double)rtd_resistance'
whismanoid 59:c0376adb6ebc 4411 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4412 // selftest: define function under test
whismanoid 56:6e9c52cc9abe 4413 // double MAX11410::TemperatureOfRTD_PT100(double rtd_resistance)
whismanoid 56:6e9c52cc9abe 4414 double fn_MAX11410_TemperatureOfRTD_PT100(double rtd_resistance)
whismanoid 56:6e9c52cc9abe 4415 {
whismanoid 59:c0376adb6ebc 4416 return g_MAX11410_device.TemperatureOfRTD_PT100((double)rtd_resistance);
whismanoid 56:6e9c52cc9abe 4417 }
whismanoid 56:6e9c52cc9abe 4418
whismanoid 56:6e9c52cc9abe 4419 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4420 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfRTD'
whismanoid 59:c0376adb6ebc 4421 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double rtd_resistance'
whismanoid 59:c0376adb6ebc 4422 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4423 // selfTestFunctionClosures[functionName]['argNames'] = 'rtd_resistance'
whismanoid 59:c0376adb6ebc 4424 // CommandParamIn_declaration = 'double rtd_resistance'
whismanoid 59:c0376adb6ebc 4425 // argNames_recast_implementation = '(double)rtd_resistance'
whismanoid 59:c0376adb6ebc 4426 //--------------------------------------------------
whismanoid 56:6e9c52cc9abe 4427 // selftest: define function under test
whismanoid 56:6e9c52cc9abe 4428 // double MAX11410::TemperatureOfRTD(double rtd_resistance)
whismanoid 56:6e9c52cc9abe 4429 double fn_MAX11410_TemperatureOfRTD(double rtd_resistance)
whismanoid 56:6e9c52cc9abe 4430 {
whismanoid 59:c0376adb6ebc 4431 return g_MAX11410_device.TemperatureOfRTD((double)rtd_resistance);
whismanoid 56:6e9c52cc9abe 4432 }
whismanoid 56:6e9c52cc9abe 4433
whismanoid 56:6e9c52cc9abe 4434 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4435 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4436 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double tc_voltage'
whismanoid 59:c0376adb6ebc 4437 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4438 // selfTestFunctionClosures[functionName]['argNames'] = 'tc_voltage'
whismanoid 59:c0376adb6ebc 4439 // CommandParamIn_declaration = 'double tc_voltage'
whismanoid 59:c0376adb6ebc 4440 // argNames_recast_implementation = '(double)tc_voltage'
whismanoid 59:c0376adb6ebc 4441 //--------------------------------------------------
whismanoid 56:6e9c52cc9abe 4442 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4443 // double MAX11410::TemperatureOfTC_TypeK(double tc_voltage)
whismanoid 52:d3fb6f1722bf 4444 double fn_MAX11410_TemperatureOfTC_TypeK(double tc_voltage)
whismanoid 52:d3fb6f1722bf 4445 {
whismanoid 59:c0376adb6ebc 4446 return g_MAX11410_device.TemperatureOfTC_TypeK((double)tc_voltage);
whismanoid 52:d3fb6f1722bf 4447 }
whismanoid 52:d3fb6f1722bf 4448
whismanoid 52:d3fb6f1722bf 4449
whismanoid 52:d3fb6f1722bf 4450 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4451 inline void print_command_prompt()
whismanoid 52:d3fb6f1722bf 4452 {
whismanoid 52:d3fb6f1722bf 4453 cmdLine_serial.serial().printf("\r\n> ");
whismanoid 52:d3fb6f1722bf 4454
whismanoid 52:d3fb6f1722bf 4455 }
whismanoid 52:d3fb6f1722bf 4456
whismanoid 52:d3fb6f1722bf 4457
whismanoid 52:d3fb6f1722bf 4458 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4459 void pinsMonitor_submenu_onEOLcommandParser(CmdLine& cmdLine)
whismanoid 52:d3fb6f1722bf 4460 {
whismanoid 52:d3fb6f1722bf 4461 // % diagnostic commands submenu
whismanoid 52:d3fb6f1722bf 4462 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 4463 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 4464 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 4465 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 4466 // %Ppin df=xx -- pwm output
whismanoid 52:d3fb6f1722bf 4467 // %Wpin -- measure high pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 4468 // %wpin -- measure low pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 4469 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 4470 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 4471 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 4472 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 4473 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 4474 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 4475 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 4476 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 4477 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 4478 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 4479 // A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 4480 //
whismanoid 52:d3fb6f1722bf 4481 char strPinIndex[3];
whismanoid 52:d3fb6f1722bf 4482 strPinIndex[0] = cmdLine[2];
whismanoid 52:d3fb6f1722bf 4483 strPinIndex[1] = cmdLine[3];
whismanoid 52:d3fb6f1722bf 4484 strPinIndex[2] = '\0';
whismanoid 52:d3fb6f1722bf 4485 int pinIndex = strtoul(strPinIndex, NULL, 10); // strtol(str, NULL, 10): get decimal value
whismanoid 52:d3fb6f1722bf 4486 //cmdLine.serial().printf(" pinIndex=%d ", pinIndex);
whismanoid 52:d3fb6f1722bf 4487 //
whismanoid 52:d3fb6f1722bf 4488 // get next character
whismanoid 52:d3fb6f1722bf 4489 switch (cmdLine[1])
whismanoid 52:d3fb6f1722bf 4490 {
whismanoid 52:d3fb6f1722bf 4491 #if HAS_digitalInOuts
whismanoid 52:d3fb6f1722bf 4492 case 'H': case 'h':
whismanoid 52:d3fb6f1722bf 4493 {
whismanoid 52:d3fb6f1722bf 4494 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 4495 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4496 pinMode(pinIndex, OUTPUT); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4497 digitalWrite(pinIndex, HIGH); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4498 #else
whismanoid 52:d3fb6f1722bf 4499 DigitalInOut& digitalInOutPin = find_digitalInOutPin(pinIndex);
whismanoid 52:d3fb6f1722bf 4500 digitalInOutPin.output();
whismanoid 52:d3fb6f1722bf 4501 digitalInOutPin.write(1);
whismanoid 52:d3fb6f1722bf 4502 #endif
whismanoid 52:d3fb6f1722bf 4503 cmdLine.serial().printf(" digitalInOutPin %d Output High ", pinIndex);
whismanoid 52:d3fb6f1722bf 4504 }
whismanoid 52:d3fb6f1722bf 4505 break;
whismanoid 52:d3fb6f1722bf 4506 case 'L': case 'l':
whismanoid 52:d3fb6f1722bf 4507 {
whismanoid 52:d3fb6f1722bf 4508 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 4509 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4510 pinMode(pinIndex, OUTPUT); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4511 digitalWrite(pinIndex, LOW); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4512 #else
whismanoid 52:d3fb6f1722bf 4513 DigitalInOut& digitalInOutPin = find_digitalInOutPin(pinIndex);
whismanoid 52:d3fb6f1722bf 4514 digitalInOutPin.output();
whismanoid 52:d3fb6f1722bf 4515 digitalInOutPin.write(0);
whismanoid 52:d3fb6f1722bf 4516 #endif
whismanoid 52:d3fb6f1722bf 4517 cmdLine.serial().printf(" digitalInOutPin %d Output Low ", pinIndex);
whismanoid 52:d3fb6f1722bf 4518 }
whismanoid 52:d3fb6f1722bf 4519 break;
whismanoid 52:d3fb6f1722bf 4520 case '?':
whismanoid 52:d3fb6f1722bf 4521 {
whismanoid 52:d3fb6f1722bf 4522 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 4523 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4524 pinMode(pinIndex, INPUT); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4525 #else
whismanoid 52:d3fb6f1722bf 4526 DigitalInOut& digitalInOutPin = find_digitalInOutPin(pinIndex);
whismanoid 52:d3fb6f1722bf 4527 digitalInOutPin.input();
whismanoid 52:d3fb6f1722bf 4528 #endif
whismanoid 52:d3fb6f1722bf 4529 serial.printf(" digitalInOutPin %d Input ", pinIndex);
whismanoid 52:d3fb6f1722bf 4530 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4531 int value = digitalRead(pinIndex);
whismanoid 52:d3fb6f1722bf 4532 #else
whismanoid 52:d3fb6f1722bf 4533 int value = digitalInOutPin.read();
whismanoid 52:d3fb6f1722bf 4534 #endif
whismanoid 52:d3fb6f1722bf 4535 cmdLine.serial().printf("%d ", value);
whismanoid 52:d3fb6f1722bf 4536 }
whismanoid 52:d3fb6f1722bf 4537 break;
whismanoid 52:d3fb6f1722bf 4538 #endif
whismanoid 52:d3fb6f1722bf 4539 //
whismanoid 52:d3fb6f1722bf 4540 #if HAS_analogIns
whismanoid 52:d3fb6f1722bf 4541 case 'A': case 'a':
whismanoid 52:d3fb6f1722bf 4542 {
whismanoid 52:d3fb6f1722bf 4543 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 4544 #if analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 4545 // Platform board uses AIN4,AIN5,.. as high range of AIN0,AIN1,..
whismanoid 52:d3fb6f1722bf 4546 for (int pinIndex = 0; pinIndex < 2; pinIndex++)
whismanoid 52:d3fb6f1722bf 4547 {
whismanoid 52:d3fb6f1722bf 4548 int cPinIndex = '0' + pinIndex;
whismanoid 52:d3fb6f1722bf 4549 AnalogIn& analogInPin = find_analogInPin(cPinIndex);
whismanoid 52:d3fb6f1722bf 4550 float adc_full_scale_voltage = analogInPin_fullScaleVoltage[pinIndex];
whismanoid 52:d3fb6f1722bf 4551 float normValue_0_1 = analogInPin.read();
whismanoid 52:d3fb6f1722bf 4552 //
whismanoid 52:d3fb6f1722bf 4553 int pinIndexH = pinIndex + 4;
whismanoid 52:d3fb6f1722bf 4554 int cPinIndexH = '0' + pinIndexH;
whismanoid 52:d3fb6f1722bf 4555 AnalogIn& analogInPinH = find_analogInPin(cPinIndexH);
whismanoid 52:d3fb6f1722bf 4556 float adc_full_scale_voltageH = analogInPin_fullScaleVoltage[pinIndexH];
whismanoid 52:d3fb6f1722bf 4557 float normValueH_0_1 = analogInPinH.read();
whismanoid 52:d3fb6f1722bf 4558 //
whismanoid 52:d3fb6f1722bf 4559 cmdLine.serial().printf("AIN%c = %7.3f%% = %1.3fV AIN%c = %7.3f%% = %1.3fV \r\n",
whismanoid 52:d3fb6f1722bf 4560 cPinIndex,
whismanoid 52:d3fb6f1722bf 4561 normValue_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4562 normValue_0_1 * adc_full_scale_voltage,
whismanoid 52:d3fb6f1722bf 4563 cPinIndexH,
whismanoid 52:d3fb6f1722bf 4564 normValueH_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4565 normValueH_0_1 * adc_full_scale_voltageH
whismanoid 52:d3fb6f1722bf 4566 );
whismanoid 52:d3fb6f1722bf 4567 }
whismanoid 52:d3fb6f1722bf 4568 for (int pinIndex = 2; pinIndex < 4; pinIndex++)
whismanoid 52:d3fb6f1722bf 4569 {
whismanoid 52:d3fb6f1722bf 4570 int cPinIndex = '0' + pinIndex;
whismanoid 52:d3fb6f1722bf 4571 AnalogIn& analogInPin = find_analogInPin(cPinIndex);
whismanoid 52:d3fb6f1722bf 4572 float adc_full_scale_voltage = analogInPin_fullScaleVoltage[pinIndex];
whismanoid 52:d3fb6f1722bf 4573 float normValue_0_1 = analogInPin.read();
whismanoid 52:d3fb6f1722bf 4574 //
whismanoid 52:d3fb6f1722bf 4575 cmdLine.serial().printf("AIN%c = %7.3f%% = %1.3fV\r\n",
whismanoid 52:d3fb6f1722bf 4576 cPinIndex,
whismanoid 52:d3fb6f1722bf 4577 normValue_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4578 normValue_0_1 * adc_full_scale_voltage
whismanoid 52:d3fb6f1722bf 4579 );
whismanoid 52:d3fb6f1722bf 4580 }
whismanoid 52:d3fb6f1722bf 4581 #else // analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 4582 // Platform board uses simple analog inputs
whismanoid 52:d3fb6f1722bf 4583 // assume standard Arduino analog inputs A0-A5
whismanoid 52:d3fb6f1722bf 4584 for (int pinIndex = 0; pinIndex < 6; pinIndex++)
whismanoid 52:d3fb6f1722bf 4585 {
whismanoid 52:d3fb6f1722bf 4586 int cPinIndex = '0' + pinIndex;
whismanoid 52:d3fb6f1722bf 4587 AnalogIn& analogInPin = find_analogInPin(cPinIndex);
whismanoid 52:d3fb6f1722bf 4588 float adc_full_scale_voltage = analogInPin_fullScaleVoltage[pinIndex];
whismanoid 52:d3fb6f1722bf 4589 float normValue_0_1 = analogInPin.read();
whismanoid 52:d3fb6f1722bf 4590 //
whismanoid 52:d3fb6f1722bf 4591 cmdLine.serial().printf("AIN%c = %7.3f%% = %1.3fV\r\n",
whismanoid 52:d3fb6f1722bf 4592 cPinIndex,
whismanoid 52:d3fb6f1722bf 4593 normValue_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4594 normValue_0_1 * adc_full_scale_voltage
whismanoid 52:d3fb6f1722bf 4595 );
whismanoid 52:d3fb6f1722bf 4596 }
whismanoid 52:d3fb6f1722bf 4597 #endif // analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 4598 }
whismanoid 52:d3fb6f1722bf 4599 break;
whismanoid 52:d3fb6f1722bf 4600 #endif
whismanoid 52:d3fb6f1722bf 4601 //
whismanoid 52:d3fb6f1722bf 4602 #if HAS_SPI2_MAX541
whismanoid 52:d3fb6f1722bf 4603 case 'D': case 'd':
whismanoid 52:d3fb6f1722bf 4604 {
whismanoid 52:d3fb6f1722bf 4605 // %D -- DAC output MAX541 (SPI2) -- need cmdLine.parse_float(voltageV)
whismanoid 52:d3fb6f1722bf 4606 // MAX541 max541(spi2_max541, spi2_max541_cs);
whismanoid 52:d3fb6f1722bf 4607 float voltageV = max541.Get_Voltage();
whismanoid 52:d3fb6f1722bf 4608 // if (cmdLine[2] == '+') {
whismanoid 52:d3fb6f1722bf 4609 // // %D+
whismanoid 52:d3fb6f1722bf 4610 // voltageV = voltageV * 1.25f;
whismanoid 52:d3fb6f1722bf 4611 // if (voltageV >= max541.VRef) voltageV = max541.VRef;
whismanoid 52:d3fb6f1722bf 4612 // SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4613 // }
whismanoid 52:d3fb6f1722bf 4614 // else if (cmdLine[2] == '-') {
whismanoid 52:d3fb6f1722bf 4615 // // %D-
whismanoid 52:d3fb6f1722bf 4616 // voltageV = voltageV * 0.75f;
whismanoid 52:d3fb6f1722bf 4617 // if (voltageV < 0.1f) voltageV = 0.1f;
whismanoid 52:d3fb6f1722bf 4618 // SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4619 // }
whismanoid 52:d3fb6f1722bf 4620 if (cmdLine.parse_float("V", voltageV))
whismanoid 52:d3fb6f1722bf 4621 {
whismanoid 52:d3fb6f1722bf 4622 // %D V=1.234 -- set voltage
whismanoid 52:d3fb6f1722bf 4623 max541.Set_Voltage(voltageV);
whismanoid 52:d3fb6f1722bf 4624 }
whismanoid 52:d3fb6f1722bf 4625 else if (cmdLine.parse_float("TEST", voltageV))
whismanoid 52:d3fb6f1722bf 4626 {
whismanoid 52:d3fb6f1722bf 4627 // %D TEST=1.234 -- set voltage and compare with AIN0
whismanoid 52:d3fb6f1722bf 4628 SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4629 }
whismanoid 52:d3fb6f1722bf 4630 else if (cmdLine.parse_float("CAL", voltageV))
whismanoid 52:d3fb6f1722bf 4631 {
whismanoid 52:d3fb6f1722bf 4632 // %D CAL=1.234 -- calibrate VRef and compare with AIN0
whismanoid 52:d3fb6f1722bf 4633
whismanoid 52:d3fb6f1722bf 4634 max541.Set_Code(0x8000); // we don't know the fullscale voltage yet, so set code to midscale
whismanoid 52:d3fb6f1722bf 4635 double max541_midscale_V = analogInPin_fullScaleVoltage[4] * analogIn4.read(); // TARGET_MAX32630 J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 4636 const int average_count = 100;
whismanoid 52:d3fb6f1722bf 4637 const double average_K = 0.25;
whismanoid 52:d3fb6f1722bf 4638 for (int count = 0; count < average_count; count++) {
whismanoid 52:d3fb6f1722bf 4639 double measurement_V = analogInPin_fullScaleVoltage[4] * analogIn4.read(); // TARGET_MAX32630 J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 4640 max541_midscale_V = ((1 - average_K) * max541_midscale_V) + (average_K * measurement_V);
whismanoid 52:d3fb6f1722bf 4641 }
whismanoid 52:d3fb6f1722bf 4642 max541.VRef = 2.0 * max541_midscale_V;
whismanoid 52:d3fb6f1722bf 4643 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 4644 "\r\n MAX541 midscale = %1.3fV, so fullscale = %1.3fV",
whismanoid 52:d3fb6f1722bf 4645 max541_midscale_V, max541.VRef);
whismanoid 52:d3fb6f1722bf 4646 // Detect whether MAX541 is really connected to MAX32625MBED.AIN0/AIN4
whismanoid 52:d3fb6f1722bf 4647 voltageV = 1.0f;
whismanoid 52:d3fb6f1722bf 4648 SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4649 }
whismanoid 52:d3fb6f1722bf 4650 else {
whismanoid 52:d3fb6f1722bf 4651 // %D -- print MAX541 DAC status
whismanoid 52:d3fb6f1722bf 4652 cmdLine.serial().printf("MAX541 code=0x%4.4x = %1.3fV VRef=%1.3fV\r\n",
whismanoid 52:d3fb6f1722bf 4653 max541.Get_Code(), max541.Get_Voltage(), max541.VRef);
whismanoid 52:d3fb6f1722bf 4654 }
whismanoid 52:d3fb6f1722bf 4655 }
whismanoid 52:d3fb6f1722bf 4656 break;
whismanoid 52:d3fb6f1722bf 4657 #endif
whismanoid 52:d3fb6f1722bf 4658
whismanoid 52:d3fb6f1722bf 4659 //
whismanoid 52:d3fb6f1722bf 4660 #if HAS_I2C // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 4661 case 'I': case 'i':
whismanoid 52:d3fb6f1722bf 4662 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 4663 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 4664 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 4665 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 4666 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 4667 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 4668 // get next character
whismanoid 52:d3fb6f1722bf 4669 // TODO: parse cmdLine arg (ADDR=\d+)? --> g_I2C_deviceAddress7
whismanoid 52:d3fb6f1722bf 4670 cmdLine.parse_byte_hex("ADDR", g_I2C_deviceAddress7);
whismanoid 52:d3fb6f1722bf 4671 // TODO: parse cmdLine arg (RD=\d)? --> g_I2C_read_count
whismanoid 52:d3fb6f1722bf 4672 g_I2C_read_count = 0; // read count must be reset every command
whismanoid 52:d3fb6f1722bf 4673 cmdLine.parse_byte_dec("RD", g_I2C_read_count);
whismanoid 52:d3fb6f1722bf 4674 // TODO: parse cmdLine arg (CMD=\d)? --> g_I2C_command_regAddress
whismanoid 52:d3fb6f1722bf 4675 cmdLine.parse_byte_hex("CMD", g_I2C_command_regAddress);
whismanoid 52:d3fb6f1722bf 4676 switch (cmdLine[2])
whismanoid 52:d3fb6f1722bf 4677 {
whismanoid 52:d3fb6f1722bf 4678 case 'P': case 'p':
whismanoid 52:d3fb6f1722bf 4679 {
whismanoid 52:d3fb6f1722bf 4680 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 4681 HuntAttachedI2CDevices(cmdLine, 0x03, 0x77);
whismanoid 52:d3fb6f1722bf 4682 }
whismanoid 52:d3fb6f1722bf 4683 break;
whismanoid 52:d3fb6f1722bf 4684 case 'C': case 'c':
whismanoid 52:d3fb6f1722bf 4685 {
whismanoid 52:d3fb6f1722bf 4686 bool isUpdatedI2CConfig = false;
whismanoid 52:d3fb6f1722bf 4687 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 4688 // parse cmdLine arg (SCL=\d+(kHZ|MHZ)?)? --> g_I2C_SCL_Hz
whismanoid 52:d3fb6f1722bf 4689 if (cmdLine.parse_frequency_Hz("SCL", g_I2C_SCL_Hz))
whismanoid 52:d3fb6f1722bf 4690 {
whismanoid 52:d3fb6f1722bf 4691 isUpdatedI2CConfig = true;
whismanoid 52:d3fb6f1722bf 4692 // TODO1: validate g_I2C_SCL_Hz against system clock frequency F_CPU
whismanoid 52:d3fb6f1722bf 4693 if (g_I2C_SCL_Hz > limit_max_I2C_SCL_Hz)
whismanoid 52:d3fb6f1722bf 4694 {
whismanoid 52:d3fb6f1722bf 4695 g_I2C_SCL_Hz = limit_max_I2C_SCL_Hz;
whismanoid 52:d3fb6f1722bf 4696 }
whismanoid 52:d3fb6f1722bf 4697 if (g_I2C_SCL_Hz < limit_min_I2C_SCL_Hz)
whismanoid 52:d3fb6f1722bf 4698 {
whismanoid 52:d3fb6f1722bf 4699 g_I2C_SCL_Hz = limit_min_I2C_SCL_Hz;
whismanoid 52:d3fb6f1722bf 4700 }
whismanoid 52:d3fb6f1722bf 4701 }
whismanoid 52:d3fb6f1722bf 4702 if (isUpdatedI2CConfig)
whismanoid 52:d3fb6f1722bf 4703 {
whismanoid 52:d3fb6f1722bf 4704 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 4705 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 4706 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 4707 i2cMaster.start();
whismanoid 52:d3fb6f1722bf 4708 i2cMaster.stop();
whismanoid 52:d3fb6f1722bf 4709 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 4710 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 4711 "\r\n %%IC ADDR=0x%2.2x=(0x%2.2x>>1) SCL=%d=%1.3fkHz -- I2C config",
whismanoid 52:d3fb6f1722bf 4712 g_I2C_deviceAddress7, (g_I2C_deviceAddress7 << 1), g_I2C_SCL_Hz,
whismanoid 52:d3fb6f1722bf 4713 (g_I2C_SCL_Hz / 1000.));
whismanoid 52:d3fb6f1722bf 4714 i2cMaster.start();
whismanoid 52:d3fb6f1722bf 4715 i2cMaster.stop();
whismanoid 52:d3fb6f1722bf 4716 }
whismanoid 52:d3fb6f1722bf 4717 }
whismanoid 52:d3fb6f1722bf 4718 break;
whismanoid 52:d3fb6f1722bf 4719 case 'W': case 'w':
whismanoid 52:d3fb6f1722bf 4720 {
whismanoid 52:d3fb6f1722bf 4721 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 4722 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 4723 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 4724 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 4725 // parse cmdLine byte list --> int byteCount; int mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 4726 #define MAX_I2C_BYTE_COUNT 32
whismanoid 52:d3fb6f1722bf 4727 size_t byteCount = byteCount;
whismanoid 52:d3fb6f1722bf 4728 static char mosiData[MAX_I2C_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 4729 static char misoData[MAX_I2C_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 4730 if (cmdLine.parse_byteCount_byteList_hex(byteCount, mosiData,
whismanoid 52:d3fb6f1722bf 4731 MAX_I2C_BYTE_COUNT))
whismanoid 52:d3fb6f1722bf 4732 {
whismanoid 52:d3fb6f1722bf 4733 // hex dump mosiData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 4734 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 4735 "\r\nADDR=0x%2.2x=(0x%2.2x>>1) byteCount:%d RD=%d\r\nI2C MOSI->",
whismanoid 52:d3fb6f1722bf 4736 g_I2C_deviceAddress7,
whismanoid 52:d3fb6f1722bf 4737 (g_I2C_deviceAddress7 << 1), byteCount, g_I2C_read_count);
whismanoid 52:d3fb6f1722bf 4738 for (unsigned int byteIndex = 0; byteIndex < byteCount; byteIndex++)
whismanoid 52:d3fb6f1722bf 4739 {
whismanoid 52:d3fb6f1722bf 4740 cmdLine.serial().printf(" 0x%2.2X", mosiData[byteIndex]);
whismanoid 52:d3fb6f1722bf 4741 }
whismanoid 52:d3fb6f1722bf 4742 //
whismanoid 52:d3fb6f1722bf 4743 // TODO: i2c transfer
whismanoid 52:d3fb6f1722bf 4744 //const int addr7bit = 0x48; // 7 bit I2C address
whismanoid 52:d3fb6f1722bf 4745 //const int addr8bit = 0x48 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 4746 // /* int */ i2cMaster.read (int addr8bit, char *data, int length, bool repeated=false) // Read from an I2C slave.
whismanoid 52:d3fb6f1722bf 4747 // /* int */ i2cMaster.read (int ack) // Read a single byte from the I2C bus.
whismanoid 52:d3fb6f1722bf 4748 // /* int */ i2cMaster.write (int addr8bit, const char *data, int length, bool repeated=false) // Write to an I2C slave.
whismanoid 52:d3fb6f1722bf 4749 // /* int */ i2cMaster.write (int data) // Write single byte out on the I2C bus.
whismanoid 52:d3fb6f1722bf 4750 // /* void */ i2cMaster.start (void) // Creates a start condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 4751 // /* void */ i2cMaster.stop (void) // Creates a stop condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 4752 // /* int */ i2cMaster.transfer (int addr8bit, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t &callback, int event=I2C_EVENT_TRANSFER_COMPLETE, bool repeated=false) // Start nonblocking I2C transfer. More...
whismanoid 52:d3fb6f1722bf 4753 // /* void */ i2cMaster.abort_transfer () // Abort the ongoing I2C transfer. More...
whismanoid 52:d3fb6f1722bf 4754 const int addr8bit = g_I2C_deviceAddress7 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 4755 unsigned int misoLength = 0;
whismanoid 52:d3fb6f1722bf 4756 bool repeated = (g_I2C_read_count > 0);
whismanoid 52:d3fb6f1722bf 4757 //
whismanoid 52:d3fb6f1722bf 4758 int writeStatus = i2cMaster.write (addr8bit, mosiData, byteCount, repeated);
whismanoid 52:d3fb6f1722bf 4759 switch (writeStatus)
whismanoid 52:d3fb6f1722bf 4760 {
whismanoid 52:d3fb6f1722bf 4761 case 0: cmdLine.serial().printf(" ack "); break;
whismanoid 52:d3fb6f1722bf 4762 case 1: cmdLine.serial().printf(" nack "); break;
whismanoid 52:d3fb6f1722bf 4763 default: cmdLine.serial().printf(" {writeStatus 0x%2.2X} ",
whismanoid 52:d3fb6f1722bf 4764 writeStatus);
whismanoid 52:d3fb6f1722bf 4765 }
whismanoid 52:d3fb6f1722bf 4766 if (repeated)
whismanoid 52:d3fb6f1722bf 4767 {
whismanoid 52:d3fb6f1722bf 4768 int readStatus =
whismanoid 52:d3fb6f1722bf 4769 i2cMaster.read (addr8bit, misoData, g_I2C_read_count, false);
whismanoid 52:d3fb6f1722bf 4770 switch (readStatus)
whismanoid 52:d3fb6f1722bf 4771 {
whismanoid 52:d3fb6f1722bf 4772 case 1: cmdLine.serial().printf(" nack "); break;
whismanoid 52:d3fb6f1722bf 4773 case 0: cmdLine.serial().printf(" ack "); break;
whismanoid 52:d3fb6f1722bf 4774 default: cmdLine.serial().printf(" {readStatus 0x%2.2X} ",
whismanoid 52:d3fb6f1722bf 4775 readStatus);
whismanoid 52:d3fb6f1722bf 4776 }
whismanoid 52:d3fb6f1722bf 4777 }
whismanoid 52:d3fb6f1722bf 4778 //
whismanoid 52:d3fb6f1722bf 4779 if (misoLength > 0)
whismanoid 52:d3fb6f1722bf 4780 {
whismanoid 52:d3fb6f1722bf 4781 // hex dump misoData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 4782 cmdLine.serial().printf(" MISO<-");
whismanoid 52:d3fb6f1722bf 4783 for (unsigned int byteIndex = 0; byteIndex < g_I2C_read_count;
whismanoid 52:d3fb6f1722bf 4784 byteIndex++)
whismanoid 52:d3fb6f1722bf 4785 {
whismanoid 52:d3fb6f1722bf 4786 cmdLine.serial().printf(" 0x%2.2X", misoData[byteIndex]);
whismanoid 52:d3fb6f1722bf 4787 }
whismanoid 52:d3fb6f1722bf 4788 }
whismanoid 52:d3fb6f1722bf 4789 cmdLine.serial().printf(" ");
whismanoid 52:d3fb6f1722bf 4790 }
whismanoid 52:d3fb6f1722bf 4791 }
whismanoid 52:d3fb6f1722bf 4792 break;
whismanoid 52:d3fb6f1722bf 4793 case 'R': case 'r':
whismanoid 52:d3fb6f1722bf 4794 {
whismanoid 52:d3fb6f1722bf 4795 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 4796 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 4797 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 4798 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 4799 // TODO: i2c transfer
whismanoid 52:d3fb6f1722bf 4800 //const int addr7bit = 0x48; // 7 bit I2C address
whismanoid 52:d3fb6f1722bf 4801 //const int addr8bit = 0x48 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 4802 // /* int */ i2cMaster.read (int addr8bit, char *data, int length, bool repeated=false) // Read from an I2C slave.
whismanoid 52:d3fb6f1722bf 4803 // /* int */ i2cMaster.read (int ack) // Read a single byte from the I2C bus.
whismanoid 52:d3fb6f1722bf 4804 // /* int */ i2cMaster.write (int addr8bit, const char *data, int length, bool repeated=false) // Write to an I2C slave.
whismanoid 52:d3fb6f1722bf 4805 // /* int */ i2cMaster.write (int data) // Write single byte out on the I2C bus.
whismanoid 52:d3fb6f1722bf 4806 // /* void */ i2cMaster.start (void) // Creates a start condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 4807 // /* void */ i2cMaster.stop (void) // Creates a stop condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 4808 // /* int */ i2cMaster.transfer (int addr8bit, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t &callback, int event=I2C_EVENT_TRANSFER_COMPLETE, bool repeated=false) // Start nonblocking I2C transfer. More...
whismanoid 52:d3fb6f1722bf 4809 // /* void */ i2cMaster.abort_transfer () // Abort the ongoing I2C transfer. More...
whismanoid 52:d3fb6f1722bf 4810 }
whismanoid 52:d3fb6f1722bf 4811 break;
whismanoid 52:d3fb6f1722bf 4812 case '^':
whismanoid 52:d3fb6f1722bf 4813 {
whismanoid 52:d3fb6f1722bf 4814 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 4815 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 4816 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 4817 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 4818 // TODO: i2c transfer
whismanoid 52:d3fb6f1722bf 4819 //const int addr7bit = 0x48; // 7 bit I2C address
whismanoid 52:d3fb6f1722bf 4820 //const int addr8bit = 0x48 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 4821 // /* int */ i2cMaster.read (int addr8bit, char *data, int length, bool repeated=false) // Read from an I2C slave.
whismanoid 52:d3fb6f1722bf 4822 // /* int */ i2cMaster.read (int ack) // Read a single byte from the I2C bus.
whismanoid 52:d3fb6f1722bf 4823 // /* int */ i2cMaster.write (int addr8bit, const char *data, int length, bool repeated=false) // Write to an I2C slave.
whismanoid 52:d3fb6f1722bf 4824 // /* int */ i2cMaster.write (int data) // Write single byte out on the I2C bus.
whismanoid 52:d3fb6f1722bf 4825 // /* void */ i2cMaster.start (void) // Creates a start condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 4826 // /* void */ i2cMaster.stop (void) // Creates a stop condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 4827 // /* int */ i2cMaster.transfer (int addr8bit, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t &callback, int event=I2C_EVENT_TRANSFER_COMPLETE, bool repeated=false) // Start nonblocking I2C transfer. More...
whismanoid 52:d3fb6f1722bf 4828 // /* void */ i2cMaster.abort_transfer () // Abort the ongoing I2C transfer. More...
whismanoid 52:d3fb6f1722bf 4829 }
whismanoid 52:d3fb6f1722bf 4830 break;
whismanoid 52:d3fb6f1722bf 4831 } // switch(cmdLine[2])
whismanoid 52:d3fb6f1722bf 4832 break;
whismanoid 52:d3fb6f1722bf 4833 #endif
whismanoid 52:d3fb6f1722bf 4834 //
whismanoid 52:d3fb6f1722bf 4835 #if HAS_SPI // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 4836 case 'S': case 's':
whismanoid 52:d3fb6f1722bf 4837 {
whismanoid 52:d3fb6f1722bf 4838 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 4839 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 4840 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 4841 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 4842 //
whismanoid 52:d3fb6f1722bf 4843 // Process arguments SCLK=\d+(kHZ|MHZ) CPOL=\d CPHA=\d
whismanoid 52:d3fb6f1722bf 4844 bool isUpdatedSPIConfig = false;
whismanoid 52:d3fb6f1722bf 4845 // parse cmdLine arg (CPOL=\d)? --> g_SPI_dataMode | SPI_MODE2
whismanoid 52:d3fb6f1722bf 4846 // parse cmdLine arg (CPHA=\d)? --> g_SPI_dataMode | SPI_MODE1
whismanoid 52:d3fb6f1722bf 4847 if (cmdLine.parse_flag("CPOL", g_SPI_dataMode, SPI_MODE2))
whismanoid 52:d3fb6f1722bf 4848 {
whismanoid 52:d3fb6f1722bf 4849 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 4850 }
whismanoid 52:d3fb6f1722bf 4851 if (cmdLine.parse_flag("CPHA", g_SPI_dataMode, SPI_MODE1))
whismanoid 52:d3fb6f1722bf 4852 {
whismanoid 52:d3fb6f1722bf 4853 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 4854 }
whismanoid 52:d3fb6f1722bf 4855 if (cmdLine.parse_flag("CS", g_SPI_cs_state, 1))
whismanoid 52:d3fb6f1722bf 4856 {
whismanoid 52:d3fb6f1722bf 4857 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 4858 }
whismanoid 52:d3fb6f1722bf 4859 // parse cmdLine arg (SCLK=\d+(kHZ|MHZ)?)? --> g_SPI_SCLK_Hz
whismanoid 52:d3fb6f1722bf 4860 if (cmdLine.parse_frequency_Hz("SCLK", g_SPI_SCLK_Hz))
whismanoid 52:d3fb6f1722bf 4861 {
whismanoid 52:d3fb6f1722bf 4862 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 4863 // TODO1: validate g_SPI_SCLK_Hz against system clock frequency F_CPU
whismanoid 52:d3fb6f1722bf 4864 if (g_SPI_SCLK_Hz > limit_max_SPI_SCLK_Hz)
whismanoid 52:d3fb6f1722bf 4865 {
whismanoid 52:d3fb6f1722bf 4866 g_SPI_SCLK_Hz = limit_max_SPI_SCLK_Hz;
whismanoid 52:d3fb6f1722bf 4867 }
whismanoid 52:d3fb6f1722bf 4868 if (g_SPI_SCLK_Hz < limit_min_SPI_SCLK_Hz)
whismanoid 52:d3fb6f1722bf 4869 {
whismanoid 52:d3fb6f1722bf 4870 g_SPI_SCLK_Hz = limit_min_SPI_SCLK_Hz;
whismanoid 52:d3fb6f1722bf 4871 }
whismanoid 52:d3fb6f1722bf 4872 }
whismanoid 52:d3fb6f1722bf 4873 // Update SPI configuration
whismanoid 52:d3fb6f1722bf 4874 if (isUpdatedSPIConfig)
whismanoid 52:d3fb6f1722bf 4875 {
whismanoid 52:d3fb6f1722bf 4876 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 4877 spi_cs = g_SPI_cs_state;
whismanoid 52:d3fb6f1722bf 4878 spi.format(8,g_SPI_dataMode); // int bits_must_be_8, int mode=0_3 CPOL=0,CPHA=0
whismanoid 52:d3fb6f1722bf 4879 #if APPLICATION_MAX5715
whismanoid 52:d3fb6f1722bf 4880 g_MAX5715_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 4881 #elif APPLICATION_MAX11131
whismanoid 52:d3fb6f1722bf 4882 g_MAX11131_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 4883 #elif APPLICATION_MAX5171
whismanoid 52:d3fb6f1722bf 4884 g_MAX5171_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 4885 #elif APPLICATION_MAX11410
whismanoid 52:d3fb6f1722bf 4886 g_MAX11410_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 4887 #elif APPLICATION_MAX12345
whismanoid 52:d3fb6f1722bf 4888 g_MAX12345_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 4889 #else
whismanoid 52:d3fb6f1722bf 4890 spi.frequency(g_SPI_SCLK_Hz); // int SCLK_Hz=1000000 = 1MHz (initial default)
whismanoid 52:d3fb6f1722bf 4891 #endif
whismanoid 52:d3fb6f1722bf 4892 //
whismanoid 52:d3fb6f1722bf 4893 double ideal_divisor = ((double)SystemCoreClock) / g_SPI_SCLK_Hz;
whismanoid 52:d3fb6f1722bf 4894 int actual_divisor = (int)(ideal_divisor + 0.0); // frequency divisor truncate
whismanoid 52:d3fb6f1722bf 4895 double actual_SCLK_Hz = SystemCoreClock / actual_divisor;
whismanoid 52:d3fb6f1722bf 4896 //
whismanoid 52:d3fb6f1722bf 4897 // fixed: mbed-os-5.11: [Warning] format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
whismanoid 52:d3fb6f1722bf 4898 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 4899 "\r\n %%SC CPOL=%d CPHA=%d CS=%d SCLK=%ld=%1.3fMHz (%1.1fMHz/%1.2f = actual %1.3fMHz) -- SPI config",
whismanoid 52:d3fb6f1722bf 4900 ((g_SPI_dataMode & SPI_MODE2) ? 1 : 0),
whismanoid 52:d3fb6f1722bf 4901 ((g_SPI_dataMode & SPI_MODE1) ? 1 : 0),
whismanoid 52:d3fb6f1722bf 4902 g_SPI_cs_state,
whismanoid 52:d3fb6f1722bf 4903 g_SPI_SCLK_Hz,
whismanoid 52:d3fb6f1722bf 4904 (g_SPI_SCLK_Hz / 1000000.),
whismanoid 52:d3fb6f1722bf 4905 ((double)(SystemCoreClock / 1000000.)),
whismanoid 52:d3fb6f1722bf 4906 ideal_divisor,
whismanoid 52:d3fb6f1722bf 4907 (actual_SCLK_Hz / 1000000.)
whismanoid 52:d3fb6f1722bf 4908 );
whismanoid 52:d3fb6f1722bf 4909 }
whismanoid 52:d3fb6f1722bf 4910 // get next character
whismanoid 52:d3fb6f1722bf 4911 switch (cmdLine[2])
whismanoid 52:d3fb6f1722bf 4912 {
whismanoid 52:d3fb6f1722bf 4913 case 'C': case 's':
whismanoid 52:d3fb6f1722bf 4914 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 4915 break;
whismanoid 52:d3fb6f1722bf 4916 case 'D': case 'd':
whismanoid 52:d3fb6f1722bf 4917 // %SD -- SPI diagnostic messages enable
whismanoid 52:d3fb6f1722bf 4918 if (g_MAX11410_device.onSPIprint) {
whismanoid 52:d3fb6f1722bf 4919 g_MAX11410_device.onSPIprint = NULL;
whismanoid 61:38ec81c33b7a 4920 g_MAX11410_device.futility_countdown_limit = 3000; // Platform_futility_countdown_limit_fast
whismanoid 52:d3fb6f1722bf 4921 }
whismanoid 52:d3fb6f1722bf 4922 else {
whismanoid 52:d3fb6f1722bf 4923 void onSPIprint_handler(size_t byteCount, uint8_t mosiData[], uint8_t misoData[]);
whismanoid 52:d3fb6f1722bf 4924 g_MAX11410_device.onSPIprint = onSPIprint_handler;
whismanoid 61:38ec81c33b7a 4925 g_MAX11410_device.futility_countdown_limit = 30; // Platform_futility_countdown_limit_diagnostic
whismanoid 52:d3fb6f1722bf 4926 }
whismanoid 52:d3fb6f1722bf 4927 break;
whismanoid 52:d3fb6f1722bf 4928 case 'W': case 'R': case 'w': case 'r':
whismanoid 52:d3fb6f1722bf 4929 {
whismanoid 52:d3fb6f1722bf 4930 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 4931 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 4932 // parse cmdLine byte list --> int byteCount; int mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 4933 #define MAX_SPI_BYTE_COUNT 32
whismanoid 52:d3fb6f1722bf 4934 size_t byteCount = byteCount;
whismanoid 52:d3fb6f1722bf 4935 static char mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 4936 static char misoData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 4937 if (cmdLine.parse_byteCount_byteList_hex(byteCount, mosiData,
whismanoid 52:d3fb6f1722bf 4938 MAX_SPI_BYTE_COUNT))
whismanoid 52:d3fb6f1722bf 4939 {
whismanoid 52:d3fb6f1722bf 4940 // hex dump mosiData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 4941 cmdLine.serial().printf("\r\nSPI");
whismanoid 52:d3fb6f1722bf 4942 if (byteCount > 7) {
whismanoid 52:d3fb6f1722bf 4943 cmdLine.serial().printf(" byteCount:%d", byteCount);
whismanoid 52:d3fb6f1722bf 4944 }
whismanoid 52:d3fb6f1722bf 4945 cmdLine.serial().printf(" MOSI->");
whismanoid 52:d3fb6f1722bf 4946 for (unsigned int byteIndex = 0; byteIndex < byteCount; byteIndex++)
whismanoid 52:d3fb6f1722bf 4947 {
whismanoid 52:d3fb6f1722bf 4948 cmdLine.serial().printf(" 0x%2.2X", mosiData[byteIndex]);
whismanoid 52:d3fb6f1722bf 4949 }
whismanoid 52:d3fb6f1722bf 4950 spi_cs = 0;
whismanoid 52:d3fb6f1722bf 4951 unsigned int numBytesTransferred =
whismanoid 52:d3fb6f1722bf 4952 spi.write(mosiData, byteCount, misoData, byteCount);
whismanoid 52:d3fb6f1722bf 4953 spi_cs = 1;
whismanoid 52:d3fb6f1722bf 4954 // hex dump misoData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 4955 cmdLine.serial().printf(" MISO<-");
whismanoid 52:d3fb6f1722bf 4956 for (unsigned int byteIndex = 0; byteIndex < numBytesTransferred;
whismanoid 52:d3fb6f1722bf 4957 byteIndex++)
whismanoid 52:d3fb6f1722bf 4958 {
whismanoid 52:d3fb6f1722bf 4959 cmdLine.serial().printf(" 0x%2.2X", misoData[byteIndex]);
whismanoid 52:d3fb6f1722bf 4960 }
whismanoid 52:d3fb6f1722bf 4961 cmdLine.serial().printf(" ");
whismanoid 52:d3fb6f1722bf 4962 }
whismanoid 52:d3fb6f1722bf 4963 }
whismanoid 52:d3fb6f1722bf 4964 break;
whismanoid 52:d3fb6f1722bf 4965 } // switch(cmdLine[2])
whismanoid 52:d3fb6f1722bf 4966 } // case 'S': // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 4967 break;
whismanoid 52:d3fb6f1722bf 4968 #endif
whismanoid 52:d3fb6f1722bf 4969 //
whismanoid 52:d3fb6f1722bf 4970 // A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 4971 } // switch(cmdLine[1])
whismanoid 52:d3fb6f1722bf 4972 } // end void pinsMonitor_submenu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 4973
whismanoid 52:d3fb6f1722bf 4974
whismanoid 52:d3fb6f1722bf 4975 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4976 void main_menu_status(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 4977 {
whismanoid 52:d3fb6f1722bf 4978 cmdLine.serial().printf("\r\nMain menu");
whismanoid 52:d3fb6f1722bf 4979
whismanoid 52:d3fb6f1722bf 4980 cmdLine.serial().printf(" MAX11410 24-bit 1.9ksps Delta-Sigma ADC");
whismanoid 52:d3fb6f1722bf 4981
whismanoid 52:d3fb6f1722bf 4982 //cmdLine.serial().print(" %s", TARGET_NAME);
whismanoid 52:d3fb6f1722bf 4983 if (cmdLine.nameStr())
whismanoid 52:d3fb6f1722bf 4984 {
whismanoid 52:d3fb6f1722bf 4985 cmdLine.serial().printf(" [%s]", cmdLine.nameStr());
whismanoid 52:d3fb6f1722bf 4986
whismanoid 52:d3fb6f1722bf 4987 }
whismanoid 52:d3fb6f1722bf 4988 cmdLine.serial().printf("\r\n ? -- help");
whismanoid 52:d3fb6f1722bf 4989
whismanoid 52:d3fb6f1722bf 4990 }
whismanoid 52:d3fb6f1722bf 4991
whismanoid 52:d3fb6f1722bf 4992
whismanoid 52:d3fb6f1722bf 4993 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4994 void main_menu_help(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 4995 {
whismanoid 52:d3fb6f1722bf 4996 // ? -- help
whismanoid 52:d3fb6f1722bf 4997 //~ cmdLine.serial().print(F("\r\nMenu:"));
whismanoid 52:d3fb6f1722bf 4998 cmdLine.serial().printf("\r\n # -- lines beginning with # are comments");
whismanoid 52:d3fb6f1722bf 4999
whismanoid 52:d3fb6f1722bf 5000 cmdLine.serial().printf("\r\n . -- SelfTest");
whismanoid 52:d3fb6f1722bf 5001
whismanoid 52:d3fb6f1722bf 5002 //cmdLine.serial().print(F("\r\n ! -- Initial Configuration"));
whismanoid 52:d3fb6f1722bf 5003 //
whismanoid 52:d3fb6f1722bf 5004 // % standardize diagnostic commands
whismanoid 52:d3fb6f1722bf 5005 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 5006 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 5007 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 5008 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 5009 // %Ppin df=xx -- pwm output
whismanoid 52:d3fb6f1722bf 5010 // %Wpin -- measure high pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 5011 // %wpin -- measure low pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 5012 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 5013 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 5014 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 5015 // %IW ADDR=? cmd=? data,data,data -- write
whismanoid 52:d3fb6f1722bf 5016 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 5017 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5018 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 5019 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5020 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 5021 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 5022 // A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 5023 //
whismanoid 52:d3fb6f1722bf 5024 #if HAS_digitalInOuts
whismanoid 52:d3fb6f1722bf 5025 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 5026 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 5027 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 5028 cmdLine.serial().printf("\r\n %%Hn {pin:");
whismanoid 52:d3fb6f1722bf 5029 list_digitalInOutPins(cmdLine.serial());
whismanoid 52:d3fb6f1722bf 5030 cmdLine.serial().printf("} -- High Output");
whismanoid 52:d3fb6f1722bf 5031 cmdLine.serial().printf("\r\n %%Ln {pin:");
whismanoid 52:d3fb6f1722bf 5032 list_digitalInOutPins(cmdLine.serial());
whismanoid 52:d3fb6f1722bf 5033 cmdLine.serial().printf("} -- Low Output");
whismanoid 52:d3fb6f1722bf 5034 cmdLine.serial().printf("\r\n %%?n {pin:");
whismanoid 52:d3fb6f1722bf 5035 list_digitalInOutPins(cmdLine.serial());
whismanoid 52:d3fb6f1722bf 5036 cmdLine.serial().printf("} -- Input");
whismanoid 52:d3fb6f1722bf 5037 #endif
whismanoid 52:d3fb6f1722bf 5038
whismanoid 52:d3fb6f1722bf 5039 #if HAS_analogIns
whismanoid 52:d3fb6f1722bf 5040 // Menu A) analogRead A0..7
whismanoid 52:d3fb6f1722bf 5041 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 5042 // analogRead(pinIndex) // analog input pins A0, A1, A2, A3, A4, A5; float voltage = analogRead(A0) * (5.0 / 1023.0)
whismanoid 52:d3fb6f1722bf 5043 cmdLine.serial().printf("\r\n %%A -- analogRead");
whismanoid 52:d3fb6f1722bf 5044 #endif
whismanoid 52:d3fb6f1722bf 5045
whismanoid 52:d3fb6f1722bf 5046 #if HAS_SPI2_MAX541
whismanoid 52:d3fb6f1722bf 5047 // TODO1: MAX541 max541(spi2_max541, spi2_max541_cs);
whismanoid 52:d3fb6f1722bf 5048 cmdLine.serial().printf("\r\n %%D -- DAC output MAX541 (SPI2)");
whismanoid 52:d3fb6f1722bf 5049 #endif
whismanoid 52:d3fb6f1722bf 5050
whismanoid 52:d3fb6f1722bf 5051 #if HAS_I2C // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5052 // TODO: support I2C HAS_I2C // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5053 // VERIFY: I2C utility commands SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5054 // VERIFY: report g_I2C_SCL_Hz = (F_CPU / ((TWBR * 2) + 16)) from last Wire_Sr.setClock(I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5055 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 5056 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 5057 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 5058 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 5059 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 5060 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5061 //g_I2C_SCL_Hz = (F_CPU / ((TWBR * 2) + 16)); // 'F_CPU' 'TWBR' not declared in this scope
whismanoid 52:d3fb6f1722bf 5062 cmdLine.serial().printf("\r\n %%IC ADDR=0x%2.2x=(0x%2.2x>>1) SCL=%d=%1.3fkHz -- I2C config",
whismanoid 52:d3fb6f1722bf 5063 g_I2C_deviceAddress7, (g_I2C_deviceAddress7 << 1), g_I2C_SCL_Hz,
whismanoid 52:d3fb6f1722bf 5064 (g_I2C_SCL_Hz / 1000.));
whismanoid 52:d3fb6f1722bf 5065 cmdLine.serial().printf("\r\n %%IW byte byte ... byte RD=? ADDR=0x%2.2x -- I2C write/read",
whismanoid 52:d3fb6f1722bf 5066 g_I2C_deviceAddress7);
whismanoid 52:d3fb6f1722bf 5067 //
whismanoid 52:d3fb6f1722bf 5068 #if SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5069 // Menu ^ cmd=?) i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5070 cmdLine.serial().printf("\r\n %%I^ cmd=? -- i2c_smbus_read_word_data");
whismanoid 52:d3fb6f1722bf 5071 // test low-level I2C i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5072 #endif // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5073 //cmdLine.serial().printf(" H) Hunt for attached I2C devices");
whismanoid 52:d3fb6f1722bf 5074 cmdLine.serial().printf("\r\n %%IP -- I2C Probe for attached devices");
whismanoid 52:d3fb6f1722bf 5075 // cmdLine.serial().printf(" s) search i2c address");
whismanoid 52:d3fb6f1722bf 5076 #endif // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5077
whismanoid 52:d3fb6f1722bf 5078 #if HAS_SPI // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5079 // TODO: support SPI HAS_SPI // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5080 // SPI test command S (mosiData)+
whismanoid 52:d3fb6f1722bf 5081 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 5082 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5083 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 5084 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 5085 // spi.format(8,0); // int bits_must_be_8, int mode=0_3 CPOL=0,CPHA=0 rising edge (initial default)
whismanoid 52:d3fb6f1722bf 5086 // spi.format(8,1); // int bits_must_be_8, int mode=0_3 CPOL=0,CPHA=1 falling edge (initial default)
whismanoid 52:d3fb6f1722bf 5087 // spi.format(8,2); // int bits_must_be_8, int mode=0_3 CPOL=1,CPHA=0 falling edge (initial default)
whismanoid 52:d3fb6f1722bf 5088 // spi.format(8,3); // int bits_must_be_8, int mode=0_3 CPOL=1,CPHA=1 rising edge (initial default)
whismanoid 52:d3fb6f1722bf 5089 // spi.frequency(1000000); // int SCLK_Hz=1000000 = 1MHz (initial default)
whismanoid 52:d3fb6f1722bf 5090 // mode | POL PHA
whismanoid 52:d3fb6f1722bf 5091 // -----+--------
whismanoid 52:d3fb6f1722bf 5092 // 0 | 0 0
whismanoid 52:d3fb6f1722bf 5093 // 1 | 0 1
whismanoid 52:d3fb6f1722bf 5094 // 2 | 1 0
whismanoid 52:d3fb6f1722bf 5095 // 3 | 1 1
whismanoid 52:d3fb6f1722bf 5096 //cmdLine.serial().printf(" S) SPI mosi,mosi,...mosi hex bytes SCLK=1000000 CPOL=0 CPHA=0");
whismanoid 52:d3fb6f1722bf 5097 // fixed: mbed-os-5.11: [Warning] format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]
whismanoid 52:d3fb6f1722bf 5098 cmdLine.serial().printf("\r\n %%SC SCLK=%ld=%1.3fMHz CPOL=%d CPHA=%d -- SPI config",
whismanoid 52:d3fb6f1722bf 5099 g_SPI_SCLK_Hz, (g_SPI_SCLK_Hz / 1000000.),
whismanoid 52:d3fb6f1722bf 5100 ((g_SPI_dataMode & SPI_MODE2) ? 1 : 0),
whismanoid 52:d3fb6f1722bf 5101 ((g_SPI_dataMode & SPI_MODE1) ? 1 : 0));
whismanoid 52:d3fb6f1722bf 5102 cmdLine.serial().printf("\r\n %%SD -- SPI diagnostic messages ");
whismanoid 52:d3fb6f1722bf 5103 if (g_MAX11410_device.onSPIprint) {
whismanoid 52:d3fb6f1722bf 5104 cmdLine.serial().printf("hide");
whismanoid 52:d3fb6f1722bf 5105 }
whismanoid 52:d3fb6f1722bf 5106 else {
whismanoid 52:d3fb6f1722bf 5107 cmdLine.serial().printf("show");
whismanoid 52:d3fb6f1722bf 5108 }
whismanoid 52:d3fb6f1722bf 5109 cmdLine.serial().printf("\r\n %%SW mosi,mosi,...mosi -- SPI write hex bytes");
whismanoid 52:d3fb6f1722bf 5110 // VERIFY: parse new SPI settings parse_strCommandArgs() SCLK=1000000 CPOL=0 CPHA=0
whismanoid 52:d3fb6f1722bf 5111 #endif // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5112 //
whismanoid 52:d3fb6f1722bf 5113 // Application-specific commands (help text) here
whismanoid 52:d3fb6f1722bf 5114 //
whismanoid 52:d3fb6f1722bf 5115 #if APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5116 cmdLine.serial().printf("\r\n A-Z,a-z,0-9 -- reserved for application use"); // ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5117 #endif // APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5118 //
whismanoid 52:d3fb6f1722bf 5119
whismanoid 56:6e9c52cc9abe 5120 extern void MAX11410_menu_help(CmdLine & cmdLine); // defined in Test_Menu_MAX11410.cpp\n
whismanoid 52:d3fb6f1722bf 5121 MAX11410_menu_help(cmdLine);
whismanoid 52:d3fb6f1722bf 5122 }
whismanoid 52:d3fb6f1722bf 5123
whismanoid 52:d3fb6f1722bf 5124
whismanoid 52:d3fb6f1722bf 5125
whismanoid 52:d3fb6f1722bf 5126 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5127 // main menu command-line parser
whismanoid 52:d3fb6f1722bf 5128 // invoked by CmdLine::append(char ch) or CmdLine::idleAppendIfReadable()
whismanoid 52:d3fb6f1722bf 5129 void main_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5130 {
whismanoid 52:d3fb6f1722bf 5131 // DIAGNOSTIC: print line buffer
whismanoid 52:d3fb6f1722bf 5132 //~ cmdLine.serial().printf("\r\nmain_menu_onEOLcommandParser: ~%s~\r\n", cmdLine.str());
whismanoid 52:d3fb6f1722bf 5133 //
whismanoid 52:d3fb6f1722bf 5134 switch (cmdLine[0])
whismanoid 52:d3fb6f1722bf 5135 {
whismanoid 52:d3fb6f1722bf 5136 case '?':
whismanoid 52:d3fb6f1722bf 5137 main_menu_status(cmdLine);
whismanoid 52:d3fb6f1722bf 5138 main_menu_help(cmdLine);
whismanoid 52:d3fb6f1722bf 5139 // print command prompt
whismanoid 52:d3fb6f1722bf 5140 //cmdLine.serial().printf("\r\n>");
whismanoid 52:d3fb6f1722bf 5141 break;
whismanoid 52:d3fb6f1722bf 5142 case '\r': case '\n': // ignore blank line
whismanoid 52:d3fb6f1722bf 5143 case '\0': // ignore empty line
whismanoid 52:d3fb6f1722bf 5144 case '#': // ignore comment line
whismanoid 52:d3fb6f1722bf 5145 // # -- lines beginning with # are comments
whismanoid 52:d3fb6f1722bf 5146 main_menu_status(cmdLine);
whismanoid 52:d3fb6f1722bf 5147 //~ main_menu_help(cmdLine);
whismanoid 52:d3fb6f1722bf 5148 // print command prompt
whismanoid 52:d3fb6f1722bf 5149 //cmdLine.serial().printf("\r\n>");
whismanoid 52:d3fb6f1722bf 5150 break;
whismanoid 52:d3fb6f1722bf 5151 #if ECHO_EOF_ON_EOL
whismanoid 52:d3fb6f1722bf 5152 case '\x04': // Unicode (U+0004) EOT END OF TRANSMISSION = CTRL+D as EOF end of file
whismanoid 52:d3fb6f1722bf 5153 cmdLine.serial().printf("\x04"); // immediately echo EOF for test scripting
whismanoid 52:d3fb6f1722bf 5154 diagnostic_led_EOF();
whismanoid 52:d3fb6f1722bf 5155 break;
whismanoid 52:d3fb6f1722bf 5156 case '\x1a': // Unicode (U+001A) SUB SUBSTITUTE = CTRL+Z as EOF end of file
whismanoid 52:d3fb6f1722bf 5157 cmdLine.serial().printf("\x1a"); // immediately echo EOF for test scripting
whismanoid 52:d3fb6f1722bf 5158 diagnostic_led_EOF();
whismanoid 52:d3fb6f1722bf 5159 break;
whismanoid 52:d3fb6f1722bf 5160 #endif
whismanoid 52:d3fb6f1722bf 5161 #if APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5162 case '.':
whismanoid 52:d3fb6f1722bf 5163 {
whismanoid 52:d3fb6f1722bf 5164 // . -- SelfTest
whismanoid 52:d3fb6f1722bf 5165 cmdLine.serial().printf("SelfTest()");
whismanoid 52:d3fb6f1722bf 5166 SelfTest(cmdLine);
whismanoid 52:d3fb6f1722bf 5167 }
whismanoid 52:d3fb6f1722bf 5168 break;
whismanoid 52:d3fb6f1722bf 5169 case '%':
whismanoid 52:d3fb6f1722bf 5170 {
whismanoid 52:d3fb6f1722bf 5171 pinsMonitor_submenu_onEOLcommandParser(cmdLine);
whismanoid 52:d3fb6f1722bf 5172 }
whismanoid 52:d3fb6f1722bf 5173 break; // case '%'
whismanoid 52:d3fb6f1722bf 5174 #endif // APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5175 //
whismanoid 52:d3fb6f1722bf 5176 // Application-specific commands here
whismanoid 52:d3fb6f1722bf 5177 // alphanumeric command codes A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 5178 //
whismanoid 52:d3fb6f1722bf 5179 #if APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5180 #endif // APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5181
whismanoid 52:d3fb6f1722bf 5182 //
whismanoid 52:d3fb6f1722bf 5183 // add new commands here
whismanoid 52:d3fb6f1722bf 5184 //
whismanoid 52:d3fb6f1722bf 5185 default:
whismanoid 52:d3fb6f1722bf 5186 extern bool MAX11410_menu_onEOLcommandParser(CmdLine & cmdLine); // defined in Test_Menu_MAX11410.cpp
whismanoid 52:d3fb6f1722bf 5187 if (!MAX11410_menu_onEOLcommandParser(cmdLine))
whismanoid 52:d3fb6f1722bf 5188 { // not_handled_by_device_submenu
whismanoid 52:d3fb6f1722bf 5189 cmdLine.serial().printf("\r\n unknown command 0x%2.2x \"%s\"\r\n", cmdLine.str()[0], cmdLine.str());
whismanoid 52:d3fb6f1722bf 5190
whismanoid 52:d3fb6f1722bf 5191 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5192 cmdLine_DAPLINKserial.serial().printf("\r\n unknown command 0x%2.2x \"%s\"\r\n", cmdLine.str()[0], cmdLine.str());
whismanoid 52:d3fb6f1722bf 5193
whismanoid 52:d3fb6f1722bf 5194 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5195 }
whismanoid 52:d3fb6f1722bf 5196 } // switch (cmdLine[0])
whismanoid 52:d3fb6f1722bf 5197 //
whismanoid 52:d3fb6f1722bf 5198 // print command prompt
whismanoid 52:d3fb6f1722bf 5199 cmdLine.serial().printf("\r\nMAX11410 > ");
whismanoid 52:d3fb6f1722bf 5200
whismanoid 52:d3fb6f1722bf 5201 } // end void main_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5202
whismanoid 52:d3fb6f1722bf 5203 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5204 #if MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 5205 // Optional Diagnostic function to print SPI transactions
whismanoid 52:d3fb6f1722bf 5206 void onSPIprint_handler(size_t byteCount, uint8_t mosiData[], uint8_t misoData[])
whismanoid 52:d3fb6f1722bf 5207 {
whismanoid 59:c0376adb6ebc 5208 cmdLine_serial.serial().printf("\r\n SPI MOSI->");
whismanoid 52:d3fb6f1722bf 5209 for (uint8_t index = 0; index < byteCount; index++) {
whismanoid 52:d3fb6f1722bf 5210 cmdLine_serial.serial().printf(" 0x%2.2X", mosiData[index]);
whismanoid 52:d3fb6f1722bf 5211 }
whismanoid 52:d3fb6f1722bf 5212 cmdLine_serial.serial().printf(" MISO<-");
whismanoid 52:d3fb6f1722bf 5213 for (uint8_t index = 0; index < byteCount; index++) {
whismanoid 52:d3fb6f1722bf 5214 cmdLine_serial.serial().printf(" 0x%2.2X", misoData[index]);
whismanoid 52:d3fb6f1722bf 5215 }
whismanoid 52:d3fb6f1722bf 5216 cmdLine_serial.serial().printf(" ");
whismanoid 52:d3fb6f1722bf 5217 }
whismanoid 52:d3fb6f1722bf 5218 #endif // MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 5219
whismanoid 52:d3fb6f1722bf 5220 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5221 void InitializeConfiguration()
whismanoid 52:d3fb6f1722bf 5222 {
whismanoid 52:d3fb6f1722bf 5223 // CODE GENERATOR: example code: member function Init
whismanoid 52:d3fb6f1722bf 5224 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5225 cmdLine_DAPLINKserial.serial().printf("\r\nMAX11410_Init()");
whismanoid 52:d3fb6f1722bf 5226
whismanoid 52:d3fb6f1722bf 5227 # endif
whismanoid 52:d3fb6f1722bf 5228 cmdLine_serial.serial().printf("\r\nMAX11410_Init()");
whismanoid 52:d3fb6f1722bf 5229
whismanoid 52:d3fb6f1722bf 5230 // Initialize MAX11410 and verify device ID
whismanoid 52:d3fb6f1722bf 5231 if (g_MAX11410_device.Init() == 0)
whismanoid 52:d3fb6f1722bf 5232 { // init failed; try "safe mode" SPI at slower SCLK rate
whismanoid 52:d3fb6f1722bf 5233 cmdLine_serial.serial().printf("\r\nMAX11410 Init failed; retry at SPI SCLK frequency 2000000 Hz\r\n");
whismanoid 52:d3fb6f1722bf 5234
whismanoid 52:d3fb6f1722bf 5235 g_SPI_SCLK_Hz = 2000000;
whismanoid 52:d3fb6f1722bf 5236 g_MAX11410_device.spi_frequency(2000000);
whismanoid 52:d3fb6f1722bf 5237 g_MAX11410_device.Init();
whismanoid 52:d3fb6f1722bf 5238 }
whismanoid 52:d3fb6f1722bf 5239 // CODE GENERATOR: get spi properties from device
whismanoid 52:d3fb6f1722bf 5240 if (g_SPI_SCLK_Hz > g_MAX11410_device.get_spi_frequency())
whismanoid 52:d3fb6f1722bf 5241 { // Device limits SPI SCLK frequency
whismanoid 52:d3fb6f1722bf 5242 g_SPI_SCLK_Hz = g_MAX11410_device.get_spi_frequency();
whismanoid 56:6e9c52cc9abe 5243 cmdLine_serial.serial().printf("\r\nMAX11410 limits SPI SCLK frequency to %ld Hz\r\n", g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5244
whismanoid 52:d3fb6f1722bf 5245 g_MAX11410_device.Init();
whismanoid 52:d3fb6f1722bf 5246 }
whismanoid 52:d3fb6f1722bf 5247 if (g_MAX11410_device.get_spi_frequency() > g_SPI_SCLK_Hz)
whismanoid 52:d3fb6f1722bf 5248 { // Platform limits SPI SCLK frequency
whismanoid 52:d3fb6f1722bf 5249 g_MAX11410_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 56:6e9c52cc9abe 5250 cmdLine_serial.serial().printf("\r\nPlatform limits MAX11410 SPI SCLK frequency to %ld Hz\r\n", g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5251
whismanoid 52:d3fb6f1722bf 5252 g_MAX11410_device.Init();
whismanoid 52:d3fb6f1722bf 5253 }
whismanoid 52:d3fb6f1722bf 5254 g_SPI_dataMode = g_MAX11410_device.get_spi_dataMode();
whismanoid 52:d3fb6f1722bf 5255
whismanoid 52:d3fb6f1722bf 5256 # if MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 5257 // Optional Diagnostic function to print SPI transactions
whismanoid 52:d3fb6f1722bf 5258 g_MAX11410_device.onSPIprint = onSPIprint_handler;
whismanoid 52:d3fb6f1722bf 5259 # endif
whismanoid 52:d3fb6f1722bf 5260 }
whismanoid 52:d3fb6f1722bf 5261
whismanoid 52:d3fb6f1722bf 5262 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5263 // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5264 void diagnostic_led_EOF()
whismanoid 52:d3fb6f1722bf 5265 {
whismanoid 52:d3fb6f1722bf 5266 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5267 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5268 // TODO1: mbed-os-5.11: [Warning] 'static osStatus rtos::Thread::wait(uint32_t)' is deprecated: Static methods only affecting current thread cause confusion. Replaced by ThisThread::sleep_for. [since mbed-os-5.10] [-Wdeprecated-declarations]
whismanoid 52:d3fb6f1722bf 5269 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5270 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5271 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5272 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5273 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5274 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5275 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5276 #endif // USE_LEDS
whismanoid 52:d3fb6f1722bf 5277 }
whismanoid 52:d3fb6f1722bf 5278
whismanoid 52:d3fb6f1722bf 5279 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5280 // Support commands that get handled immediately w/o waiting for EOL
whismanoid 52:d3fb6f1722bf 5281 // handled as immediate command, do not append to buffer
whismanoid 52:d3fb6f1722bf 5282 void on_immediate_0x21() // Unicode (U+0021) ! EXCLAMATION MARK
whismanoid 52:d3fb6f1722bf 5283 {
whismanoid 52:d3fb6f1722bf 5284 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5285 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 5286 #endif // USE_LEDS
whismanoid 52:d3fb6f1722bf 5287 InitializeConfiguration();
whismanoid 52:d3fb6f1722bf 5288 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5289 }
whismanoid 52:d3fb6f1722bf 5290
whismanoid 52:d3fb6f1722bf 5291 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5292 // Support commands that get handled immediately w/o waiting for EOL
whismanoid 52:d3fb6f1722bf 5293 // handled as immediate command, do not append to buffer
whismanoid 52:d3fb6f1722bf 5294 void on_immediate_0x7b() // Unicode (U+007B) { LEFT CURLY BRACKET
whismanoid 52:d3fb6f1722bf 5295 {
whismanoid 52:d3fb6f1722bf 5296 #if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5297 onButton2FallingEdge();
whismanoid 52:d3fb6f1722bf 5298 #endif
whismanoid 52:d3fb6f1722bf 5299 }
whismanoid 52:d3fb6f1722bf 5300
whismanoid 52:d3fb6f1722bf 5301 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5302 // Support commands that get handled immediately w/o waiting for EOL
whismanoid 52:d3fb6f1722bf 5303 // handled as immediate command, do not append to buffer
whismanoid 52:d3fb6f1722bf 5304 void on_immediate_0x7d() // Unicode (U+007D) } RIGHT CURLY BRACKET
whismanoid 52:d3fb6f1722bf 5305 {
whismanoid 52:d3fb6f1722bf 5306 #if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5307 onButton1FallingEdge();
whismanoid 52:d3fb6f1722bf 5308 #endif
whismanoid 52:d3fb6f1722bf 5309 }
whismanoid 52:d3fb6f1722bf 5310
whismanoid 52:d3fb6f1722bf 5311 //----------------------------------------
whismanoid 52:d3fb6f1722bf 5312 // example code main function
whismanoid 52:d3fb6f1722bf 5313 int main()
whismanoid 52:d3fb6f1722bf 5314 {
whismanoid 52:d3fb6f1722bf 5315 // Configure serial ports
whismanoid 52:d3fb6f1722bf 5316 cmdLine_serial.clear();
whismanoid 52:d3fb6f1722bf 5317 //~ cmdLine_serial.serial().printf("\r\n cmdLine_serial.serial().printf test\r\n");
whismanoid 52:d3fb6f1722bf 5318 cmdLine_serial.onEOLcommandParser = main_menu_onEOLcommandParser;
whismanoid 52:d3fb6f1722bf 5319 cmdLine_serial.diagnostic_led_EOF = diagnostic_led_EOF;
whismanoid 52:d3fb6f1722bf 5320 /// CmdLine::set_immediate_handler(char, functionPointer_void_void_on_immediate_0x21);
whismanoid 52:d3fb6f1722bf 5321 cmdLine_serial.on_immediate_0x21 = on_immediate_0x21;
whismanoid 52:d3fb6f1722bf 5322 cmdLine_serial.on_immediate_0x7b = on_immediate_0x7b;
whismanoid 52:d3fb6f1722bf 5323 cmdLine_serial.on_immediate_0x7d = on_immediate_0x7d;
whismanoid 52:d3fb6f1722bf 5324 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5325 cmdLine_DAPLINKserial.clear();
whismanoid 52:d3fb6f1722bf 5326 //~ cmdLine_DAPLINKserial.serial().printf("\r\n cmdLine_DAPLINKserial.serial().printf test\r\n");
whismanoid 52:d3fb6f1722bf 5327 cmdLine_DAPLINKserial.onEOLcommandParser = main_menu_onEOLcommandParser;
whismanoid 52:d3fb6f1722bf 5328 /// @todo CmdLine::set_immediate_handler(char, functionPointer_void_void_on_immediate_0x21);
whismanoid 52:d3fb6f1722bf 5329 cmdLine_DAPLINKserial.on_immediate_0x21 = on_immediate_0x21;
whismanoid 52:d3fb6f1722bf 5330 cmdLine_DAPLINKserial.on_immediate_0x7b = on_immediate_0x7b;
whismanoid 52:d3fb6f1722bf 5331 cmdLine_DAPLINKserial.on_immediate_0x7d = on_immediate_0x7d;
whismanoid 52:d3fb6f1722bf 5332 # endif
whismanoid 52:d3fb6f1722bf 5333
whismanoid 52:d3fb6f1722bf 5334
whismanoid 52:d3fb6f1722bf 5335 //print_banner();
whismanoid 52:d3fb6f1722bf 5336
whismanoid 59:c0376adb6ebc 5337 #if HAS_I2C
whismanoid 59:c0376adb6ebc 5338 // i2c init
whismanoid 59:c0376adb6ebc 5339 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 59:c0376adb6ebc 5340 // i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 59:c0376adb6ebc 5341 #else
whismanoid 59:c0376adb6ebc 5342 // Ensure that the unused I2C pins do not interfere with analog inputs A4 and A5
whismanoid 59:c0376adb6ebc 5343 #if HAS_digitalInOut14
whismanoid 59:c0376adb6ebc 5344 // DigitalInOut digitalInOut14(P1_6, PIN_INPUT, PullUp, 1); // P1_6 TARGET_MAX32635MBED A4/SDA (10pin digital connector)
whismanoid 59:c0376adb6ebc 5345 digitalInOut14.input();
whismanoid 59:c0376adb6ebc 5346 #endif
whismanoid 59:c0376adb6ebc 5347 #if HAS_digitalInOut15
whismanoid 59:c0376adb6ebc 5348 // DigitalInOut digitalInOut15(P1_7, PIN_INPUT, PullUp, 1); // P1_7 TARGET_MAX32635MBED A5/SCL (10pin digital connector)
whismanoid 59:c0376adb6ebc 5349 digitalInOut15.input();
whismanoid 59:c0376adb6ebc 5350 #endif
whismanoid 59:c0376adb6ebc 5351 #if HAS_digitalInOut16
whismanoid 59:c0376adb6ebc 5352 // DigitalInOut mode can be one of PullUp, PullDown, PullNone, OpenDrain
whismanoid 59:c0376adb6ebc 5353 // PullUp-->3.4V, PullDown-->1.7V, PullNone-->3.5V, OpenDrain-->0.00V
whismanoid 59:c0376adb6ebc 5354 //DigitalInOut digitalInOut16(P3_4, PIN_INPUT, OpenDrain, 0); // P3_4 TARGET_MAX32635MBED A4/SDA (6pin analog connector)
whismanoid 59:c0376adb6ebc 5355 digitalInOut16.input();
whismanoid 59:c0376adb6ebc 5356 #endif
whismanoid 59:c0376adb6ebc 5357 #if HAS_digitalInOut17
whismanoid 59:c0376adb6ebc 5358 //DigitalInOut digitalInOut17(P3_5, PIN_INPUT, OpenDrain, 0); // P3_5 TARGET_MAX32635MBED A5/SCL (6pin analog connector)
whismanoid 59:c0376adb6ebc 5359 digitalInOut17.input();
whismanoid 59:c0376adb6ebc 5360 #endif
whismanoid 59:c0376adb6ebc 5361 #endif // HAS_I2C
whismanoid 52:d3fb6f1722bf 5362
whismanoid 52:d3fb6f1722bf 5363
whismanoid 52:d3fb6f1722bf 5364 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5365 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 5366 led1 = LED_ON; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led RED
whismanoid 52:d3fb6f1722bf 5367 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5368 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5369 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5370 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 5371 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5372 led1 = LED_ON; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led RED+GREEN+BLUE=WHITE
whismanoid 52:d3fb6f1722bf 5373 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5374 led1 = LED_OFF; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led GREEN+BLUE=CYAN
whismanoid 52:d3fb6f1722bf 5375 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5376 led1 = LED_ON; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led RED+BLUE=MAGENTA
whismanoid 52:d3fb6f1722bf 5377 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5378 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5379 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5380 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led BLACK
whismanoid 52:d3fb6f1722bf 5381 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5382 #elif defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 5383 led1 = LED_ON; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led RED
whismanoid 52:d3fb6f1722bf 5384 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5385 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5386 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5387 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 5388 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5389 led1 = LED_ON; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led RED+GREEN+BLUE=WHITE
whismanoid 52:d3fb6f1722bf 5390 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5391 led1 = LED_OFF; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led GREEN+BLUE=CYAN
whismanoid 52:d3fb6f1722bf 5392 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5393 led1 = LED_ON; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led RED+BLUE=MAGENTA
whismanoid 52:d3fb6f1722bf 5394 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5395 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5396 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5397 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led BLACK
whismanoid 52:d3fb6f1722bf 5398 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5399 #else // not defined(TARGET_LPC1768 etc.)
whismanoid 52:d3fb6f1722bf 5400 led1 = LED_ON;
whismanoid 52:d3fb6f1722bf 5401 led2 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5402 led3 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5403 led4 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5404 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5405 //led1 = LED_ON;
whismanoid 52:d3fb6f1722bf 5406 led2 = LED_ON;
whismanoid 52:d3fb6f1722bf 5407 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5408 led1 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5409 //led2 = LED_ON;
whismanoid 52:d3fb6f1722bf 5410 led3 = LED_ON;
whismanoid 52:d3fb6f1722bf 5411 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5412 led2 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5413 //led3 = LED_ON;
whismanoid 52:d3fb6f1722bf 5414 led4 = LED_ON;
whismanoid 52:d3fb6f1722bf 5415 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5416 led3 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5417 led4 = LED_ON;
whismanoid 52:d3fb6f1722bf 5418 //
whismanoid 52:d3fb6f1722bf 5419 #endif // target definition
whismanoid 52:d3fb6f1722bf 5420 #endif
whismanoid 52:d3fb6f1722bf 5421
whismanoid 52:d3fb6f1722bf 5422 // cmd_TE();
whismanoid 52:d3fb6f1722bf 5423
whismanoid 52:d3fb6f1722bf 5424 // #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5425 // rgb_led.white(); // diagnostic rbg led RED+GREEN+BLUE=WHITE
whismanoid 52:d3fb6f1722bf 5426 // #endif // USE_LEDS
whismanoid 57:dc118969c848 5427 if (led1.is_connected()) {
whismanoid 57:dc118969c848 5428 led1 = LED_ON;
whismanoid 57:dc118969c848 5429 }
whismanoid 57:dc118969c848 5430 if (led2.is_connected()) {
whismanoid 57:dc118969c848 5431 led2 = LED_ON;
whismanoid 57:dc118969c848 5432 }
whismanoid 57:dc118969c848 5433 if (led3.is_connected()) {
whismanoid 57:dc118969c848 5434 led3 = LED_ON;
whismanoid 57:dc118969c848 5435 }
whismanoid 52:d3fb6f1722bf 5436
whismanoid 52:d3fb6f1722bf 5437 InitializeConfiguration();
whismanoid 52:d3fb6f1722bf 5438 // example code: serial port banner message
whismanoid 52:d3fb6f1722bf 5439 #if defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 5440 serial.printf("MAX32625MBED ");
whismanoid 52:d3fb6f1722bf 5441 #elif defined(TARGET_MAX32600MBED)
whismanoid 52:d3fb6f1722bf 5442 serial.printf("MAX32600MBED ");
whismanoid 52:d3fb6f1722bf 5443 #elif defined(TARGET_NUCLEO_F446RE)
whismanoid 52:d3fb6f1722bf 5444 serial.printf("NUCLEO_F446RE ");
whismanoid 52:d3fb6f1722bf 5445 #endif
whismanoid 52:d3fb6f1722bf 5446 serial.printf("MAX11410BOB\r\n");
whismanoid 52:d3fb6f1722bf 5447
whismanoid 52:d3fb6f1722bf 5448
whismanoid 52:d3fb6f1722bf 5449 while (1) {
whismanoid 52:d3fb6f1722bf 5450 #if HAS_BUTTON1_DEMO_INTERRUPT_POLLING
whismanoid 52:d3fb6f1722bf 5451 // avoid runtime error on button1 press [mbed-os-5.11]
whismanoid 52:d3fb6f1722bf 5452 // instead of using InterruptIn, use DigitalIn and poll in main while(1)
whismanoid 52:d3fb6f1722bf 5453 # if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5454 static int button1_value_prev = 1;
whismanoid 52:d3fb6f1722bf 5455 static int button1_value_now = 1;
whismanoid 52:d3fb6f1722bf 5456 button1_value_prev = button1_value_now;
whismanoid 52:d3fb6f1722bf 5457 button1_value_now = button1.read();
whismanoid 52:d3fb6f1722bf 5458 if ((button1_value_prev - button1_value_now) == 1)
whismanoid 52:d3fb6f1722bf 5459 {
whismanoid 52:d3fb6f1722bf 5460 // on button1 falling edge (button1 press)
whismanoid 52:d3fb6f1722bf 5461 onButton1FallingEdge();
whismanoid 52:d3fb6f1722bf 5462 }
whismanoid 52:d3fb6f1722bf 5463 # endif // HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5464 # if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5465 static int button2_value_prev = 1;
whismanoid 52:d3fb6f1722bf 5466 static int button2_value_now = 1;
whismanoid 52:d3fb6f1722bf 5467 button2_value_prev = button2_value_now;
whismanoid 52:d3fb6f1722bf 5468 button2_value_now = button2.read();
whismanoid 52:d3fb6f1722bf 5469 if ((button2_value_prev - button2_value_now) == 1)
whismanoid 52:d3fb6f1722bf 5470 {
whismanoid 52:d3fb6f1722bf 5471 // on button2 falling edge (button2 press)
whismanoid 52:d3fb6f1722bf 5472 onButton2FallingEdge();
whismanoid 52:d3fb6f1722bf 5473 }
whismanoid 52:d3fb6f1722bf 5474 # endif // HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5475 #endif
whismanoid 52:d3fb6f1722bf 5476 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5477 if (DAPLINKserial.readable()) {
whismanoid 52:d3fb6f1722bf 5478 cmdLine_DAPLINKserial.append(DAPLINKserial.getc());
whismanoid 52:d3fb6f1722bf 5479 }
whismanoid 52:d3fb6f1722bf 5480 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5481 if (serial.readable()) {
whismanoid 52:d3fb6f1722bf 5482 int c = serial.getc();
whismanoid 52:d3fb6f1722bf 5483 cmdLine_serial.append(c);
whismanoid 52:d3fb6f1722bf 5484 #if IGNORE_AT_COMMANDS
whismanoid 52:d3fb6f1722bf 5485 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5486 cmdLine_DAPLINKserial.serial().printf("%c", c);
whismanoid 52:d3fb6f1722bf 5487 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5488 #endif // IGNORE_AT_COMMANDS
whismanoid 52:d3fb6f1722bf 5489 //
whismanoid 52:d3fb6f1722bf 5490 }
whismanoid 52:d3fb6f1722bf 5491 } // while(1)
whismanoid 52:d3fb6f1722bf 5492 }
whismanoid 52:d3fb6f1722bf 5493 //---------- CODE GENERATOR: end testMainCppCodeList