Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.

Dependencies:   MaximTinyTester MAX11410 CmdLine USBDevice

Committer:
whismanoid
Date:
Mon Apr 13 03:02:14 2020 +0000
Revision:
63:708490d6a29f
Parent:
61:38ec81c33b7a
Child:
64:5e9555fda955
respect read-only and constant props, shorter arg/prop names, rtd_ms, self tests, use return type and arg type signatures in names e.g. FunctionCall_su_d_lu_Expect

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 63:708490d6a29f 1821 extern uint8_t fn_MAX11410_RegWrite(int commandByte, uint32_t regData);
whismanoid 63:708490d6a29f 1822 extern double fn_MAX11410_Measure_Voltage(int ainp, int ainn);
whismanoid 63:708490d6a29f 1823 extern uint8_t fn_MAX11410_Configure_CTRL_REF(uint8_t ref_sel);
whismanoid 63:708490d6a29f 1824 extern uint8_t fn_MAX11410_Configure_PGA(uint8_t sigpath, uint8_t gain);
whismanoid 63:708490d6a29f 1825 extern double fn_MAX11410_VoltageOfCode_Unipolar(uint32_t value_u24);
whismanoid 63:708490d6a29f 1826 extern double fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary(uint32_t value_u24);
whismanoid 63:708490d6a29f 1827 extern double fn_MAX11410_VoltageOfCode_Bipolar_2sComplement(uint32_t value_u24);
whismanoid 63:708490d6a29f 1828 extern double fn_MAX11410_TemperatureOfRTD_PT1000(double rtd_ohm);
whismanoid 63:708490d6a29f 1829 extern double fn_MAX11410_TemperatureOfRTD_PT100(double rtd_ohm);
whismanoid 63:708490d6a29f 1830 extern double fn_MAX11410_TemperatureOfRTD(double rtd_ohm);
whismanoid 63:708490d6a29f 1831 extern double fn_MAX11410_TemperatureOfTC_TypeK(double tc_v);
whismanoid 52:d3fb6f1722bf 1832
whismanoid 52:d3fb6f1722bf 1833 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 1834 // optional self-test groups for self test function SelfTest()
whismanoid 52:d3fb6f1722bf 1835 // enable by changing the #define value from 0 to 1
whismanoid 59:c0376adb6ebc 1836
whismanoid 63:708490d6a29f 1837 // SelfTest group POR description:
whismanoid 63:708490d6a29f 1838 // verify initial register values (enabled by default)
whismanoid 63:708490d6a29f 1839 #ifndef MAX11410_SELFTEST_POR
whismanoid 63:708490d6a29f 1840 #define MAX11410_SELFTEST_POR 1
whismanoid 63:708490d6a29f 1841 #endif
whismanoid 63:708490d6a29f 1842
whismanoid 63:708490d6a29f 1843 // SelfTest group RES1KA0A1TOGND description:
whismanoid 63:708490d6a29f 1844 // measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v (disabled by default)
whismanoid 63:708490d6a29f 1845 #ifndef MAX11410_SELFTEST_RES1KA0A1TOGND
whismanoid 63:708490d6a29f 1846 #define MAX11410_SELFTEST_RES1KA0A1TOGND 1
whismanoid 63:708490d6a29f 1847 #endif
whismanoid 63:708490d6a29f 1848
whismanoid 63:708490d6a29f 1849 // SelfTest group RES1KA0A1TOGNDMORE description:
whismanoid 63:708490d6a29f 1850 // measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v in more detail
whismanoid 63:708490d6a29f 1851 #ifndef MAX11410_SELFTEST_RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 1852 #define MAX11410_SELFTEST_RES1KA0A1TOGNDMORE 1
whismanoid 63:708490d6a29f 1853 #endif
whismanoid 63:708490d6a29f 1854
whismanoid 63:708490d6a29f 1855 // SelfTest group RES1KA0A1TOGND_BAD description:
whismanoid 63:708490d6a29f 1856 // function Measure_Voltage
whismanoid 63:708490d6a29f 1857 #ifndef MAX11410_SELFTEST_RES1KA0A1TOGND_BAD
whismanoid 63:708490d6a29f 1858 #define MAX11410_SELFTEST_RES1KA0A1TOGND_BAD 1
whismanoid 63:708490d6a29f 1859 #endif
whismanoid 63:708490d6a29f 1860
whismanoid 59:c0376adb6ebc 1861 // SelfTest group UNIPOLAR description:
whismanoid 61:38ec81c33b7a 1862 // Verify function VoltageOfCode_Unipolar
whismanoid 52:d3fb6f1722bf 1863 #ifndef MAX11410_SELFTEST_UNIPOLAR
whismanoid 52:d3fb6f1722bf 1864 #define MAX11410_SELFTEST_UNIPOLAR 1
whismanoid 52:d3fb6f1722bf 1865 #endif
whismanoid 52:d3fb6f1722bf 1866
whismanoid 59:c0376adb6ebc 1867 // SelfTest group BIPOB description:
whismanoid 61:38ec81c33b7a 1868 // Verify function VoltageOfCode_Bipolar_OffsetBinary
whismanoid 52:d3fb6f1722bf 1869 #ifndef MAX11410_SELFTEST_BIPOB
whismanoid 52:d3fb6f1722bf 1870 #define MAX11410_SELFTEST_BIPOB 1
whismanoid 52:d3fb6f1722bf 1871 #endif
whismanoid 52:d3fb6f1722bf 1872
whismanoid 59:c0376adb6ebc 1873 // SelfTest group BIP2C description:
whismanoid 61:38ec81c33b7a 1874 // Verify function VoltageOfCode_Bipolar_2sComplement
whismanoid 52:d3fb6f1722bf 1875 #ifndef MAX11410_SELFTEST_BIP2C
whismanoid 52:d3fb6f1722bf 1876 #define MAX11410_SELFTEST_BIP2C 1
whismanoid 52:d3fb6f1722bf 1877 #endif
whismanoid 52:d3fb6f1722bf 1878
whismanoid 59:c0376adb6ebc 1879 // SelfTest group RTD_PT1000 description:
whismanoid 61:38ec81c33b7a 1880 // PT1000 type Resistive Temperature Device (RTD)
whismanoid 52:d3fb6f1722bf 1881 #ifndef MAX11410_SELFTEST_RTD_PT1000
whismanoid 52:d3fb6f1722bf 1882 #define MAX11410_SELFTEST_RTD_PT1000 1
whismanoid 52:d3fb6f1722bf 1883 #endif
whismanoid 52:d3fb6f1722bf 1884
whismanoid 59:c0376adb6ebc 1885 // SelfTest group RTD_PT100 description:
whismanoid 61:38ec81c33b7a 1886 // PT100 type Resistive Temperature Device (RTD)
whismanoid 56:6e9c52cc9abe 1887 #ifndef MAX11410_SELFTEST_RTD_PT100
whismanoid 56:6e9c52cc9abe 1888 #define MAX11410_SELFTEST_RTD_PT100 1
whismanoid 56:6e9c52cc9abe 1889 #endif
whismanoid 56:6e9c52cc9abe 1890
whismanoid 59:c0376adb6ebc 1891 // SelfTest group RTD description:
whismanoid 59:c0376adb6ebc 1892 // Verify function TemperatureOfRTD
whismanoid 56:6e9c52cc9abe 1893 #ifndef MAX11410_SELFTEST_RTD
whismanoid 56:6e9c52cc9abe 1894 #define MAX11410_SELFTEST_RTD 1
whismanoid 56:6e9c52cc9abe 1895 #endif
whismanoid 56:6e9c52cc9abe 1896
whismanoid 59:c0376adb6ebc 1897 // SelfTest group TC_1 description:
whismanoid 61:38ec81c33b7a 1898 // Verify Thermocouple function TemperatureOfTC_TypeK
whismanoid 52:d3fb6f1722bf 1899 #ifndef MAX11410_SELFTEST_TC_1
whismanoid 52:d3fb6f1722bf 1900 #define MAX11410_SELFTEST_TC_1 1
whismanoid 52:d3fb6f1722bf 1901 #endif
whismanoid 52:d3fb6f1722bf 1902
whismanoid 59:c0376adb6ebc 1903 // SelfTest group TC_2 description:
whismanoid 61:38ec81c33b7a 1904 // Verify Thermocouple function TemperatureOfTC_TypeK in more detail
whismanoid 52:d3fb6f1722bf 1905 #ifndef MAX11410_SELFTEST_TC_2
whismanoid 52:d3fb6f1722bf 1906 #define MAX11410_SELFTEST_TC_2 1
whismanoid 52:d3fb6f1722bf 1907 #endif
whismanoid 52:d3fb6f1722bf 1908
whismanoid 52:d3fb6f1722bf 1909 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1910 // When user presses button BUTTON1, perform self test
whismanoid 52:d3fb6f1722bf 1911 #if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1912 void onButton1FallingEdge(void)
whismanoid 52:d3fb6f1722bf 1913 {
whismanoid 52:d3fb6f1722bf 1914 void SelfTest(CmdLine & cmdLine);
whismanoid 52:d3fb6f1722bf 1915 SelfTest(cmdLine_serial);
whismanoid 52:d3fb6f1722bf 1916 }
whismanoid 52:d3fb6f1722bf 1917 #endif // HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1918
whismanoid 52:d3fb6f1722bf 1919 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1920 // When user presses button BUTTON2, perform demo configuration
whismanoid 52:d3fb6f1722bf 1921 #if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1922 void onButton2FallingEdge(void)
whismanoid 52:d3fb6f1722bf 1923 {
whismanoid 52:d3fb6f1722bf 1924 // TBD demo configuration
whismanoid 55:73d886c105f5 1925 // CODE GENERATOR: example code: has no member function Configure_Demo
whismanoid 52:d3fb6f1722bf 1926 // TODO diagnostic LED
whismanoid 55:73d886c105f5 1927 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 1928 }
whismanoid 52:d3fb6f1722bf 1929 #endif // HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 1930
whismanoid 52:d3fb6f1722bf 1931 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1932 void SelfTest(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 1933 {
whismanoid 52:d3fb6f1722bf 1934 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 1935 #if analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 1936 // Platform board uses AIN4,AIN5,.. as high range of AIN0,AIN1,..
whismanoid 52:d3fb6f1722bf 1937 MaximTinyTester tinyTester(cmdLine, analogIn4, analogIn5, analogIn2, analogIn3, analogIn0, analogIn4, led1_RFailLED, led2_GPassLED, led3_BBusyLED);
whismanoid 52:d3fb6f1722bf 1938 tinyTester.analogInPin_fullScaleVoltage[0] = analogInPin_fullScaleVoltage[4]; // board support
whismanoid 52:d3fb6f1722bf 1939 tinyTester.analogInPin_fullScaleVoltage[1] = analogInPin_fullScaleVoltage[5]; // board support
whismanoid 52:d3fb6f1722bf 1940 tinyTester.analogInPin_fullScaleVoltage[2] = analogInPin_fullScaleVoltage[2]; // board support
whismanoid 52:d3fb6f1722bf 1941 tinyTester.analogInPin_fullScaleVoltage[3] = analogInPin_fullScaleVoltage[3]; // board support
whismanoid 52:d3fb6f1722bf 1942 tinyTester.analogInPin_fullScaleVoltage[4] = analogInPin_fullScaleVoltage[0]; // board support
whismanoid 52:d3fb6f1722bf 1943 tinyTester.analogInPin_fullScaleVoltage[5] = analogInPin_fullScaleVoltage[1]; // board support
whismanoid 52:d3fb6f1722bf 1944 // low range channels AIN0, AIN1, AIN2, AIN3
whismanoid 52:d3fb6f1722bf 1945 #else // analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 1946 // Platform board uses simple analog inputs
whismanoid 52:d3fb6f1722bf 1947 MaximTinyTester tinyTester(cmdLine, analogIn0, analogIn1, analogIn2, analogIn3, analogIn4, analogIn5, led1_RFailLED, led2_GPassLED, led3_BBusyLED);
whismanoid 52:d3fb6f1722bf 1948 tinyTester.analogInPin_fullScaleVoltage[0] = analogInPin_fullScaleVoltage[0]; // board support
whismanoid 52:d3fb6f1722bf 1949 tinyTester.analogInPin_fullScaleVoltage[1] = analogInPin_fullScaleVoltage[1]; // board support
whismanoid 52:d3fb6f1722bf 1950 tinyTester.analogInPin_fullScaleVoltage[2] = analogInPin_fullScaleVoltage[2]; // board support
whismanoid 52:d3fb6f1722bf 1951 tinyTester.analogInPin_fullScaleVoltage[3] = analogInPin_fullScaleVoltage[3]; // board support
whismanoid 52:d3fb6f1722bf 1952 tinyTester.analogInPin_fullScaleVoltage[4] = analogInPin_fullScaleVoltage[4]; // board support
whismanoid 52:d3fb6f1722bf 1953 tinyTester.analogInPin_fullScaleVoltage[5] = analogInPin_fullScaleVoltage[5]; // board support
whismanoid 52:d3fb6f1722bf 1954 #endif
whismanoid 52:d3fb6f1722bf 1955 tinyTester.clear();
whismanoid 52:d3fb6f1722bf 1956
whismanoid 52:d3fb6f1722bf 1957 // CODE GENERATOR: generate SelfTest based on function docstrings @test lines
whismanoid 52:d3fb6f1722bf 1958
whismanoid 61:38ec81c33b7a 1959 // @test Init() expect 1
whismanoid 59:c0376adb6ebc 1960 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 1961 // docTest_item['action'] = 'Init() expect 1'
whismanoid 59:c0376adb6ebc 1962 // docTest_item['funcName'] = 'Init'
whismanoid 59:c0376adb6ebc 1963 // docTest_item['expect-value'] = '1'
whismanoid 59:c0376adb6ebc 1964 // call-function
whismanoid 59:c0376adb6ebc 1965 // ASSERT_EQ(g_MAX11410_device.Init(()), (uint8_t)1); //
whismanoid 63:708490d6a29f 1966 tinyTester.FunctionCall_su_Expect("MAX11410.Init", fn_MAX11410_Init, /* empty docTest_argList */ /* expect: */ (uint8_t)1); //
whismanoid 63:708490d6a29f 1967
whismanoid 63:708490d6a29f 1968 // @test group POR // verify initial register values (enabled by default)
whismanoid 63:708490d6a29f 1969 // @test group POR RegRead(MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer) expect 1 expect-buffer 0x000F02
whismanoid 60:f38c54a91794 1970 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 1971 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 1972 // 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 1973 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 1974 // docTest_item['arglist'] = 'MAX11410::CMD_r001_0001_xxxx_xxxx_xxxx_xxxx_xxxx_xddd_PART_ID, buffer'
whismanoid 60:f38c54a91794 1975 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 1976 // docTest_item['expect-buffer-value'] = '0x000F02'
whismanoid 63:708490d6a29f 1977 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 1978 // call-function
whismanoid 60:f38c54a91794 1979 // 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 1980 { // expect-buffer 0x000F02
whismanoid 60:f38c54a91794 1981 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 1982 //
whismanoid 63:708490d6a29f 1983 tinyTester.FunctionCall_su_d_plu_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 1984 } // expect-buffer 0x000F02
whismanoid 63:708490d6a29f 1985 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 1986
whismanoid 63:708490d6a29f 1987 // @test group POR RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 1988 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 1989 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 1990 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 1991 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 1992 // docTest_item['arglist'] = 'MAX11410::CMD_r000_0100_dddd_xddd_GP0_CTRL, buffer'
whismanoid 60:f38c54a91794 1993 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 1994 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 63:708490d6a29f 1995 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 1996 // call-function
whismanoid 60:f38c54a91794 1997 // 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 1998 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 1999 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2000 //
whismanoid 63:708490d6a29f 2001 tinyTester.FunctionCall_su_d_plu_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 2002 } // expect-buffer 0x00
whismanoid 63:708490d6a29f 2003 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2004
whismanoid 63:708490d6a29f 2005 // @test group POR RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2006 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2007 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2008 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2009 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2010 // docTest_item['arglist'] = 'MAX11410::CMD_r000_0101_dddd_xddd_GP1_CTRL, buffer'
whismanoid 60:f38c54a91794 2011 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2012 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 63:708490d6a29f 2013 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2014 // call-function
whismanoid 60:f38c54a91794 2015 // 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 2016 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2017 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2018 //
whismanoid 63:708490d6a29f 2019 tinyTester.FunctionCall_su_d_plu_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 2020 } // expect-buffer 0x00
whismanoid 63:708490d6a29f 2021 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2022
whismanoid 63:708490d6a29f 2023 // @test group POR RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a
whismanoid 60:f38c54a91794 2024 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2025 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2026 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer) expect 1 expect-buffer 0x00003a'
whismanoid 60:f38c54a91794 2027 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2028 // docTest_item['arglist'] = 'MAX11410::CMD_r000_0111_xddd_dddd_GP_SEQ_ADDR, buffer'
whismanoid 60:f38c54a91794 2029 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2030 // docTest_item['expect-buffer-value'] = '0x00003a'
whismanoid 63:708490d6a29f 2031 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2032 // call-function
whismanoid 60:f38c54a91794 2033 // 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 2034 { // expect-buffer 0x00003a
whismanoid 60:f38c54a91794 2035 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2036 //
whismanoid 63:708490d6a29f 2037 tinyTester.FunctionCall_su_d_plu_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 2038 } // expect-buffer 0x00003a
whismanoid 63:708490d6a29f 2039 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2040
whismanoid 63:708490d6a29f 2041 // @test group POR RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2042 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2043 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2044 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2045 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2046 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1000_x0dd_dddd_FILTER, buffer'
whismanoid 60:f38c54a91794 2047 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2048 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 63:708490d6a29f 2049 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2050 // call-function
whismanoid 60:f38c54a91794 2051 // 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 2052 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2053 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2054 //
whismanoid 63:708490d6a29f 2055 tinyTester.FunctionCall_su_d_plu_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 2056 } // expect-buffer 0x00
whismanoid 63:708490d6a29f 2057 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2058
whismanoid 63:708490d6a29f 2059 // @test group POR RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001
whismanoid 60:f38c54a91794 2060 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2061 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2062 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer) expect 1 expect-buffer 0x000001'
whismanoid 60:f38c54a91794 2063 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2064 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1001_dddd_dddd_CTRL, buffer'
whismanoid 60:f38c54a91794 2065 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2066 // docTest_item['expect-buffer-value'] = '0x000001'
whismanoid 63:708490d6a29f 2067 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2068 // call-function
whismanoid 60:f38c54a91794 2069 // 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 2070 { // expect-buffer 0x000001
whismanoid 60:f38c54a91794 2071 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2072 //
whismanoid 63:708490d6a29f 2073 tinyTester.FunctionCall_su_d_plu_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 2074 } // expect-buffer 0x000001
whismanoid 63:708490d6a29f 2075 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2076
whismanoid 63:708490d6a29f 2077 // @test group POR RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2078 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2079 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2080 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2081 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2082 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1010_dddd_dddd_SOURCE, buffer'
whismanoid 60:f38c54a91794 2083 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2084 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 63:708490d6a29f 2085 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2086 // call-function
whismanoid 60:f38c54a91794 2087 // 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 2088 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2089 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2090 //
whismanoid 63:708490d6a29f 2091 tinyTester.FunctionCall_su_d_plu_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 2092 } // expect-buffer 0x00
whismanoid 63:708490d6a29f 2093 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2094
whismanoid 63:708490d6a29f 2095 // @test group POR RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2096 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2097 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2098 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 2099 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2100 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1011_dddd_dddd_MUX_CTRL0, buffer'
whismanoid 60:f38c54a91794 2101 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2102 // docTest_item['expect-buffer-value'] = '0x0000ff'
whismanoid 63:708490d6a29f 2103 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2104 // call-function
whismanoid 60:f38c54a91794 2105 // 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 2106 { // expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2107 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2108 //
whismanoid 63:708490d6a29f 2109 tinyTester.FunctionCall_su_d_plu_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 2110 } // expect-buffer 0x0000ff
whismanoid 63:708490d6a29f 2111 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2112
whismanoid 63:708490d6a29f 2113 // @test group POR RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2114 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2115 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2116 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer) expect 1 expect-buffer 0x0000ff'
whismanoid 60:f38c54a91794 2117 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2118 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1100_dddd_dddd_MUX_CTRL1, buffer'
whismanoid 60:f38c54a91794 2119 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2120 // docTest_item['expect-buffer-value'] = '0x0000ff'
whismanoid 63:708490d6a29f 2121 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2122 // call-function
whismanoid 60:f38c54a91794 2123 // 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 2124 { // expect-buffer 0x0000ff
whismanoid 60:f38c54a91794 2125 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2126 //
whismanoid 63:708490d6a29f 2127 tinyTester.FunctionCall_su_d_plu_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 2128 } // expect-buffer 0x0000ff
whismanoid 63:708490d6a29f 2129 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2130
whismanoid 63:708490d6a29f 2131 // @test group POR RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2132 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2133 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2134 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2135 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2136 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1101_dddd_dddd_MUX_CTRL2, buffer'
whismanoid 60:f38c54a91794 2137 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2138 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 63:708490d6a29f 2139 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2140 // call-function
whismanoid 60:f38c54a91794 2141 // 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 2142 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2143 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2144 //
whismanoid 63:708490d6a29f 2145 tinyTester.FunctionCall_su_d_plu_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 2146 } // expect-buffer 0x00
whismanoid 63:708490d6a29f 2147 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2148
whismanoid 63:708490d6a29f 2149 // @test group POR RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00
whismanoid 60:f38c54a91794 2150 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2151 // docTest_item['group-id-value'] = 'POR'
whismanoid 60:f38c54a91794 2152 // docTest_item['action'] = 'RegRead(MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer) expect 1 expect-buffer 0x00'
whismanoid 60:f38c54a91794 2153 // docTest_item['funcName'] = 'RegRead'
whismanoid 60:f38c54a91794 2154 // docTest_item['arglist'] = 'MAX11410::CMD_r000_1110_xxdd_xddd_PGA, buffer'
whismanoid 60:f38c54a91794 2155 // docTest_item['expect-value'] = '1'
whismanoid 60:f38c54a91794 2156 // docTest_item['expect-buffer-value'] = '0x00'
whismanoid 63:708490d6a29f 2157 #if MAX11410_SELFTEST_POR // group POR RegRead
whismanoid 60:f38c54a91794 2158 // call-function
whismanoid 60:f38c54a91794 2159 // 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 2160 { // expect-buffer 0x00
whismanoid 60:f38c54a91794 2161 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 60:f38c54a91794 2162 //
whismanoid 63:708490d6a29f 2163 tinyTester.FunctionCall_su_d_plu_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 2164 } // expect-buffer 0x00
whismanoid 63:708490d6a29f 2165 #endif // MAX11410_SELFTEST_POR // group POR
whismanoid 63:708490d6a29f 2166
whismanoid 63:708490d6a29f 2167 // @test group RES1KA0A1TOGND // measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v (disabled by default)
whismanoid 63:708490d6a29f 2168 // @test group RES1KA0A1TOGNDMORE // measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v in more detail
whismanoid 63:708490d6a29f 2169 // @test group RES1KA0A1TOGNDMORE tinyTester.print("measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v")
whismanoid 63:708490d6a29f 2170 // docTest_item['actionType'] = 'print-string'
whismanoid 63:708490d6a29f 2171 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2172 // docTest_item['action'] = 'tinyTester.print("measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v")'
whismanoid 63:708490d6a29f 2173 // docTest_item['arglist'] = 'measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v'
whismanoid 63:708490d6a29f 2174 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE None
whismanoid 63:708490d6a29f 2175 // print-string
whismanoid 63:708490d6a29f 2176 // tinyTesterFuncName = "tinyTester.print"
whismanoid 63:708490d6a29f 2177 // tinyTesterPrintStringLiteral = "measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v"
whismanoid 63:708490d6a29f 2178 tinyTester.print("measure a 1kohm resistor between (AIN0,AIN1) and AGND to verify ref2_v");
whismanoid 63:708490d6a29f 2179 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2180
whismanoid 63:708490d6a29f 2181 // @test group RES1KA0A1TOGND tinyTester.settle_time_msec = 1000 // default 250
whismanoid 63:708490d6a29f 2182 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 63:708490d6a29f 2183 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND'
whismanoid 63:708490d6a29f 2184 // docTest_item['action'] = 'tinyTester.settle_time_msec = 1000'
whismanoid 63:708490d6a29f 2185 // docTest_item['remarks'] = 'default 250'
whismanoid 63:708490d6a29f 2186 // docTest_item['propName'] = 'tinyTester.settle_time_msec'
whismanoid 63:708490d6a29f 2187 // docTest_item['propValue'] = '1000'
whismanoid 63:708490d6a29f 2188 #if MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND None default 250
whismanoid 63:708490d6a29f 2189 // assign-propname-value
whismanoid 63:708490d6a29f 2190 // tinyTesterPropName = "tinyTester.settle_time_msec"
whismanoid 63:708490d6a29f 2191 // tinyTesterPropValue = "1000"
whismanoid 63:708490d6a29f 2192 tinyTester.settle_time_msec = 1000;
whismanoid 63:708490d6a29f 2193 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND
whismanoid 63:708490d6a29f 2194
whismanoid 63:708490d6a29f 2195 // @test group RES1KA0A1TOGND RegWrite(0x0C, 0xF1) expect 1 // *mux_ctrl1=0xf1 drives current source from AIN1
whismanoid 63:708490d6a29f 2196 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2197 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND'
whismanoid 63:708490d6a29f 2198 // docTest_item['action'] = 'RegWrite(0x0C, 0xF1) expect 1'
whismanoid 63:708490d6a29f 2199 // docTest_item['remarks'] = '*mux_ctrl1=0xf1 drives current source from AIN1'
whismanoid 63:708490d6a29f 2200 // docTest_item['funcName'] = 'RegWrite'
whismanoid 63:708490d6a29f 2201 // docTest_item['arglist'] = '0x0C, 0xF1'
whismanoid 63:708490d6a29f 2202 // docTest_item['expect-value'] = '1'
whismanoid 63:708490d6a29f 2203 #if MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND RegWrite *mux_ctrl1=0xf1 drives current source from AIN1
whismanoid 63:708490d6a29f 2204 // call-function
whismanoid 63:708490d6a29f 2205 // ASSERT_EQ(g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)0x0C, (uint32_t)0xF1), (uint8_t)1); // *mux_ctrl1=0xf1 drives current source from AIN1
whismanoid 63:708490d6a29f 2206 tinyTester.FunctionCall_su_d_lu_Expect("MAX11410.RegWrite", fn_MAX11410_RegWrite, (MAX11410::MAX11410_CMD_enum_t)0x0C, (uint32_t)0xF1, /* expect: */ (uint8_t)1); // *mux_ctrl1=0xf1 drives current source from AIN1
whismanoid 63:708490d6a29f 2207 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND
whismanoid 63:708490d6a29f 2208
whismanoid 63:708490d6a29f 2209 // @test group RES1KA0A1TOGNDMORE RegWrite(0x0A, 0x03) expect 1 // *source=0x03 idac_mode=100uA, 1k resistor 0.1V
whismanoid 63:708490d6a29f 2210 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2211 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2212 // docTest_item['action'] = 'RegWrite(0x0A, 0x03) expect 1'
whismanoid 63:708490d6a29f 2213 // docTest_item['remarks'] = '*source=0x03 idac_mode=100uA, 1k resistor 0.1V'
whismanoid 63:708490d6a29f 2214 // docTest_item['funcName'] = 'RegWrite'
whismanoid 63:708490d6a29f 2215 // docTest_item['arglist'] = '0x0A, 0x03'
whismanoid 63:708490d6a29f 2216 // docTest_item['expect-value'] = '1'
whismanoid 63:708490d6a29f 2217 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE RegWrite *source=0x03 idac_mode=100uA, 1k resistor 0.1V
whismanoid 63:708490d6a29f 2218 // call-function
whismanoid 63:708490d6a29f 2219 // ASSERT_EQ(g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)0x0A, (uint32_t)0x03), (uint8_t)1); // *source=0x03 idac_mode=100uA, 1k resistor 0.1V
whismanoid 63:708490d6a29f 2220 tinyTester.FunctionCall_su_d_lu_Expect("MAX11410.RegWrite", fn_MAX11410_RegWrite, (MAX11410::MAX11410_CMD_enum_t)0x0A, (uint32_t)0x03, /* expect: */ (uint8_t)1); // *source=0x03 idac_mode=100uA, 1k resistor 0.1V
whismanoid 63:708490d6a29f 2221 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2222
whismanoid 63:708490d6a29f 2223 // @test group RES1KA0A1TOGNDMORE tinyTester.print("idac_mode=100uA, 1k resistor 0.1V")
whismanoid 63:708490d6a29f 2224 // docTest_item['actionType'] = 'print-string'
whismanoid 63:708490d6a29f 2225 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2226 // docTest_item['action'] = 'tinyTester.print("idac_mode=100uA, 1k resistor 0.1V")'
whismanoid 63:708490d6a29f 2227 // docTest_item['arglist'] = 'idac_mode=100uA, 1k resistor 0.1V'
whismanoid 63:708490d6a29f 2228 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE None
whismanoid 63:708490d6a29f 2229 // print-string
whismanoid 63:708490d6a29f 2230 // tinyTesterFuncName = "tinyTester.print"
whismanoid 63:708490d6a29f 2231 // tinyTesterPrintStringLiteral = "idac_mode=100uA, 1k resistor 0.1V"
whismanoid 63:708490d6a29f 2232 tinyTester.print("idac_mode=100uA, 1k resistor 0.1V");
whismanoid 63:708490d6a29f 2233 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2234
whismanoid 63:708490d6a29f 2235 // @test group RES1KA0A1TOGNDMORE tinyTester.Wait_Output_Settling()
whismanoid 63:708490d6a29f 2236 // docTest_item['actionType'] = 'call-tinytester-function'
whismanoid 63:708490d6a29f 2237 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2238 // docTest_item['action'] = 'tinyTester.Wait_Output_Settling()'
whismanoid 63:708490d6a29f 2239 // docTest_item['propName'] = 'Wait_Output_Settling'
whismanoid 63:708490d6a29f 2240 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE None
whismanoid 63:708490d6a29f 2241 // call-tinytester-function
whismanoid 63:708490d6a29f 2242 // tinyTesterFuncName = "tinyTester.Wait_Output_Settling"
whismanoid 63:708490d6a29f 2243 // docTest_argList = ""
whismanoid 63:708490d6a29f 2244 tinyTester.Wait_Output_Settling(); //
whismanoid 63:708490d6a29f 2245 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2246
whismanoid 63:708490d6a29f 2247 // @test group RES1KA0A1TOGND_BAD Measure_Voltage(0,10) // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2248 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2249 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND_BAD'
whismanoid 63:708490d6a29f 2250 // docTest_item['action'] = 'Measure_Voltage(0,10)'
whismanoid 63:708490d6a29f 2251 // docTest_item['remarks'] = 'TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?'
whismanoid 63:708490d6a29f 2252 // docTest_item['funcName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 2253 // docTest_item['arglist'] = '0,10'
whismanoid 63:708490d6a29f 2254 #if MAX11410_SELFTEST_RES1KA0A1TOGND_BAD // group RES1KA0A1TOGND_BAD Measure_Voltage TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2255 // call-function
whismanoid 63:708490d6a29f 2256 // ASSERT_EQ(g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10), (double)None); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2257 // tinyTester.FunctionCall_Expect("MAX11410.Measure_Voltage", fn_MAX11410_Measure_Voltage, (MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10, /* empty expect: */ (double)None); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2258 g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2259 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND_BAD // group RES1KA0A1TOGND_BAD
whismanoid 63:708490d6a29f 2260
whismanoid 63:708490d6a29f 2261 // @test group RES1KA0A1TOGNDMORE Measure_Voltage(0,10) expect 0.1
whismanoid 63:708490d6a29f 2262 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2263 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2264 // docTest_item['action'] = 'Measure_Voltage(0,10) expect 0.1'
whismanoid 63:708490d6a29f 2265 // docTest_item['funcName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 2266 // docTest_item['arglist'] = '0,10'
whismanoid 63:708490d6a29f 2267 // docTest_item['expect-value'] = '0.1'
whismanoid 63:708490d6a29f 2268 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE Measure_Voltage
whismanoid 63:708490d6a29f 2269 // call-function
whismanoid 63:708490d6a29f 2270 // ASSERT_EQ(g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10), (double)0.1); //
whismanoid 63:708490d6a29f 2271 tinyTester.FunctionCall_f_d_d_Expect("MAX11410.Measure_Voltage", fn_MAX11410_Measure_Voltage, (MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10, /* expect: */ (double)0.1); //
whismanoid 63:708490d6a29f 2272 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2273
whismanoid 63:708490d6a29f 2274 // @test group RES1KA0A1TOGNDMORE AINcode[0] expect (uint32_t)337731 within 33773 // idac_mode=100uA, 1k resistor 0.1V
whismanoid 63:708490d6a29f 2275 // @test group RES1KA0A1TOGNDMORE RegWrite(0x0A, 0x0D) expect 1 // *source=0x0d idac_mode=800uA, 1k resistor 0.8V
whismanoid 63:708490d6a29f 2276 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2277 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2278 // docTest_item['action'] = 'RegWrite(0x0A, 0x0D) expect 1'
whismanoid 63:708490d6a29f 2279 // docTest_item['remarks'] = '*source=0x0d idac_mode=800uA, 1k resistor 0.8V'
whismanoid 63:708490d6a29f 2280 // docTest_item['funcName'] = 'RegWrite'
whismanoid 63:708490d6a29f 2281 // docTest_item['arglist'] = '0x0A, 0x0D'
whismanoid 63:708490d6a29f 2282 // docTest_item['expect-value'] = '1'
whismanoid 63:708490d6a29f 2283 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE RegWrite *source=0x0d idac_mode=800uA, 1k resistor 0.8V
whismanoid 63:708490d6a29f 2284 // call-function
whismanoid 63:708490d6a29f 2285 // ASSERT_EQ(g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)0x0A, (uint32_t)0x0D), (uint8_t)1); // *source=0x0d idac_mode=800uA, 1k resistor 0.8V
whismanoid 63:708490d6a29f 2286 tinyTester.FunctionCall_su_d_lu_Expect("MAX11410.RegWrite", fn_MAX11410_RegWrite, (MAX11410::MAX11410_CMD_enum_t)0x0A, (uint32_t)0x0D, /* expect: */ (uint8_t)1); // *source=0x0d idac_mode=800uA, 1k resistor 0.8V
whismanoid 63:708490d6a29f 2287 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2288
whismanoid 63:708490d6a29f 2289 // @test group RES1KA0A1TOGNDMORE tinyTester.print("idac_mode=800uA, 1k resistor 0.8V")
whismanoid 63:708490d6a29f 2290 // docTest_item['actionType'] = 'print-string'
whismanoid 63:708490d6a29f 2291 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2292 // docTest_item['action'] = 'tinyTester.print("idac_mode=800uA, 1k resistor 0.8V")'
whismanoid 63:708490d6a29f 2293 // docTest_item['arglist'] = 'idac_mode=800uA, 1k resistor 0.8V'
whismanoid 63:708490d6a29f 2294 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE None
whismanoid 63:708490d6a29f 2295 // print-string
whismanoid 63:708490d6a29f 2296 // tinyTesterFuncName = "tinyTester.print"
whismanoid 63:708490d6a29f 2297 // tinyTesterPrintStringLiteral = "idac_mode=800uA, 1k resistor 0.8V"
whismanoid 63:708490d6a29f 2298 tinyTester.print("idac_mode=800uA, 1k resistor 0.8V");
whismanoid 63:708490d6a29f 2299 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2300
whismanoid 63:708490d6a29f 2301 // @test group RES1KA0A1TOGNDMORE tinyTester.Wait_Output_Settling()
whismanoid 63:708490d6a29f 2302 // docTest_item['actionType'] = 'call-tinytester-function'
whismanoid 63:708490d6a29f 2303 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2304 // docTest_item['action'] = 'tinyTester.Wait_Output_Settling()'
whismanoid 63:708490d6a29f 2305 // docTest_item['propName'] = 'Wait_Output_Settling'
whismanoid 63:708490d6a29f 2306 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE None
whismanoid 63:708490d6a29f 2307 // call-tinytester-function
whismanoid 63:708490d6a29f 2308 // tinyTesterFuncName = "tinyTester.Wait_Output_Settling"
whismanoid 63:708490d6a29f 2309 // docTest_argList = ""
whismanoid 63:708490d6a29f 2310 tinyTester.Wait_Output_Settling(); //
whismanoid 63:708490d6a29f 2311 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2312
whismanoid 63:708490d6a29f 2313 // @test group RES1KA0A1TOGND_BAD Measure_Voltage(0,10) // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2314 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2315 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND_BAD'
whismanoid 63:708490d6a29f 2316 // docTest_item['action'] = 'Measure_Voltage(0,10)'
whismanoid 63:708490d6a29f 2317 // docTest_item['remarks'] = 'TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?'
whismanoid 63:708490d6a29f 2318 // docTest_item['funcName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 2319 // docTest_item['arglist'] = '0,10'
whismanoid 63:708490d6a29f 2320 #if MAX11410_SELFTEST_RES1KA0A1TOGND_BAD // group RES1KA0A1TOGND_BAD Measure_Voltage TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2321 // call-function
whismanoid 63:708490d6a29f 2322 // ASSERT_EQ(g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10), (double)None); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2323 // tinyTester.FunctionCall_Expect("MAX11410.Measure_Voltage", fn_MAX11410_Measure_Voltage, (MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10, /* empty expect: */ (double)None); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2324 g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2325 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND_BAD // group RES1KA0A1TOGND_BAD
whismanoid 63:708490d6a29f 2326
whismanoid 63:708490d6a29f 2327 // @test group RES1KA0A1TOGNDMORE Measure_Voltage(0,10) expect 0.8
whismanoid 63:708490d6a29f 2328 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2329 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2330 // docTest_item['action'] = 'Measure_Voltage(0,10) expect 0.8'
whismanoid 63:708490d6a29f 2331 // docTest_item['funcName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 2332 // docTest_item['arglist'] = '0,10'
whismanoid 63:708490d6a29f 2333 // docTest_item['expect-value'] = '0.8'
whismanoid 63:708490d6a29f 2334 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE Measure_Voltage
whismanoid 63:708490d6a29f 2335 // call-function
whismanoid 63:708490d6a29f 2336 // ASSERT_EQ(g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10), (double)0.8); //
whismanoid 63:708490d6a29f 2337 tinyTester.FunctionCall_f_d_d_Expect("MAX11410.Measure_Voltage", fn_MAX11410_Measure_Voltage, (MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10, /* expect: */ (double)0.8); //
whismanoid 63:708490d6a29f 2338 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2339
whismanoid 63:708490d6a29f 2340 // @test group RES1KA0A1TOGNDMORE AINcode[0] expect (uint32_t)2724467 within 33773 // idac_mode=800uA, 1k resistor 0.8V
whismanoid 63:708490d6a29f 2341 // @test group RES1KA0A1TOGND RegWrite(0x0A, 0x0B) expect 1 // *source=0x0b idac_mode=400uA, 1k resistor 0.4V
whismanoid 63:708490d6a29f 2342 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2343 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND'
whismanoid 63:708490d6a29f 2344 // docTest_item['action'] = 'RegWrite(0x0A, 0x0B) expect 1'
whismanoid 63:708490d6a29f 2345 // docTest_item['remarks'] = '*source=0x0b idac_mode=400uA, 1k resistor 0.4V'
whismanoid 63:708490d6a29f 2346 // docTest_item['funcName'] = 'RegWrite'
whismanoid 63:708490d6a29f 2347 // docTest_item['arglist'] = '0x0A, 0x0B'
whismanoid 63:708490d6a29f 2348 // docTest_item['expect-value'] = '1'
whismanoid 63:708490d6a29f 2349 #if MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND RegWrite *source=0x0b idac_mode=400uA, 1k resistor 0.4V
whismanoid 63:708490d6a29f 2350 // call-function
whismanoid 63:708490d6a29f 2351 // ASSERT_EQ(g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)0x0A, (uint32_t)0x0B), (uint8_t)1); // *source=0x0b idac_mode=400uA, 1k resistor 0.4V
whismanoid 63:708490d6a29f 2352 tinyTester.FunctionCall_su_d_lu_Expect("MAX11410.RegWrite", fn_MAX11410_RegWrite, (MAX11410::MAX11410_CMD_enum_t)0x0A, (uint32_t)0x0B, /* expect: */ (uint8_t)1); // *source=0x0b idac_mode=400uA, 1k resistor 0.4V
whismanoid 63:708490d6a29f 2353 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND
whismanoid 63:708490d6a29f 2354
whismanoid 63:708490d6a29f 2355 // @test group RES1KA0A1TOGNDMORE tinyTester.print("idac_mode=400uA, 1k resistor 0.4V")
whismanoid 63:708490d6a29f 2356 // docTest_item['actionType'] = 'print-string'
whismanoid 63:708490d6a29f 2357 // docTest_item['group-id-value'] = 'RES1KA0A1TOGNDMORE'
whismanoid 63:708490d6a29f 2358 // docTest_item['action'] = 'tinyTester.print("idac_mode=400uA, 1k resistor 0.4V")'
whismanoid 63:708490d6a29f 2359 // docTest_item['arglist'] = 'idac_mode=400uA, 1k resistor 0.4V'
whismanoid 63:708490d6a29f 2360 #if MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE None
whismanoid 63:708490d6a29f 2361 // print-string
whismanoid 63:708490d6a29f 2362 // tinyTesterFuncName = "tinyTester.print"
whismanoid 63:708490d6a29f 2363 // tinyTesterPrintStringLiteral = "idac_mode=400uA, 1k resistor 0.4V"
whismanoid 63:708490d6a29f 2364 tinyTester.print("idac_mode=400uA, 1k resistor 0.4V");
whismanoid 63:708490d6a29f 2365 #endif // MAX11410_SELFTEST_RES1KA0A1TOGNDMORE // group RES1KA0A1TOGNDMORE
whismanoid 63:708490d6a29f 2366
whismanoid 63:708490d6a29f 2367 // @test group RES1KA0A1TOGND tinyTester.Wait_Output_Settling()
whismanoid 63:708490d6a29f 2368 // docTest_item['actionType'] = 'call-tinytester-function'
whismanoid 63:708490d6a29f 2369 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND'
whismanoid 63:708490d6a29f 2370 // docTest_item['action'] = 'tinyTester.Wait_Output_Settling()'
whismanoid 63:708490d6a29f 2371 // docTest_item['propName'] = 'Wait_Output_Settling'
whismanoid 63:708490d6a29f 2372 #if MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND None
whismanoid 63:708490d6a29f 2373 // call-tinytester-function
whismanoid 63:708490d6a29f 2374 // tinyTesterFuncName = "tinyTester.Wait_Output_Settling"
whismanoid 63:708490d6a29f 2375 // docTest_argList = ""
whismanoid 63:708490d6a29f 2376 tinyTester.Wait_Output_Settling(); //
whismanoid 63:708490d6a29f 2377 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND
whismanoid 63:708490d6a29f 2378
whismanoid 63:708490d6a29f 2379 // @test group RES1KA0A1TOGND_BAD Measure_Voltage(0,10) // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2380 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2381 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND_BAD'
whismanoid 63:708490d6a29f 2382 // docTest_item['action'] = 'Measure_Voltage(0,10)'
whismanoid 63:708490d6a29f 2383 // docTest_item['remarks'] = 'TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?'
whismanoid 63:708490d6a29f 2384 // docTest_item['funcName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 2385 // docTest_item['arglist'] = '0,10'
whismanoid 63:708490d6a29f 2386 #if MAX11410_SELFTEST_RES1KA0A1TOGND_BAD // group RES1KA0A1TOGND_BAD Measure_Voltage TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2387 // call-function
whismanoid 63:708490d6a29f 2388 // ASSERT_EQ(g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10), (double)None); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2389 // tinyTester.FunctionCall_Expect("MAX11410.Measure_Voltage", fn_MAX11410_Measure_Voltage, (MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10, /* empty expect: */ (double)None); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2390 g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10); // TODO1 #175 MAX11410 Self Test why does Measure_Voltage(0,10) without expect cause an mbed hard fault?
whismanoid 63:708490d6a29f 2391 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND_BAD // group RES1KA0A1TOGND_BAD
whismanoid 63:708490d6a29f 2392
whismanoid 63:708490d6a29f 2393 // @test group RES1KA0A1TOGND Measure_Voltage(0,10) expect 0.4
whismanoid 63:708490d6a29f 2394 // docTest_item['actionType'] = 'call-function'
whismanoid 63:708490d6a29f 2395 // docTest_item['group-id-value'] = 'RES1KA0A1TOGND'
whismanoid 63:708490d6a29f 2396 // docTest_item['action'] = 'Measure_Voltage(0,10) expect 0.4'
whismanoid 63:708490d6a29f 2397 // docTest_item['funcName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 2398 // docTest_item['arglist'] = '0,10'
whismanoid 63:708490d6a29f 2399 // docTest_item['expect-value'] = '0.4'
whismanoid 63:708490d6a29f 2400 #if MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND Measure_Voltage
whismanoid 63:708490d6a29f 2401 // call-function
whismanoid 63:708490d6a29f 2402 // ASSERT_EQ(g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10), (double)0.4); //
whismanoid 63:708490d6a29f 2403 tinyTester.FunctionCall_f_d_d_Expect("MAX11410.Measure_Voltage", fn_MAX11410_Measure_Voltage, (MAX11410::MAX11410_AINP_SEL_enum_t)0, (MAX11410::MAX11410_AINN_SEL_enum_t)10, /* expect: */ (double)0.4); //
whismanoid 63:708490d6a29f 2404 #endif // MAX11410_SELFTEST_RES1KA0A1TOGND // group RES1KA0A1TOGND
whismanoid 63:708490d6a29f 2405
whismanoid 63:708490d6a29f 2406 // @test group RES1KA0A1TOGNDMORE AINcode[0] expect (uint32_t)1343163 within 33773 // idac_mode=400uA, 1k resistor 0.4V
whismanoid 61:38ec81c33b7a 2407 // @test tinyTester.print("check filter register is writeable")
whismanoid 59:c0376adb6ebc 2408 // docTest_item['actionType'] = 'print-string'
whismanoid 59:c0376adb6ebc 2409 // docTest_item['action'] = 'tinyTester.print("check filter register is writeable")'
whismanoid 59:c0376adb6ebc 2410 // docTest_item['arglist'] = 'check filter register is writeable'
whismanoid 59:c0376adb6ebc 2411 // print-string
whismanoid 59:c0376adb6ebc 2412 // tinyTesterFuncName = "tinyTester.print"
whismanoid 59:c0376adb6ebc 2413 // tinyTesterPrintStringLiteral = "check filter register is writeable"
whismanoid 59:c0376adb6ebc 2414 tinyTester.print("check filter register is writeable");
whismanoid 59:c0376adb6ebc 2415
whismanoid 61:38ec81c33b7a 2416 // @test RegWrite(0x08, 0x34) expect 1
whismanoid 59:c0376adb6ebc 2417 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 2418 // docTest_item['action'] = 'RegWrite(0x08, 0x34) expect 1'
whismanoid 59:c0376adb6ebc 2419 // docTest_item['funcName'] = 'RegWrite'
whismanoid 59:c0376adb6ebc 2420 // docTest_item['arglist'] = '0x08, 0x34'
whismanoid 59:c0376adb6ebc 2421 // docTest_item['expect-value'] = '1'
whismanoid 59:c0376adb6ebc 2422 // call-function
whismanoid 59:c0376adb6ebc 2423 // ASSERT_EQ(g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)0x08, (uint32_t)0x34), (uint8_t)1); //
whismanoid 63:708490d6a29f 2424 tinyTester.FunctionCall_su_d_lu_Expect("MAX11410.RegWrite", fn_MAX11410_RegWrite, (MAX11410::MAX11410_CMD_enum_t)0x08, (uint32_t)0x34, /* expect: */ (uint8_t)1); //
whismanoid 59:c0376adb6ebc 2425
whismanoid 61:38ec81c33b7a 2426 // @test tinyTester.print("check filter register is readable")
whismanoid 59:c0376adb6ebc 2427 // docTest_item['actionType'] = 'print-string'
whismanoid 59:c0376adb6ebc 2428 // docTest_item['action'] = 'tinyTester.print("check filter register is readable")'
whismanoid 59:c0376adb6ebc 2429 // docTest_item['arglist'] = 'check filter register is readable'
whismanoid 59:c0376adb6ebc 2430 // print-string
whismanoid 59:c0376adb6ebc 2431 // tinyTesterFuncName = "tinyTester.print"
whismanoid 59:c0376adb6ebc 2432 // tinyTesterPrintStringLiteral = "check filter register is readable"
whismanoid 59:c0376adb6ebc 2433 tinyTester.print("check filter register is readable");
whismanoid 59:c0376adb6ebc 2434
whismanoid 61:38ec81c33b7a 2435 // @test RegRead(0x08, buffer) expect 1 expect-buffer 0x34
whismanoid 59:c0376adb6ebc 2436 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 2437 // docTest_item['action'] = 'RegRead(0x08, buffer) expect 1 expect-buffer 0x34'
whismanoid 59:c0376adb6ebc 2438 // docTest_item['funcName'] = 'RegRead'
whismanoid 59:c0376adb6ebc 2439 // docTest_item['arglist'] = '0x08, buffer'
whismanoid 59:c0376adb6ebc 2440 // docTest_item['expect-value'] = '1'
whismanoid 59:c0376adb6ebc 2441 // docTest_item['expect-buffer-value'] = '0x34'
whismanoid 59:c0376adb6ebc 2442 // call-function
whismanoid 59:c0376adb6ebc 2443 // ASSERT_EQ(g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)0x08, (uint32_t*)buffer), (uint8_t)1); //
whismanoid 59:c0376adb6ebc 2444 { // expect-buffer 0x34
whismanoid 59:c0376adb6ebc 2445 uint32_t buffer = 1234; // expect-buffer initial value
whismanoid 59:c0376adb6ebc 2446 //
whismanoid 63:708490d6a29f 2447 tinyTester.FunctionCall_su_d_plu_Expect("MAX11410.RegRead", fn_MAX11410_RegRead, (MAX11410::MAX11410_CMD_enum_t)0x08, &buffer, /* expect: */ (uint8_t)1, /* expect-buffer: */ 0x34); //
whismanoid 59:c0376adb6ebc 2448 } // expect-buffer 0x34
whismanoid 59:c0376adb6ebc 2449
whismanoid 61:38ec81c33b7a 2450 // @test tinyTester.settle_time_msec = 250 // default 250
whismanoid 59:c0376adb6ebc 2451 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 59:c0376adb6ebc 2452 // docTest_item['action'] = 'tinyTester.settle_time_msec = 250'
whismanoid 59:c0376adb6ebc 2453 // docTest_item['remarks'] = 'default 250'
whismanoid 59:c0376adb6ebc 2454 // docTest_item['propName'] = 'tinyTester.settle_time_msec'
whismanoid 59:c0376adb6ebc 2455 // docTest_item['propValue'] = '250'
whismanoid 59:c0376adb6ebc 2456 // assign-propname-value
whismanoid 59:c0376adb6ebc 2457 // tinyTesterPropName = "tinyTester.settle_time_msec"
whismanoid 59:c0376adb6ebc 2458 // tinyTesterPropValue = "250"
whismanoid 59:c0376adb6ebc 2459 tinyTester.settle_time_msec = 250;
whismanoid 59:c0376adb6ebc 2460
whismanoid 61:38ec81c33b7a 2461 // @test tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 59:c0376adb6ebc 2462 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 59:c0376adb6ebc 2463 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 59:c0376adb6ebc 2464 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 2465 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 59:c0376adb6ebc 2466 // docTest_item['propValue'] = '75'
whismanoid 59:c0376adb6ebc 2467 // assign-propname-value
whismanoid 59:c0376adb6ebc 2468 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 59:c0376adb6ebc 2469 // tinyTesterPropValue = "75"
whismanoid 59:c0376adb6ebc 2470 tinyTester.blink_time_msec = 75;
whismanoid 59:c0376adb6ebc 2471
whismanoid 61:38ec81c33b7a 2472 // @test tinyTester.input_timeout_time_msec = 250 // default 250
whismanoid 59:c0376adb6ebc 2473 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2474 // docTest_item['action'] = 'tinyTester.input_timeout_time_msec = 250'
whismanoid 61:38ec81c33b7a 2475 // docTest_item['remarks'] = 'default 250'
whismanoid 61:38ec81c33b7a 2476 // docTest_item['propName'] = 'tinyTester.input_timeout_time_msec'
whismanoid 61:38ec81c33b7a 2477 // docTest_item['propValue'] = '250'
whismanoid 59:c0376adb6ebc 2478 // assign-propname-value
whismanoid 61:38ec81c33b7a 2479 // tinyTesterPropName = "tinyTester.input_timeout_time_msec"
whismanoid 61:38ec81c33b7a 2480 // tinyTesterPropValue = "250"
whismanoid 61:38ec81c33b7a 2481 tinyTester.input_timeout_time_msec = 250;
whismanoid 61:38ec81c33b7a 2482
whismanoid 61:38ec81c33b7a 2483 // @test tinyTester.settle_time_msec = 20 // default 250
whismanoid 59:c0376adb6ebc 2484 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2485 // docTest_item['action'] = 'tinyTester.settle_time_msec = 20'
whismanoid 61:38ec81c33b7a 2486 // docTest_item['remarks'] = 'default 250'
whismanoid 61:38ec81c33b7a 2487 // docTest_item['propName'] = 'tinyTester.settle_time_msec'
whismanoid 59:c0376adb6ebc 2488 // docTest_item['propValue'] = '20'
whismanoid 59:c0376adb6ebc 2489 // assign-propname-value
whismanoid 61:38ec81c33b7a 2490 // tinyTesterPropName = "tinyTester.settle_time_msec"
whismanoid 59:c0376adb6ebc 2491 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2492 tinyTester.settle_time_msec = 20;
whismanoid 61:38ec81c33b7a 2493
whismanoid 61:38ec81c33b7a 2494 // @test tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 59:c0376adb6ebc 2495 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 59:c0376adb6ebc 2496 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 59:c0376adb6ebc 2497 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 59:c0376adb6ebc 2498 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 59:c0376adb6ebc 2499 // docTest_item['propValue'] = '20'
whismanoid 59:c0376adb6ebc 2500 // assign-propname-value
whismanoid 59:c0376adb6ebc 2501 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 59:c0376adb6ebc 2502 // tinyTesterPropValue = "20"
whismanoid 59:c0376adb6ebc 2503 tinyTester.blink_time_msec = 20;
whismanoid 59:c0376adb6ebc 2504
whismanoid 61:38ec81c33b7a 2505 // @test tinyTester.input_timeout_time_msec = 100 // default 250
whismanoid 61:38ec81c33b7a 2506 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2507 // docTest_item['action'] = 'tinyTester.input_timeout_time_msec = 100'
whismanoid 61:38ec81c33b7a 2508 // docTest_item['remarks'] = 'default 250'
whismanoid 61:38ec81c33b7a 2509 // docTest_item['propName'] = 'tinyTester.input_timeout_time_msec'
whismanoid 61:38ec81c33b7a 2510 // docTest_item['propValue'] = '100'
whismanoid 61:38ec81c33b7a 2511 // assign-propname-value
whismanoid 61:38ec81c33b7a 2512 // tinyTesterPropName = "tinyTester.input_timeout_time_msec"
whismanoid 61:38ec81c33b7a 2513 // tinyTesterPropValue = "100"
whismanoid 61:38ec81c33b7a 2514 tinyTester.input_timeout_time_msec = 100;
whismanoid 61:38ec81c33b7a 2515
whismanoid 61:38ec81c33b7a 2516 // @test tinyTester.Wait_Output_Settling()
whismanoid 61:38ec81c33b7a 2517 // docTest_item['actionType'] = 'call-tinytester-function'
whismanoid 61:38ec81c33b7a 2518 // docTest_item['action'] = 'tinyTester.Wait_Output_Settling()'
whismanoid 61:38ec81c33b7a 2519 // docTest_item['propName'] = 'Wait_Output_Settling'
whismanoid 61:38ec81c33b7a 2520 // call-tinytester-function
whismanoid 61:38ec81c33b7a 2521 // tinyTesterFuncName = "tinyTester.Wait_Output_Settling"
whismanoid 61:38ec81c33b7a 2522 // docTest_argList = ""
whismanoid 61:38ec81c33b7a 2523 tinyTester.Wait_Output_Settling(); //
whismanoid 61:38ec81c33b7a 2524
whismanoid 61:38ec81c33b7a 2525 // @test group UNIPOLAR // Verify function VoltageOfCode_Unipolar
whismanoid 61:38ec81c33b7a 2526 // @test group UNIPOLAR tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2527 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2528 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2529 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 2530 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 2531 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2532 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 2533 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2534 // assign-propname-value
whismanoid 61:38ec81c33b7a 2535 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2536 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2537 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 2538 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2539
whismanoid 61:38ec81c33b7a 2540 // @test group UNIPOLAR Configure_CTRL_REF(2) expect 1 // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2541 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2542 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2543 // docTest_item['action'] = 'Configure_CTRL_REF(2) expect 1'
whismanoid 61:38ec81c33b7a 2544 // docTest_item['remarks'] = 'These tests require REF2 = 2.500V'
whismanoid 61:38ec81c33b7a 2545 // docTest_item['funcName'] = 'Configure_CTRL_REF'
whismanoid 61:38ec81c33b7a 2546 // docTest_item['arglist'] = '2'
whismanoid 61:38ec81c33b7a 2547 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2548 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR Configure_CTRL_REF These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2549 // call-function
whismanoid 61:38ec81c33b7a 2550 // ASSERT_EQ(g_MAX11410_device.Configure_CTRL_REF((uint8_t)2), (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 63:708490d6a29f 2551 tinyTester.FunctionCall_su_su_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 2552 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2553
whismanoid 61:38ec81c33b7a 2554 // @test group UNIPOLAR Configure_PGA(0,0) expect 1 // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2555 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2556 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2557 // docTest_item['action'] = 'Configure_PGA(0,0) expect 1'
whismanoid 61:38ec81c33b7a 2558 // docTest_item['remarks'] = 'These tests require PGA gain=1'
whismanoid 61:38ec81c33b7a 2559 // docTest_item['funcName'] = 'Configure_PGA'
whismanoid 61:38ec81c33b7a 2560 // docTest_item['arglist'] = '0,0'
whismanoid 61:38ec81c33b7a 2561 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2562 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR Configure_PGA These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2563 // call-function
whismanoid 61:38ec81c33b7a 2564 // ASSERT_EQ(g_MAX11410_device.Configure_PGA((uint8_t)0, (uint8_t)0), (uint8_t)1); // These tests require PGA gain=1
whismanoid 63:708490d6a29f 2565 tinyTester.FunctionCall_su_su_su_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 2566 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2567
whismanoid 61:38ec81c33b7a 2568 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xFFFFFF) expect 2.500 within 0.030 // Full Scale
whismanoid 61:38ec81c33b7a 2569 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2570 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2571 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xFFFFFF) expect 2.500 within 0.030'
whismanoid 61:38ec81c33b7a 2572 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2573 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2574 // docTest_item['arglist'] = '0xFFFFFF'
whismanoid 61:38ec81c33b7a 2575 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 2576 // docTest_item['within-value'] = '0.030'
whismanoid 61:38ec81c33b7a 2577 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Full Scale
whismanoid 61:38ec81c33b7a 2578 // call-function
whismanoid 61:38ec81c33b7a 2579 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xFFFFFF), (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2580 tinyTester.err_threshold = 0.030; // within 0.030
whismanoid 63:708490d6a29f 2581 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xFFFFFF, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2582 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2583
whismanoid 61:38ec81c33b7a 2584 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xFFFFFE) expect 2.500 // Full Scale
whismanoid 61:38ec81c33b7a 2585 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2586 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2587 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xFFFFFE) expect 2.500'
whismanoid 61:38ec81c33b7a 2588 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2589 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2590 // docTest_item['arglist'] = '0xFFFFFE'
whismanoid 61:38ec81c33b7a 2591 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 2592 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Full Scale
whismanoid 61:38ec81c33b7a 2593 // call-function
whismanoid 61:38ec81c33b7a 2594 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xFFFFFE), (double)2.500); // Full Scale
whismanoid 63:708490d6a29f 2595 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xFFFFFE, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 2596 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2597
whismanoid 61:38ec81c33b7a 2598 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xCCCCCC) expect 2.000 // Two Volts
whismanoid 61:38ec81c33b7a 2599 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2600 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2601 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xCCCCCC) expect 2.000'
whismanoid 61:38ec81c33b7a 2602 // docTest_item['remarks'] = 'Two Volts'
whismanoid 61:38ec81c33b7a 2603 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2604 // docTest_item['arglist'] = '0xCCCCCC'
whismanoid 61:38ec81c33b7a 2605 // docTest_item['expect-value'] = '2.000'
whismanoid 61:38ec81c33b7a 2606 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Two Volts
whismanoid 61:38ec81c33b7a 2607 // call-function
whismanoid 61:38ec81c33b7a 2608 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xCCCCCC), (double)2.000); // Two Volts
whismanoid 63:708490d6a29f 2609 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xCCCCCC, /* expect: */ (double)2.000); // Two Volts
whismanoid 61:38ec81c33b7a 2610 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2611
whismanoid 61:38ec81c33b7a 2612 // @test group UNIPOLAR VoltageOfCode_Unipolar(0xC00000) expect 1.875 // 75% Scale
whismanoid 61:38ec81c33b7a 2613 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2614 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2615 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0xC00000) expect 1.875'
whismanoid 61:38ec81c33b7a 2616 // docTest_item['remarks'] = '75% Scale'
whismanoid 61:38ec81c33b7a 2617 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2618 // docTest_item['arglist'] = '0xC00000'
whismanoid 61:38ec81c33b7a 2619 // docTest_item['expect-value'] = '1.875'
whismanoid 61:38ec81c33b7a 2620 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 75% Scale
whismanoid 61:38ec81c33b7a 2621 // call-function
whismanoid 61:38ec81c33b7a 2622 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0xC00000), (double)1.875); // 75% Scale
whismanoid 63:708490d6a29f 2623 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0xC00000, /* expect: */ (double)1.875); // 75% Scale
whismanoid 61:38ec81c33b7a 2624 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2625
whismanoid 61:38ec81c33b7a 2626 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x800000) expect 1.250 // Mid Scale
whismanoid 61:38ec81c33b7a 2627 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2628 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2629 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x800000) expect 1.250'
whismanoid 61:38ec81c33b7a 2630 // docTest_item['remarks'] = 'Mid Scale'
whismanoid 61:38ec81c33b7a 2631 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2632 // docTest_item['arglist'] = '0x800000'
whismanoid 61:38ec81c33b7a 2633 // docTest_item['expect-value'] = '1.250'
whismanoid 61:38ec81c33b7a 2634 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Mid Scale
whismanoid 61:38ec81c33b7a 2635 // call-function
whismanoid 61:38ec81c33b7a 2636 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x800000), (double)1.250); // Mid Scale
whismanoid 63:708490d6a29f 2637 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x800000, /* expect: */ (double)1.250); // Mid Scale
whismanoid 61:38ec81c33b7a 2638 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2639
whismanoid 61:38ec81c33b7a 2640 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x666666) expect 1.000 // One Volt
whismanoid 61:38ec81c33b7a 2641 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2642 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2643 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x666666) expect 1.000'
whismanoid 61:38ec81c33b7a 2644 // docTest_item['remarks'] = 'One Volt'
whismanoid 61:38ec81c33b7a 2645 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2646 // docTest_item['arglist'] = '0x666666'
whismanoid 61:38ec81c33b7a 2647 // docTest_item['expect-value'] = '1.000'
whismanoid 61:38ec81c33b7a 2648 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar One Volt
whismanoid 61:38ec81c33b7a 2649 // call-function
whismanoid 61:38ec81c33b7a 2650 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x666666), (double)1.000); // One Volt
whismanoid 63:708490d6a29f 2651 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x666666, /* expect: */ (double)1.000); // One Volt
whismanoid 61:38ec81c33b7a 2652 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2653
whismanoid 61:38ec81c33b7a 2654 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x400000) expect 0.625 // 25% Scale
whismanoid 61:38ec81c33b7a 2655 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2656 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2657 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x400000) expect 0.625'
whismanoid 61:38ec81c33b7a 2658 // docTest_item['remarks'] = '25% Scale'
whismanoid 61:38ec81c33b7a 2659 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2660 // docTest_item['arglist'] = '0x400000'
whismanoid 61:38ec81c33b7a 2661 // docTest_item['expect-value'] = '0.625'
whismanoid 61:38ec81c33b7a 2662 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 25% Scale
whismanoid 61:38ec81c33b7a 2663 // call-function
whismanoid 61:38ec81c33b7a 2664 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x400000), (double)0.625); // 25% Scale
whismanoid 63:708490d6a29f 2665 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x400000, /* expect: */ (double)0.625); // 25% Scale
whismanoid 61:38ec81c33b7a 2666 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2667
whismanoid 61:38ec81c33b7a 2668 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x0A3D70) expect 0.100 // 100mV
whismanoid 61:38ec81c33b7a 2669 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2670 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2671 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x0A3D70) expect 0.100'
whismanoid 61:38ec81c33b7a 2672 // docTest_item['remarks'] = '100mV'
whismanoid 61:38ec81c33b7a 2673 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2674 // docTest_item['arglist'] = '0x0A3D70'
whismanoid 61:38ec81c33b7a 2675 // docTest_item['expect-value'] = '0.100'
whismanoid 61:38ec81c33b7a 2676 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 100mV
whismanoid 61:38ec81c33b7a 2677 // call-function
whismanoid 61:38ec81c33b7a 2678 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x0A3D70), (double)0.100); // 100mV
whismanoid 63:708490d6a29f 2679 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x0A3D70, /* expect: */ (double)0.100); // 100mV
whismanoid 61:38ec81c33b7a 2680 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2681
whismanoid 61:38ec81c33b7a 2682 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000064) expect 0.000014901162 // 100 LSB
whismanoid 61:38ec81c33b7a 2683 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2684 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2685 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000064) expect 0.000014901162'
whismanoid 61:38ec81c33b7a 2686 // docTest_item['remarks'] = '100 LSB'
whismanoid 61:38ec81c33b7a 2687 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2688 // docTest_item['arglist'] = '0x000064'
whismanoid 61:38ec81c33b7a 2689 // docTest_item['expect-value'] = '0.000014901162'
whismanoid 61:38ec81c33b7a 2690 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar 100 LSB
whismanoid 61:38ec81c33b7a 2691 // call-function
whismanoid 61:38ec81c33b7a 2692 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000064), (double)0.000014901162); // 100 LSB
whismanoid 63:708490d6a29f 2693 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000064, /* expect: */ (double)0.000014901162); // 100 LSB
whismanoid 61:38ec81c33b7a 2694 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2695
whismanoid 61:38ec81c33b7a 2696 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x00000A) expect 0.0000014901162 // Ten LSB
whismanoid 61:38ec81c33b7a 2697 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2698 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2699 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x00000A) expect 0.0000014901162'
whismanoid 61:38ec81c33b7a 2700 // docTest_item['remarks'] = 'Ten LSB'
whismanoid 61:38ec81c33b7a 2701 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2702 // docTest_item['arglist'] = '0x00000A'
whismanoid 61:38ec81c33b7a 2703 // docTest_item['expect-value'] = '0.0000014901162'
whismanoid 61:38ec81c33b7a 2704 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Ten LSB
whismanoid 61:38ec81c33b7a 2705 // call-function
whismanoid 61:38ec81c33b7a 2706 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x00000A), (double)0.0000014901162); // Ten LSB
whismanoid 63:708490d6a29f 2707 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x00000A, /* expect: */ (double)0.0000014901162); // Ten LSB
whismanoid 61:38ec81c33b7a 2708 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2709
whismanoid 61:38ec81c33b7a 2710 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000003) expect 0.00000044703483 // Three LSB
whismanoid 61:38ec81c33b7a 2711 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2712 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2713 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000003) expect 0.00000044703483'
whismanoid 61:38ec81c33b7a 2714 // docTest_item['remarks'] = 'Three LSB'
whismanoid 61:38ec81c33b7a 2715 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2716 // docTest_item['arglist'] = '0x000003'
whismanoid 61:38ec81c33b7a 2717 // docTest_item['expect-value'] = '0.00000044703483'
whismanoid 61:38ec81c33b7a 2718 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Three LSB
whismanoid 61:38ec81c33b7a 2719 // call-function
whismanoid 61:38ec81c33b7a 2720 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000003), (double)0.00000044703483); // Three LSB
whismanoid 63:708490d6a29f 2721 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000003, /* expect: */ (double)0.00000044703483); // Three LSB
whismanoid 61:38ec81c33b7a 2722 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2723
whismanoid 61:38ec81c33b7a 2724 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000002) expect 0.00000029802326 // Two LSB
whismanoid 61:38ec81c33b7a 2725 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2726 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2727 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000002) expect 0.00000029802326'
whismanoid 61:38ec81c33b7a 2728 // docTest_item['remarks'] = 'Two LSB'
whismanoid 61:38ec81c33b7a 2729 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2730 // docTest_item['arglist'] = '0x000002'
whismanoid 61:38ec81c33b7a 2731 // docTest_item['expect-value'] = '0.00000029802326'
whismanoid 61:38ec81c33b7a 2732 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Two LSB
whismanoid 61:38ec81c33b7a 2733 // call-function
whismanoid 61:38ec81c33b7a 2734 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000002), (double)0.00000029802326); // Two LSB
whismanoid 63:708490d6a29f 2735 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000002, /* expect: */ (double)0.00000029802326); // Two LSB
whismanoid 61:38ec81c33b7a 2736 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2737
whismanoid 61:38ec81c33b7a 2738 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000001) expect 0.00000014901162 // One LSB
whismanoid 61:38ec81c33b7a 2739 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2740 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2741 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000001) expect 0.00000014901162'
whismanoid 61:38ec81c33b7a 2742 // docTest_item['remarks'] = 'One LSB'
whismanoid 61:38ec81c33b7a 2743 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2744 // docTest_item['arglist'] = '0x000001'
whismanoid 61:38ec81c33b7a 2745 // docTest_item['expect-value'] = '0.00000014901162'
whismanoid 61:38ec81c33b7a 2746 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar One LSB
whismanoid 61:38ec81c33b7a 2747 // call-function
whismanoid 61:38ec81c33b7a 2748 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000001), (double)0.00000014901162); // One LSB
whismanoid 63:708490d6a29f 2749 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000001, /* expect: */ (double)0.00000014901162); // One LSB
whismanoid 61:38ec81c33b7a 2750 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2751
whismanoid 61:38ec81c33b7a 2752 // @test group UNIPOLAR VoltageOfCode_Unipolar(0x000000) expect 0.0 // Zero Scale
whismanoid 61:38ec81c33b7a 2753 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2754 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2755 // docTest_item['action'] = 'VoltageOfCode_Unipolar(0x000000) expect 0.0'
whismanoid 61:38ec81c33b7a 2756 // docTest_item['remarks'] = 'Zero Scale'
whismanoid 61:38ec81c33b7a 2757 // docTest_item['funcName'] = 'VoltageOfCode_Unipolar'
whismanoid 61:38ec81c33b7a 2758 // docTest_item['arglist'] = '0x000000'
whismanoid 61:38ec81c33b7a 2759 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 2760 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR VoltageOfCode_Unipolar Zero Scale
whismanoid 61:38ec81c33b7a 2761 // call-function
whismanoid 61:38ec81c33b7a 2762 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)0x000000), (double)0.0); // Zero Scale
whismanoid 63:708490d6a29f 2763 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Unipolar", fn_MAX11410_VoltageOfCode_Unipolar, (uint32_t)0x000000, /* expect: */ (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2764 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2765
whismanoid 61:38ec81c33b7a 2766 // @test group UNIPOLAR tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 2767 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2768 // docTest_item['group-id-value'] = 'UNIPOLAR'
whismanoid 61:38ec81c33b7a 2769 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 2770 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 2771 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2772 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 2773 #if MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 2774 // assign-propname-value
whismanoid 61:38ec81c33b7a 2775 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2776 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 2777 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 2778 #endif // MAX11410_SELFTEST_UNIPOLAR // group UNIPOLAR
whismanoid 61:38ec81c33b7a 2779
whismanoid 61:38ec81c33b7a 2780 // @test group BIPOB // Verify function VoltageOfCode_Bipolar_OffsetBinary
whismanoid 61:38ec81c33b7a 2781 // @test group BIPOB tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2782 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 2783 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2784 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 2785 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 2786 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 2787 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 2788 #if MAX11410_SELFTEST_BIPOB // group BIPOB None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 2789 // assign-propname-value
whismanoid 61:38ec81c33b7a 2790 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 2791 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 2792 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 2793 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2794
whismanoid 61:38ec81c33b7a 2795 // @test group BIPOB Configure_CTRL_REF(2) expect 1 // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2796 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2797 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2798 // docTest_item['action'] = 'Configure_CTRL_REF(2) expect 1'
whismanoid 61:38ec81c33b7a 2799 // docTest_item['remarks'] = 'These tests require REF2 = 2.500V'
whismanoid 61:38ec81c33b7a 2800 // docTest_item['funcName'] = 'Configure_CTRL_REF'
whismanoid 61:38ec81c33b7a 2801 // docTest_item['arglist'] = '2'
whismanoid 61:38ec81c33b7a 2802 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2803 #if MAX11410_SELFTEST_BIPOB // group BIPOB Configure_CTRL_REF These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 2804 // call-function
whismanoid 61:38ec81c33b7a 2805 // ASSERT_EQ(g_MAX11410_device.Configure_CTRL_REF((uint8_t)2), (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 63:708490d6a29f 2806 tinyTester.FunctionCall_su_su_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 2807 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2808
whismanoid 61:38ec81c33b7a 2809 // @test group BIPOB Configure_PGA(0,0) expect 1 // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2810 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2811 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2812 // docTest_item['action'] = 'Configure_PGA(0,0) expect 1'
whismanoid 61:38ec81c33b7a 2813 // docTest_item['remarks'] = 'These tests require PGA gain=1'
whismanoid 61:38ec81c33b7a 2814 // docTest_item['funcName'] = 'Configure_PGA'
whismanoid 61:38ec81c33b7a 2815 // docTest_item['arglist'] = '0,0'
whismanoid 61:38ec81c33b7a 2816 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 2817 #if MAX11410_SELFTEST_BIPOB // group BIPOB Configure_PGA These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 2818 // call-function
whismanoid 61:38ec81c33b7a 2819 // ASSERT_EQ(g_MAX11410_device.Configure_PGA((uint8_t)0, (uint8_t)0), (uint8_t)1); // These tests require PGA gain=1
whismanoid 63:708490d6a29f 2820 tinyTester.FunctionCall_su_su_su_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 2821 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2822
whismanoid 61:38ec81c33b7a 2823 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFF) expect 2.5 within 0.030 // Full Scale
whismanoid 61:38ec81c33b7a 2824 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2825 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2826 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFF) expect 2.5 within 0.030'
whismanoid 61:38ec81c33b7a 2827 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2828 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2829 // docTest_item['arglist'] = '0xFFFFFF'
whismanoid 61:38ec81c33b7a 2830 // docTest_item['expect-value'] = '2.5'
whismanoid 61:38ec81c33b7a 2831 // docTest_item['within-value'] = '0.030'
whismanoid 61:38ec81c33b7a 2832 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Full Scale
whismanoid 61:38ec81c33b7a 2833 // call-function
whismanoid 61:38ec81c33b7a 2834 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0xFFFFFF), (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2835 tinyTester.err_threshold = 0.030; // within 0.030
whismanoid 63:708490d6a29f 2836 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0xFFFFFF, /* expect: */ (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2837 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2838
whismanoid 61:38ec81c33b7a 2839 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFE) expect 2.5 // Full Scale
whismanoid 61:38ec81c33b7a 2840 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2841 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2842 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0xFFFFFE) expect 2.5'
whismanoid 61:38ec81c33b7a 2843 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 2844 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2845 // docTest_item['arglist'] = '0xFFFFFE'
whismanoid 61:38ec81c33b7a 2846 // docTest_item['expect-value'] = '2.5'
whismanoid 61:38ec81c33b7a 2847 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Full Scale
whismanoid 61:38ec81c33b7a 2848 // call-function
whismanoid 61:38ec81c33b7a 2849 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0xFFFFFE), (double)2.5); // Full Scale
whismanoid 63:708490d6a29f 2850 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0xFFFFFE, /* expect: */ (double)2.5); // Full Scale
whismanoid 61:38ec81c33b7a 2851 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2852
whismanoid 61:38ec81c33b7a 2853 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0xC00000) expect 1.25 // Mid Scale
whismanoid 61:38ec81c33b7a 2854 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2855 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2856 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0xC00000) expect 1.25'
whismanoid 61:38ec81c33b7a 2857 // docTest_item['remarks'] = 'Mid Scale'
whismanoid 61:38ec81c33b7a 2858 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2859 // docTest_item['arglist'] = '0xC00000'
whismanoid 61:38ec81c33b7a 2860 // docTest_item['expect-value'] = '1.25'
whismanoid 61:38ec81c33b7a 2861 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Mid Scale
whismanoid 61:38ec81c33b7a 2862 // call-function
whismanoid 61:38ec81c33b7a 2863 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0xC00000), (double)1.25); // Mid Scale
whismanoid 63:708490d6a29f 2864 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0xC00000, /* expect: */ (double)1.25); // Mid Scale
whismanoid 61:38ec81c33b7a 2865 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2866
whismanoid 61:38ec81c33b7a 2867 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800003) expect 0.00000894069671 // Three LSB
whismanoid 61:38ec81c33b7a 2868 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2869 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2870 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800003) expect 0.00000894069671'
whismanoid 61:38ec81c33b7a 2871 // docTest_item['remarks'] = 'Three LSB'
whismanoid 61:38ec81c33b7a 2872 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2873 // docTest_item['arglist'] = '0x800003'
whismanoid 61:38ec81c33b7a 2874 // docTest_item['expect-value'] = '0.00000894069671'
whismanoid 61:38ec81c33b7a 2875 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Three LSB
whismanoid 61:38ec81c33b7a 2876 // call-function
whismanoid 61:38ec81c33b7a 2877 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800003), (double)0.00000894069671); // Three LSB
whismanoid 63:708490d6a29f 2878 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800003, /* expect: */ (double)0.00000894069671); // Three LSB
whismanoid 61:38ec81c33b7a 2879 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2880
whismanoid 61:38ec81c33b7a 2881 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800002) expect 0.00000596046447 // Two LSB
whismanoid 61:38ec81c33b7a 2882 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2883 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2884 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800002) expect 0.00000596046447'
whismanoid 61:38ec81c33b7a 2885 // docTest_item['remarks'] = 'Two LSB'
whismanoid 61:38ec81c33b7a 2886 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2887 // docTest_item['arglist'] = '0x800002'
whismanoid 61:38ec81c33b7a 2888 // docTest_item['expect-value'] = '0.00000596046447'
whismanoid 61:38ec81c33b7a 2889 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Two LSB
whismanoid 61:38ec81c33b7a 2890 // call-function
whismanoid 61:38ec81c33b7a 2891 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800002), (double)0.00000596046447); // Two LSB
whismanoid 63:708490d6a29f 2892 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800002, /* expect: */ (double)0.00000596046447); // Two LSB
whismanoid 61:38ec81c33b7a 2893 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2894
whismanoid 61:38ec81c33b7a 2895 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800001) expect 0.0000029802326 // One LSB
whismanoid 61:38ec81c33b7a 2896 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2897 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2898 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800001) expect 0.0000029802326'
whismanoid 61:38ec81c33b7a 2899 // docTest_item['remarks'] = 'One LSB'
whismanoid 61:38ec81c33b7a 2900 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2901 // docTest_item['arglist'] = '0x800001'
whismanoid 61:38ec81c33b7a 2902 // docTest_item['expect-value'] = '0.0000029802326'
whismanoid 61:38ec81c33b7a 2903 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary One LSB
whismanoid 61:38ec81c33b7a 2904 // call-function
whismanoid 61:38ec81c33b7a 2905 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800001), (double)0.0000029802326); // One LSB
whismanoid 63:708490d6a29f 2906 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800001, /* expect: */ (double)0.0000029802326); // One LSB
whismanoid 61:38ec81c33b7a 2907 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2908
whismanoid 61:38ec81c33b7a 2909 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x800000) expect 0.0 // Zero Scale
whismanoid 61:38ec81c33b7a 2910 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2911 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2912 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x800000) expect 0.0'
whismanoid 61:38ec81c33b7a 2913 // docTest_item['remarks'] = 'Zero Scale'
whismanoid 61:38ec81c33b7a 2914 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2915 // docTest_item['arglist'] = '0x800000'
whismanoid 61:38ec81c33b7a 2916 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 2917 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Zero Scale
whismanoid 61:38ec81c33b7a 2918 // call-function
whismanoid 61:38ec81c33b7a 2919 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x800000), (double)0.0); // Zero Scale
whismanoid 63:708490d6a29f 2920 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x800000, /* expect: */ (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 2921 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2922
whismanoid 61:38ec81c33b7a 2923 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFF) expect -0.0000029802326 // Negative One LSB
whismanoid 61:38ec81c33b7a 2924 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2925 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2926 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFF) expect -0.0000029802326'
whismanoid 61:38ec81c33b7a 2927 // docTest_item['remarks'] = 'Negative One LSB'
whismanoid 61:38ec81c33b7a 2928 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2929 // docTest_item['arglist'] = '0x7FFFFF'
whismanoid 61:38ec81c33b7a 2930 // docTest_item['expect-value'] = '-0.0000029802326'
whismanoid 61:38ec81c33b7a 2931 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative One LSB
whismanoid 61:38ec81c33b7a 2932 // call-function
whismanoid 61:38ec81c33b7a 2933 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x7FFFFF), (double)-0.0000029802326); // Negative One LSB
whismanoid 63:708490d6a29f 2934 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x7FFFFF, /* expect: */ (double)-0.0000029802326); // Negative One LSB
whismanoid 61:38ec81c33b7a 2935 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2936
whismanoid 61:38ec81c33b7a 2937 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFE) expect -0.0000059604644 // Negative Two LSB
whismanoid 61:38ec81c33b7a 2938 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2939 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2940 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFE) expect -0.0000059604644'
whismanoid 61:38ec81c33b7a 2941 // docTest_item['remarks'] = 'Negative Two LSB'
whismanoid 61:38ec81c33b7a 2942 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2943 // docTest_item['arglist'] = '0x7FFFFE'
whismanoid 61:38ec81c33b7a 2944 // docTest_item['expect-value'] = '-0.0000059604644'
whismanoid 61:38ec81c33b7a 2945 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Two LSB
whismanoid 61:38ec81c33b7a 2946 // call-function
whismanoid 61:38ec81c33b7a 2947 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x7FFFFE), (double)-0.0000059604644); // Negative Two LSB
whismanoid 63:708490d6a29f 2948 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x7FFFFE, /* expect: */ (double)-0.0000059604644); // Negative Two LSB
whismanoid 61:38ec81c33b7a 2949 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2950
whismanoid 61:38ec81c33b7a 2951 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFD) expect -0.0000089406967 // Negative Three LSB
whismanoid 61:38ec81c33b7a 2952 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2953 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2954 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x7FFFFD) expect -0.0000089406967'
whismanoid 61:38ec81c33b7a 2955 // docTest_item['remarks'] = 'Negative Three LSB'
whismanoid 61:38ec81c33b7a 2956 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2957 // docTest_item['arglist'] = '0x7FFFFD'
whismanoid 61:38ec81c33b7a 2958 // docTest_item['expect-value'] = '-0.0000089406967'
whismanoid 61:38ec81c33b7a 2959 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Three LSB
whismanoid 61:38ec81c33b7a 2960 // call-function
whismanoid 61:38ec81c33b7a 2961 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x7FFFFD), (double)-0.0000089406967); // Negative Three LSB
whismanoid 63:708490d6a29f 2962 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x7FFFFD, /* expect: */ (double)-0.0000089406967); // Negative Three LSB
whismanoid 61:38ec81c33b7a 2963 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2964
whismanoid 61:38ec81c33b7a 2965 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x400000) expect -1.25 // Negative Mid Scale
whismanoid 61:38ec81c33b7a 2966 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2967 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2968 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x400000) expect -1.25'
whismanoid 61:38ec81c33b7a 2969 // docTest_item['remarks'] = 'Negative Mid Scale'
whismanoid 61:38ec81c33b7a 2970 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2971 // docTest_item['arglist'] = '0x400000'
whismanoid 61:38ec81c33b7a 2972 // docTest_item['expect-value'] = '-1.25'
whismanoid 61:38ec81c33b7a 2973 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Mid Scale
whismanoid 61:38ec81c33b7a 2974 // call-function
whismanoid 61:38ec81c33b7a 2975 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x400000), (double)-1.25); // Negative Mid Scale
whismanoid 63:708490d6a29f 2976 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x400000, /* expect: */ (double)-1.25); // Negative Mid Scale
whismanoid 61:38ec81c33b7a 2977 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2978
whismanoid 61:38ec81c33b7a 2979 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x000001) expect -2.5 // Negative Full Scale
whismanoid 61:38ec81c33b7a 2980 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2981 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2982 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x000001) expect -2.5'
whismanoid 61:38ec81c33b7a 2983 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 2984 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2985 // docTest_item['arglist'] = '0x000001'
whismanoid 61:38ec81c33b7a 2986 // docTest_item['expect-value'] = '-2.5'
whismanoid 61:38ec81c33b7a 2987 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Full Scale
whismanoid 61:38ec81c33b7a 2988 // call-function
whismanoid 61:38ec81c33b7a 2989 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x000001), (double)-2.5); // Negative Full Scale
whismanoid 63:708490d6a29f 2990 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x000001, /* expect: */ (double)-2.5); // Negative Full Scale
whismanoid 61:38ec81c33b7a 2991 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 2992
whismanoid 61:38ec81c33b7a 2993 // @test group BIPOB VoltageOfCode_Bipolar_OffsetBinary(0x000000) expect -2.5 // Negative Full Scale
whismanoid 61:38ec81c33b7a 2994 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 2995 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 2996 // docTest_item['action'] = 'VoltageOfCode_Bipolar_OffsetBinary(0x000000) expect -2.5'
whismanoid 61:38ec81c33b7a 2997 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 2998 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 61:38ec81c33b7a 2999 // docTest_item['arglist'] = '0x000000'
whismanoid 61:38ec81c33b7a 3000 // docTest_item['expect-value'] = '-2.5'
whismanoid 61:38ec81c33b7a 3001 #if MAX11410_SELFTEST_BIPOB // group BIPOB VoltageOfCode_Bipolar_OffsetBinary Negative Full Scale
whismanoid 61:38ec81c33b7a 3002 // call-function
whismanoid 61:38ec81c33b7a 3003 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)0x000000), (double)-2.5); // Negative Full Scale
whismanoid 63:708490d6a29f 3004 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_OffsetBinary", fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary, (uint32_t)0x000000, /* expect: */ (double)-2.5); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3005 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 3006
whismanoid 61:38ec81c33b7a 3007 // @test group BIPOB tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3008 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3009 // docTest_item['group-id-value'] = 'BIPOB'
whismanoid 61:38ec81c33b7a 3010 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3011 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3012 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3013 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3014 #if MAX11410_SELFTEST_BIPOB // group BIPOB None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3015 // assign-propname-value
whismanoid 61:38ec81c33b7a 3016 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3017 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3018 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3019 #endif // MAX11410_SELFTEST_BIPOB // group BIPOB
whismanoid 61:38ec81c33b7a 3020
whismanoid 61:38ec81c33b7a 3021 // @test group BIP2C // Verify function VoltageOfCode_Bipolar_2sComplement
whismanoid 61:38ec81c33b7a 3022 // @test group BIP2C tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3023 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3024 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3025 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3026 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3027 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3028 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3029 #if MAX11410_SELFTEST_BIP2C // group BIP2C None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3030 // assign-propname-value
whismanoid 61:38ec81c33b7a 3031 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3032 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3033 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3034 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3035
whismanoid 61:38ec81c33b7a 3036 // @test group BIP2C Configure_CTRL_REF(2) expect 1 // These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 3037 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3038 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3039 // docTest_item['action'] = 'Configure_CTRL_REF(2) expect 1'
whismanoid 61:38ec81c33b7a 3040 // docTest_item['remarks'] = 'These tests require REF2 = 2.500V'
whismanoid 61:38ec81c33b7a 3041 // docTest_item['funcName'] = 'Configure_CTRL_REF'
whismanoid 61:38ec81c33b7a 3042 // docTest_item['arglist'] = '2'
whismanoid 61:38ec81c33b7a 3043 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 3044 #if MAX11410_SELFTEST_BIP2C // group BIP2C Configure_CTRL_REF These tests require REF2 = 2.500V
whismanoid 61:38ec81c33b7a 3045 // call-function
whismanoid 61:38ec81c33b7a 3046 // ASSERT_EQ(g_MAX11410_device.Configure_CTRL_REF((uint8_t)2), (uint8_t)1); // These tests require REF2 = 2.500V
whismanoid 63:708490d6a29f 3047 tinyTester.FunctionCall_su_su_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 3048 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3049
whismanoid 61:38ec81c33b7a 3050 // @test group BIP2C Configure_PGA(0,0) expect 1 // These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 3051 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3052 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3053 // docTest_item['action'] = 'Configure_PGA(0,0) expect 1'
whismanoid 61:38ec81c33b7a 3054 // docTest_item['remarks'] = 'These tests require PGA gain=1'
whismanoid 61:38ec81c33b7a 3055 // docTest_item['funcName'] = 'Configure_PGA'
whismanoid 61:38ec81c33b7a 3056 // docTest_item['arglist'] = '0,0'
whismanoid 61:38ec81c33b7a 3057 // docTest_item['expect-value'] = '1'
whismanoid 61:38ec81c33b7a 3058 #if MAX11410_SELFTEST_BIP2C // group BIP2C Configure_PGA These tests require PGA gain=1
whismanoid 61:38ec81c33b7a 3059 // call-function
whismanoid 61:38ec81c33b7a 3060 // ASSERT_EQ(g_MAX11410_device.Configure_PGA((uint8_t)0, (uint8_t)0), (uint8_t)1); // These tests require PGA gain=1
whismanoid 63:708490d6a29f 3061 tinyTester.FunctionCall_su_su_su_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 3062 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3063
whismanoid 61:38ec81c33b7a 3064 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x7FFFFF) expect 2.500 within 0.030 // Full Scale
whismanoid 61:38ec81c33b7a 3065 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3066 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3067 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x7FFFFF) expect 2.500 within 0.030'
whismanoid 61:38ec81c33b7a 3068 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 3069 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3070 // docTest_item['arglist'] = '0x7FFFFF'
whismanoid 61:38ec81c33b7a 3071 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 3072 // docTest_item['within-value'] = '0.030'
whismanoid 61:38ec81c33b7a 3073 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Full Scale
whismanoid 61:38ec81c33b7a 3074 // call-function
whismanoid 61:38ec81c33b7a 3075 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x7FFFFF), (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 3076 tinyTester.err_threshold = 0.030; // within 0.030
whismanoid 63:708490d6a29f 3077 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x7FFFFF, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 3078 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3079
whismanoid 61:38ec81c33b7a 3080 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x7FFFFE) expect 2.500 // Full Scale
whismanoid 61:38ec81c33b7a 3081 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3082 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3083 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x7FFFFE) expect 2.500'
whismanoid 61:38ec81c33b7a 3084 // docTest_item['remarks'] = 'Full Scale'
whismanoid 61:38ec81c33b7a 3085 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3086 // docTest_item['arglist'] = '0x7FFFFE'
whismanoid 61:38ec81c33b7a 3087 // docTest_item['expect-value'] = '2.500'
whismanoid 61:38ec81c33b7a 3088 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Full Scale
whismanoid 61:38ec81c33b7a 3089 // call-function
whismanoid 61:38ec81c33b7a 3090 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x7FFFFE), (double)2.500); // Full Scale
whismanoid 63:708490d6a29f 3091 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x7FFFFE, /* expect: */ (double)2.500); // Full Scale
whismanoid 61:38ec81c33b7a 3092 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3093
whismanoid 61:38ec81c33b7a 3094 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x666666) expect 2.000 // Two Volts
whismanoid 61:38ec81c33b7a 3095 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3096 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3097 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x666666) expect 2.000'
whismanoid 61:38ec81c33b7a 3098 // docTest_item['remarks'] = 'Two Volts'
whismanoid 61:38ec81c33b7a 3099 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3100 // docTest_item['arglist'] = '0x666666'
whismanoid 61:38ec81c33b7a 3101 // docTest_item['expect-value'] = '2.000'
whismanoid 61:38ec81c33b7a 3102 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Two Volts
whismanoid 61:38ec81c33b7a 3103 // call-function
whismanoid 61:38ec81c33b7a 3104 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x666666), (double)2.000); // Two Volts
whismanoid 63:708490d6a29f 3105 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x666666, /* expect: */ (double)2.000); // Two Volts
whismanoid 61:38ec81c33b7a 3106 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3107
whismanoid 61:38ec81c33b7a 3108 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x600000) expect 1.875 // 75% Scale
whismanoid 61:38ec81c33b7a 3109 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3110 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3111 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x600000) expect 1.875'
whismanoid 61:38ec81c33b7a 3112 // docTest_item['remarks'] = '75% Scale'
whismanoid 61:38ec81c33b7a 3113 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3114 // docTest_item['arglist'] = '0x600000'
whismanoid 61:38ec81c33b7a 3115 // docTest_item['expect-value'] = '1.875'
whismanoid 61:38ec81c33b7a 3116 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement 75% Scale
whismanoid 61:38ec81c33b7a 3117 // call-function
whismanoid 61:38ec81c33b7a 3118 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x600000), (double)1.875); // 75% Scale
whismanoid 63:708490d6a29f 3119 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x600000, /* expect: */ (double)1.875); // 75% Scale
whismanoid 61:38ec81c33b7a 3120 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3121
whismanoid 61:38ec81c33b7a 3122 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x400000) expect 1.250 // Mid Scale
whismanoid 61:38ec81c33b7a 3123 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3124 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3125 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x400000) expect 1.250'
whismanoid 61:38ec81c33b7a 3126 // docTest_item['remarks'] = 'Mid Scale'
whismanoid 61:38ec81c33b7a 3127 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3128 // docTest_item['arglist'] = '0x400000'
whismanoid 61:38ec81c33b7a 3129 // docTest_item['expect-value'] = '1.250'
whismanoid 61:38ec81c33b7a 3130 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Mid Scale
whismanoid 61:38ec81c33b7a 3131 // call-function
whismanoid 61:38ec81c33b7a 3132 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x400000), (double)1.250); // Mid Scale
whismanoid 63:708490d6a29f 3133 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x400000, /* expect: */ (double)1.250); // Mid Scale
whismanoid 61:38ec81c33b7a 3134 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3135
whismanoid 61:38ec81c33b7a 3136 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x333333) expect 1.000 // One Volt
whismanoid 61:38ec81c33b7a 3137 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3138 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3139 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x333333) expect 1.000'
whismanoid 61:38ec81c33b7a 3140 // docTest_item['remarks'] = 'One Volt'
whismanoid 61:38ec81c33b7a 3141 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3142 // docTest_item['arglist'] = '0x333333'
whismanoid 61:38ec81c33b7a 3143 // docTest_item['expect-value'] = '1.000'
whismanoid 61:38ec81c33b7a 3144 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement One Volt
whismanoid 61:38ec81c33b7a 3145 // call-function
whismanoid 61:38ec81c33b7a 3146 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x333333), (double)1.000); // One Volt
whismanoid 63:708490d6a29f 3147 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x333333, /* expect: */ (double)1.000); // One Volt
whismanoid 61:38ec81c33b7a 3148 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3149
whismanoid 61:38ec81c33b7a 3150 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x200000) expect 0.625 // 25% Scale
whismanoid 61:38ec81c33b7a 3151 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3152 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3153 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x200000) expect 0.625'
whismanoid 61:38ec81c33b7a 3154 // docTest_item['remarks'] = '25% Scale'
whismanoid 61:38ec81c33b7a 3155 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3156 // docTest_item['arglist'] = '0x200000'
whismanoid 61:38ec81c33b7a 3157 // docTest_item['expect-value'] = '0.625'
whismanoid 61:38ec81c33b7a 3158 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement 25% Scale
whismanoid 61:38ec81c33b7a 3159 // call-function
whismanoid 61:38ec81c33b7a 3160 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x200000), (double)0.625); // 25% Scale
whismanoid 63:708490d6a29f 3161 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x200000, /* expect: */ (double)0.625); // 25% Scale
whismanoid 61:38ec81c33b7a 3162 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3163
whismanoid 61:38ec81c33b7a 3164 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x051eb8) expect 0.100 // 100mV
whismanoid 61:38ec81c33b7a 3165 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3166 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3167 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x051eb8) expect 0.100'
whismanoid 61:38ec81c33b7a 3168 // docTest_item['remarks'] = '100mV'
whismanoid 61:38ec81c33b7a 3169 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3170 // docTest_item['arglist'] = '0x051eb8'
whismanoid 61:38ec81c33b7a 3171 // docTest_item['expect-value'] = '0.100'
whismanoid 61:38ec81c33b7a 3172 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement 100mV
whismanoid 61:38ec81c33b7a 3173 // call-function
whismanoid 61:38ec81c33b7a 3174 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x051eb8), (double)0.100); // 100mV
whismanoid 63:708490d6a29f 3175 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x051eb8, /* expect: */ (double)0.100); // 100mV
whismanoid 61:38ec81c33b7a 3176 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3177
whismanoid 61:38ec81c33b7a 3178 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000003) expect 0.00000894069671 // Three LSB
whismanoid 61:38ec81c33b7a 3179 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3180 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3181 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000003) expect 0.00000894069671'
whismanoid 61:38ec81c33b7a 3182 // docTest_item['remarks'] = 'Three LSB'
whismanoid 61:38ec81c33b7a 3183 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3184 // docTest_item['arglist'] = '0x000003'
whismanoid 61:38ec81c33b7a 3185 // docTest_item['expect-value'] = '0.00000894069671'
whismanoid 61:38ec81c33b7a 3186 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Three LSB
whismanoid 61:38ec81c33b7a 3187 // call-function
whismanoid 61:38ec81c33b7a 3188 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000003), (double)0.00000894069671); // Three LSB
whismanoid 63:708490d6a29f 3189 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000003, /* expect: */ (double)0.00000894069671); // Three LSB
whismanoid 61:38ec81c33b7a 3190 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3191
whismanoid 61:38ec81c33b7a 3192 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000002) expect 0.00000596046447 // Two LSB
whismanoid 61:38ec81c33b7a 3193 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3194 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3195 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000002) expect 0.00000596046447'
whismanoid 61:38ec81c33b7a 3196 // docTest_item['remarks'] = 'Two LSB'
whismanoid 61:38ec81c33b7a 3197 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3198 // docTest_item['arglist'] = '0x000002'
whismanoid 61:38ec81c33b7a 3199 // docTest_item['expect-value'] = '0.00000596046447'
whismanoid 61:38ec81c33b7a 3200 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Two LSB
whismanoid 61:38ec81c33b7a 3201 // call-function
whismanoid 61:38ec81c33b7a 3202 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000002), (double)0.00000596046447); // Two LSB
whismanoid 63:708490d6a29f 3203 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000002, /* expect: */ (double)0.00000596046447); // Two LSB
whismanoid 61:38ec81c33b7a 3204 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3205
whismanoid 61:38ec81c33b7a 3206 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000001) expect 0.0000029802326 // One LSB
whismanoid 61:38ec81c33b7a 3207 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3208 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3209 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000001) expect 0.0000029802326'
whismanoid 61:38ec81c33b7a 3210 // docTest_item['remarks'] = 'One LSB'
whismanoid 61:38ec81c33b7a 3211 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3212 // docTest_item['arglist'] = '0x000001'
whismanoid 61:38ec81c33b7a 3213 // docTest_item['expect-value'] = '0.0000029802326'
whismanoid 61:38ec81c33b7a 3214 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement One LSB
whismanoid 61:38ec81c33b7a 3215 // call-function
whismanoid 61:38ec81c33b7a 3216 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000001), (double)0.0000029802326); // One LSB
whismanoid 63:708490d6a29f 3217 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000001, /* expect: */ (double)0.0000029802326); // One LSB
whismanoid 61:38ec81c33b7a 3218 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3219
whismanoid 61:38ec81c33b7a 3220 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x000000) expect 0.0 // Zero Scale
whismanoid 61:38ec81c33b7a 3221 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3222 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3223 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x000000) expect 0.0'
whismanoid 61:38ec81c33b7a 3224 // docTest_item['remarks'] = 'Zero Scale'
whismanoid 61:38ec81c33b7a 3225 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3226 // docTest_item['arglist'] = '0x000000'
whismanoid 61:38ec81c33b7a 3227 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3228 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Zero Scale
whismanoid 61:38ec81c33b7a 3229 // call-function
whismanoid 61:38ec81c33b7a 3230 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x000000), (double)0.0); // Zero Scale
whismanoid 63:708490d6a29f 3231 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x000000, /* expect: */ (double)0.0); // Zero Scale
whismanoid 61:38ec81c33b7a 3232 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3233
whismanoid 61:38ec81c33b7a 3234 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFFFFFF) expect -0.0000029802326 // Negative One LSB
whismanoid 61:38ec81c33b7a 3235 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3236 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3237 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFFFFFF) expect -0.0000029802326'
whismanoid 61:38ec81c33b7a 3238 // docTest_item['remarks'] = 'Negative One LSB'
whismanoid 61:38ec81c33b7a 3239 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3240 // docTest_item['arglist'] = '0xFFFFFF'
whismanoid 61:38ec81c33b7a 3241 // docTest_item['expect-value'] = '-0.0000029802326'
whismanoid 61:38ec81c33b7a 3242 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative One LSB
whismanoid 61:38ec81c33b7a 3243 // call-function
whismanoid 61:38ec81c33b7a 3244 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFFFFFF), (double)-0.0000029802326); // Negative One LSB
whismanoid 63:708490d6a29f 3245 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFFFFFF, /* expect: */ (double)-0.0000029802326); // Negative One LSB
whismanoid 61:38ec81c33b7a 3246 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3247
whismanoid 61:38ec81c33b7a 3248 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFFFFFE) expect -0.0000059604644 // Negative Two LSB
whismanoid 61:38ec81c33b7a 3249 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3250 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3251 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFFFFFE) expect -0.0000059604644'
whismanoid 61:38ec81c33b7a 3252 // docTest_item['remarks'] = 'Negative Two LSB'
whismanoid 61:38ec81c33b7a 3253 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3254 // docTest_item['arglist'] = '0xFFFFFE'
whismanoid 61:38ec81c33b7a 3255 // docTest_item['expect-value'] = '-0.0000059604644'
whismanoid 61:38ec81c33b7a 3256 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Two LSB
whismanoid 61:38ec81c33b7a 3257 // call-function
whismanoid 61:38ec81c33b7a 3258 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFFFFFE), (double)-0.0000059604644); // Negative Two LSB
whismanoid 63:708490d6a29f 3259 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFFFFFE, /* expect: */ (double)-0.0000059604644); // Negative Two LSB
whismanoid 61:38ec81c33b7a 3260 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3261
whismanoid 61:38ec81c33b7a 3262 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFFFFFD) expect -0.0000089406967 // Negative Three LSB
whismanoid 61:38ec81c33b7a 3263 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3264 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3265 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFFFFFD) expect -0.0000089406967'
whismanoid 61:38ec81c33b7a 3266 // docTest_item['remarks'] = 'Negative Three LSB'
whismanoid 61:38ec81c33b7a 3267 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3268 // docTest_item['arglist'] = '0xFFFFFD'
whismanoid 61:38ec81c33b7a 3269 // docTest_item['expect-value'] = '-0.0000089406967'
whismanoid 61:38ec81c33b7a 3270 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Three LSB
whismanoid 61:38ec81c33b7a 3271 // call-function
whismanoid 61:38ec81c33b7a 3272 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFFFFFD), (double)-0.0000089406967); // Negative Three LSB
whismanoid 63:708490d6a29f 3273 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFFFFFD, /* expect: */ (double)-0.0000089406967); // Negative Three LSB
whismanoid 61:38ec81c33b7a 3274 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3275
whismanoid 61:38ec81c33b7a 3276 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xFAE148) expect -0.100 // Negative 100mV
whismanoid 61:38ec81c33b7a 3277 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3278 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3279 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xFAE148) expect -0.100'
whismanoid 61:38ec81c33b7a 3280 // docTest_item['remarks'] = 'Negative 100mV'
whismanoid 61:38ec81c33b7a 3281 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3282 // docTest_item['arglist'] = '0xFAE148'
whismanoid 61:38ec81c33b7a 3283 // docTest_item['expect-value'] = '-0.100'
whismanoid 61:38ec81c33b7a 3284 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative 100mV
whismanoid 61:38ec81c33b7a 3285 // call-function
whismanoid 61:38ec81c33b7a 3286 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xFAE148), (double)-0.100); // Negative 100mV
whismanoid 63:708490d6a29f 3287 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xFAE148, /* expect: */ (double)-0.100); // Negative 100mV
whismanoid 61:38ec81c33b7a 3288 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3289
whismanoid 61:38ec81c33b7a 3290 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xE00000) expect -0.625 // Negative 25% Scale
whismanoid 61:38ec81c33b7a 3291 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3292 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3293 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xE00000) expect -0.625'
whismanoid 61:38ec81c33b7a 3294 // docTest_item['remarks'] = 'Negative 25% Scale'
whismanoid 61:38ec81c33b7a 3295 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3296 // docTest_item['arglist'] = '0xE00000'
whismanoid 61:38ec81c33b7a 3297 // docTest_item['expect-value'] = '-0.625'
whismanoid 61:38ec81c33b7a 3298 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative 25% Scale
whismanoid 61:38ec81c33b7a 3299 // call-function
whismanoid 61:38ec81c33b7a 3300 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xE00000), (double)-0.625); // Negative 25% Scale
whismanoid 63:708490d6a29f 3301 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xE00000, /* expect: */ (double)-0.625); // Negative 25% Scale
whismanoid 61:38ec81c33b7a 3302 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3303
whismanoid 61:38ec81c33b7a 3304 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xCCCCCD) expect -1.000 // Negative One Volt
whismanoid 61:38ec81c33b7a 3305 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3306 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3307 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xCCCCCD) expect -1.000'
whismanoid 61:38ec81c33b7a 3308 // docTest_item['remarks'] = 'Negative One Volt'
whismanoid 61:38ec81c33b7a 3309 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3310 // docTest_item['arglist'] = '0xCCCCCD'
whismanoid 61:38ec81c33b7a 3311 // docTest_item['expect-value'] = '-1.000'
whismanoid 61:38ec81c33b7a 3312 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative One Volt
whismanoid 61:38ec81c33b7a 3313 // call-function
whismanoid 61:38ec81c33b7a 3314 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xCCCCCD), (double)-1.000); // Negative One Volt
whismanoid 63:708490d6a29f 3315 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xCCCCCD, /* expect: */ (double)-1.000); // Negative One Volt
whismanoid 61:38ec81c33b7a 3316 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3317
whismanoid 61:38ec81c33b7a 3318 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xC00000) expect -1.250 // Negative Mid Scale
whismanoid 61:38ec81c33b7a 3319 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3320 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3321 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xC00000) expect -1.250'
whismanoid 61:38ec81c33b7a 3322 // docTest_item['remarks'] = 'Negative Mid Scale'
whismanoid 61:38ec81c33b7a 3323 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3324 // docTest_item['arglist'] = '0xC00000'
whismanoid 61:38ec81c33b7a 3325 // docTest_item['expect-value'] = '-1.250'
whismanoid 61:38ec81c33b7a 3326 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Mid Scale
whismanoid 61:38ec81c33b7a 3327 // call-function
whismanoid 61:38ec81c33b7a 3328 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xC00000), (double)-1.250); // Negative Mid Scale
whismanoid 63:708490d6a29f 3329 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xC00000, /* expect: */ (double)-1.250); // Negative Mid Scale
whismanoid 61:38ec81c33b7a 3330 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3331
whismanoid 61:38ec81c33b7a 3332 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0xA00000) expect -1.875 // Negative 75% Scale
whismanoid 61:38ec81c33b7a 3333 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3334 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3335 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0xA00000) expect -1.875'
whismanoid 61:38ec81c33b7a 3336 // docTest_item['remarks'] = 'Negative 75% Scale'
whismanoid 61:38ec81c33b7a 3337 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3338 // docTest_item['arglist'] = '0xA00000'
whismanoid 61:38ec81c33b7a 3339 // docTest_item['expect-value'] = '-1.875'
whismanoid 61:38ec81c33b7a 3340 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative 75% Scale
whismanoid 61:38ec81c33b7a 3341 // call-function
whismanoid 61:38ec81c33b7a 3342 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0xA00000), (double)-1.875); // Negative 75% Scale
whismanoid 63:708490d6a29f 3343 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0xA00000, /* expect: */ (double)-1.875); // Negative 75% Scale
whismanoid 61:38ec81c33b7a 3344 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3345
whismanoid 61:38ec81c33b7a 3346 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x99999A) expect -2.000 // Negative Two Volts
whismanoid 61:38ec81c33b7a 3347 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3348 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3349 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x99999A) expect -2.000'
whismanoid 61:38ec81c33b7a 3350 // docTest_item['remarks'] = 'Negative Two Volts'
whismanoid 61:38ec81c33b7a 3351 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3352 // docTest_item['arglist'] = '0x99999A'
whismanoid 61:38ec81c33b7a 3353 // docTest_item['expect-value'] = '-2.000'
whismanoid 61:38ec81c33b7a 3354 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Two Volts
whismanoid 61:38ec81c33b7a 3355 // call-function
whismanoid 61:38ec81c33b7a 3356 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x99999A), (double)-2.000); // Negative Two Volts
whismanoid 63:708490d6a29f 3357 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x99999A, /* expect: */ (double)-2.000); // Negative Two Volts
whismanoid 61:38ec81c33b7a 3358 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3359
whismanoid 61:38ec81c33b7a 3360 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x800001) expect -2.500 // Negative Full Scale
whismanoid 61:38ec81c33b7a 3361 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3362 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3363 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x800001) expect -2.500'
whismanoid 61:38ec81c33b7a 3364 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 3365 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3366 // docTest_item['arglist'] = '0x800001'
whismanoid 61:38ec81c33b7a 3367 // docTest_item['expect-value'] = '-2.500'
whismanoid 61:38ec81c33b7a 3368 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Full Scale
whismanoid 61:38ec81c33b7a 3369 // call-function
whismanoid 61:38ec81c33b7a 3370 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x800001), (double)-2.500); // Negative Full Scale
whismanoid 63:708490d6a29f 3371 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x800001, /* expect: */ (double)-2.500); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3372 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3373
whismanoid 61:38ec81c33b7a 3374 // @test group BIP2C VoltageOfCode_Bipolar_2sComplement(0x800000) expect -2.500 // Negative Full Scale
whismanoid 61:38ec81c33b7a 3375 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3376 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3377 // docTest_item['action'] = 'VoltageOfCode_Bipolar_2sComplement(0x800000) expect -2.500'
whismanoid 61:38ec81c33b7a 3378 // docTest_item['remarks'] = 'Negative Full Scale'
whismanoid 61:38ec81c33b7a 3379 // docTest_item['funcName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 61:38ec81c33b7a 3380 // docTest_item['arglist'] = '0x800000'
whismanoid 61:38ec81c33b7a 3381 // docTest_item['expect-value'] = '-2.500'
whismanoid 61:38ec81c33b7a 3382 #if MAX11410_SELFTEST_BIP2C // group BIP2C VoltageOfCode_Bipolar_2sComplement Negative Full Scale
whismanoid 61:38ec81c33b7a 3383 // call-function
whismanoid 61:38ec81c33b7a 3384 // ASSERT_EQ(g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)0x800000), (double)-2.500); // Negative Full Scale
whismanoid 63:708490d6a29f 3385 tinyTester.FunctionCall_f_lu_Expect("MAX11410.VoltageOfCode_Bipolar_2sComplement", fn_MAX11410_VoltageOfCode_Bipolar_2sComplement, (uint32_t)0x800000, /* expect: */ (double)-2.500); // Negative Full Scale
whismanoid 61:38ec81c33b7a 3386 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3387
whismanoid 61:38ec81c33b7a 3388 // @test group BIP2C tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3389 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3390 // docTest_item['group-id-value'] = 'BIP2C'
whismanoid 61:38ec81c33b7a 3391 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3392 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3393 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3394 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3395 #if MAX11410_SELFTEST_BIP2C // group BIP2C None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3396 // assign-propname-value
whismanoid 61:38ec81c33b7a 3397 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3398 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3399 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3400 #endif // MAX11410_SELFTEST_BIP2C // group BIP2C
whismanoid 61:38ec81c33b7a 3401
whismanoid 61:38ec81c33b7a 3402 // @test group RTD_PT1000 // PT1000 type Resistive Temperature Device (RTD)
whismanoid 61:38ec81c33b7a 3403 // @test group RTD_PT1000 tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3404 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3405 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3406 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3407 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3408 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3409 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3410 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3411 // assign-propname-value
whismanoid 61:38ec81c33b7a 3412 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3413 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3414 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3415 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3416
whismanoid 61:38ec81c33b7a 3417 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(842.94) expect -40.0 within 0.1 // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3418 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3419 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3420 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(842.94) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3421 // docTest_item['remarks'] = 'PT-1000 RTD at -40C'
whismanoid 61:38ec81c33b7a 3422 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3423 // docTest_item['arglist'] = '842.94'
whismanoid 61:38ec81c33b7a 3424 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3425 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3426 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3427 // call-function
whismanoid 61:38ec81c33b7a 3428 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)842.94), (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3429 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3430 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)842.94, /* expect: */ (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3431 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3432
whismanoid 61:38ec81c33b7a 3433 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1000.0) expect 0.0 within 0.1 // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3434 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3435 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3436 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1000.0) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3437 // docTest_item['remarks'] = 'PT-1000 RTD at 0C'
whismanoid 61:38ec81c33b7a 3438 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3439 // docTest_item['arglist'] = '1000.0'
whismanoid 61:38ec81c33b7a 3440 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3441 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3442 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3443 // call-function
whismanoid 61:38ec81c33b7a 3444 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1000.0), (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3445 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3446 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1000.0, /* expect: */ (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3447 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3448
whismanoid 61:38ec81c33b7a 3449 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1097.3) expect 25.0 within 0.1 // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3450 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3451 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3452 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1097.3) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3453 // docTest_item['remarks'] = 'PT-1000 RTD at 25C'
whismanoid 61:38ec81c33b7a 3454 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3455 // docTest_item['arglist'] = '1097.3'
whismanoid 61:38ec81c33b7a 3456 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3457 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3458 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3459 // call-function
whismanoid 61:38ec81c33b7a 3460 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1097.3), (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3461 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3462 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1097.3, /* expect: */ (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3463 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3464
whismanoid 61:38ec81c33b7a 3465 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1328.1) expect 85.0 within 0.1 // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3466 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3467 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3468 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1328.1) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3469 // docTest_item['remarks'] = 'PT-1000 RTD at 85C'
whismanoid 61:38ec81c33b7a 3470 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3471 // docTest_item['arglist'] = '1328.1'
whismanoid 61:38ec81c33b7a 3472 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3473 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3474 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3475 // call-function
whismanoid 61:38ec81c33b7a 3476 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1328.1), (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3477 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3478 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1328.1, /* expect: */ (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3479 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3480
whismanoid 61:38ec81c33b7a 3481 // @test group RTD_PT1000 TemperatureOfRTD_PT1000(1479.5) expect 125.0 within 0.1 // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3482 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3483 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3484 // docTest_item['action'] = 'TemperatureOfRTD_PT1000(1479.5) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3485 // docTest_item['remarks'] = 'PT-1000 RTD at 125C'
whismanoid 61:38ec81c33b7a 3486 // docTest_item['funcName'] = 'TemperatureOfRTD_PT1000'
whismanoid 61:38ec81c33b7a 3487 // docTest_item['arglist'] = '1479.5'
whismanoid 61:38ec81c33b7a 3488 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3489 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3490 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 TemperatureOfRTD_PT1000 PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3491 // call-function
whismanoid 61:38ec81c33b7a 3492 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT1000((double)1479.5), (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3493 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3494 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT1000", fn_MAX11410_TemperatureOfRTD_PT1000, (double)1479.5, /* expect: */ (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3495 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3496
whismanoid 61:38ec81c33b7a 3497 // @test group RTD_PT1000 tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3498 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3499 // docTest_item['group-id-value'] = 'RTD_PT1000'
whismanoid 61:38ec81c33b7a 3500 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3501 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3502 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3503 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3504 #if MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000 None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3505 // assign-propname-value
whismanoid 61:38ec81c33b7a 3506 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3507 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3508 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3509 #endif // MAX11410_SELFTEST_RTD_PT1000 // group RTD_PT1000
whismanoid 61:38ec81c33b7a 3510
whismanoid 61:38ec81c33b7a 3511 // @test group RTD_PT100 // PT100 type Resistive Temperature Device (RTD)
whismanoid 61:38ec81c33b7a 3512 // @test group RTD_PT100 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'] = 'RTD_PT100'
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_RTD_PT100 // group RTD_PT100 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_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3525
whismanoid 61:38ec81c33b7a 3526 // @test group RTD_PT100 TemperatureOfRTD_PT100(84.294) expect -40.0 within 0.1 // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3527 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3528 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3529 // docTest_item['action'] = 'TemperatureOfRTD_PT100(84.294) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3530 // docTest_item['remarks'] = 'PT-100 RTD at -40C'
whismanoid 61:38ec81c33b7a 3531 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3532 // docTest_item['arglist'] = '84.294'
whismanoid 61:38ec81c33b7a 3533 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3534 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3535 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3536 // call-function
whismanoid 61:38ec81c33b7a 3537 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)84.294), (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3538 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3539 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)84.294, /* expect: */ (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3540 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3541
whismanoid 61:38ec81c33b7a 3542 // @test group RTD_PT100 TemperatureOfRTD_PT100(100.00) expect 0.0 within 0.1 // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3543 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3544 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3545 // docTest_item['action'] = 'TemperatureOfRTD_PT100(100.00) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3546 // docTest_item['remarks'] = 'PT-100 RTD at 0C'
whismanoid 61:38ec81c33b7a 3547 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3548 // docTest_item['arglist'] = '100.00'
whismanoid 61:38ec81c33b7a 3549 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3550 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3551 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3552 // call-function
whismanoid 61:38ec81c33b7a 3553 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)100.00), (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3554 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3555 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)100.00, /* expect: */ (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3556 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3557
whismanoid 61:38ec81c33b7a 3558 // @test group RTD_PT100 TemperatureOfRTD_PT100(109.73) expect 25.0 within 0.1 // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3559 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3560 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3561 // docTest_item['action'] = 'TemperatureOfRTD_PT100(109.73) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3562 // docTest_item['remarks'] = 'PT-100 RTD at 25C'
whismanoid 61:38ec81c33b7a 3563 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3564 // docTest_item['arglist'] = '109.73'
whismanoid 61:38ec81c33b7a 3565 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3566 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3567 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3568 // call-function
whismanoid 61:38ec81c33b7a 3569 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)109.73), (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3570 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3571 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)109.73, /* expect: */ (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3572 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3573
whismanoid 61:38ec81c33b7a 3574 // @test group RTD_PT100 TemperatureOfRTD_PT100(132.81) expect 85.0 within 0.1 // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3575 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3576 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3577 // docTest_item['action'] = 'TemperatureOfRTD_PT100(132.81) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3578 // docTest_item['remarks'] = 'PT-100 RTD at 85C'
whismanoid 61:38ec81c33b7a 3579 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3580 // docTest_item['arglist'] = '132.81'
whismanoid 61:38ec81c33b7a 3581 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3582 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3583 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3584 // call-function
whismanoid 61:38ec81c33b7a 3585 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)132.81), (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3586 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3587 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)132.81, /* expect: */ (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3588 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3589
whismanoid 61:38ec81c33b7a 3590 // @test group RTD_PT100 TemperatureOfRTD_PT100(147.95) expect 125.0 within 0.1 // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3591 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3592 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3593 // docTest_item['action'] = 'TemperatureOfRTD_PT100(147.95) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3594 // docTest_item['remarks'] = 'PT-100 RTD at 125C'
whismanoid 61:38ec81c33b7a 3595 // docTest_item['funcName'] = 'TemperatureOfRTD_PT100'
whismanoid 61:38ec81c33b7a 3596 // docTest_item['arglist'] = '147.95'
whismanoid 61:38ec81c33b7a 3597 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3598 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3599 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 TemperatureOfRTD_PT100 PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3600 // call-function
whismanoid 61:38ec81c33b7a 3601 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD_PT100((double)147.95), (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3602 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3603 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD_PT100", fn_MAX11410_TemperatureOfRTD_PT100, (double)147.95, /* expect: */ (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3604 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3605
whismanoid 61:38ec81c33b7a 3606 // @test group RTD_PT100 tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3607 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3608 // docTest_item['group-id-value'] = 'RTD_PT100'
whismanoid 61:38ec81c33b7a 3609 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3610 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3611 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3612 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3613 #if MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100 None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3614 // assign-propname-value
whismanoid 61:38ec81c33b7a 3615 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3616 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3617 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3618 #endif // MAX11410_SELFTEST_RTD_PT100 // group RTD_PT100
whismanoid 61:38ec81c33b7a 3619
whismanoid 61:38ec81c33b7a 3620 // @test group RTD // Verify function TemperatureOfRTD
whismanoid 61:38ec81c33b7a 3621 // @test group RTD tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3622 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3623 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3624 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3625 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3626 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3627 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3628 #if MAX11410_SELFTEST_RTD // group RTD None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3629 // assign-propname-value
whismanoid 61:38ec81c33b7a 3630 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3631 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3632 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3633 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3634
whismanoid 61:38ec81c33b7a 3635 // @test group RTD TemperatureOfRTD(84.294) expect -40.0 within 0.1 // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3636 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3637 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3638 // docTest_item['action'] = 'TemperatureOfRTD(84.294) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3639 // docTest_item['remarks'] = 'PT-100 RTD at -40C'
whismanoid 61:38ec81c33b7a 3640 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3641 // docTest_item['arglist'] = '84.294'
whismanoid 61:38ec81c33b7a 3642 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3643 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3644 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3645 // call-function
whismanoid 61:38ec81c33b7a 3646 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)84.294), (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3647 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3648 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)84.294, /* expect: */ (double)-40.0); // PT-100 RTD at -40C
whismanoid 61:38ec81c33b7a 3649 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3650
whismanoid 61:38ec81c33b7a 3651 // @test group RTD TemperatureOfRTD(100.00) expect 0.0 within 0.1 // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3652 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3653 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3654 // docTest_item['action'] = 'TemperatureOfRTD(100.00) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3655 // docTest_item['remarks'] = 'PT-100 RTD at 0C'
whismanoid 61:38ec81c33b7a 3656 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3657 // docTest_item['arglist'] = '100.00'
whismanoid 61:38ec81c33b7a 3658 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3659 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3660 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3661 // call-function
whismanoid 61:38ec81c33b7a 3662 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)100.00), (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3663 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3664 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)100.00, /* expect: */ (double)0.0); // PT-100 RTD at 0C
whismanoid 61:38ec81c33b7a 3665 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3666
whismanoid 61:38ec81c33b7a 3667 // @test group RTD TemperatureOfRTD(109.73) expect 25.0 within 0.1 // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3668 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3669 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3670 // docTest_item['action'] = 'TemperatureOfRTD(109.73) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3671 // docTest_item['remarks'] = 'PT-100 RTD at 25C'
whismanoid 61:38ec81c33b7a 3672 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3673 // docTest_item['arglist'] = '109.73'
whismanoid 61:38ec81c33b7a 3674 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3675 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3676 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3677 // call-function
whismanoid 61:38ec81c33b7a 3678 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)109.73), (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3679 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3680 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)109.73, /* expect: */ (double)25.0); // PT-100 RTD at 25C
whismanoid 61:38ec81c33b7a 3681 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3682
whismanoid 61:38ec81c33b7a 3683 // @test group RTD TemperatureOfRTD(132.81) expect 85.0 within 0.1 // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3684 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3685 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3686 // docTest_item['action'] = 'TemperatureOfRTD(132.81) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3687 // docTest_item['remarks'] = 'PT-100 RTD at 85C'
whismanoid 61:38ec81c33b7a 3688 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3689 // docTest_item['arglist'] = '132.81'
whismanoid 61:38ec81c33b7a 3690 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3691 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3692 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3693 // call-function
whismanoid 61:38ec81c33b7a 3694 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)132.81), (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3695 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3696 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)132.81, /* expect: */ (double)85.0); // PT-100 RTD at 85C
whismanoid 61:38ec81c33b7a 3697 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3698
whismanoid 61:38ec81c33b7a 3699 // @test group RTD TemperatureOfRTD(147.95) expect 125.0 within 0.1 // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3700 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3701 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3702 // docTest_item['action'] = 'TemperatureOfRTD(147.95) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3703 // docTest_item['remarks'] = 'PT-100 RTD at 125C'
whismanoid 61:38ec81c33b7a 3704 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3705 // docTest_item['arglist'] = '147.95'
whismanoid 61:38ec81c33b7a 3706 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3707 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3708 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3709 // call-function
whismanoid 61:38ec81c33b7a 3710 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)147.95), (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3711 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3712 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)147.95, /* expect: */ (double)125.0); // PT-100 RTD at 125C
whismanoid 61:38ec81c33b7a 3713 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3714
whismanoid 61:38ec81c33b7a 3715 // @test group RTD TemperatureOfRTD(842.94) expect -40.0 within 0.1 // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3716 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3717 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3718 // docTest_item['action'] = 'TemperatureOfRTD(842.94) expect -40.0 within 0.1'
whismanoid 61:38ec81c33b7a 3719 // docTest_item['remarks'] = 'PT-1000 RTD at -40C'
whismanoid 61:38ec81c33b7a 3720 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3721 // docTest_item['arglist'] = '842.94'
whismanoid 61:38ec81c33b7a 3722 // docTest_item['expect-value'] = '-40.0'
whismanoid 61:38ec81c33b7a 3723 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3724 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3725 // call-function
whismanoid 61:38ec81c33b7a 3726 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)842.94), (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3727 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3728 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)842.94, /* expect: */ (double)-40.0); // PT-1000 RTD at -40C
whismanoid 61:38ec81c33b7a 3729 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3730
whismanoid 61:38ec81c33b7a 3731 // @test group RTD TemperatureOfRTD(1000.0) expect 0.0 within 0.1 // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3732 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3733 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3734 // docTest_item['action'] = 'TemperatureOfRTD(1000.0) expect 0.0 within 0.1'
whismanoid 61:38ec81c33b7a 3735 // docTest_item['remarks'] = 'PT-1000 RTD at 0C'
whismanoid 61:38ec81c33b7a 3736 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3737 // docTest_item['arglist'] = '1000.0'
whismanoid 61:38ec81c33b7a 3738 // docTest_item['expect-value'] = '0.0'
whismanoid 61:38ec81c33b7a 3739 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3740 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3741 // call-function
whismanoid 61:38ec81c33b7a 3742 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1000.0), (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3743 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3744 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1000.0, /* expect: */ (double)0.0); // PT-1000 RTD at 0C
whismanoid 61:38ec81c33b7a 3745 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3746
whismanoid 61:38ec81c33b7a 3747 // @test group RTD TemperatureOfRTD(1097.3) expect 25.0 within 0.1 // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3748 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3749 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3750 // docTest_item['action'] = 'TemperatureOfRTD(1097.3) expect 25.0 within 0.1'
whismanoid 61:38ec81c33b7a 3751 // docTest_item['remarks'] = 'PT-1000 RTD at 25C'
whismanoid 61:38ec81c33b7a 3752 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3753 // docTest_item['arglist'] = '1097.3'
whismanoid 61:38ec81c33b7a 3754 // docTest_item['expect-value'] = '25.0'
whismanoid 61:38ec81c33b7a 3755 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3756 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3757 // call-function
whismanoid 61:38ec81c33b7a 3758 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1097.3), (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3759 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3760 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1097.3, /* expect: */ (double)25.0); // PT-1000 RTD at 25C
whismanoid 61:38ec81c33b7a 3761 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3762
whismanoid 61:38ec81c33b7a 3763 // @test group RTD TemperatureOfRTD(1328.1) expect 85.0 within 0.1 // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3764 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3765 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3766 // docTest_item['action'] = 'TemperatureOfRTD(1328.1) expect 85.0 within 0.1'
whismanoid 61:38ec81c33b7a 3767 // docTest_item['remarks'] = 'PT-1000 RTD at 85C'
whismanoid 61:38ec81c33b7a 3768 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3769 // docTest_item['arglist'] = '1328.1'
whismanoid 61:38ec81c33b7a 3770 // docTest_item['expect-value'] = '85.0'
whismanoid 61:38ec81c33b7a 3771 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3772 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3773 // call-function
whismanoid 61:38ec81c33b7a 3774 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1328.1), (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3775 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3776 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1328.1, /* expect: */ (double)85.0); // PT-1000 RTD at 85C
whismanoid 61:38ec81c33b7a 3777 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3778
whismanoid 61:38ec81c33b7a 3779 // @test group RTD TemperatureOfRTD(1479.5) expect 125.0 within 0.1 // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3780 // docTest_item['actionType'] = 'call-function'
whismanoid 61:38ec81c33b7a 3781 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3782 // docTest_item['action'] = 'TemperatureOfRTD(1479.5) expect 125.0 within 0.1'
whismanoid 61:38ec81c33b7a 3783 // docTest_item['remarks'] = 'PT-1000 RTD at 125C'
whismanoid 61:38ec81c33b7a 3784 // docTest_item['funcName'] = 'TemperatureOfRTD'
whismanoid 61:38ec81c33b7a 3785 // docTest_item['arglist'] = '1479.5'
whismanoid 61:38ec81c33b7a 3786 // docTest_item['expect-value'] = '125.0'
whismanoid 61:38ec81c33b7a 3787 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3788 #if MAX11410_SELFTEST_RTD // group RTD TemperatureOfRTD PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3789 // call-function
whismanoid 61:38ec81c33b7a 3790 // ASSERT_EQ(g_MAX11410_device.TemperatureOfRTD((double)1479.5), (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3791 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3792 tinyTester.FunctionCall_f_f_Expect("MAX11410.TemperatureOfRTD", fn_MAX11410_TemperatureOfRTD, (double)1479.5, /* expect: */ (double)125.0); // PT-1000 RTD at 125C
whismanoid 61:38ec81c33b7a 3793 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3794
whismanoid 61:38ec81c33b7a 3795 // @test group RTD tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3796 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3797 // docTest_item['group-id-value'] = 'RTD'
whismanoid 61:38ec81c33b7a 3798 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 61:38ec81c33b7a 3799 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 61:38ec81c33b7a 3800 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3801 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 3802 #if MAX11410_SELFTEST_RTD // group RTD None default 75 resume hardware self test
whismanoid 61:38ec81c33b7a 3803 // assign-propname-value
whismanoid 61:38ec81c33b7a 3804 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3805 // tinyTesterPropValue = "75"
whismanoid 61:38ec81c33b7a 3806 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 3807 #endif // MAX11410_SELFTEST_RTD // group RTD
whismanoid 61:38ec81c33b7a 3808
whismanoid 61:38ec81c33b7a 3809 // @test group TC_1 // Verify Thermocouple function TemperatureOfTC_TypeK
whismanoid 61:38ec81c33b7a 3810 // @test group TC_2 // Verify Thermocouple function TemperatureOfTC_TypeK in more detail
whismanoid 61:38ec81c33b7a 3811 // @test group TC_1 tinyTester.blink_time_msec = 20 // quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3812 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 3813 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 61:38ec81c33b7a 3814 // docTest_item['action'] = 'tinyTester.blink_time_msec = 20'
whismanoid 61:38ec81c33b7a 3815 // docTest_item['remarks'] = 'quickly speed through the software verification'
whismanoid 61:38ec81c33b7a 3816 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 61:38ec81c33b7a 3817 // docTest_item['propValue'] = '20'
whismanoid 61:38ec81c33b7a 3818 #if MAX11410_SELFTEST_TC_1 // group TC_1 None quickly speed through the software verification
whismanoid 61:38ec81c33b7a 3819 // assign-propname-value
whismanoid 61:38ec81c33b7a 3820 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 61:38ec81c33b7a 3821 // tinyTesterPropValue = "20"
whismanoid 61:38ec81c33b7a 3822 tinyTester.blink_time_msec = 20;
whismanoid 61:38ec81c33b7a 3823 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 61:38ec81c33b7a 3824
whismanoid 61:38ec81c33b7a 3825 // @test group TC_1 TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1 // TC_TypeK at 0C = 0.000mV
whismanoid 59:c0376adb6ebc 3826 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3827 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3828 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.000e-3) expect 0.0 within 0.1'
whismanoid 59:c0376adb6ebc 3829 // docTest_item['remarks'] = 'TC_TypeK at 0C = 0.000mV'
whismanoid 59:c0376adb6ebc 3830 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3831 // docTest_item['arglist'] = '0.000e-3'
whismanoid 59:c0376adb6ebc 3832 // docTest_item['expect-value'] = '0.0'
whismanoid 59:c0376adb6ebc 3833 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3834 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 0C = 0.000mV
whismanoid 59:c0376adb6ebc 3835 // call-function
whismanoid 59:c0376adb6ebc 3836 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.000e-3), (double)0.0); // TC_TypeK at 0C = 0.000mV
whismanoid 52:d3fb6f1722bf 3837 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3838 tinyTester.FunctionCall_f_f_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 3839 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3840
whismanoid 61:38ec81c33b7a 3841 // @test group TC_1 TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1 // TC_TypeK at 1C = 0.039mV
whismanoid 59:c0376adb6ebc 3842 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3843 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3844 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.039e-3) expect 1.0 within 0.1'
whismanoid 59:c0376adb6ebc 3845 // docTest_item['remarks'] = 'TC_TypeK at 1C = 0.039mV'
whismanoid 59:c0376adb6ebc 3846 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3847 // docTest_item['arglist'] = '0.039e-3'
whismanoid 59:c0376adb6ebc 3848 // docTest_item['expect-value'] = '1.0'
whismanoid 59:c0376adb6ebc 3849 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3850 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 1C = 0.039mV
whismanoid 59:c0376adb6ebc 3851 // call-function
whismanoid 59:c0376adb6ebc 3852 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.039e-3), (double)1.0); // TC_TypeK at 1C = 0.039mV
whismanoid 52:d3fb6f1722bf 3853 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3854 tinyTester.FunctionCall_f_f_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 3855 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 3856
whismanoid 61:38ec81c33b7a 3857 // @test group TC_1 TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1 // TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3858 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3859 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3860 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.079e-3) expect 2.0 within 0.1'
whismanoid 59:c0376adb6ebc 3861 // docTest_item['remarks'] = 'TC_TypeK at 2C = 0.079mV'
whismanoid 59:c0376adb6ebc 3862 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3863 // docTest_item['arglist'] = '0.079e-3'
whismanoid 59:c0376adb6ebc 3864 // docTest_item['expect-value'] = '2.0'
whismanoid 59:c0376adb6ebc 3865 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3866 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3867 // call-function
whismanoid 59:c0376adb6ebc 3868 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.079e-3), (double)2.0); // TC_TypeK at 2C = 0.079mV
whismanoid 59:c0376adb6ebc 3869 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3870 tinyTester.FunctionCall_f_f_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 3871 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3872
whismanoid 61:38ec81c33b7a 3873 // @test group TC_1 TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1 // TC_TypeK at 3C = 0.119mV
whismanoid 59:c0376adb6ebc 3874 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3875 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3876 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.119e-3) expect 3.0 within 0.1'
whismanoid 59:c0376adb6ebc 3877 // docTest_item['remarks'] = 'TC_TypeK at 3C = 0.119mV'
whismanoid 59:c0376adb6ebc 3878 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3879 // docTest_item['arglist'] = '0.119e-3'
whismanoid 59:c0376adb6ebc 3880 // docTest_item['expect-value'] = '3.0'
whismanoid 59:c0376adb6ebc 3881 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3882 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 3C = 0.119mV
whismanoid 59:c0376adb6ebc 3883 // call-function
whismanoid 59:c0376adb6ebc 3884 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.119e-3), (double)3.0); // TC_TypeK at 3C = 0.119mV
whismanoid 52:d3fb6f1722bf 3885 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3886 tinyTester.FunctionCall_f_f_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 3887 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 3888
whismanoid 61:38ec81c33b7a 3889 // @test group TC_2 TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1 // TC_TypeK at 4C = 0.158mV
whismanoid 59:c0376adb6ebc 3890 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3891 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3892 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.158e-3) expect 4.0 within 0.1'
whismanoid 59:c0376adb6ebc 3893 // docTest_item['remarks'] = 'TC_TypeK at 4C = 0.158mV'
whismanoid 59:c0376adb6ebc 3894 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3895 // docTest_item['arglist'] = '0.158e-3'
whismanoid 59:c0376adb6ebc 3896 // docTest_item['expect-value'] = '4.0'
whismanoid 59:c0376adb6ebc 3897 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3898 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 4C = 0.158mV
whismanoid 59:c0376adb6ebc 3899 // call-function
whismanoid 59:c0376adb6ebc 3900 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.158e-3), (double)4.0); // TC_TypeK at 4C = 0.158mV
whismanoid 59:c0376adb6ebc 3901 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3902 tinyTester.FunctionCall_f_f_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 3903 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3904
whismanoid 61:38ec81c33b7a 3905 // @test group TC_2 TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1 // TC_TypeK at 5C = 0.198mV
whismanoid 59:c0376adb6ebc 3906 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3907 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3908 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.198e-3) expect 5.0 within 0.1'
whismanoid 59:c0376adb6ebc 3909 // docTest_item['remarks'] = 'TC_TypeK at 5C = 0.198mV'
whismanoid 59:c0376adb6ebc 3910 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3911 // docTest_item['arglist'] = '0.198e-3'
whismanoid 59:c0376adb6ebc 3912 // docTest_item['expect-value'] = '5.0'
whismanoid 59:c0376adb6ebc 3913 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3914 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 5C = 0.198mV
whismanoid 59:c0376adb6ebc 3915 // call-function
whismanoid 59:c0376adb6ebc 3916 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.198e-3), (double)5.0); // TC_TypeK at 5C = 0.198mV
whismanoid 52:d3fb6f1722bf 3917 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3918 tinyTester.FunctionCall_f_f_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 3919 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3920
whismanoid 61:38ec81c33b7a 3921 // @test group TC_2 TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1 // TC_TypeK at 6C = 0.238mV
whismanoid 59:c0376adb6ebc 3922 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3923 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3924 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.238e-3) expect 6.0 within 0.1'
whismanoid 59:c0376adb6ebc 3925 // docTest_item['remarks'] = 'TC_TypeK at 6C = 0.238mV'
whismanoid 59:c0376adb6ebc 3926 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3927 // docTest_item['arglist'] = '0.238e-3'
whismanoid 59:c0376adb6ebc 3928 // docTest_item['expect-value'] = '6.0'
whismanoid 59:c0376adb6ebc 3929 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3930 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 6C = 0.238mV
whismanoid 59:c0376adb6ebc 3931 // call-function
whismanoid 59:c0376adb6ebc 3932 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.238e-3), (double)6.0); // TC_TypeK at 6C = 0.238mV
whismanoid 52:d3fb6f1722bf 3933 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3934 tinyTester.FunctionCall_f_f_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 3935 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 3936
whismanoid 61:38ec81c33b7a 3937 // @test group TC_2 TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1 // TC_TypeK at 7C = 0.2775mV
whismanoid 59:c0376adb6ebc 3938 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3939 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3940 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.2775e-3) expect 7.0 within 0.1'
whismanoid 59:c0376adb6ebc 3941 // docTest_item['remarks'] = 'TC_TypeK at 7C = 0.2775mV'
whismanoid 59:c0376adb6ebc 3942 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3943 // docTest_item['arglist'] = '0.2775e-3'
whismanoid 59:c0376adb6ebc 3944 // docTest_item['expect-value'] = '7.0'
whismanoid 59:c0376adb6ebc 3945 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3946 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 7C = 0.2775mV
whismanoid 59:c0376adb6ebc 3947 // call-function
whismanoid 59:c0376adb6ebc 3948 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.2775e-3), (double)7.0); // TC_TypeK at 7C = 0.2775mV
whismanoid 52:d3fb6f1722bf 3949 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3950 tinyTester.FunctionCall_f_f_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 3951 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3952
whismanoid 61:38ec81c33b7a 3953 // @test group TC_2 TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1 // TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3954 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3955 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3956 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.317e-3) expect 8.0 within 0.1'
whismanoid 59:c0376adb6ebc 3957 // docTest_item['remarks'] = 'TC_TypeK at 8C = 0.317mV'
whismanoid 59:c0376adb6ebc 3958 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3959 // docTest_item['arglist'] = '0.317e-3'
whismanoid 59:c0376adb6ebc 3960 // docTest_item['expect-value'] = '8.0'
whismanoid 59:c0376adb6ebc 3961 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3962 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3963 // call-function
whismanoid 59:c0376adb6ebc 3964 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.317e-3), (double)8.0); // TC_TypeK at 8C = 0.317mV
whismanoid 59:c0376adb6ebc 3965 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3966 tinyTester.FunctionCall_f_f_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 3967 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3968
whismanoid 61:38ec81c33b7a 3969 // @test group TC_2 TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1 // TC_TypeK at 9C = 0.357mV
whismanoid 59:c0376adb6ebc 3970 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3971 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 3972 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.357e-3) expect 9.0 within 0.1'
whismanoid 59:c0376adb6ebc 3973 // docTest_item['remarks'] = 'TC_TypeK at 9C = 0.357mV'
whismanoid 59:c0376adb6ebc 3974 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3975 // docTest_item['arglist'] = '0.357e-3'
whismanoid 59:c0376adb6ebc 3976 // docTest_item['expect-value'] = '9.0'
whismanoid 59:c0376adb6ebc 3977 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3978 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 9C = 0.357mV
whismanoid 59:c0376adb6ebc 3979 // call-function
whismanoid 59:c0376adb6ebc 3980 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.357e-3), (double)9.0); // TC_TypeK at 9C = 0.357mV
whismanoid 52:d3fb6f1722bf 3981 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3982 tinyTester.FunctionCall_f_f_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 3983 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 3984
whismanoid 61:38ec81c33b7a 3985 // @test group TC_1 TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1 // TC_TypeK at 10C = 0.397mV
whismanoid 59:c0376adb6ebc 3986 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 3987 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 3988 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.397e-3) expect 10.0 within 0.1'
whismanoid 59:c0376adb6ebc 3989 // docTest_item['remarks'] = 'TC_TypeK at 10C = 0.397mV'
whismanoid 59:c0376adb6ebc 3990 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 3991 // docTest_item['arglist'] = '0.397e-3'
whismanoid 59:c0376adb6ebc 3992 // docTest_item['expect-value'] = '10.0'
whismanoid 59:c0376adb6ebc 3993 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 3994 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 10C = 0.397mV
whismanoid 59:c0376adb6ebc 3995 // call-function
whismanoid 59:c0376adb6ebc 3996 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.397e-3), (double)10.0); // TC_TypeK at 10C = 0.397mV
whismanoid 59:c0376adb6ebc 3997 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 3998 tinyTester.FunctionCall_f_f_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 3999 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4000
whismanoid 61:38ec81c33b7a 4001 // @test group TC_1 TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1 // TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 4002 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4003 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4004 // docTest_item['action'] = 'TemperatureOfTC_TypeK(0.798e-3) expect 20.0 within 0.1'
whismanoid 59:c0376adb6ebc 4005 // docTest_item['remarks'] = 'TC_TypeK at 20C = 0.798mV'
whismanoid 59:c0376adb6ebc 4006 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4007 // docTest_item['arglist'] = '0.798e-3'
whismanoid 59:c0376adb6ebc 4008 // docTest_item['expect-value'] = '20.0'
whismanoid 59:c0376adb6ebc 4009 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4010 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 4011 // call-function
whismanoid 59:c0376adb6ebc 4012 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)0.798e-3), (double)20.0); // TC_TypeK at 20C = 0.798mV
whismanoid 59:c0376adb6ebc 4013 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4014 tinyTester.FunctionCall_f_f_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 4015 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4016
whismanoid 61:38ec81c33b7a 4017 // @test group TC_1 TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1 // TC_TypeK at 27C = 1.081mV
whismanoid 59:c0376adb6ebc 4018 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4019 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4020 // docTest_item['action'] = 'TemperatureOfTC_TypeK(1.081e-3) expect 27.0 within 0.1'
whismanoid 59:c0376adb6ebc 4021 // docTest_item['remarks'] = 'TC_TypeK at 27C = 1.081mV'
whismanoid 59:c0376adb6ebc 4022 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4023 // docTest_item['arglist'] = '1.081e-3'
whismanoid 59:c0376adb6ebc 4024 // docTest_item['expect-value'] = '27.0'
whismanoid 59:c0376adb6ebc 4025 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4026 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 27C = 1.081mV
whismanoid 59:c0376adb6ebc 4027 // call-function
whismanoid 59:c0376adb6ebc 4028 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)1.081e-3), (double)27.0); // TC_TypeK at 27C = 1.081mV
whismanoid 52:d3fb6f1722bf 4029 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4030 tinyTester.FunctionCall_f_f_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 4031 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4032
whismanoid 61:38ec81c33b7a 4033 // @test group TC_1 TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1 // TC_TypeK at 30C = 1.203mV
whismanoid 59:c0376adb6ebc 4034 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4035 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4036 // docTest_item['action'] = 'TemperatureOfTC_TypeK(1.203e-3) expect 30.0 within 0.1'
whismanoid 59:c0376adb6ebc 4037 // docTest_item['remarks'] = 'TC_TypeK at 30C = 1.203mV'
whismanoid 59:c0376adb6ebc 4038 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4039 // docTest_item['arglist'] = '1.203e-3'
whismanoid 59:c0376adb6ebc 4040 // docTest_item['expect-value'] = '30.0'
whismanoid 59:c0376adb6ebc 4041 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4042 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 30C = 1.203mV
whismanoid 59:c0376adb6ebc 4043 // call-function
whismanoid 59:c0376adb6ebc 4044 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)1.203e-3), (double)30.0); // TC_TypeK at 30C = 1.203mV
whismanoid 52:d3fb6f1722bf 4045 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4046 tinyTester.FunctionCall_f_f_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 4047 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4048
whismanoid 61:38ec81c33b7a 4049 // @test group TC_1 TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1 // TC_TypeK at 40C = 1.612mV
whismanoid 59:c0376adb6ebc 4050 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4051 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4052 // docTest_item['action'] = 'TemperatureOfTC_TypeK(1.612e-3) expect 40.0 within 0.1'
whismanoid 59:c0376adb6ebc 4053 // docTest_item['remarks'] = 'TC_TypeK at 40C = 1.612mV'
whismanoid 59:c0376adb6ebc 4054 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4055 // docTest_item['arglist'] = '1.612e-3'
whismanoid 59:c0376adb6ebc 4056 // docTest_item['expect-value'] = '40.0'
whismanoid 59:c0376adb6ebc 4057 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4058 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 40C = 1.612mV
whismanoid 59:c0376adb6ebc 4059 // call-function
whismanoid 59:c0376adb6ebc 4060 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)1.612e-3), (double)40.0); // TC_TypeK at 40C = 1.612mV
whismanoid 52:d3fb6f1722bf 4061 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4062 tinyTester.FunctionCall_f_f_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 4063 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4064
whismanoid 61:38ec81c33b7a 4065 // @test group TC_1 TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1 // TC_TypeK at 50C = 2.023mV
whismanoid 59:c0376adb6ebc 4066 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4067 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4068 // docTest_item['action'] = 'TemperatureOfTC_TypeK(2.023e-3) expect 50.0 within 0.1'
whismanoid 59:c0376adb6ebc 4069 // docTest_item['remarks'] = 'TC_TypeK at 50C = 2.023mV'
whismanoid 59:c0376adb6ebc 4070 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4071 // docTest_item['arglist'] = '2.023e-3'
whismanoid 59:c0376adb6ebc 4072 // docTest_item['expect-value'] = '50.0'
whismanoid 59:c0376adb6ebc 4073 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4074 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 50C = 2.023mV
whismanoid 59:c0376adb6ebc 4075 // call-function
whismanoid 59:c0376adb6ebc 4076 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)2.023e-3), (double)50.0); // TC_TypeK at 50C = 2.023mV
whismanoid 52:d3fb6f1722bf 4077 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4078 tinyTester.FunctionCall_f_f_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 4079 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4080
whismanoid 61:38ec81c33b7a 4081 // @test group TC_1 TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1 // TC_TypeK at 60C = 2.436mV
whismanoid 59:c0376adb6ebc 4082 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4083 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4084 // docTest_item['action'] = 'TemperatureOfTC_TypeK(2.436e-3) expect 60.0 within 0.1'
whismanoid 59:c0376adb6ebc 4085 // docTest_item['remarks'] = 'TC_TypeK at 60C = 2.436mV'
whismanoid 59:c0376adb6ebc 4086 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4087 // docTest_item['arglist'] = '2.436e-3'
whismanoid 59:c0376adb6ebc 4088 // docTest_item['expect-value'] = '60.0'
whismanoid 59:c0376adb6ebc 4089 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4090 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 60C = 2.436mV
whismanoid 59:c0376adb6ebc 4091 // call-function
whismanoid 59:c0376adb6ebc 4092 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)2.436e-3), (double)60.0); // TC_TypeK at 60C = 2.436mV
whismanoid 52:d3fb6f1722bf 4093 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4094 tinyTester.FunctionCall_f_f_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 4095 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4096
whismanoid 61:38ec81c33b7a 4097 // @test group TC_1 TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1 // TC_TypeK at 70C = 2.851mV
whismanoid 59:c0376adb6ebc 4098 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4099 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4100 // docTest_item['action'] = 'TemperatureOfTC_TypeK(2.851e-3) expect 70.0 within 0.1'
whismanoid 59:c0376adb6ebc 4101 // docTest_item['remarks'] = 'TC_TypeK at 70C = 2.851mV'
whismanoid 59:c0376adb6ebc 4102 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4103 // docTest_item['arglist'] = '2.851e-3'
whismanoid 59:c0376adb6ebc 4104 // docTest_item['expect-value'] = '70.0'
whismanoid 59:c0376adb6ebc 4105 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4106 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 70C = 2.851mV
whismanoid 59:c0376adb6ebc 4107 // call-function
whismanoid 59:c0376adb6ebc 4108 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)2.851e-3), (double)70.0); // TC_TypeK at 70C = 2.851mV
whismanoid 52:d3fb6f1722bf 4109 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4110 tinyTester.FunctionCall_f_f_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 4111 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4112
whismanoid 61:38ec81c33b7a 4113 // @test group TC_1 TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1 // TC_TypeK at 80C = 3.267mV
whismanoid 59:c0376adb6ebc 4114 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4115 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4116 // docTest_item['action'] = 'TemperatureOfTC_TypeK(3.267e-3) expect 80.0 within 0.1'
whismanoid 59:c0376adb6ebc 4117 // docTest_item['remarks'] = 'TC_TypeK at 80C = 3.267mV'
whismanoid 59:c0376adb6ebc 4118 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4119 // docTest_item['arglist'] = '3.267e-3'
whismanoid 59:c0376adb6ebc 4120 // docTest_item['expect-value'] = '80.0'
whismanoid 59:c0376adb6ebc 4121 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4122 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 80C = 3.267mV
whismanoid 59:c0376adb6ebc 4123 // call-function
whismanoid 59:c0376adb6ebc 4124 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)3.267e-3), (double)80.0); // TC_TypeK at 80C = 3.267mV
whismanoid 52:d3fb6f1722bf 4125 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4126 tinyTester.FunctionCall_f_f_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 4127 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4128
whismanoid 61:38ec81c33b7a 4129 // @test group TC_1 TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1 // TC_TypeK at 90C = 3.682mV
whismanoid 59:c0376adb6ebc 4130 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4131 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4132 // docTest_item['action'] = 'TemperatureOfTC_TypeK(3.682e-3) expect 90.0 within 0.1'
whismanoid 59:c0376adb6ebc 4133 // docTest_item['remarks'] = 'TC_TypeK at 90C = 3.682mV'
whismanoid 59:c0376adb6ebc 4134 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4135 // docTest_item['arglist'] = '3.682e-3'
whismanoid 59:c0376adb6ebc 4136 // docTest_item['expect-value'] = '90.0'
whismanoid 59:c0376adb6ebc 4137 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4138 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 90C = 3.682mV
whismanoid 59:c0376adb6ebc 4139 // call-function
whismanoid 59:c0376adb6ebc 4140 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)3.682e-3), (double)90.0); // TC_TypeK at 90C = 3.682mV
whismanoid 52:d3fb6f1722bf 4141 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4142 tinyTester.FunctionCall_f_f_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 4143 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4144
whismanoid 61:38ec81c33b7a 4145 // @test group TC_1 TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1 // TC_TypeK at 100C = 4.096mV
whismanoid 59:c0376adb6ebc 4146 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4147 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4148 // docTest_item['action'] = 'TemperatureOfTC_TypeK(4.096e-3) expect 100.0 within 0.1'
whismanoid 59:c0376adb6ebc 4149 // docTest_item['remarks'] = 'TC_TypeK at 100C = 4.096mV'
whismanoid 59:c0376adb6ebc 4150 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4151 // docTest_item['arglist'] = '4.096e-3'
whismanoid 59:c0376adb6ebc 4152 // docTest_item['expect-value'] = '100.0'
whismanoid 59:c0376adb6ebc 4153 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4154 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 100C = 4.096mV
whismanoid 59:c0376adb6ebc 4155 // call-function
whismanoid 59:c0376adb6ebc 4156 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)4.096e-3), (double)100.0); // TC_TypeK at 100C = 4.096mV
whismanoid 52:d3fb6f1722bf 4157 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4158 tinyTester.FunctionCall_f_f_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 4159 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4160
whismanoid 61:38ec81c33b7a 4161 // @test group TC_2 TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1 // TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 4162 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4163 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4164 // docTest_item['action'] = 'TemperatureOfTC_TypeK(4.509e-3) expect 110.0 within 0.1'
whismanoid 59:c0376adb6ebc 4165 // docTest_item['remarks'] = 'TC_TypeK at 110C = 4.509mV'
whismanoid 59:c0376adb6ebc 4166 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4167 // docTest_item['arglist'] = '4.509e-3'
whismanoid 59:c0376adb6ebc 4168 // docTest_item['expect-value'] = '110.0'
whismanoid 59:c0376adb6ebc 4169 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4170 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 4171 // call-function
whismanoid 59:c0376adb6ebc 4172 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)4.509e-3), (double)110.0); // TC_TypeK at 110C = 4.509mV
whismanoid 59:c0376adb6ebc 4173 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4174 tinyTester.FunctionCall_f_f_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 4175 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4176
whismanoid 61:38ec81c33b7a 4177 // @test group TC_2 TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1 // TC_TypeK at 120C = 4.920mV
whismanoid 59:c0376adb6ebc 4178 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4179 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4180 // docTest_item['action'] = 'TemperatureOfTC_TypeK(4.920e-3) expect 120.0 within 0.1'
whismanoid 59:c0376adb6ebc 4181 // docTest_item['remarks'] = 'TC_TypeK at 120C = 4.920mV'
whismanoid 59:c0376adb6ebc 4182 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4183 // docTest_item['arglist'] = '4.920e-3'
whismanoid 59:c0376adb6ebc 4184 // docTest_item['expect-value'] = '120.0'
whismanoid 59:c0376adb6ebc 4185 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4186 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 120C = 4.920mV
whismanoid 59:c0376adb6ebc 4187 // call-function
whismanoid 59:c0376adb6ebc 4188 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)4.920e-3), (double)120.0); // TC_TypeK at 120C = 4.920mV
whismanoid 52:d3fb6f1722bf 4189 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4190 tinyTester.FunctionCall_f_f_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 4191 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4192
whismanoid 61:38ec81c33b7a 4193 // @test group TC_2 TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1 // TC_TypeK at 130C = 5.328mV
whismanoid 59:c0376adb6ebc 4194 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4195 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4196 // docTest_item['action'] = 'TemperatureOfTC_TypeK(5.328e-3) expect 130.0 within 0.1'
whismanoid 59:c0376adb6ebc 4197 // docTest_item['remarks'] = 'TC_TypeK at 130C = 5.328mV'
whismanoid 59:c0376adb6ebc 4198 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4199 // docTest_item['arglist'] = '5.328e-3'
whismanoid 59:c0376adb6ebc 4200 // docTest_item['expect-value'] = '130.0'
whismanoid 59:c0376adb6ebc 4201 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4202 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 130C = 5.328mV
whismanoid 59:c0376adb6ebc 4203 // call-function
whismanoid 59:c0376adb6ebc 4204 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)5.328e-3), (double)130.0); // TC_TypeK at 130C = 5.328mV
whismanoid 52:d3fb6f1722bf 4205 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4206 tinyTester.FunctionCall_f_f_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 4207 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4208
whismanoid 61:38ec81c33b7a 4209 // @test group TC_2 TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1 // TC_TypeK at 140C = 5.735mV
whismanoid 59:c0376adb6ebc 4210 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4211 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4212 // docTest_item['action'] = 'TemperatureOfTC_TypeK(5.735e-3) expect 140.0 within 0.1'
whismanoid 59:c0376adb6ebc 4213 // docTest_item['remarks'] = 'TC_TypeK at 140C = 5.735mV'
whismanoid 59:c0376adb6ebc 4214 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4215 // docTest_item['arglist'] = '5.735e-3'
whismanoid 59:c0376adb6ebc 4216 // docTest_item['expect-value'] = '140.0'
whismanoid 59:c0376adb6ebc 4217 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4218 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 140C = 5.735mV
whismanoid 59:c0376adb6ebc 4219 // call-function
whismanoid 59:c0376adb6ebc 4220 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)5.735e-3), (double)140.0); // TC_TypeK at 140C = 5.735mV
whismanoid 52:d3fb6f1722bf 4221 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4222 tinyTester.FunctionCall_f_f_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 4223 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4224
whismanoid 61:38ec81c33b7a 4225 // @test group TC_2 TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1 // TC_TypeK at 150C = 6.138mV
whismanoid 59:c0376adb6ebc 4226 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4227 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4228 // docTest_item['action'] = 'TemperatureOfTC_TypeK(6.138e-3) expect 150.0 within 0.1'
whismanoid 59:c0376adb6ebc 4229 // docTest_item['remarks'] = 'TC_TypeK at 150C = 6.138mV'
whismanoid 59:c0376adb6ebc 4230 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4231 // docTest_item['arglist'] = '6.138e-3'
whismanoid 59:c0376adb6ebc 4232 // docTest_item['expect-value'] = '150.0'
whismanoid 59:c0376adb6ebc 4233 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4234 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 150C = 6.138mV
whismanoid 59:c0376adb6ebc 4235 // call-function
whismanoid 59:c0376adb6ebc 4236 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)6.138e-3), (double)150.0); // TC_TypeK at 150C = 6.138mV
whismanoid 52:d3fb6f1722bf 4237 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4238 tinyTester.FunctionCall_f_f_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 4239 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4240
whismanoid 61:38ec81c33b7a 4241 // @test group TC_2 TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1 // TC_TypeK at 160C = 6.540mV
whismanoid 59:c0376adb6ebc 4242 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4243 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4244 // docTest_item['action'] = 'TemperatureOfTC_TypeK(6.540e-3) expect 160.0 within 0.1'
whismanoid 59:c0376adb6ebc 4245 // docTest_item['remarks'] = 'TC_TypeK at 160C = 6.540mV'
whismanoid 59:c0376adb6ebc 4246 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4247 // docTest_item['arglist'] = '6.540e-3'
whismanoid 59:c0376adb6ebc 4248 // docTest_item['expect-value'] = '160.0'
whismanoid 59:c0376adb6ebc 4249 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4250 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 160C = 6.540mV
whismanoid 59:c0376adb6ebc 4251 // call-function
whismanoid 59:c0376adb6ebc 4252 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)6.540e-3), (double)160.0); // TC_TypeK at 160C = 6.540mV
whismanoid 52:d3fb6f1722bf 4253 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4254 tinyTester.FunctionCall_f_f_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 4255 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4256
whismanoid 61:38ec81c33b7a 4257 // @test group TC_2 TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1 // TC_TypeK at 170C = 6.941mV
whismanoid 59:c0376adb6ebc 4258 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4259 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4260 // docTest_item['action'] = 'TemperatureOfTC_TypeK(6.941e-3) expect 170.0 within 0.1'
whismanoid 59:c0376adb6ebc 4261 // docTest_item['remarks'] = 'TC_TypeK at 170C = 6.941mV'
whismanoid 59:c0376adb6ebc 4262 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4263 // docTest_item['arglist'] = '6.941e-3'
whismanoid 59:c0376adb6ebc 4264 // docTest_item['expect-value'] = '170.0'
whismanoid 59:c0376adb6ebc 4265 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4266 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 170C = 6.941mV
whismanoid 59:c0376adb6ebc 4267 // call-function
whismanoid 59:c0376adb6ebc 4268 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)6.941e-3), (double)170.0); // TC_TypeK at 170C = 6.941mV
whismanoid 52:d3fb6f1722bf 4269 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4270 tinyTester.FunctionCall_f_f_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 4271 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4272
whismanoid 61:38ec81c33b7a 4273 // @test group TC_2 TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1 // TC_TypeK at 180C = 7.340mV
whismanoid 59:c0376adb6ebc 4274 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4275 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4276 // docTest_item['action'] = 'TemperatureOfTC_TypeK(7.340e-3) expect 180.0 within 0.1'
whismanoid 59:c0376adb6ebc 4277 // docTest_item['remarks'] = 'TC_TypeK at 180C = 7.340mV'
whismanoid 59:c0376adb6ebc 4278 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4279 // docTest_item['arglist'] = '7.340e-3'
whismanoid 59:c0376adb6ebc 4280 // docTest_item['expect-value'] = '180.0'
whismanoid 59:c0376adb6ebc 4281 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4282 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 180C = 7.340mV
whismanoid 59:c0376adb6ebc 4283 // call-function
whismanoid 59:c0376adb6ebc 4284 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)7.340e-3), (double)180.0); // TC_TypeK at 180C = 7.340mV
whismanoid 52:d3fb6f1722bf 4285 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4286 tinyTester.FunctionCall_f_f_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 4287 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4288
whismanoid 61:38ec81c33b7a 4289 // @test group TC_1 TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1 // TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 4290 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4291 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4292 // docTest_item['action'] = 'TemperatureOfTC_TypeK(7.739e-3) expect 190.0 within 0.1'
whismanoid 59:c0376adb6ebc 4293 // docTest_item['remarks'] = 'TC_TypeK at 190C = 7.739mV'
whismanoid 59:c0376adb6ebc 4294 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4295 // docTest_item['arglist'] = '7.739e-3'
whismanoid 59:c0376adb6ebc 4296 // docTest_item['expect-value'] = '190.0'
whismanoid 59:c0376adb6ebc 4297 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4298 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 4299 // call-function
whismanoid 59:c0376adb6ebc 4300 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)7.739e-3), (double)190.0); // TC_TypeK at 190C = 7.739mV
whismanoid 59:c0376adb6ebc 4301 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4302 tinyTester.FunctionCall_f_f_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 4303 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4304
whismanoid 61:38ec81c33b7a 4305 // @test group TC_1 TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1 // TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4306 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4307 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4308 // docTest_item['action'] = 'TemperatureOfTC_TypeK(8.138e-3) expect 200.0 within 0.1'
whismanoid 59:c0376adb6ebc 4309 // docTest_item['remarks'] = 'TC_TypeK at 200C = 8.138mV'
whismanoid 59:c0376adb6ebc 4310 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4311 // docTest_item['arglist'] = '8.138e-3'
whismanoid 59:c0376adb6ebc 4312 // docTest_item['expect-value'] = '200.0'
whismanoid 59:c0376adb6ebc 4313 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4314 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4315 // call-function
whismanoid 59:c0376adb6ebc 4316 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)8.138e-3), (double)200.0); // TC_TypeK at 200C = 8.138mV
whismanoid 59:c0376adb6ebc 4317 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4318 tinyTester.FunctionCall_f_f_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 4319 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4320
whismanoid 61:38ec81c33b7a 4321 // @test group TC_1 TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1 // TC_TypeK at 210C = 8.539mV
whismanoid 59:c0376adb6ebc 4322 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4323 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4324 // docTest_item['action'] = 'TemperatureOfTC_TypeK(8.539e-3) expect 210.0 within 0.1'
whismanoid 59:c0376adb6ebc 4325 // docTest_item['remarks'] = 'TC_TypeK at 210C = 8.539mV'
whismanoid 59:c0376adb6ebc 4326 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4327 // docTest_item['arglist'] = '8.539e-3'
whismanoid 59:c0376adb6ebc 4328 // docTest_item['expect-value'] = '210.0'
whismanoid 59:c0376adb6ebc 4329 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4330 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 210C = 8.539mV
whismanoid 59:c0376adb6ebc 4331 // call-function
whismanoid 59:c0376adb6ebc 4332 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)8.539e-3), (double)210.0); // TC_TypeK at 210C = 8.539mV
whismanoid 52:d3fb6f1722bf 4333 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4334 tinyTester.FunctionCall_f_f_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 4335 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4336
whismanoid 61:38ec81c33b7a 4337 // @test group TC_1 TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1 // TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4338 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4339 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4340 // docTest_item['action'] = 'TemperatureOfTC_TypeK(8.940e-3) expect 220.0 within 0.1'
whismanoid 59:c0376adb6ebc 4341 // docTest_item['remarks'] = 'TC_TypeK at 220C = 8.940mV'
whismanoid 59:c0376adb6ebc 4342 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4343 // docTest_item['arglist'] = '8.940e-3'
whismanoid 59:c0376adb6ebc 4344 // docTest_item['expect-value'] = '220.0'
whismanoid 59:c0376adb6ebc 4345 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4346 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4347 // call-function
whismanoid 59:c0376adb6ebc 4348 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)8.940e-3), (double)220.0); // TC_TypeK at 220C = 8.940mV
whismanoid 59:c0376adb6ebc 4349 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4350 tinyTester.FunctionCall_f_f_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 4351 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4352
whismanoid 61:38ec81c33b7a 4353 // @test group TC_2 TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1 // TC_TypeK at 230C = 9.343mV
whismanoid 59:c0376adb6ebc 4354 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4355 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4356 // docTest_item['action'] = 'TemperatureOfTC_TypeK(9.343e-3) expect 230.0 within 0.1'
whismanoid 59:c0376adb6ebc 4357 // docTest_item['remarks'] = 'TC_TypeK at 230C = 9.343mV'
whismanoid 59:c0376adb6ebc 4358 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4359 // docTest_item['arglist'] = '9.343e-3'
whismanoid 59:c0376adb6ebc 4360 // docTest_item['expect-value'] = '230.0'
whismanoid 59:c0376adb6ebc 4361 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4362 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 230C = 9.343mV
whismanoid 59:c0376adb6ebc 4363 // call-function
whismanoid 59:c0376adb6ebc 4364 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)9.343e-3), (double)230.0); // TC_TypeK at 230C = 9.343mV
whismanoid 59:c0376adb6ebc 4365 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4366 tinyTester.FunctionCall_f_f_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 4367 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4368
whismanoid 61:38ec81c33b7a 4369 // @test group TC_2 TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1 // TC_TypeK at 240C = 9.747mV
whismanoid 59:c0376adb6ebc 4370 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4371 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4372 // docTest_item['action'] = 'TemperatureOfTC_TypeK(9.747e-3) expect 240.0 within 0.1'
whismanoid 59:c0376adb6ebc 4373 // docTest_item['remarks'] = 'TC_TypeK at 240C = 9.747mV'
whismanoid 59:c0376adb6ebc 4374 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4375 // docTest_item['arglist'] = '9.747e-3'
whismanoid 59:c0376adb6ebc 4376 // docTest_item['expect-value'] = '240.0'
whismanoid 59:c0376adb6ebc 4377 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4378 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 240C = 9.747mV
whismanoid 59:c0376adb6ebc 4379 // call-function
whismanoid 59:c0376adb6ebc 4380 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)9.747e-3), (double)240.0); // TC_TypeK at 240C = 9.747mV
whismanoid 52:d3fb6f1722bf 4381 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4382 tinyTester.FunctionCall_f_f_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 4383 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4384
whismanoid 61:38ec81c33b7a 4385 // @test group TC_2 TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1 // TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4386 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4387 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4388 // docTest_item['action'] = 'TemperatureOfTC_TypeK(10.153e-3) expect 250.0 within 0.1'
whismanoid 59:c0376adb6ebc 4389 // docTest_item['remarks'] = 'TC_TypeK at 250C = 10.153mV'
whismanoid 59:c0376adb6ebc 4390 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4391 // docTest_item['arglist'] = '10.153e-3'
whismanoid 59:c0376adb6ebc 4392 // docTest_item['expect-value'] = '250.0'
whismanoid 59:c0376adb6ebc 4393 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4394 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4395 // call-function
whismanoid 59:c0376adb6ebc 4396 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)10.153e-3), (double)250.0); // TC_TypeK at 250C = 10.153mV
whismanoid 59:c0376adb6ebc 4397 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4398 tinyTester.FunctionCall_f_f_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 4399 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4400
whismanoid 61:38ec81c33b7a 4401 // @test group TC_2 TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1 // TC_TypeK at 260C = 10.561mV
whismanoid 59:c0376adb6ebc 4402 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4403 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4404 // docTest_item['action'] = 'TemperatureOfTC_TypeK(10.561e-3) expect 260.0 within 0.1'
whismanoid 59:c0376adb6ebc 4405 // docTest_item['remarks'] = 'TC_TypeK at 260C = 10.561mV'
whismanoid 59:c0376adb6ebc 4406 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4407 // docTest_item['arglist'] = '10.561e-3'
whismanoid 59:c0376adb6ebc 4408 // docTest_item['expect-value'] = '260.0'
whismanoid 59:c0376adb6ebc 4409 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4410 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 260C = 10.561mV
whismanoid 59:c0376adb6ebc 4411 // call-function
whismanoid 59:c0376adb6ebc 4412 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)10.561e-3), (double)260.0); // TC_TypeK at 260C = 10.561mV
whismanoid 59:c0376adb6ebc 4413 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4414 tinyTester.FunctionCall_f_f_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 4415 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4416
whismanoid 61:38ec81c33b7a 4417 // @test group TC_2 TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1 // TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4418 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4419 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4420 // docTest_item['action'] = 'TemperatureOfTC_TypeK(10.971e-3) expect 270.0 within 0.1'
whismanoid 59:c0376adb6ebc 4421 // docTest_item['remarks'] = 'TC_TypeK at 270C = 10.971mV'
whismanoid 59:c0376adb6ebc 4422 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4423 // docTest_item['arglist'] = '10.971e-3'
whismanoid 59:c0376adb6ebc 4424 // docTest_item['expect-value'] = '270.0'
whismanoid 59:c0376adb6ebc 4425 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4426 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4427 // call-function
whismanoid 59:c0376adb6ebc 4428 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)10.971e-3), (double)270.0); // TC_TypeK at 270C = 10.971mV
whismanoid 59:c0376adb6ebc 4429 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4430 tinyTester.FunctionCall_f_f_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 4431 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4432
whismanoid 61:38ec81c33b7a 4433 // @test group TC_2 TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1 // TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4434 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4435 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4436 // docTest_item['action'] = 'TemperatureOfTC_TypeK(11.382e-3) expect 280.0 within 0.1'
whismanoid 59:c0376adb6ebc 4437 // docTest_item['remarks'] = 'TC_TypeK at 280C = 11.382mV'
whismanoid 59:c0376adb6ebc 4438 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4439 // docTest_item['arglist'] = '11.382e-3'
whismanoid 59:c0376adb6ebc 4440 // docTest_item['expect-value'] = '280.0'
whismanoid 59:c0376adb6ebc 4441 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4442 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4443 // call-function
whismanoid 59:c0376adb6ebc 4444 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)11.382e-3), (double)280.0); // TC_TypeK at 280C = 11.382mV
whismanoid 59:c0376adb6ebc 4445 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4446 tinyTester.FunctionCall_f_f_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 4447 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4448
whismanoid 61:38ec81c33b7a 4449 // @test group TC_2 TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1 // TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4450 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4451 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4452 // docTest_item['action'] = 'TemperatureOfTC_TypeK(11.795e-3) expect 290.0 within 0.1'
whismanoid 59:c0376adb6ebc 4453 // docTest_item['remarks'] = 'TC_TypeK at 290C = 11.795mV'
whismanoid 59:c0376adb6ebc 4454 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4455 // docTest_item['arglist'] = '11.795e-3'
whismanoid 59:c0376adb6ebc 4456 // docTest_item['expect-value'] = '290.0'
whismanoid 59:c0376adb6ebc 4457 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4458 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4459 // call-function
whismanoid 59:c0376adb6ebc 4460 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)11.795e-3), (double)290.0); // TC_TypeK at 290C = 11.795mV
whismanoid 59:c0376adb6ebc 4461 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4462 tinyTester.FunctionCall_f_f_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 4463 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 59:c0376adb6ebc 4464
whismanoid 61:38ec81c33b7a 4465 // @test group TC_1 TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1 // TC_TypeK at 300C = 12.209mV
whismanoid 59:c0376adb6ebc 4466 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4467 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4468 // docTest_item['action'] = 'TemperatureOfTC_TypeK(12.209e-3) expect 300.0 within 0.1'
whismanoid 59:c0376adb6ebc 4469 // docTest_item['remarks'] = 'TC_TypeK at 300C = 12.209mV'
whismanoid 59:c0376adb6ebc 4470 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4471 // docTest_item['arglist'] = '12.209e-3'
whismanoid 59:c0376adb6ebc 4472 // docTest_item['expect-value'] = '300.0'
whismanoid 59:c0376adb6ebc 4473 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4474 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 300C = 12.209mV
whismanoid 59:c0376adb6ebc 4475 // call-function
whismanoid 59:c0376adb6ebc 4476 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)12.209e-3), (double)300.0); // TC_TypeK at 300C = 12.209mV
whismanoid 52:d3fb6f1722bf 4477 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4478 tinyTester.FunctionCall_f_f_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 4479 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4480
whismanoid 61:38ec81c33b7a 4481 // @test group TC_2 TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1 // TC_TypeK at 350C = 14.293mV
whismanoid 59:c0376adb6ebc 4482 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4483 // docTest_item['group-id-value'] = 'TC_2'
whismanoid 59:c0376adb6ebc 4484 // docTest_item['action'] = 'TemperatureOfTC_TypeK(14.293e-3) expect 350.0 within 0.1'
whismanoid 59:c0376adb6ebc 4485 // docTest_item['remarks'] = 'TC_TypeK at 350C = 14.293mV'
whismanoid 59:c0376adb6ebc 4486 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4487 // docTest_item['arglist'] = '14.293e-3'
whismanoid 59:c0376adb6ebc 4488 // docTest_item['expect-value'] = '350.0'
whismanoid 59:c0376adb6ebc 4489 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4490 #if MAX11410_SELFTEST_TC_2 // group TC_2 TemperatureOfTC_TypeK TC_TypeK at 350C = 14.293mV
whismanoid 59:c0376adb6ebc 4491 // call-function
whismanoid 59:c0376adb6ebc 4492 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)14.293e-3), (double)350.0); // TC_TypeK at 350C = 14.293mV
whismanoid 52:d3fb6f1722bf 4493 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4494 tinyTester.FunctionCall_f_f_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 4495 #endif // MAX11410_SELFTEST_TC_2 // group TC_2
whismanoid 52:d3fb6f1722bf 4496
whismanoid 61:38ec81c33b7a 4497 // @test group TC_1 TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1 // TC_TypeK at 400C = 16.397mV
whismanoid 59:c0376adb6ebc 4498 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4499 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4500 // docTest_item['action'] = 'TemperatureOfTC_TypeK(16.397e-3) expect 400.0 within 0.1'
whismanoid 59:c0376adb6ebc 4501 // docTest_item['remarks'] = 'TC_TypeK at 400C = 16.397mV'
whismanoid 59:c0376adb6ebc 4502 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4503 // docTest_item['arglist'] = '16.397e-3'
whismanoid 59:c0376adb6ebc 4504 // docTest_item['expect-value'] = '400.0'
whismanoid 59:c0376adb6ebc 4505 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4506 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 400C = 16.397mV
whismanoid 59:c0376adb6ebc 4507 // call-function
whismanoid 59:c0376adb6ebc 4508 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)16.397e-3), (double)400.0); // TC_TypeK at 400C = 16.397mV
whismanoid 52:d3fb6f1722bf 4509 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4510 tinyTester.FunctionCall_f_f_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 4511 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4512
whismanoid 61:38ec81c33b7a 4513 // @test group TC_1 TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1 // TC_TypeK at 450C = 18.516mV
whismanoid 59:c0376adb6ebc 4514 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4515 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4516 // docTest_item['action'] = 'TemperatureOfTC_TypeK(18.516e-3) expect 450.0 within 0.1'
whismanoid 59:c0376adb6ebc 4517 // docTest_item['remarks'] = 'TC_TypeK at 450C = 18.516mV'
whismanoid 59:c0376adb6ebc 4518 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4519 // docTest_item['arglist'] = '18.516e-3'
whismanoid 59:c0376adb6ebc 4520 // docTest_item['expect-value'] = '450.0'
whismanoid 59:c0376adb6ebc 4521 // docTest_item['within-value'] = '0.1'
whismanoid 61:38ec81c33b7a 4522 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 450C = 18.516mV
whismanoid 59:c0376adb6ebc 4523 // call-function
whismanoid 59:c0376adb6ebc 4524 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)18.516e-3), (double)450.0); // TC_TypeK at 450C = 18.516mV
whismanoid 52:d3fb6f1722bf 4525 tinyTester.err_threshold = 0.1; // within 0.1
whismanoid 63:708490d6a29f 4526 tinyTester.FunctionCall_f_f_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 4527 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4528
whismanoid 61:38ec81c33b7a 4529 // @test group TC_1 TemperatureOfTC_TypeK(20.218e-3) expect 490.0 // TC_TypeK at 490C = 20.218mV
whismanoid 59:c0376adb6ebc 4530 // docTest_item['actionType'] = 'call-function'
whismanoid 59:c0376adb6ebc 4531 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4532 // docTest_item['action'] = 'TemperatureOfTC_TypeK(20.218e-3) expect 490.0'
whismanoid 59:c0376adb6ebc 4533 // docTest_item['remarks'] = 'TC_TypeK at 490C = 20.218mV'
whismanoid 59:c0376adb6ebc 4534 // docTest_item['funcName'] = 'TemperatureOfTC_TypeK'
whismanoid 59:c0376adb6ebc 4535 // docTest_item['arglist'] = '20.218e-3'
whismanoid 59:c0376adb6ebc 4536 // docTest_item['expect-value'] = '490.0'
whismanoid 61:38ec81c33b7a 4537 #if MAX11410_SELFTEST_TC_1 // group TC_1 TemperatureOfTC_TypeK TC_TypeK at 490C = 20.218mV
whismanoid 59:c0376adb6ebc 4538 // call-function
whismanoid 59:c0376adb6ebc 4539 // ASSERT_EQ(g_MAX11410_device.TemperatureOfTC_TypeK((double)20.218e-3), (double)490.0); // TC_TypeK at 490C = 20.218mV
whismanoid 63:708490d6a29f 4540 tinyTester.FunctionCall_f_f_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 4541 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 52:d3fb6f1722bf 4542
whismanoid 61:38ec81c33b7a 4543 // @test group TC_1 tinyTester.blink_time_msec = 75 // default 75 resume hardware self test
whismanoid 59:c0376adb6ebc 4544 // docTest_item['actionType'] = 'assign-propname-value'
whismanoid 61:38ec81c33b7a 4545 // docTest_item['group-id-value'] = 'TC_1'
whismanoid 59:c0376adb6ebc 4546 // docTest_item['action'] = 'tinyTester.blink_time_msec = 75'
whismanoid 59:c0376adb6ebc 4547 // docTest_item['remarks'] = 'default 75 resume hardware self test'
whismanoid 59:c0376adb6ebc 4548 // docTest_item['propName'] = 'tinyTester.blink_time_msec'
whismanoid 59:c0376adb6ebc 4549 // docTest_item['propValue'] = '75'
whismanoid 61:38ec81c33b7a 4550 #if MAX11410_SELFTEST_TC_1 // group TC_1 None default 75 resume hardware self test
whismanoid 59:c0376adb6ebc 4551 // assign-propname-value
whismanoid 59:c0376adb6ebc 4552 // tinyTesterPropName = "tinyTester.blink_time_msec"
whismanoid 59:c0376adb6ebc 4553 // tinyTesterPropValue = "75"
whismanoid 59:c0376adb6ebc 4554 tinyTester.blink_time_msec = 75;
whismanoid 61:38ec81c33b7a 4555 #endif // MAX11410_SELFTEST_TC_1 // group TC_1
whismanoid 59:c0376adb6ebc 4556
whismanoid 52:d3fb6f1722bf 4557 //
whismanoid 52:d3fb6f1722bf 4558 #if INJECT_SELFTEST_FAIL
whismanoid 52:d3fb6f1722bf 4559 // Test of the pass/fail report mechanism
whismanoid 52:d3fb6f1722bf 4560 tinyTester.FAIL();
whismanoid 52:d3fb6f1722bf 4561 cmdLine.serial().print(F("injecting one false failure for test reporting"));
whismanoid 52:d3fb6f1722bf 4562 #endif
whismanoid 52:d3fb6f1722bf 4563 //
whismanoid 52:d3fb6f1722bf 4564 // Report number of pass and number of fail test results
whismanoid 52:d3fb6f1722bf 4565 tinyTester.Report_Summary();
whismanoid 52:d3fb6f1722bf 4566 }
whismanoid 52:d3fb6f1722bf 4567
whismanoid 52:d3fb6f1722bf 4568 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4569 // selfTestFunctionClosures[functionName]['functionName'] = 'Init'
whismanoid 59:c0376adb6ebc 4570 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'void'
whismanoid 59:c0376adb6ebc 4571 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4572 // selfTestFunctionClosures[functionName]['argNames'] = ''
whismanoid 59:c0376adb6ebc 4573 // CommandParamIn_declaration = 'void'
whismanoid 59:c0376adb6ebc 4574 // argNames_recast_implementation = ''
whismanoid 59:c0376adb6ebc 4575 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4576 // selftest: define function under test
whismanoid 59:c0376adb6ebc 4577 // uint8_t MAX11410::Init(void)
whismanoid 59:c0376adb6ebc 4578 uint8_t fn_MAX11410_Init(void)
whismanoid 55:73d886c105f5 4579 {
whismanoid 59:c0376adb6ebc 4580 return g_MAX11410_device.Init();
whismanoid 59:c0376adb6ebc 4581 }
whismanoid 59:c0376adb6ebc 4582
whismanoid 59:c0376adb6ebc 4583 //--------------------------------------------------
whismanoid 60:f38c54a91794 4584 // selfTestFunctionClosures[functionName]['functionName'] = 'RegRead'
whismanoid 60:f38c54a91794 4585 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t* ptrRegData'
whismanoid 60:f38c54a91794 4586 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 60:f38c54a91794 4587 // selfTestFunctionClosures[functionName]['argNames'] = 'commandByte, ptrRegData'
whismanoid 60:f38c54a91794 4588 // CommandParamIn_declaration = 'int commandByte, uint32_t* ptrRegData'
whismanoid 60:f38c54a91794 4589 // argNames_recast_implementation = '(MAX11410::MAX11410_CMD_enum_t)commandByte, /*(uint32_t*) */ ptrRegData'
whismanoid 60:f38c54a91794 4590 //--------------------------------------------------
whismanoid 60:f38c54a91794 4591 // selftest: define function under test
whismanoid 60:f38c54a91794 4592 // uint8_t MAX11410::RegRead(MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t* ptrRegData)
whismanoid 60:f38c54a91794 4593 uint8_t fn_MAX11410_RegRead(int commandByte, uint32_t* ptrRegData)
whismanoid 60:f38c54a91794 4594 {
whismanoid 60:f38c54a91794 4595 return g_MAX11410_device.RegRead((MAX11410::MAX11410_CMD_enum_t)commandByte, /*(uint32_t*) */ ptrRegData);
whismanoid 60:f38c54a91794 4596 }
whismanoid 60:f38c54a91794 4597
whismanoid 60:f38c54a91794 4598 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4599 // selfTestFunctionClosures[functionName]['functionName'] = 'RegWrite'
whismanoid 59:c0376adb6ebc 4600 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t regData'
whismanoid 59:c0376adb6ebc 4601 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4602 // selfTestFunctionClosures[functionName]['argNames'] = 'commandByte, regData'
whismanoid 63:708490d6a29f 4603 // CommandParamIn_declaration = 'int commandByte, uint32_t regData'
whismanoid 59:c0376adb6ebc 4604 // argNames_recast_implementation = '(MAX11410::MAX11410_CMD_enum_t)commandByte, (uint32_t)regData'
whismanoid 59:c0376adb6ebc 4605 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4606 // selftest: define function under test
whismanoid 59:c0376adb6ebc 4607 // uint8_t MAX11410::RegWrite(MAX11410::MAX11410_CMD_enum_t commandByte, uint32_t regData)
whismanoid 63:708490d6a29f 4608 uint8_t fn_MAX11410_RegWrite(int commandByte, uint32_t regData)
whismanoid 59:c0376adb6ebc 4609 {
whismanoid 59:c0376adb6ebc 4610 return g_MAX11410_device.RegWrite((MAX11410::MAX11410_CMD_enum_t)commandByte, (uint32_t)regData);
whismanoid 55:73d886c105f5 4611 }
whismanoid 55:73d886c105f5 4612
whismanoid 55:73d886c105f5 4613 //--------------------------------------------------
whismanoid 63:708490d6a29f 4614 // selfTestFunctionClosures[functionName]['functionName'] = 'Measure_Voltage'
whismanoid 63:708490d6a29f 4615 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'MAX11410::MAX11410_AINP_SEL_enum_t ainp, MAX11410::MAX11410_AINN_SEL_enum_t ainn'
whismanoid 63:708490d6a29f 4616 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 63:708490d6a29f 4617 // selfTestFunctionClosures[functionName]['argNames'] = 'ainp, ainn'
whismanoid 63:708490d6a29f 4618 // CommandParamIn_declaration = 'int ainp, int ainn'
whismanoid 63:708490d6a29f 4619 // argNames_recast_implementation = '(MAX11410::MAX11410_AINP_SEL_enum_t)ainp, (MAX11410::MAX11410_AINN_SEL_enum_t)ainn'
whismanoid 63:708490d6a29f 4620 //--------------------------------------------------
whismanoid 63:708490d6a29f 4621 // selftest: define function under test
whismanoid 63:708490d6a29f 4622 // double MAX11410::Measure_Voltage(MAX11410::MAX11410_AINP_SEL_enum_t ainp, MAX11410::MAX11410_AINN_SEL_enum_t ainn)
whismanoid 63:708490d6a29f 4623 double fn_MAX11410_Measure_Voltage(int ainp, int ainn)
whismanoid 63:708490d6a29f 4624 {
whismanoid 63:708490d6a29f 4625 return g_MAX11410_device.Measure_Voltage((MAX11410::MAX11410_AINP_SEL_enum_t)ainp, (MAX11410::MAX11410_AINN_SEL_enum_t)ainn);
whismanoid 63:708490d6a29f 4626 }
whismanoid 63:708490d6a29f 4627
whismanoid 63:708490d6a29f 4628 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4629 // selfTestFunctionClosures[functionName]['functionName'] = 'Configure_CTRL_REF'
whismanoid 59:c0376adb6ebc 4630 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint8_t ref_sel'
whismanoid 59:c0376adb6ebc 4631 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4632 // selfTestFunctionClosures[functionName]['argNames'] = 'ref_sel'
whismanoid 63:708490d6a29f 4633 // CommandParamIn_declaration = 'uint8_t ref_sel'
whismanoid 59:c0376adb6ebc 4634 // argNames_recast_implementation = '(uint8_t)ref_sel'
whismanoid 59:c0376adb6ebc 4635 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4636 // selftest: define function under test
whismanoid 59:c0376adb6ebc 4637 // uint8_t MAX11410::Configure_CTRL_REF(uint8_t ref_sel)
whismanoid 63:708490d6a29f 4638 uint8_t fn_MAX11410_Configure_CTRL_REF(uint8_t ref_sel)
whismanoid 59:c0376adb6ebc 4639 {
whismanoid 59:c0376adb6ebc 4640 return g_MAX11410_device.Configure_CTRL_REF((uint8_t)ref_sel);
whismanoid 59:c0376adb6ebc 4641 }
whismanoid 59:c0376adb6ebc 4642
whismanoid 59:c0376adb6ebc 4643 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4644 // selfTestFunctionClosures[functionName]['functionName'] = 'Configure_PGA'
whismanoid 59:c0376adb6ebc 4645 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint8_t sigpath, uint8_t gain'
whismanoid 59:c0376adb6ebc 4646 // selfTestFunctionClosures[functionName]['returnType'] = 'uint8_t'
whismanoid 59:c0376adb6ebc 4647 // selfTestFunctionClosures[functionName]['argNames'] = 'sigpath, gain'
whismanoid 63:708490d6a29f 4648 // CommandParamIn_declaration = 'uint8_t sigpath, uint8_t gain'
whismanoid 59:c0376adb6ebc 4649 // argNames_recast_implementation = '(uint8_t)sigpath, (uint8_t)gain'
whismanoid 59:c0376adb6ebc 4650 //--------------------------------------------------
whismanoid 55:73d886c105f5 4651 // selftest: define function under test
whismanoid 56:6e9c52cc9abe 4652 // uint8_t MAX11410::Configure_PGA(uint8_t sigpath, uint8_t gain)
whismanoid 63:708490d6a29f 4653 uint8_t fn_MAX11410_Configure_PGA(uint8_t sigpath, uint8_t gain)
whismanoid 56:6e9c52cc9abe 4654 {
whismanoid 59:c0376adb6ebc 4655 return g_MAX11410_device.Configure_PGA((uint8_t)sigpath, (uint8_t)gain);
whismanoid 56:6e9c52cc9abe 4656 }
whismanoid 56:6e9c52cc9abe 4657
whismanoid 56:6e9c52cc9abe 4658 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4659 // selfTestFunctionClosures[functionName]['functionName'] = 'VoltageOfCode_Unipolar'
whismanoid 59:c0376adb6ebc 4660 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4661 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4662 // selfTestFunctionClosures[functionName]['argNames'] = 'value_u24'
whismanoid 63:708490d6a29f 4663 // CommandParamIn_declaration = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4664 // argNames_recast_implementation = '(uint32_t)value_u24'
whismanoid 59:c0376adb6ebc 4665 //--------------------------------------------------
whismanoid 56:6e9c52cc9abe 4666 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4667 // double MAX11410::VoltageOfCode_Unipolar(uint32_t value_u24)
whismanoid 63:708490d6a29f 4668 double fn_MAX11410_VoltageOfCode_Unipolar(uint32_t value_u24)
whismanoid 52:d3fb6f1722bf 4669 {
whismanoid 59:c0376adb6ebc 4670 return g_MAX11410_device.VoltageOfCode_Unipolar((uint32_t)value_u24);
whismanoid 52:d3fb6f1722bf 4671 }
whismanoid 52:d3fb6f1722bf 4672
whismanoid 52:d3fb6f1722bf 4673 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4674 // selfTestFunctionClosures[functionName]['functionName'] = 'VoltageOfCode_Bipolar_OffsetBinary'
whismanoid 59:c0376adb6ebc 4675 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4676 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4677 // selfTestFunctionClosures[functionName]['argNames'] = 'value_u24'
whismanoid 63:708490d6a29f 4678 // CommandParamIn_declaration = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4679 // argNames_recast_implementation = '(uint32_t)value_u24'
whismanoid 59:c0376adb6ebc 4680 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4681 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4682 // double MAX11410::VoltageOfCode_Bipolar_OffsetBinary(uint32_t value_u24)
whismanoid 63:708490d6a29f 4683 double fn_MAX11410_VoltageOfCode_Bipolar_OffsetBinary(uint32_t value_u24)
whismanoid 52:d3fb6f1722bf 4684 {
whismanoid 59:c0376adb6ebc 4685 return g_MAX11410_device.VoltageOfCode_Bipolar_OffsetBinary((uint32_t)value_u24);
whismanoid 52:d3fb6f1722bf 4686 }
whismanoid 52:d3fb6f1722bf 4687
whismanoid 52:d3fb6f1722bf 4688 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4689 // selfTestFunctionClosures[functionName]['functionName'] = 'VoltageOfCode_Bipolar_2sComplement'
whismanoid 59:c0376adb6ebc 4690 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4691 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 59:c0376adb6ebc 4692 // selfTestFunctionClosures[functionName]['argNames'] = 'value_u24'
whismanoid 63:708490d6a29f 4693 // CommandParamIn_declaration = 'uint32_t value_u24'
whismanoid 59:c0376adb6ebc 4694 // argNames_recast_implementation = '(uint32_t)value_u24'
whismanoid 59:c0376adb6ebc 4695 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4696 // selftest: define function under test
whismanoid 52:d3fb6f1722bf 4697 // double MAX11410::VoltageOfCode_Bipolar_2sComplement(uint32_t value_u24)
whismanoid 63:708490d6a29f 4698 double fn_MAX11410_VoltageOfCode_Bipolar_2sComplement(uint32_t value_u24)
whismanoid 52:d3fb6f1722bf 4699 {
whismanoid 59:c0376adb6ebc 4700 return g_MAX11410_device.VoltageOfCode_Bipolar_2sComplement((uint32_t)value_u24);
whismanoid 52:d3fb6f1722bf 4701 }
whismanoid 52:d3fb6f1722bf 4702
whismanoid 52:d3fb6f1722bf 4703 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4704 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfRTD_PT1000'
whismanoid 63:708490d6a29f 4705 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double rtd_ohm'
whismanoid 59:c0376adb6ebc 4706 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 63:708490d6a29f 4707 // selfTestFunctionClosures[functionName]['argNames'] = 'rtd_ohm'
whismanoid 63:708490d6a29f 4708 // CommandParamIn_declaration = 'double rtd_ohm'
whismanoid 63:708490d6a29f 4709 // argNames_recast_implementation = '(double)rtd_ohm'
whismanoid 59:c0376adb6ebc 4710 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4711 // selftest: define function under test
whismanoid 63:708490d6a29f 4712 // double MAX11410::TemperatureOfRTD_PT1000(double rtd_ohm)
whismanoid 63:708490d6a29f 4713 double fn_MAX11410_TemperatureOfRTD_PT1000(double rtd_ohm)
whismanoid 52:d3fb6f1722bf 4714 {
whismanoid 63:708490d6a29f 4715 return g_MAX11410_device.TemperatureOfRTD_PT1000((double)rtd_ohm);
whismanoid 52:d3fb6f1722bf 4716 }
whismanoid 52:d3fb6f1722bf 4717
whismanoid 52:d3fb6f1722bf 4718 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4719 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfRTD_PT100'
whismanoid 63:708490d6a29f 4720 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double rtd_ohm'
whismanoid 59:c0376adb6ebc 4721 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 63:708490d6a29f 4722 // selfTestFunctionClosures[functionName]['argNames'] = 'rtd_ohm'
whismanoid 63:708490d6a29f 4723 // CommandParamIn_declaration = 'double rtd_ohm'
whismanoid 63:708490d6a29f 4724 // argNames_recast_implementation = '(double)rtd_ohm'
whismanoid 59:c0376adb6ebc 4725 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4726 // selftest: define function under test
whismanoid 63:708490d6a29f 4727 // double MAX11410::TemperatureOfRTD_PT100(double rtd_ohm)
whismanoid 63:708490d6a29f 4728 double fn_MAX11410_TemperatureOfRTD_PT100(double rtd_ohm)
whismanoid 56:6e9c52cc9abe 4729 {
whismanoid 63:708490d6a29f 4730 return g_MAX11410_device.TemperatureOfRTD_PT100((double)rtd_ohm);
whismanoid 56:6e9c52cc9abe 4731 }
whismanoid 56:6e9c52cc9abe 4732
whismanoid 56:6e9c52cc9abe 4733 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4734 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfRTD'
whismanoid 63:708490d6a29f 4735 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double rtd_ohm'
whismanoid 59:c0376adb6ebc 4736 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 63:708490d6a29f 4737 // selfTestFunctionClosures[functionName]['argNames'] = 'rtd_ohm'
whismanoid 63:708490d6a29f 4738 // CommandParamIn_declaration = 'double rtd_ohm'
whismanoid 63:708490d6a29f 4739 // argNames_recast_implementation = '(double)rtd_ohm'
whismanoid 59:c0376adb6ebc 4740 //--------------------------------------------------
whismanoid 56:6e9c52cc9abe 4741 // selftest: define function under test
whismanoid 63:708490d6a29f 4742 // double MAX11410::TemperatureOfRTD(double rtd_ohm)
whismanoid 63:708490d6a29f 4743 double fn_MAX11410_TemperatureOfRTD(double rtd_ohm)
whismanoid 56:6e9c52cc9abe 4744 {
whismanoid 63:708490d6a29f 4745 return g_MAX11410_device.TemperatureOfRTD((double)rtd_ohm);
whismanoid 56:6e9c52cc9abe 4746 }
whismanoid 56:6e9c52cc9abe 4747
whismanoid 56:6e9c52cc9abe 4748 //--------------------------------------------------
whismanoid 59:c0376adb6ebc 4749 // selfTestFunctionClosures[functionName]['functionName'] = 'TemperatureOfTC_TypeK'
whismanoid 63:708490d6a29f 4750 // selfTestFunctionClosures[functionName]['argListDeclaration'] = 'double tc_v'
whismanoid 59:c0376adb6ebc 4751 // selfTestFunctionClosures[functionName]['returnType'] = 'double'
whismanoid 63:708490d6a29f 4752 // selfTestFunctionClosures[functionName]['argNames'] = 'tc_v'
whismanoid 63:708490d6a29f 4753 // CommandParamIn_declaration = 'double tc_v'
whismanoid 63:708490d6a29f 4754 // argNames_recast_implementation = '(double)tc_v'
whismanoid 59:c0376adb6ebc 4755 //--------------------------------------------------
whismanoid 56:6e9c52cc9abe 4756 // selftest: define function under test
whismanoid 63:708490d6a29f 4757 // double MAX11410::TemperatureOfTC_TypeK(double tc_v)
whismanoid 63:708490d6a29f 4758 double fn_MAX11410_TemperatureOfTC_TypeK(double tc_v)
whismanoid 52:d3fb6f1722bf 4759 {
whismanoid 63:708490d6a29f 4760 return g_MAX11410_device.TemperatureOfTC_TypeK((double)tc_v);
whismanoid 52:d3fb6f1722bf 4761 }
whismanoid 52:d3fb6f1722bf 4762
whismanoid 52:d3fb6f1722bf 4763
whismanoid 52:d3fb6f1722bf 4764 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4765 inline void print_command_prompt()
whismanoid 52:d3fb6f1722bf 4766 {
whismanoid 52:d3fb6f1722bf 4767 cmdLine_serial.serial().printf("\r\n> ");
whismanoid 52:d3fb6f1722bf 4768
whismanoid 52:d3fb6f1722bf 4769 }
whismanoid 52:d3fb6f1722bf 4770
whismanoid 52:d3fb6f1722bf 4771
whismanoid 52:d3fb6f1722bf 4772 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 4773 void pinsMonitor_submenu_onEOLcommandParser(CmdLine& cmdLine)
whismanoid 52:d3fb6f1722bf 4774 {
whismanoid 52:d3fb6f1722bf 4775 // % diagnostic commands submenu
whismanoid 52:d3fb6f1722bf 4776 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 4777 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 4778 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 4779 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 4780 // %Ppin df=xx -- pwm output
whismanoid 52:d3fb6f1722bf 4781 // %Wpin -- measure high pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 4782 // %wpin -- measure low pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 4783 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 4784 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 4785 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 4786 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 4787 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 4788 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 4789 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 4790 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 4791 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 4792 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 4793 // A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 4794 //
whismanoid 52:d3fb6f1722bf 4795 char strPinIndex[3];
whismanoid 52:d3fb6f1722bf 4796 strPinIndex[0] = cmdLine[2];
whismanoid 52:d3fb6f1722bf 4797 strPinIndex[1] = cmdLine[3];
whismanoid 52:d3fb6f1722bf 4798 strPinIndex[2] = '\0';
whismanoid 52:d3fb6f1722bf 4799 int pinIndex = strtoul(strPinIndex, NULL, 10); // strtol(str, NULL, 10): get decimal value
whismanoid 52:d3fb6f1722bf 4800 //cmdLine.serial().printf(" pinIndex=%d ", pinIndex);
whismanoid 52:d3fb6f1722bf 4801 //
whismanoid 52:d3fb6f1722bf 4802 // get next character
whismanoid 52:d3fb6f1722bf 4803 switch (cmdLine[1])
whismanoid 52:d3fb6f1722bf 4804 {
whismanoid 52:d3fb6f1722bf 4805 #if HAS_digitalInOuts
whismanoid 52:d3fb6f1722bf 4806 case 'H': case 'h':
whismanoid 52:d3fb6f1722bf 4807 {
whismanoid 52:d3fb6f1722bf 4808 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 4809 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4810 pinMode(pinIndex, OUTPUT); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4811 digitalWrite(pinIndex, HIGH); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4812 #else
whismanoid 52:d3fb6f1722bf 4813 DigitalInOut& digitalInOutPin = find_digitalInOutPin(pinIndex);
whismanoid 52:d3fb6f1722bf 4814 digitalInOutPin.output();
whismanoid 52:d3fb6f1722bf 4815 digitalInOutPin.write(1);
whismanoid 52:d3fb6f1722bf 4816 #endif
whismanoid 52:d3fb6f1722bf 4817 cmdLine.serial().printf(" digitalInOutPin %d Output High ", pinIndex);
whismanoid 52:d3fb6f1722bf 4818 }
whismanoid 52:d3fb6f1722bf 4819 break;
whismanoid 52:d3fb6f1722bf 4820 case 'L': case 'l':
whismanoid 52:d3fb6f1722bf 4821 {
whismanoid 52:d3fb6f1722bf 4822 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 4823 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4824 pinMode(pinIndex, OUTPUT); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4825 digitalWrite(pinIndex, LOW); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4826 #else
whismanoid 52:d3fb6f1722bf 4827 DigitalInOut& digitalInOutPin = find_digitalInOutPin(pinIndex);
whismanoid 52:d3fb6f1722bf 4828 digitalInOutPin.output();
whismanoid 52:d3fb6f1722bf 4829 digitalInOutPin.write(0);
whismanoid 52:d3fb6f1722bf 4830 #endif
whismanoid 52:d3fb6f1722bf 4831 cmdLine.serial().printf(" digitalInOutPin %d Output Low ", pinIndex);
whismanoid 52:d3fb6f1722bf 4832 }
whismanoid 52:d3fb6f1722bf 4833 break;
whismanoid 52:d3fb6f1722bf 4834 case '?':
whismanoid 52:d3fb6f1722bf 4835 {
whismanoid 52:d3fb6f1722bf 4836 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 4837 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4838 pinMode(pinIndex, INPUT); // digital pins 0, 1, 2, .. 13, analog input pins A0, A1, .. A5
whismanoid 52:d3fb6f1722bf 4839 #else
whismanoid 52:d3fb6f1722bf 4840 DigitalInOut& digitalInOutPin = find_digitalInOutPin(pinIndex);
whismanoid 52:d3fb6f1722bf 4841 digitalInOutPin.input();
whismanoid 52:d3fb6f1722bf 4842 #endif
whismanoid 52:d3fb6f1722bf 4843 serial.printf(" digitalInOutPin %d Input ", pinIndex);
whismanoid 52:d3fb6f1722bf 4844 #if ARDUINO_STYLE
whismanoid 52:d3fb6f1722bf 4845 int value = digitalRead(pinIndex);
whismanoid 52:d3fb6f1722bf 4846 #else
whismanoid 52:d3fb6f1722bf 4847 int value = digitalInOutPin.read();
whismanoid 52:d3fb6f1722bf 4848 #endif
whismanoid 52:d3fb6f1722bf 4849 cmdLine.serial().printf("%d ", value);
whismanoid 52:d3fb6f1722bf 4850 }
whismanoid 52:d3fb6f1722bf 4851 break;
whismanoid 52:d3fb6f1722bf 4852 #endif
whismanoid 52:d3fb6f1722bf 4853 //
whismanoid 52:d3fb6f1722bf 4854 #if HAS_analogIns
whismanoid 52:d3fb6f1722bf 4855 case 'A': case 'a':
whismanoid 52:d3fb6f1722bf 4856 {
whismanoid 52:d3fb6f1722bf 4857 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 4858 #if analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 4859 // Platform board uses AIN4,AIN5,.. as high range of AIN0,AIN1,..
whismanoid 52:d3fb6f1722bf 4860 for (int pinIndex = 0; pinIndex < 2; pinIndex++)
whismanoid 52:d3fb6f1722bf 4861 {
whismanoid 52:d3fb6f1722bf 4862 int cPinIndex = '0' + pinIndex;
whismanoid 52:d3fb6f1722bf 4863 AnalogIn& analogInPin = find_analogInPin(cPinIndex);
whismanoid 52:d3fb6f1722bf 4864 float adc_full_scale_voltage = analogInPin_fullScaleVoltage[pinIndex];
whismanoid 52:d3fb6f1722bf 4865 float normValue_0_1 = analogInPin.read();
whismanoid 52:d3fb6f1722bf 4866 //
whismanoid 52:d3fb6f1722bf 4867 int pinIndexH = pinIndex + 4;
whismanoid 52:d3fb6f1722bf 4868 int cPinIndexH = '0' + pinIndexH;
whismanoid 52:d3fb6f1722bf 4869 AnalogIn& analogInPinH = find_analogInPin(cPinIndexH);
whismanoid 52:d3fb6f1722bf 4870 float adc_full_scale_voltageH = analogInPin_fullScaleVoltage[pinIndexH];
whismanoid 52:d3fb6f1722bf 4871 float normValueH_0_1 = analogInPinH.read();
whismanoid 52:d3fb6f1722bf 4872 //
whismanoid 52:d3fb6f1722bf 4873 cmdLine.serial().printf("AIN%c = %7.3f%% = %1.3fV AIN%c = %7.3f%% = %1.3fV \r\n",
whismanoid 52:d3fb6f1722bf 4874 cPinIndex,
whismanoid 52:d3fb6f1722bf 4875 normValue_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4876 normValue_0_1 * adc_full_scale_voltage,
whismanoid 52:d3fb6f1722bf 4877 cPinIndexH,
whismanoid 52:d3fb6f1722bf 4878 normValueH_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4879 normValueH_0_1 * adc_full_scale_voltageH
whismanoid 52:d3fb6f1722bf 4880 );
whismanoid 52:d3fb6f1722bf 4881 }
whismanoid 52:d3fb6f1722bf 4882 for (int pinIndex = 2; pinIndex < 4; pinIndex++)
whismanoid 52:d3fb6f1722bf 4883 {
whismanoid 52:d3fb6f1722bf 4884 int cPinIndex = '0' + pinIndex;
whismanoid 52:d3fb6f1722bf 4885 AnalogIn& analogInPin = find_analogInPin(cPinIndex);
whismanoid 52:d3fb6f1722bf 4886 float adc_full_scale_voltage = analogInPin_fullScaleVoltage[pinIndex];
whismanoid 52:d3fb6f1722bf 4887 float normValue_0_1 = analogInPin.read();
whismanoid 52:d3fb6f1722bf 4888 //
whismanoid 52:d3fb6f1722bf 4889 cmdLine.serial().printf("AIN%c = %7.3f%% = %1.3fV\r\n",
whismanoid 52:d3fb6f1722bf 4890 cPinIndex,
whismanoid 52:d3fb6f1722bf 4891 normValue_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4892 normValue_0_1 * adc_full_scale_voltage
whismanoid 52:d3fb6f1722bf 4893 );
whismanoid 52:d3fb6f1722bf 4894 }
whismanoid 52:d3fb6f1722bf 4895 #else // analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 4896 // Platform board uses simple analog inputs
whismanoid 52:d3fb6f1722bf 4897 // assume standard Arduino analog inputs A0-A5
whismanoid 52:d3fb6f1722bf 4898 for (int pinIndex = 0; pinIndex < 6; pinIndex++)
whismanoid 52:d3fb6f1722bf 4899 {
whismanoid 52:d3fb6f1722bf 4900 int cPinIndex = '0' + pinIndex;
whismanoid 52:d3fb6f1722bf 4901 AnalogIn& analogInPin = find_analogInPin(cPinIndex);
whismanoid 52:d3fb6f1722bf 4902 float adc_full_scale_voltage = analogInPin_fullScaleVoltage[pinIndex];
whismanoid 52:d3fb6f1722bf 4903 float normValue_0_1 = analogInPin.read();
whismanoid 52:d3fb6f1722bf 4904 //
whismanoid 52:d3fb6f1722bf 4905 cmdLine.serial().printf("AIN%c = %7.3f%% = %1.3fV\r\n",
whismanoid 52:d3fb6f1722bf 4906 cPinIndex,
whismanoid 52:d3fb6f1722bf 4907 normValue_0_1 * 100.0,
whismanoid 52:d3fb6f1722bf 4908 normValue_0_1 * adc_full_scale_voltage
whismanoid 52:d3fb6f1722bf 4909 );
whismanoid 52:d3fb6f1722bf 4910 }
whismanoid 52:d3fb6f1722bf 4911 #endif // analogIn4_IS_HIGH_RANGE_OF_analogIn0
whismanoid 52:d3fb6f1722bf 4912 }
whismanoid 52:d3fb6f1722bf 4913 break;
whismanoid 52:d3fb6f1722bf 4914 #endif
whismanoid 52:d3fb6f1722bf 4915 //
whismanoid 52:d3fb6f1722bf 4916 #if HAS_SPI2_MAX541
whismanoid 52:d3fb6f1722bf 4917 case 'D': case 'd':
whismanoid 52:d3fb6f1722bf 4918 {
whismanoid 52:d3fb6f1722bf 4919 // %D -- DAC output MAX541 (SPI2) -- need cmdLine.parse_float(voltageV)
whismanoid 52:d3fb6f1722bf 4920 // MAX541 max541(spi2_max541, spi2_max541_cs);
whismanoid 52:d3fb6f1722bf 4921 float voltageV = max541.Get_Voltage();
whismanoid 52:d3fb6f1722bf 4922 // if (cmdLine[2] == '+') {
whismanoid 52:d3fb6f1722bf 4923 // // %D+
whismanoid 52:d3fb6f1722bf 4924 // voltageV = voltageV * 1.25f;
whismanoid 52:d3fb6f1722bf 4925 // if (voltageV >= max541.VRef) voltageV = max541.VRef;
whismanoid 52:d3fb6f1722bf 4926 // SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4927 // }
whismanoid 52:d3fb6f1722bf 4928 // else if (cmdLine[2] == '-') {
whismanoid 52:d3fb6f1722bf 4929 // // %D-
whismanoid 52:d3fb6f1722bf 4930 // voltageV = voltageV * 0.75f;
whismanoid 52:d3fb6f1722bf 4931 // if (voltageV < 0.1f) voltageV = 0.1f;
whismanoid 52:d3fb6f1722bf 4932 // SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4933 // }
whismanoid 52:d3fb6f1722bf 4934 if (cmdLine.parse_float("V", voltageV))
whismanoid 52:d3fb6f1722bf 4935 {
whismanoid 52:d3fb6f1722bf 4936 // %D V=1.234 -- set voltage
whismanoid 52:d3fb6f1722bf 4937 max541.Set_Voltage(voltageV);
whismanoid 52:d3fb6f1722bf 4938 }
whismanoid 52:d3fb6f1722bf 4939 else if (cmdLine.parse_float("TEST", voltageV))
whismanoid 52:d3fb6f1722bf 4940 {
whismanoid 52:d3fb6f1722bf 4941 // %D TEST=1.234 -- set voltage and compare with AIN0
whismanoid 52:d3fb6f1722bf 4942 SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4943 }
whismanoid 52:d3fb6f1722bf 4944 else if (cmdLine.parse_float("CAL", voltageV))
whismanoid 52:d3fb6f1722bf 4945 {
whismanoid 52:d3fb6f1722bf 4946 // %D CAL=1.234 -- calibrate VRef and compare with AIN0
whismanoid 52:d3fb6f1722bf 4947
whismanoid 52:d3fb6f1722bf 4948 max541.Set_Code(0x8000); // we don't know the fullscale voltage yet, so set code to midscale
whismanoid 52:d3fb6f1722bf 4949 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 4950 const int average_count = 100;
whismanoid 52:d3fb6f1722bf 4951 const double average_K = 0.25;
whismanoid 52:d3fb6f1722bf 4952 for (int count = 0; count < average_count; count++) {
whismanoid 52:d3fb6f1722bf 4953 double measurement_V = analogInPin_fullScaleVoltage[4] * analogIn4.read(); // TARGET_MAX32630 J1.5 AIN_4 = AIN0 / 5.0 fullscale is 6.0V
whismanoid 52:d3fb6f1722bf 4954 max541_midscale_V = ((1 - average_K) * max541_midscale_V) + (average_K * measurement_V);
whismanoid 52:d3fb6f1722bf 4955 }
whismanoid 52:d3fb6f1722bf 4956 max541.VRef = 2.0 * max541_midscale_V;
whismanoid 52:d3fb6f1722bf 4957 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 4958 "\r\n MAX541 midscale = %1.3fV, so fullscale = %1.3fV",
whismanoid 52:d3fb6f1722bf 4959 max541_midscale_V, max541.VRef);
whismanoid 52:d3fb6f1722bf 4960 // Detect whether MAX541 is really connected to MAX32625MBED.AIN0/AIN4
whismanoid 52:d3fb6f1722bf 4961 voltageV = 1.0f;
whismanoid 52:d3fb6f1722bf 4962 SelfTest_MAX541_Voltage(cmdLine, max541, voltageV);
whismanoid 52:d3fb6f1722bf 4963 }
whismanoid 52:d3fb6f1722bf 4964 else {
whismanoid 52:d3fb6f1722bf 4965 // %D -- print MAX541 DAC status
whismanoid 52:d3fb6f1722bf 4966 cmdLine.serial().printf("MAX541 code=0x%4.4x = %1.3fV VRef=%1.3fV\r\n",
whismanoid 52:d3fb6f1722bf 4967 max541.Get_Code(), max541.Get_Voltage(), max541.VRef);
whismanoid 52:d3fb6f1722bf 4968 }
whismanoid 52:d3fb6f1722bf 4969 }
whismanoid 52:d3fb6f1722bf 4970 break;
whismanoid 52:d3fb6f1722bf 4971 #endif
whismanoid 52:d3fb6f1722bf 4972
whismanoid 52:d3fb6f1722bf 4973 //
whismanoid 52:d3fb6f1722bf 4974 #if HAS_I2C // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 4975 case 'I': case 'i':
whismanoid 52:d3fb6f1722bf 4976 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 4977 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 4978 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 4979 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 4980 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 4981 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 4982 // get next character
whismanoid 52:d3fb6f1722bf 4983 // TODO: parse cmdLine arg (ADDR=\d+)? --> g_I2C_deviceAddress7
whismanoid 52:d3fb6f1722bf 4984 cmdLine.parse_byte_hex("ADDR", g_I2C_deviceAddress7);
whismanoid 52:d3fb6f1722bf 4985 // TODO: parse cmdLine arg (RD=\d)? --> g_I2C_read_count
whismanoid 52:d3fb6f1722bf 4986 g_I2C_read_count = 0; // read count must be reset every command
whismanoid 52:d3fb6f1722bf 4987 cmdLine.parse_byte_dec("RD", g_I2C_read_count);
whismanoid 52:d3fb6f1722bf 4988 // TODO: parse cmdLine arg (CMD=\d)? --> g_I2C_command_regAddress
whismanoid 52:d3fb6f1722bf 4989 cmdLine.parse_byte_hex("CMD", g_I2C_command_regAddress);
whismanoid 52:d3fb6f1722bf 4990 switch (cmdLine[2])
whismanoid 52:d3fb6f1722bf 4991 {
whismanoid 52:d3fb6f1722bf 4992 case 'P': case 'p':
whismanoid 52:d3fb6f1722bf 4993 {
whismanoid 52:d3fb6f1722bf 4994 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 4995 HuntAttachedI2CDevices(cmdLine, 0x03, 0x77);
whismanoid 52:d3fb6f1722bf 4996 }
whismanoid 52:d3fb6f1722bf 4997 break;
whismanoid 52:d3fb6f1722bf 4998 case 'C': case 'c':
whismanoid 52:d3fb6f1722bf 4999 {
whismanoid 52:d3fb6f1722bf 5000 bool isUpdatedI2CConfig = false;
whismanoid 52:d3fb6f1722bf 5001 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 5002 // parse cmdLine arg (SCL=\d+(kHZ|MHZ)?)? --> g_I2C_SCL_Hz
whismanoid 52:d3fb6f1722bf 5003 if (cmdLine.parse_frequency_Hz("SCL", g_I2C_SCL_Hz))
whismanoid 52:d3fb6f1722bf 5004 {
whismanoid 52:d3fb6f1722bf 5005 isUpdatedI2CConfig = true;
whismanoid 52:d3fb6f1722bf 5006 // TODO1: validate g_I2C_SCL_Hz against system clock frequency F_CPU
whismanoid 52:d3fb6f1722bf 5007 if (g_I2C_SCL_Hz > limit_max_I2C_SCL_Hz)
whismanoid 52:d3fb6f1722bf 5008 {
whismanoid 52:d3fb6f1722bf 5009 g_I2C_SCL_Hz = limit_max_I2C_SCL_Hz;
whismanoid 52:d3fb6f1722bf 5010 }
whismanoid 52:d3fb6f1722bf 5011 if (g_I2C_SCL_Hz < limit_min_I2C_SCL_Hz)
whismanoid 52:d3fb6f1722bf 5012 {
whismanoid 52:d3fb6f1722bf 5013 g_I2C_SCL_Hz = limit_min_I2C_SCL_Hz;
whismanoid 52:d3fb6f1722bf 5014 }
whismanoid 52:d3fb6f1722bf 5015 }
whismanoid 52:d3fb6f1722bf 5016 if (isUpdatedI2CConfig)
whismanoid 52:d3fb6f1722bf 5017 {
whismanoid 52:d3fb6f1722bf 5018 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 5019 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 5020 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5021 i2cMaster.start();
whismanoid 52:d3fb6f1722bf 5022 i2cMaster.stop();
whismanoid 52:d3fb6f1722bf 5023 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5024 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 5025 "\r\n %%IC ADDR=0x%2.2x=(0x%2.2x>>1) SCL=%d=%1.3fkHz -- I2C config",
whismanoid 52:d3fb6f1722bf 5026 g_I2C_deviceAddress7, (g_I2C_deviceAddress7 << 1), g_I2C_SCL_Hz,
whismanoid 52:d3fb6f1722bf 5027 (g_I2C_SCL_Hz / 1000.));
whismanoid 52:d3fb6f1722bf 5028 i2cMaster.start();
whismanoid 52:d3fb6f1722bf 5029 i2cMaster.stop();
whismanoid 52:d3fb6f1722bf 5030 }
whismanoid 52:d3fb6f1722bf 5031 }
whismanoid 52:d3fb6f1722bf 5032 break;
whismanoid 52:d3fb6f1722bf 5033 case 'W': case 'w':
whismanoid 52:d3fb6f1722bf 5034 {
whismanoid 52:d3fb6f1722bf 5035 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 5036 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 5037 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5038 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 5039 // parse cmdLine byte list --> int byteCount; int mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 5040 #define MAX_I2C_BYTE_COUNT 32
whismanoid 52:d3fb6f1722bf 5041 size_t byteCount = byteCount;
whismanoid 52:d3fb6f1722bf 5042 static char mosiData[MAX_I2C_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 5043 static char misoData[MAX_I2C_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 5044 if (cmdLine.parse_byteCount_byteList_hex(byteCount, mosiData,
whismanoid 52:d3fb6f1722bf 5045 MAX_I2C_BYTE_COUNT))
whismanoid 52:d3fb6f1722bf 5046 {
whismanoid 52:d3fb6f1722bf 5047 // hex dump mosiData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 5048 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 5049 "\r\nADDR=0x%2.2x=(0x%2.2x>>1) byteCount:%d RD=%d\r\nI2C MOSI->",
whismanoid 52:d3fb6f1722bf 5050 g_I2C_deviceAddress7,
whismanoid 52:d3fb6f1722bf 5051 (g_I2C_deviceAddress7 << 1), byteCount, g_I2C_read_count);
whismanoid 52:d3fb6f1722bf 5052 for (unsigned int byteIndex = 0; byteIndex < byteCount; byteIndex++)
whismanoid 52:d3fb6f1722bf 5053 {
whismanoid 52:d3fb6f1722bf 5054 cmdLine.serial().printf(" 0x%2.2X", mosiData[byteIndex]);
whismanoid 52:d3fb6f1722bf 5055 }
whismanoid 52:d3fb6f1722bf 5056 //
whismanoid 52:d3fb6f1722bf 5057 // TODO: i2c transfer
whismanoid 52:d3fb6f1722bf 5058 //const int addr7bit = 0x48; // 7 bit I2C address
whismanoid 52:d3fb6f1722bf 5059 //const int addr8bit = 0x48 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 5060 // /* int */ i2cMaster.read (int addr8bit, char *data, int length, bool repeated=false) // Read from an I2C slave.
whismanoid 52:d3fb6f1722bf 5061 // /* int */ i2cMaster.read (int ack) // Read a single byte from the I2C bus.
whismanoid 52:d3fb6f1722bf 5062 // /* int */ i2cMaster.write (int addr8bit, const char *data, int length, bool repeated=false) // Write to an I2C slave.
whismanoid 52:d3fb6f1722bf 5063 // /* int */ i2cMaster.write (int data) // Write single byte out on the I2C bus.
whismanoid 52:d3fb6f1722bf 5064 // /* void */ i2cMaster.start (void) // Creates a start condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 5065 // /* void */ i2cMaster.stop (void) // Creates a stop condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 5066 // /* 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 5067 // /* void */ i2cMaster.abort_transfer () // Abort the ongoing I2C transfer. More...
whismanoid 52:d3fb6f1722bf 5068 const int addr8bit = g_I2C_deviceAddress7 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 5069 unsigned int misoLength = 0;
whismanoid 52:d3fb6f1722bf 5070 bool repeated = (g_I2C_read_count > 0);
whismanoid 52:d3fb6f1722bf 5071 //
whismanoid 52:d3fb6f1722bf 5072 int writeStatus = i2cMaster.write (addr8bit, mosiData, byteCount, repeated);
whismanoid 52:d3fb6f1722bf 5073 switch (writeStatus)
whismanoid 52:d3fb6f1722bf 5074 {
whismanoid 52:d3fb6f1722bf 5075 case 0: cmdLine.serial().printf(" ack "); break;
whismanoid 52:d3fb6f1722bf 5076 case 1: cmdLine.serial().printf(" nack "); break;
whismanoid 52:d3fb6f1722bf 5077 default: cmdLine.serial().printf(" {writeStatus 0x%2.2X} ",
whismanoid 52:d3fb6f1722bf 5078 writeStatus);
whismanoid 52:d3fb6f1722bf 5079 }
whismanoid 52:d3fb6f1722bf 5080 if (repeated)
whismanoid 52:d3fb6f1722bf 5081 {
whismanoid 52:d3fb6f1722bf 5082 int readStatus =
whismanoid 52:d3fb6f1722bf 5083 i2cMaster.read (addr8bit, misoData, g_I2C_read_count, false);
whismanoid 52:d3fb6f1722bf 5084 switch (readStatus)
whismanoid 52:d3fb6f1722bf 5085 {
whismanoid 52:d3fb6f1722bf 5086 case 1: cmdLine.serial().printf(" nack "); break;
whismanoid 52:d3fb6f1722bf 5087 case 0: cmdLine.serial().printf(" ack "); break;
whismanoid 52:d3fb6f1722bf 5088 default: cmdLine.serial().printf(" {readStatus 0x%2.2X} ",
whismanoid 52:d3fb6f1722bf 5089 readStatus);
whismanoid 52:d3fb6f1722bf 5090 }
whismanoid 52:d3fb6f1722bf 5091 }
whismanoid 52:d3fb6f1722bf 5092 //
whismanoid 52:d3fb6f1722bf 5093 if (misoLength > 0)
whismanoid 52:d3fb6f1722bf 5094 {
whismanoid 52:d3fb6f1722bf 5095 // hex dump misoData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 5096 cmdLine.serial().printf(" MISO<-");
whismanoid 52:d3fb6f1722bf 5097 for (unsigned int byteIndex = 0; byteIndex < g_I2C_read_count;
whismanoid 52:d3fb6f1722bf 5098 byteIndex++)
whismanoid 52:d3fb6f1722bf 5099 {
whismanoid 52:d3fb6f1722bf 5100 cmdLine.serial().printf(" 0x%2.2X", misoData[byteIndex]);
whismanoid 52:d3fb6f1722bf 5101 }
whismanoid 52:d3fb6f1722bf 5102 }
whismanoid 52:d3fb6f1722bf 5103 cmdLine.serial().printf(" ");
whismanoid 52:d3fb6f1722bf 5104 }
whismanoid 52:d3fb6f1722bf 5105 }
whismanoid 52:d3fb6f1722bf 5106 break;
whismanoid 52:d3fb6f1722bf 5107 case 'R': case 'r':
whismanoid 52:d3fb6f1722bf 5108 {
whismanoid 52:d3fb6f1722bf 5109 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 5110 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 5111 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5112 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 5113 // TODO: i2c transfer
whismanoid 52:d3fb6f1722bf 5114 //const int addr7bit = 0x48; // 7 bit I2C address
whismanoid 52:d3fb6f1722bf 5115 //const int addr8bit = 0x48 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 5116 // /* int */ i2cMaster.read (int addr8bit, char *data, int length, bool repeated=false) // Read from an I2C slave.
whismanoid 52:d3fb6f1722bf 5117 // /* int */ i2cMaster.read (int ack) // Read a single byte from the I2C bus.
whismanoid 52:d3fb6f1722bf 5118 // /* int */ i2cMaster.write (int addr8bit, const char *data, int length, bool repeated=false) // Write to an I2C slave.
whismanoid 52:d3fb6f1722bf 5119 // /* int */ i2cMaster.write (int data) // Write single byte out on the I2C bus.
whismanoid 52:d3fb6f1722bf 5120 // /* void */ i2cMaster.start (void) // Creates a start condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 5121 // /* void */ i2cMaster.stop (void) // Creates a stop condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 5122 // /* 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 5123 // /* void */ i2cMaster.abort_transfer () // Abort the ongoing I2C transfer. More...
whismanoid 52:d3fb6f1722bf 5124 }
whismanoid 52:d3fb6f1722bf 5125 break;
whismanoid 52:d3fb6f1722bf 5126 case '^':
whismanoid 52:d3fb6f1722bf 5127 {
whismanoid 52:d3fb6f1722bf 5128 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 52:d3fb6f1722bf 5129 I2C i2cMaster(I2C0_SDA, I2C0_SCL); // sda scl TARGET_MAX32635MBED: P1_6, P1_7 Arduino 10-pin header
whismanoid 52:d3fb6f1722bf 5130 i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5131 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5132 // TODO: i2c transfer
whismanoid 52:d3fb6f1722bf 5133 //const int addr7bit = 0x48; // 7 bit I2C address
whismanoid 52:d3fb6f1722bf 5134 //const int addr8bit = 0x48 << 1; // 8bit I2C address, 0x90
whismanoid 52:d3fb6f1722bf 5135 // /* int */ i2cMaster.read (int addr8bit, char *data, int length, bool repeated=false) // Read from an I2C slave.
whismanoid 52:d3fb6f1722bf 5136 // /* int */ i2cMaster.read (int ack) // Read a single byte from the I2C bus.
whismanoid 52:d3fb6f1722bf 5137 // /* int */ i2cMaster.write (int addr8bit, const char *data, int length, bool repeated=false) // Write to an I2C slave.
whismanoid 52:d3fb6f1722bf 5138 // /* int */ i2cMaster.write (int data) // Write single byte out on the I2C bus.
whismanoid 52:d3fb6f1722bf 5139 // /* void */ i2cMaster.start (void) // Creates a start condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 5140 // /* void */ i2cMaster.stop (void) // Creates a stop condition on the I2C bus.
whismanoid 52:d3fb6f1722bf 5141 // /* 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 5142 // /* void */ i2cMaster.abort_transfer () // Abort the ongoing I2C transfer. More...
whismanoid 52:d3fb6f1722bf 5143 }
whismanoid 52:d3fb6f1722bf 5144 break;
whismanoid 52:d3fb6f1722bf 5145 } // switch(cmdLine[2])
whismanoid 52:d3fb6f1722bf 5146 break;
whismanoid 52:d3fb6f1722bf 5147 #endif
whismanoid 52:d3fb6f1722bf 5148 //
whismanoid 52:d3fb6f1722bf 5149 #if HAS_SPI // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5150 case 'S': case 's':
whismanoid 52:d3fb6f1722bf 5151 {
whismanoid 52:d3fb6f1722bf 5152 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 5153 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5154 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 5155 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 5156 //
whismanoid 52:d3fb6f1722bf 5157 // Process arguments SCLK=\d+(kHZ|MHZ) CPOL=\d CPHA=\d
whismanoid 52:d3fb6f1722bf 5158 bool isUpdatedSPIConfig = false;
whismanoid 52:d3fb6f1722bf 5159 // parse cmdLine arg (CPOL=\d)? --> g_SPI_dataMode | SPI_MODE2
whismanoid 52:d3fb6f1722bf 5160 // parse cmdLine arg (CPHA=\d)? --> g_SPI_dataMode | SPI_MODE1
whismanoid 52:d3fb6f1722bf 5161 if (cmdLine.parse_flag("CPOL", g_SPI_dataMode, SPI_MODE2))
whismanoid 52:d3fb6f1722bf 5162 {
whismanoid 52:d3fb6f1722bf 5163 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 5164 }
whismanoid 52:d3fb6f1722bf 5165 if (cmdLine.parse_flag("CPHA", g_SPI_dataMode, SPI_MODE1))
whismanoid 52:d3fb6f1722bf 5166 {
whismanoid 52:d3fb6f1722bf 5167 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 5168 }
whismanoid 52:d3fb6f1722bf 5169 if (cmdLine.parse_flag("CS", g_SPI_cs_state, 1))
whismanoid 52:d3fb6f1722bf 5170 {
whismanoid 52:d3fb6f1722bf 5171 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 5172 }
whismanoid 52:d3fb6f1722bf 5173 // parse cmdLine arg (SCLK=\d+(kHZ|MHZ)?)? --> g_SPI_SCLK_Hz
whismanoid 52:d3fb6f1722bf 5174 if (cmdLine.parse_frequency_Hz("SCLK", g_SPI_SCLK_Hz))
whismanoid 52:d3fb6f1722bf 5175 {
whismanoid 52:d3fb6f1722bf 5176 isUpdatedSPIConfig = true;
whismanoid 52:d3fb6f1722bf 5177 // TODO1: validate g_SPI_SCLK_Hz against system clock frequency F_CPU
whismanoid 52:d3fb6f1722bf 5178 if (g_SPI_SCLK_Hz > limit_max_SPI_SCLK_Hz)
whismanoid 52:d3fb6f1722bf 5179 {
whismanoid 52:d3fb6f1722bf 5180 g_SPI_SCLK_Hz = limit_max_SPI_SCLK_Hz;
whismanoid 52:d3fb6f1722bf 5181 }
whismanoid 52:d3fb6f1722bf 5182 if (g_SPI_SCLK_Hz < limit_min_SPI_SCLK_Hz)
whismanoid 52:d3fb6f1722bf 5183 {
whismanoid 52:d3fb6f1722bf 5184 g_SPI_SCLK_Hz = limit_min_SPI_SCLK_Hz;
whismanoid 52:d3fb6f1722bf 5185 }
whismanoid 52:d3fb6f1722bf 5186 }
whismanoid 52:d3fb6f1722bf 5187 // Update SPI configuration
whismanoid 52:d3fb6f1722bf 5188 if (isUpdatedSPIConfig)
whismanoid 52:d3fb6f1722bf 5189 {
whismanoid 52:d3fb6f1722bf 5190 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5191 spi_cs = g_SPI_cs_state;
whismanoid 52:d3fb6f1722bf 5192 spi.format(8,g_SPI_dataMode); // int bits_must_be_8, int mode=0_3 CPOL=0,CPHA=0
whismanoid 52:d3fb6f1722bf 5193 #if APPLICATION_MAX5715
whismanoid 52:d3fb6f1722bf 5194 g_MAX5715_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5195 #elif APPLICATION_MAX11131
whismanoid 52:d3fb6f1722bf 5196 g_MAX11131_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5197 #elif APPLICATION_MAX5171
whismanoid 52:d3fb6f1722bf 5198 g_MAX5171_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5199 #elif APPLICATION_MAX11410
whismanoid 52:d3fb6f1722bf 5200 g_MAX11410_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5201 #elif APPLICATION_MAX12345
whismanoid 52:d3fb6f1722bf 5202 g_MAX12345_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5203 #else
whismanoid 52:d3fb6f1722bf 5204 spi.frequency(g_SPI_SCLK_Hz); // int SCLK_Hz=1000000 = 1MHz (initial default)
whismanoid 52:d3fb6f1722bf 5205 #endif
whismanoid 52:d3fb6f1722bf 5206 //
whismanoid 52:d3fb6f1722bf 5207 double ideal_divisor = ((double)SystemCoreClock) / g_SPI_SCLK_Hz;
whismanoid 52:d3fb6f1722bf 5208 int actual_divisor = (int)(ideal_divisor + 0.0); // frequency divisor truncate
whismanoid 52:d3fb6f1722bf 5209 double actual_SCLK_Hz = SystemCoreClock / actual_divisor;
whismanoid 52:d3fb6f1722bf 5210 //
whismanoid 52:d3fb6f1722bf 5211 // 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 5212 cmdLine.serial().printf(
whismanoid 52:d3fb6f1722bf 5213 "\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 5214 ((g_SPI_dataMode & SPI_MODE2) ? 1 : 0),
whismanoid 52:d3fb6f1722bf 5215 ((g_SPI_dataMode & SPI_MODE1) ? 1 : 0),
whismanoid 52:d3fb6f1722bf 5216 g_SPI_cs_state,
whismanoid 52:d3fb6f1722bf 5217 g_SPI_SCLK_Hz,
whismanoid 52:d3fb6f1722bf 5218 (g_SPI_SCLK_Hz / 1000000.),
whismanoid 52:d3fb6f1722bf 5219 ((double)(SystemCoreClock / 1000000.)),
whismanoid 52:d3fb6f1722bf 5220 ideal_divisor,
whismanoid 52:d3fb6f1722bf 5221 (actual_SCLK_Hz / 1000000.)
whismanoid 52:d3fb6f1722bf 5222 );
whismanoid 52:d3fb6f1722bf 5223 }
whismanoid 52:d3fb6f1722bf 5224 // get next character
whismanoid 52:d3fb6f1722bf 5225 switch (cmdLine[2])
whismanoid 52:d3fb6f1722bf 5226 {
whismanoid 52:d3fb6f1722bf 5227 case 'C': case 's':
whismanoid 52:d3fb6f1722bf 5228 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5229 break;
whismanoid 52:d3fb6f1722bf 5230 case 'D': case 'd':
whismanoid 52:d3fb6f1722bf 5231 // %SD -- SPI diagnostic messages enable
whismanoid 52:d3fb6f1722bf 5232 if (g_MAX11410_device.onSPIprint) {
whismanoid 52:d3fb6f1722bf 5233 g_MAX11410_device.onSPIprint = NULL;
whismanoid 63:708490d6a29f 5234 g_MAX11410_device.loop_limit = 3000; // Platform_futility_countdown_limit_fast
whismanoid 52:d3fb6f1722bf 5235 }
whismanoid 52:d3fb6f1722bf 5236 else {
whismanoid 52:d3fb6f1722bf 5237 void onSPIprint_handler(size_t byteCount, uint8_t mosiData[], uint8_t misoData[]);
whismanoid 52:d3fb6f1722bf 5238 g_MAX11410_device.onSPIprint = onSPIprint_handler;
whismanoid 63:708490d6a29f 5239 g_MAX11410_device.loop_limit = 30; // Platform_futility_countdown_limit_diagnostic
whismanoid 52:d3fb6f1722bf 5240 }
whismanoid 52:d3fb6f1722bf 5241 break;
whismanoid 52:d3fb6f1722bf 5242 case 'W': case 'R': case 'w': case 'r':
whismanoid 52:d3fb6f1722bf 5243 {
whismanoid 52:d3fb6f1722bf 5244 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 5245 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 5246 // parse cmdLine byte list --> int byteCount; int mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 5247 #define MAX_SPI_BYTE_COUNT 32
whismanoid 52:d3fb6f1722bf 5248 size_t byteCount = byteCount;
whismanoid 52:d3fb6f1722bf 5249 static char mosiData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 5250 static char misoData[MAX_SPI_BYTE_COUNT];
whismanoid 52:d3fb6f1722bf 5251 if (cmdLine.parse_byteCount_byteList_hex(byteCount, mosiData,
whismanoid 52:d3fb6f1722bf 5252 MAX_SPI_BYTE_COUNT))
whismanoid 52:d3fb6f1722bf 5253 {
whismanoid 52:d3fb6f1722bf 5254 // hex dump mosiData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 5255 cmdLine.serial().printf("\r\nSPI");
whismanoid 52:d3fb6f1722bf 5256 if (byteCount > 7) {
whismanoid 52:d3fb6f1722bf 5257 cmdLine.serial().printf(" byteCount:%d", byteCount);
whismanoid 52:d3fb6f1722bf 5258 }
whismanoid 52:d3fb6f1722bf 5259 cmdLine.serial().printf(" MOSI->");
whismanoid 52:d3fb6f1722bf 5260 for (unsigned int byteIndex = 0; byteIndex < byteCount; byteIndex++)
whismanoid 52:d3fb6f1722bf 5261 {
whismanoid 52:d3fb6f1722bf 5262 cmdLine.serial().printf(" 0x%2.2X", mosiData[byteIndex]);
whismanoid 52:d3fb6f1722bf 5263 }
whismanoid 52:d3fb6f1722bf 5264 spi_cs = 0;
whismanoid 52:d3fb6f1722bf 5265 unsigned int numBytesTransferred =
whismanoid 52:d3fb6f1722bf 5266 spi.write(mosiData, byteCount, misoData, byteCount);
whismanoid 52:d3fb6f1722bf 5267 spi_cs = 1;
whismanoid 52:d3fb6f1722bf 5268 // hex dump misoData[0..byteCount-1]
whismanoid 52:d3fb6f1722bf 5269 cmdLine.serial().printf(" MISO<-");
whismanoid 52:d3fb6f1722bf 5270 for (unsigned int byteIndex = 0; byteIndex < numBytesTransferred;
whismanoid 52:d3fb6f1722bf 5271 byteIndex++)
whismanoid 52:d3fb6f1722bf 5272 {
whismanoid 52:d3fb6f1722bf 5273 cmdLine.serial().printf(" 0x%2.2X", misoData[byteIndex]);
whismanoid 52:d3fb6f1722bf 5274 }
whismanoid 52:d3fb6f1722bf 5275 cmdLine.serial().printf(" ");
whismanoid 52:d3fb6f1722bf 5276 }
whismanoid 52:d3fb6f1722bf 5277 }
whismanoid 52:d3fb6f1722bf 5278 break;
whismanoid 52:d3fb6f1722bf 5279 } // switch(cmdLine[2])
whismanoid 52:d3fb6f1722bf 5280 } // case 'S': // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 5281 break;
whismanoid 52:d3fb6f1722bf 5282 #endif
whismanoid 52:d3fb6f1722bf 5283 //
whismanoid 52:d3fb6f1722bf 5284 // A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 5285 } // switch(cmdLine[1])
whismanoid 52:d3fb6f1722bf 5286 } // end void pinsMonitor_submenu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5287
whismanoid 52:d3fb6f1722bf 5288
whismanoid 52:d3fb6f1722bf 5289 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5290 void main_menu_status(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5291 {
whismanoid 52:d3fb6f1722bf 5292 cmdLine.serial().printf("\r\nMain menu");
whismanoid 52:d3fb6f1722bf 5293
whismanoid 52:d3fb6f1722bf 5294 cmdLine.serial().printf(" MAX11410 24-bit 1.9ksps Delta-Sigma ADC");
whismanoid 52:d3fb6f1722bf 5295
whismanoid 52:d3fb6f1722bf 5296 //cmdLine.serial().print(" %s", TARGET_NAME);
whismanoid 52:d3fb6f1722bf 5297 if (cmdLine.nameStr())
whismanoid 52:d3fb6f1722bf 5298 {
whismanoid 52:d3fb6f1722bf 5299 cmdLine.serial().printf(" [%s]", cmdLine.nameStr());
whismanoid 52:d3fb6f1722bf 5300
whismanoid 52:d3fb6f1722bf 5301 }
whismanoid 52:d3fb6f1722bf 5302 cmdLine.serial().printf("\r\n ? -- help");
whismanoid 52:d3fb6f1722bf 5303
whismanoid 52:d3fb6f1722bf 5304 }
whismanoid 52:d3fb6f1722bf 5305
whismanoid 52:d3fb6f1722bf 5306
whismanoid 52:d3fb6f1722bf 5307 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5308 void main_menu_help(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5309 {
whismanoid 52:d3fb6f1722bf 5310 // ? -- help
whismanoid 52:d3fb6f1722bf 5311 //~ cmdLine.serial().print(F("\r\nMenu:"));
whismanoid 52:d3fb6f1722bf 5312 cmdLine.serial().printf("\r\n # -- lines beginning with # are comments");
whismanoid 52:d3fb6f1722bf 5313
whismanoid 52:d3fb6f1722bf 5314 cmdLine.serial().printf("\r\n . -- SelfTest");
whismanoid 52:d3fb6f1722bf 5315
whismanoid 52:d3fb6f1722bf 5316 //cmdLine.serial().print(F("\r\n ! -- Initial Configuration"));
whismanoid 52:d3fb6f1722bf 5317 //
whismanoid 52:d3fb6f1722bf 5318 // % standardize diagnostic commands
whismanoid 52:d3fb6f1722bf 5319 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 5320 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 5321 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 5322 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 5323 // %Ppin df=xx -- pwm output
whismanoid 52:d3fb6f1722bf 5324 // %Wpin -- measure high pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 5325 // %wpin -- measure low pulsewidth input in usec
whismanoid 52:d3fb6f1722bf 5326 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 5327 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 5328 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 5329 // %IW ADDR=? cmd=? data,data,data -- write
whismanoid 52:d3fb6f1722bf 5330 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 5331 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5332 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 5333 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5334 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 5335 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 5336 // A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 5337 //
whismanoid 52:d3fb6f1722bf 5338 #if HAS_digitalInOuts
whismanoid 52:d3fb6f1722bf 5339 // %Hpin -- digital output high
whismanoid 52:d3fb6f1722bf 5340 // %Lpin -- digital output low
whismanoid 52:d3fb6f1722bf 5341 // %?pin -- digital input
whismanoid 52:d3fb6f1722bf 5342 cmdLine.serial().printf("\r\n %%Hn {pin:");
whismanoid 52:d3fb6f1722bf 5343 list_digitalInOutPins(cmdLine.serial());
whismanoid 52:d3fb6f1722bf 5344 cmdLine.serial().printf("} -- High Output");
whismanoid 52:d3fb6f1722bf 5345 cmdLine.serial().printf("\r\n %%Ln {pin:");
whismanoid 52:d3fb6f1722bf 5346 list_digitalInOutPins(cmdLine.serial());
whismanoid 52:d3fb6f1722bf 5347 cmdLine.serial().printf("} -- Low Output");
whismanoid 52:d3fb6f1722bf 5348 cmdLine.serial().printf("\r\n %%?n {pin:");
whismanoid 52:d3fb6f1722bf 5349 list_digitalInOutPins(cmdLine.serial());
whismanoid 52:d3fb6f1722bf 5350 cmdLine.serial().printf("} -- Input");
whismanoid 52:d3fb6f1722bf 5351 #endif
whismanoid 52:d3fb6f1722bf 5352
whismanoid 52:d3fb6f1722bf 5353 #if HAS_analogIns
whismanoid 52:d3fb6f1722bf 5354 // Menu A) analogRead A0..7
whismanoid 52:d3fb6f1722bf 5355 // %A %Apin -- analog input
whismanoid 52:d3fb6f1722bf 5356 // analogRead(pinIndex) // analog input pins A0, A1, A2, A3, A4, A5; float voltage = analogRead(A0) * (5.0 / 1023.0)
whismanoid 52:d3fb6f1722bf 5357 cmdLine.serial().printf("\r\n %%A -- analogRead");
whismanoid 52:d3fb6f1722bf 5358 #endif
whismanoid 52:d3fb6f1722bf 5359
whismanoid 52:d3fb6f1722bf 5360 #if HAS_SPI2_MAX541
whismanoid 52:d3fb6f1722bf 5361 // TODO1: MAX541 max541(spi2_max541, spi2_max541_cs);
whismanoid 52:d3fb6f1722bf 5362 cmdLine.serial().printf("\r\n %%D -- DAC output MAX541 (SPI2)");
whismanoid 52:d3fb6f1722bf 5363 #endif
whismanoid 52:d3fb6f1722bf 5364
whismanoid 52:d3fb6f1722bf 5365 #if HAS_I2C // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5366 // TODO: support I2C HAS_I2C // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5367 // VERIFY: I2C utility commands SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5368 // VERIFY: report g_I2C_SCL_Hz = (F_CPU / ((TWBR * 2) + 16)) from last Wire_Sr.setClock(I2C_SCL_Hz);
whismanoid 52:d3fb6f1722bf 5369 // %I... -- I2C diagnostics
whismanoid 52:d3fb6f1722bf 5370 // %IP -- I2C probe
whismanoid 52:d3fb6f1722bf 5371 // %IC scl=100khz ADDR=? -- I2C configure
whismanoid 52:d3fb6f1722bf 5372 // %IW byte byte ... byte RD=? ADDR=0x -- write
whismanoid 52:d3fb6f1722bf 5373 // %IR ADDR=? RD=? -- read
whismanoid 52:d3fb6f1722bf 5374 // %I^ cmd=? -- i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5375 //g_I2C_SCL_Hz = (F_CPU / ((TWBR * 2) + 16)); // 'F_CPU' 'TWBR' not declared in this scope
whismanoid 52:d3fb6f1722bf 5376 cmdLine.serial().printf("\r\n %%IC ADDR=0x%2.2x=(0x%2.2x>>1) SCL=%d=%1.3fkHz -- I2C config",
whismanoid 52:d3fb6f1722bf 5377 g_I2C_deviceAddress7, (g_I2C_deviceAddress7 << 1), g_I2C_SCL_Hz,
whismanoid 52:d3fb6f1722bf 5378 (g_I2C_SCL_Hz / 1000.));
whismanoid 52:d3fb6f1722bf 5379 cmdLine.serial().printf("\r\n %%IW byte byte ... byte RD=? ADDR=0x%2.2x -- I2C write/read",
whismanoid 52:d3fb6f1722bf 5380 g_I2C_deviceAddress7);
whismanoid 52:d3fb6f1722bf 5381 //
whismanoid 52:d3fb6f1722bf 5382 #if SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5383 // Menu ^ cmd=?) i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5384 cmdLine.serial().printf("\r\n %%I^ cmd=? -- i2c_smbus_read_word_data");
whismanoid 52:d3fb6f1722bf 5385 // test low-level I2C i2c_smbus_read_word_data
whismanoid 52:d3fb6f1722bf 5386 #endif // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5387 //cmdLine.serial().printf(" H) Hunt for attached I2C devices");
whismanoid 52:d3fb6f1722bf 5388 cmdLine.serial().printf("\r\n %%IP -- I2C Probe for attached devices");
whismanoid 52:d3fb6f1722bf 5389 // cmdLine.serial().printf(" s) search i2c address");
whismanoid 52:d3fb6f1722bf 5390 #endif // SUPPORT_I2C
whismanoid 52:d3fb6f1722bf 5391
whismanoid 52:d3fb6f1722bf 5392 #if HAS_SPI // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5393 // TODO: support SPI HAS_SPI // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5394 // SPI test command S (mosiData)+
whismanoid 52:d3fb6f1722bf 5395 // %S... -- SPI diagnostics
whismanoid 52:d3fb6f1722bf 5396 // %SC sclk=1Mhz -- SPI configure
whismanoid 52:d3fb6f1722bf 5397 // %SW -- write (write and read)
whismanoid 52:d3fb6f1722bf 5398 // %SR -- read (alias for %SW because SPI always write and read)
whismanoid 52:d3fb6f1722bf 5399 // spi.format(8,0); // int bits_must_be_8, int mode=0_3 CPOL=0,CPHA=0 rising edge (initial default)
whismanoid 52:d3fb6f1722bf 5400 // spi.format(8,1); // int bits_must_be_8, int mode=0_3 CPOL=0,CPHA=1 falling edge (initial default)
whismanoid 52:d3fb6f1722bf 5401 // spi.format(8,2); // int bits_must_be_8, int mode=0_3 CPOL=1,CPHA=0 falling edge (initial default)
whismanoid 52:d3fb6f1722bf 5402 // spi.format(8,3); // int bits_must_be_8, int mode=0_3 CPOL=1,CPHA=1 rising edge (initial default)
whismanoid 52:d3fb6f1722bf 5403 // spi.frequency(1000000); // int SCLK_Hz=1000000 = 1MHz (initial default)
whismanoid 52:d3fb6f1722bf 5404 // mode | POL PHA
whismanoid 52:d3fb6f1722bf 5405 // -----+--------
whismanoid 52:d3fb6f1722bf 5406 // 0 | 0 0
whismanoid 52:d3fb6f1722bf 5407 // 1 | 0 1
whismanoid 52:d3fb6f1722bf 5408 // 2 | 1 0
whismanoid 52:d3fb6f1722bf 5409 // 3 | 1 1
whismanoid 52:d3fb6f1722bf 5410 //cmdLine.serial().printf(" S) SPI mosi,mosi,...mosi hex bytes SCLK=1000000 CPOL=0 CPHA=0");
whismanoid 52:d3fb6f1722bf 5411 // 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 5412 cmdLine.serial().printf("\r\n %%SC SCLK=%ld=%1.3fMHz CPOL=%d CPHA=%d -- SPI config",
whismanoid 52:d3fb6f1722bf 5413 g_SPI_SCLK_Hz, (g_SPI_SCLK_Hz / 1000000.),
whismanoid 52:d3fb6f1722bf 5414 ((g_SPI_dataMode & SPI_MODE2) ? 1 : 0),
whismanoid 52:d3fb6f1722bf 5415 ((g_SPI_dataMode & SPI_MODE1) ? 1 : 0));
whismanoid 52:d3fb6f1722bf 5416 cmdLine.serial().printf("\r\n %%SD -- SPI diagnostic messages ");
whismanoid 52:d3fb6f1722bf 5417 if (g_MAX11410_device.onSPIprint) {
whismanoid 52:d3fb6f1722bf 5418 cmdLine.serial().printf("hide");
whismanoid 52:d3fb6f1722bf 5419 }
whismanoid 52:d3fb6f1722bf 5420 else {
whismanoid 52:d3fb6f1722bf 5421 cmdLine.serial().printf("show");
whismanoid 52:d3fb6f1722bf 5422 }
whismanoid 52:d3fb6f1722bf 5423 cmdLine.serial().printf("\r\n %%SW mosi,mosi,...mosi -- SPI write hex bytes");
whismanoid 52:d3fb6f1722bf 5424 // VERIFY: parse new SPI settings parse_strCommandArgs() SCLK=1000000 CPOL=0 CPHA=0
whismanoid 52:d3fb6f1722bf 5425 #endif // SUPPORT_SPI
whismanoid 52:d3fb6f1722bf 5426 //
whismanoid 52:d3fb6f1722bf 5427 // Application-specific commands (help text) here
whismanoid 52:d3fb6f1722bf 5428 //
whismanoid 52:d3fb6f1722bf 5429 #if APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5430 cmdLine.serial().printf("\r\n A-Z,a-z,0-9 -- reserved for application use"); // ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5431 #endif // APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5432 //
whismanoid 52:d3fb6f1722bf 5433
whismanoid 56:6e9c52cc9abe 5434 extern void MAX11410_menu_help(CmdLine & cmdLine); // defined in Test_Menu_MAX11410.cpp\n
whismanoid 52:d3fb6f1722bf 5435 MAX11410_menu_help(cmdLine);
whismanoid 52:d3fb6f1722bf 5436 }
whismanoid 52:d3fb6f1722bf 5437
whismanoid 52:d3fb6f1722bf 5438
whismanoid 52:d3fb6f1722bf 5439
whismanoid 52:d3fb6f1722bf 5440 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5441 // main menu command-line parser
whismanoid 52:d3fb6f1722bf 5442 // invoked by CmdLine::append(char ch) or CmdLine::idleAppendIfReadable()
whismanoid 52:d3fb6f1722bf 5443 void main_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5444 {
whismanoid 52:d3fb6f1722bf 5445 // DIAGNOSTIC: print line buffer
whismanoid 52:d3fb6f1722bf 5446 //~ cmdLine.serial().printf("\r\nmain_menu_onEOLcommandParser: ~%s~\r\n", cmdLine.str());
whismanoid 52:d3fb6f1722bf 5447 //
whismanoid 52:d3fb6f1722bf 5448 switch (cmdLine[0])
whismanoid 52:d3fb6f1722bf 5449 {
whismanoid 52:d3fb6f1722bf 5450 case '?':
whismanoid 52:d3fb6f1722bf 5451 main_menu_status(cmdLine);
whismanoid 52:d3fb6f1722bf 5452 main_menu_help(cmdLine);
whismanoid 52:d3fb6f1722bf 5453 // print command prompt
whismanoid 52:d3fb6f1722bf 5454 //cmdLine.serial().printf("\r\n>");
whismanoid 52:d3fb6f1722bf 5455 break;
whismanoid 52:d3fb6f1722bf 5456 case '\r': case '\n': // ignore blank line
whismanoid 52:d3fb6f1722bf 5457 case '\0': // ignore empty line
whismanoid 52:d3fb6f1722bf 5458 case '#': // ignore comment line
whismanoid 52:d3fb6f1722bf 5459 // # -- lines beginning with # are comments
whismanoid 52:d3fb6f1722bf 5460 main_menu_status(cmdLine);
whismanoid 52:d3fb6f1722bf 5461 //~ main_menu_help(cmdLine);
whismanoid 52:d3fb6f1722bf 5462 // print command prompt
whismanoid 52:d3fb6f1722bf 5463 //cmdLine.serial().printf("\r\n>");
whismanoid 52:d3fb6f1722bf 5464 break;
whismanoid 52:d3fb6f1722bf 5465 #if ECHO_EOF_ON_EOL
whismanoid 52:d3fb6f1722bf 5466 case '\x04': // Unicode (U+0004) EOT END OF TRANSMISSION = CTRL+D as EOF end of file
whismanoid 52:d3fb6f1722bf 5467 cmdLine.serial().printf("\x04"); // immediately echo EOF for test scripting
whismanoid 52:d3fb6f1722bf 5468 diagnostic_led_EOF();
whismanoid 52:d3fb6f1722bf 5469 break;
whismanoid 52:d3fb6f1722bf 5470 case '\x1a': // Unicode (U+001A) SUB SUBSTITUTE = CTRL+Z as EOF end of file
whismanoid 52:d3fb6f1722bf 5471 cmdLine.serial().printf("\x1a"); // immediately echo EOF for test scripting
whismanoid 52:d3fb6f1722bf 5472 diagnostic_led_EOF();
whismanoid 52:d3fb6f1722bf 5473 break;
whismanoid 52:d3fb6f1722bf 5474 #endif
whismanoid 52:d3fb6f1722bf 5475 #if APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5476 case '.':
whismanoid 52:d3fb6f1722bf 5477 {
whismanoid 52:d3fb6f1722bf 5478 // . -- SelfTest
whismanoid 52:d3fb6f1722bf 5479 cmdLine.serial().printf("SelfTest()");
whismanoid 52:d3fb6f1722bf 5480 SelfTest(cmdLine);
whismanoid 52:d3fb6f1722bf 5481 }
whismanoid 52:d3fb6f1722bf 5482 break;
whismanoid 52:d3fb6f1722bf 5483 case '%':
whismanoid 52:d3fb6f1722bf 5484 {
whismanoid 52:d3fb6f1722bf 5485 pinsMonitor_submenu_onEOLcommandParser(cmdLine);
whismanoid 52:d3fb6f1722bf 5486 }
whismanoid 52:d3fb6f1722bf 5487 break; // case '%'
whismanoid 52:d3fb6f1722bf 5488 #endif // APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5489 //
whismanoid 52:d3fb6f1722bf 5490 // Application-specific commands here
whismanoid 52:d3fb6f1722bf 5491 // alphanumeric command codes A-Z,a-z,0-9 reserved for application use
whismanoid 52:d3fb6f1722bf 5492 //
whismanoid 52:d3fb6f1722bf 5493 #if APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5494 #endif // APPLICATION_ArduinoPinsMonitor
whismanoid 52:d3fb6f1722bf 5495
whismanoid 52:d3fb6f1722bf 5496 //
whismanoid 52:d3fb6f1722bf 5497 // add new commands here
whismanoid 52:d3fb6f1722bf 5498 //
whismanoid 52:d3fb6f1722bf 5499 default:
whismanoid 52:d3fb6f1722bf 5500 extern bool MAX11410_menu_onEOLcommandParser(CmdLine & cmdLine); // defined in Test_Menu_MAX11410.cpp
whismanoid 52:d3fb6f1722bf 5501 if (!MAX11410_menu_onEOLcommandParser(cmdLine))
whismanoid 52:d3fb6f1722bf 5502 { // not_handled_by_device_submenu
whismanoid 52:d3fb6f1722bf 5503 cmdLine.serial().printf("\r\n unknown command 0x%2.2x \"%s\"\r\n", cmdLine.str()[0], cmdLine.str());
whismanoid 52:d3fb6f1722bf 5504
whismanoid 52:d3fb6f1722bf 5505 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5506 cmdLine_DAPLINKserial.serial().printf("\r\n unknown command 0x%2.2x \"%s\"\r\n", cmdLine.str()[0], cmdLine.str());
whismanoid 52:d3fb6f1722bf 5507
whismanoid 52:d3fb6f1722bf 5508 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5509 }
whismanoid 52:d3fb6f1722bf 5510 } // switch (cmdLine[0])
whismanoid 52:d3fb6f1722bf 5511 //
whismanoid 52:d3fb6f1722bf 5512 // print command prompt
whismanoid 52:d3fb6f1722bf 5513 cmdLine.serial().printf("\r\nMAX11410 > ");
whismanoid 52:d3fb6f1722bf 5514
whismanoid 52:d3fb6f1722bf 5515 } // end void main_menu_onEOLcommandParser(CmdLine & cmdLine)
whismanoid 52:d3fb6f1722bf 5516
whismanoid 52:d3fb6f1722bf 5517 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5518 #if MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 5519 // Optional Diagnostic function to print SPI transactions
whismanoid 52:d3fb6f1722bf 5520 void onSPIprint_handler(size_t byteCount, uint8_t mosiData[], uint8_t misoData[])
whismanoid 52:d3fb6f1722bf 5521 {
whismanoid 59:c0376adb6ebc 5522 cmdLine_serial.serial().printf("\r\n SPI MOSI->");
whismanoid 52:d3fb6f1722bf 5523 for (uint8_t index = 0; index < byteCount; index++) {
whismanoid 52:d3fb6f1722bf 5524 cmdLine_serial.serial().printf(" 0x%2.2X", mosiData[index]);
whismanoid 52:d3fb6f1722bf 5525 }
whismanoid 52:d3fb6f1722bf 5526 cmdLine_serial.serial().printf(" MISO<-");
whismanoid 52:d3fb6f1722bf 5527 for (uint8_t index = 0; index < byteCount; index++) {
whismanoid 52:d3fb6f1722bf 5528 cmdLine_serial.serial().printf(" 0x%2.2X", misoData[index]);
whismanoid 52:d3fb6f1722bf 5529 }
whismanoid 52:d3fb6f1722bf 5530 cmdLine_serial.serial().printf(" ");
whismanoid 52:d3fb6f1722bf 5531 }
whismanoid 52:d3fb6f1722bf 5532 #endif // MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 5533
whismanoid 52:d3fb6f1722bf 5534 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5535 void InitializeConfiguration()
whismanoid 52:d3fb6f1722bf 5536 {
whismanoid 52:d3fb6f1722bf 5537 // CODE GENERATOR: example code: member function Init
whismanoid 52:d3fb6f1722bf 5538 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5539 cmdLine_DAPLINKserial.serial().printf("\r\nMAX11410_Init()");
whismanoid 52:d3fb6f1722bf 5540
whismanoid 52:d3fb6f1722bf 5541 # endif
whismanoid 52:d3fb6f1722bf 5542 cmdLine_serial.serial().printf("\r\nMAX11410_Init()");
whismanoid 52:d3fb6f1722bf 5543
whismanoid 52:d3fb6f1722bf 5544 // Initialize MAX11410 and verify device ID
whismanoid 52:d3fb6f1722bf 5545 if (g_MAX11410_device.Init() == 0)
whismanoid 52:d3fb6f1722bf 5546 { // init failed; try "safe mode" SPI at slower SCLK rate
whismanoid 52:d3fb6f1722bf 5547 cmdLine_serial.serial().printf("\r\nMAX11410 Init failed; retry at SPI SCLK frequency 2000000 Hz\r\n");
whismanoid 52:d3fb6f1722bf 5548
whismanoid 52:d3fb6f1722bf 5549 g_SPI_SCLK_Hz = 2000000;
whismanoid 52:d3fb6f1722bf 5550 g_MAX11410_device.spi_frequency(2000000);
whismanoid 52:d3fb6f1722bf 5551 g_MAX11410_device.Init();
whismanoid 52:d3fb6f1722bf 5552 }
whismanoid 52:d3fb6f1722bf 5553 // CODE GENERATOR: get spi properties from device
whismanoid 52:d3fb6f1722bf 5554 if (g_SPI_SCLK_Hz > g_MAX11410_device.get_spi_frequency())
whismanoid 52:d3fb6f1722bf 5555 { // Device limits SPI SCLK frequency
whismanoid 52:d3fb6f1722bf 5556 g_SPI_SCLK_Hz = g_MAX11410_device.get_spi_frequency();
whismanoid 56:6e9c52cc9abe 5557 cmdLine_serial.serial().printf("\r\nMAX11410 limits SPI SCLK frequency to %ld Hz\r\n", g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5558
whismanoid 52:d3fb6f1722bf 5559 g_MAX11410_device.Init();
whismanoid 52:d3fb6f1722bf 5560 }
whismanoid 52:d3fb6f1722bf 5561 if (g_MAX11410_device.get_spi_frequency() > g_SPI_SCLK_Hz)
whismanoid 52:d3fb6f1722bf 5562 { // Platform limits SPI SCLK frequency
whismanoid 52:d3fb6f1722bf 5563 g_MAX11410_device.spi_frequency(g_SPI_SCLK_Hz);
whismanoid 56:6e9c52cc9abe 5564 cmdLine_serial.serial().printf("\r\nPlatform limits MAX11410 SPI SCLK frequency to %ld Hz\r\n", g_SPI_SCLK_Hz);
whismanoid 52:d3fb6f1722bf 5565
whismanoid 52:d3fb6f1722bf 5566 g_MAX11410_device.Init();
whismanoid 52:d3fb6f1722bf 5567 }
whismanoid 52:d3fb6f1722bf 5568 g_SPI_dataMode = g_MAX11410_device.get_spi_dataMode();
whismanoid 52:d3fb6f1722bf 5569
whismanoid 52:d3fb6f1722bf 5570 # if MAX11410_ONSPIPRINT
whismanoid 52:d3fb6f1722bf 5571 // Optional Diagnostic function to print SPI transactions
whismanoid 52:d3fb6f1722bf 5572 g_MAX11410_device.onSPIprint = onSPIprint_handler;
whismanoid 52:d3fb6f1722bf 5573 # endif
whismanoid 52:d3fb6f1722bf 5574 }
whismanoid 52:d3fb6f1722bf 5575
whismanoid 52:d3fb6f1722bf 5576 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5577 // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5578 void diagnostic_led_EOF()
whismanoid 52:d3fb6f1722bf 5579 {
whismanoid 52:d3fb6f1722bf 5580 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5581 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5582 // 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 5583 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5584 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5585 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5586 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5587 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5588 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5589 ThisThread::sleep_for(250); // [since mbed-os-5.10] vs Thread::wait(250);
whismanoid 52:d3fb6f1722bf 5590 #endif // USE_LEDS
whismanoid 52:d3fb6f1722bf 5591 }
whismanoid 52:d3fb6f1722bf 5592
whismanoid 52:d3fb6f1722bf 5593 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5594 // Support commands that get handled immediately w/o waiting for EOL
whismanoid 52:d3fb6f1722bf 5595 // handled as immediate command, do not append to buffer
whismanoid 52:d3fb6f1722bf 5596 void on_immediate_0x21() // Unicode (U+0021) ! EXCLAMATION MARK
whismanoid 52:d3fb6f1722bf 5597 {
whismanoid 52:d3fb6f1722bf 5598 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5599 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 5600 #endif // USE_LEDS
whismanoid 52:d3fb6f1722bf 5601 InitializeConfiguration();
whismanoid 52:d3fb6f1722bf 5602 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5603 }
whismanoid 52:d3fb6f1722bf 5604
whismanoid 52:d3fb6f1722bf 5605 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5606 // Support commands that get handled immediately w/o waiting for EOL
whismanoid 52:d3fb6f1722bf 5607 // handled as immediate command, do not append to buffer
whismanoid 52:d3fb6f1722bf 5608 void on_immediate_0x7b() // Unicode (U+007B) { LEFT CURLY BRACKET
whismanoid 52:d3fb6f1722bf 5609 {
whismanoid 52:d3fb6f1722bf 5610 #if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5611 onButton2FallingEdge();
whismanoid 52:d3fb6f1722bf 5612 #endif
whismanoid 52:d3fb6f1722bf 5613 }
whismanoid 52:d3fb6f1722bf 5614
whismanoid 52:d3fb6f1722bf 5615 //--------------------------------------------------
whismanoid 52:d3fb6f1722bf 5616 // Support commands that get handled immediately w/o waiting for EOL
whismanoid 52:d3fb6f1722bf 5617 // handled as immediate command, do not append to buffer
whismanoid 52:d3fb6f1722bf 5618 void on_immediate_0x7d() // Unicode (U+007D) } RIGHT CURLY BRACKET
whismanoid 52:d3fb6f1722bf 5619 {
whismanoid 52:d3fb6f1722bf 5620 #if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5621 onButton1FallingEdge();
whismanoid 52:d3fb6f1722bf 5622 #endif
whismanoid 52:d3fb6f1722bf 5623 }
whismanoid 52:d3fb6f1722bf 5624
whismanoid 52:d3fb6f1722bf 5625 //----------------------------------------
whismanoid 52:d3fb6f1722bf 5626 // example code main function
whismanoid 52:d3fb6f1722bf 5627 int main()
whismanoid 52:d3fb6f1722bf 5628 {
whismanoid 52:d3fb6f1722bf 5629 // Configure serial ports
whismanoid 52:d3fb6f1722bf 5630 cmdLine_serial.clear();
whismanoid 52:d3fb6f1722bf 5631 //~ cmdLine_serial.serial().printf("\r\n cmdLine_serial.serial().printf test\r\n");
whismanoid 52:d3fb6f1722bf 5632 cmdLine_serial.onEOLcommandParser = main_menu_onEOLcommandParser;
whismanoid 52:d3fb6f1722bf 5633 cmdLine_serial.diagnostic_led_EOF = diagnostic_led_EOF;
whismanoid 52:d3fb6f1722bf 5634 /// CmdLine::set_immediate_handler(char, functionPointer_void_void_on_immediate_0x21);
whismanoid 52:d3fb6f1722bf 5635 cmdLine_serial.on_immediate_0x21 = on_immediate_0x21;
whismanoid 52:d3fb6f1722bf 5636 cmdLine_serial.on_immediate_0x7b = on_immediate_0x7b;
whismanoid 52:d3fb6f1722bf 5637 cmdLine_serial.on_immediate_0x7d = on_immediate_0x7d;
whismanoid 52:d3fb6f1722bf 5638 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5639 cmdLine_DAPLINKserial.clear();
whismanoid 52:d3fb6f1722bf 5640 //~ cmdLine_DAPLINKserial.serial().printf("\r\n cmdLine_DAPLINKserial.serial().printf test\r\n");
whismanoid 52:d3fb6f1722bf 5641 cmdLine_DAPLINKserial.onEOLcommandParser = main_menu_onEOLcommandParser;
whismanoid 52:d3fb6f1722bf 5642 /// @todo CmdLine::set_immediate_handler(char, functionPointer_void_void_on_immediate_0x21);
whismanoid 52:d3fb6f1722bf 5643 cmdLine_DAPLINKserial.on_immediate_0x21 = on_immediate_0x21;
whismanoid 52:d3fb6f1722bf 5644 cmdLine_DAPLINKserial.on_immediate_0x7b = on_immediate_0x7b;
whismanoid 52:d3fb6f1722bf 5645 cmdLine_DAPLINKserial.on_immediate_0x7d = on_immediate_0x7d;
whismanoid 52:d3fb6f1722bf 5646 # endif
whismanoid 52:d3fb6f1722bf 5647
whismanoid 52:d3fb6f1722bf 5648
whismanoid 52:d3fb6f1722bf 5649 //print_banner();
whismanoid 52:d3fb6f1722bf 5650
whismanoid 59:c0376adb6ebc 5651 #if HAS_I2C
whismanoid 59:c0376adb6ebc 5652 // i2c init
whismanoid 59:c0376adb6ebc 5653 // declare in narrower scope: MAX32625MBED I2C i2cMaster(...)
whismanoid 59:c0376adb6ebc 5654 // i2cMaster.frequency(g_I2C_SCL_Hz);
whismanoid 59:c0376adb6ebc 5655 #else
whismanoid 59:c0376adb6ebc 5656 // Ensure that the unused I2C pins do not interfere with analog inputs A4 and A5
whismanoid 59:c0376adb6ebc 5657 #if HAS_digitalInOut14
whismanoid 59:c0376adb6ebc 5658 // DigitalInOut digitalInOut14(P1_6, PIN_INPUT, PullUp, 1); // P1_6 TARGET_MAX32635MBED A4/SDA (10pin digital connector)
whismanoid 59:c0376adb6ebc 5659 digitalInOut14.input();
whismanoid 59:c0376adb6ebc 5660 #endif
whismanoid 59:c0376adb6ebc 5661 #if HAS_digitalInOut15
whismanoid 59:c0376adb6ebc 5662 // DigitalInOut digitalInOut15(P1_7, PIN_INPUT, PullUp, 1); // P1_7 TARGET_MAX32635MBED A5/SCL (10pin digital connector)
whismanoid 59:c0376adb6ebc 5663 digitalInOut15.input();
whismanoid 59:c0376adb6ebc 5664 #endif
whismanoid 59:c0376adb6ebc 5665 #if HAS_digitalInOut16
whismanoid 59:c0376adb6ebc 5666 // DigitalInOut mode can be one of PullUp, PullDown, PullNone, OpenDrain
whismanoid 59:c0376adb6ebc 5667 // PullUp-->3.4V, PullDown-->1.7V, PullNone-->3.5V, OpenDrain-->0.00V
whismanoid 59:c0376adb6ebc 5668 //DigitalInOut digitalInOut16(P3_4, PIN_INPUT, OpenDrain, 0); // P3_4 TARGET_MAX32635MBED A4/SDA (6pin analog connector)
whismanoid 59:c0376adb6ebc 5669 digitalInOut16.input();
whismanoid 59:c0376adb6ebc 5670 #endif
whismanoid 59:c0376adb6ebc 5671 #if HAS_digitalInOut17
whismanoid 59:c0376adb6ebc 5672 //DigitalInOut digitalInOut17(P3_5, PIN_INPUT, OpenDrain, 0); // P3_5 TARGET_MAX32635MBED A5/SCL (6pin analog connector)
whismanoid 59:c0376adb6ebc 5673 digitalInOut17.input();
whismanoid 59:c0376adb6ebc 5674 #endif
whismanoid 59:c0376adb6ebc 5675 #endif // HAS_I2C
whismanoid 52:d3fb6f1722bf 5676
whismanoid 52:d3fb6f1722bf 5677
whismanoid 52:d3fb6f1722bf 5678 #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5679 #if defined(TARGET_MAX32630)
whismanoid 52:d3fb6f1722bf 5680 led1 = LED_ON; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led RED
whismanoid 52:d3fb6f1722bf 5681 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5682 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5683 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5684 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 5685 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5686 led1 = LED_ON; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led RED+GREEN+BLUE=WHITE
whismanoid 52:d3fb6f1722bf 5687 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5688 led1 = LED_OFF; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led GREEN+BLUE=CYAN
whismanoid 52:d3fb6f1722bf 5689 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5690 led1 = LED_ON; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led RED+BLUE=MAGENTA
whismanoid 52:d3fb6f1722bf 5691 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5692 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5693 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5694 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led BLACK
whismanoid 52:d3fb6f1722bf 5695 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5696 #elif defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 5697 led1 = LED_ON; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led RED
whismanoid 52:d3fb6f1722bf 5698 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5699 led1 = LED_OFF; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led GREEN
whismanoid 52:d3fb6f1722bf 5700 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5701 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led BLUE
whismanoid 52:d3fb6f1722bf 5702 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5703 led1 = LED_ON; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led RED+GREEN+BLUE=WHITE
whismanoid 52:d3fb6f1722bf 5704 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5705 led1 = LED_OFF; led2 = LED_ON; led3 = LED_ON; // diagnostic rbg led GREEN+BLUE=CYAN
whismanoid 52:d3fb6f1722bf 5706 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5707 led1 = LED_ON; led2 = LED_OFF; led3 = LED_ON; // diagnostic rbg led RED+BLUE=MAGENTA
whismanoid 52:d3fb6f1722bf 5708 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5709 led1 = LED_ON; led2 = LED_ON; led3 = LED_OFF; // diagnostic rbg led RED+GREEN=YELLOW
whismanoid 52:d3fb6f1722bf 5710 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5711 led1 = LED_OFF; led2 = LED_OFF; led3 = LED_OFF; // diagnostic rbg led BLACK
whismanoid 52:d3fb6f1722bf 5712 ThisThread::sleep_for(125); // [since mbed-os-5.10] vs Thread::wait(125);
whismanoid 52:d3fb6f1722bf 5713 #else // not defined(TARGET_LPC1768 etc.)
whismanoid 52:d3fb6f1722bf 5714 led1 = LED_ON;
whismanoid 52:d3fb6f1722bf 5715 led2 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5716 led3 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5717 led4 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5718 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5719 //led1 = LED_ON;
whismanoid 52:d3fb6f1722bf 5720 led2 = LED_ON;
whismanoid 52:d3fb6f1722bf 5721 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5722 led1 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5723 //led2 = LED_ON;
whismanoid 52:d3fb6f1722bf 5724 led3 = LED_ON;
whismanoid 52:d3fb6f1722bf 5725 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5726 led2 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5727 //led3 = LED_ON;
whismanoid 52:d3fb6f1722bf 5728 led4 = LED_ON;
whismanoid 52:d3fb6f1722bf 5729 ThisThread::sleep_for(75); // [since mbed-os-5.10] vs Thread::wait(75);
whismanoid 52:d3fb6f1722bf 5730 led3 = LED_OFF;
whismanoid 52:d3fb6f1722bf 5731 led4 = LED_ON;
whismanoid 52:d3fb6f1722bf 5732 //
whismanoid 52:d3fb6f1722bf 5733 #endif // target definition
whismanoid 52:d3fb6f1722bf 5734 #endif
whismanoid 52:d3fb6f1722bf 5735
whismanoid 52:d3fb6f1722bf 5736 // cmd_TE();
whismanoid 52:d3fb6f1722bf 5737
whismanoid 52:d3fb6f1722bf 5738 // #if USE_LEDS
whismanoid 52:d3fb6f1722bf 5739 // rgb_led.white(); // diagnostic rbg led RED+GREEN+BLUE=WHITE
whismanoid 52:d3fb6f1722bf 5740 // #endif // USE_LEDS
whismanoid 57:dc118969c848 5741 if (led1.is_connected()) {
whismanoid 57:dc118969c848 5742 led1 = LED_ON;
whismanoid 57:dc118969c848 5743 }
whismanoid 57:dc118969c848 5744 if (led2.is_connected()) {
whismanoid 57:dc118969c848 5745 led2 = LED_ON;
whismanoid 57:dc118969c848 5746 }
whismanoid 57:dc118969c848 5747 if (led3.is_connected()) {
whismanoid 57:dc118969c848 5748 led3 = LED_ON;
whismanoid 57:dc118969c848 5749 }
whismanoid 52:d3fb6f1722bf 5750
whismanoid 52:d3fb6f1722bf 5751 InitializeConfiguration();
whismanoid 52:d3fb6f1722bf 5752 // example code: serial port banner message
whismanoid 52:d3fb6f1722bf 5753 #if defined(TARGET_MAX32625MBED)
whismanoid 52:d3fb6f1722bf 5754 serial.printf("MAX32625MBED ");
whismanoid 52:d3fb6f1722bf 5755 #elif defined(TARGET_MAX32600MBED)
whismanoid 52:d3fb6f1722bf 5756 serial.printf("MAX32600MBED ");
whismanoid 52:d3fb6f1722bf 5757 #elif defined(TARGET_NUCLEO_F446RE)
whismanoid 52:d3fb6f1722bf 5758 serial.printf("NUCLEO_F446RE ");
whismanoid 52:d3fb6f1722bf 5759 #endif
whismanoid 52:d3fb6f1722bf 5760 serial.printf("MAX11410BOB\r\n");
whismanoid 52:d3fb6f1722bf 5761
whismanoid 52:d3fb6f1722bf 5762
whismanoid 52:d3fb6f1722bf 5763 while (1) {
whismanoid 52:d3fb6f1722bf 5764 #if HAS_BUTTON1_DEMO_INTERRUPT_POLLING
whismanoid 52:d3fb6f1722bf 5765 // avoid runtime error on button1 press [mbed-os-5.11]
whismanoid 52:d3fb6f1722bf 5766 // instead of using InterruptIn, use DigitalIn and poll in main while(1)
whismanoid 52:d3fb6f1722bf 5767 # if HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5768 static int button1_value_prev = 1;
whismanoid 52:d3fb6f1722bf 5769 static int button1_value_now = 1;
whismanoid 52:d3fb6f1722bf 5770 button1_value_prev = button1_value_now;
whismanoid 52:d3fb6f1722bf 5771 button1_value_now = button1.read();
whismanoid 52:d3fb6f1722bf 5772 if ((button1_value_prev - button1_value_now) == 1)
whismanoid 52:d3fb6f1722bf 5773 {
whismanoid 52:d3fb6f1722bf 5774 // on button1 falling edge (button1 press)
whismanoid 52:d3fb6f1722bf 5775 onButton1FallingEdge();
whismanoid 52:d3fb6f1722bf 5776 }
whismanoid 52:d3fb6f1722bf 5777 # endif // HAS_BUTTON1_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5778 # if HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5779 static int button2_value_prev = 1;
whismanoid 52:d3fb6f1722bf 5780 static int button2_value_now = 1;
whismanoid 52:d3fb6f1722bf 5781 button2_value_prev = button2_value_now;
whismanoid 52:d3fb6f1722bf 5782 button2_value_now = button2.read();
whismanoid 52:d3fb6f1722bf 5783 if ((button2_value_prev - button2_value_now) == 1)
whismanoid 52:d3fb6f1722bf 5784 {
whismanoid 52:d3fb6f1722bf 5785 // on button2 falling edge (button2 press)
whismanoid 52:d3fb6f1722bf 5786 onButton2FallingEdge();
whismanoid 52:d3fb6f1722bf 5787 }
whismanoid 52:d3fb6f1722bf 5788 # endif // HAS_BUTTON2_DEMO_INTERRUPT
whismanoid 52:d3fb6f1722bf 5789 #endif
whismanoid 52:d3fb6f1722bf 5790 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5791 if (DAPLINKserial.readable()) {
whismanoid 52:d3fb6f1722bf 5792 cmdLine_DAPLINKserial.append(DAPLINKserial.getc());
whismanoid 52:d3fb6f1722bf 5793 }
whismanoid 52:d3fb6f1722bf 5794 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5795 if (serial.readable()) {
whismanoid 52:d3fb6f1722bf 5796 int c = serial.getc();
whismanoid 52:d3fb6f1722bf 5797 cmdLine_serial.append(c);
whismanoid 52:d3fb6f1722bf 5798 #if IGNORE_AT_COMMANDS
whismanoid 52:d3fb6f1722bf 5799 # if HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5800 cmdLine_DAPLINKserial.serial().printf("%c", c);
whismanoid 52:d3fb6f1722bf 5801 # endif // HAS_DAPLINK_SERIAL
whismanoid 52:d3fb6f1722bf 5802 #endif // IGNORE_AT_COMMANDS
whismanoid 52:d3fb6f1722bf 5803 //
whismanoid 52:d3fb6f1722bf 5804 }
whismanoid 52:d3fb6f1722bf 5805 } // while(1)
whismanoid 52:d3fb6f1722bf 5806 }
whismanoid 52:d3fb6f1722bf 5807 //---------- CODE GENERATOR: end testMainCppCodeList