26. nqEx
The nqEx object is a built-in object that controls the hardware interface and functions on NEQTO Bridge IO Board and NEQTO Bridge Digital IO Board.
Limitations:
- It can be used only when using NEQTO Bridge IO Board or NEQTO Bridge Digital IO Board.
".getBoardType()" can be used regardless of the hardware configuration.
nqEx Global Object
Methods()/Properties | Summary | Version | note |
---|---|---|---|
.getBoardType() | Gets the IO Board type. | 00.00.27+ | |
.enGPIO() | Enables/Disables the GPIO port. | 00.00.15+ | |
.enUART() | Enables/Disables the UART port. | 00.00.15+ | |
.enI2CS() | Enables/Disables the I2C Short port. | 00.00.15+ | |
.enI2CL() | Enables/Disables the I2C Long port. | 00.00.15+ | |
.enSPI() | Enables/Disables the SPI port. | 01.04.00+ | |
.enADC1() | Enables/Disables the ADC1 port. | 00.00.15+ | |
.enOPA() | Enables/Disables the OPA port. | 00.00.15+ | |
.enI2CMIntOutput() | Enables/Disables the I2C Module interrupt signal output. | 00.00.27+ | |
.enI2CSIntOutput() | Enables/Disables the I2C Short interrupt signal output. | 00.00.27+ | |
.enI2CLIntOutput() | Enables/Disables the I2C Long interrupt signal output. | 00.00.27+ | |
.getGPIO() | Gets the enabled/disabled state of the GPIO port. | 00.00.15+ | |
.getUART() | Gets the enabled/disabled state of the UART port. | 00.00.15+ | |
.getI2CS() | Gets the enabled/disabled state of the I2C Short port. | 00.00.15+ | |
.getI2CL() | Gets the enabled/disabled state of the I2C Long port. | 00.00.15+ | |
.getSPI() | Gets the enabled/disabled state of the SPI port. | 01.04.00+ | |
.getADC1() | Gets the enabled/disabled state of the ADC1 port. | 00.00.15+ | |
.getOPA() | Gets the enabled/disabled state of the OPA port. | 00.00.15+ | |
.getI2CMIntOutput() | Gets the enabled/disabled state of the I2C Module interrupt signal output. | 00.00.27+ | |
.getI2CSIntOutput() | Gets the enabled/disabled state of the I2C Short interrupt signal output. | 00.00.27+ | |
.getI2CLIntOutput() | Gets the enabled/disabled state of the I2C Long interrupt signal output. | 00.00.27+ | |
.getI2CMInt() | Gets the interrupt status of the I2C Module. | 00.00.15+ | |
.getI2CSInt() | Gets the interrupt status of the I2C Short. | 00.00.15+ | |
.getI2CLInt() | Gets the interrupt status of the I2C Long. | 00.00.15+ | |
.getBatteryInfo() | Gets the battery information. | 00.00.24+ | Option |
Details
.getBoardType()
Gets the IO Board type.
Returns the IO Board type detected by the NEQTO Bridge module.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | number | - | IO Board Type 0: None 1: IO Board 2: Digital IO Board |
.enGPIO(sts)
Enables/Disables the GPIO port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enUART(sts)
Enables/Disables the UART port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enI2CS(sts)
Enables/Disables the I2C Short port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enI2CL(sts)
Enables/Disables the I2C Long port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enSPI(sts)
Enables/Disables the SPI port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enADC1(sts)
Enables/Disables the ADC1 port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enOPA(sts)
Enables/Disables the OPA port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enI2CMIntOutput(sts)
Enables/Disables the I2C Module interrupt signal output.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enI2CSIntOutput(sts)
Enables/Disables the I2C Short interrupt signal output.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.enI2CLIntOutput(sts)
Enables/Disables the I2C Long interrupt signal output.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
sts | boolean | mandatory | true: Enabled false: Disabled | |
return | boolean | - | true: Success false: Failure |
.getGPIO()
Gets the enabled/disabled state of the GPIO ports.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getUART()
Gets the enabled/disabled state of the UART port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getI2CS()
Gets the enabled/disabled state of the I2C Short port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getI2CL()
Gets the enabled/disabled state of the I2C Long port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getSPI()
Gets the enabled/disabled state of the SPI port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getADC1()
Gets the enabled/disabled state of the ADC1 port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getOPA()
Gets the enabled/disabled state of the OPA port.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getI2CMIntOutput()
Gets the enabled/disabled state of the I2C Module interrupt signal output.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getI2CSIntOutput()
Gets the enabled/disabled state of the I2C Short interrupt signal output.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getI2CLIntOutput()
Gets the enabled/disabled state of the I2C Long interrupt signal output.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Enabled false: Disabled |
.getI2CMInt()
Gets the interrupt status of the I2C Module.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Interrupt present false: No interrupts |
.getI2CSInt()
Gets the interrupt status of the I2C Short.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Interrupt present false: No interrupts |
.getI2CLInt()
Gets the interrupt status of the I2C Long.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | boolean | - | true: Interrupt present false: No interrupts |
.getBatteryInfo()
Gets the battery information.
Name | Type | M/O | Summary | Note |
---|---|---|---|---|
return | {batInfo} | - | {batInfo} : Battery information |
{batInfo}
Name | Type | Summary | Note |
---|---|---|---|
.conn | boolean | Battery connection status true: Battery connected false: Battery disconnected | |
.status | boolean | Battery status true: Normal false: Errors detected | |
.eventLevel | string | Event level Indicates the importance of the event message. 'fatal' > 'warn' > 'info' | |
.message | string | Event message empty : Battery is empty low : Battery level low half : Battery level half full : Battery full charging : Battery is charging malfunction : Battery failed | This value is valid only when the battery is connected. |
.level | number | Battery level 0: Battery is empty 1: Battery level low 2: Battery level half 3: Battery full 4: Battery is charging 5: Battery failed | This value is valid only when the battery is connected. |
.temp | number | Battery temperature level 0: Low temperature 1: Normal temperature 2: High temperature | This value is valid only when the battery is connected. |
Object Usage Examples
Sample 1
This is a sample that acquires and displays the current battery state.
var battery = nqEx.getBatteryInfo();
if (battery.conn == true) {
print('[' + battery.eventLevel + ']'+ battery.message);
if (battery.status == false) {
print('battery malfunction detected');
} else {
print('battery level : ' + battery.level);
print('battery temprature level: ' + battery.temp);
}
} else {
print('battery is not connected');
}