LoadCell_STM32_SDRAM_v1
Dependencies: BSP_DISCO_F746NG DISCO-F746NG_SDRAMBlockDevice LCD_DISCO_F746NG mbed
Fork of LoadCell_STM32 by
main.h@7:30df32ea2d03, 2018-03-08 (annotated)
- Committer:
- tapiov
- Date:
- Thu Mar 08 20:17:32 2018 +0000
- Revision:
- 7:30df32ea2d03
- Parent:
- 6:641b171407c9
First commit to publish
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tapiov | 6:641b171407c9 | 1 | // LoadCell_STM32_SDRAM main header |
tapiov | 1:c3c61d08f31b | 2 | // (C) Tapio Valli 2018-02-20 |
tapiov | 1:c3c61d08f31b | 3 | |
tapiov | 6:641b171407c9 | 4 | #include <stdint.h> |
tapiov | 6:641b171407c9 | 5 | #include <stdio.h> |
tapiov | 6:641b171407c9 | 6 | #include <stdlib.h> |
tapiov | 6:641b171407c9 | 7 | #include <string.h> |
tapiov | 6:641b171407c9 | 8 | #include <assert.h> |
tapiov | 6:641b171407c9 | 9 | #include <ctype.h> |
tapiov | 6:641b171407c9 | 10 | #include <errno.h> |
tapiov | 6:641b171407c9 | 11 | |
tapiov | 6:641b171407c9 | 12 | #include "LCD_DISCO_F746NG.h" |
tapiov | 6:641b171407c9 | 13 | #include "SDRAM_DISCO_F746NG_BlockDevice.h" |
tapiov | 6:641b171407c9 | 14 | #include "FATFileSystem.h" |
tapiov | 6:641b171407c9 | 15 | |
tapiov | 6:641b171407c9 | 16 | extern SDRAM_DISCO_F746NG_BlockDevice bd; |
tapiov | 6:641b171407c9 | 17 | extern FATFileSystem fs; |
tapiov | 6:641b171407c9 | 18 | extern Serial pc; |
tapiov | 6:641b171407c9 | 19 | extern LCD_DISCO_F746NG lcd; |
tapiov | 6:641b171407c9 | 20 | |
tapiov | 1:c3c61d08f31b | 21 | typedef struct { |
tapiov | 5:f8d3bcb187de | 22 | uint16_t *array; |
tapiov | 1:c3c61d08f31b | 23 | size_t used; |
tapiov | 1:c3c61d08f31b | 24 | size_t size; |
tapiov | 1:c3c61d08f31b | 25 | } Array; |
tapiov | 1:c3c61d08f31b | 26 | |
tapiov | 1:c3c61d08f31b | 27 | // Prototypes |
tapiov | 1:c3c61d08f31b | 28 | |
tapiov | 1:c3c61d08f31b | 29 | extern void initArray(Array *a, size_t initialSize); |
tapiov | 5:f8d3bcb187de | 30 | extern void insertArray(Array *a, uint32_t newsize); |
tapiov | 1:c3c61d08f31b | 31 | extern void freeArray(Array *a); |
tapiov | 1:c3c61d08f31b | 32 | |
tapiov | 1:c3c61d08f31b | 33 | extern size_t string_parser(char *input, char ***word_array); |
tapiov | 1:c3c61d08f31b | 34 | extern void PlotData(uint32_t XCoordinate,uint32_t YCoordinate); |
tapiov | 1:c3c61d08f31b | 35 | extern void InitScreen(uint32_t BackGroundColor,uint32_t ForeGroundColor); |
tapiov | 1:c3c61d08f31b | 36 | extern void LCDWrite(uint32_t Line,char Str[],Text_AlignModeTypdef AlingMode); |
tapiov | 1:c3c61d08f31b | 37 | extern void CountDown(uint32_t millisecs); |
tapiov | 1:c3c61d08f31b | 38 | extern void SamplePoints(Array *Data,uint32_t NoOfPoints,uint32_t Period_us); |
tapiov | 1:c3c61d08f31b | 39 | extern void AvgAndPlotPoints(Array *Data,uint32_t NoOfPoints, uint32_t AvgSize); |
tapiov | 6:641b171407c9 | 40 | |
tapiov | 6:641b171407c9 | 41 | extern void BlockDeviceErase(); |
tapiov | 6:641b171407c9 | 42 | extern void MountFS(); |
tapiov | 6:641b171407c9 | 43 | extern void WriteData2FS(Array *Data,uint32_t NoOfPoints,uint32_t FileNumber); |
tapiov | 6:641b171407c9 | 44 | extern void ReadFile2Data(Array *Data,uint32_t NoOfPoints,uint32_t FileNumber); |
tapiov | 6:641b171407c9 | 45 | extern void DirListing(void); |
tapiov | 6:641b171407c9 | 46 | extern uint32_t GetFileSize(FILE *fp); |