|
| 1 | + |
| 2 | + |
| 3 | +/****************************************************************************** |
| 4 | + * @file node_config.h |
| 5 | + * @brief This file allow you to use standard preprocessor definitions to |
| 6 | + * configure your project, Luos and Luos HAL libraries |
| 7 | + * |
| 8 | + * # Introduction |
| 9 | + * This file is for the luos user. You may here configure your project and |
| 10 | + * define your custom Luos service and custom Luos command for your product |
| 11 | + * |
| 12 | + * Luos libraries offer a minimal standard configuration to optimize |
| 13 | + * memory usage. In some case you have to modify standard value to fit |
| 14 | + * with your need concerning among of data transiting through the network |
| 15 | + * or network speed for example |
| 16 | + * |
| 17 | + * Luos libraries can be use with a lot a MCU family. Luos compagny give you |
| 18 | + * a default configuration, for specific MCU family, in robus_hal_config.h. |
| 19 | + * This configuration can be modify here to fit with you design by |
| 20 | + * preprocessor definitions of MCU Hardware needs |
| 21 | + * |
| 22 | + * # Usage |
| 23 | + * This file should be place a the root folder of your project and include |
| 24 | + * where build flag preprocessor definitions are define in your IDE |
| 25 | + * -include node_config.h |
| 26 | + * |
| 27 | + * @author Luos |
| 28 | + * @version 0.0.0 |
| 29 | + ******************************************************************************/ |
| 30 | +#ifndef _NODE_CONFIG_H_ |
| 31 | +#define _NODE_CONFIG_H_ |
| 32 | + |
| 33 | +/******************************************************************************* |
| 34 | + * PROJECT DEFINITION |
| 35 | + *******************************************************************************/ |
| 36 | + |
| 37 | +/******************************************************************************* |
| 38 | + * LUOS LIBRARY DEFINITION |
| 39 | + ******************************************************************************* |
| 40 | + * Define | Default Value | Description |
| 41 | + * :---------------------|------------------------------------------------------ |
| 42 | + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node |
| 43 | + * MAX_NODE_NUMBER | 20 | Node number in the device |
| 44 | + * MAX_SERVICE_NUMBER | 20 | Service number in the device |
| 45 | + * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX |
| 46 | + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer |
| 47 | + * NBR_PORT | 2 | PTP Branch number Max 8 |
| 48 | + * NBR_RETRY | 10 | Send Retry number in case of NACK or collision |
| 49 | + ******************************************************************************/ |
| 50 | +#define MAX_LOCAL_SERVICE_NUMBER 2 |
| 51 | +#define MAX_LOCAL_PROFILE_NUMBER 1 |
| 52 | +#define MAX_MSG_NB 200 |
| 53 | +#define MSG_BUFFER_SIZE 8192 |
| 54 | + |
| 55 | +/******************************************************************************* |
| 56 | + * LUOS HAL LIBRARY DEFINITION |
| 57 | +******************************************************************************* |
| 58 | + * Define | Description |
| 59 | + * :-----------------------|----------------------------------------------- |
| 60 | + * MCUFREQ | Put your the MCU frequency (value in Hz) |
| 61 | + * TIMERDIV | Timer divider clock (see your clock configuration) |
| 62 | + * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU |
| 63 | + * USE_TX_IT | define to 1 to not use DMA transfers for Luos Tx |
| 64 | + * |
| 65 | + * PORT_CLOCK_ENABLE | Enable clock for port |
| 66 | + * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ |
| 67 | + * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ |
| 68 | + * RX_EN | Rx enable for driver RS485 always on Pin/Port |
| 69 | + * TX_EN | Tx enable for driver RS485 Pin/Port |
| 70 | + * COM_TX | Tx USART Com Pin/Port/Alternate |
| 71 | + * COM_RX | Rx USART Com Pin/Port/Alternate |
| 72 | + * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler |
| 73 | +
|
| 74 | + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART |
| 75 | + * ROBUS_COM | USART number |
| 76 | + * ROBUS_COM_IRQ | USART IRQ number |
| 77 | + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler |
| 78 | +
|
| 79 | + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA |
| 80 | + * ROBUS_DMA | DMA number |
| 81 | + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) |
| 82 | +
|
| 83 | + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer |
| 84 | + * ROBUS_TIMER | Timer number |
| 85 | + * ROBUS_TIMER_IRQ | Timer IRQ number |
| 86 | + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler |
| 87 | +******************************************************************************/ |
| 88 | + |
| 89 | +/******************************************************************************* |
| 90 | + * FLASH CONFIGURATION FOR APP WITH BOOTLOADER |
| 91 | + ******************************************************************************** |
| 92 | + * Define | Default Value | Description |
| 93 | + * :---------------------|------------------------------------------------------ |
| 94 | + * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash |
| 95 | + * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag |
| 96 | + * APP_START_ADDRESS | 0x0800C800 | Start address of application with bootloader |
| 97 | + * APP_END_ADDRESS | FLASH_BANK1_END=0x0801FFFF | End address of application with bootloader |
| 98 | + ******************************************************************************/ |
| 99 | + |
| 100 | +/******************************************************************************* |
| 101 | + * GATE SERIAL COM DEFINITION |
| 102 | + ******************************************************************************* |
| 103 | + * Define | Default Value | Description |
| 104 | + * :-------------------------|------------------------------------------------------ |
| 105 | + * GATE_BUFF_SIZE | 1024 | Json receive buffer size |
| 106 | + * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size |
| 107 | + * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size |
| 108 | + * INIT_TIME | 150 | Wait init time before first detection |
| 109 | + ******************************************************************************/ |
| 110 | +#define GATE_BUFF_SIZE 65000 |
| 111 | +#define PIPE_RX_BUFFER_SIZE 65000 |
| 112 | +#define PIPE_TX_BUFFER_SIZE 65000 |
| 113 | +#define SERIAL_RX_BUFFER_SIZE 65000 |
| 114 | +#define INIT_TIME 150 |
| 115 | +#define GATE_REFRESH_TIME_S 0.05f |
| 116 | +#define SERIAL_PORT "/dev/cu.usbmodem1202" // "/dev/cu.usbserial-D308N897" |
| 117 | + |
| 118 | +#endif /* _NODE_CONFIG_H_ */ |
0 commit comments