Refacored code; introduced all possible commands

This commit is contained in:
Ollo
2024-12-07 11:39:12 +01:00
parent 30deee981b
commit da8045e7de
4 changed files with 122 additions and 28 deletions

View File

@@ -1,16 +1,35 @@
/**
* @file SerialCmd.h
* @author Ollo
* @brief
* @version 0.1
* @date 2024-12-06
*
* @copyright Copyright (c) 2024
*
*/
#ifndef SERIALCMD_H
#define SERIALCMD_H
#include <stdint.h>
/* Define commands: */
#define SERIALCMD_COMMAND_SETLED "l"
#define SERIALCMD_COMMAND_AUTOMATIC "a"
#define SERIALCMD_COMMAND_FAN "f"
#define SERIALCMD_COMMAND_HELP "ollpehelp"
#define SERIALCMD_PARAMETER_OFFSET 6
int SerialCmd_readFromSerial (void);
void SerialCmd_clearCmdArray (void);
int SerialCmd_checkCmdArrayForPrefix (void);
uint32_t SerialCmd_parseColor(int startOffset);
uint32_t SerialCmd_parseColor(unsigned int startOffset);
char SerialCmd_type(void);
void SerialCmd_help(void);
#endif /* SERIALCMD_H */
#endif /* SERIALCMD_H */

View File

@@ -11,8 +11,20 @@
#ifndef FANLEDCTL_PINS
#define FANLEDCTL_PINS
#define FAN_PIN D6 /**< Output Pin, controlling FAN speed via PWM */
#define SIGNAL_PIN D7 /**< Input Pin, reading current FANs RPM*/
/******************************************************************************
* BEHAVIOR DEFINES
******************************************************************************/
#define LOW_FAN_SPEED 500 /**< Rounds per Minute */
/******************************************************************************
* PINOUT DEFINES
******************************************************************************/
#define FAN_PIN D6 /**< Output Pin, controlling FAN speed via PWM */
#define SIGNAL_PIN D7 /**< Input Pin, reading current FANs RPM*/
#define GPIO_DS18B20 D2 /**< One-Wire used for Dallas temperature sensor */