1 | /* |
2 | * Copyright 2019 NXP |
3 | * |
4 | * SPDX-License-Identifier: BSD-3-Clause |
5 | * |
6 | * FreeMASTER Communication Driver - User Configuration File |
7 | */ |
8 | |
9 | #ifndef __FREEMASTER_CFG_H |
10 | #define __FREEMASTER_CFG_H |
11 | |
12 | // Make sure the FMSTR_TRANSPORT and related low-level communication driver is selected below. |
13 | // Also make sure the low-level module and device pins are properly initialized in the main() |
14 | // function and that FMSTR_Init() and FMSTR_Poll() functions are called from the main application loop. |
15 | // See freemaster_examples/fmstr_uart example application for more information. |
16 | |
17 | //////////////////////////////////////////////////////////////////////////////// |
18 | // Definitions |
19 | //////////////////////////////////////////////////////////////////////////////// |
20 | #define FMSTR_PLATFORM_CORTEX_M 1 /* Cortex-M platform (see freemaster.h for list of all supported platforms) */ |
21 | |
22 | //! Set the demo application configuration |
23 | #define FMSTR_DEMO_ENOUGH_ROM 1 /* Platform has enough ROM to show most of the FreeMASTER features */ |
24 | #define FMSTR_DEMO_LARGE_ROM 1 /* Platform has large ROM enough to store the extended data structures used in FreeMASTER demo */ |
25 | #define FMSTR_DEMO_SUPPORT_I64 1 /* support for long long type */ |
26 | #define FMSTR_DEMO_SUPPORT_FLT 1 /* support for float type */ |
27 | #define FMSTR_DEMO_SUPPORT_DBL 1 /* support for double type */ |
28 | |
29 | //! Enable/Disable FreeMASTER support as a whole |
30 | #define FMSTR_DISABLE 0 // To disable all FreeMASTER functionalities |
31 | |
32 | //! Select interrupt or poll-driven serial communication |
33 | #define FMSTR_LONG_INTR 0 // Complete message processing in interrupt |
34 | #define FMSTR_SHORT_INTR 1 // Queuing done in interrupt |
35 | #define FMSTR_POLL_DRIVEN 0 // No interrupt needed, polling only |
36 | |
37 | // List of standard FreeMASTER transports and their low-level drivers. See more options in src/drivers. |
38 | // FMSTR_SERIAL - Standard serial transport protocol (Used by various types of UART peripherals as USB CDC implementation) |
39 | // FMSTR_SERIAL_MCUX_UART - MCUXSDK driver for UART peripheral |
40 | // FMSTR_SERIAL_MCUX_LPUART - MCUXSDK driver for LPUART peripheral |
41 | // FMSTR_SERIAL_MCUX_USART - MCUXSDK driver for USART peripheral |
42 | // FMSTR_SERIAL_MCUX_MINIUSART -MCUXSDK driver for MINIUSART peripheral |
43 | // FMSTR_SERIAL_MCUX_USB - MCUXSDK driver for USB peripheral with CDC class |
44 | // FMSTR_CAN - Standard CAN transport protocol (Used by various types of CAN peripherals) |
45 | // FMSTR_CAN_MCUX_FLEXCAN - MCUXSDK driver for FlexCAN peripheral |
46 | // FMSTR_CAN_MCUX_MCAN - MCUXSDK driver for MCAN peripheral |
47 | // FMSTR_CAN_MCUX_MSCAN - MCUXSDK driver for msCAN peripheral |
48 | // FMSTR_PDBDM - Packet Driven BDM (direct memory access via JTAG, SWD or BDM debug probes). No low-level driver used. |
49 | |
50 | //! Select communication interface |
51 | #define FMSTR_TRANSPORT FMSTR_SERIAL |
52 | #define FMSTR_SERIAL_DRV FMSTR_SERIAL_MCUX_LPUART |
53 | #define FMSTR_CAN_DRV FMSTR_SERIAL_MCUX_FLEXCAN |
54 | |
55 | //! Define communication interface base address or leave undefined for runtime setting |
56 | //#define FMSTR_SERIAL_BASE LPUART1_BASE // Serial base will be assigned in runtime (when FMSTR_USE_UART) |
57 | //#define FMSTR_CAN_BASE LPUART1_BASE // CAN base will be assigned in runtime (when FMSTR_USE_FLEXCAN) |
58 | |
59 | //! FlexCAN-specific, communication message buffers |
60 | #define FMSTR_FLEXCAN_TXMB 0 |
61 | #define FMSTR_FLEXCAN_RXMB 1 |
62 | |
63 | //! Input/output communication buffer size |
64 | #define FMSTR_COMM_BUFFER_SIZE 0 // Set to 0 for "automatic" |
65 | |
66 | //! Receive FIFO queue size (use with FMSTR_SHORT_INTR only) |
67 | #define FMSTR_COMM_RQUEUE_SIZE 0 // Set to 0 for "default" |
68 | |
69 | //! Support for Application Commands |
70 | #define FMSTR_USE_APPCMD 0 // Enable/disable App.Commands support |
71 | #define FMSTR_APPCMD_BUFF_SIZE 0 // App.Command data buffer size |
72 | #define FMSTR_MAX_APPCMD_CALLS 1 // How many app.cmd callbacks? (0=disable) |
73 | |
74 | //! Oscilloscope support |
75 | #define FMSTR_USE_SCOPE 1 // Specify number of supported oscilloscopes |
76 | #define FMSTR_MAX_SCOPE_VARS 8 // Specify maximum number of scope variables per one oscilloscope |
77 | |
78 | //! Recorder support |
79 | #define FMSTR_USE_RECORDER 1 // Specify number of supported recorders |
80 | |
81 | //! Built-in recorder buffer |
82 | #define FMSTR_REC_BUFF_SIZE 1024 // Built-in buffer size of recorder #0. Set to 0 to use runtime settings. |
83 | |
84 | //! Recorder time base, specifies how often the recorder is called in the user app. |
85 | #define FMSTR_REC_TIMEBASE 0 // 0 = "unknown" |
86 | #define FMSTR_REC_FLOAT_TRIG 1 // Enable/disable floating point triggering |
87 | |
88 | // Target-side address translation (TSA) |
89 | #define FMSTR_USE_TSA 0 // Enable TSA functionality |
90 | #define FMSTR_USE_TSA_INROM 0 // TSA tables declared as const (put to ROM) |
91 | #define FMSTR_USE_TSA_SAFETY 0 // Enable/Disable TSA memory protection |
92 | #define FMSTR_USE_TSA_DYNAMIC 0 // Enable/Disable TSA entries to be added also in runtime |
93 | |
94 | // Pipes as data streaming over FreeMASTER protocol |
95 | #define FMSTR_USE_PIPES 1 // Specify number of supported pipe objects |
96 | |
97 | // Enable/Disable read/write memory commands |
98 | #define FMSTR_USE_READMEM 1 // Enable read memory commands |
99 | #define FMSTR_USE_WRITEMEM 1 // Enable write memory commands |
100 | #define FMSTR_USE_WRITEMEMMASK 1 // Enable write memory bits commands |
101 | |
102 | // Define password for access levels to protect them. AVOID SHORT PASSWORDS in production version. |
103 | // Passwords should be at least 20 characters long to prevent dictionary attacks. |
104 | // #define FMSTR_RESTRICTED_ACCESS_R_PASSWORD "r" // Read-only access level password. Let undefined when no password is required. |
105 | // #define FMSTR_RESTRICTED_ACCESS_RW_PASSWORD "rw" // Write access level password. Let undefined to set the same as for read-only access level. |
106 | // #define FMSTR_RESTRICTED_ACCESS_RWF_PASSWORD "rwf" // Flash access level password. Let undefined to set the same as for write access level. |
107 | |
108 | // Storing cleartext passwords in Flash memory is not safe, consider storing their SHA1 hash instead |
109 | // Even with this option, the hash must be generated from reasonably complex password to prevent dictionary attack. |
110 | #define FMSTR_USE_HASHED_PASSWORDS 0 // When non-zero, the passwords above are specified as a pointer to 20-byte SHA1 hash of password text |
111 | #endif /* __FREEMASTER_CFG_H */ |
112 | |
113 | //////////////////////////////////////////////////////////////////////////////// |
114 | // EOF |
115 | //////////////////////////////////////////////////////////////////////////////// |
116 | |