Selaa lähdekoodia

improve implementation in readme

Juraj Ďuďák 1 vuosi sitten
vanhempi
commit
93e742058d
2 muutettua tiedostoa jossa 27 lisäystä ja 1 poistoa
  1. 6 0
      Inc/nbus_config.h.default
  2. 21 1
      README.md

+ 6 - 0
Inc/nbus_config.h.default

@@ -25,6 +25,7 @@
 
 #define MODULE_FSR 	1		
 #define MODULE_IMU 	2
+#define MODULE_GNOSTIC_DISTANCE 	3
 
 #define MODULE MODULE_FSR
 
@@ -42,6 +43,11 @@
 #endif
 
 
+#if MODULE == MODULE_GNOSTIC_DISTANCE
+	// MUST BE 3 BYTE LONG
+	#define MODULE_TYPE "GNS"
+	#define MODULE_INIT_IP_ADC
+#endif
 
 #define CRC8_INIT_VALUE	0x0
 

+ 21 - 1
README.md

@@ -37,6 +37,25 @@ static  inline  void  nbus_app_TIM_periodElapsed(){
 ```
 ###  Practical integration
 
+**Include file**
+Copy file ``nbus_config.h.default`` to your project and rename it to ``nbus_config.h``
+These are important configuration settings:
+- MODULE_ADDRESS - address of module. Allowed values are from 1 to 31
+- MODULE_MASTER - Master module functionality. Allowed values are 0,1.
+- MODULE_SLAVE - Slave module functionality. Allowed values are 0,1.
+- MODULE_NAME - name of developed module. Max 8 chars.
+- MODULE - type of slave module. Use of these constat
+  - MODULE_DUMMY
+  - MODULE_FSR
+  - MODULE_IMU
+  - MODULE_GNOSTIC_DISTANCE
+- UART_BAUDRATE - Uart baudrate. This communication speed have to be set in your application
+
+Include following header file to project:
+```c
+#include  "nbus_app.h"
+```
+
 **Create platform driver**
 ```c
 nBusPlatformInterface_t hw_platform ={
@@ -90,10 +109,11 @@ nbus_init_memory_driver(&memory_ec20, 16);  // pass memory driver to nBus
 ```
 
 ***Run application stack***
-
+The function ``nbus_stack()`` contains of application loop.
 ```c
 nbus_stack();
 ```
+
 ## nBus interface
 nBus interface is pointer to structure ``nBusAppInterface_t``. It contains these functions:
 - ``void  init(void *hw_interface, void *hw_config);``