| MAXREFDES82# Code Documentation V01.00 Maxim Smart Force Sensor

- Main Page
- Modules
- Files

- File List
- Globals

All Files Functions Variables Macros Groups Pages
Macros | Functions | Variables
maintask.c File Reference
`#include "main.h"`
`#include "GUI.h"`
`#include "string.h"`
`#include "stm32f429i_discovery_lcd.h"`
`#include "stm32f4xx_hal.h"`
`#include "stm32f429i_discovery.h"`
`#include "math.h"`

Go to the source code of this file.

## Macros
#define | POWERUP_CAL_NUM 200
#define | FACOTRY_CAL_NUM 200
#define | MAJORVERSION 3
#define | MINORVERSION 5

## Functions
void | ConfigureSPIandGPIO (void)
void | ConfigureMAX11254 (void)
void | ReadMAX11254Results (void)
void | Calibration (int8_t type, int32_t conversions)
void | MainTask (void)

## Variables
uint8_t | usbTxBuf [32] ={0}
uint32_t | SectorError = 0
USBD_HandleTypeDef | USBD_Device
uint8_t | request = 0
GUI_RECT | Rect = {0, 0, 320, 240}
uint8_t | spiWritePacket [4] = {0}
uint8_t | data0 [4]
uint8_t | data1 [4]
uint8_t | data2 [4]
uint8_t | data3 [4]
uint32_t | data0BO
uint32_t | data1BO
uint32_t | data2BO
uint32_t | data3BO
int | cell0Load
int | cell1Load
int | cell2Load
int | cell3Load
double | cell0Load0 =80606.899
double | cell1Load0 =2316.475
double | cell2Load0 =-4303.219
double | cell3Load0 =48106.286
uint32_t | cell0Load0Int
uint32_t | cell1Load0Int
uint32_t | cell2Load0Int
uint32_t | cell3Load0Int
uint32_t | cell0Load0Sign
uint32_t | cell1Load0Sign
uint32_t | cell2Load0Sign
uint32_t | cell3Load0Sign
double | cell0Load700 =1386219.167
double | cell1Load700 =1306319.674
double | cell2Load700 =1238527.327
double | cell3Load700 =1278776.285
uint32_t | cell0Load700Int
uint32_t | cell1Load700Int
uint32_t | cell2Load700Int
uint32_t | cell3Load700Int
uint32_t | cell0Load700Sign
uint32_t | cell1Load700Sign
uint32_t | cell2Load700Sign
uint32_t | cell3Load700Sign
double | cell0Powerup
double | cell1Powerup
double | cell2Powerup
double | cell3Powerup
double | cell0Grams
double | cell1Grams
double | cell2Grams
double | cell3Grams
double | x =0
double | y =0
double | r =0

## Detailed Description

          Project: MAXREFDES82
          Filename: maintask.c
      Description: This module contains the major functions for the
                   implementation of the example program for the MAXREFDES82.

Revision History:
03-02-2016 Rev 03.50 MG Initial release.

Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of Maxim Integrated Products, Inc. shall not be used except as stated in the Maxim Integrated Products, Inc. Branding Policy.

The mere transfer of this software does not imply any licenses of trade secrets, proprietary technology, copyrights, patents, trademarks, maskwork rights, or any other form of intellectual property whatsoever. Maxim Integrated Products, Inc. retains all ownership rights.

Definition in file maintask.c.

## Macro Definition Documentation

#define FACOTRY_CAL_NUM 200

Definition at line 52 of file maintask.c.

#define MAJORVERSION 3

Definition at line 54 of file maintask.c.

#define MINORVERSION 5

Definition at line 55 of file maintask.c.

#define POWERUP_CAL_NUM 200

Definition at line 51 of file maintask.c.

## Function Documentation

void Calibration | ( | int8_t | type,
|  | int32_t | conversions
| ) |  |

Definition at line 510 of file maintask.c.

void ConfigureMAX11254 | ( | void |  | ) |

Definition at line 408 of file maintask.c.

void ConfigureSPIandGPIO | ( | void |  | ) |

Definition at line 370 of file maintask.c.

void MainTask | ( | void |  | ) |

Definition at line 112 of file maintask.c.

void ReadMAX11254Results | ( | void |  | ) |

Definition at line 469 of file maintask.c.

## Variable Documentation

double cell0Grams

Definition at line 93 of file maintask.c.

int cell0Load

Definition at line 77 of file maintask.c.

double cell0Load0 =80606.899

Definition at line 80 of file maintask.c.

uint32_t cell0Load0Int

Definition at line 81 of file maintask.c.

uint32_t cell0Load0Sign

Definition at line 82 of file maintask.c.

double cell0Load700 =1386219.167

Definition at line 85 of file maintask.c.

uint32_t cell0Load700Int

Definition at line 86 of file maintask.c.

uint32_t cell0Load700Sign

Definition at line 87 of file maintask.c.

double cell0Powerup

Definition at line 90 of file maintask.c.

double cell1Grams

Definition at line 93 of file maintask.c.

int cell1Load

Definition at line 77 of file maintask.c.

double cell1Load0 =2316.475

Definition at line 80 of file maintask.c.

uint32_t cell1Load0Int

Definition at line 81 of file maintask.c.

uint32_t cell1Load0Sign

Definition at line 82 of file maintask.c.

double cell1Load700 =1306319.674

Definition at line 85 of file maintask.c.

uint32_t cell1Load700Int

Definition at line 86 of file maintask.c.

uint32_t cell1Load700Sign

Definition at line 87 of file maintask.c.

double cell1Powerup

Definition at line 90 of file maintask.c.

double cell2Grams

Definition at line 93 of file maintask.c.

int cell2Load

Definition at line 77 of file maintask.c.

double cell2Load0 =-4303.219

Definition at line 80 of file maintask.c.

uint32_t cell2Load0Int

Definition at line 81 of file maintask.c.

uint32_t cell2Load0Sign

Definition at line 82 of file maintask.c.

double cell2Load700 =1238527.327

Definition at line 85 of file maintask.c.

uint32_t cell2Load700Int

Definition at line 86 of file maintask.c.

uint32_t cell2Load700Sign

Definition at line 87 of file maintask.c.

double cell2Powerup

Definition at line 90 of file maintask.c.

double cell3Grams

Definition at line 93 of file maintask.c.

int cell3Load

Definition at line 77 of file maintask.c.

double cell3Load0 =48106.286

Definition at line 80 of file maintask.c.

uint32_t cell3Load0Int

Definition at line 81 of file maintask.c.

uint32_t cell3Load0Sign

Definition at line 82 of file maintask.c.

double cell3Load700 =1278776.285

Definition at line 85 of file maintask.c.

uint32_t cell3Load700Int

Definition at line 86 of file maintask.c.

uint32_t cell3Load700Sign

Definition at line 87 of file maintask.c.

double cell3Powerup

Definition at line 90 of file maintask.c.

uint8_t data0[4]

Definition at line 71 of file maintask.c.

uint32_t data0BO

Definition at line 74 of file maintask.c.

uint8_t data1[4]

Definition at line 71 of file maintask.c.

uint32_t data1BO

Definition at line 74 of file maintask.c.

uint8_t data2[4]

Definition at line 71 of file maintask.c.

uint32_t data2BO

Definition at line 74 of file maintask.c.

uint8_t data3[4]

Definition at line 71 of file maintask.c.

uint32_t data3BO

Definition at line 74 of file maintask.c.

double r =0

Definition at line 100 of file maintask.c.

GUI_RECT Rect = {0, 0, 320, 240}

Definition at line 66 of file maintask.c.

uint8_t request = 0

Definition at line 64 of file maintask.c.

uint32_t SectorError = 0

Definition at line 60 of file maintask.c.

uint8_t spiWritePacket[4] = {0}

Definition at line 68 of file maintask.c.

USBD_HandleTypeDef USBD_Device

Definition at line 68 of file MAXREFDES82.c.

uint8_t usbTxBuf[32] ={0}

Definition at line 56 of file maintask.c.

double x =0

Definition at line 100 of file maintask.c.

double y =0

Definition at line 100 of file maintask.c.