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 / Low level disk interface modlue include file (C)ChaN, 2014 /
wardm 12:046346a16ff4 3 /-----------------------------------------------------------------------*/
wardm 12:046346a16ff4 4
wardm 12:046346a16ff4 5 #ifndef _DISKIO_DEFINED
wardm 12:046346a16ff4 6 #define _DISKIO_DEFINED
wardm 12:046346a16ff4 7
wardm 12:046346a16ff4 8 #ifdef __cplusplus
wardm 12:046346a16ff4 9 extern "C" {
wardm 12:046346a16ff4 10 #endif
wardm 12:046346a16ff4 11
wardm 12:046346a16ff4 12 #define _USE_WRITE 1 /* 1: Enable disk_write function */
wardm 12:046346a16ff4 13 #define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
wardm 12:046346a16ff4 14
wardm 12:046346a16ff4 15 #include "integer.h"
wardm 12:046346a16ff4 16
wardm 12:046346a16ff4 17
wardm 12:046346a16ff4 18 /* Status of Disk Functions */
wardm 12:046346a16ff4 19 typedef BYTE DSTATUS;
wardm 12:046346a16ff4 20
wardm 12:046346a16ff4 21 /* Results of Disk Functions */
wardm 12:046346a16ff4 22 typedef enum {
wardm 12:046346a16ff4 23 RES_OK = 0, /* 0: Successful */
wardm 12:046346a16ff4 24 RES_ERROR, /* 1: R/W Error */
wardm 12:046346a16ff4 25 RES_WRPRT, /* 2: Write Protected */
wardm 12:046346a16ff4 26 RES_NOTRDY, /* 3: Not Ready */
wardm 12:046346a16ff4 27 RES_PARERR /* 4: Invalid Parameter */
wardm 12:046346a16ff4 28 } DRESULT;
wardm 12:046346a16ff4 29
wardm 12:046346a16ff4 30
wardm 12:046346a16ff4 31 /*---------------------------------------*/
wardm 12:046346a16ff4 32 /* Prototypes for disk control functions */
wardm 12:046346a16ff4 33
wardm 12:046346a16ff4 34
wardm 12:046346a16ff4 35 DSTATUS disk_initialize (BYTE pdrv);
wardm 12:046346a16ff4 36 DSTATUS disk_status (BYTE pdrv);
wardm 12:046346a16ff4 37 DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
wardm 12:046346a16ff4 38 DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
wardm 12:046346a16ff4 39 DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
wardm 12:046346a16ff4 40
wardm 12:046346a16ff4 41
wardm 12:046346a16ff4 42 /* Disk Status Bits (DSTATUS) */
wardm 12:046346a16ff4 43
wardm 12:046346a16ff4 44 #define STA_NOINIT 0x01 /* Drive not initialized */
wardm 12:046346a16ff4 45 #define STA_NODISK 0x02 /* No medium in the drive */
wardm 12:046346a16ff4 46 #define STA_PROTECT 0x04 /* Write protected */
wardm 12:046346a16ff4 47
wardm 12:046346a16ff4 48
wardm 12:046346a16ff4 49 /* Command code for disk_ioctrl fucntion */
wardm 12:046346a16ff4 50
wardm 12:046346a16ff4 51 /* Generic command (Used by FatFs) */
wardm 12:046346a16ff4 52 #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
wardm 12:046346a16ff4 53 #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
wardm 12:046346a16ff4 54 #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
wardm 12:046346a16ff4 55 #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
wardm 12:046346a16ff4 56 #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
wardm 12:046346a16ff4 57
wardm 12:046346a16ff4 58 /* Generic command (Not used by FatFs) */
wardm 12:046346a16ff4 59 #define CTRL_POWER 5 /* Get/Set power status */
wardm 12:046346a16ff4 60 #define CTRL_LOCK 6 /* Lock/Unlock media removal */
wardm 12:046346a16ff4 61 #define CTRL_EJECT 7 /* Eject media */
wardm 12:046346a16ff4 62 #define CTRL_FORMAT 8 /* Create physical format on the media */
wardm 12:046346a16ff4 63
wardm 12:046346a16ff4 64 /* MMC/SDC specific ioctl command */
wardm 12:046346a16ff4 65 #define MMC_GET_TYPE 10 /* Get card type */
wardm 12:046346a16ff4 66 #define MMC_GET_CSD 11 /* Get CSD */
wardm 12:046346a16ff4 67 #define MMC_GET_CID 12 /* Get CID */
wardm 12:046346a16ff4 68 #define MMC_GET_OCR 13 /* Get OCR */
wardm 12:046346a16ff4 69 #define MMC_GET_SDSTAT 14 /* Get SD status */
wardm 12:046346a16ff4 70
wardm 12:046346a16ff4 71 /* ATA/CF specific ioctl command */
wardm 12:046346a16ff4 72 #define ATA_GET_REV 20 /* Get F/W revision */
wardm 12:046346a16ff4 73 #define ATA_GET_MODEL 21 /* Get model name */
wardm 12:046346a16ff4 74 #define ATA_GET_SN 22 /* Get serial number */
wardm 12:046346a16ff4 75
wardm 12:046346a16ff4 76 #ifdef __cplusplus
wardm 12:046346a16ff4 77 }
wardm 12:046346a16ff4 78 #endif
wardm 12:046346a16ff4 79
wardm 12:046346a16ff4 80 #endif