Modifications

Sauter à la navigation Sauter à la recherche
608 octets ajoutés ,  29 juillet 2017 à 17:09
Ligne 18 : Ligne 18 :     
== Configurer SPI ==
 
== Configurer SPI ==
Bien que SDEP soit neutre is bus neutral, in the case of the Bluefruit LE SPI Friend or Shield, an SPI transport is used with the following constraints and assumptions, largely to take into account the HW limitations of the nRF51822 system on chip:
+
Bien que SDEP soit prévu pour être un protocole neutre vis-à-vis du bus, dans le cas du Bluefruit LE SPI Friend ou du shield BlueFruit LE, le transport SPI est utilisé avec les contraintes et suppositions suivantes, principalement guidés par les limitations matérielles du nRF51822:
    
=== Conditions requises du SPI matérielles ===
 
=== Conditions requises du SPI matérielles ===
* The SPI clock should run <=4MHz
+
* Le signal d'horloge SPI doit être <= 4MHz
* A 100us delay should be added between the moment that the CS line is asserted, and before any data is transmitted on the SPI bus
+
* Un délais de 100µs doit être ajouté entre le moment où la ligne CS est activée et la transmission des premières données sur le bus SPI
* The CS line must remain activée (''asserted'') for the entire packet, rather than toggling CS every byte
+
* La ligne CS doit rester activée (''asserted'') pour tout le paquet de donnée (et non activé pour chaque octet transmit)
* The CS line can however be deasserted and then reasserted between individual SDEP packets (of up to 20 bytes each).* The SPI commands must be setup to transmit MSB ([https://en.wikipedia.org/wiki/Most_significant_bit most significant bit]) first (not LSB first)
+
* La ligne CS peut cependant être activée ou désactivée entre l'envoi de différents paquets SDEP (chaque paquet ayant jusqu'à 20 octets max).
 +
* Les commandes SPI doivent être constituées pour une transmission MSB ([https://en.wikipedia.org/wiki/Most_significant_bit most significant bit]) en premier (le bit le plus significatif en premier).
    
=== Broche IRQ ===
 
=== Broche IRQ ===
The IRQ line is asserted by the Bluefruit LE SPI Friend/Shield as long as an entire SDEP packet is available in the buffer on the nRF51822, at which point you should read the packet, keeping the CS line asserted for the entire transaction (as detailed above).
+
La ligne IRQ est activée par le par le Bluefruit LE Shield (ou Friend) SPI dès que (et aussi longtemps que) un paquet SDEP complet est disponible dans la mémoire tampon (''buffer'') du nRF51822. Vous devriez lire le paquet lorsque l'IRQ (interruption) est activée, garder la ligne CS activée durant la transaction entière (comme détaillé ci-dessous).
   −
The IRQ line will remain asserted as long as one or more packets are available, so the line may stay high after reading a packet, meaning that more packets are still available in the FIFO on the SPI slave side.
+
La ligne IRQ reste activée aussi longtemps qu'un ou plusieurs paquets sont disponibles. Par conséquent, la ligne pourrait rester active après la lecture d'un paquet, cela signifie qu'il reste encore des paquets à lire dans la mémoire tampon FIFO du module SPI esclave.
   −
=== Paquets SDEP et identifaction des erreurs SPI ===
+
FIFO est l'acronyme de ''First In First Out'' qui signifie "Premier Rentré Premier Sorti".  
Once CS has been asserted and the mandatory 100us delay has passed, a single byte should be read from the SPI bus which will indicate the type of payload available on the nRF51822 (see Message Type Indicator below for more information on SDEP message types). Keep CS asserted after this byte has been read in case you need to continue reading the rest of the frame.
     −
If a standard SDEP message type indicator (0x10, 0x20, 0x40 or 0x80) is encountered, keep reading as normal. There are two other indicators that should be taken into account, though, which indicate a problem on the nRF51822 SPI slave side:
+
=== Paquets SDEP et identification des erreurs SPI ===
 +
Une fois la ligne CS activée et le délai de 100µS écoulé, un simple octet devrait être lu sur le bus et ce dernier indiquera le type de payload (paquet) disponible sur le nRF51822 (Voir "''Message Type Indicator''" ci-dessous pour plus d'information sur les types de message SDEP). Gardez la ligne CS active après la lecture de ce premier octet au cas ou vous auriez besoin de poursuivre la lecture de données complémentaire (le restant du payload s'il fait plus d'un octet).
 +
 
 +
Si nous nous trouvons face à un "''Message Type Indicator''" SDEP standard (0x10, 0x20, 0x40 or 0x80) alors nous pouvons poursuivrez normalement la lecture
 +
 
 +
{{traduction}}
 +
There are two other indicators that should be taken into account, though, which indicate a problem on the nRF51822 SPI slave side:
 
* '''0xFE''' : Slave device not ready (wait a bit and try again)
 
* '''0xFE''' : Slave device not ready (wait a bit and try again)
 
* '''0xFF''' : Slave device read overflow indicator (you've read more data than is available)
 
* '''0xFF''' : Slave device read overflow indicator (you've read more data than is available)
29 917

modifications

Menu de navigation