49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
/* USER CODE BEGIN Header */
|
|
/**
|
|
******************************************************************************
|
|
* @file : app_tasks.h
|
|
* @brief : Header for ModTOS (Modbus RTU slave task).
|
|
*
|
|
* Declares core symbols for the Modbus driver running in FreeRTOS context.
|
|
* Author: Scott Leonard
|
|
* License: Unlicense
|
|
******************************************************************************
|
|
*/
|
|
/* USER CODE END Header */
|
|
|
|
#ifndef __APP_TASKS_H
|
|
#define __APP_TASKS_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "main.h"
|
|
#include "cmsis_os.h"
|
|
#include <stdint.h>
|
|
|
|
/* Shared buffers and register table */
|
|
extern uint8_t request_frame[];
|
|
extern uint8_t response_frame[];
|
|
extern uint16_t modbus_table[];
|
|
|
|
/* Task entry point */
|
|
void app_task_Modbus(void);
|
|
|
|
/* Core Modbus driver functions */
|
|
void rs485_dir_tx(void);
|
|
void rs485_dir_rx(void);
|
|
uint16_t calculate_modbus_crc(uint8_t *data, uint16_t length);
|
|
void send_modbus_data(uint8_t *data, int size);
|
|
void modbus_exception(uint8_t exception_code);
|
|
uint8_t table_read(void);
|
|
uint8_t table_write(void);
|
|
void process_modbus_message(uint16_t size);
|
|
void init_modbus_system(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __APP_TASKS_H */
|