Bluefruit-LE-Shield-Hardware
En cours de traduction/élaboration. |
Commandes matériel
Les commandes suivantes vous permettent d'interagir avec la bas niveau matériel du module Bluefruit LE. Vous pourrez lire et modifier l'état des GPIO, effectuer une conversion Analogique-vers-digital (ADC), etc.
AT+BAUDRATE
Change le débit (baud rate en anglais) utilisé par l'UART matériel du nRF51822.
- Codebase Revision: 0.7.0
- Paramètres: débit en bauds. Doit être une des valeurs suivantes:
- 1200
- 2400
- 4800
- 9600
- 14400
- 19200
- 28800
- 38400
- 57600
- 76800
- 115200
- 230400
- 250000
- 460800
- 921600
- 1000000
- Sortie: Le configuration courante du débit
# Fixe le débit à 115200 bauds AT+BAUDRATE=115200 OK # Vérifier la configuration du débit AT+BAUDRATE 115200 OK
AT+HWADC
Effectue une conversion ADC (analogique vers digital) pour une broche ADC spécifique
- Codebase Revision: 0.3.0
- Paramètres: Le canal ADC (0..7)
- Sortie: Le résultat de la conversion ADC
AT+HWADC=0 178 OK
AT+HWGETDIETEMP
Obtenir la température (en degrés Celcius) du composant BLE. Peut être utilisé pour faire du débogage (un courant plus élevé signifie généralement une consommation de courant plus important). Cette information ne correspond pas à la température ambiante et ne peut donc pas être utilisé pour remplacer un senseur de température normal.
- Codebase Revision: 0.3.0
- Paramètres: Aucun
- Sortie: Le température du composant BLE (en degré Celcuis)
AT+HWGETDIETEMP 32.25 OK
AT+HWGPIO
Lire ou fixer la valeur de la broche GPIO spécifiée (en fonction du mode de la broche).
- Codebase Revision: 0.3.0
- Paramètres: les paramètres de cette commande changent en fonction du mode de la broche.
GPIO en sortie
MODE DE SORTIE/OUTPUT MODE: Les paramètres suivants (séparés par des virgules) peuvent être utilisés pour modifier l'état d'une broche configurée en sortie:
- Numéro de broche
- Etat de la broche, où:
- 0 = désactive la broche (Niveau logique bas/LOW/GND)
- 1 = active la broche (Niveau logique haut/HIGH/VCC)
GPIO en entrée
MODE ENTREE/INPUT MODE: Pour lire létat actuel d'une broche en entrée (ou lire l'état d'une broche en sortie). Utiliser le numéro de broche comme le seul paramètre de la commande.
- Sortie: L'état de la broche si vous lisez une entrée (ou vérifiez l'état de sortie d'une broche). La valeur retournée est:
- 0 signifiant que la broche est au niveau logique bas/LOW/GND
- 1 signifiant que la broche est au niveai logique haut/HIGH/VCC
Recommendation
Essayer de fixer l'état d'une broche qui n'a pas encore été configurée produira la réponse 'ERROR'. |
Certaines broches du BlueFruit LE sont réservée pour des fonctions spécifiques. Ces broches ne peuvent pas être utilisées comme GPIO. La commande génèrera une erreur si vous essayez d'utiliser ces numéros réservés. |
Exemples
# Place la broche 14 au niveau haut/HIGH AT+HWGPIO=14,1 OK # Place la broche 14 au niveau bas/LOW AT+HWGPIO=14,0 OK # Lire l'état de la broche 14 14 AT+HWGPIO=14 0 OK # Essayer de modifier une broche qui n'est pas # configuré en sortie/output AT+HWGPIOMODE=14,0 OK AT+HWGPIO=14,1 ERROR
AT+HWGPIOMODE
This will set the mode for the specified GPIO pin (input, output, etc.).
- Codebase Revision: 0.3.0
- Paramètres: This command one or two values (comma-separated in the case of two Paramètres being used):
- The pin number
- The new GPIO mode, where:
- 0 = Input
- 1 = Output
- 2 = Input with pullup enabled
- 3 = Input with pulldown enabled
- Sortie: If a single Paramètres is passed (the GPIO pin number) the current pin mode will be returned.
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. |
# Configure pin 14 as an output AT+HWGPIOMODE=14,0 OK # Get the current mode for pin 14 AT+HWPGIOMODE=14 0 OK
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
- Paramètres: None
- Sortie: 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.
# I2C scan with two devices detected AT+HWI2CSCAN 0x23,0x35 OK # I2C scan with no devices detected AT+HWI2CSCAN OK
AT+HWVBAT
Returns the main power supply voltage level in millivolts
- Codebase Revision: 0.3.0
- Paramètres: None
- Sortie: The VBAT level in millivolts
AT+HWVBAT 3248 OK
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
- Paramètres: None
- Sortie: A random 32-bit hexadecimal value (ex. '0x12345678')
AT+HWRANDOM 0x769ED823 OK
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
- Paramètres: 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.
- Sortie: If run with no Paramètres, returns an upper-case string representing the current MODE LED operating mode from the fields above
# 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
AT+UARTFLOW
Enables or disable hardware flow control (CTS + RTS) on the UART peripheral block of the nRF51822.
- Codebase Revision: 0.7.0
- Paramètres: HW flow control state, which can be one of:
- on
- off
- 0
- 1
- Sortie: If run with no Paramètres, returns a number representing whether flow control is enabled (1) or disabled (0).
# Check the current flow control state AT+UARTFLOW 1 OK # Disable HW flow control AT+UARTFLOW=off OK
Basé sur "Bluefruit LE Shield" d'Adafruit Industries, écrit par
Kevin Townsend - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction".
Based on "Bluefruit LE Shield" from Adafruit Industries, written by
Kevin Townsend - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit).
Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com