Modifications

Sauter à la navigation Sauter à la recherche
5 420 octets ajoutés ,  3 juin 2017 à 14:58
Ligne 46 : Ligne 46 :  
OK</nowiki>
 
OK</nowiki>
    +
== AT+HWGETDIETEMP ==
 +
Gets the temperature in degree celcius of the BLE module's die.  This can be used for debug purposes (higher die temperature generally means higher current consumption), but does not corresponds to ambient temperature and can nto be used as a replacement for a normal temperature sensor.
 +
 +
* Codebase Revision: 0.3.0
 +
* Parameters: None
 +
* Output: The die temperature in degrees celcius
 +
 +
<nowiki>AT+HWGETDIETEMP
 +
32.25
 +
OK</nowiki>
 +
 +
== AT+HWGPIO ==
 +
Gets or sets the value of the specified GPIO pin (depending on the pin's mode).
 +
 +
* Codebase Revision: 0.3.0
 +
* Parameters: The parameters for this command change depending on the pin mode.
 +
 +
=== GPIO en sortie ===
 +
OUTPUT MODE: The following comma-separated parameters can be used when updating a pin that is set as an output:
 +
 +
* Pin numbers
 +
* Pin state, where:
 +
** 0 = clear the pin (logic low/GND)
 +
** 1 = set the pin (logic high/VCC)
 +
 +
=== GPIO en entrée ===
 +
INPUT MODE: To read the current state of an input pin or a pin that has been configured as an output, enter the pin number as a single parameter.
 +
 +
* Output: The pin state if you are reading an input or checking the state of an input pin (meaning only 1 parameter is supplied, the pin number), where:
 +
** 0 means the pin is logic low/GND
 +
** 1 means the pin is logic high/VCC
 +
 +
=== Recommendation ===
 +
{{ambox-stop|text=Trying to set the value of a pin that has not been configured as an output will produce an 'ERROR' response.}}
 +
{{ambox-stop|text=Some pins are reserved for specific functions on Bluefruit modules and can not be used as GPIO. If you try to make use of a reserved pin number an 'ERROR' response will be generated. }}
 +
 +
=== Exemples ===
 +
<nowiki># Set pin 14 HIGH
 +
AT+HWGPIO=14,1
 +
OK
 +
 
 +
# Set pin 14 LOW
 +
AT+HWGPIO=14,0
 +
OK
 +
 
 +
# Read the current state of pin 14
 +
AT+HWGPIO=14
 +
0
 +
OK
 +
 
 +
# Try to update a pin that is not set as an output
 +
AT+HWGPIOMODE=14,0
 +
OK
 +
AT+HWGPIO=14,1
 +
ERROR</nowiki>
 +
 +
== AT+HWGPIOMODE ==
 +
This will set the mode for the specified GPIO pin (input, output, etc.).
 +
 +
* Codebase Revision: 0.3.0
 +
* Parameters: This command one or two values (comma-separated in the case of two parameters being used):
 +
** The pin number
 +
** The new GPIO mode, where:
 +
*** 0 = Input
 +
*** 1 = Output
 +
*** 2 = Input with pullup enabled
 +
*** 3 = Input with pulldown enabled
 +
* Output: If a single parameters is passed (the GPIO pin number) the current pin mode will be returned.
 +
 +
{{ambox-stop|text=Some pins are reserved for specific functions on Bluefruit modules and can not be used as GPIO. If you try to make use of a reserved pin number an 'ERROR' response will be generated. }}
 +
 +
<nowiki># Configure pin 14 as an output
 +
AT+HWGPIOMODE=14,0
 +
OK
 +
 +
# Get the current mode for pin 14
 +
AT+HWPGIOMODE=14
 +
0
 +
OK</nowiki>
 +
 +
== AT+HWI2CSCAN ==
 +
Scans the I2C bus to try to detect any connected I2C devices, and returns the address of devices that were found during the scan process.
 +
 +
* Codebase Revision: 0.3.0
 +
* Parameters: None
 +
* Output: A comma-separated list of any I2C address that were found while scanning the valid address range on the I2C bus, or nothing is no devices were found.
 +
 +
<nowiki># I2C scan with two devices detected
 +
AT+HWI2CSCAN
 +
0x23,0x35
 +
OK
 +
 +
# I2C scan with no devices detected
 +
AT+HWI2CSCAN
 +
OK</nowiki>
 +
 +
== AT+HWVBAT ==
 +
Returns the main power supply voltage level in millivolts
 +
* Codebase Revision: 0.3.0
 +
* Parameters: None
 +
* Output: The VBAT level in millivolts
 +
 +
<nowiki>AT+HWVBAT
 +
3248
 +
OK</nowiki>
 +
 +
== AT+HWRANDOM ==
 +
Generates a random 32-bit number using the HW random number generator on the nRF51822 (based on white noise).
 +
* Codebase Revision: 0.4.7
 +
* Parameters: None
 +
* Output: A random 32-bit hexadecimal value (ex. '0x12345678')
 +
 +
<nowiki>AT+HWRANDOM
 +
0x769ED823
 +
OK</nowiki>
 +
 +
== AT+HWMODELED ==
 +
Allows you to override the default behaviour of the MODE led (which indicates the operating mode by default).
 +
 +
* Codebase Revision: 0.6.6
 +
* Parameters: LED operating mode, which can be one of the following values:
 +
** '''disable''' or '''DISABLE''' or '''0''' - Disable the MODE LED entirely to save power
 +
** '''mode''' or '''MODE''' or '''1''' - Default behaviour, indicates the current operating mode
 +
** '''hwuart''' or '''HWUART''' or '''2''' - Toggles the LED on any activity on the HW UART bus (TX or RX)
 +
** '''bleuart''' or '''BLEUART''' or '''3''' - Toggles the LED on any activity on the BLE UART Service (TX or RX characteristic)
 +
** '''spi''' or '''SPI''' or '''4''' - Toggles the LED on any SPI activity
 +
** '''manual''' or '''MANUAL''' or '''5''' - Manually sets the state of the MODE LED via a second comma-separated parameter, which can be on, off, or toggle.
 +
* Output: If run with no parameters, returns an upper-case string representing the current MODE LED operating mode from the fields above
 +
 +
<nowiki># Get the curent MODE LED setting
 +
AT+HWMODELED
 +
MODE
 +
OK
 +
 
 +
# Change the MODE LED to indicate BLE UART activity
 +
AT+HWMODELED=BLEUART
 +
OK
 +
 +
# Manually toggle the MODE LED
 +
AT+HWMODELED=MANUAL,TOGGLE
 +
OK</nowiki>
 +
 +
== AT+UARTFLOW ==
 +
Enables or disable hardware flow control (CTS + RTS) on the UART peripheral block of the nRF51822.
 +
 +
* Codebase Revision: 0.7.0
 +
* Parameters: HW flow control state, which can be one of:
 +
** on
 +
** off
 +
** 0
 +
** 1
 +
* Output: If run with no parameters, returns a number representing whether flow control is enabled (1) or disabled (0).
 +
 +
<nowiki># Check the current flow control state
 +
AT+UARTFLOW
 +
1
 +
OK
 +
 +
# Disable HW flow control
 +
AT+UARTFLOW=off
 +
OK</nowiki>
 
{{Bluefruit-LE-Shield-TRAILER}}
 
{{Bluefruit-LE-Shield-TRAILER}}
29 917

modifications

Menu de navigation