This is code is part of a Technion course project in advanced IoT, implementing a device to receive and present sensors data from a Formula racing car built by students at Technion - Israel Institute of Technology.

Dependencies:   mbed Buffer

Fork of DISCO-L072CZ-LRWAN1_LoRa_PingPong by ST

This is code is part of a Technion course project in advanced IoT, implementing a device to receive sensors data from another L072CZ-LRWAN1 installed on a Formula racing car (built by students at Technion - Israel Institute of Technology), and sends it to a GUI presenting the data (GUI project: github.com/ward-mattar/TechnionFormulaGUI).

How to install

  • Create an account on Mbed: https://os.mbed.com/account/signup/
  • Import project into Compiler
  • In the Program Workspace select "Formula_Nucleo_Receiver"
  • Select a Platform like so:
  1. Click button at top-left
  2. Add Board
  3. Search "NUCLEO F103RB" and then "Add to your Mbed Compiler"
  • Finally click "Compile", if the build was successful, the binary would download automatically
  • To install it on device simply plug it in to a PC, open device drive and drag then drop binary file in it
Committer:
wardm
Date:
Sat May 19 15:42:38 2018 +0000
Revision:
12:046346a16ff4
V1.0.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wardm 12:046346a16ff4 1 /*---------------------------------------------------------------------------/
wardm 12:046346a16ff4 2 / FatFs - FAT file system module configuration file R0.11a (C)ChaN, 2015
wardm 12:046346a16ff4 3 /---------------------------------------------------------------------------*/
wardm 12:046346a16ff4 4
wardm 12:046346a16ff4 5 #define _FFCONF 64180 /* Revision ID */
wardm 12:046346a16ff4 6
wardm 12:046346a16ff4 7 #define FFS_DBG 0
wardm 12:046346a16ff4 8
wardm 12:046346a16ff4 9 /*---------------------------------------------------------------------------/
wardm 12:046346a16ff4 10 / Function Configurations
wardm 12:046346a16ff4 11 /---------------------------------------------------------------------------*/
wardm 12:046346a16ff4 12
wardm 12:046346a16ff4 13 #define _FS_READONLY 0
wardm 12:046346a16ff4 14 /* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
wardm 12:046346a16ff4 15 / Read-only configuration removes writing API functions, f_write(), f_sync(),
wardm 12:046346a16ff4 16 / f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
wardm 12:046346a16ff4 17 / and optional writing functions as well. */
wardm 12:046346a16ff4 18
wardm 12:046346a16ff4 19
wardm 12:046346a16ff4 20 #define _FS_MINIMIZE 0
wardm 12:046346a16ff4 21 /* This option defines minimization level to remove some basic API functions.
wardm 12:046346a16ff4 22 /
wardm 12:046346a16ff4 23 / 0: All basic functions are enabled.
wardm 12:046346a16ff4 24 / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),
wardm 12:046346a16ff4 25 / f_truncate() and f_rename() function are removed.
wardm 12:046346a16ff4 26 / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
wardm 12:046346a16ff4 27 / 3: f_lseek() function is removed in addition to 2. */
wardm 12:046346a16ff4 28
wardm 12:046346a16ff4 29
wardm 12:046346a16ff4 30 #define _USE_STRFUNC 0
wardm 12:046346a16ff4 31 /* This option switches string functions, f_gets(), f_putc(), f_puts() and
wardm 12:046346a16ff4 32 / f_printf().
wardm 12:046346a16ff4 33 /
wardm 12:046346a16ff4 34 / 0: Disable string functions.
wardm 12:046346a16ff4 35 / 1: Enable without LF-CRLF conversion.
wardm 12:046346a16ff4 36 / 2: Enable with LF-CRLF conversion. */
wardm 12:046346a16ff4 37
wardm 12:046346a16ff4 38
wardm 12:046346a16ff4 39 #define _USE_FIND 0
wardm 12:046346a16ff4 40 /* This option switches filtered directory read feature and related functions,
wardm 12:046346a16ff4 41 / f_findfirst() and f_findnext(). (0:Disable or 1:Enable) */
wardm 12:046346a16ff4 42
wardm 12:046346a16ff4 43
wardm 12:046346a16ff4 44 #define _USE_MKFS 1
wardm 12:046346a16ff4 45 /* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
wardm 12:046346a16ff4 46
wardm 12:046346a16ff4 47
wardm 12:046346a16ff4 48 #define _USE_FASTSEEK 0
wardm 12:046346a16ff4 49 /* This option switches fast seek feature. (0:Disable or 1:Enable) */
wardm 12:046346a16ff4 50
wardm 12:046346a16ff4 51
wardm 12:046346a16ff4 52 #define _USE_LABEL 0
wardm 12:046346a16ff4 53 /* This option switches volume label functions, f_getlabel() and f_setlabel().
wardm 12:046346a16ff4 54 / (0:Disable or 1:Enable) */
wardm 12:046346a16ff4 55
wardm 12:046346a16ff4 56
wardm 12:046346a16ff4 57 #define _USE_FORWARD 0
wardm 12:046346a16ff4 58 /* This option switches f_forward() function. (0:Disable or 1:Enable)
wardm 12:046346a16ff4 59 / To enable it, also _FS_TINY need to be set to 1. */
wardm 12:046346a16ff4 60
wardm 12:046346a16ff4 61
wardm 12:046346a16ff4 62 /*---------------------------------------------------------------------------/
wardm 12:046346a16ff4 63 / Locale and Namespace Configurations
wardm 12:046346a16ff4 64 /---------------------------------------------------------------------------*/
wardm 12:046346a16ff4 65
wardm 12:046346a16ff4 66 #define _CODE_PAGE 850
wardm 12:046346a16ff4 67 /* This option specifies the OEM code page to be used on the target system.
wardm 12:046346a16ff4 68 / Incorrect setting of the code page can cause a file open failure.
wardm 12:046346a16ff4 69 /
wardm 12:046346a16ff4 70 / 1 - ASCII (No extended character. Non-LFN cfg. only)
wardm 12:046346a16ff4 71 / 437 - U.S.
wardm 12:046346a16ff4 72 / 720 - Arabic
wardm 12:046346a16ff4 73 / 737 - Greek
wardm 12:046346a16ff4 74 / 771 - KBL
wardm 12:046346a16ff4 75 / 775 - Baltic
wardm 12:046346a16ff4 76 / 850 - Latin 1
wardm 12:046346a16ff4 77 / 852 - Latin 2
wardm 12:046346a16ff4 78 / 855 - Cyrillic
wardm 12:046346a16ff4 79 / 857 - Turkish
wardm 12:046346a16ff4 80 / 860 - Portuguese
wardm 12:046346a16ff4 81 / 861 - Icelandic
wardm 12:046346a16ff4 82 / 862 - Hebrew
wardm 12:046346a16ff4 83 / 863 - Canadian French
wardm 12:046346a16ff4 84 / 864 - Arabic
wardm 12:046346a16ff4 85 / 865 - Nordic
wardm 12:046346a16ff4 86 / 866 - Russian
wardm 12:046346a16ff4 87 / 869 - Greek 2
wardm 12:046346a16ff4 88 / 932 - Japanese (DBCS)
wardm 12:046346a16ff4 89 / 936 - Simplified Chinese (DBCS)
wardm 12:046346a16ff4 90 / 949 - Korean (DBCS)
wardm 12:046346a16ff4 91 / 950 - Traditional Chinese (DBCS)
wardm 12:046346a16ff4 92 */
wardm 12:046346a16ff4 93
wardm 12:046346a16ff4 94
wardm 12:046346a16ff4 95 #define _USE_LFN 1
wardm 12:046346a16ff4 96 #define _MAX_LFN 255
wardm 12:046346a16ff4 97 /* The _USE_LFN option switches the LFN feature.
wardm 12:046346a16ff4 98 /
wardm 12:046346a16ff4 99 / 0: Disable LFN feature. _MAX_LFN has no effect.
wardm 12:046346a16ff4 100 / 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
wardm 12:046346a16ff4 101 / 2: Enable LFN with dynamic working buffer on the STACK.
wardm 12:046346a16ff4 102 / 3: Enable LFN with dynamic working buffer on the HEAP.
wardm 12:046346a16ff4 103 /
wardm 12:046346a16ff4 104 / When enable the LFN feature, Unicode handling functions (option/unicode.c) must
wardm 12:046346a16ff4 105 / be added to the project. The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes.
wardm 12:046346a16ff4 106 / When use stack for the working buffer, take care on stack overflow. When use heap
wardm 12:046346a16ff4 107 / memory for the working buffer, memory management functions, ff_memalloc() and
wardm 12:046346a16ff4 108 / ff_memfree(), must be added to the project. */
wardm 12:046346a16ff4 109
wardm 12:046346a16ff4 110
wardm 12:046346a16ff4 111 #define _LFN_UNICODE 0
wardm 12:046346a16ff4 112 /* This option switches character encoding on the API. (0:ANSI/OEM or 1:Unicode)
wardm 12:046346a16ff4 113 / To use Unicode string for the path name, enable LFN feature and set _LFN_UNICODE
wardm 12:046346a16ff4 114 / to 1. This option also affects behavior of string I/O functions. */
wardm 12:046346a16ff4 115
wardm 12:046346a16ff4 116
wardm 12:046346a16ff4 117 #define _STRF_ENCODE 3
wardm 12:046346a16ff4 118 /* When _LFN_UNICODE is 1, this option selects the character encoding on the file to
wardm 12:046346a16ff4 119 / be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().
wardm 12:046346a16ff4 120 /
wardm 12:046346a16ff4 121 / 0: ANSI/OEM
wardm 12:046346a16ff4 122 / 1: UTF-16LE
wardm 12:046346a16ff4 123 / 2: UTF-16BE
wardm 12:046346a16ff4 124 / 3: UTF-8
wardm 12:046346a16ff4 125 /
wardm 12:046346a16ff4 126 / When _LFN_UNICODE is 0, this option has no effect. */
wardm 12:046346a16ff4 127
wardm 12:046346a16ff4 128
wardm 12:046346a16ff4 129 #define _FS_RPATH 0
wardm 12:046346a16ff4 130 /* This option configures relative path feature.
wardm 12:046346a16ff4 131 /
wardm 12:046346a16ff4 132 / 0: Disable relative path feature and remove related functions.
wardm 12:046346a16ff4 133 / 1: Enable relative path feature. f_chdir() and f_chdrive() are available.
wardm 12:046346a16ff4 134 / 2: f_getcwd() function is available in addition to 1.
wardm 12:046346a16ff4 135 /
wardm 12:046346a16ff4 136 / Note that directory items read via f_readdir() are affected by this option. */
wardm 12:046346a16ff4 137
wardm 12:046346a16ff4 138
wardm 12:046346a16ff4 139 /*---------------------------------------------------------------------------/
wardm 12:046346a16ff4 140 / Drive/Volume Configurations
wardm 12:046346a16ff4 141 /---------------------------------------------------------------------------*/
wardm 12:046346a16ff4 142
wardm 12:046346a16ff4 143 #define _VOLUMES 1
wardm 12:046346a16ff4 144 /* Number of volumes (logical drives) to be used. */
wardm 12:046346a16ff4 145
wardm 12:046346a16ff4 146
wardm 12:046346a16ff4 147 #define _STR_VOLUME_ID 0
wardm 12:046346a16ff4 148 #define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"
wardm 12:046346a16ff4 149 /* _STR_VOLUME_ID option switches string volume ID feature.
wardm 12:046346a16ff4 150 / When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
wardm 12:046346a16ff4 151 / number in the path name. _VOLUME_STRS defines the drive ID strings for each
wardm 12:046346a16ff4 152 / logical drives. Number of items must be equal to _VOLUMES. Valid characters for
wardm 12:046346a16ff4 153 / the drive ID strings are: A-Z and 0-9. */
wardm 12:046346a16ff4 154
wardm 12:046346a16ff4 155
wardm 12:046346a16ff4 156 #define _MULTI_PARTITION 0
wardm 12:046346a16ff4 157 /* This option switches multi-partition feature. By default (0), each logical drive
wardm 12:046346a16ff4 158 / number is bound to the same physical drive number and only an FAT volume found on
wardm 12:046346a16ff4 159 / the physical drive will be mounted. When multi-partition feature is enabled (1),
wardm 12:046346a16ff4 160 / each logical drive number is bound to arbitrary physical drive and partition
wardm 12:046346a16ff4 161 / listed in the VolToPart[]. Also f_fdisk() funciton will be available. */
wardm 12:046346a16ff4 162
wardm 12:046346a16ff4 163
wardm 12:046346a16ff4 164 #define _MIN_SS 512
wardm 12:046346a16ff4 165 #define _MAX_SS 512
wardm 12:046346a16ff4 166 /* These options configure the range of sector size to be supported. (512, 1024,
wardm 12:046346a16ff4 167 / 2048 or 4096) Always set both 512 for most systems, all type of memory cards and
wardm 12:046346a16ff4 168 / harddisk. But a larger value may be required for on-board flash memory and some
wardm 12:046346a16ff4 169 / type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured
wardm 12:046346a16ff4 170 / to variable sector size and GET_SECTOR_SIZE command must be implemented to the
wardm 12:046346a16ff4 171 / disk_ioctl() function. */
wardm 12:046346a16ff4 172
wardm 12:046346a16ff4 173
wardm 12:046346a16ff4 174 #define _USE_TRIM 0
wardm 12:046346a16ff4 175 /* This option switches ATA-TRIM feature. (0:Disable or 1:Enable)
wardm 12:046346a16ff4 176 / To enable Trim feature, also CTRL_TRIM command should be implemented to the
wardm 12:046346a16ff4 177 / disk_ioctl() function. */
wardm 12:046346a16ff4 178
wardm 12:046346a16ff4 179
wardm 12:046346a16ff4 180 #define _FS_NOFSINFO 0
wardm 12:046346a16ff4 181 /* If you need to know correct free space on the FAT32 volume, set bit 0 of this
wardm 12:046346a16ff4 182 / option, and f_getfree() function at first time after volume mount will force
wardm 12:046346a16ff4 183 / a full FAT scan. Bit 1 controls the use of last allocated cluster number.
wardm 12:046346a16ff4 184 /
wardm 12:046346a16ff4 185 / bit0=0: Use free cluster count in the FSINFO if available.
wardm 12:046346a16ff4 186 / bit0=1: Do not trust free cluster count in the FSINFO.
wardm 12:046346a16ff4 187 / bit1=0: Use last allocated cluster number in the FSINFO if available.
wardm 12:046346a16ff4 188 / bit1=1: Do not trust last allocated cluster number in the FSINFO.
wardm 12:046346a16ff4 189 */
wardm 12:046346a16ff4 190
wardm 12:046346a16ff4 191
wardm 12:046346a16ff4 192
wardm 12:046346a16ff4 193 /*---------------------------------------------------------------------------/
wardm 12:046346a16ff4 194 / System Configurations
wardm 12:046346a16ff4 195 /---------------------------------------------------------------------------*/
wardm 12:046346a16ff4 196
wardm 12:046346a16ff4 197 #define _FS_TINY 0
wardm 12:046346a16ff4 198 /* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
wardm 12:046346a16ff4 199 / At the tiny configuration, size of the file object (FIL) is reduced _MAX_SS
wardm 12:046346a16ff4 200 / bytes. Instead of private sector buffer eliminated from the file object,
wardm 12:046346a16ff4 201 / common sector buffer in the file system object (FATFS) is used for the file
wardm 12:046346a16ff4 202 / data transfer. */
wardm 12:046346a16ff4 203
wardm 12:046346a16ff4 204
wardm 12:046346a16ff4 205 #define _FS_NORTC 0
wardm 12:046346a16ff4 206 #define _NORTC_MON 1
wardm 12:046346a16ff4 207 #define _NORTC_MDAY 1
wardm 12:046346a16ff4 208 #define _NORTC_YEAR 2015
wardm 12:046346a16ff4 209 /* The _FS_NORTC option switches timestamp feature. If the system does not have
wardm 12:046346a16ff4 210 / an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable
wardm 12:046346a16ff4 211 / the timestamp feature. All objects modified by FatFs will have a fixed timestamp
wardm 12:046346a16ff4 212 / defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR.
wardm 12:046346a16ff4 213 / When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
wardm 12:046346a16ff4 214 / to be added to the project to read current time form RTC. _NORTC_MON,
wardm 12:046346a16ff4 215 / _NORTC_MDAY and _NORTC_YEAR have no effect.
wardm 12:046346a16ff4 216 / These options have no effect at read-only configuration (_FS_READONLY == 1). */
wardm 12:046346a16ff4 217
wardm 12:046346a16ff4 218
wardm 12:046346a16ff4 219 #define _FS_LOCK 0
wardm 12:046346a16ff4 220 /* The _FS_LOCK option switches file lock feature to control duplicated file open
wardm 12:046346a16ff4 221 / and illegal operation to open objects. This option must be 0 when _FS_READONLY
wardm 12:046346a16ff4 222 / is 1.
wardm 12:046346a16ff4 223 /
wardm 12:046346a16ff4 224 / 0: Disable file lock feature. To avoid volume corruption, application program
wardm 12:046346a16ff4 225 / should avoid illegal open, remove and rename to the open objects.
wardm 12:046346a16ff4 226 / >0: Enable file lock feature. The value defines how many files/sub-directories
wardm 12:046346a16ff4 227 / can be opened simultaneously under file lock control. Note that the file
wardm 12:046346a16ff4 228 / lock feature is independent of re-entrancy. */
wardm 12:046346a16ff4 229
wardm 12:046346a16ff4 230
wardm 12:046346a16ff4 231 #define _FS_REENTRANT 0
wardm 12:046346a16ff4 232 #define _FS_TIMEOUT 1000
wardm 12:046346a16ff4 233 #define _SYNC_t HANDLE
wardm 12:046346a16ff4 234 /* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs
wardm 12:046346a16ff4 235 / module itself. Note that regardless of this option, file access to different
wardm 12:046346a16ff4 236 / volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
wardm 12:046346a16ff4 237 / and f_fdisk() function, are always not re-entrant. Only file/directory access
wardm 12:046346a16ff4 238 / to the same volume is under control of this feature.
wardm 12:046346a16ff4 239 /
wardm 12:046346a16ff4 240 / 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.
wardm 12:046346a16ff4 241 / 1: Enable re-entrancy. Also user provided synchronization handlers,
wardm 12:046346a16ff4 242 / ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
wardm 12:046346a16ff4 243 / function, must be added to the project. Samples are available in
wardm 12:046346a16ff4 244 / option/syscall.c.
wardm 12:046346a16ff4 245 /
wardm 12:046346a16ff4 246 / The _FS_TIMEOUT defines timeout period in unit of time tick.
wardm 12:046346a16ff4 247 / The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,
wardm 12:046346a16ff4 248 / SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be
wardm 12:046346a16ff4 249 / included somewhere in the scope of ff.c. */
wardm 12:046346a16ff4 250
wardm 12:046346a16ff4 251
wardm 12:046346a16ff4 252 #define _WORD_ACCESS 0
wardm 12:046346a16ff4 253 /* The _WORD_ACCESS option is an only platform dependent option. It defines
wardm 12:046346a16ff4 254 / which access method is used to the word data on the FAT volume.
wardm 12:046346a16ff4 255 /
wardm 12:046346a16ff4 256 / 0: Byte-by-byte access. Always compatible with all platforms.
wardm 12:046346a16ff4 257 / 1: Word access. Do not choose this unless under both the following conditions.
wardm 12:046346a16ff4 258 /
wardm 12:046346a16ff4 259 / * Address misaligned memory access is always allowed to ALL instructions.
wardm 12:046346a16ff4 260 / * Byte order on the memory is little-endian.
wardm 12:046346a16ff4 261 /
wardm 12:046346a16ff4 262 / If it is the case, _WORD_ACCESS can also be set to 1 to reduce code size.
wardm 12:046346a16ff4 263 / Following table shows allowable settings of some type of processors.
wardm 12:046346a16ff4 264 /
wardm 12:046346a16ff4 265 / ARM7TDMI 0 *2 ColdFire 0 *1 V850E 0 *2
wardm 12:046346a16ff4 266 / Cortex-M3 0 *3 Z80 0/1 V850ES 0/1
wardm 12:046346a16ff4 267 / Cortex-M0 0 *2 x86 0/1 TLCS-870 0/1
wardm 12:046346a16ff4 268 / AVR 0/1 RX600(LE) 0/1 TLCS-900 0/1
wardm 12:046346a16ff4 269 / AVR32 0 *1 RL78 0 *2 R32C 0 *2
wardm 12:046346a16ff4 270 / PIC18 0/1 SH-2 0 *1 M16C 0/1
wardm 12:046346a16ff4 271 / PIC24 0 *2 H8S 0 *1 MSP430 0 *2
wardm 12:046346a16ff4 272 / PIC32 0 *1 H8/300H 0 *1 8051 0/1
wardm 12:046346a16ff4 273 /
wardm 12:046346a16ff4 274 / *1:Big-endian.
wardm 12:046346a16ff4 275 / *2:Unaligned memory access is not supported.
wardm 12:046346a16ff4 276 / *3:Some compilers generate LDM/STM for mem_cpy function.
wardm 12:046346a16ff4 277 */
wardm 12:046346a16ff4 278
wardm 12:046346a16ff4 279 #define FLUSH_ON_NEW_CLUSTER 0 /* Sync the file on every new cluster */
wardm 12:046346a16ff4 280 #define FLUSH_ON_NEW_SECTOR 1 /* Sync the file on every new sector */
wardm 12:046346a16ff4 281 /* Only one of these two defines needs to be set to 1. If both are set to 0
wardm 12:046346a16ff4 282 the file is only sync when closed.
wardm 12:046346a16ff4 283 Clusters are group of sectors (eg: 8 sectors). Flushing on new cluster means
wardm 12:046346a16ff4 284 it would be less often than flushing on new sector. Sectors are generally
wardm 12:046346a16ff4 285 512 Bytes long. */