add external temperature sensor support, separate different test functions, allow to cycle through different test modes
This commit is contained in:
11
Core/Inc/external_temp.h
Normal file
11
Core/Inc/external_temp.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef __EXTERNAL_TEMP
|
||||
#define __EXTERNAL_TEMP
|
||||
|
||||
extern ADC_HandleTypeDef hadc1;
|
||||
|
||||
|
||||
|
||||
void external_temp_show_celsius(void);
|
||||
void external_temp_show_fahrenheit(void);
|
||||
|
||||
#endif
|
||||
10
Core/Inc/generic_macros.h
Normal file
10
Core/Inc/generic_macros.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef __GENERIC_MACROS
|
||||
#define __GENERIC_MACROS
|
||||
|
||||
#define PANIC(status) \
|
||||
do { \
|
||||
GPIOD->ODR = status; \
|
||||
while (1) {} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
24
Core/Inc/lcd.h
Normal file
24
Core/Inc/lcd.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __LCD
|
||||
#define __LCD
|
||||
|
||||
#define DISPLAY_RS ((uint16_t) (0x1U << 7))
|
||||
#define DISPLAY_RW ((uint16_t) (0x1U << 10))
|
||||
#define DISPLAY_ENA ((uint16_t) (0x1U << 11))
|
||||
|
||||
#define DISPLAY_POLL_UNTIL_READY do { while (display_read_status() & 0x80) {} } while (0)
|
||||
|
||||
#define DISPLAY_SET_INCREMENT do { display_write_instruction_byte(0x06); } while (0)
|
||||
#define DISPLAY_SET_DECREMENT do { display_write_instruction_byte(0x04); } while (0)
|
||||
|
||||
#define DISPLAY_SET_CURSOR(line, position) do { display_write_instruction_byte(0x80 | (line << 6) | position); } while (0)
|
||||
|
||||
#define DISPLAY_CLEAR do { display_write_instruction_byte(0x01); } while (0)
|
||||
|
||||
|
||||
void display_init(void);
|
||||
uint8_t display_read_status(void);
|
||||
void display_write_instruction_byte(uint8_t code);
|
||||
void display_write_data_byte(uint8_t code);
|
||||
void display_write_data_seq(char *codes);
|
||||
|
||||
#endif
|
||||
@@ -38,7 +38,7 @@
|
||||
#define HAL_MODULE_ENABLED
|
||||
|
||||
/* #define HAL_CRYP_MODULE_ENABLED */
|
||||
/* #define HAL_ADC_MODULE_ENABLED */
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
/* #define HAL_CAN_MODULE_ENABLED */
|
||||
/* #define HAL_CRC_MODULE_ENABLED */
|
||||
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
Reference in New Issue
Block a user