Maxim Integrated / Mbed OS MAX11410BOB_Serial_Tester

Dependencies:   MaximTinyTester MAX11410 CmdLine USBDevice

Committer:
whismanoid
Date:
Mon Apr 13 11:16:21 2020 +0000
Revision:
64:5e9555fda955
Parent:
63:708490d6a29f
Child:
66:663bf97b8cf2
rename CMD_r000_1110_xxdd_xddd_PGA to CMD_r000_1110_00ss_0ggg_PGA; ; Measure_RTD() add rtd_filter=0x34 rtd_ctrl=0x41 rtd_source=0x0B rtd_pga=0x21;

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