init
864
научка/code/pwm_motor_control/Modbus/Modbus.c
Normal file
@@ -0,0 +1,864 @@
|
||||
/********************************MODBUS*************************************
|
||||
Данный файл содержит базовые функции для реализации MODBUS.
|
||||
//-------------------Функции-------------------//
|
||||
@func user
|
||||
- MB_SetCoil
|
||||
- MB_ResetCoil
|
||||
|
||||
@func process message
|
||||
- MB_DefineRegistersAddress Определение "начального" адреса регистров
|
||||
- MB_DefineCoilsAddress Определение "начального" адреса коилов
|
||||
- MB_Check_Address_For_Arr принадлежит ли адресс Addr конкретному массиву
|
||||
- Modbus_Command_x Обработка команды x
|
||||
|
||||
@func RS functions
|
||||
- Parse_Message/Collect_Message Заполнение структуры сообщения и буфера
|
||||
- RS_Response Ответ на комманду
|
||||
- RS_Define_Size_of_RX_Message Определение размера принимаемых данных
|
||||
- RS_Init Инициализация периферии и modbus handler
|
||||
|
||||
@func initialization
|
||||
- MB_Init Инициализация modbus
|
||||
|
||||
//--------------Данные для модбас--------------//
|
||||
@registers Holding/Input Registers
|
||||
Регистры представляют собой 16-битные числа (слова). В обработке комманд
|
||||
находится адресс "начального" регистра и записывается в указатель. Доступ к
|
||||
остальным регистрам осуществляется через указатель. Таким образом, сами
|
||||
регистры могут представлять собой как массив так и структуру.
|
||||
- sine_log - массив регистров на 500 элементов
|
||||
- sine_log - массив регистров на 500 элементов
|
||||
|
||||
@coils Coils
|
||||
Коилы представляют собой биты, упакованные в 16-битные регистры. В обработке
|
||||
комманд находится адресс "начального" регистра запрашиваемого коила. Доступ к
|
||||
остальным коилам осуществляется через маску и указатель. Таким образом, сами
|
||||
коилы могут представлять собой как массив так и структуру.
|
||||
|
||||
|
||||
@example SLAVE RECEIVE
|
||||
//--------------Настройка модбас--------------//
|
||||
// create handles and settings
|
||||
Create_MODBUS_Handles(modbus1);
|
||||
|
||||
// set up UART for modbus
|
||||
modbus1_suart.huart = &modbus1_huart;
|
||||
modbus1_suart.huart->Instance = USED_MODBUS_UART;
|
||||
modbus1_suart.huart->Init.BaudRate = 38400;
|
||||
modbus1_suart.GPIOx = MODBUS_GPIOX;
|
||||
modbus1_suart.GPIO_PIN_RX = MODBUS_GPIO_PIN_RX;
|
||||
modbus1_suart.GPIO_PIN_TX = MODBUS_GPIO_PIN_TX;
|
||||
|
||||
// set up timeout TIM for modbus
|
||||
modbus1_stim.htim = &modbus1_htim;
|
||||
modbus1_stim.htim.Instance = USED_MODBUS_TIM;
|
||||
modbus1_stim.htim.Init.Prescaler = 36000; // set this to 0.5 ms
|
||||
modbus1_stim.TIM_MODE = TIM_IT_CONF;
|
||||
|
||||
// set up modbus: MB_RX_Size_NotConst and Timeout enable
|
||||
hmodbus1.ID = 1;
|
||||
hmodbus1.sRS_RX_Size_Mode = RS_RX_Size_NotConst;
|
||||
hmodbus1.sRS_Timeout = 100;
|
||||
hmodbus1.sRS_Mode = SLAVE_ALWAYS_WAIT;
|
||||
hmodbus1.RS_STATUS = RS_Init(&hmodbus1, &modbus1_suart, &modbus1_stim, 0);
|
||||
|
||||
//----------------Прием модбас----------------//
|
||||
RS_MsgTypeDef MODBUS_MSG;
|
||||
RS_Receive_IT(&hmodbus1, &MODBUS_MSG);
|
||||
***************************************************************************/
|
||||
#include "rs_message.h"
|
||||
uint32_t dbg_temp, dbg_temp2, dbg_temp3; // for debug
|
||||
uint32_t err_cnt = 0;
|
||||
/* EXTERN MODBUS HANDLES */
|
||||
UART_SettingsTypeDef modbus1_suart;
|
||||
TIM_SettingsTypeDef modbus1_stim;
|
||||
RS_HandleTypeDef hmodbus1;
|
||||
|
||||
/* DEFINE REGISTERS/COILS */
|
||||
uint16_t sine_log[R_SINE_LOG_QNT]; // start from 0x0000
|
||||
uint16_t pwm_log[R_PWM_LOG_QNT]; // start from 500 (0x1F4)
|
||||
uint16_t cnt_log[R_CNT_LOG_QNT]; // start from 100 (0x3E8)
|
||||
uint16_t time_log[R_TIME_LOG_QNT]; // start from 1500 (0x5DC)
|
||||
uint16_t pwm_ctrl[R_PWM_CTRL_QNT]; // start from 2000 (0x7D0)
|
||||
uint16_t log_ctrl[R_PWM_CTRL_QNT]; // start from 2008 (0x7D0)
|
||||
uint16_t uart_ctrl[R_UART_CTRL_QNT];
|
||||
|
||||
uint16_t coils_regs[C_CTRL_COILS_QNT];
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-----------------------------FOR USER------------------------------
|
||||
/**
|
||||
* @brief First set up of MODBUS.
|
||||
* @note Первый инит модбас. Заполняет структуры и инициализирует таймер и юарт для общения по модбас.
|
||||
* Скважность ШИМ меняется по закону синусоиды, каждый канал генерирует свой полупериод синуса (от -1 до 0 И от 0 до 1)
|
||||
* ШИМ генерируется на одном канале.
|
||||
* @note This called from main
|
||||
*/
|
||||
void MODBUS_FirstInit(void)
|
||||
{
|
||||
//-----------SETUP MODBUS-------------
|
||||
// set up UART for modbus
|
||||
modbus1_suart.huart.Instance = USED_MODBUS_UART;
|
||||
modbus1_suart.huart.Init.BaudRate = PROJSET.MB_SPEED;
|
||||
modbus1_suart.GPIOx = (GPIO_TypeDef *)PROJSET.MB_GPIOX;
|
||||
modbus1_suart.GPIO_PIN_RX = PROJSET.MB_GPIO_PIN_RX;
|
||||
modbus1_suart.GPIO_PIN_TX = PROJSET.MB_GPIO_PIN_TX;
|
||||
|
||||
// set up timeout TIM for modbus
|
||||
modbus1_stim.htim.Instance = USED_MODBUS_TIM;
|
||||
modbus1_stim.sTimAHBFreqMHz = PROJSET.MB_TIM_AHB_FREQ;
|
||||
modbus1_stim.sTimMode = TIM_IT_CONF;
|
||||
|
||||
// set up modbus: MB_RX_Size_NotConst and Timeout enable
|
||||
hmodbus1.ID = PROJSET.MB_DEVICE_ID;
|
||||
hmodbus1.sRS_Timeout = PROJSET.MB_MAX_TIMEOUT;
|
||||
hmodbus1.sRS_Mode = SLAVE_ALWAYS_WAIT;
|
||||
hmodbus1.sRS_RX_Size_Mode = RS_RX_Size_NotConst;
|
||||
|
||||
// INIT
|
||||
hmodbus1.RS_STATUS = RS_Init(&hmodbus1, &modbus1_suart, &modbus1_stim, 0);
|
||||
}
|
||||
/**
|
||||
* @brief Set or Reset Coil at its global address.
|
||||
* @param Addr - адрес коила.
|
||||
* @param WriteVal - Что записать в коил: 0 или 1.
|
||||
* @return ExceptionCode - Код исключения если коила по адресу не существует, и NO_ERRORS если все ок.
|
||||
*
|
||||
* @note Позволяет обратиться к любому коилу по его глобальному адрессу.
|
||||
Вне зависимости от того как коилы размещены в памяти.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_Write_Coil_Global(uint16_t Addr, MB_CoilsOpTypeDef WriteVal)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
MB_ExceptionTypeDef Exception = NO_ERRORS;
|
||||
uint16_t *coils;
|
||||
uint16_t start_shift = 0; // shift in coils register
|
||||
|
||||
//------------WRITE COIL-------------
|
||||
Exception = MB_DefineCoilsAddress(&coils, Addr, 1, &start_shift, 1);
|
||||
if(Exception == NO_ERRORS)
|
||||
{
|
||||
switch(WriteVal)
|
||||
{
|
||||
case SET_COIL:
|
||||
*coils |= (1<<start_shift);
|
||||
break;
|
||||
|
||||
case RESET_COIL:
|
||||
*coils &= ~(1<<start_shift);
|
||||
break;
|
||||
|
||||
case TOOGLE_COIL:
|
||||
*coils ^= (1<<start_shift);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return Exception;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Read Coil at its global address.
|
||||
* @param Addr - адрес коила.
|
||||
* @param Exception - Указатель на переменную для кода исключения, в случа неудачи при чтении.
|
||||
* @return uint16_t - Возвращает весь регистр с маской на запрошенном коиле.
|
||||
*
|
||||
* @note Позволяет обратиться к любому коилу по его глобальному адрессу.
|
||||
Вне зависимости от того как коилы размещены в памяти.
|
||||
*/
|
||||
uint16_t MB_Read_Coil_Global(uint16_t Addr, MB_ExceptionTypeDef *Exception)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
MB_ExceptionTypeDef Exception_tmp;
|
||||
if(Exception == NULL) // if exception is not given to func fill it
|
||||
Exception = &Exception_tmp;
|
||||
|
||||
uint16_t *coils;
|
||||
uint16_t start_shift = 0; // shift in coils register
|
||||
|
||||
//------------READ COIL--------------
|
||||
*Exception = MB_DefineCoilsAddress(&coils, Addr, 1, &start_shift, 0);
|
||||
if(*Exception == NO_ERRORS)
|
||||
{
|
||||
return ((*coils)&(1<<start_shift));
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//----------------FUNCTIONS FOR PROCESSING MESSAGE-------------------
|
||||
/**
|
||||
* @brief Define Address Origin for Input/Holding Registers
|
||||
* @param pRegs - указатель на указатель регистров.
|
||||
* @param Addr - адрес начального регистра.
|
||||
* @param Qnt - количество запрашиваемых регистров.
|
||||
* @param WriteFlag - флаг регистр нужны для чтения или записи.
|
||||
* @return ExceptionCode - Код исключения если есть, и NO_ERRORS если нет.
|
||||
*
|
||||
* @note Определение адреса начального регистра.
|
||||
* @note WriteFlag пока не используется.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_DefineRegistersAddress(uint16_t **pRegs, uint16_t Addr, uint16_t Qnt, uint8_t WriteFlag)
|
||||
{
|
||||
/* check quantity error */
|
||||
if (Qnt > 125)
|
||||
{
|
||||
return ILLEGAL_DATA_VALUE; // return exception code
|
||||
}
|
||||
|
||||
// sensors array
|
||||
if(MB_Check_Address_For_Arr(Addr, Qnt, R_SINE_LOG_ADDR, R_SINE_LOG_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&sine_log, Addr); // начало регистров хранения/входных
|
||||
}
|
||||
// PWM array
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, R_PWM_LOG_ADDR, R_PWM_LOG_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&pwm_log, Addr - R_PWM_LOG_ADDR); // начало регистров хранения/входных
|
||||
}
|
||||
// counter array
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, R_CNT_LOG_ADDR, R_CNT_LOG_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&cnt_log, Addr - R_CNT_LOG_ADDR); // начало регистров хранения/входных
|
||||
}
|
||||
// time array
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, R_TIME_LOG_ADDR, R_TIME_LOG_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&time_log, Addr - R_TIME_LOG_ADDR); // начало регистров хранения/входных
|
||||
}
|
||||
// PWM array
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, R_PWM_CTRL_ADDR, R_PWM_CTRL_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&pwm_ctrl, Addr - R_PWM_CTRL_ADDR); // начало регистров хранения/входных
|
||||
}
|
||||
// log array
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, R_LOG_CTRL_ADDR, R_LOG_CTRL_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&log_ctrl, Addr - R_LOG_CTRL_ADDR); // начало регистров хранения/входных
|
||||
}
|
||||
// uart settings array
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, R_UART_CTRL_ADDR, R_UART_CTRL_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pRegs = MB_Set_Register_Ptr(&uart_ctrl, Addr - R_UART_CTRL_ADDR); // начало регистров хранения/входных
|
||||
}
|
||||
// if address doesnt match any array - return illegal data address response
|
||||
else
|
||||
{
|
||||
return ILLEGAL_DATA_ADDRESS;
|
||||
}
|
||||
// if found requeried array return no err
|
||||
return NO_ERRORS; // return no errors
|
||||
}
|
||||
/**
|
||||
* @brief Define Address Origin for coils
|
||||
* @param pCoils - указатель на указатель коилов.
|
||||
* @param Addr - адресс начального коила.
|
||||
* @param Qnt - количество запрашиваемых коилов.
|
||||
* @param start_shift - указатель на переменную содержащую сдвиг внутри регистра для начального коила.
|
||||
* @param WriteFlag - флаг коилы нужны для чтения или записи.
|
||||
* @return ExceptionCode - Код исключения если есть, и NO_ERRORS если нет.
|
||||
*
|
||||
* @note Определение адреса начального регистра запрашиваемых коилов.
|
||||
* @note WriteFlag используется для определния регистров GPIO: ODR или IDR.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_DefineCoilsAddress(uint16_t **pCoils, uint16_t Addr, uint16_t Qnt, uint16_t *start_shift, uint8_t WriteFlag)
|
||||
{
|
||||
/* check quantity error */
|
||||
if (Qnt > 2000)
|
||||
{
|
||||
return ILLEGAL_DATA_VALUE; // return exception code
|
||||
}
|
||||
|
||||
// gpiod coils
|
||||
if(MB_Check_Address_For_Arr(Addr, Qnt, C_GPIOD_ADDR, C_GPIOD_QNT) == NO_ERRORS)
|
||||
{
|
||||
if(WriteFlag) // if write set odr
|
||||
*pCoils = MB_Set_Coil_Reg_Ptr(&GPIOD->ODR, Addr);
|
||||
else // if read set idr
|
||||
*pCoils = MB_Set_Coil_Reg_Ptr(&GPIOD->IDR, Addr);
|
||||
}
|
||||
// peripheral control coils
|
||||
else if(MB_Check_Address_For_Arr(Addr, Qnt, C_CTRL_COILS_ADDR, C_CTRL_COILS_QNT) == NO_ERRORS)
|
||||
{
|
||||
*pCoils = MB_Set_Coil_Reg_Ptr(&coils_regs, Addr-C_CTRL_COILS_ADDR);
|
||||
}
|
||||
// if address doesnt match any array - return illegal data address response
|
||||
else
|
||||
{
|
||||
return ILLEGAL_DATA_ADDRESS;
|
||||
}
|
||||
|
||||
*start_shift = Addr % 16; // set shift to requested coil
|
||||
// if found requeried array return no err
|
||||
return NO_ERRORS; // return no errors
|
||||
}
|
||||
/**
|
||||
* @brief Check is address valid for certain array.
|
||||
* @param Addr - начальный адресс.
|
||||
* @param Qnt - количество запрашиваемых элементов.
|
||||
* @param R_ARR_ADDR - начальный адресс массива R_ARR.
|
||||
* @param R_ARR_NUMB - количество элементов в массиве R_ARR.
|
||||
* @return ExceptionCode - ILLEGAL DATA ADRESS если адресс недействителен, и NO_ERRORS если все ок.
|
||||
*
|
||||
* @note Позволяет определить, принадлежит ли адресс Addr массиву R_ARR:
|
||||
* Если адресс Addr находится в диапазоне адрессов массива R_ARR, то возвращаем NO_ERROR.
|
||||
* Если адресс Addr находится за пределами адрессов массива R_ARR - ILLEGAL_DATA_ADDRESSю.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_Check_Address_For_Arr(uint16_t Addr, uint16_t Qnt, uint16_t R_ARR_ADDR, uint16_t R_ARR_NUMB)
|
||||
{
|
||||
// if address from this array
|
||||
if(Addr >= R_ARR_ADDR)
|
||||
{
|
||||
// if quantity too big return error
|
||||
if ((Addr - R_ARR_ADDR) + Qnt > R_ARR_NUMB)
|
||||
{
|
||||
return ILLEGAL_DATA_ADDRESS; // return exception code
|
||||
}
|
||||
// if all ok - return no errors
|
||||
return NO_ERRORS;
|
||||
}
|
||||
// if address isnt from this array return error
|
||||
else
|
||||
return ILLEGAL_DATA_ADDRESS; // return exception code
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Proccess command Read Coils (01 - 0x01).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Read Coils.
|
||||
*/
|
||||
uint8_t MB_Read_Coils(RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
uint16_t *coils;
|
||||
uint16_t start_shift = 0; // shift in coils register
|
||||
|
||||
modbus_msg->Except_Code = MB_DefineCoilsAddress(&coils, modbus_msg->Addr, modbus_msg->Qnt, &start_shift, 0);
|
||||
if(modbus_msg->Except_Code != NO_ERRORS)
|
||||
return 0;
|
||||
|
||||
//-----------READING COIL------------
|
||||
// setup output message data size
|
||||
modbus_msg->ByteCnt = Divide_Up(modbus_msg->Qnt, 8);
|
||||
// create mask for coils
|
||||
uint16_t mask_for_coils = 0; // mask for coils that've been chosen
|
||||
uint16_t setted_coils = 0; // value of setted coils
|
||||
uint16_t temp_reg = 0; // temp register for saving coils that hasnt been chosen
|
||||
uint16_t coil_cnt = 0; // counter for processed coils
|
||||
|
||||
// cycle until all registers with requered coils would be processed
|
||||
int shift = start_shift; // set shift to first coil in first register
|
||||
int ind = 0; // index for coils registers and data
|
||||
for(; ind <= Divide_Up(start_shift + modbus_msg->Qnt, 16); ind++)
|
||||
{
|
||||
//----SET MASK FOR COILS REGISTER----
|
||||
mask_for_coils = 0;
|
||||
for(; shift < 0x10; shift++)
|
||||
{
|
||||
mask_for_coils |= 1<<(shift); // choose certain coil
|
||||
if(++coil_cnt >= modbus_msg->Qnt)
|
||||
break;
|
||||
}
|
||||
shift = 0; // set shift to zero for the next step
|
||||
|
||||
//-----------READ COILS--------------
|
||||
modbus_msg->DATA[ind] = (*(coils+ind)&mask_for_coils) >> start_shift;
|
||||
if(ind > 0)
|
||||
modbus_msg->DATA[ind-1] |= ((*(coils+ind)&mask_for_coils) << 16) >> start_shift;
|
||||
|
||||
}
|
||||
// т.к. DATA 16-битная, для 8-битной передачи, надо поменять местами верхний и нижний байты
|
||||
for(; ind >= 0; --ind)
|
||||
modbus_msg->DATA[ind] = ByteSwap16(modbus_msg->DATA[ind]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Proccess command Read Holding Registers (03 - 0x03).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Read Holding Registers.
|
||||
*/
|
||||
uint8_t MB_Read_Hold_Regs(RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
// get origin address for data
|
||||
uint16_t *pHoldRegs;
|
||||
modbus_msg->Except_Code = MB_DefineRegistersAddress(&pHoldRegs, modbus_msg->Addr, modbus_msg->Qnt, NULL); // определение адреса регистров
|
||||
if(modbus_msg->Except_Code != NO_ERRORS)
|
||||
return 0;
|
||||
|
||||
|
||||
//-----------READING REGS------------
|
||||
// setup output message data size
|
||||
modbus_msg->ByteCnt = modbus_msg->Qnt*2; // *2 because we transmit 8 bits, not 16 bits
|
||||
// read data
|
||||
int i;
|
||||
for (i = 0; i<modbus_msg->Qnt; i++)
|
||||
{
|
||||
modbus_msg->DATA[i] = *(pHoldRegs++);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/**
|
||||
* @brief Proccess command Write Single Coils (05 - 0x05).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Single Coils.
|
||||
*/
|
||||
uint8_t MB_Write_Single_Coil(RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
if ((modbus_msg->Qnt != 0x0000) && (modbus_msg->Qnt != 0xFF00))
|
||||
{
|
||||
modbus_msg->Except_Code = ILLEGAL_DATA_VALUE;
|
||||
return 0;
|
||||
}
|
||||
// define position of coil
|
||||
uint16_t *coils;
|
||||
uint16_t start_shift = 0; // shift in coils register
|
||||
modbus_msg->Except_Code = MB_DefineCoilsAddress(&coils, modbus_msg->Addr, 0, &start_shift, 1);
|
||||
if(modbus_msg->Except_Code != NO_ERRORS)
|
||||
return 0;
|
||||
|
||||
|
||||
//----------WRITTING COIL------------
|
||||
if(modbus_msg->Qnt == 0xFF00)
|
||||
*(coils) |= 1<<start_shift; // write flags corresponding to received data
|
||||
else
|
||||
*(coils) &= ~(1<<start_shift); // write flags corresponding to received data
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Proccess command Write Single Register (06 - 0x06).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Single Register.
|
||||
*/
|
||||
uint8_t MB_Write_Single_Reg(RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
// get origin address for data
|
||||
uint16_t *pInputRegs;
|
||||
modbus_msg->Except_Code = MB_DefineRegistersAddress(&pInputRegs, modbus_msg->Addr, 1, NULL); // определение адреса регистров
|
||||
if(modbus_msg->Except_Code != NO_ERRORS)
|
||||
return 0;
|
||||
|
||||
//-----------WRITTING REG------------
|
||||
*(pInputRegs) = modbus_msg->Qnt;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Proccess command Write Multiple Coils (15 - 0x0F).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Multiple Coils.
|
||||
*/
|
||||
uint8_t MB_Write_Miltuple_Coils(RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
if (modbus_msg->ByteCnt != Divide_Up(modbus_msg->Qnt, 8))
|
||||
{ // if quantity too large OR if quantity and bytes count arent match
|
||||
modbus_msg->Except_Code = ILLEGAL_DATA_VALUE;
|
||||
return 0;
|
||||
}
|
||||
// define position of coil
|
||||
uint16_t *coils; // pointer to coils
|
||||
uint16_t start_shift = 0; // shift in coils register
|
||||
modbus_msg->Except_Code = MB_DefineCoilsAddress(&coils, modbus_msg->Addr, modbus_msg->Qnt, &start_shift, 1);
|
||||
if(modbus_msg->Except_Code != NO_ERRORS)
|
||||
return 0;
|
||||
|
||||
//----------WRITTING COILS-----------
|
||||
// create mask for coils
|
||||
uint16_t mask_for_coils = 0; // mask for coils that've been chosen
|
||||
uint32_t setted_coils = 0; // value of setted coils
|
||||
uint16_t temp_reg = 0; // temp register for saving coils that hasnt been chosen
|
||||
uint16_t coil_cnt = 0; // counter for processed coils
|
||||
|
||||
// cycle until all registers with requered coils would be processed
|
||||
int shift = start_shift; // set shift to first coil in first register
|
||||
for(int ind = 0; ind <= Divide_Up(start_shift + modbus_msg->Qnt, 16); ind++)
|
||||
{
|
||||
//----SET MASK FOR COILS REGISTER----
|
||||
mask_for_coils = 0;
|
||||
for(; shift < 0x10; shift++)
|
||||
{
|
||||
mask_for_coils |= 1<<(shift); // choose certain coil
|
||||
if(++coil_cnt >= modbus_msg->Qnt)
|
||||
break;
|
||||
}
|
||||
shift = 0; // set shift to zero for the next step
|
||||
|
||||
|
||||
|
||||
//-----------WRITE COILS-------------
|
||||
// get current coils
|
||||
temp_reg = *(coils+ind);
|
||||
// set coils
|
||||
setted_coils = ByteSwap16(modbus_msg->DATA[ind]) << start_shift;
|
||||
if(ind > 0)
|
||||
{
|
||||
setted_coils |= ((ByteSwap16(modbus_msg->DATA[ind-1]) << start_shift) >> 16);
|
||||
}
|
||||
// write coils
|
||||
|
||||
*(coils+ind) = setted_coils & mask_for_coils;
|
||||
// restore untouched coils
|
||||
*(coils+ind) |= temp_reg&(~mask_for_coils);
|
||||
|
||||
|
||||
if(coil_cnt >= modbus_msg->Qnt) // if all coils written - break cycle
|
||||
break; // *kind of unnecessary
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Proccess command Write Multiple Registers (16 - 0x10).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Multiple Registers.
|
||||
*/
|
||||
uint8_t MB_Write_Miltuple_Regs(RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
//---------CHECK FOR ERRORS----------
|
||||
if (modbus_msg->Qnt*2 != modbus_msg->ByteCnt)
|
||||
{ // if quantity and bytes count arent match
|
||||
modbus_msg->Except_Code = 3;
|
||||
return 0;
|
||||
}
|
||||
// get origin address for data
|
||||
uint16_t *pInputRegs;
|
||||
modbus_msg->Except_Code = MB_DefineRegistersAddress(&pInputRegs, modbus_msg->Addr, modbus_msg->Qnt, NULL); // определение адреса регистров
|
||||
if(modbus_msg->Except_Code != NO_ERRORS)
|
||||
return 0;
|
||||
|
||||
//-----------WRITTING REGS-----------
|
||||
for (int i = 0; i<modbus_msg->Qnt; i++)
|
||||
{
|
||||
*(pInputRegs++) = modbus_msg->DATA[i];
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Respond accord to received message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о результате ответа на комманду.
|
||||
* @note Обработка принятой комманды и ответ на неё.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Response(RS_HandleTypeDef *hmodbus, RS_MsgTypeDef *modbus_msg)
|
||||
{
|
||||
RS_StatusTypeDef MB_RES = 0;
|
||||
hmodbus->fMessageHandled = 0;
|
||||
hmodbus->fEchoResponse = 0;
|
||||
RS_Reset_TX_Flags(hmodbus); // reset flag for correct transmit
|
||||
|
||||
if(modbus_msg->Func_Code < ERR_VALUES_START)// if no errors after parsing
|
||||
{
|
||||
switch (modbus_msg->Func_Code)
|
||||
{
|
||||
// Read Coils
|
||||
case MB_R_COILS:
|
||||
hmodbus->fMessageHandled = MB_Read_Coils(hmodbus->pMessagePtr);
|
||||
break;
|
||||
// case MB_R_DISC_IN: break;
|
||||
|
||||
// Read Hodling Registers
|
||||
case MB_R_HOLD_REGS:
|
||||
case MB_R_IN_REGS:
|
||||
hmodbus->fMessageHandled = MB_Read_Hold_Regs(hmodbus->pMessagePtr);
|
||||
break;
|
||||
|
||||
|
||||
// Write Single Coils
|
||||
case MB_W_COIL:
|
||||
hmodbus->fMessageHandled = MB_Write_Single_Coil(hmodbus->pMessagePtr);
|
||||
if(hmodbus->fMessageHandled) hmodbus->fEchoResponse = 1; // echo response if write ok
|
||||
break;
|
||||
|
||||
case MB_W_IN_REG:
|
||||
hmodbus->fMessageHandled = MB_Write_Single_Reg(hmodbus->pMessagePtr);
|
||||
if(hmodbus->fMessageHandled) hmodbus->fEchoResponse = 1; // echo response if write ok
|
||||
break;
|
||||
|
||||
// Write Multiple Coils
|
||||
case MB_W_COILS:
|
||||
hmodbus->fMessageHandled = MB_Write_Miltuple_Coils(hmodbus->pMessagePtr);
|
||||
if(hmodbus->fMessageHandled) hmodbus->fEchoResponse = 1; hmodbus->RS_Message_Size = 6; // echo response if write ok (withous data bytes)
|
||||
break;
|
||||
|
||||
// Write Multiple Registers
|
||||
case MB_W_IN_REGS:
|
||||
hmodbus->fMessageHandled = MB_Write_Miltuple_Regs(hmodbus->pMessagePtr);
|
||||
if(hmodbus->fMessageHandled) hmodbus->fEchoResponse = 1; hmodbus->RS_Message_Size = 6; // echo response if write ok (withous data bytes)
|
||||
break;
|
||||
|
||||
/* unknown func code */
|
||||
default: modbus_msg->Except_Code = 0x01; /* set exception code: illegal function */
|
||||
}
|
||||
|
||||
if(hmodbus->fMessageHandled == 0)
|
||||
modbus_msg->Func_Code += ERR_VALUES_START;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// if we need response - check that transmit isnt busy
|
||||
if( RS_Is_TX_Busy(hmodbus) )
|
||||
RS_Abort(hmodbus, ABORT_TX); // if tx busy - set it free
|
||||
|
||||
// Transmit right there, or sets (fDeferredResponse) to transmit response in main code
|
||||
MB_RES = RS_Handle_Transmit_Start(hmodbus, modbus_msg);
|
||||
|
||||
hmodbus->RS_STATUS = MB_RES;
|
||||
return MB_RES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Collect message in buffer to transmit it.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @param msg_uart_buff - указатель на буффер UART.
|
||||
* @return RS_RES - статус о результате заполнения буфера.
|
||||
* @note Заполнение буффера UART из структуры сообщения.
|
||||
*/
|
||||
RS_StatusTypeDef Collect_Message(RS_HandleTypeDef *hmodbus, RS_MsgTypeDef *modbus_msg, uint8_t *modbus_uart_buff)
|
||||
{
|
||||
int ind = 0; // ind for modbus-uart buffer
|
||||
|
||||
if(hmodbus->fEchoResponse && hmodbus->fMessageHandled) // if echo response need
|
||||
ind = hmodbus->RS_Message_Size;
|
||||
else
|
||||
{
|
||||
//------INFO ABOUT DATA/MESSAGE------
|
||||
//-----------[first bytes]-----------
|
||||
// set ID of message/user
|
||||
modbus_uart_buff[ind++] = modbus_msg->MbAddr;
|
||||
|
||||
// set dat or err response
|
||||
modbus_uart_buff[ind++] = modbus_msg->Func_Code;
|
||||
|
||||
if (modbus_msg->Func_Code < ERR_VALUES_START) // if no error occur
|
||||
{
|
||||
// set size of received data
|
||||
if (modbus_msg->ByteCnt <= DATA_SIZE*2) // if ByteCnt less than DATA_SIZE
|
||||
modbus_uart_buff[ind++] = modbus_msg->ByteCnt;
|
||||
else // otherwise return data_size err
|
||||
return RS_COLLECT_MSG_ERR;
|
||||
|
||||
//---------------DATA----------------
|
||||
//-----------[data bytes]------------
|
||||
uint16_t *tmp_data_addr = (uint16_t *)modbus_msg->DATA;
|
||||
for(int i = 0; i < modbus_msg->ByteCnt; i++) // filling buffer with data
|
||||
{ // set data
|
||||
if (i%2 == 0) // HI byte
|
||||
modbus_uart_buff[ind++] = (*tmp_data_addr)>>8;
|
||||
else // LO byte
|
||||
{
|
||||
modbus_uart_buff[ind++] = *tmp_data_addr;
|
||||
tmp_data_addr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // if some error occur
|
||||
{ // send expection code
|
||||
modbus_uart_buff[ind++] = modbus_msg->Except_Code;
|
||||
}
|
||||
}
|
||||
//---------------CRC----------------
|
||||
//---------[last 16 bytes]----------
|
||||
// calc crc of received data
|
||||
uint16_t CRC_VALUE = crc16(modbus_uart_buff, ind);
|
||||
// write crc to message structure and modbus-uart buffer
|
||||
modbus_msg->MB_CRC = CRC_VALUE;
|
||||
modbus_uart_buff[ind++] = CRC_VALUE;
|
||||
modbus_uart_buff[ind++] = CRC_VALUE >> 8;
|
||||
|
||||
hmodbus->RS_Message_Size = ind;
|
||||
|
||||
return RS_OK; // returns ok
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Parse message from buffer to process it.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @param msg_uart_buff - указатель на буффер UART.
|
||||
* @return RS_RES - статус о результате заполнения структуры.
|
||||
* @note Заполнение структуры сообщения из буффера UART.
|
||||
*/
|
||||
RS_StatusTypeDef Parse_Message(RS_HandleTypeDef *hmodbus, RS_MsgTypeDef *modbus_msg, uint8_t *modbus_uart_buff)
|
||||
{
|
||||
uint32_t check_empty_buff;
|
||||
int ind = 0; // ind for modbus-uart buffer
|
||||
//-----INFO ABOUT DATA/MESSAGE-------
|
||||
//-----------[first bits]------------
|
||||
// get ID of message/user
|
||||
modbus_msg->MbAddr = modbus_uart_buff[ind++];
|
||||
if(modbus_msg->MbAddr != hmodbus->ID)
|
||||
return RS_SKIP;
|
||||
|
||||
// get dat or err response
|
||||
modbus_msg->Func_Code = modbus_uart_buff[ind++];
|
||||
|
||||
// get address from CMD
|
||||
modbus_msg->Addr = modbus_uart_buff[ind++] << 8;
|
||||
modbus_msg->Addr |= modbus_uart_buff[ind++];
|
||||
|
||||
// get address from CMD
|
||||
modbus_msg->Qnt = modbus_uart_buff[ind++] << 8;
|
||||
modbus_msg->Qnt |= modbus_uart_buff[ind++];
|
||||
|
||||
if(hmodbus->fRX_Half == 0) // if all message received
|
||||
{
|
||||
//---------------DATA----------------
|
||||
// (optional)
|
||||
if (modbus_msg->ByteCnt != 0)
|
||||
{
|
||||
ind++; // increment ind for data_size byte
|
||||
//check that data size is correct
|
||||
if (modbus_msg->ByteCnt > DATA_SIZE)
|
||||
{
|
||||
// hmodbus->MB_RESPONSE = MB_DATA_SIZE_ERR; // set func code - error data size more than maximumif yes, set func code - error about empty message
|
||||
modbus_msg->Func_Code += ERR_VALUES_START;
|
||||
return RS_PARSE_MSG_ERR;
|
||||
}
|
||||
uint16_t *tmp_data_addr = (uint16_t *)modbus_msg->DATA;
|
||||
for(int i = 0; i < modbus_msg->ByteCnt; i++) // /2 because we transmit 8 bits, not 16 bits
|
||||
{ // set data
|
||||
if (i%2 == 0)
|
||||
*tmp_data_addr = ((uint16_t)modbus_uart_buff[ind++] << 8);
|
||||
else
|
||||
{
|
||||
*tmp_data_addr |= modbus_uart_buff[ind++];
|
||||
tmp_data_addr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------CRC----------------
|
||||
//----------[last 16 bits]----------
|
||||
// calc crc of received data
|
||||
uint16_t CRC_VALUE = crc16(modbus_uart_buff, ind);
|
||||
// get crc of received data
|
||||
modbus_msg->MB_CRC = modbus_uart_buff[ind++];
|
||||
modbus_msg->MB_CRC |= modbus_uart_buff[ind++] << 8;
|
||||
// compare crc
|
||||
if (modbus_msg->MB_CRC != CRC_VALUE)
|
||||
modbus_msg->Func_Code += ERR_VALUES_START;
|
||||
// hmodbus->MB_RESPONSE = MB_CRC_ERR; // set func code - error about wrong crc
|
||||
|
||||
// check is buffer empty
|
||||
check_empty_buff = 0;
|
||||
for(int i=0; i<ind;i++)
|
||||
check_empty_buff += modbus_uart_buff[i];
|
||||
// if(check_empty_buff == 0)
|
||||
// hmodbus->MB_RESPONSE = MB_EMPTY_MSG; //
|
||||
}
|
||||
|
||||
return RS_OK;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Define size of RX Message that need to be received.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param rx_data_size - указатель на переменную для записи кол-ва байт для принятия.
|
||||
* @return RS_RES - статус о корректности рассчета кол-ва байт для принятия.
|
||||
* @note Определение сколько байтов надо принять по протоколу.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Define_Size_of_RX_Message(RS_HandleTypeDef *hmodbus, uint32_t *rx_data_size)
|
||||
{
|
||||
RS_StatusTypeDef MB_RES = 0;
|
||||
|
||||
MB_RES = Parse_Message(hmodbus, hmodbus->pMessagePtr, hmodbus->pBufferPtr);
|
||||
if(MB_RES == RS_SKIP) // if message not for us
|
||||
return MB_RES; // return
|
||||
|
||||
if ((hmodbus->pMessagePtr->Func_Code & ~ERR_VALUES_START) < 0x0F)
|
||||
{
|
||||
hmodbus->pMessagePtr->ByteCnt = 0;
|
||||
*rx_data_size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
hmodbus->pMessagePtr->ByteCnt = hmodbus->pBufferPtr[RX_FIRST_PART_SIZE-1]; // get numb of data in command
|
||||
// +1 because that defines is size, not ind.
|
||||
*rx_data_size = hmodbus->pMessagePtr->ByteCnt + 2;
|
||||
}
|
||||
hmodbus->RS_Message_Size = RX_FIRST_PART_SIZE + *rx_data_size; // size of whole message
|
||||
return RS_OK;
|
||||
}
|
||||
|
||||
//-----------------------------FOR USER------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------HANDLERS FUNCTION-------------------------
|
||||
#if (MODBUS_UART_NUMB == 1) // choose handler for UART
|
||||
void USART1_IRQHandler(void)
|
||||
#elif (MODBUS_UART_NUMB == 2)
|
||||
void USART2_IRQHandler(void)
|
||||
#elif (MODBUS_UART_NUMB == 3)
|
||||
void USART3_IRQHandler(void)
|
||||
#elif (MODBUS_UART_NUMB == 4)
|
||||
void USART4_IRQHandler(void)
|
||||
#elif (MODBUS_UART_NUMB == 5)
|
||||
void USART5_IRQHandler(void)
|
||||
#elif (MODBUS_UART_NUMB == 6)
|
||||
void USART6_IRQHandler(void)
|
||||
#endif
|
||||
{
|
||||
Trace_MB_UART_Enter();
|
||||
RS_UART_Handler(&hmodbus1);
|
||||
Trace_MB_UART_Exit();
|
||||
}
|
||||
#if (MODBUS_TIM_NUMB == 1) || (MODBUS_TIM_NUMB == 10) // choose handler for TIM
|
||||
void TIM1_UP_TIM10_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 2)
|
||||
void TIM2_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 3)
|
||||
void TIM3_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 4)
|
||||
void TIM4_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 5)
|
||||
void TIM5_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 6)
|
||||
void TIM6_DAC_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 7)
|
||||
void TIM7_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 8) || (MODBUS_TIM_NUMB == 13)
|
||||
void TIM8_UP_TIM13_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 1) || (MODBUS_TIM_NUMB == 9)
|
||||
void TIM1_BRK_TIM9_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 1) || (MODBUS_TIM_NUMB == 11)
|
||||
void TIM1_TRG_COM_TIM11_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 8) || (MODBUS_TIM_NUMB == 12)
|
||||
void TIM8_BRK_TIM12_IRQHandler(void)
|
||||
#elif (MODBUS_TIM_NUMB == 8) || (MODBUS_TIM_NUMB == 14)
|
||||
void TIM8_TRG_COM_TIM14_IRQHandler(void)
|
||||
#endif
|
||||
{
|
||||
Trace_MB_TIM_Enter();
|
||||
RS_TIM_Handler(&hmodbus1);
|
||||
Trace_MB_TIM_Exit();
|
||||
}
|
||||
|
||||
//-------------------------HANDLERS FUNCTION-------------------------
|
||||
//-------------------------------------------------------------------
|
||||
419
научка/code/pwm_motor_control/Modbus/Modbus.h
Normal file
@@ -0,0 +1,419 @@
|
||||
/********************************MODBUS*************************************
|
||||
Данный файл содержит объявления базовых функции и дефайны для реализации
|
||||
MODBUS.
|
||||
Данный файл необходимо подключить в rs_message.h. После подключать rs_message.h
|
||||
к основному проекту.
|
||||
***************************************************************************/
|
||||
#ifndef __MODBUS_H_
|
||||
#define __MODBUS_H_
|
||||
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "modbus_data.h"
|
||||
#include "settings.h" // for modbus settings
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////---SETTINGS---/////////////////////////////
|
||||
|
||||
////----------DEFINES FOR MODBUS SETTING--------------
|
||||
//#define MODBUS_UART_NUMB 3 // number of used uart
|
||||
//#define MODBUS_SPEED 115200
|
||||
//#define MODBUS_GPIOX GPIOB
|
||||
//#define MODBUS_GPIO_PIN_RX GPIO_PIN_11
|
||||
//#define MODBUS_GPIO_PIN_TX GPIO_PIN_10
|
||||
///* accord to this define sets define USED_MB_UART = USARTx */
|
||||
//#define MODBUS_TIM_NUMB 7 // number of used uart
|
||||
//#define MODBUS_TIM_AHB_FREQ 72
|
||||
///* accord to this define sets define USED_MB_TIM = TIMx */
|
||||
|
||||
///* defines for modbus behaviour */
|
||||
//#define MODBUS_DEVICE_ID 1 // number of used uart
|
||||
//#define MODBUS_MAX_TIMEOUT 5000 // is ms
|
||||
//// custom define for size of receive message
|
||||
////--------------------------------------------------
|
||||
|
||||
//---------------MODBUS DEVICE DATA-----------------
|
||||
/* EXTERN REGISTERS/COILS */
|
||||
|
||||
extern uint16_t sine_log[R_SINE_LOG_QNT]; // start from 0x0000
|
||||
extern uint16_t pwm_log[R_PWM_LOG_QNT]; // start from 500 (0x1F4)
|
||||
extern uint16_t cnt_log[R_CNT_LOG_QNT]; // start from 100 (0x3E8)
|
||||
extern uint16_t time_log[R_TIME_LOG_QNT]; // start from 1500 (0x5DC)
|
||||
|
||||
extern uint16_t pwm_ctrl[R_PWM_CTRL_QNT]; // start from 2000 (0x7D0)
|
||||
extern uint16_t log_ctrl[R_LOG_CTRL_QNT]; // start from 2008 (0x7D0)
|
||||
|
||||
|
||||
extern uint16_t uart_ctrl[R_UART_CTRL_QNT];
|
||||
|
||||
extern uint16_t coils_regs[C_CTRL_COILS_QNT]; // start from 0x0001 (16th bit)
|
||||
|
||||
//--------------------------------------------------
|
||||
//////////////////////////---SETTINGS---/////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
/////////////////////---USER MESSAGE DEFINES---//////////////////////
|
||||
//-------------DEFINES FOR STRUCTURE----------------
|
||||
/* defines for structure of modbus message */
|
||||
#define MbAddr_SIZE 1 // size of (MbAddr)
|
||||
#define Func_Code_SIZE 1 // size of (Func_Code)
|
||||
#define Addr_SIZE 2 // size of (Addr)
|
||||
#define Qnt_SIZE 2 // size of (Qnt)
|
||||
#define ByteCnt_SIZE 1 // size of (ByteCnt)
|
||||
#define DATA_SIZE 125 // maximum number of data: DWORD (NOT MESSAGE SIZE)
|
||||
#define CRC_SIZE 2 // size of (MB_CRC) in bytes
|
||||
|
||||
/* size of info */
|
||||
#define INFO_SIZE_MAX (MbAddr_SIZE+Func_Code_SIZE+Addr_SIZE+Qnt_SIZE+ByteCnt_SIZE)
|
||||
|
||||
/* size of first part of message that will be received
|
||||
first receive info part of message, than defines size of rest message*/
|
||||
#define RX_FIRST_PART_SIZE INFO_SIZE_MAX
|
||||
|
||||
/* size of buffer: max size of whole message */
|
||||
#define MSG_SIZE_MAX (INFO_SIZE_MAX + DATA_SIZE*2 + CRC_SIZE) // max possible size of message
|
||||
|
||||
/* Structure for modbus exception codes */
|
||||
typedef enum //MB_ExceptionTypeDef
|
||||
{
|
||||
// reading
|
||||
NO_ERRORS = 0x00, // no errors
|
||||
ILLEGAL_FUNCTION = 0x01, // function cannot be processed
|
||||
ILLEGAL_DATA_ADDRESS = 0x02, // data at this address is not available
|
||||
ILLEGAL_DATA_VALUE = 0x03, // uncorrect data value (quantity too big and cannot be returned or value for coil is incorrect)
|
||||
SLAVE_DEVICE_FAILURE = 0x04, // idk
|
||||
ACKNOWLEDGE = 0x05, // idk
|
||||
SLAVE_DEVICE_BUSY = 0x06, // idk
|
||||
MEMORY_PARITY_ERROR = 0x08, // idk
|
||||
}MB_ExceptionTypeDef;
|
||||
|
||||
/* Structure for modbus func codes */
|
||||
typedef enum //MB_FunctonTypeDef
|
||||
{
|
||||
// reading
|
||||
MB_R_COILS = 0x01,
|
||||
MB_R_DISC_IN = 0x02,
|
||||
MB_R_IN_REGS = 0x03,
|
||||
MB_R_HOLD_REGS = 0x04,
|
||||
|
||||
// writting
|
||||
MB_W_COIL = 0x05,
|
||||
MB_W_IN_REG = 0x06,
|
||||
MB_W_COILS = 0x0F,
|
||||
MB_W_IN_REGS = 0x10,
|
||||
}MB_FunctonTypeDef;
|
||||
#define ERR_VALUES_START 0x80U // from this value starts error func codes
|
||||
|
||||
/* Structure for modbus messsage */
|
||||
typedef struct // RS_MsgTypeDef
|
||||
{
|
||||
uint8_t MbAddr;
|
||||
MB_FunctonTypeDef Func_Code;
|
||||
uint16_t Addr;
|
||||
uint16_t Qnt;
|
||||
uint8_t ByteCnt;
|
||||
|
||||
uint16_t DATA[DATA_SIZE];
|
||||
MB_ExceptionTypeDef Except_Code;
|
||||
|
||||
uint16_t MB_CRC;
|
||||
}RS_MsgTypeDef;
|
||||
//--------------------------------------------------
|
||||
/////////////////////---USER MESSAGE DEFINES---//////////////////////
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
/////////////////////---GENERAL MODBUS STUFF---//////////////////////
|
||||
/* Structure for coils operation */
|
||||
typedef enum
|
||||
{
|
||||
// READ_COIL,
|
||||
SET_COIL,
|
||||
RESET_COIL,
|
||||
TOOGLE_COIL,
|
||||
}MB_CoilsOpTypeDef;
|
||||
|
||||
//------------DEFINES FOR PROCESS DATA--------------
|
||||
/**
|
||||
* @brief Calc dividing including remainder
|
||||
* @param _val_ - делимое.
|
||||
* @param _div_ - делитель.
|
||||
* @note Если результат деления без остатка: он возвращается как есть
|
||||
Если с остатком - округляется вверх
|
||||
*/
|
||||
//#define Divide_Up(_val_, _div_) (((_val_)%(_div_))? (_val_)/(_div_)+1 : (_val_)/_div_) /* через тернарный оператор */
|
||||
#define Divide_Up(_val_, _div_) ((_val_ - 1) / _div_) + 1 /* через мат выражение */
|
||||
|
||||
/**
|
||||
* @brief Swap between Little Endian and Big Endian
|
||||
* @param v - Переменная для свапа.
|
||||
* @return v (new) - Свапнутая переменная.
|
||||
* @note Переключения между двумя типами хранения слова: HI-LO байты и LO-HI байты.
|
||||
*/
|
||||
#define ByteSwap16(v) (((v&0xFF00) >> (8)) | ((v&0x00FF) << (8)))
|
||||
//--------------------------------------------------
|
||||
|
||||
|
||||
//-----------DEFINES FOR ACCESS TO DATA-------------
|
||||
/**
|
||||
* @brief Macros to set pointer to 16-bit array
|
||||
* @param _arr_ - массив слов (16-бит).
|
||||
*/
|
||||
#define MB_Set_Arr16_Ptr(_arr_) ((uint16_t*)(&(_arr_)))
|
||||
/**
|
||||
* @brief Macros to set pointer to register
|
||||
* @param _parr_ - массив регистров.
|
||||
* @param _addr_ - Номер регистра (его индекс) от начала массива _arr_.
|
||||
*/
|
||||
#define MB_Set_Register_Ptr(_parr_, _addr_) ((uint16_t *)(_parr_)+(_addr_))
|
||||
|
||||
/**
|
||||
* @brief Macros to set pointer to a certain register that contains certain coil
|
||||
* @param _parr_ - массив коилов.
|
||||
* @param _coil_ - Номер коила от начала массива _arr_.
|
||||
* @note Пояснение выражений
|
||||
* (_coil_/16) - get index (address shift) of register that contain certain coil
|
||||
* (16*(_coil_/16) - how many coils we need to skip. e.g. (16*30/16) - skip 16 coils from first register
|
||||
* _coil_-(16*(_coil_/16)) - shift to certain coil in certain register
|
||||
* e.g. Coil(30) gets in register[1] (30/16 = 1) coil №14 (30 - (16*30/16) = 30 - 16 = 14)
|
||||
*
|
||||
* Visual explanation:
|
||||
* xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxCx
|
||||
* |register[0]----| |register[1]----|
|
||||
* |skip this------| |get this-------|
|
||||
* |shift to 14 bit|
|
||||
*/
|
||||
#define MB_Set_Coil_Reg_Ptr(_parr_, _coil_) ((uint16_t *)(_parr_)+((_coil_)/16))
|
||||
#define MB_Set_Coil_Mask(_coil_) (1 << ( _coil_ - (16*((_coil_)/16)) ))
|
||||
|
||||
/**
|
||||
* @brief Read Coil at its local address.
|
||||
* @param _parr_ - массив коилов.
|
||||
* @param _coil_ - Номер коила от начала массива _arr_.
|
||||
* @return uint16_t - Возвращает запрошенный коил на 0м бите.
|
||||
*
|
||||
* @note Позволяет обратиться к коилу по адресу относительно _arr_.
|
||||
*/
|
||||
#define MB_Read_Coil_Local(_parr_, _coil_) (( *MB_Set_Coil_Reg_Ptr(_parr_, _coil_) & MB_Set_Coil_Mask(_coil_) ) >> (_coil_))
|
||||
/**
|
||||
* @brief Set Coil at its local address.
|
||||
* @param _parr_ - указатель на массив коилов.
|
||||
* @param _coil_ - Номер коила от начала массива _arr_.
|
||||
*
|
||||
* @note Позволяет обратиться к коилу по адресу относительно _arr_.
|
||||
*/
|
||||
#define MB_Set_Coil_Local(_parr_, _coil_) *MB_Set_Coil_Reg_Ptr(_parr_, _coil_) |= MB_Set_Coil_Mask(_coil_)
|
||||
/**
|
||||
* @brief Reset Coil at its local address.
|
||||
* @param _parr_ - указатель на массив коилов.
|
||||
* @param _coil_ - Номер коила от начала массива _arr_.
|
||||
*
|
||||
* @note Позволяет обратиться к коилу по адресу относительно _arr_.
|
||||
*/
|
||||
#define MB_Reset_Coil_Local(_parr_, _coil_) *MB_Set_Coil_Reg_Ptr(_parr_, _coil_) &= ~(MB_Set_Coil_Mask(_coil_))
|
||||
/**
|
||||
* @brief Set Coil at its local address.
|
||||
* @param _parr_ - указатель на массив коилов.
|
||||
* @param _coil_ - Номер коила от начала массива _arr_.
|
||||
*
|
||||
* @note Позволяет обратиться к коилу по адресу относительно _arr_.
|
||||
*/
|
||||
#define MB_Toogle_Coil_Local(_parr_, _coil_) *MB_Set_Coil_Reg_Ptr(_parr_, _coil_) ^= MB_Set_Coil_Mask(_coil_)
|
||||
//--------------------------------------------------
|
||||
|
||||
|
||||
//------------------OTHER DEFINES-------------------
|
||||
// create hadnles and settings for uart, tim, rs with _modbus_ name
|
||||
#define CONCAT(a,b) a##b
|
||||
#define Create_MODBUS_Handles(_modbus_) \
|
||||
UART_SettingsTypeDef CONCAT(_modbus_, _suart); \
|
||||
UART_HandleTypeDef CONCAT(_modbus_, _huart); \
|
||||
TIM_SettingsTypeDef CONCAT(_modbus_, _stim); \
|
||||
TIM_HandleTypeDef CONCAT(_modbus_, _htim); \
|
||||
RS_HandleTypeDef CONCAT(h, _modbus_)
|
||||
//--------------------------------------------------
|
||||
///////////////////---MODBUS & MESSAGE DEFINES---////////////////////
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
////////////////////---FUNCTIONS FOR USER---/////////////////////////
|
||||
/**
|
||||
* @brief First set up of MODBUS.
|
||||
* @note Первый инит модбас. Заполняет структуры и инициализирует таймер и юарт для общения по модбас.
|
||||
* Скважность ШИМ меняется по закону синусоиды, каждый канал генерирует свой полупериод синуса (от -1 до 0 И от 0 до 1)
|
||||
* ШИМ генерируется на одном канале.
|
||||
* @note This called from main
|
||||
*/
|
||||
void MODBUS_FirstInit(void);
|
||||
/**
|
||||
* @brief Set or Reset Coil at its global address.
|
||||
* @param Addr - адрес коила.
|
||||
* @param WriteVal - Что записать в коил: 0 или 1.
|
||||
* @return ExceptionCode - Код исключения если коила по адресу не существует, и NO_ERRORS если все ок.
|
||||
*
|
||||
* @note Позволяет обратиться к любому коилу по его глобальному адрессу.
|
||||
Вне зависимости от того как коилы размещены в памяти.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_Write_Coil_Global(uint16_t Addr, MB_CoilsOpTypeDef WriteVal);
|
||||
/**
|
||||
* @brief Read Coil at its global address.
|
||||
* @param Addr - адрес коила.
|
||||
* @param Exception - Указатель на переменную для кода исключения, в случа неудачи при чтении.
|
||||
* @return uint16_t - Возвращает весь регистр с маской на запрошенном коиле.
|
||||
*
|
||||
* @note Позволяет обратиться к любому коилу по его глобальному адрессу.
|
||||
Вне зависимости от того как коилы размещены в памяти.
|
||||
*/
|
||||
uint16_t MB_Read_Coil_Global(uint16_t Addr, MB_ExceptionTypeDef *Exception);
|
||||
////////////////////---FUNCTIONS FOR USER---/////////////////////////
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
/////////////---PROCESS MODBUS COMMAND FUNCTIONS---//////////////////
|
||||
/**
|
||||
* @brief Check is address valid for certain array.
|
||||
* @param Addr - начальный адресс.
|
||||
* @param Qnt - количество запрашиваемых элементов.
|
||||
* @param R_ARR_ADDR - начальный адресс массива R_ARR.
|
||||
* @param R_ARR_NUMB - количество элементов в массиве R_ARR.
|
||||
* @return ExceptionCode - ILLEGAL DATA ADRESS если адресс недействителен, и NO_ERRORS если все ок.
|
||||
*
|
||||
* @note Позволяет определить, брать ли данные по адрессу Addr из массива R_ARR.
|
||||
* Если адресс Addr находится в диапазоне адрессов массива R_ARR, то возвращаем NO_ERROR.
|
||||
* Если адресс Addr находится за пределами адрессов массива R_ARR - ILLEGAL_DATA_ADDRESSю.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_Check_Address_For_Arr(uint16_t Addr, uint16_t Qnt, uint16_t R_ARR_ADDR, uint16_t R_ARR_NUMB);
|
||||
/**
|
||||
* @brief Define Address Origin for Input/Holding Registers
|
||||
* @param pRegs - указатель на указатель регистров.
|
||||
* @param Addr - адрес начального регистра.
|
||||
* @param Qnt - количество запрашиваемых регистров.
|
||||
* @param WriteFlag - флаг регистр нужны для чтения или записи.
|
||||
* @return ExceptionCode - Код исключения если есть, и NO_ERRORS если нет.
|
||||
*
|
||||
* @note Определение адреса начального регистра.
|
||||
* @note WriteFlag пока не используется.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_DefineRegistersAddress(uint16_t **pRegs, uint16_t Addr, uint16_t Qnt, uint8_t WriteFlag);
|
||||
/**
|
||||
* @brief Define Address Origin for coils
|
||||
* @param pCoils - указатель на указатель коилов.
|
||||
* @param Addr - адресс начального коила.
|
||||
* @param Qnt - количество запрашиваемых коилов.
|
||||
* @param start_shift - указатель на переменную содержащую сдвиг внутри регистра для начального коила.
|
||||
* @param WriteFlag - флаг коилы нужны для чтения или записи.
|
||||
* @return ExceptionCode - Код исключения если есть, и NO_ERRORS если нет.
|
||||
*
|
||||
* @note Определение адреса начального регистра запрашиваемых коилов.
|
||||
* @note WriteFlag используется для определния регистров GPIO: ODR или IDR.
|
||||
*/
|
||||
MB_ExceptionTypeDef MB_DefineCoilsAddress(uint16_t **pCoils, uint16_t Addr, uint16_t Qnt, uint16_t *start_shift, uint8_t WriteFlag);
|
||||
/**
|
||||
* @brief Proccess command Read Coils (01 - 0x01).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Read Coils.
|
||||
*/
|
||||
uint8_t MB_Read_Coils(RS_MsgTypeDef *modbus_msg);
|
||||
/**
|
||||
* @brief Proccess command Read Holding Registers (03 - 0x03).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Read Holding Registers.
|
||||
*/
|
||||
uint8_t MB_Read_Hold_Regs(RS_MsgTypeDef *modbus_msg);
|
||||
/**
|
||||
* @brief Proccess command Write Single Coils (05 - 0x05).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Single Coils.
|
||||
*/
|
||||
uint8_t MB_Write_Single_Coil(RS_MsgTypeDef *modbus_msg);
|
||||
/**
|
||||
* @brief Proccess command Write Multiple Coils (15 - 0x0F).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Multiple Coils.
|
||||
*/
|
||||
uint8_t MB_Write_Miltuple_Coils(RS_MsgTypeDef *modbus_msg);
|
||||
/**
|
||||
* @brief Proccess command Write Multiple Register (16 - 0x10).
|
||||
* @param modbus_msg - указатель на структуру собщения modbus.
|
||||
* @return fMessageHandled - статус о результате обработки комманды.
|
||||
* @note Обработка команды Write Multiple Register.
|
||||
*/
|
||||
uint8_t MB_Write_Miltuple_Regs(RS_MsgTypeDef *modbus_msg);
|
||||
/////////////---PROCESS MODBUS COMMAND FUNCTIONS---//////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////---CALC DEFINES---//////////////////////////
|
||||
|
||||
/* set USART_TypeDef for choosen numb of usart */
|
||||
#if (MODBUS_UART_NUMB == 1)
|
||||
#define USED_MODBUS_UART USART1
|
||||
#define USE_USART1
|
||||
#elif (MODBUS_UART_NUMB == 2)
|
||||
#define USED_MODBUS_UART USART2
|
||||
#define USE_USART2
|
||||
#elif (MODBUS_UART_NUMB == 3)
|
||||
#define USED_MODBUS_UART USART3
|
||||
#define USE_USART3
|
||||
#elif (MODBUS_UART_NUMB == 4)
|
||||
#define USED_MODBUS_UART UART4
|
||||
#define USE_UART4
|
||||
#elif (MODBUS_UART_NUMB == 5)
|
||||
#define USED_MODBUS_UART UART5
|
||||
#define USE_UART6
|
||||
#elif (MODBUS_UART_NUMB == 6)
|
||||
#define USED_MODBUS_UART USART6
|
||||
#define USE_USART6
|
||||
#endif
|
||||
|
||||
#if (MODBUS_TIM_NUMB == 1)
|
||||
#define USED_MODBUS_TIM TIM1
|
||||
#define USE_TIM1
|
||||
#elif (MODBUS_TIM_NUMB == 2)
|
||||
#define USED_MODBUS_TIM TIM2
|
||||
#define USE_TIM2
|
||||
#elif (MODBUS_TIM_NUMB == 3)
|
||||
#define USED_MODBUS_TIM TIM3
|
||||
#define USE_TIM3
|
||||
#elif (MODBUS_TIM_NUMB == 4)
|
||||
#define USED_MODBUS_TIM TIM4
|
||||
#define USE_TIM4
|
||||
#elif (MODBUS_TIM_NUMB == 5)
|
||||
#define USED_MODBUS_TIM TIM5
|
||||
#define USE_TIM5
|
||||
#elif (MODBUS_TIM_NUMB == 6)
|
||||
#define USED_MODBUS_TIM TIM6
|
||||
#define USE_TIM6
|
||||
#elif (MODBUS_TIM_NUMB == 7)
|
||||
#define USED_MODBUS_TIM TIM7
|
||||
#define USE_TIM7
|
||||
#elif (MODBUS_TIM_NUMB == 8)
|
||||
#define USED_MODBUS_TIM TIM8
|
||||
#define USE_TIM8
|
||||
#elif (MODBUS_TIM_NUMB == 9)
|
||||
#define USED_MODBUS_TIM TIM9
|
||||
#define USE_TIM9
|
||||
#elif (MODBUS_TIM_NUMB == 10)
|
||||
#define USED_MODBUS_TIM TIM10
|
||||
#define USE_TIM10
|
||||
#elif (MODBUS_TIM_NUMB == 11)
|
||||
#define USED_MODBUS_TIM TIM11
|
||||
#define USE_TIM11
|
||||
#elif (MODBUS_TIM_NUMB == 12)
|
||||
#define USED_MODBUS_TIM TIM12
|
||||
#define USE_TIM12
|
||||
#elif (MODBUS_TIM_NUMB == 13)
|
||||
#define USED_MODBUS_TIM TIM13
|
||||
#define USE_TIM13
|
||||
#elif (MODBUS_TIM_NUMB == 14)
|
||||
#define USED_MODBUS_TIM TIM14
|
||||
#define USE_TIM14
|
||||
#endif
|
||||
|
||||
|
||||
#endif //__MODBUS_H_
|
||||
116
научка/code/pwm_motor_control/Modbus/crc_algs.c
Normal file
@@ -0,0 +1,116 @@
|
||||
#include "crc_algs.h"
|
||||
|
||||
|
||||
uint32_t CRC_calc;
|
||||
uint32_t CRC_ref;
|
||||
|
||||
//uint16_t CRC_calc;
|
||||
//uint16_t CRC_ref;
|
||||
|
||||
|
||||
// left this global for debug
|
||||
uint8_t uchCRCHi = 0xFF;
|
||||
uint8_t uchCRCLo = 0xFF;
|
||||
unsigned uIndex;
|
||||
|
||||
|
||||
uint32_t crc32(uint8_t *data, uint32_t data_size)
|
||||
{
|
||||
static const unsigned int crc32_table[] =
|
||||
{
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
||||
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
||||
unsigned int crc = 0xFFFFFFFF;
|
||||
while (data_size--)
|
||||
{
|
||||
crc = (crc >> 8) ^ crc32_table[(crc ^ *data) & 255];
|
||||
data++;
|
||||
}
|
||||
return crc^0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
uint16_t crc16(uint8_t *data, uint32_t data_size)
|
||||
{
|
||||
/*Table of CRC values for high order byte*/
|
||||
static unsigned char auchCRCHi[]=
|
||||
{
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,
|
||||
0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,
|
||||
};
|
||||
/*Table of CRC values for low order byte*/
|
||||
static char auchCRCLo[] =
|
||||
{
|
||||
0x00,0xC0,0xC1,0x01,0xC3,0x03,0x02,0xC2,0xC6,0x06,0x07,0xC7,0x05,0xC5,0xC4,0x04,
|
||||
0xCC,0x0C,0x0D,0xCD,0x0F,0xCF,0xCE,0x0E,0x0A,0xCA,0xCB,0x0B,0xC9,0x09,0x08,0xC8,
|
||||
0xD8,0x18,0x19,0xD9,0x1B,0xDB,0xDA,0x1A,0x1E,0xDE,0xDF,0x1F,0xDD,0x1D,0x1C,0xDC,
|
||||
0x14,0xD4,0xD5,0x15,0xD7,0x17,0x16,0xD6,0xD2,0x12,0x13,0xD3,0x11,0xD1,0xD0,0x10,
|
||||
0xF0,0x30,0x31,0xF1,0x33,0xF3,0xF2,0x32,0x36,0xF6,0xF7,0x37,0xF5,0x35,0x34,0xF4,
|
||||
0x3C,0xFC,0xFD,0x3D,0xFF,0x3F,0x3E,0xFE,0xFA,0x3A,0x3B,0xFB,0x39,0xF9,0xF8,0x38,
|
||||
0x28,0xE8,0xE9,0x29,0xEB,0x2B,0x2A,0xEA,0xEE,0x2E,0x2F,0xEF,0x2D,0xED,0xEC,0x2C,
|
||||
0xE4,0x24,0x25,0xE5,0x27,0xE7,0xE6,0x26,0x22,0xE2,0xE3,0x23,0xE1,0x21,0x20,0xE0,
|
||||
0xA0,0x60,0x61,0xA1,0x63,0xA3,0xA2,0x62,0x66,0xA6,0xA7,0x67,0xA5,0x65,0x64,0xA4,
|
||||
0x6C,0xAC,0xAD,0x6D,0xAF,0x6F,0x6E,0xAE,0xAA,0x6A,0x6B,0xAB,0x69,0xA9,0xA8,0x68,
|
||||
0x78,0xB8,0xB9,0x79,0xBB,0x7B,0x7A,0xBA,0xBE,0x7E,0x7F,0xBF,0x7D,0xBD,0xBC,0x7C,
|
||||
0xB4,0x74,0x75,0xB5,0x77,0xB7,0xB6,0x76,0x72,0xB2,0xB3,0x73,0xB1,0x71,0x70,0xB0,
|
||||
0x50,0x90,0x91,0x51,0x93,0x53,0x52,0x92,0x96,0x56,0x57,0x97,0x55,0x95,0x94,0x54,
|
||||
0x9C,0x5C,0x5D,0x9D,0x5F,0x9F,0x9E,0x5E,0x5A,0x9A,0x9B,0x5B,0x99,0x59,0x58,0x98,
|
||||
0x88,0x48,0x49,0x89,0x4B,0x8B,0x8A,0x4A,0x4E,0x8E,0x8F,0x4F,0x8D,0x4D,0x4C,0x8C,
|
||||
0x44,0x84,0x85,0x45,0x87,0x47,0x46,0x86,0x82,0x42,0x43,0x83,0x41,0x81,0x80,0x40,
|
||||
};
|
||||
uchCRCHi = 0xFF;
|
||||
uchCRCLo = 0xFF;
|
||||
/* CRC Generation Function */
|
||||
while( data_size--) /* pass through message buffer */
|
||||
{
|
||||
uIndex = uchCRCHi ^ *data++; /* calculate the CRC */
|
||||
uchCRCHi = uchCRCLo ^ auchCRCHi[uIndex];
|
||||
uchCRCLo = auchCRCLo[uIndex];
|
||||
}
|
||||
return uchCRCHi | uchCRCLo<<8;
|
||||
}
|
||||
9
научка/code/pwm_motor_control/Modbus/crc_algs.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "main.h"
|
||||
|
||||
// extern here to use in bootloader.c
|
||||
extern uint32_t CRC_calc;
|
||||
extern uint32_t CRC_ref;
|
||||
|
||||
|
||||
uint16_t crc16(uint8_t *data, uint32_t data_size);
|
||||
uint32_t crc32(uint8_t *data, uint32_t data_size);
|
||||
91
научка/code/pwm_motor_control/Modbus/html/annotated.html
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: Data Structures</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">Data Structures</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock">Here are the data structures with brief descriptions:</div><div class="directory">
|
||||
<table class="directory">
|
||||
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_r_s___handle_type_def.html" target="_self">RS_HandleTypeDef</a></td><td class="desc">Handle for RS communication </td></tr>
|
||||
<tr id="row_1_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_r_s___msg_type_def.html" target="_self">RS_MsgTypeDef</a></td><td class="desc"></td></tr>
|
||||
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_t_i_m___settings_type_def.html" target="_self">TIM_SettingsTypeDef</a></td><td class="desc"></td></tr>
|
||||
<tr id="row_3_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_u_a_r_t___settings_type_def.html" target="_self">UART_SettingsTypeDef</a></td><td class="desc"></td></tr>
|
||||
</table>
|
||||
</div><!-- directory -->
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
научка/code/pwm_motor_control/Modbus/html/bc_s.png
Normal file
|
After Width: | Height: | Size: 676 B |
BIN
научка/code/pwm_motor_control/Modbus/html/bc_sd.png
Normal file
|
After Width: | Height: | Size: 635 B |
95
научка/code/pwm_motor_control/Modbus/html/classes.html
Normal file
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: Data Structure Index</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">Data Structure Index</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="qindex"><a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_T">T</a> | <a class="qindex" href="#letter_U">U</a></div>
|
||||
<div class="classindex">
|
||||
<dl class="classindex even">
|
||||
<dt class="alphachar"><a id="letter_R" name="letter_R">R</a></dt>
|
||||
<dd><a class="el" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a></dd><dd><a class="el" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a></dd></dl>
|
||||
<dl class="classindex odd">
|
||||
<dt class="alphachar"><a id="letter_T" name="letter_T">T</a></dt>
|
||||
<dd><a class="el" href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a></dd></dl>
|
||||
<dl class="classindex even">
|
||||
<dt class="alphachar"><a id="letter_U" name="letter_U">U</a></dt>
|
||||
<dd><a class="el" href="struct_u_a_r_t___settings_type_def.html">UART_SettingsTypeDef</a></dd></dl>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
61
научка/code/pwm_motor_control/Modbus/html/clipboard.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
|
||||
The code below is based on the Doxygen Awesome project, see
|
||||
https://github.com/jothepro/doxygen-awesome-css
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 - 2022 jothepro
|
||||
|
||||
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 THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
|
||||
*/
|
||||
|
||||
let clipboard_title = "Copy to clipboard"
|
||||
let clipboard_icon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>`
|
||||
let clipboard_successIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>`
|
||||
let clipboard_successDuration = 1000
|
||||
|
||||
$(function() {
|
||||
if(navigator.clipboard) {
|
||||
const fragments = document.getElementsByClassName("fragment")
|
||||
for(const fragment of fragments) {
|
||||
const clipboard_div = document.createElement("div")
|
||||
clipboard_div.classList.add("clipboard")
|
||||
clipboard_div.innerHTML = clipboard_icon
|
||||
clipboard_div.title = clipboard_title
|
||||
$(clipboard_div).click(function() {
|
||||
const content = this.parentNode.cloneNode(true)
|
||||
// filter out line number and folded fragments from file listings
|
||||
content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() })
|
||||
let text = content.textContent
|
||||
// remove trailing newlines and trailing spaces from empty lines
|
||||
text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'')
|
||||
navigator.clipboard.writeText(text);
|
||||
this.classList.add("success")
|
||||
this.innerHTML = clipboard_successIcon
|
||||
window.setTimeout(() => { // switch back to normal icon after timeout
|
||||
this.classList.remove("success")
|
||||
this.innerHTML = clipboard_icon
|
||||
}, clipboard_successDuration);
|
||||
})
|
||||
fragment.insertBefore(clipboard_div, fragment.firstChild)
|
||||
}
|
||||
}
|
||||
})
|
||||
BIN
научка/code/pwm_motor_control/Modbus/html/closed.png
Normal file
|
After Width: | Height: | Size: 132 B |
58
научка/code/pwm_motor_control/Modbus/html/cookie.js
Normal file
@@ -0,0 +1,58 @@
|
||||
/*!
|
||||
Cookie helper functions
|
||||
Copyright (c) 2023 Dimitri van Heesch
|
||||
Released under MIT license.
|
||||
*/
|
||||
let Cookie = {
|
||||
cookie_namespace: 'doxygen_',
|
||||
|
||||
readSetting(cookie,defVal) {
|
||||
if (window.chrome) {
|
||||
const val = localStorage.getItem(this.cookie_namespace+cookie) ||
|
||||
sessionStorage.getItem(this.cookie_namespace+cookie);
|
||||
if (val) return val;
|
||||
} else {
|
||||
let myCookie = this.cookie_namespace+cookie+"=";
|
||||
if (document.cookie) {
|
||||
const index = document.cookie.indexOf(myCookie);
|
||||
if (index != -1) {
|
||||
const valStart = index + myCookie.length;
|
||||
let valEnd = document.cookie.indexOf(";", valStart);
|
||||
if (valEnd == -1) {
|
||||
valEnd = document.cookie.length;
|
||||
}
|
||||
return document.cookie.substring(valStart, valEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
return defVal;
|
||||
},
|
||||
|
||||
writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete
|
||||
if (window.chrome) {
|
||||
if (days==0) {
|
||||
sessionStorage.setItem(this.cookie_namespace+cookie,val);
|
||||
} else {
|
||||
localStorage.setItem(this.cookie_namespace+cookie,val);
|
||||
}
|
||||
} else {
|
||||
let date = new Date();
|
||||
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||
const expiration = days!=0 ? "expires="+date.toGMTString()+";" : "";
|
||||
document.cookie = this.cookie_namespace + cookie + "=" +
|
||||
val + "; SameSite=Lax;" + expiration + "path=/";
|
||||
}
|
||||
},
|
||||
|
||||
eraseSetting(cookie) {
|
||||
if (window.chrome) {
|
||||
if (localStorage.getItem(this.cookie_namespace+cookie)) {
|
||||
localStorage.removeItem(this.cookie_namespace+cookie);
|
||||
} else if (sessionStorage.getItem(this.cookie_namespace+cookie)) {
|
||||
sessionStorage.removeItem(this.cookie_namespace+cookie);
|
||||
}
|
||||
} else {
|
||||
this.writeSetting(cookie,'',-1);
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: crc_algs.h Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(0); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">crc_algs.h</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#include "main.h"</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// extern here to use in bootloader.c</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="keyword">extern</span> uint32_t CRC_calc;</div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">extern</span> uint32_t CRC_ref;</div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span>uint16_t crc16(uint8_t *data, uint32_t data_size);</div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span>uint32_t crc32(uint8_t *data, uint32_t data_size);</div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
12
научка/code/pwm_motor_control/Modbus/html/doc.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 80 60" id="doc" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#4665A2">
|
||||
<path d="m 14,-1.1445312 c -2.824372,0 -5.1445313,2.320159 -5.1445312,5.1445312 v 72 c 0,2.824372 2.3201592,5.144531 5.1445312,5.144531 h 52 c 2.824372,0 5.144531,-2.320159 5.144531,-5.144531 V 23.699219 a 1.1447968,1.1447968 0 0 0 -0.01563,-0.1875 C 70.977847,22.605363 70.406495,21.99048 70.007812,21.591797 L 48.208984,-0.20898438 C 47.606104,-0.81186474 46.804652,-1.1445313 46,-1.1445312 Z m 1.144531,6.2890624 H 42.855469 V 24 c 0,1.724372 1.420159,3.144531 3.144531,3.144531 H 64.855469 V 74.855469 H 15.144531 Z m 34,4.4179688 L 60.4375,20.855469 H 49.144531 Z"/>
|
||||
</g>
|
||||
<g style="fill:#D8DFEE;stroke-width:0">
|
||||
<path d="M 3.0307167,13.993174 V 7.0307167 h 2.7576792 2.7576792 v 1.8826151 c 0,1.2578262 0.0099,1.9287572 0.029818,2.0216512 0.03884,0.181105 0.168631,0.348218 0.33827,0.43554 l 0.1355017,0.06975 1.9598092,0.0079 1.959809,0.0078 v 4.749829 4.749829 H 8 3.0307167 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
<path d="M 9.8293515,9.0581469 V 7.9456453 l 1.1058025,1.1055492 c 0.608191,0.6080521 1.105802,1.1086775 1.105802,1.1125015 0,0.0038 -0.497611,0.007 -1.105802,0.007 H 9.8293515 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
12
научка/code/pwm_motor_control/Modbus/html/docd.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 80 60" id="doc" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#C4CFE5">
|
||||
<path d="m 14,-1.1445312 c -2.824372,0 -5.1445313,2.320159 -5.1445312,5.1445312 v 72 c 0,2.824372 2.3201592,5.144531 5.1445312,5.144531 h 52 c 2.824372,0 5.144531,-2.320159 5.144531,-5.144531 V 23.699219 a 1.1447968,1.1447968 0 0 0 -0.01563,-0.1875 C 70.977847,22.605363 70.406495,21.99048 70.007812,21.591797 L 48.208984,-0.20898438 C 47.606104,-0.81186474 46.804652,-1.1445313 46,-1.1445312 Z m 1.144531,6.2890624 H 42.855469 V 24 c 0,1.724372 1.420159,3.144531 3.144531,3.144531 H 64.855469 V 74.855469 H 15.144531 Z m 34,4.4179688 L 60.4375,20.855469 H 49.144531 Z"/>
|
||||
</g>
|
||||
<g style="fill:#4665A2;stroke-width:0">
|
||||
<path d="M 3.0307167,13.993174 V 7.0307167 h 2.7576792 2.7576792 v 1.8826151 c 0,1.2578262 0.0099,1.9287572 0.029818,2.0216512 0.03884,0.181105 0.168631,0.348218 0.33827,0.43554 l 0.1355017,0.06975 1.9598092,0.0079 1.959809,0.0078 v 4.749829 4.749829 H 8 3.0307167 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
<path d="M 9.8293515,9.0581469 V 7.9456453 l 1.1058025,1.1055492 c 0.608191,0.6080521 1.105802,1.1086775 1.105802,1.1125015 0,0.0038 -0.497611,0.007 -1.105802,0.007 H 9.8293515 Z" transform="matrix(5,0,0,5,0,-30)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
2225
научка/code/pwm_motor_control/Modbus/html/doxygen.css
Normal file
28
научка/code/pwm_motor_control/Modbus/html/doxygen.svg
Normal file
|
After Width: | Height: | Size: 15 KiB |
25
научка/code/pwm_motor_control/Modbus/html/doxygen_crawl.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<title>Validator / crawler helper</title>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
</head>
|
||||
<body>
|
||||
<a href="crc__algs_8h_source.html"/>
|
||||
<a href="modbus_8h_source.html"/>
|
||||
<a href="rs__message_8h_source.html"/>
|
||||
<a href="tim__general_8h_source.html"/>
|
||||
<a href="struct_r_s___handle_type_def.html"/>
|
||||
<a href="struct_r_s___msg_type_def.html"/>
|
||||
<a href="struct_t_i_m___settings_type_def.html"/>
|
||||
<a href="struct_u_a_r_t___settings_type_def.html"/>
|
||||
<a href="index.html"/>
|
||||
<a href="doxygen_crawl.html"/>
|
||||
<a href="annotated.html"/>
|
||||
<a href="classes.html"/>
|
||||
<a href="files.html"/>
|
||||
</body>
|
||||
</html>
|
||||
194
научка/code/pwm_motor_control/Modbus/html/dynsections.js
Normal file
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
|
||||
let dynsection = {
|
||||
|
||||
// helper function
|
||||
updateStripes : function() {
|
||||
$('table.directory tr').
|
||||
removeClass('even').filter(':visible:even').addClass('even');
|
||||
$('table.directory tr').
|
||||
removeClass('odd').filter(':visible:odd').addClass('odd');
|
||||
},
|
||||
|
||||
toggleVisibility : function(linkObj) {
|
||||
const base = $(linkObj).attr('id');
|
||||
const summary = $('#'+base+'-summary');
|
||||
const content = $('#'+base+'-content');
|
||||
const trigger = $('#'+base+'-trigger');
|
||||
const src=$(trigger).attr('src');
|
||||
if (content.is(':visible')===true) {
|
||||
content.hide();
|
||||
summary.show();
|
||||
$(linkObj).addClass('closed').removeClass('opened');
|
||||
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||
} else {
|
||||
content.show();
|
||||
summary.hide();
|
||||
$(linkObj).removeClass('closed').addClass('opened');
|
||||
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
toggleLevel : function(level) {
|
||||
$('table.directory tr').each(function() {
|
||||
const l = this.id.split('_').length-1;
|
||||
const i = $('#img'+this.id.substring(3));
|
||||
const a = $('#arr'+this.id.substring(3));
|
||||
if (l<level+1) {
|
||||
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
|
||||
a.html('▼');
|
||||
$(this).show();
|
||||
} else if (l==level+1) {
|
||||
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
|
||||
a.html('►');
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
this.updateStripes();
|
||||
},
|
||||
|
||||
toggleFolder : function(id) {
|
||||
// the clicked row
|
||||
const currentRow = $('#row_'+id);
|
||||
|
||||
// all rows after the clicked row
|
||||
const rows = currentRow.nextAll("tr");
|
||||
|
||||
const re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
|
||||
|
||||
// only match elements AFTER this one (can't hide elements before)
|
||||
const childRows = rows.filter(function() { return this.id.match(re); });
|
||||
|
||||
// first row is visible we are HIDING
|
||||
if (childRows.filter(':first').is(':visible')===true) {
|
||||
// replace down arrow by right arrow for current row
|
||||
const currentRowSpans = currentRow.find("span");
|
||||
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
||||
currentRowSpans.filter(".arrow").html('►');
|
||||
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
|
||||
} else { // we are SHOWING
|
||||
// replace right arrow by down arrow for current row
|
||||
const currentRowSpans = currentRow.find("span");
|
||||
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
|
||||
currentRowSpans.filter(".arrow").html('▼');
|
||||
// replace down arrows by right arrows for child rows
|
||||
const childRowsSpans = childRows.find("span");
|
||||
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
||||
childRowsSpans.filter(".arrow").html('►');
|
||||
childRows.show(); //show all children
|
||||
}
|
||||
this.updateStripes();
|
||||
},
|
||||
|
||||
toggleInherit : function(id) {
|
||||
const rows = $('tr.inherit.'+id);
|
||||
const img = $('tr.inherit_header.'+id+' img');
|
||||
const src = $(img).attr('src');
|
||||
if (rows.filter(':first').is(':visible')===true) {
|
||||
rows.css('display','none');
|
||||
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||
} else {
|
||||
rows.css('display','table-row'); // using show() causes jump in firefox
|
||||
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let codefold = {
|
||||
opened : true,
|
||||
|
||||
// in case HTML_COLORSTYLE is LIGHT or DARK the vars will be replaced, so we write them out explicitly and use double quotes
|
||||
plusImg: [ "var(--fold-plus-image)", "var(--fold-plus-image-relpath)" ],
|
||||
minusImg: [ "var(--fold-minus-image)", "var(--fold-minus-image-relpath)" ],
|
||||
|
||||
// toggle all folding blocks
|
||||
toggle_all : function(relPath) {
|
||||
if (this.opened) {
|
||||
$('#fold_all').css('background-image',this.plusImg[relPath]);
|
||||
$('div[id^=foldopen]').hide();
|
||||
$('div[id^=foldclosed]').show();
|
||||
} else {
|
||||
$('#fold_all').css('background-image',this.minusImg[relPath]);
|
||||
$('div[id^=foldopen]').show();
|
||||
$('div[id^=foldclosed]').hide();
|
||||
}
|
||||
this.opened=!this.opened;
|
||||
},
|
||||
|
||||
// toggle single folding block
|
||||
toggle : function(id) {
|
||||
$('#foldopen'+id).toggle();
|
||||
$('#foldclosed'+id).toggle();
|
||||
},
|
||||
|
||||
init : function(relPath) {
|
||||
$('span[class=lineno]').css({
|
||||
'padding-right':'4px',
|
||||
'margin-right':'2px',
|
||||
'display':'inline-block',
|
||||
'width':'54px',
|
||||
'background':'linear-gradient(var(--fold-line-color),var(--fold-line-color)) no-repeat 46px/2px 100%'
|
||||
});
|
||||
// add global toggle to first line
|
||||
$('span[class=lineno]:first').append('<span class="fold" id="fold_all" '+
|
||||
'onclick="javascript:codefold.toggle_all('+relPath+');" '+
|
||||
'style="background-image:'+this.minusImg[relPath]+';"></span>');
|
||||
// add vertical lines to other rows
|
||||
$('span[class=lineno]').not(':eq(0)').append('<span class="fold"></span>');
|
||||
// add toggle controls to lines with fold divs
|
||||
$('div[class=foldopen]').each(function() {
|
||||
// extract specific id to use
|
||||
const id = $(this).attr('id').replace('foldopen','');
|
||||
// extract start and end foldable fragment attributes
|
||||
const start = $(this).attr('data-start');
|
||||
const end = $(this).attr('data-end');
|
||||
// replace normal fold span with controls for the first line of a foldable fragment
|
||||
$(this).find('span[class=fold]:first').replaceWith('<span class="fold" '+
|
||||
'onclick="javascript:codefold.toggle(\''+id+'\');" '+
|
||||
'style="background-image:'+codefold.minusImg[relPath]+';"></span>');
|
||||
// append div for folded (closed) representation
|
||||
$(this).after('<div id="foldclosed'+id+'" class="foldclosed" style="display:none;"></div>');
|
||||
// extract the first line from the "open" section to represent closed content
|
||||
const line = $(this).children().first().clone();
|
||||
// remove any glow that might still be active on the original line
|
||||
$(line).removeClass('glow');
|
||||
if (start) {
|
||||
// if line already ends with a start marker (e.g. trailing {), remove it
|
||||
$(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),''));
|
||||
}
|
||||
// replace minus with plus symbol
|
||||
$(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]);
|
||||
// append ellipsis
|
||||
$(line).append(' '+start+'<a href="javascript:codefold.toggle(\''+id+'\')">…</a>'+end);
|
||||
// insert constructed line into closed div
|
||||
$('#foldclosed'+id).html(line);
|
||||
});
|
||||
},
|
||||
};
|
||||
/* @license-end */
|
||||
91
научка/code/pwm_motor_control/Modbus/html/files.html
Normal file
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: File List</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">File List</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
|
||||
<table class="directory">
|
||||
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><a href="crc__algs_8h_source.html"><span class="icondoc"></span></a><b>crc_algs.h</b></td><td class="desc"></td></tr>
|
||||
<tr id="row_1_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><a href="modbus_8h_source.html"><span class="icondoc"></span></a><b>modbus.h</b></td><td class="desc"></td></tr>
|
||||
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><a href="rs__message_8h_source.html"><span class="icondoc"></span></a><b>rs_message.h</b></td><td class="desc"></td></tr>
|
||||
<tr id="row_3_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><a href="tim__general_8h_source.html"><span class="icondoc"></span></a><b>tim_general.h</b></td><td class="desc"></td></tr>
|
||||
</table>
|
||||
</div><!-- directory -->
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
11
научка/code/pwm_motor_control/Modbus/html/folderclosed.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#4665A2;">
|
||||
<path d="M1,5.998l-0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm2,-0l-0,16.002c-0,0.796 0.316,1.559 0.879,2.121c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121c0,-3.486 0,-8.514 0,-12c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998Z"/>
|
||||
</g>
|
||||
<g style="fill:#D8DFEE;stroke-width:0;">
|
||||
<path d="M 5.6063709,24.951908 C 4.3924646,24.775461 3.4197129,23.899792 3.1031586,22.698521 L 3.0216155,22.389078 V 13.997725 5.6063709 L 3.1037477,5.2982247 C 3.3956682,4.2029881 4.1802788,3.412126 5.2787258,3.105917 5.5646428,3.0262132 5.6154982,3.0244963 8.0611641,3.0119829 l 2.4911989,-0.012746 1.932009,1.9300342 c 1.344142,1.3427669 1.976319,1.9498819 2.07763,1.9952626 0.137456,0.061571 0.474218,0.066269 6.006826,0.083795 l 5.861206,0.018568 0.29124,0.081916 c 1.094895,0.3079569 1.890116,1.109428 2.175567,2.192667 l 0.08154,0.3094425 V 16 22.389078 l -0.08154,0.309443 c -0.28446,1.079482 -1.086411,1.888085 -2.175567,2.193614 l -0.29124,0.0817 -10.302616,0.0049 c -5.700217,0.0027 -10.4001945,-0.0093 -10.5210471,-0.02684 z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
11
научка/code/pwm_motor_control/Modbus/html/folderclosedd.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#C4CFE5;">
|
||||
<path d="M1,5.998l-0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm2,-0l-0,16.002c-0,0.796 0.316,1.559 0.879,2.121c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121c0,-3.486 0,-8.514 0,-12c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998Z"/>
|
||||
</g>
|
||||
<g style="fill:#4665A2;stroke-width:0;">
|
||||
<path d="M 5.6063709,24.951908 C 4.3924646,24.775461 3.4197129,23.899792 3.1031586,22.698521 L 3.0216155,22.389078 V 13.997725 5.6063709 L 3.1037477,5.2982247 C 3.3956682,4.2029881 4.1802788,3.412126 5.2787258,3.105917 5.5646428,3.0262132 5.6154982,3.0244963 8.0611641,3.0119829 l 2.4911989,-0.012746 1.932009,1.9300342 c 1.344142,1.3427669 1.976319,1.9498819 2.07763,1.9952626 0.137456,0.061571 0.474218,0.066269 6.006826,0.083795 l 5.861206,0.018568 0.29124,0.081916 c 1.094895,0.3079569 1.890116,1.109428 2.175567,2.192667 l 0.08154,0.3094425 V 16 22.389078 l -0.08154,0.309443 c -0.28446,1.079482 -1.086411,1.888085 -2.175567,2.193614 l -0.29124,0.0817 -10.302616,0.0049 c -5.700217,0.0027 -10.4001945,-0.0093 -10.5210471,-0.02684 z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
17
научка/code/pwm_motor_control/Modbus/html/folderopen.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#4665A2;">
|
||||
<path
|
||||
d="M1,5.998l0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm28,14.415l-3.456,-5.925c-0.538,-0.921 -1.524,-1.488 -2.591,-1.488c-0,0 -12.905,0 -12.906,0c-1.067,0 -2.053,0.567 -2.591,1.488l-4.453,7.635c0.03,0.751 0.342,1.465 0.876,1.998c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121l0,-1.587Zm0,-3.969l0,-6.444c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998l0,12.16l2.729,-4.677c0.896,-1.536 2.54,-2.481 4.318,-2.481c3.354,0 9.552,0 12.906,0c1.778,0 3.422,0.945 4.318,2.481l1.729,2.963Z"
|
||||
id="path2" />
|
||||
</g>
|
||||
<g style="fill:#D8DFEE;stroke-width:0;">
|
||||
<path
|
||||
d="M 5.3879408,24.913408 C 4.1598821,24.650818 3.1571088,23.558656 3.053503,22.370876 L 3.0312746,22.116041 5.2606813,18.293515 C 6.486855,16.191126 7.5598351,14.372696 7.6450818,14.25256 8.0043056,13.746312 8.5423079,13.363007 9.2104664,13.137285 l 0.2548351,-0.08609 6.9294785,-0.0097 c 6.805096,-0.0095 6.934944,-0.0084 7.234011,0.06267 0.695577,0.165199 1.290483,0.557253 1.714887,1.130141 0.08158,0.110125 0.938747,1.556711 1.90481,3.214634 l 1.756479,3.014406 -0.0186,0.971942 c -0.01387,0.724723 -0.03365,1.032131 -0.07778,1.208575 -0.242792,0.970733 -0.88732,1.735415 -1.772382,2.102793 -0.58835,0.244217 0.247209,0.227436 -11.161974,0.224159 -9.0281537,-0.0026 -10.3636023,-0.0098 -10.5862902,-0.05746 z"
|
||||
id="path199" /><path
|
||||
d="M 3.0126385,11.849829 3.0235061,5.5881684 3.1020974,5.2969283 C 3.3478146,4.3863605 3.93576,3.6757372 4.756668,3.2971229 5.3293315,3.0330025 5.1813272,3.0450949 8.0130385,3.0310668 l 2.5522875,-0.012644 1.918693,1.9107086 c 1.404146,1.3983023 1.964459,1.9332518 2.089351,1.9947704 l 0.170657,0.084062 5.897611,0.019367 c 5.553257,0.018236 5.910365,0.023213 6.116041,0.085231 1.102257,0.3323708 1.857042,1.1184422 2.154229,2.2435244 0.05645,0.2137228 0.06373,0.5643981 0.07519,3.6220748 0.0076,2.032169 -5.42e-4,3.370979 -0.02041,3.349261 -0.0182,-0.0199 -0.414296,-0.691472 -0.880217,-1.492382 -0.46592,-0.80091 -0.93093,-1.577954 -1.033354,-1.726764 -0.735716,-1.0689 -1.983568,-1.844244 -3.315972,-2.060353 -0.280375,-0.04548 -1.345158,-0.05334 -7.238708,-0.05347 -4.713933,-1.09e-4 -6.9931825,0.01221 -7.1717862,0.03874 -1.3002273,0.193134 -2.4770512,0.889916 -3.283628,1.944192 -0.1076466,0.140705 -0.8359664,1.353438 -1.6184885,2.694963 L 3.0017709,18.11149 Z"
|
||||
id="path201" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
12
научка/code/pwm_motor_control/Modbus/html/folderopend.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" width="16" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
<g style="fill:#C4CFE5;">
|
||||
<path d="M1,5.998l0,16.002c-0,1.326 0.527,2.598 1.464,3.536c0.938,0.937 2.21,1.464 3.536,1.464c5.322,0 14.678,-0 20,0c1.326,0 2.598,-0.527 3.536,-1.464c0.937,-0.938 1.464,-2.21 1.464,-3.536c0,-3.486 0,-8.514 0,-12c0,-1.326 -0.527,-2.598 -1.464,-3.536c-0.938,-0.937 -2.21,-1.464 -3.536,-1.464c-0,0 -10.586,0 -10.586,0c0,-0 -3.707,-3.707 -3.707,-3.707c-0.187,-0.188 -0.442,-0.293 -0.707,-0.293l-5.002,0c-2.76,0 -4.998,2.238 -4.998,4.998Zm28,14.415l-3.456,-5.925c-0.538,-0.921 -1.524,-1.488 -2.591,-1.488c-0,0 -12.905,0 -12.906,0c-1.067,0 -2.053,0.567 -2.591,1.488l-4.453,7.635c0.03,0.751 0.342,1.465 0.876,1.998c0.562,0.563 1.325,0.879 2.121,0.879l20,0c0.796,0 1.559,-0.316 2.121,-0.879c0.563,-0.562 0.879,-1.325 0.879,-2.121l0,-1.587Zm0,-3.969l0,-6.444c0,-0.796 -0.316,-1.559 -0.879,-2.121c-0.562,-0.563 -1.325,-0.879 -2.121,-0.879c-7.738,0 -11,0 -11,0c-0.265,0 -0.52,-0.105 -0.707,-0.293c-0,0 -3.707,-3.707 -3.707,-3.707c-0,0 -4.588,0 -4.588,0c-1.656,0 -2.998,1.342 -2.998,2.998l0,12.16l2.729,-4.677c0.896,-1.536 2.54,-2.481 4.318,-2.481c3.354,0 9.552,0 12.906,0c1.778,0 3.422,0.945 4.318,2.481l1.729,2.963Z"/>
|
||||
</g>
|
||||
<g style="fill:#4665A2;stroke-width:0;">
|
||||
<path d="M 5.3879408,24.913408 C 4.1598821,24.650818 3.1571088,23.558656 3.053503,22.370876 L 3.0312746,22.116041 5.2606813,18.293515 C 6.486855,16.191126 7.5598351,14.372696 7.6450818,14.25256 8.0043056,13.746312 8.5423079,13.363007 9.2104664,13.137285 l 0.2548351,-0.08609 6.9294785,-0.0097 c 6.805096,-0.0095 6.934944,-0.0084 7.234011,0.06267 0.695577,0.165199 1.290483,0.557253 1.714887,1.130141 0.08158,0.110125 0.938747,1.556711 1.90481,3.214634 l 1.756479,3.014406 -0.0186,0.971942 c -0.01387,0.724723 -0.03365,1.032131 -0.07778,1.208575 -0.242792,0.970733 -0.88732,1.735415 -1.772382,2.102793 -0.58835,0.244217 0.247209,0.227436 -11.161974,0.224159 -9.0281537,-0.0026 -10.3636023,-0.0098 -10.5862902,-0.05746 z" />
|
||||
<path d="M 3.0126385,11.849829 3.0235061,5.5881684 3.1020974,5.2969283 C 3.3478146,4.3863605 3.93576,3.6757372 4.756668,3.2971229 5.3293315,3.0330025 5.1813272,3.0450949 8.0130385,3.0310668 l 2.5522875,-0.012644 1.918693,1.9107086 c 1.404146,1.3983023 1.964459,1.9332518 2.089351,1.9947704 l 0.170657,0.084062 5.897611,0.019367 c 5.553257,0.018236 5.910365,0.023213 6.116041,0.085231 1.102257,0.3323708 1.857042,1.1184422 2.154229,2.2435244 0.05645,0.2137228 0.06373,0.5643981 0.07519,3.6220748 0.0076,2.032169 -5.42e-4,3.370979 -0.02041,3.349261 -0.0182,-0.0199 -0.414296,-0.691472 -0.880217,-1.492382 -0.46592,-0.80091 -0.93093,-1.577954 -1.033354,-1.726764 -0.735716,-1.0689 -1.983568,-1.844244 -3.315972,-2.060353 -0.280375,-0.04548 -1.345158,-0.05334 -7.238708,-0.05347 -4.713933,-1.09e-4 -6.9931825,0.01221 -7.1717862,0.03874 -1.3002273,0.193134 -2.4770512,0.889916 -3.283628,1.944192 -0.1076466,0.140705 -0.8359664,1.353438 -1.6184885,2.694963 L 3.0017709,18.11149 Z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
84
научка/code/pwm_motor_control/Modbus/html/index.html
Normal file
@@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: Main Page</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">My Project Documentation</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="doxygen_crawl.html"/>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
34
научка/code/pwm_motor_control/Modbus/html/jquery.js
vendored
Normal file
134
научка/code/pwm_motor_control/Modbus/html/menu.js
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
|
||||
function makeTree(data,relPath) {
|
||||
let result='';
|
||||
if ('children' in data) {
|
||||
result+='<ul>';
|
||||
for (let i in data.children) {
|
||||
let url;
|
||||
const link = data.children[i].url;
|
||||
if (link.substring(0,1)=='^') {
|
||||
url = link.substring(1);
|
||||
} else {
|
||||
url = relPath+link;
|
||||
}
|
||||
result+='<li><a href="'+url+'">'+
|
||||
data.children[i].text+'</a>'+
|
||||
makeTree(data.children[i],relPath)+'</li>';
|
||||
}
|
||||
result+='</ul>';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
let searchBoxHtml;
|
||||
if (searchEnabled) {
|
||||
if (serverSide) {
|
||||
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
||||
'<div class="left">'+
|
||||
'<form id="FSearchBox" action="'+relPath+searchPage+
|
||||
'" method="get"><span id="MSearchSelectExt"> </span>'+
|
||||
'<input type="text" id="MSearchField" name="query" value="" placeholder="'+search+
|
||||
'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)"'+
|
||||
' onblur="searchBox.OnSearchFieldFocus(false)"/>'+
|
||||
'</form>'+
|
||||
'</div>'+
|
||||
'<div class="right"></div>'+
|
||||
'</div>';
|
||||
} else {
|
||||
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
||||
'<span class="left">'+
|
||||
'<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()"'+
|
||||
' onmouseout="return searchBox.OnSearchSelectHide()"> </span>'+
|
||||
'<input type="text" id="MSearchField" value="" placeholder="'+search+
|
||||
'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" '+
|
||||
'onblur="searchBox.OnSearchFieldFocus(false)" '+
|
||||
'onkeyup="searchBox.OnSearchFieldChange(event)"/>'+
|
||||
'</span>'+
|
||||
'<span class="right"><a id="MSearchClose" '+
|
||||
'href="javascript:searchBox.CloseResultsWindow()">'+
|
||||
'<img id="MSearchCloseImg" border="0" src="'+relPath+
|
||||
'search/close.svg" alt=""/></a>'+
|
||||
'</span>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$('#main-nav').before('<div class="sm sm-dox"><input id="main-menu-state" type="checkbox"/>'+
|
||||
'<label class="main-menu-btn" for="main-menu-state">'+
|
||||
'<span class="main-menu-btn-icon"></span> '+
|
||||
'Toggle main menu visibility</label>'+
|
||||
'<span id="searchBoxPos1" style="position:absolute;right:8px;top:8px;height:36px;"></span>'+
|
||||
'</div>');
|
||||
$('#main-nav').append(makeTree(menudata,relPath));
|
||||
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
|
||||
if (searchBoxHtml) {
|
||||
$('#main-menu').append('<li id="searchBoxPos2" style="float:right"></li>');
|
||||
}
|
||||
const $mainMenuState = $('#main-menu-state');
|
||||
let prevWidth = 0;
|
||||
if ($mainMenuState.length) {
|
||||
const initResizableIfExists = function() {
|
||||
if (typeof initResizable==='function') initResizable();
|
||||
}
|
||||
// animate mobile menu
|
||||
$mainMenuState.change(function() {
|
||||
const $menu = $('#main-menu');
|
||||
let options = { duration: 250, step: initResizableIfExists };
|
||||
if (this.checked) {
|
||||
options['complete'] = () => $menu.css('display', 'block');
|
||||
$menu.hide().slideDown(options);
|
||||
} else {
|
||||
options['complete'] = () => $menu.css('display', 'none');
|
||||
$menu.show().slideUp(options);
|
||||
}
|
||||
});
|
||||
// set default menu visibility
|
||||
const resetState = function() {
|
||||
const $menu = $('#main-menu');
|
||||
const newWidth = $(window).outerWidth();
|
||||
if (newWidth!=prevWidth) {
|
||||
if ($(window).outerWidth()<768) {
|
||||
$mainMenuState.prop('checked',false); $menu.hide();
|
||||
$('#searchBoxPos1').html(searchBoxHtml);
|
||||
$('#searchBoxPos2').hide();
|
||||
} else {
|
||||
$menu.show();
|
||||
$('#searchBoxPos1').empty();
|
||||
$('#searchBoxPos2').html(searchBoxHtml);
|
||||
$('#searchBoxPos2').show();
|
||||
}
|
||||
if (typeof searchBox!=='undefined') {
|
||||
searchBox.CloseResultsWindow();
|
||||
}
|
||||
prevWidth = newWidth;
|
||||
}
|
||||
}
|
||||
$(window).ready(function() { resetState(); initResizableIfExists(); });
|
||||
$(window).resize(resetState);
|
||||
}
|
||||
$('#main-menu').smartmenus();
|
||||
}
|
||||
/* @license-end */
|
||||
31
научка/code/pwm_motor_control/Modbus/html/menudata.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
var menudata={children:[
|
||||
{text:"Main Page",url:"index.html"},
|
||||
{text:"Data Structures",url:"annotated.html",children:[
|
||||
{text:"Data Structures",url:"annotated.html"},
|
||||
{text:"Data Structure Index",url:"classes.html"}]},
|
||||
{text:"Files",url:"files.html",children:[
|
||||
{text:"File List",url:"files.html"}]}]}
|
||||
8
научка/code/pwm_motor_control/Modbus/html/minus.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#fcfcfc;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 582 B |
8
научка/code/pwm_motor_control/Modbus/html/minusd.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#000000;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 582 B |
258
научка/code/pwm_motor_control/Modbus/html/modbus_8h_source.html
Normal file
@@ -0,0 +1,258 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: modbus.h Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(0); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">modbus.h</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/********************************MODBUS*************************************</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">Данный файл содержит объявления базовых функции и дефайны для реализации </span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">протоколов </span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">***************************************************************************/</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#ifndef __MODBUS_H_</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#define __MODBUS_H_</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include "main.h"</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//----------DEFINES FOR MODBUS SETTING--------------</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#define MB_UART_NUMB 2 </span><span class="comment">// number of used uart</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">/* accord to this define sets define USED_MB_UART = USARTx */</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#define MB_TIM_NUMB 7 </span><span class="comment">// number of used uart</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">/* accord to this define sets define USED_MB_TIM = TIMx */</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#define COILS_NUMB 16 </span><span class="comment">// minimum 16</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#define INPUT_REGS_NUMB 100</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#define HOLD_REGS_NUMB 100 </span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">/* defines for modbus behaviour */</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#define MB_MAX_TIMEOUT 5000 </span><span class="comment">// is ms</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#define RX_FIRST_PART_IND 6 </span><span class="comment">// up to NUMB of bytes if its there, or up to first byte CRC</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// custom define for size of receive message </span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">//--------------------------------------------------</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">//-------------DEFINES FOR STRUCTURE----------------</span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">/* defines for structure of modbus message */</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#define DEVICE_ID_SIZE 1 </span><span class="comment">// size of (MbAddr)</span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#define FUNC_CODE_SIZE 1 </span><span class="comment">// size of (Func_Code)</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#define DATA_SIZE_SIZE 1 </span><span class="comment">// size of (ByteCnt)</span></div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#define ADDRESS_SIZE 2 </span><span class="comment">// size of (Qnt)</span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#define NUMBorVAL_SIZE 2 </span><span class="comment">// size of (Qnt)</span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="preprocessor">#define DATA_MAX_SIZE 32 </span><span class="comment">// maximum number of data: DWORD (NOT MESSAGE SIZE)</span></div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#define CRC_SIZE 2 </span><span class="comment">// size of (MB_CRC) in bytes</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor">#define ERR_VALUES_START 0x80U </span><span class="comment">// first number of (Except_Code)</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment">/* size of info */</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor">#define INFO_SIZE DEVICE_ID_SIZE+FUNC_CODE_SIZE+DATA_SIZE_SIZE+ADDRESS_SIZE+NUMBorVAL_SIZE</span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment">/* size of buffer: max size of whole message */</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#define MSG_SIZE_MAX (DATA_MAX_SIZE+INFO_SIZE+CRC_SIZE) </span><span class="comment">// max possible size of message</span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor">#define Message_Data(_msg_, _ind_) _msg_->DATA[_ind_].DATA</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="preprocessor">#define Message_Data_Byte(_msg_, _ind_, _byte_) _msg_->DATA[_ind_]._byte_</span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment">// choose certain coil</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor">#define Set_Coils_Origin(_coils_, _source_) uint16_t *(_coils_) = (uint16_t *)(&(_source_))</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor">#define Set_Hold_Regs_Origin(_hregs_, _source_) uint16_t *(_hregs_) = (uint16_t *)(&(_source_))</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">/* Structure for modbus messsage */</span></div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">//RS_FunctonTypeDef</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span>{</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="comment">// reading</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> MB_R_COILS = 0x01,</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> MB_R_DISC_IN = 0x02,</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> MB_R_IN_REGS = 0x03,</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> MB_R_HOLD_REGS = 0x04,</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// writting</span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> MB_W_COIL = 0x05,</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> MB_W_HOLD_REG = 0x06,</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> MB_W_COILS = 0x0F,</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> MB_W_HOLD_REGS = 0x10,</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>}RS_FunctonTypeDef;</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
|
||||
<div class="foldopen" id="foldopen00071" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="struct_r_s___msg_type_def.html"> 71</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><span class="comment">// RS_MsgTypeDef</span></div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span>{</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> uint8_t MbAddr;</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> RS_FunctonTypeDef Func_Code;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> uint8_t Except_Code;</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> uint16_t Addr;</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> uint16_t Qnt;</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> uint8_t ByteCnt;</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> uint16_t DATA[DATA_MAX_SIZE];</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> uint16_t MB_CRC;</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span>}<a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a>;</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment">//--------------------------------------------------</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="preprocessor">#define write16_to_8(_16bit_, _2_8bit_)</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span>uint8_t Modbus_Command_1(<a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *modbus_msg);</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>uint8_t Modbus_Command_3(<a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *modbus_msg);</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>uint8_t Modbus_Command_5(<a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *modbus_msg);</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>uint8_t Modbus_Command_15(<a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *modbus_msg);</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="comment">/* set USART_TypeDef for choosen numb of usart */</span></div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="preprocessor">#if (MB_UART_NUMB == 1) </span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="preprocessor"> #define USED_MODBUS_UART USART1 </span></div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="preprocessor"> #define USE_USART1</span></div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="preprocessor">#elif (MB_UART_NUMB == 2)</span></div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="preprocessor"> #define USED_MODBUS_UART USART2 </span></div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="preprocessor"> #define USE_USART2</span></div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="preprocessor">#elif (MB_UART_NUMB == 3)</span></div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span><span class="preprocessor"> #define USED_MODBUS_UART USART3 </span></div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span><span class="preprocessor"> #define USE_USART3</span></div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="preprocessor">#elif (MB_UART_NUMB == 4)</span></div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="preprocessor"> #define USED_MODBUS_UART UART4 </span></div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span><span class="preprocessor"> #define USE_UART4</span></div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span><span class="preprocessor">#elif (MB_UART_NUMB == 5)</span></div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="preprocessor"> #define USED_MODBUS_UART UART5</span></div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span><span class="preprocessor"> #define USE_UART6</span></div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="preprocessor">#elif (MB_UART_NUMB == 6)</span></div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span><span class="preprocessor"> #define USED_MODBUS_UART USART6 </span></div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span><span class="preprocessor"> #define USE_USART6</span></div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span><span class="preprocessor">#if (MB_TIM_NUMB == 1) </span></div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM1 </span></div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="preprocessor"> #define USE_TIM1</span></div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="preprocessor">#elif (MB_TIM_NUMB == 2)</span></div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM2 </span></div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="preprocessor"> #define USE_TIM2</span></div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span><span class="preprocessor">#elif (MB_TIM_NUMB == 3)</span></div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM3 </span></div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="preprocessor"> #define USE_TIM3</span></div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="preprocessor">#elif (MB_TIM_NUMB == 4)</span></div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM4 </span></div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span><span class="preprocessor"> #define USE_TIM4</span></div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span><span class="preprocessor">#elif (MB_TIM_NUMB == 5)</span></div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM5</span></div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="preprocessor"> #define USE_TIM5</span></div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="preprocessor">#elif (MB_TIM_NUMB == 6)</span></div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM6 </span></div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="preprocessor"> #define USE_TIM6</span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="preprocessor">#elif (MB_TIM_NUMB == 7)</span></div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM7 </span></div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="preprocessor"> #define USE_TIM7</span></div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="preprocessor">#elif (MB_TIM_NUMB == 8)</span></div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM8</span></div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="preprocessor"> #define USE_TIM8 </span></div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="preprocessor">#elif (MB_TIM_NUMB == 9)</span></div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM9 </span></div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="preprocessor"> #define USE_TIM9</span></div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="preprocessor">#elif (MB_TIM_NUMB == 10)</span></div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM10 </span></div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span><span class="preprocessor"> #define USE_TIM10</span></div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="preprocessor">#elif (MB_TIM_NUMB == 11)</span></div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM11</span></div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span><span class="preprocessor"> #define USE_TIM11</span></div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span><span class="preprocessor">#elif (MB_TIM_NUMB == 12)</span></div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM12 </span></div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="preprocessor"> #define USE_TIM12</span></div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="preprocessor">#elif (MB_TIM_NUMB == 13)</span></div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM13 </span></div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="preprocessor"> #define USE_TIM13</span></div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="preprocessor">#elif (MB_TIM_NUMB == 14)</span></div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="preprocessor"> #define USED_MODBUS_TIM TIM14 </span></div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span><span class="preprocessor"> #define USE_TIM14</span></div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="preprocessor">#endif </span><span class="comment">//__MODBUS_H_</span></div>
|
||||
<div class="ttc" id="astruct_r_s___msg_type_def_html"><div class="ttname"><a href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a></div><div class="ttdef"><b>Definition</b> modbus.h:72</div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
научка/code/pwm_motor_control/Modbus/html/nav_f.png
Normal file
|
After Width: | Height: | Size: 153 B |
BIN
научка/code/pwm_motor_control/Modbus/html/nav_fd.png
Normal file
|
After Width: | Height: | Size: 169 B |
BIN
научка/code/pwm_motor_control/Modbus/html/nav_g.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
научка/code/pwm_motor_control/Modbus/html/nav_h.png
Normal file
|
After Width: | Height: | Size: 98 B |
BIN
научка/code/pwm_motor_control/Modbus/html/nav_hd.png
Normal file
|
After Width: | Height: | Size: 114 B |
BIN
научка/code/pwm_motor_control/Modbus/html/open.png
Normal file
|
After Width: | Height: | Size: 123 B |
9
научка/code/pwm_motor_control/Modbus/html/plus.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#fcfcfc;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="15.874998" height="52.916668" x="44.979168" y="26.458332" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 696 B |
9
научка/code/pwm_motor_control/Modbus/html/plusd.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 105.83333 105.83333" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<g>
|
||||
<rect style="fill:#808080;stroke-width:0" width="105.83333" height="105.83334" x="4.2409692e-08" y="-1.2701158e-06" ry="0" />
|
||||
<rect style="fill:#000000;stroke-width:0" width="79.375" height="79.375" x="13.229166" y="13.229166" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="52.916668" height="15.874998" x="26.458332" y="44.979168" />
|
||||
<rect style="fill:#808080;stroke-width:0" width="15.874998" height="52.916668" x="44.979168" y="26.458332" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 696 B |
@@ -0,0 +1,335 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: rs_message.h Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(0); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">rs_message.h</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef __UART_USER_H_</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define __UART_USER_H_</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#define HAL_UART_MODULE_ENABLED </span><span class="comment">// need to uncomment these defines in stm32f4xx_hal_conf.h</span></div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#define HAL_USART_MODULE_ENABLED </span><span class="comment">// also need to add hal_uart.c (source code)</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//#define USE_USART1</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">//#define USE_USART2</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">//#define USE_USART3</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">//#define USE_UART4</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//#define USE_UART5</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">//#define USE_USART6</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">/* note: used uart defines in modbus.h */</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include "modbus.h"</span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include "stm32f4xx_hal.h"</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include "crc_algs.h"</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include "tim_general.h"</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">/* Clear message-uart buffer */</span></div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#define RS_Clear_Buff(_buff_) for(int i=0; i<MSG_SIZE_MAX;i++) _buff_[i] = NULL</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">/* Set/Reset flags */</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#define RS_Set_Free(_hRS_) _hRS_->fRS_Busy = 0</span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#define RS_Set_Busy(_hRS_) _hRS_->fRS_Busy = 1</span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#define RS_Set_RX_Flags(_hRS_) _hRS_->fRX_Busy = 1; _hRS_->fRX_Done = 0; _hRS_->fRX_Half = 0</span></div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#define RS_Set_TX_Flags(_hRS_) _hRS_->fTX_Busy = 1; _hRS_->fTX_Done = 0</span></div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor">#define RS_Reset_RX_Flags(_hRS_) _hRS_->fRX_Busy = 0; _hRS_->fRX_Done = 0; _hRS_->fRX_Half = 0</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor">#define RS_Reset_TX_Flags(_hRS_) _hRS_->fTX_Busy = 0; _hRS_->fTX_Done = 0</span></div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="preprocessor">#define RS_Set_RX_End_Flag(_hRS_) _hRS_->fRX_Done = 1</span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#define RS_Set_TX_End_Flag(_hRS_) _hRS_->fTX_Done = 1</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#define RS_Set_RX_End(_hRS_) RS_Reset_RX_Flags(_hRS_); RS_Set_RX_End_Flag(_hRS_)</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor">#define RS_Set_TX_End(_hRS_) RS_Reset_TX_Flags(_hRS_); RS_Set_TX_End_Flag(_hRS_)</span></div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment">/* Clear all RS stuff */</span></div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor">#define RS_Clear_All(_hRS_) RS_Clear_Buff(_hRS_->pBufferPtr); RS_Reset_RX_Flags(_hRS_); RS_Reset_TX_Flags(_hRS_);</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment">//#define MB_Is_RX_Busy(_hRS_) ((_hRS_->huartx->gState&HAL_USART_STATE_BUSY_RX) == HAL_USART_STATE_BUSY_RX)</span></div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment">//#define MB_Is_TX_Busy(_hRS_) ((_hRS_->huartx->gState&HAL_USART_STATE_BUSY_RX) == HAL_USART_STATE_BUSY_TX)</span></div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor">#define RS_Is_RX_Busy(_hRS_) (_hRS_->fRX_Busy == 1)</span></div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor">#define RS_Is_TX_Busy(_hRS_) (_hRS_->fTX_Busy == 1)</span></div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="preprocessor">#define IS_IRQ_MASKED() (__get_PRIMASK() != 0U)</span></div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="preprocessor">#define IS_IRQ_MODE() (__get_IPSR() != 0U)</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="preprocessor">#define IS_IRQ() (IS_IRQ_MODE() || IS_IRQ_MASKED())</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||
<div class="foldopen" id="foldopen00064" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="struct_u_a_r_t___settings_type_def.html"> 64</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><span class="comment">// struct with settings for custom function</span></div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>{</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> UART_HandleTypeDef *huartx;</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> DMA_HandleTypeDef *hdma_uartx_rx;</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> GPIO_TypeDef *GPIOx;</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> uint16_t GPIO_PIN_RX;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> uint16_t GPIO_PIN_TX;</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> DMA_Stream_TypeDef *DMAChannel; <span class="comment">// DMAChannel = 0 if doesnt need</span></div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> uint32_t DMA_CHANNEL_X; <span class="comment">// DMAChannel = 0 if doesnt need</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>}<a class="code hl_struct" href="struct_u_a_r_t___settings_type_def.html">UART_SettingsTypeDef</a>;</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment">//------------------ENUMERATIONS--------------------</span></div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment">/* Enums for respond CMD about RS status*/</span></div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">// RS_StatusTypeDef</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span>{</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">/* IN-CODE STATUS (start from 0x01, and goes up)*/</span></div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">/*0x01*/</span> RS_OK = 0x01,</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">/*0x02*/</span> RS_ERR, </div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">/*0x03*/</span> RS_ABORTED, </div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="comment">/*0x04*/</span> RS_BUSY,</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">/*0x06*/</span> RS_COLLECT_MSG_ERR,</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">/*0x07*/</span> RS_PARSE_MSG_ERR,</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="comment">/*0x01*/</span> RS_NOT_MINE_DATA,</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// reserved values</span></div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment">// /*0x00*/ RS_UNKNOWN_ERR = 0x00, // reserved for case, if no one error founded (nothing changed response from zero)</span></div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>}RS_StatusTypeDef;</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment">/* Enums for RS Modes */</span></div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">// RS_ModeTypeDef</span></div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span>{</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> SLAVE_ALWAYS_WAIT = 0x01, <span class="comment">// Slave mode with infinity waiting</span></div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> SLAVE_TIMEOUT_WAIT = 0x02, <span class="comment">// Slave mode with waiting with timeout</span></div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment">// MASTER = 0x03, // Master mode</span></div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>}RS_ModeTypeDef;</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment">/* Enums for RS UART Modes */</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">// RS_ITModeTypeDef</span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span>{</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> BLCK_MODE = 0x00, <span class="comment">// Blocking mode</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> IT_MODE = 0x01, <span class="comment">// Interrupt mode</span></div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>}RS_ITModeTypeDef;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="comment">/* Enums for Response modes */</span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">// RS_RespModeTypeDef</span></div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span>{</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> NO_RESPONSE = 0x00, <span class="comment">// No response: only receive/transmit without any response</span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> SING_RESPONSE = 0x01, <span class="comment">// Single response: respond once after receive / wait for one respond after transmit</span></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> CIRC_RESPONSE = 0x02, <span class="comment">// Circular response: </span></div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="comment">// IT_MODE: Receive - permanent receive mode and after any received message send respond, Transmit - same as in Receive, but it start with Transmit</span></div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="comment">// BLCK_MODE: Transmit - transmit until response is taken, Receive - unused</span></div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span>}RS_RespModeTypeDef;</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="comment">/* Enums for Abort modes */</span></div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">// RS_AbortTypeDef</span></div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span>{</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> ABORT_TX = 0x01, <span class="comment">// Abort transmit</span></div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> ABORT_RX = 0x02, <span class="comment">// Abort receive</span></div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> ABORT_RX_TX = 0x03, <span class="comment">// Abort receive and transmit</span></div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> ABORT_RS = 0x04, <span class="comment">// Abort uart and reset RS structure</span></div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span>}RS_AbortTypeDef;</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="comment">/* Enums for RX Size modes */</span></div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="keyword">typedef</span> <span class="keyword">enum</span> <span class="comment">// RS_RXSizeTypeDef</span></div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span>{</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> RS_RX_Size_Const = 0x01, <span class="comment">// size of receiving message is constant</span></div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> RS_RX_Size_NotConst = 0x02, <span class="comment">// size of receiving message isnt constant</span></div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span>}RS_RXSizeTypeDef;</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span><span class="comment">//-----------STRUCTURE FOR HANDLE RS------------</span></div>
|
||||
<div class="foldopen" id="foldopen00146" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="struct_r_s___handle_type_def.html"> 146</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><span class="comment">// RS_HandleTypeDef</span></div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span>{ </div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="comment">/* MESSAGE */</span></div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> uint8_t ID; <span class="comment">// ID of RS "channel"</span></div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *pMessagePtr; <span class="comment">// pointer to message struct</span></div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> uint8_t *pBufferPtr; <span class="comment">// pointer to message buffer</span></div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> uint32_t RS_Message_Size; <span class="comment">// size of whole message, not only data</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="comment">/* HANDLERS and SETTINGS */</span></div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> UART_HandleTypeDef *huartx; <span class="comment">// handler for used uart</span></div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> TIM_HandleTypeDef *htimx; <span class="comment">// handler for used tim</span></div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> RS_ModeTypeDef sRS_Mode; <span class="comment">// slave or master @ref RS_ModeTypeDef</span></div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> RS_ITModeTypeDef sRS_IT_Mode; <span class="comment">// 1 - IT mode, 0 - Blocking mode </span></div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> uint32_t sRS_Timeout; <span class="comment">// setting: timeout in ms</span></div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> RS_RXSizeTypeDef sRS_RX_Size_Mode; <span class="comment">// setting: 1 - not const, 0 - const </span></div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="comment">/* FLAGS */</span> </div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="comment">// These flags for controling receive/transmit</span></div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordtype">unsigned</span> fRX_Half:1; <span class="comment">// 0 - receiving msg before ByteCnt, 0 - receiving msg after ByteCnt</span></div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> </div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordtype">unsigned</span> fRS_Busy:1; <span class="comment">// 1 - RS is busy, 0 - RS isnt busy </span></div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordtype">unsigned</span> fRX_Busy:1; <span class="comment">// 1 - receiving is active, 0 - receiving isnt active</span></div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordtype">unsigned</span> fTX_Busy:1; <span class="comment">// 1 - transmiting is active, 0 - transmiting isnt active </span></div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> </div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordtype">unsigned</span> fRX_Done:1; <span class="comment">// 1 - receiving is done, 0 - receiving isnt done </span></div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordtype">unsigned</span> fTX_Done:1; <span class="comment">// 1 - transmiting is done, 0 - transmiting isnt done </span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> </div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="comment">// setted by user</span></div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordtype">unsigned</span> fMessageHandled:1; <span class="comment">// 1 - RS command is handled, 0 - RS command isnt handled yet</span></div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keywordtype">unsigned</span> fEchoResponse:1; <span class="comment">// 0 - receiving msg before ByteCnt, 0 - receiving msg after ByteCnt</span></div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordtype">unsigned</span> fDeferredResponse:1; <span class="comment">// 0 - receiving msg before ByteCnt, 0 - receiving msg after ByteCnt</span></div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> </div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="comment">/* RS STATUS */</span></div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> RS_StatusTypeDef RS_STATUS; <span class="comment">// RS status</span></div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> RS_FunctonTypeDef RS_RESPONSE; <span class="comment">// RS response</span></div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span>}<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a>;</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> </div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> </div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> </div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> </div>
|
||||
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
|
||||
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
|
||||
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> </div>
|
||||
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div>
|
||||
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> </div>
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> </div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="comment">//----------------FUNCTIONS FOR PROCESSING MESSAGE-------------------</span></div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span><span class="comment">/*--------------------Defined by users purposes--------------------*/</span></div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span>RS_StatusTypeDef RS_Response(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg);</div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span>RS_StatusTypeDef Collect_Message(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg, uint8_t *msg_uart_buff);</div>
|
||||
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> </div>
|
||||
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span>RS_StatusTypeDef Parse_Message(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg, uint8_t *msg_uart_buff);</div>
|
||||
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span>RS_StatusTypeDef RS_Define_Size_of_RX_Message(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, uint32_t *rx_data_size);</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> </div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span><span class="comment">/* MORE USER FUNCTION BEGIN*/</span></div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span><span class="comment">/* MORE USER FUNCTION END*/</span></div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> </div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> </div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span><span class="comment">//-------------------------GENERAL FUNCTIONS-------------------------</span></div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span><span class="comment">/*-----------------Should be called from main code-----------------*/</span></div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span>RS_StatusTypeDef RS_Receive_IT(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg);</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> </div>
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span>RS_StatusTypeDef RS_Transmit_IT(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg);</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> </div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span>RS_StatusTypeDef RS_Init(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_u_a_r_t___settings_type_def.html">UART_SettingsTypeDef</a> *suart, <a class="code hl_struct" href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a> *stim, uint8_t *pRS_BufferPtr);</div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> </div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span>RS_StatusTypeDef RS_Abort(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, RS_AbortTypeDef AbortMode);</div>
|
||||
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> </div>
|
||||
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span><span class="comment">//-------------------------SUPPORT FUNCTIONS-------------------------</span></div>
|
||||
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span><span class="comment">/*------------------Called from General functions------------------*/</span></div>
|
||||
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span>RS_StatusTypeDef RS_Handle_Receive_Start(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg);</div>
|
||||
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span>RS_StatusTypeDef RS_Handle_Transmit_Start(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS, <a class="code hl_struct" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> *RS_msg);</div>
|
||||
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span><span class="comment">/* UART RX Callback: define behaviour after receiving message */</span></div>
|
||||
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span>RS_StatusTypeDef RS_UART_RxCpltCallback(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS);</div>
|
||||
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span><span class="comment">/* UART RX Callback: define behaviour after transmiting message */</span></div>
|
||||
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span>RS_StatusTypeDef RS_UART_TxCpltCallback(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS);</div>
|
||||
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span><span class="comment">/* Handler for UART */</span></div>
|
||||
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span><span class="keywordtype">void</span> RS_UART_Handler(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS);</div>
|
||||
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span><span class="comment">/* Handler for TIM */</span></div>
|
||||
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span><span class="keywordtype">void</span> RS_TIM_Handler(<a class="code hl_struct" href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a> *hRS);</div>
|
||||
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> </div>
|
||||
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> </div>
|
||||
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> </div>
|
||||
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> </div>
|
||||
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> </div>
|
||||
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> </div>
|
||||
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span>HAL_StatusTypeDef RS_UART_Init(<a class="code hl_struct" href="struct_u_a_r_t___settings_type_def.html">UART_SettingsTypeDef</a> *suart);</div>
|
||||
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span><span class="keywordtype">void</span> UART_GPIO_Init(GPIO_TypeDef *GPIOx, uint16_t GPIO_PIN_RX, uint16_t GPIO_PIN_TX);</div>
|
||||
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span><span class="keywordtype">void</span> UART_DMA_Init(UART_HandleTypeDef *huart, DMA_HandleTypeDef *hdma_rx, DMA_Stream_TypeDef *DMAChannel, uint32_t DMA_CHANNEL_X);</div>
|
||||
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span><span class="keywordtype">void</span> User_UART_MspInit(UART_HandleTypeDef *huart);</div>
|
||||
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> </div>
|
||||
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span>HAL_StatusTypeDef User_UART_Check(<a class="code hl_struct" href="struct_u_a_r_t___settings_type_def.html">UART_SettingsTypeDef</a> *suart);</div>
|
||||
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> </div>
|
||||
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span><span class="preprocessor">#define __USER_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \</span></div>
|
||||
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span><span class="preprocessor"> do{ \</span></div>
|
||||
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span><span class="preprocessor"> (__HANDLE__)->__PPP_DMA_FIELD__ = (__DMA_HANDLE__); \</span></div>
|
||||
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span><span class="preprocessor"> (__DMA_HANDLE__)->Parent = (__HANDLE__);} while(0U)</span></div>
|
||||
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> </div>
|
||||
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> </div>
|
||||
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> </div>
|
||||
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> </div>
|
||||
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span><span class="preprocessor">#endif </span><span class="comment">// __UART_USER_H_</span></div>
|
||||
<div class="ttc" id="astruct_r_s___handle_type_def_html"><div class="ttname"><a href="struct_r_s___handle_type_def.html">RS_HandleTypeDef</a></div><div class="ttdoc">Handle for RS communication.</div><div class="ttdef"><b>Definition</b> rs_message.h:147</div></div>
|
||||
<div class="ttc" id="astruct_r_s___msg_type_def_html"><div class="ttname"><a href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a></div><div class="ttdef"><b>Definition</b> modbus.h:72</div></div>
|
||||
<div class="ttc" id="astruct_t_i_m___settings_type_def_html"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a></div><div class="ttdef"><b>Definition</b> tim_general.h:43</div></div>
|
||||
<div class="ttc" id="astruct_u_a_r_t___settings_type_def_html"><div class="ttname"><a href="struct_u_a_r_t___settings_type_def.html">UART_SettingsTypeDef</a></div><div class="ttdef"><b>Definition</b> rs_message.h:65</div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
var searchData=
|
||||
[
|
||||
['rs_5fhandletypedef_0',['RS_HandleTypeDef',['../struct_r_s___handle_type_def.html',1,'']]],
|
||||
['rs_5fmsgtypedef_1',['RS_MsgTypeDef',['../struct_r_s___msg_type_def.html',1,'']]]
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
var searchData=
|
||||
[
|
||||
['tim_5fsettingstypedef_0',['TIM_SettingsTypeDef',['../struct_t_i_m___settings_type_def.html',1,'']]]
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
var searchData=
|
||||
[
|
||||
['uart_5fsettingstypedef_0',['UART_SettingsTypeDef',['../struct_u_a_r_t___settings_type_def.html',1,'']]]
|
||||
];
|
||||
@@ -0,0 +1,5 @@
|
||||
var searchData=
|
||||
[
|
||||
['rs_5fhandletypedef_0',['RS_HandleTypeDef',['../struct_r_s___handle_type_def.html',1,'']]],
|
||||
['rs_5fmsgtypedef_1',['RS_MsgTypeDef',['../struct_r_s___msg_type_def.html',1,'']]]
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
var searchData=
|
||||
[
|
||||
['tim_5fsettingstypedef_0',['TIM_SettingsTypeDef',['../struct_t_i_m___settings_type_def.html',1,'']]]
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
var searchData=
|
||||
[
|
||||
['uart_5fsettingstypedef_0',['UART_SettingsTypeDef',['../struct_u_a_r_t___settings_type_def.html',1,'']]]
|
||||
];
|
||||
18
научка/code/pwm_motor_control/Modbus/html/search/close.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 11 11"
|
||||
height="11"
|
||||
width="11"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6" />
|
||||
<path
|
||||
id="path12"
|
||||
d="M 5.5 0.5 A 5 5 0 0 0 0.5 5.5 A 5 5 0 0 0 5.5 10.5 A 5 5 0 0 0 10.5 5.5 A 5 5 0 0 0 5.5 0.5 z M 3.5820312 3 A 0.58291923 0.58291923 0 0 1 4 3.1757812 L 5.5 4.6757812 L 7 3.1757812 A 0.58291923 0.58291923 0 0 1 7.4003906 3 A 0.58291923 0.58291923 0 0 1 7.8242188 4 L 6.3242188 5.5 L 7.8242188 7 A 0.58291923 0.58291923 0 1 1 7 7.8242188 L 5.5 6.3242188 L 4 7.8242188 A 0.58291923 0.58291923 0 1 1 3.1757812 7 L 4.6757812 5.5 L 3.1757812 4 A 0.58291923 0.58291923 0 0 1 3.5820312 3 z "
|
||||
style="stroke-width:1.09870648;fill:#bababa;fill-opacity:1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 947 B |
24
научка/code/pwm_motor_control/Modbus/html/search/mag.svg
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 20 19"
|
||||
height="19"
|
||||
width="20"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
r="3.5"
|
||||
cy="8.5"
|
||||
cx="5.5"
|
||||
id="path4611"
|
||||
style="fill:#000000;fill-opacity:0;stroke:#656565;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path4630"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
style="fill:none;stroke:#656565;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 804 B |
24
научка/code/pwm_motor_control/Modbus/html/search/mag_d.svg
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 20 19"
|
||||
height="19"
|
||||
width="20"
|
||||
id="svg2"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
r="3.5"
|
||||
cy="8.5"
|
||||
cx="5.5"
|
||||
id="path4611"
|
||||
style="fill:#000000;fill-opacity:0;stroke:#C5C5C5;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path4630"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
style="fill:none;stroke:#C5C5C5;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 804 B |
31
научка/code/pwm_motor_control/Modbus/html/search/mag_sel.svg
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="20"
|
||||
height="19"
|
||||
viewBox="0 0 20 19"
|
||||
>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
style="fill:#000000;fill-opacity:0;stroke:#656565;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="path4611"
|
||||
cx="5.5"
|
||||
cy="8.5"
|
||||
r="3.5" />
|
||||
<path
|
||||
style="fill:#656565;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 11,7 13.5,10 16,7 Z"
|
||||
id="path4609"
|
||||
/>
|
||||
<path
|
||||
style="fill:none;stroke:#656565;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
id="path4630"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1019 B |
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="20"
|
||||
height="19"
|
||||
viewBox="0 0 20 19"
|
||||
>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<circle
|
||||
style="fill:#000000;fill-opacity:0;stroke:#c5C5C5;stroke-width:1.4;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
id="path4611"
|
||||
cx="5.5"
|
||||
cy="8.5"
|
||||
r="3.5" />
|
||||
<path
|
||||
style="fill:#c5C5C5;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 11,7 13.5,10 16,7 Z"
|
||||
id="path4609"
|
||||
/>
|
||||
<path
|
||||
style="fill:none;stroke:#c5C5C5;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 8.1085854,11.109059 2.7823556,2.782356"
|
||||
id="path4630"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1019 B |
291
научка/code/pwm_motor_control/Modbus/html/search/search.css
Normal file
@@ -0,0 +1,291 @@
|
||||
/*---------------- Search Box positioning */
|
||||
|
||||
#main-menu > li:last-child {
|
||||
/* This <li> object is the parent of the search bar */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 36px;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
/*---------------- Search box styling */
|
||||
|
||||
.SRPage * {
|
||||
font-weight: normal;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
dark-mode-toggle {
|
||||
margin-left: 5px;
|
||||
display: flex;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#MSearchBox {
|
||||
display: inline-block;
|
||||
white-space : nowrap;
|
||||
background: var(--search-background-color);
|
||||
border-radius: 0.65em;
|
||||
box-shadow: var(--search-box-shadow);
|
||||
z-index: 102;
|
||||
}
|
||||
|
||||
#MSearchBox .left {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: 1.4em;
|
||||
}
|
||||
|
||||
#MSearchSelect {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 20px;
|
||||
height: 19px;
|
||||
background-image: var(--search-magnification-select-image);
|
||||
margin: 0 0 0 0.3em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#MSearchSelectExt {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 10px;
|
||||
height: 19px;
|
||||
background-image: var(--search-magnification-image);
|
||||
margin: 0 0 0 0.5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#MSearchField {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 7.5em;
|
||||
height: 19px;
|
||||
margin: 0 0.15em;
|
||||
padding: 0;
|
||||
line-height: 1em;
|
||||
border:none;
|
||||
color: var(--search-foreground-color);
|
||||
outline: none;
|
||||
font-family: var(--font-family-search);
|
||||
-webkit-border-radius: 0px;
|
||||
border-radius: 0px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
@media(hover: none) {
|
||||
/* to avoid zooming on iOS */
|
||||
#MSearchField {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
#MSearchBox .right {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 1.4em;
|
||||
height: 1.4em;
|
||||
}
|
||||
|
||||
#MSearchClose {
|
||||
display: none;
|
||||
font-size: inherit;
|
||||
background : none;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
|
||||
}
|
||||
|
||||
#MSearchCloseImg {
|
||||
padding: 0.3em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.MSearchBoxActive #MSearchField {
|
||||
color: var(--search-active-color);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------- Search filter selection */
|
||||
|
||||
#MSearchSelectWindow {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
border: 1px solid var(--search-filter-border-color);
|
||||
background-color: var(--search-filter-background-color);
|
||||
z-index: 10001;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.SelectItem {
|
||||
font: 8pt var(--font-family-search);
|
||||
padding-left: 2px;
|
||||
padding-right: 12px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
span.SelectionMark {
|
||||
margin-right: 4px;
|
||||
font-family: var(--font-family-monospace);
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.SelectItem {
|
||||
display: block;
|
||||
outline-style: none;
|
||||
color: var(--search-filter-foreground-color);
|
||||
text-decoration: none;
|
||||
padding-left: 6px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
a.SelectItem:focus,
|
||||
a.SelectItem:active {
|
||||
color: var(--search-filter-foreground-color);
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.SelectItem:hover {
|
||||
color: var(--search-filter-highlight-text-color);
|
||||
background-color: var(--search-filter-highlight-bg-color);
|
||||
outline-style: none;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*---------------- Search results window */
|
||||
|
||||
iframe#MSearchResults {
|
||||
/*width: 60ex;*/
|
||||
height: 15em;
|
||||
}
|
||||
|
||||
#MSearchResultsWindow {
|
||||
display: none;
|
||||
position: absolute;
|
||||
left: 0; top: 0;
|
||||
border: 1px solid var(--search-results-border-color);
|
||||
background-color: var(--search-results-background-color);
|
||||
z-index:10000;
|
||||
width: 300px;
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* ----------------------------------- */
|
||||
|
||||
|
||||
#SRIndex {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.SREntry {
|
||||
font-size: 10pt;
|
||||
padding-left: 1ex;
|
||||
}
|
||||
|
||||
.SRPage .SREntry {
|
||||
font-size: 8pt;
|
||||
padding: 1px 5px;
|
||||
}
|
||||
|
||||
div.SRPage {
|
||||
margin: 5px 2px;
|
||||
background-color: var(--search-results-background-color);
|
||||
}
|
||||
|
||||
.SRChildren {
|
||||
padding-left: 3ex; padding-bottom: .5em
|
||||
}
|
||||
|
||||
.SRPage .SRChildren {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.SRSymbol {
|
||||
font-weight: bold;
|
||||
color: var(--search-results-foreground-color);
|
||||
font-family: var(--font-family-search);
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
a.SRScope {
|
||||
display: block;
|
||||
color: var(--search-results-foreground-color);
|
||||
font-family: var(--font-family-search);
|
||||
font-size: 8pt;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
a.SRSymbol:focus, a.SRSymbol:active,
|
||||
a.SRScope:focus, a.SRScope:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.SRScope {
|
||||
padding-left: 4px;
|
||||
font-family: var(--font-family-search);
|
||||
}
|
||||
|
||||
.SRPage .SRStatus {
|
||||
padding: 2px 5px;
|
||||
font-size: 8pt;
|
||||
font-style: italic;
|
||||
font-family: var(--font-family-search);
|
||||
}
|
||||
|
||||
.SRResult {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.searchresults {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*---------------- External search page results */
|
||||
|
||||
.pages b {
|
||||
color: white;
|
||||
padding: 5px 5px 3px 5px;
|
||||
background-image: var(--nav-gradient-active-image-parent);
|
||||
background-repeat: repeat-x;
|
||||
text-shadow: 0 1px 1px #000000;
|
||||
}
|
||||
|
||||
.pages {
|
||||
line-height: 17px;
|
||||
margin-left: 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.hl {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#searchresults {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.searchpages {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
694
научка/code/pwm_motor_control/Modbus/html/search/search.js
Normal file
@@ -0,0 +1,694 @@
|
||||
/*
|
||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||
|
||||
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 THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
|
||||
@licend The above is the entire license notice for the JavaScript code in this file
|
||||
*/
|
||||
const SEARCH_COOKIE_NAME = ''+'search_grp';
|
||||
|
||||
const searchResults = new SearchResults();
|
||||
|
||||
/* A class handling everything associated with the search panel.
|
||||
|
||||
Parameters:
|
||||
name - The name of the global variable that will be
|
||||
storing this instance. Is needed to be able to set timeouts.
|
||||
resultPath - path to use for external files
|
||||
*/
|
||||
function SearchBox(name, resultsPath, extension) {
|
||||
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
|
||||
if (!extension || extension == "") { extension = ".html"; }
|
||||
|
||||
function getXPos(item) {
|
||||
let x = 0;
|
||||
if (item.offsetWidth) {
|
||||
while (item && item!=document.body) {
|
||||
x += item.offsetLeft;
|
||||
item = item.offsetParent;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
function getYPos(item) {
|
||||
let y = 0;
|
||||
if (item.offsetWidth) {
|
||||
while (item && item!=document.body) {
|
||||
y += item.offsetTop;
|
||||
item = item.offsetParent;
|
||||
}
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
// ---------- Instance variables
|
||||
this.name = name;
|
||||
this.resultsPath = resultsPath;
|
||||
this.keyTimeout = 0;
|
||||
this.keyTimeoutLength = 500;
|
||||
this.closeSelectionTimeout = 300;
|
||||
this.lastSearchValue = "";
|
||||
this.lastResultsPage = "";
|
||||
this.hideTimeout = 0;
|
||||
this.searchIndex = 0;
|
||||
this.searchActive = false;
|
||||
this.extension = extension;
|
||||
|
||||
// ----------- DOM Elements
|
||||
|
||||
this.DOMSearchField = () => document.getElementById("MSearchField");
|
||||
this.DOMSearchSelect = () => document.getElementById("MSearchSelect");
|
||||
this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow");
|
||||
this.DOMPopupSearchResults = () => document.getElementById("MSearchResults");
|
||||
this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow");
|
||||
this.DOMSearchClose = () => document.getElementById("MSearchClose");
|
||||
this.DOMSearchBox = () => document.getElementById("MSearchBox");
|
||||
|
||||
// ------------ Event Handlers
|
||||
|
||||
// Called when focus is added or removed from the search field.
|
||||
this.OnSearchFieldFocus = function(isActive) {
|
||||
this.Activate(isActive);
|
||||
}
|
||||
|
||||
this.OnSearchSelectShow = function() {
|
||||
const searchSelectWindow = this.DOMSearchSelectWindow();
|
||||
const searchField = this.DOMSearchSelect();
|
||||
|
||||
const left = getXPos(searchField);
|
||||
const top = getYPos(searchField) + searchField.offsetHeight;
|
||||
|
||||
// show search selection popup
|
||||
searchSelectWindow.style.display='block';
|
||||
searchSelectWindow.style.left = left + 'px';
|
||||
searchSelectWindow.style.top = top + 'px';
|
||||
|
||||
// stop selection hide timer
|
||||
if (this.hideTimeout) {
|
||||
clearTimeout(this.hideTimeout);
|
||||
this.hideTimeout=0;
|
||||
}
|
||||
return false; // to avoid "image drag" default event
|
||||
}
|
||||
|
||||
this.OnSearchSelectHide = function() {
|
||||
this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this),
|
||||
this.closeSelectionTimeout);
|
||||
}
|
||||
|
||||
// Called when the content of the search field is changed.
|
||||
this.OnSearchFieldChange = function(evt) {
|
||||
if (this.keyTimeout) { // kill running timer
|
||||
clearTimeout(this.keyTimeout);
|
||||
this.keyTimeout = 0;
|
||||
}
|
||||
|
||||
const e = evt ? evt : window.event; // for IE
|
||||
if (e.keyCode==40 || e.keyCode==13) {
|
||||
if (e.shiftKey==1) {
|
||||
this.OnSearchSelectShow();
|
||||
const win=this.DOMSearchSelectWindow();
|
||||
for (let i=0;i<win.childNodes.length;i++) {
|
||||
const child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem') {
|
||||
child.focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
const elem = searchResults.NavNext(0);
|
||||
if (elem) elem.focus();
|
||||
}
|
||||
} else if (e.keyCode==27) { // Escape out of the search field
|
||||
e.stopPropagation();
|
||||
this.DOMSearchField().blur();
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.lastSearchValue = '';
|
||||
this.Activate(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// strip whitespaces
|
||||
const searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||
|
||||
if (searchValue != this.lastSearchValue) { // search value has changed
|
||||
if (searchValue != "") { // non-empty search
|
||||
// set timer for search update
|
||||
this.keyTimeout = setTimeout(this.Search.bind(this), this.keyTimeoutLength);
|
||||
} else { // empty search field
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.lastSearchValue = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.SelectItemCount = function() {
|
||||
let count=0;
|
||||
const win=this.DOMSearchSelectWindow();
|
||||
for (let i=0;i<win.childNodes.length;i++) {
|
||||
const child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem') {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
this.GetSelectionIdByName = function(name) {
|
||||
let j=0;
|
||||
const win=this.DOMSearchSelectWindow();
|
||||
for (let i=0;i<win.childNodes.length;i++) {
|
||||
const child = win.childNodes[i];
|
||||
if (child.className=='SelectItem') {
|
||||
if (child.childNodes[1].nodeValue==name) {
|
||||
return j;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
this.SelectItemSet = function(id) {
|
||||
let j=0;
|
||||
const win=this.DOMSearchSelectWindow();
|
||||
for (let i=0;i<win.childNodes.length;i++) {
|
||||
const child = win.childNodes[i]; // get span within a
|
||||
if (child.className=='SelectItem') {
|
||||
const node = child.firstChild;
|
||||
if (j==id) {
|
||||
node.innerHTML='•';
|
||||
Cookie.writeSetting(SEARCH_COOKIE_NAME, child.childNodes[1].nodeValue, 0)
|
||||
} else {
|
||||
node.innerHTML=' ';
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when an search filter selection is made.
|
||||
// set item with index id as the active item
|
||||
this.OnSelectItem = function(id) {
|
||||
this.searchIndex = id;
|
||||
this.SelectItemSet(id);
|
||||
const searchValue = this.DOMSearchField().value.replace(/ +/g, "");
|
||||
if (searchValue!="" && this.searchActive) { // something was found -> do a search
|
||||
this.Search();
|
||||
}
|
||||
}
|
||||
|
||||
this.OnSearchSelectKey = function(evt) {
|
||||
const e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) { // Down
|
||||
this.searchIndex++;
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
} else if (e.keyCode==38 && this.searchIndex>0) { // Up
|
||||
this.searchIndex--;
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
} else if (e.keyCode==13 || e.keyCode==27) {
|
||||
e.stopPropagation();
|
||||
this.OnSelectItem(this.searchIndex);
|
||||
this.CloseSelectionWindow();
|
||||
this.DOMSearchField().focus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// --------- Actions
|
||||
|
||||
// Closes the results window.
|
||||
this.CloseResultsWindow = function() {
|
||||
this.DOMPopupSearchResultsWindow().style.display = 'none';
|
||||
this.DOMSearchClose().style.display = 'none';
|
||||
this.Activate(false);
|
||||
}
|
||||
|
||||
this.CloseSelectionWindow = function() {
|
||||
this.DOMSearchSelectWindow().style.display = 'none';
|
||||
}
|
||||
|
||||
// Performs a search.
|
||||
this.Search = function() {
|
||||
this.keyTimeout = 0;
|
||||
|
||||
// strip leading whitespace
|
||||
const searchValue = this.DOMSearchField().value.replace(/^ +/, "");
|
||||
|
||||
const code = searchValue.toLowerCase().charCodeAt(0);
|
||||
let idxChar = searchValue.substr(0, 1).toLowerCase();
|
||||
if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair
|
||||
idxChar = searchValue.substr(0, 2);
|
||||
}
|
||||
|
||||
let jsFile;
|
||||
let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);
|
||||
if (idx!=-1) {
|
||||
const hexCode=idx.toString(16);
|
||||
jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js';
|
||||
}
|
||||
|
||||
const loadJS = function(url, impl, loc) {
|
||||
const scriptTag = document.createElement('script');
|
||||
scriptTag.src = url;
|
||||
scriptTag.onload = impl;
|
||||
scriptTag.onreadystatechange = impl;
|
||||
loc.appendChild(scriptTag);
|
||||
}
|
||||
|
||||
const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
|
||||
const domSearchBox = this.DOMSearchBox();
|
||||
const domPopupSearchResults = this.DOMPopupSearchResults();
|
||||
const domSearchClose = this.DOMSearchClose();
|
||||
const resultsPath = this.resultsPath;
|
||||
|
||||
const handleResults = function() {
|
||||
document.getElementById("Loading").style.display="none";
|
||||
if (typeof searchData !== 'undefined') {
|
||||
createResults(resultsPath);
|
||||
document.getElementById("NoMatches").style.display="none";
|
||||
}
|
||||
|
||||
if (idx!=-1) {
|
||||
searchResults.Search(searchValue);
|
||||
} else { // no file with search results => force empty search results
|
||||
searchResults.Search('====');
|
||||
}
|
||||
|
||||
if (domPopupSearchResultsWindow.style.display!='block') {
|
||||
domSearchClose.style.display = 'inline-block';
|
||||
let left = getXPos(domSearchBox) + 150;
|
||||
let top = getYPos(domSearchBox) + 20;
|
||||
domPopupSearchResultsWindow.style.display = 'block';
|
||||
left -= domPopupSearchResults.offsetWidth;
|
||||
const maxWidth = document.body.clientWidth;
|
||||
const maxHeight = document.body.clientHeight;
|
||||
let width = 300;
|
||||
if (left<10) left=10;
|
||||
if (width+left+8>maxWidth) width=maxWidth-left-8;
|
||||
let height = 400;
|
||||
if (height+top+8>maxHeight) height=maxHeight-top-8;
|
||||
domPopupSearchResultsWindow.style.top = top + 'px';
|
||||
domPopupSearchResultsWindow.style.left = left + 'px';
|
||||
domPopupSearchResultsWindow.style.width = width + 'px';
|
||||
domPopupSearchResultsWindow.style.height = height + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
if (jsFile) {
|
||||
loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow());
|
||||
} else {
|
||||
handleResults();
|
||||
}
|
||||
|
||||
this.lastSearchValue = searchValue;
|
||||
}
|
||||
|
||||
// -------- Activation Functions
|
||||
|
||||
// Activates or deactivates the search panel, resetting things to
|
||||
// their default values if necessary.
|
||||
this.Activate = function(isActive) {
|
||||
if (isActive || // open it
|
||||
this.DOMPopupSearchResultsWindow().style.display == 'block'
|
||||
) {
|
||||
this.DOMSearchBox().className = 'MSearchBoxActive';
|
||||
this.searchActive = true;
|
||||
} else if (!isActive) { // directly remove the panel
|
||||
this.DOMSearchBox().className = 'MSearchBoxInactive';
|
||||
this.searchActive = false;
|
||||
this.lastSearchValue = ''
|
||||
this.lastResultsPage = '';
|
||||
this.DOMSearchField().value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// The class that handles everything on the search results page.
|
||||
function SearchResults() {
|
||||
|
||||
function convertToId(search) {
|
||||
let result = '';
|
||||
for (let i=0;i<search.length;i++) {
|
||||
const c = search.charAt(i);
|
||||
const cn = c.charCodeAt(0);
|
||||
if (c.match(/[a-z0-9\u0080-\uFFFF]/)) {
|
||||
result+=c;
|
||||
} else if (cn<16) {
|
||||
result+="_0"+cn.toString(16);
|
||||
} else {
|
||||
result+="_"+cn.toString(16);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// The number of matches from the last run of <Search()>.
|
||||
this.lastMatchCount = 0;
|
||||
this.lastKey = 0;
|
||||
this.repeatOn = false;
|
||||
|
||||
// Toggles the visibility of the passed element ID.
|
||||
this.FindChildElement = function(id) {
|
||||
const parentElement = document.getElementById(id);
|
||||
let element = parentElement.firstChild;
|
||||
|
||||
while (element && element!=parentElement) {
|
||||
if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') {
|
||||
return element;
|
||||
}
|
||||
|
||||
if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) {
|
||||
element = element.firstChild;
|
||||
} else if (element.nextSibling) {
|
||||
element = element.nextSibling;
|
||||
} else {
|
||||
do {
|
||||
element = element.parentNode;
|
||||
}
|
||||
while (element && element!=parentElement && !element.nextSibling);
|
||||
|
||||
if (element && element!=parentElement) {
|
||||
element = element.nextSibling;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.Toggle = function(id) {
|
||||
const element = this.FindChildElement(id);
|
||||
if (element) {
|
||||
if (element.style.display == 'block') {
|
||||
element.style.display = 'none';
|
||||
} else {
|
||||
element.style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Searches for the passed string. If there is no parameter,
|
||||
// it takes it from the URL query.
|
||||
//
|
||||
// Always returns true, since other documents may try to call it
|
||||
// and that may or may not be possible.
|
||||
this.Search = function(search) {
|
||||
if (!search) { // get search word from URL
|
||||
search = window.location.search;
|
||||
search = search.substring(1); // Remove the leading '?'
|
||||
search = unescape(search);
|
||||
}
|
||||
|
||||
search = search.replace(/^ +/, ""); // strip leading spaces
|
||||
search = search.replace(/ +$/, ""); // strip trailing spaces
|
||||
search = search.toLowerCase();
|
||||
search = convertToId(search);
|
||||
|
||||
const resultRows = document.getElementsByTagName("div");
|
||||
let matches = 0;
|
||||
|
||||
let i = 0;
|
||||
while (i < resultRows.length) {
|
||||
const row = resultRows.item(i);
|
||||
if (row.className == "SRResult") {
|
||||
let rowMatchName = row.id.toLowerCase();
|
||||
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
|
||||
|
||||
if (search.length<=rowMatchName.length &&
|
||||
rowMatchName.substr(0, search.length)==search) {
|
||||
row.style.display = 'block';
|
||||
matches++;
|
||||
} else {
|
||||
row.style.display = 'none';
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
document.getElementById("Searching").style.display='none';
|
||||
if (matches == 0) { // no results
|
||||
document.getElementById("NoMatches").style.display='block';
|
||||
} else { // at least one result
|
||||
document.getElementById("NoMatches").style.display='none';
|
||||
}
|
||||
this.lastMatchCount = matches;
|
||||
return true;
|
||||
}
|
||||
|
||||
// return the first item with index index or higher that is visible
|
||||
this.NavNext = function(index) {
|
||||
let focusItem;
|
||||
for (;;) {
|
||||
const focusName = 'Item'+index;
|
||||
focusItem = document.getElementById(focusName);
|
||||
if (focusItem && focusItem.parentNode.parentNode.style.display=='block') {
|
||||
break;
|
||||
} else if (!focusItem) { // last element
|
||||
break;
|
||||
}
|
||||
focusItem=null;
|
||||
index++;
|
||||
}
|
||||
return focusItem;
|
||||
}
|
||||
|
||||
this.NavPrev = function(index) {
|
||||
let focusItem;
|
||||
for (;;) {
|
||||
const focusName = 'Item'+index;
|
||||
focusItem = document.getElementById(focusName);
|
||||
if (focusItem && focusItem.parentNode.parentNode.style.display=='block') {
|
||||
break;
|
||||
} else if (!focusItem) { // last element
|
||||
break;
|
||||
}
|
||||
focusItem=null;
|
||||
index--;
|
||||
}
|
||||
return focusItem;
|
||||
}
|
||||
|
||||
this.ProcessKeys = function(e) {
|
||||
if (e.type == "keydown") {
|
||||
this.repeatOn = false;
|
||||
this.lastKey = e.keyCode;
|
||||
} else if (e.type == "keypress") {
|
||||
if (!this.repeatOn) {
|
||||
if (this.lastKey) this.repeatOn = true;
|
||||
return false; // ignore first keypress after keydown
|
||||
}
|
||||
} else if (e.type == "keyup") {
|
||||
this.lastKey = 0;
|
||||
this.repeatOn = false;
|
||||
}
|
||||
return this.lastKey!=0;
|
||||
}
|
||||
|
||||
this.Nav = function(evt,itemIndex) {
|
||||
const e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==13) return true;
|
||||
if (!this.ProcessKeys(e)) return false;
|
||||
|
||||
if (this.lastKey==38) { // Up
|
||||
const newIndex = itemIndex-1;
|
||||
let focusItem = this.NavPrev(newIndex);
|
||||
if (focusItem) {
|
||||
let child = this.FindChildElement(focusItem.parentNode.parentNode.id);
|
||||
if (child && child.style.display == 'block') { // children visible
|
||||
let n=0;
|
||||
let tmpElem;
|
||||
for (;;) { // search for last child
|
||||
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
|
||||
if (tmpElem) {
|
||||
focusItem = tmpElem;
|
||||
} else { // found it!
|
||||
break;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (focusItem) {
|
||||
focusItem.focus();
|
||||
} else { // return focus to search field
|
||||
document.getElementById("MSearchField").focus();
|
||||
}
|
||||
} else if (this.lastKey==40) { // Down
|
||||
const newIndex = itemIndex+1;
|
||||
let focusItem;
|
||||
const item = document.getElementById('Item'+itemIndex);
|
||||
const elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem && elem.style.display == 'block') { // children visible
|
||||
focusItem = document.getElementById('Item'+itemIndex+'_c0');
|
||||
}
|
||||
if (!focusItem) focusItem = this.NavNext(newIndex);
|
||||
if (focusItem) focusItem.focus();
|
||||
} else if (this.lastKey==39) { // Right
|
||||
const item = document.getElementById('Item'+itemIndex);
|
||||
const elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem) elem.style.display = 'block';
|
||||
} else if (this.lastKey==37) { // Left
|
||||
const item = document.getElementById('Item'+itemIndex);
|
||||
const elem = this.FindChildElement(item.parentNode.parentNode.id);
|
||||
if (elem) elem.style.display = 'none';
|
||||
} else if (this.lastKey==27) { // Escape
|
||||
e.stopPropagation();
|
||||
searchBox.CloseResultsWindow();
|
||||
document.getElementById("MSearchField").focus();
|
||||
} else if (this.lastKey==13) { // Enter
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
this.NavChild = function(evt,itemIndex,childIndex) {
|
||||
const e = (evt) ? evt : window.event; // for IE
|
||||
if (e.keyCode==13) return true;
|
||||
if (!this.ProcessKeys(e)) return false;
|
||||
|
||||
if (this.lastKey==38) { // Up
|
||||
if (childIndex>0) {
|
||||
const newIndex = childIndex-1;
|
||||
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
|
||||
} else { // already at first child, jump to parent
|
||||
document.getElementById('Item'+itemIndex).focus();
|
||||
}
|
||||
} else if (this.lastKey==40) { // Down
|
||||
const newIndex = childIndex+1;
|
||||
let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
|
||||
if (!elem) { // last child, jump to parent next parent
|
||||
elem = this.NavNext(itemIndex+1);
|
||||
}
|
||||
if (elem) {
|
||||
elem.focus();
|
||||
}
|
||||
} else if (this.lastKey==27) { // Escape
|
||||
e.stopPropagation();
|
||||
searchBox.CloseResultsWindow();
|
||||
document.getElementById("MSearchField").focus();
|
||||
} else if (this.lastKey==13) { // Enter
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function createResults(resultsPath) {
|
||||
|
||||
function setKeyActions(elem,action) {
|
||||
elem.setAttribute('onkeydown',action);
|
||||
elem.setAttribute('onkeypress',action);
|
||||
elem.setAttribute('onkeyup',action);
|
||||
}
|
||||
|
||||
function setClassAttr(elem,attr) {
|
||||
elem.setAttribute('class',attr);
|
||||
elem.setAttribute('className',attr);
|
||||
}
|
||||
|
||||
const results = document.getElementById("SRResults");
|
||||
results.innerHTML = '';
|
||||
searchData.forEach((elem,index) => {
|
||||
const id = elem[0];
|
||||
const srResult = document.createElement('div');
|
||||
srResult.setAttribute('id','SR_'+id);
|
||||
setClassAttr(srResult,'SRResult');
|
||||
const srEntry = document.createElement('div');
|
||||
setClassAttr(srEntry,'SREntry');
|
||||
const srLink = document.createElement('a');
|
||||
srLink.setAttribute('id','Item'+index);
|
||||
setKeyActions(srLink,'return searchResults.Nav(event,'+index+')');
|
||||
setClassAttr(srLink,'SRSymbol');
|
||||
srLink.innerHTML = elem[1][0];
|
||||
srEntry.appendChild(srLink);
|
||||
if (elem[1].length==2) { // single result
|
||||
srLink.setAttribute('href',resultsPath+elem[1][1][0]);
|
||||
srLink.setAttribute('onclick','searchBox.CloseResultsWindow()');
|
||||
if (elem[1][1][1]) {
|
||||
srLink.setAttribute('target','_parent');
|
||||
} else {
|
||||
srLink.setAttribute('target','_blank');
|
||||
}
|
||||
const srScope = document.createElement('span');
|
||||
setClassAttr(srScope,'SRScope');
|
||||
srScope.innerHTML = elem[1][1][2];
|
||||
srEntry.appendChild(srScope);
|
||||
} else { // multiple results
|
||||
srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
|
||||
const srChildren = document.createElement('div');
|
||||
setClassAttr(srChildren,'SRChildren');
|
||||
for (let c=0; c<elem[1].length-1; c++) {
|
||||
const srChild = document.createElement('a');
|
||||
srChild.setAttribute('id','Item'+index+'_c'+c);
|
||||
setKeyActions(srChild,'return searchResults.NavChild(event,'+index+','+c+')');
|
||||
setClassAttr(srChild,'SRScope');
|
||||
srChild.setAttribute('href',resultsPath+elem[1][c+1][0]);
|
||||
srChild.setAttribute('onclick','searchBox.CloseResultsWindow()');
|
||||
if (elem[1][c+1][1]) {
|
||||
srChild.setAttribute('target','_parent');
|
||||
} else {
|
||||
srChild.setAttribute('target','_blank');
|
||||
}
|
||||
srChild.innerHTML = elem[1][c+1][2];
|
||||
srChildren.appendChild(srChild);
|
||||
}
|
||||
srEntry.appendChild(srChildren);
|
||||
}
|
||||
srResult.appendChild(srEntry);
|
||||
results.appendChild(srResult);
|
||||
});
|
||||
}
|
||||
|
||||
function init_search() {
|
||||
const results = document.getElementById("MSearchSelectWindow");
|
||||
|
||||
results.tabIndex=0;
|
||||
for (let key in indexSectionLabels) {
|
||||
const link = document.createElement('a');
|
||||
link.setAttribute('class','SelectItem');
|
||||
link.setAttribute('onclick','searchBox.OnSelectItem('+key+')');
|
||||
link.href='javascript:void(0)';
|
||||
link.innerHTML='<span class="SelectionMark"> </span>'+indexSectionLabels[key];
|
||||
results.appendChild(link);
|
||||
}
|
||||
|
||||
const input = document.getElementById("MSearchSelect");
|
||||
const searchSelectWindow = document.getElementById("MSearchSelectWindow");
|
||||
input.tabIndex=0;
|
||||
input.addEventListener("keydown", function(event) {
|
||||
if (event.keyCode==13 || event.keyCode==40) {
|
||||
event.preventDefault();
|
||||
if (searchSelectWindow.style.display == 'block') {
|
||||
searchBox.CloseSelectionWindow();
|
||||
} else {
|
||||
searchBox.OnSearchSelectShow();
|
||||
searchBox.DOMSearchSelectWindow().focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
const name = Cookie.readSetting(SEARCH_COOKIE_NAME,0);
|
||||
const id = searchBox.GetSelectionIdByName(name);
|
||||
searchBox.OnSelectItem(id);
|
||||
}
|
||||
/* @license-end */
|
||||
@@ -0,0 +1,18 @@
|
||||
var indexSectionsWithContent =
|
||||
{
|
||||
0: "rtu",
|
||||
1: "rtu"
|
||||
};
|
||||
|
||||
var indexSectionNames =
|
||||
{
|
||||
0: "all",
|
||||
1: "classes"
|
||||
};
|
||||
|
||||
var indexSectionLabels =
|
||||
{
|
||||
0: "All",
|
||||
1: "Data Structures"
|
||||
};
|
||||
|
||||
BIN
научка/code/pwm_motor_control/Modbus/html/splitbar.png
Normal file
|
After Width: | Height: | Size: 314 B |
BIN
научка/code/pwm_motor_control/Modbus/html/splitbard.png
Normal file
|
After Width: | Height: | Size: 282 B |
@@ -0,0 +1,163 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: RS_HandleTypeDef Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle"><div class="title">RS_HandleTypeDef Struct Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Handle for RS communication.
|
||||
<a href="#details">More...</a></p>
|
||||
|
||||
<p><code>#include <<a class="el" href="rs__message_8h_source.html">rs_message.h</a>></code></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr class="memitem:ae05e4021c05cb62085215a5b3d03c0bc" id="r_ae05e4021c05cb62085215a5b3d03c0bc"><td class="memItemLeft" align="right" valign="top"><a id="ae05e4021c05cb62085215a5b3d03c0bc" name="ae05e4021c05cb62085215a5b3d03c0bc"></a>
|
||||
uint8_t </td><td class="memItemRight" valign="bottom"><b>ID</b></td></tr>
|
||||
<tr class="separator:ae05e4021c05cb62085215a5b3d03c0bc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a88ae0a4f03c2dcacd81b52096623d889" id="r_a88ae0a4f03c2dcacd81b52096623d889"><td class="memItemLeft" align="right" valign="top"><a id="a88ae0a4f03c2dcacd81b52096623d889" name="a88ae0a4f03c2dcacd81b52096623d889"></a>
|
||||
<a class="el" href="struct_r_s___msg_type_def.html">RS_MsgTypeDef</a> * </td><td class="memItemRight" valign="bottom"><b>pMessagePtr</b></td></tr>
|
||||
<tr class="separator:a88ae0a4f03c2dcacd81b52096623d889"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a669517eccd963ae4f9d2d577e2d0934f" id="r_a669517eccd963ae4f9d2d577e2d0934f"><td class="memItemLeft" align="right" valign="top"><a id="a669517eccd963ae4f9d2d577e2d0934f" name="a669517eccd963ae4f9d2d577e2d0934f"></a>
|
||||
uint8_t * </td><td class="memItemRight" valign="bottom"><b>pBufferPtr</b></td></tr>
|
||||
<tr class="separator:a669517eccd963ae4f9d2d577e2d0934f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a16caf9f00c09a4d54890da6e4fc4274b" id="r_a16caf9f00c09a4d54890da6e4fc4274b"><td class="memItemLeft" align="right" valign="top"><a id="a16caf9f00c09a4d54890da6e4fc4274b" name="a16caf9f00c09a4d54890da6e4fc4274b"></a>
|
||||
uint32_t </td><td class="memItemRight" valign="bottom"><b>RS_Message_Size</b></td></tr>
|
||||
<tr class="separator:a16caf9f00c09a4d54890da6e4fc4274b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0e36e9b1b63956cd293971aed1093181" id="r_a0e36e9b1b63956cd293971aed1093181"><td class="memItemLeft" align="right" valign="top"><a id="a0e36e9b1b63956cd293971aed1093181" name="a0e36e9b1b63956cd293971aed1093181"></a>
|
||||
UART_HandleTypeDef * </td><td class="memItemRight" valign="bottom"><b>huartx</b></td></tr>
|
||||
<tr class="separator:a0e36e9b1b63956cd293971aed1093181"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a910371de958804a12d90272976015b91" id="r_a910371de958804a12d90272976015b91"><td class="memItemLeft" align="right" valign="top"><a id="a910371de958804a12d90272976015b91" name="a910371de958804a12d90272976015b91"></a>
|
||||
TIM_HandleTypeDef * </td><td class="memItemRight" valign="bottom"><b>htimx</b></td></tr>
|
||||
<tr class="separator:a910371de958804a12d90272976015b91"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a5a3d42cab7d7603dc8d31be5c8645e02" id="r_a5a3d42cab7d7603dc8d31be5c8645e02"><td class="memItemLeft" align="right" valign="top"><a id="a5a3d42cab7d7603dc8d31be5c8645e02" name="a5a3d42cab7d7603dc8d31be5c8645e02"></a>
|
||||
RS_ModeTypeDef </td><td class="memItemRight" valign="bottom"><b>sRS_Mode</b></td></tr>
|
||||
<tr class="separator:a5a3d42cab7d7603dc8d31be5c8645e02"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a95952089da1c4c2eef20380db162bb77" id="r_a95952089da1c4c2eef20380db162bb77"><td class="memItemLeft" align="right" valign="top"><a id="a95952089da1c4c2eef20380db162bb77" name="a95952089da1c4c2eef20380db162bb77"></a>
|
||||
RS_ITModeTypeDef </td><td class="memItemRight" valign="bottom"><b>sRS_IT_Mode</b></td></tr>
|
||||
<tr class="separator:a95952089da1c4c2eef20380db162bb77"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:adc5c4a4075d22fc7cdd538d284c45158" id="r_adc5c4a4075d22fc7cdd538d284c45158"><td class="memItemLeft" align="right" valign="top"><a id="adc5c4a4075d22fc7cdd538d284c45158" name="adc5c4a4075d22fc7cdd538d284c45158"></a>
|
||||
uint32_t </td><td class="memItemRight" valign="bottom"><b>sRS_Timeout</b></td></tr>
|
||||
<tr class="separator:adc5c4a4075d22fc7cdd538d284c45158"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a08481653f3280f5486083bd696598634" id="r_a08481653f3280f5486083bd696598634"><td class="memItemLeft" align="right" valign="top"><a id="a08481653f3280f5486083bd696598634" name="a08481653f3280f5486083bd696598634"></a>
|
||||
RS_RXSizeTypeDef </td><td class="memItemRight" valign="bottom"><b>sRS_RX_Size_Mode</b></td></tr>
|
||||
<tr class="separator:a08481653f3280f5486083bd696598634"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0ab58800ad233c8d78c3f5bd84d5dd05" id="r_a0ab58800ad233c8d78c3f5bd84d5dd05"><td class="memItemLeft" align="right" valign="top"><a id="a0ab58800ad233c8d78c3f5bd84d5dd05" name="a0ab58800ad233c8d78c3f5bd84d5dd05"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fRX_Half</b>:1</td></tr>
|
||||
<tr class="separator:a0ab58800ad233c8d78c3f5bd84d5dd05"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a9e1f372e541cf388be0c52d47bb80cb8" id="r_a9e1f372e541cf388be0c52d47bb80cb8"><td class="memItemLeft" align="right" valign="top"><a id="a9e1f372e541cf388be0c52d47bb80cb8" name="a9e1f372e541cf388be0c52d47bb80cb8"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fRS_Busy</b>:1</td></tr>
|
||||
<tr class="separator:a9e1f372e541cf388be0c52d47bb80cb8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a947a1fe0d91ba0395187d18a14b505fb" id="r_a947a1fe0d91ba0395187d18a14b505fb"><td class="memItemLeft" align="right" valign="top"><a id="a947a1fe0d91ba0395187d18a14b505fb" name="a947a1fe0d91ba0395187d18a14b505fb"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fRX_Busy</b>:1</td></tr>
|
||||
<tr class="separator:a947a1fe0d91ba0395187d18a14b505fb"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a24ccf83bfa9917253d2ff36cc312df27" id="r_a24ccf83bfa9917253d2ff36cc312df27"><td class="memItemLeft" align="right" valign="top"><a id="a24ccf83bfa9917253d2ff36cc312df27" name="a24ccf83bfa9917253d2ff36cc312df27"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fTX_Busy</b>:1</td></tr>
|
||||
<tr class="separator:a24ccf83bfa9917253d2ff36cc312df27"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae79c8a604d2842548e685fce1635040c" id="r_ae79c8a604d2842548e685fce1635040c"><td class="memItemLeft" align="right" valign="top"><a id="ae79c8a604d2842548e685fce1635040c" name="ae79c8a604d2842548e685fce1635040c"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fRX_Done</b>:1</td></tr>
|
||||
<tr class="separator:ae79c8a604d2842548e685fce1635040c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a5b45936c5266e15b9daa67cbd1480706" id="r_a5b45936c5266e15b9daa67cbd1480706"><td class="memItemLeft" align="right" valign="top"><a id="a5b45936c5266e15b9daa67cbd1480706" name="a5b45936c5266e15b9daa67cbd1480706"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fTX_Done</b>:1</td></tr>
|
||||
<tr class="separator:a5b45936c5266e15b9daa67cbd1480706"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6909a2ee1bb3513505bbd4984ff591b5" id="r_a6909a2ee1bb3513505bbd4984ff591b5"><td class="memItemLeft" align="right" valign="top"><a id="a6909a2ee1bb3513505bbd4984ff591b5" name="a6909a2ee1bb3513505bbd4984ff591b5"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fMessageHandled</b>:1</td></tr>
|
||||
<tr class="separator:a6909a2ee1bb3513505bbd4984ff591b5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aec772d6a0db85220c5db8634ddf16120" id="r_aec772d6a0db85220c5db8634ddf16120"><td class="memItemLeft" align="right" valign="top"><a id="aec772d6a0db85220c5db8634ddf16120" name="aec772d6a0db85220c5db8634ddf16120"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fEchoResponse</b>:1</td></tr>
|
||||
<tr class="separator:aec772d6a0db85220c5db8634ddf16120"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0c3c3aee0342b80b75a782aec6d46c2e" id="r_a0c3c3aee0342b80b75a782aec6d46c2e"><td class="memItemLeft" align="right" valign="top"><a id="a0c3c3aee0342b80b75a782aec6d46c2e" name="a0c3c3aee0342b80b75a782aec6d46c2e"></a>
|
||||
unsigned </td><td class="memItemRight" valign="bottom"><b>fDeferredResponse</b>:1</td></tr>
|
||||
<tr class="separator:a0c3c3aee0342b80b75a782aec6d46c2e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a81db00ae327dbd10d04207c3db186fbf" id="r_a81db00ae327dbd10d04207c3db186fbf"><td class="memItemLeft" align="right" valign="top"><a id="a81db00ae327dbd10d04207c3db186fbf" name="a81db00ae327dbd10d04207c3db186fbf"></a>
|
||||
RS_StatusTypeDef </td><td class="memItemRight" valign="bottom"><b>RS_STATUS</b></td></tr>
|
||||
<tr class="separator:a81db00ae327dbd10d04207c3db186fbf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ac5e044058c7c85e15623836e8e832057" id="r_ac5e044058c7c85e15623836e8e832057"><td class="memItemLeft" align="right" valign="top"><a id="ac5e044058c7c85e15623836e8e832057" name="ac5e044058c7c85e15623836e8e832057"></a>
|
||||
RS_FunctonTypeDef </td><td class="memItemRight" valign="bottom"><b>RS_RESPONSE</b></td></tr>
|
||||
<tr class="separator:ac5e044058c7c85e15623836e8e832057"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Handle for RS communication. </p>
|
||||
<dl class="section note"><dt>Note</dt><dd>Prefixes: h - handle, s - settings, f - flag </dd></dl>
|
||||
</div><hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li><a class="el" href="rs__message_8h_source.html">rs_message.h</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: RS_MsgTypeDef Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle"><div class="title">RS_MsgTypeDef Struct Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr class="memitem:a6186caa23a7d17866abb7d27cb8d9b13" id="r_a6186caa23a7d17866abb7d27cb8d9b13"><td class="memItemLeft" align="right" valign="top"><a id="a6186caa23a7d17866abb7d27cb8d9b13" name="a6186caa23a7d17866abb7d27cb8d9b13"></a>
|
||||
uint8_t </td><td class="memItemRight" valign="bottom"><b>MbAddr</b></td></tr>
|
||||
<tr class="separator:a6186caa23a7d17866abb7d27cb8d9b13"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a49661162da2af9d2e939dfd8ccec633b" id="r_a49661162da2af9d2e939dfd8ccec633b"><td class="memItemLeft" align="right" valign="top"><a id="a49661162da2af9d2e939dfd8ccec633b" name="a49661162da2af9d2e939dfd8ccec633b"></a>
|
||||
RS_FunctonTypeDef </td><td class="memItemRight" valign="bottom"><b>Func_Code</b></td></tr>
|
||||
<tr class="separator:a49661162da2af9d2e939dfd8ccec633b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ac2fbbe9d6ed859cacb2928626be8f70d" id="r_ac2fbbe9d6ed859cacb2928626be8f70d"><td class="memItemLeft" align="right" valign="top"><a id="ac2fbbe9d6ed859cacb2928626be8f70d" name="ac2fbbe9d6ed859cacb2928626be8f70d"></a>
|
||||
uint8_t </td><td class="memItemRight" valign="bottom"><b>Except_Code</b></td></tr>
|
||||
<tr class="separator:ac2fbbe9d6ed859cacb2928626be8f70d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aba418f23e6ab48bb7fe6ff160373d10f" id="r_aba418f23e6ab48bb7fe6ff160373d10f"><td class="memItemLeft" align="right" valign="top"><a id="aba418f23e6ab48bb7fe6ff160373d10f" name="aba418f23e6ab48bb7fe6ff160373d10f"></a>
|
||||
uint16_t </td><td class="memItemRight" valign="bottom"><b>Addr</b></td></tr>
|
||||
<tr class="separator:aba418f23e6ab48bb7fe6ff160373d10f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aab19fca65df39b3dfc1161bf1abd2530" id="r_aab19fca65df39b3dfc1161bf1abd2530"><td class="memItemLeft" align="right" valign="top"><a id="aab19fca65df39b3dfc1161bf1abd2530" name="aab19fca65df39b3dfc1161bf1abd2530"></a>
|
||||
uint16_t </td><td class="memItemRight" valign="bottom"><b>Qnt</b></td></tr>
|
||||
<tr class="separator:aab19fca65df39b3dfc1161bf1abd2530"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a98b3d756f2da2ddac397749bee665e60" id="r_a98b3d756f2da2ddac397749bee665e60"><td class="memItemLeft" align="right" valign="top"><a id="a98b3d756f2da2ddac397749bee665e60" name="a98b3d756f2da2ddac397749bee665e60"></a>
|
||||
uint8_t </td><td class="memItemRight" valign="bottom"><b>ByteCnt</b></td></tr>
|
||||
<tr class="separator:a98b3d756f2da2ddac397749bee665e60"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:af808c7dd6b4ba12cf5e106f027cf324c" id="r_af808c7dd6b4ba12cf5e106f027cf324c"><td class="memItemLeft" align="right" valign="top"><a id="af808c7dd6b4ba12cf5e106f027cf324c" name="af808c7dd6b4ba12cf5e106f027cf324c"></a>
|
||||
uint16_t </td><td class="memItemRight" valign="bottom"><b>DATA</b> [DATA_MAX_SIZE]</td></tr>
|
||||
<tr class="separator:af808c7dd6b4ba12cf5e106f027cf324c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ab36aadc5b220463d41e442a39f3f13e8" id="r_ab36aadc5b220463d41e442a39f3f13e8"><td class="memItemLeft" align="right" valign="top"><a id="ab36aadc5b220463d41e442a39f3f13e8" name="ab36aadc5b220463d41e442a39f3f13e8"></a>
|
||||
uint16_t </td><td class="memItemRight" valign="bottom"><b>MB_CRC</b></td></tr>
|
||||
<tr class="separator:ab36aadc5b220463d41e442a39f3f13e8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li><a class="el" href="modbus_8h_source.html">modbus.h</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,98 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: TIM_SettingsTypeDef Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle"><div class="title">TIM_SettingsTypeDef Struct Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr class="memitem:a910371de958804a12d90272976015b91" id="r_a910371de958804a12d90272976015b91"><td class="memItemLeft" align="right" valign="top"><a id="a910371de958804a12d90272976015b91" name="a910371de958804a12d90272976015b91"></a>
|
||||
TIM_HandleTypeDef * </td><td class="memItemRight" valign="bottom"><b>htimx</b></td></tr>
|
||||
<tr class="separator:a910371de958804a12d90272976015b91"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a8d6c153e149fb61b28a4eb94f1e6a939" id="r_a8d6c153e149fb61b28a4eb94f1e6a939"><td class="memItemLeft" align="right" valign="top"><a id="a8d6c153e149fb61b28a4eb94f1e6a939" name="a8d6c153e149fb61b28a4eb94f1e6a939"></a>
|
||||
TIM_ITModeTypeDef </td><td class="memItemRight" valign="bottom"><b>TIM_IT_MODE</b>:1</td></tr>
|
||||
<tr class="separator:a8d6c153e149fb61b28a4eb94f1e6a939"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li><a class="el" href="tim__general_8h_source.html">tim_general.h</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: UART_SettingsTypeDef Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Data Fields</a> </div>
|
||||
<div class="headertitle"><div class="title">UART_SettingsTypeDef Struct Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
|
||||
Data Fields</h2></td></tr>
|
||||
<tr class="memitem:a0e36e9b1b63956cd293971aed1093181" id="r_a0e36e9b1b63956cd293971aed1093181"><td class="memItemLeft" align="right" valign="top"><a id="a0e36e9b1b63956cd293971aed1093181" name="a0e36e9b1b63956cd293971aed1093181"></a>
|
||||
UART_HandleTypeDef * </td><td class="memItemRight" valign="bottom"><b>huartx</b></td></tr>
|
||||
<tr class="separator:a0e36e9b1b63956cd293971aed1093181"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a2320e05e7b39955a916a627a7a27a332" id="r_a2320e05e7b39955a916a627a7a27a332"><td class="memItemLeft" align="right" valign="top"><a id="a2320e05e7b39955a916a627a7a27a332" name="a2320e05e7b39955a916a627a7a27a332"></a>
|
||||
DMA_HandleTypeDef * </td><td class="memItemRight" valign="bottom"><b>hdma_uartx_rx</b></td></tr>
|
||||
<tr class="separator:a2320e05e7b39955a916a627a7a27a332"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a1cb502d7339fa12f24109da591102eb2" id="r_a1cb502d7339fa12f24109da591102eb2"><td class="memItemLeft" align="right" valign="top"><a id="a1cb502d7339fa12f24109da591102eb2" name="a1cb502d7339fa12f24109da591102eb2"></a>
|
||||
GPIO_TypeDef * </td><td class="memItemRight" valign="bottom"><b>GPIOx</b></td></tr>
|
||||
<tr class="separator:a1cb502d7339fa12f24109da591102eb2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:abaeeb4afab801fd79f4ec7d2a5dea905" id="r_abaeeb4afab801fd79f4ec7d2a5dea905"><td class="memItemLeft" align="right" valign="top"><a id="abaeeb4afab801fd79f4ec7d2a5dea905" name="abaeeb4afab801fd79f4ec7d2a5dea905"></a>
|
||||
uint16_t </td><td class="memItemRight" valign="bottom"><b>GPIO_PIN_RX</b></td></tr>
|
||||
<tr class="separator:abaeeb4afab801fd79f4ec7d2a5dea905"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a94c85d6469c4e147ad9eb64c90c65361" id="r_a94c85d6469c4e147ad9eb64c90c65361"><td class="memItemLeft" align="right" valign="top"><a id="a94c85d6469c4e147ad9eb64c90c65361" name="a94c85d6469c4e147ad9eb64c90c65361"></a>
|
||||
uint16_t </td><td class="memItemRight" valign="bottom"><b>GPIO_PIN_TX</b></td></tr>
|
||||
<tr class="separator:a94c85d6469c4e147ad9eb64c90c65361"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a33f6f0ee5f51c9743f371c9f0cd150cd" id="r_a33f6f0ee5f51c9743f371c9f0cd150cd"><td class="memItemLeft" align="right" valign="top"><a id="a33f6f0ee5f51c9743f371c9f0cd150cd" name="a33f6f0ee5f51c9743f371c9f0cd150cd"></a>
|
||||
DMA_Stream_TypeDef * </td><td class="memItemRight" valign="bottom"><b>DMAChannel</b></td></tr>
|
||||
<tr class="separator:a33f6f0ee5f51c9743f371c9f0cd150cd"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a368dd11dde59368be144107b6027e892" id="r_a368dd11dde59368be144107b6027e892"><td class="memItemLeft" align="right" valign="top"><a id="a368dd11dde59368be144107b6027e892" name="a368dd11dde59368be144107b6027e892"></a>
|
||||
uint32_t </td><td class="memItemRight" valign="bottom"><b>DMA_CHANNEL_X</b></td></tr>
|
||||
<tr class="separator:a368dd11dde59368be144107b6027e892"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li><a class="el" href="rs__message_8h_source.html">rs_message.h</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
BIN
научка/code/pwm_motor_control/Modbus/html/sync_off.png
Normal file
|
After Width: | Height: | Size: 853 B |
BIN
научка/code/pwm_motor_control/Modbus/html/sync_on.png
Normal file
|
After Width: | Height: | Size: 845 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_a.png
Normal file
|
After Width: | Height: | Size: 142 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_ad.png
Normal file
|
After Width: | Height: | Size: 135 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_b.png
Normal file
|
After Width: | Height: | Size: 169 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_bd.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_h.png
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_hd.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_s.png
Normal file
|
After Width: | Height: | Size: 184 B |
BIN
научка/code/pwm_motor_control/Modbus/html/tab_sd.png
Normal file
|
After Width: | Height: | Size: 188 B |
1
научка/code/pwm_motor_control/Modbus/html/tabs.css
Normal file
@@ -0,0 +1,145 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>My Project: tim_general.h Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">My Project<span id="projectnumber"> 1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(0); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">tim_general.h</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef __TIM_USER_H_</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define __TIM_USER_H_</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#define HAL_TIM_MODULE_ENABLED </span><span class="comment">// need to uncomment this define in stm32f4xx_hal_conf.h</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">//#define USE_TIM1</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">//#define USE_TIM2</span></div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">//#define USE_TIM3</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">//#define USE_TIM4</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//#define USE_TIM5</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">//#define USE_TIM6</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">//#define USE_TIM7</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">//#define USE_TIM8</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">//#define USE_TIM9</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">//#define USE_TIM10</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">//#define USE_TIM11</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">//#define USE_TIM12</span></div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">//#define USE_TIM13</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">//#define USE_TIM14</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">/* note: used uart defines in modbus.h */</span></div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include "modbus.h"</span> </div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include "stm32f4xx_hal.h"</span></div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">typedef</span> <span class="keyword">enum</span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span>{</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> TIM_IT_DISABLE = 0x00,</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> TIM_IT_ENABLE = 0x01,</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>}TIM_ITModeTypeDef;</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">//typedef enum</span></div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">//{</span></div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">// TIM_1MS_BASE = 0xFFFF,</span></div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment">// TIM_1US_BASE = 0xFFFF-1,</span></div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment">//}TIM_TickBaseTypeDef;</span></div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html"> 42</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><span class="comment">// struct with settings for custom function</span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span>{</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> TIM_HandleTypeDef *htimx;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment">// TIM_TickBaseTypeDef TickBase;</span></div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment">// TIM_TickBaseTypeDef TimPeriod;</span></div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> TIM_ITModeTypeDef TIM_IT_MODE:1;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>}<a class="code hl_struct" href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a>;</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>HAL_StatusTypeDef User_TIM_Init(<a class="code hl_struct" href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a>* stim);</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keywordtype">void</span> User_TIM_Base_MspInit(TIM_HandleTypeDef* htim, TIM_ITModeTypeDef it_mode);</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="preprocessor">#endif </span><span class="comment">// __TIM_BOOT_H</span></div>
|
||||
<div class="ttc" id="astruct_t_i_m___settings_type_def_html"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a></div><div class="ttdef"><b>Definition</b> tim_general.h:43</div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
27
научка/code/pwm_motor_control/Modbus/latex/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
LATEX_CMD?=pdflatex
|
||||
MKIDX_CMD?=makeindex
|
||||
BIBTEX_CMD?=bibtex
|
||||
LATEX_COUNT?=8
|
||||
MANUAL_FILE?=refman
|
||||
|
||||
all: $(MANUAL_FILE).pdf
|
||||
|
||||
pdf: $(MANUAL_FILE).pdf
|
||||
|
||||
$(MANUAL_FILE).pdf: clean $(MANUAL_FILE).tex
|
||||
$(LATEX_CMD) $(MANUAL_FILE)
|
||||
$(MKIDX_CMD) $(MANUAL_FILE).idx
|
||||
$(LATEX_CMD) $(MANUAL_FILE)
|
||||
latex_count=$(LATEX_COUNT) ; \
|
||||
while grep -E -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\
|
||||
do \
|
||||
echo "Rerunning latex...." ;\
|
||||
$(LATEX_CMD) $(MANUAL_FILE) ;\
|
||||
latex_count=`expr $$latex_count - 1` ;\
|
||||
done
|
||||
$(MKIDX_CMD) $(MANUAL_FILE).idx
|
||||
$(LATEX_CMD) $(MANUAL_FILE)
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl $(MANUAL_FILE).pdf
|
||||
7
научка/code/pwm_motor_control/Modbus/latex/annotated.tex
Normal file
@@ -0,0 +1,7 @@
|
||||
\doxysection{Data Structures}
|
||||
Here are the data structures with brief descriptions\+:\begin{DoxyCompactList}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \\*Handle for RS communication }{\pageref{struct_r_s___handle_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} }{\pageref{struct_r_s___msg_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\+\_\+\+Settings\+Type\+Def}} }{\pageref{struct_t_i_m___settings_type_def}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} }{\pageref{struct_u_a_r_t___settings_type_def}}{}
|
||||
\end{DoxyCompactList}
|
||||
@@ -0,0 +1,14 @@
|
||||
\doxysection{crc\+\_\+algs.\+h}
|
||||
\hypertarget{crc__algs_8h_source}{}\label{crc__algs_8h_source}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#include\ "{}main.h"{}}}
|
||||
\DoxyCodeLine{00002\ }
|
||||
\DoxyCodeLine{00003\ \textcolor{comment}{//\ extern\ here\ to\ use\ in\ bootloader.c}}
|
||||
\DoxyCodeLine{00004\ \textcolor{keyword}{extern}\ uint32\_t\ CRC\_calc;}
|
||||
\DoxyCodeLine{00005\ \textcolor{keyword}{extern}\ uint32\_t\ CRC\_ref;}
|
||||
\DoxyCodeLine{00006\ }
|
||||
\DoxyCodeLine{00007\ }
|
||||
\DoxyCodeLine{00008\ uint16\_t\ crc16(uint8\_t\ *data,\ uint32\_t\ data\_size);}
|
||||
\DoxyCodeLine{00009\ uint32\_t\ crc32(uint8\_t\ *data,\ uint32\_t\ data\_size);}
|
||||
|
||||
\end{DoxyCode}
|
||||
694
научка/code/pwm_motor_control/Modbus/latex/doxygen.sty
Normal file
@@ -0,0 +1,694 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{doxygen}
|
||||
|
||||
% Packages used by this style file
|
||||
\RequirePackage{alltt}
|
||||
%%\RequirePackage{array} %% moved to refman.tex due to workaround for LaTex 2019 version and unmaintained tabu package
|
||||
\RequirePackage{calc}
|
||||
\RequirePackage{float}
|
||||
%%\RequirePackage{ifthen} %% moved to refman.tex due to workaround for LaTex 2019 version and unmaintained tabu package
|
||||
\RequirePackage{verbatim}
|
||||
\RequirePackage[table]{xcolor}
|
||||
\RequirePackage{longtable_doxygen}
|
||||
\RequirePackage{tabu_doxygen}
|
||||
\RequirePackage{fancyvrb}
|
||||
\RequirePackage{tabularx}
|
||||
\RequirePackage{multicol}
|
||||
\RequirePackage{multirow}
|
||||
\RequirePackage{hanging}
|
||||
\RequirePackage{ifpdf}
|
||||
\RequirePackage{adjustbox}
|
||||
\RequirePackage{amssymb}
|
||||
\RequirePackage{stackengine}
|
||||
\RequirePackage{enumitem}
|
||||
\RequirePackage{alphalph}
|
||||
\RequirePackage[normalem]{ulem} % for strikeout, but don't modify emphasis
|
||||
|
||||
%---------- Internal commands used in this style file ----------------
|
||||
|
||||
\newcommand{\ensurespace}[1]{%
|
||||
\begingroup%
|
||||
\setlength{\dimen@}{#1}%
|
||||
\vskip\z@\@plus\dimen@%
|
||||
\penalty -100\vskip\z@\@plus -\dimen@%
|
||||
\vskip\dimen@%
|
||||
\penalty 9999%
|
||||
\vskip -\dimen@%
|
||||
\vskip\z@skip% hide the previous |\vskip| from |\addvspace|
|
||||
\endgroup%
|
||||
}
|
||||
|
||||
\newcommand{\DoxyHorRuler}[1]{%
|
||||
\setlength{\parskip}{0ex plus 0ex minus 0ex}%
|
||||
\ifthenelse{#1=0}%
|
||||
{%
|
||||
\hrule%
|
||||
}%
|
||||
{%
|
||||
\hrulefilll%
|
||||
}%
|
||||
}
|
||||
\newcommand{\DoxyLabelFont}{}
|
||||
\newcommand{\entrylabel}[1]{%
|
||||
{%
|
||||
\parbox[b]{\labelwidth-4pt}{%
|
||||
\makebox[0pt][l]{\DoxyLabelFont#1}%
|
||||
\vspace{1.5\baselineskip}%
|
||||
}%
|
||||
}%
|
||||
}
|
||||
|
||||
\newenvironment{DoxyDesc}[1]{%
|
||||
\ensurespace{4\baselineskip}%
|
||||
\begin{list}{}{%
|
||||
\settowidth{\labelwidth}{20pt}%
|
||||
%\setlength{\parsep}{0pt}%
|
||||
\setlength{\itemsep}{0pt}%
|
||||
\setlength{\leftmargin}{\labelwidth+\labelsep}%
|
||||
\renewcommand{\makelabel}{\entrylabel}%
|
||||
}%
|
||||
\item[#1]%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
\newsavebox{\xrefbox}
|
||||
\newlength{\xreflength}
|
||||
\newcommand{\xreflabel}[1]{%
|
||||
\sbox{\xrefbox}{#1}%
|
||||
\setlength{\xreflength}{\wd\xrefbox}%
|
||||
\ifthenelse{\xreflength>\labelwidth}{%
|
||||
\begin{minipage}{\textwidth}%
|
||||
\setlength{\parindent}{0pt}%
|
||||
\hangindent=15pt\bfseries #1\vspace{1.2\itemsep}%
|
||||
\end{minipage}%
|
||||
}{%
|
||||
\parbox[b]{\labelwidth}{\makebox[0pt][l]{\textbf{#1}}}%
|
||||
}%
|
||||
}
|
||||
|
||||
%---------- Commands used by doxygen LaTeX output generator ----------
|
||||
|
||||
% Used by <pre> ... </pre>
|
||||
\newenvironment{DoxyPre}{%
|
||||
\small%
|
||||
\begin{alltt}%
|
||||
}{%
|
||||
\end{alltt}%
|
||||
\normalsize%
|
||||
}
|
||||
% Necessary for redefining not defined characters, i.e. "Replacement Character" in tex output.
|
||||
\newlength{\CodeWidthChar}
|
||||
\newlength{\CodeHeightChar}
|
||||
\settowidth{\CodeWidthChar}{?}
|
||||
\settoheight{\CodeHeightChar}{?}
|
||||
% Necessary for hanging indent
|
||||
\newlength{\DoxyCodeWidth}
|
||||
|
||||
\newcommand\DoxyCodeLine[1]{
|
||||
\ifthenelse{\equal{\detokenize{#1}}{}}
|
||||
{
|
||||
\vspace*{\baselineskip}
|
||||
}
|
||||
{
|
||||
\hangpara{\DoxyCodeWidth}{1}{#1}\par
|
||||
}
|
||||
}
|
||||
|
||||
\newcommand\NiceSpace{%
|
||||
\discretionary{}{\kern\fontdimen2\font}{\kern\fontdimen2\font}%
|
||||
}
|
||||
|
||||
% Used by @code ... @endcode
|
||||
\newenvironment{DoxyCode}[1]{%
|
||||
\par%
|
||||
\scriptsize%
|
||||
\normalfont\ttfamily%
|
||||
\rightskip0pt plus 1fil%
|
||||
\settowidth{\DoxyCodeWidth}{000000}%
|
||||
\settowidth{\CodeWidthChar}{?}%
|
||||
\settoheight{\CodeHeightChar}{?}%
|
||||
\setlength{\parskip}{0ex plus 0ex minus 0ex}%
|
||||
\ifthenelse{\equal{#1}{0}}
|
||||
{
|
||||
{\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces%
|
||||
}
|
||||
{
|
||||
{\lccode`~32 \lowercase{\global\let~}}\obeyspaces%
|
||||
}
|
||||
|
||||
}{%
|
||||
\normalfont%
|
||||
\normalsize%
|
||||
\settowidth{\CodeWidthChar}{?}%
|
||||
\settoheight{\CodeHeightChar}{?}%
|
||||
}
|
||||
|
||||
% Redefining not defined characters, i.e. "Replacement Character" in tex output.
|
||||
\def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{%
|
||||
\textcolor{white}{\sffamily\bfseries\small ?}}{%
|
||||
\rotatebox{45}{$\blacksquare$}}}}
|
||||
|
||||
% Used by @example, @include, @includelineno and @dontinclude
|
||||
\newenvironment{DoxyCodeInclude}[1]{%
|
||||
\DoxyCode{#1}%
|
||||
}{%
|
||||
\endDoxyCode%
|
||||
}
|
||||
|
||||
% Used by @verbatim ... @endverbatim
|
||||
\newenvironment{DoxyVerb}{%
|
||||
\par%
|
||||
\footnotesize%
|
||||
\verbatim%
|
||||
}{%
|
||||
\endverbatim%
|
||||
\normalsize%
|
||||
}
|
||||
|
||||
% Used by @verbinclude
|
||||
\newenvironment{DoxyVerbInclude}{%
|
||||
\DoxyVerb%
|
||||
}{%
|
||||
\endDoxyVerb%
|
||||
}
|
||||
|
||||
% Used by numbered lists (using '-#' or <ol> ... </ol>)
|
||||
\setlistdepth{12}
|
||||
\newlist{DoxyEnumerate}{enumerate}{12}
|
||||
\setlist[DoxyEnumerate,1]{label=\arabic*.}
|
||||
\setlist[DoxyEnumerate,2]{label=(\enumalphalphcnt*)}
|
||||
\setlist[DoxyEnumerate,3]{label=\roman*.}
|
||||
\setlist[DoxyEnumerate,4]{label=\enumAlphAlphcnt*.}
|
||||
\setlist[DoxyEnumerate,5]{label=\arabic*.}
|
||||
\setlist[DoxyEnumerate,6]{label=(\enumalphalphcnt*)}
|
||||
\setlist[DoxyEnumerate,7]{label=\roman*.}
|
||||
\setlist[DoxyEnumerate,8]{label=\enumAlphAlphcnt*.}
|
||||
\setlist[DoxyEnumerate,9]{label=\arabic*.}
|
||||
\setlist[DoxyEnumerate,10]{label=(\enumalphalphcnt*)}
|
||||
\setlist[DoxyEnumerate,11]{label=\roman*.}
|
||||
\setlist[DoxyEnumerate,12]{label=\enumAlphAlphcnt*.}
|
||||
|
||||
% Used by bullet lists (using '-', @li, @arg, or <ul> ... </ul>)
|
||||
\setlistdepth{12}
|
||||
\newlist{DoxyItemize}{itemize}{12}
|
||||
\setlist[DoxyItemize]{label=\textperiodcentered}
|
||||
|
||||
\setlist[DoxyItemize,1]{label=\textbullet}
|
||||
\setlist[DoxyItemize,2]{label=\normalfont\bfseries \textendash}
|
||||
\setlist[DoxyItemize,3]{label=\textasteriskcentered}
|
||||
\setlist[DoxyItemize,4]{label=\textperiodcentered}
|
||||
|
||||
% Used by description lists (using <dl> ... </dl>)
|
||||
\newenvironment{DoxyDescription}{%
|
||||
\description%
|
||||
}{%
|
||||
\enddescription%
|
||||
}
|
||||
|
||||
% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc
|
||||
% (only if caption is specified)
|
||||
\newenvironment{DoxyImage}{%
|
||||
\begin{figure}[H]%
|
||||
\centering%
|
||||
}{%
|
||||
\end{figure}%
|
||||
}
|
||||
|
||||
% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc
|
||||
% (only if no caption is specified)
|
||||
\newenvironment{DoxyImageNoCaption}{%
|
||||
\begin{center}%
|
||||
}{%
|
||||
\end{center}%
|
||||
}
|
||||
|
||||
% Used by @image
|
||||
% (only if inline is specified)
|
||||
\newenvironment{DoxyInlineImage}{%
|
||||
}{%
|
||||
}
|
||||
|
||||
% Used by @attention
|
||||
\newenvironment{DoxyAttention}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @author and @authors
|
||||
\newenvironment{DoxyAuthor}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @date
|
||||
\newenvironment{DoxyDate}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @invariant
|
||||
\newenvironment{DoxyInvariant}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @note
|
||||
\newenvironment{DoxyNote}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @post
|
||||
\newenvironment{DoxyPostcond}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @pre
|
||||
\newenvironment{DoxyPrecond}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @copyright
|
||||
\newenvironment{DoxyCopyright}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @remark
|
||||
\newenvironment{DoxyRemark}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @return and @returns
|
||||
\newenvironment{DoxyReturn}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @since
|
||||
\newenvironment{DoxySince}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @see
|
||||
\newenvironment{DoxySeeAlso}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @version
|
||||
\newenvironment{DoxyVersion}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @warning
|
||||
\newenvironment{DoxyWarning}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by @par and @paragraph
|
||||
\newenvironment{DoxyParagraph}[1]{%
|
||||
\begin{DoxyDesc}{#1}%
|
||||
}{%
|
||||
\end{DoxyDesc}%
|
||||
}
|
||||
|
||||
% Used by parameter lists
|
||||
\newenvironment{DoxyParams}[2][]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\ifthenelse{\equal{#1}{}}%
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description
|
||||
{\ifthenelse{\equal{#1}{1}}%
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc
|
||||
{\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc
|
||||
}
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for fields of simple structs
|
||||
\newenvironment{DoxyFields}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}%
|
||||
\multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for fields simple class style enums
|
||||
\newenvironment{DoxyEnumFields}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for parameters within a detailed function description
|
||||
\newenvironment{DoxyParamCaption}{%
|
||||
\renewcommand{\item}[2][]{\\ \hspace*{2.0cm} ##1 {\em ##2}}%
|
||||
}{%
|
||||
}
|
||||
|
||||
% Used by return value lists
|
||||
\newenvironment{DoxyRetVals}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used by exception lists
|
||||
\newenvironment{DoxyExceptions}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used by template parameter lists
|
||||
\newenvironment{DoxyTemplParams}[1]{%
|
||||
\tabulinesep=1mm%
|
||||
\par%
|
||||
\begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endfirsthead%
|
||||
\multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]%
|
||||
\hline%
|
||||
\endhead%
|
||||
}{%
|
||||
\end{longtabu*}%
|
||||
\vspace{6pt}%
|
||||
}
|
||||
|
||||
% Used for member lists
|
||||
\newenvironment{DoxyCompactItemize}{%
|
||||
\begin{itemize}%
|
||||
\setlength{\itemsep}{-3pt}%
|
||||
\setlength{\parsep}{0pt}%
|
||||
\setlength{\topsep}{0pt}%
|
||||
\setlength{\partopsep}{0pt}%
|
||||
}{%
|
||||
\end{itemize}%
|
||||
}
|
||||
|
||||
% Used for member descriptions
|
||||
\newenvironment{DoxyCompactList}{%
|
||||
\begin{list}{}{%
|
||||
\setlength{\leftmargin}{0.5cm}%
|
||||
\setlength{\itemsep}{0pt}%
|
||||
\setlength{\parsep}{0pt}%
|
||||
\setlength{\topsep}{0pt}%
|
||||
\renewcommand{\makelabel}{\hfill}%
|
||||
}%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used for reference lists (@bug, @deprecated, @todo, etc.)
|
||||
\newenvironment{DoxyRefList}{%
|
||||
\begin{list}{}{%
|
||||
\setlength{\labelwidth}{10pt}%
|
||||
\setlength{\leftmargin}{\labelwidth}%
|
||||
\addtolength{\leftmargin}{\labelsep}%
|
||||
\renewcommand{\makelabel}{\xreflabel}%
|
||||
}%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used by @bug, @deprecated, @todo, etc.
|
||||
\newenvironment{DoxyRefDesc}[1]{%
|
||||
\begin{list}{}{%
|
||||
\renewcommand\makelabel[1]{\textbf{##1}}%
|
||||
\settowidth\labelwidth{\makelabel{#1}}%
|
||||
\setlength\leftmargin{\labelwidth+\labelsep}%
|
||||
}%
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used by parameter lists and simple sections
|
||||
\newenvironment{Desc}
|
||||
{\begin{list}{}{%
|
||||
\settowidth{\labelwidth}{20pt}%
|
||||
\setlength{\parsep}{0pt}%
|
||||
\setlength{\itemsep}{0pt}%
|
||||
\setlength{\leftmargin}{\labelwidth+\labelsep}%
|
||||
\renewcommand{\makelabel}{\entrylabel}%
|
||||
}
|
||||
}{%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used by tables
|
||||
\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}%
|
||||
\newenvironment{TabularC}[1]%
|
||||
{\tabulinesep=1mm
|
||||
\begin{longtabu*}spread 0pt [c]{*#1{|X[-1]}|}}%
|
||||
{\end{longtabu*}\par}%
|
||||
|
||||
\newenvironment{TabularNC}[1]%
|
||||
{\begin{tabu}spread 0pt [l]{*#1{|X[-1]}|}}%
|
||||
{\end{tabu}\par}%
|
||||
|
||||
% Used for member group headers
|
||||
\newenvironment{Indent}{%
|
||||
\begin{list}{}{%
|
||||
\setlength{\leftmargin}{0.5cm}%
|
||||
}%
|
||||
\item[]\ignorespaces%
|
||||
}{%
|
||||
\unskip%
|
||||
\end{list}%
|
||||
}
|
||||
|
||||
% Used when hyperlinks are turned on
|
||||
\newcommand{\doxylink}[2]{%
|
||||
\mbox{\hyperlink{#1}{#2}}%
|
||||
}
|
||||
|
||||
% Used when hyperlinks are turned on
|
||||
% Third argument is the SectionType, see the doxygen internal
|
||||
% documentation for the values (relevant: Page ... Subsubsection).
|
||||
\newcommand{\doxysectlink}[3]{%
|
||||
\mbox{\hyperlink{#1}{#2}}%
|
||||
}
|
||||
% Used when hyperlinks are turned off
|
||||
\newcommand{\doxyref}[3]{%
|
||||
\textbf{#1} (\textnormal{#2}\,\pageref{#3})%
|
||||
}
|
||||
|
||||
% Used when hyperlinks are turned off
|
||||
% Fourth argument is the SectionType, see the doxygen internal
|
||||
% documentation for the values (relevant: Page ... Subsubsection).
|
||||
\newcommand{\doxysectref}[4]{%
|
||||
\textbf{#1} (\textnormal{#2}\,\pageref{#3})%
|
||||
}
|
||||
|
||||
% Used to link to a table when hyperlinks are turned on
|
||||
\newcommand{\doxytablelink}[2]{%
|
||||
\ref{#1}%
|
||||
}
|
||||
|
||||
% Used to link to a table when hyperlinks are turned off
|
||||
\newcommand{\doxytableref}[3]{%
|
||||
\ref{#3}%
|
||||
}
|
||||
|
||||
% Used by @addindex
|
||||
\newcommand{\lcurly}{\{}
|
||||
\newcommand{\rcurly}{\}}
|
||||
|
||||
% Colors used for syntax highlighting
|
||||
\definecolor{comment}{rgb}{0.5,0.0,0.0}
|
||||
\definecolor{keyword}{rgb}{0.0,0.5,0.0}
|
||||
\definecolor{keywordtype}{rgb}{0.38,0.25,0.125}
|
||||
\definecolor{keywordflow}{rgb}{0.88,0.5,0.0}
|
||||
\definecolor{preprocessor}{rgb}{0.5,0.38,0.125}
|
||||
\definecolor{stringliteral}{rgb}{0.0,0.125,0.25}
|
||||
\definecolor{charliteral}{rgb}{0.0,0.5,0.5}
|
||||
\definecolor{xmlcdata}{rgb}{0.0,0.0,0.0}
|
||||
\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0}
|
||||
\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43}
|
||||
\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0}
|
||||
\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0}
|
||||
|
||||
% Color used for table heading
|
||||
\newcommand{\tableheadbgcolor}{lightgray}%
|
||||
|
||||
% Version of hypertarget with correct landing location
|
||||
\newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
|
||||
|
||||
% possibility to have sections etc. be within the margins
|
||||
% unfortunately had to copy part of book.cls and add \raggedright
|
||||
\makeatletter
|
||||
\newcounter{subsubsubsection}[subsubsection]
|
||||
\newcounter{subsubsubsubsection}[subsubsubsection]
|
||||
\newcounter{subsubsubsubsubsection}[subsubsubsubsection]
|
||||
\newcounter{subsubsubsubsubsubsection}[subsubsubsubsubsection]
|
||||
\renewcommand{\thesubsubsubsection}{\thesubsubsection.\arabic{subsubsubsection}}
|
||||
\renewcommand{\thesubsubsubsubsection}{\thesubsubsubsection.\arabic{subsubsubsubsection}}
|
||||
\renewcommand{\thesubsubsubsubsubsection}{\thesubsubsubsubsection.\arabic{subsubsubsubsubsection}}
|
||||
\renewcommand{\thesubsubsubsubsubsubsection}{\thesubsubsubsubsubsection.\arabic{subsubsubsubsubsubsection}}
|
||||
\newcommand{\subsubsubsectionmark}[1]{}
|
||||
\newcommand{\subsubsubsubsectionmark}[1]{}
|
||||
\newcommand{\subsubsubsubsubsectionmark}[1]{}
|
||||
\newcommand{\subsubsubsubsubsubsectionmark}[1]{}
|
||||
\def\toclevel@subsubsubsection{4}
|
||||
\def\toclevel@subsubsubsubsection{5}
|
||||
\def\toclevel@subsubsubsubsubsection{6}
|
||||
\def\toclevel@subsubsubsubsubsubsection{7}
|
||||
\def\toclevel@paragraph{8}
|
||||
\def\toclevel@subparagraph{9}
|
||||
|
||||
\newcommand\doxysection{\@startsection {section}{1}{\z@}%
|
||||
{-3.5ex \@plus -1ex \@minus -.2ex}%
|
||||
{2.3ex \@plus.2ex}%
|
||||
{\raggedright\normalfont\Large\bfseries}}
|
||||
\newcommand\doxysubsection{\@startsection{subsection}{2}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\large\bfseries}}
|
||||
\newcommand\doxysubsubsection{\@startsection{subsubsection}{3}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsection{\@startsection{subsubsubsection}{4}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsubsection{\@startsection{subsubsubsubsection}{5}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsubsubsection{\@startsection{subsubsubsubsubsection}{6}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubsubsubsubsubsubsection{\@startsection{subsubsubsubsubsubsection}{7}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxyparagraph{\@startsection{paragraph}{8}{\z@}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
\newcommand\doxysubparagraph{\@startsection{subparagraph}{9}{\parindent}%
|
||||
{-3.25ex\@plus -1ex \@minus -.2ex}%
|
||||
{1.5ex \@plus .2ex}%
|
||||
{\raggedright\normalfont\normalsize\bfseries}}
|
||||
|
||||
\newcommand\l@subsubsubsection{\@dottedtocline{4}{6.1em}{7.8em}}
|
||||
\newcommand\l@subsubsubsubsection{\@dottedtocline{5}{6.1em}{9.4em}}
|
||||
\newcommand\l@subsubsubsubsubsection{\@dottedtocline{6}{6.1em}{11em}}
|
||||
\newcommand\l@subsubsubsubsubsubsection{\@dottedtocline{7}{6.1em}{12.6em}}
|
||||
\renewcommand\l@paragraph{\@dottedtocline{8}{6.1em}{14.2em}}
|
||||
\renewcommand\l@subparagraph{\@dottedtocline{9}{6.1em}{15.8em}}
|
||||
\makeatother
|
||||
% the sectsty doesn't look to be maintained but gives, in our case, some warning like:
|
||||
% LaTeX Warning: Command \underline has changed.
|
||||
% Check if current package is valid.
|
||||
% unfortunately had to copy the relevant part
|
||||
\newcommand*{\doxypartfont} [1]
|
||||
{\gdef\SS@partnumberfont{\SS@sectid{0}\SS@nopart\SS@makeulinepartchap#1}
|
||||
\gdef\SS@parttitlefont{\SS@sectid{0}\SS@titlepart\SS@makeulinepartchap#1}}
|
||||
\newcommand*{\doxychapterfont} [1]
|
||||
{\gdef\SS@chapnumfont{\SS@sectid{1}\SS@nopart\SS@makeulinepartchap#1}
|
||||
\gdef\SS@chaptitlefont{\SS@sectid{1}\SS@titlepart\SS@makeulinepartchap#1}}
|
||||
\newcommand*{\doxysectionfont} [1]
|
||||
{\gdef\SS@sectfont{\SS@sectid{2}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxysubsectionfont} [1]
|
||||
{\gdef\SS@subsectfont{\SS@sectid{3}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxysubsubsectionfont} [1]
|
||||
{\gdef\SS@subsubsectfont{\SS@sectid{4}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxyparagraphfont} [1]
|
||||
{\gdef\SS@parafont{\SS@sectid{5}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxysubparagraphfont} [1]
|
||||
{\gdef\SS@subparafont{\SS@sectid{6}\SS@rr\SS@makeulinesect#1}}
|
||||
\newcommand*{\doxyminisecfont} [1]
|
||||
{\gdef\SS@minisecfont{\SS@sectid{7}\SS@rr\SS@makeulinepartchap#1}}
|
||||
\newcommand*{\doxyallsectionsfont} [1] {\doxypartfont{#1}%
|
||||
\doxychapterfont{#1}%
|
||||
\doxysectionfont{#1}%
|
||||
\doxysubsectionfont{#1}%
|
||||
\doxysubsubsectionfont{#1}%
|
||||
\doxyparagraphfont{#1}%
|
||||
\doxysubparagraphfont{#1}%
|
||||
\doxyminisecfont{#1}}%
|
||||
% Define caption that is also suitable in a table
|
||||
\makeatletter
|
||||
\def\doxyfigcaption{%
|
||||
\H@refstepcounter{figure}%
|
||||
\@dblarg{\@caption{figure}}}
|
||||
\makeatother
|
||||
|
||||
% Define alpha enumarative names for counters > 26
|
||||
\makeatletter
|
||||
\def\enumalphalphcnt#1{\expandafter\@enumalphalphcnt\csname c@#1\endcsname}
|
||||
\def\@enumalphalphcnt#1{\alphalph{#1}}
|
||||
\def\enumAlphAlphcnt#1{\expandafter\@enumAlphAlphcnt\csname c@#1\endcsname}
|
||||
\def\@enumAlphAlphcnt#1{\AlphAlph{#1}}
|
||||
\makeatother
|
||||
\AddEnumerateCounter{\enumalphalphcnt}{\@enumalphalphcnt}{aa}
|
||||
\AddEnumerateCounter{\enumAlphAlphcnt}{\@enumAlphAlphcnt}{AA}
|
||||
2178
научка/code/pwm_motor_control/Modbus/latex/etoc_doxygen.sty
Normal file
7
научка/code/pwm_motor_control/Modbus/latex/files.tex
Normal file
@@ -0,0 +1,7 @@
|
||||
\doxysection{File List}
|
||||
Here is a list of all documented files with brief descriptions\+:\begin{DoxyCompactList}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{crc__algs_8h_source}{crc\+\_\+algs.\+h}} }{\pageref{crc__algs_8h_source}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{modbus_8h_source}{modbus.\+h}} }{\pageref{modbus_8h_source}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{rs__message_8h_source}{rs\+\_\+message.\+h}} }{\pageref{rs__message_8h_source}}{}
|
||||
\item\contentsline{section}{\mbox{\hyperlink{tim__general_8h_source}{tim\+\_\+general.\+h}} }{\pageref{tim__general_8h_source}}{}
|
||||
\end{DoxyCompactList}
|
||||
456
научка/code/pwm_motor_control/Modbus/latex/longtable_doxygen.sty
Normal file
@@ -0,0 +1,456 @@
|
||||
%%
|
||||
%% This is file `longtable.sty',
|
||||
%% generated with the docstrip utility.
|
||||
%%
|
||||
%% The original source files were:
|
||||
%%
|
||||
%% longtable.dtx (with options: `package')
|
||||
%%
|
||||
%% This is a generated file.
|
||||
%%
|
||||
%% The source is maintained by the LaTeX Project team and bug
|
||||
%% reports for it can be opened at http://latex-project.org/bugs.html
|
||||
%% (but please observe conditions on bug reports sent to that address!)
|
||||
%%
|
||||
%% Copyright 1993-2016
|
||||
%% The LaTeX3 Project and any individual authors listed elsewhere
|
||||
%% in this file.
|
||||
%%
|
||||
%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
|
||||
%% --------------------------------------------------------------------------
|
||||
%%
|
||||
%% It may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.3c
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.3c or later is part of all distributions of LaTeX
|
||||
%% version 2005/12/01 or later.
|
||||
%%
|
||||
%% This file may only be distributed together with a copy of the LaTeX
|
||||
%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
|
||||
%% without such generated files.
|
||||
%%
|
||||
%% The list of all files belonging to the LaTeX `Tools Bundle' is
|
||||
%% given in the file `manifest.txt'.
|
||||
%%
|
||||
%% File: longtable.dtx Copyright (C) 1990-2001 David Carlisle
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
|
||||
\ProvidesPackage{longtable_doxygen}
|
||||
[2014/10/28 v4.11 Multi-page Table package (DPC) - frozen version for doxygen]
|
||||
\def\LT@err{\PackageError{longtable}}
|
||||
\def\LT@warn{\PackageWarning{longtable}}
|
||||
\def\LT@final@warn{%
|
||||
\AtEndDocument{%
|
||||
\LT@warn{Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}%
|
||||
\global\let\LT@final@warn\relax}
|
||||
\DeclareOption{errorshow}{%
|
||||
\def\LT@warn{\PackageInfo{longtable}}}
|
||||
\DeclareOption{pausing}{%
|
||||
\def\LT@warn#1{%
|
||||
\LT@err{#1}{This is not really an error}}}
|
||||
\DeclareOption{set}{}
|
||||
\DeclareOption{final}{}
|
||||
\ProcessOptions
|
||||
\newskip\LTleft \LTleft=\fill
|
||||
\newskip\LTright \LTright=\fill
|
||||
\newskip\LTpre \LTpre=\bigskipamount
|
||||
\newskip\LTpost \LTpost=\bigskipamount
|
||||
\newcount\LTchunksize \LTchunksize=20
|
||||
\let\c@LTchunksize\LTchunksize
|
||||
\newdimen\LTcapwidth \LTcapwidth=4in
|
||||
\newbox\LT@head
|
||||
\newbox\LT@firsthead
|
||||
\newbox\LT@foot
|
||||
\newbox\LT@lastfoot
|
||||
\newcount\LT@cols
|
||||
\newcount\LT@rows
|
||||
\newcounter{LT@tables}
|
||||
\newcounter{LT@chunks}[LT@tables]
|
||||
\ifx\c@table\undefined
|
||||
\newcounter{table}
|
||||
\def\fnum@table{\tablename~\thetable}
|
||||
\fi
|
||||
\ifx\tablename\undefined
|
||||
\def\tablename{Table}
|
||||
\fi
|
||||
\newtoks\LT@p@ftn
|
||||
\mathchardef\LT@end@pen=30000
|
||||
\def\longtable{%
|
||||
\par
|
||||
\ifx\multicols\@undefined
|
||||
\else
|
||||
\ifnum\col@number>\@ne
|
||||
\@twocolumntrue
|
||||
\fi
|
||||
\fi
|
||||
\if@twocolumn
|
||||
\LT@err{longtable not in 1-column mode}\@ehc
|
||||
\fi
|
||||
\begingroup
|
||||
\@ifnextchar[\LT@array{\LT@array[x]}}
|
||||
\def\LT@array[#1]#2{%
|
||||
\refstepcounter{table}\stepcounter{LT@tables}%
|
||||
\if l#1%
|
||||
\LTleft\z@ \LTright\fill
|
||||
\else\if r#1%
|
||||
\LTleft\fill \LTright\z@
|
||||
\else\if c#1%
|
||||
\LTleft\fill \LTright\fill
|
||||
\fi\fi\fi
|
||||
\let\LT@mcol\multicolumn
|
||||
\let\LT@@tabarray\@tabarray
|
||||
\let\LT@@hl\hline
|
||||
\def\@tabarray{%
|
||||
\let\hline\LT@@hl
|
||||
\LT@@tabarray}%
|
||||
\let\\\LT@tabularcr\let\tabularnewline\\%
|
||||
\def\newpage{\noalign{\break}}%
|
||||
\def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%
|
||||
\def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%
|
||||
\let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption
|
||||
\@tempdima\ht\strutbox
|
||||
\let\@endpbox\LT@endpbox
|
||||
\ifx\extrarowheight\@undefined
|
||||
\let\@acol\@tabacol
|
||||
\let\@classz\@tabclassz \let\@classiv\@tabclassiv
|
||||
\def\@startpbox{\vtop\LT@startpbox}%
|
||||
\let\@@startpbox\@startpbox
|
||||
\let\@@endpbox\@endpbox
|
||||
\let\LT@LL@FM@cr\@tabularcr
|
||||
\else
|
||||
\advance\@tempdima\extrarowheight
|
||||
\col@sep\tabcolsep
|
||||
\let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr
|
||||
\fi
|
||||
\setbox\@arstrutbox\hbox{\vrule
|
||||
\@height \arraystretch \@tempdima
|
||||
\@depth \arraystretch \dp \strutbox
|
||||
\@width \z@}%
|
||||
\let\@sharp##\let\protect\relax
|
||||
\begingroup
|
||||
\@mkpream{#2}%
|
||||
\xdef\LT@bchunk{%
|
||||
\global\advance\c@LT@chunks\@ne
|
||||
\global\LT@rows\z@\setbox\z@\vbox\bgroup
|
||||
\LT@setprevdepth
|
||||
\tabskip\LTleft \noexpand\halign to\hsize\bgroup
|
||||
\tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
|
||||
\endgroup
|
||||
\expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
|
||||
\LT@make@row
|
||||
\m@th\let\par\@empty
|
||||
\everycr{}\lineskip\z@\baselineskip\z@
|
||||
\LT@bchunk}
|
||||
\def\LT@no@pgbk#1[#2]{\penalty #1\@getpen{#2}\ifnum`{=0\fi}}
|
||||
\def\LT@start{%
|
||||
\let\LT@start\endgraf
|
||||
\endgraf\penalty\z@\vskip\LTpre
|
||||
\dimen@\pagetotal
|
||||
\advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
|
||||
\advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
|
||||
\advance\dimen@ \ht\LT@foot
|
||||
\dimen@ii\vfuzz
|
||||
\vfuzz\maxdimen
|
||||
\setbox\tw@\copy\z@
|
||||
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
|
||||
\setbox\tw@\vbox{\unvbox\tw@}%
|
||||
\vfuzz\dimen@ii
|
||||
\advance\dimen@ \ht
|
||||
\ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
|
||||
\advance\dimen@\dp
|
||||
\ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
|
||||
\advance\dimen@ -\pagegoal
|
||||
\ifdim \dimen@>\z@\vfil\break\fi
|
||||
\global\@colroom\@colht
|
||||
\ifvoid\LT@foot\else
|
||||
\advance\vsize-\ht\LT@foot
|
||||
\global\advance\@colroom-\ht\LT@foot
|
||||
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
|
||||
\maxdepth\z@
|
||||
\fi
|
||||
\ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak
|
||||
\output{\LT@output}}
|
||||
\def\endlongtable{%
|
||||
\crcr
|
||||
\noalign{%
|
||||
\let\LT@entry\LT@entry@chop
|
||||
\xdef\LT@save@row{\LT@save@row}}%
|
||||
\LT@echunk
|
||||
\LT@start
|
||||
\unvbox\z@
|
||||
\LT@get@widths
|
||||
\if@filesw
|
||||
{\let\LT@entry\LT@entry@write\immediate\write\@auxout{%
|
||||
\gdef\expandafter\noexpand
|
||||
\csname LT@\romannumeral\c@LT@tables\endcsname
|
||||
{\LT@save@row}}}%
|
||||
\fi
|
||||
\ifx\LT@save@row\LT@@save@row
|
||||
\else
|
||||
\LT@warn{Column \@width s have changed\MessageBreak
|
||||
in table \thetable}%
|
||||
\LT@final@warn
|
||||
\fi
|
||||
\endgraf\penalty -\LT@end@pen
|
||||
\endgroup
|
||||
\global\@mparbottom\z@
|
||||
\pagegoal\vsize
|
||||
\endgraf\penalty\z@\addvspace\LTpost
|
||||
\ifvoid\footins\else\insert\footins{}\fi}
|
||||
\def\LT@nofcols#1&{%
|
||||
\futurelet\@let@token\LT@n@fcols}
|
||||
\def\LT@n@fcols{%
|
||||
\advance\LT@cols\@ne
|
||||
\ifx\@let@token\LT@nofcols
|
||||
\expandafter\@gobble
|
||||
\else
|
||||
\expandafter\LT@nofcols
|
||||
\fi}
|
||||
\def\LT@tabularcr{%
|
||||
\relax\iffalse{\fi\ifnum0=`}\fi
|
||||
\@ifstar
|
||||
{\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr
|
||||
\LT@t@bularcr}%
|
||||
{\LT@t@bularcr}}
|
||||
\let\LT@crcr\crcr
|
||||
\let\LT@setprevdepth\relax
|
||||
\def\LT@t@bularcr{%
|
||||
\global\advance\LT@rows\@ne
|
||||
\ifnum\LT@rows=\LTchunksize
|
||||
\gdef\LT@setprevdepth{%
|
||||
\prevdepth\z@\global
|
||||
\global\let\LT@setprevdepth\relax}%
|
||||
\expandafter\LT@xtabularcr
|
||||
\else
|
||||
\ifnum0=`{}\fi
|
||||
\expandafter\LT@LL@FM@cr
|
||||
\fi}
|
||||
\def\LT@xtabularcr{%
|
||||
\@ifnextchar[\LT@argtabularcr\LT@ntabularcr}
|
||||
\def\LT@ntabularcr{%
|
||||
\ifnum0=`{}\fi
|
||||
\LT@echunk
|
||||
\LT@start
|
||||
\unvbox\z@
|
||||
\LT@get@widths
|
||||
\LT@bchunk}
|
||||
\def\LT@argtabularcr[#1]{%
|
||||
\ifnum0=`{}\fi
|
||||
\ifdim #1>\z@
|
||||
\unskip\@xargarraycr{#1}%
|
||||
\else
|
||||
\@yargarraycr{#1}%
|
||||
\fi
|
||||
\LT@echunk
|
||||
\LT@start
|
||||
\unvbox\z@
|
||||
\LT@get@widths
|
||||
\LT@bchunk}
|
||||
\def\LT@echunk{%
|
||||
\crcr\LT@save@row\cr\egroup
|
||||
\global\setbox\@ne\lastbox
|
||||
\unskip
|
||||
\egroup}
|
||||
\def\LT@entry#1#2{%
|
||||
\ifhmode\@firstofone{&}\fi\omit
|
||||
\ifnum#1=\c@LT@chunks
|
||||
\else
|
||||
\kern#2\relax
|
||||
\fi}
|
||||
\def\LT@entry@chop#1#2{%
|
||||
\noexpand\LT@entry
|
||||
{\ifnum#1>\c@LT@chunks
|
||||
1}{0pt%
|
||||
\else
|
||||
#1}{#2%
|
||||
\fi}}
|
||||
\def\LT@entry@write{%
|
||||
\noexpand\LT@entry^^J%
|
||||
\@spaces}
|
||||
\def\LT@kill{%
|
||||
\LT@echunk
|
||||
\LT@get@widths
|
||||
\expandafter\LT@rebox\LT@bchunk}
|
||||
\def\LT@rebox#1\bgroup{%
|
||||
#1\bgroup
|
||||
\unvbox\z@
|
||||
\unskip
|
||||
\setbox\z@\lastbox}
|
||||
\def\LT@blank@row{%
|
||||
\xdef\LT@save@row{\expandafter\LT@build@blank
|
||||
\romannumeral\number\LT@cols 001 }}
|
||||
\def\LT@build@blank#1{%
|
||||
\if#1m%
|
||||
\noexpand\LT@entry{1}{0pt}%
|
||||
\expandafter\LT@build@blank
|
||||
\fi}
|
||||
\def\LT@make@row{%
|
||||
\global\expandafter\let\expandafter\LT@save@row
|
||||
\csname LT@\romannumeral\c@LT@tables\endcsname
|
||||
\ifx\LT@save@row\relax
|
||||
\LT@blank@row
|
||||
\else
|
||||
{\let\LT@entry\or
|
||||
\if!%
|
||||
\ifcase\expandafter\expandafter\expandafter\LT@cols
|
||||
\expandafter\@gobble\LT@save@row
|
||||
\or
|
||||
\else
|
||||
\relax
|
||||
\fi
|
||||
!%
|
||||
\else
|
||||
\aftergroup\LT@blank@row
|
||||
\fi}%
|
||||
\fi}
|
||||
\let\setlongtables\relax
|
||||
\def\LT@get@widths{%
|
||||
\setbox\tw@\hbox{%
|
||||
\unhbox\@ne
|
||||
\let\LT@old@row\LT@save@row
|
||||
\global\let\LT@save@row\@empty
|
||||
\count@\LT@cols
|
||||
\loop
|
||||
\unskip
|
||||
\setbox\tw@\lastbox
|
||||
\ifhbox\tw@
|
||||
\LT@def@row
|
||||
\advance\count@\m@ne
|
||||
\repeat}%
|
||||
\ifx\LT@@save@row\@undefined
|
||||
\let\LT@@save@row\LT@save@row
|
||||
\fi}
|
||||
\def\LT@def@row{%
|
||||
\let\LT@entry\or
|
||||
\edef\@tempa{%
|
||||
\ifcase\expandafter\count@\LT@old@row
|
||||
\else
|
||||
{1}{0pt}%
|
||||
\fi}%
|
||||
\let\LT@entry\relax
|
||||
\xdef\LT@save@row{%
|
||||
\LT@entry
|
||||
\expandafter\LT@max@sel\@tempa
|
||||
\LT@save@row}}
|
||||
\def\LT@max@sel#1#2{%
|
||||
{\ifdim#2=\wd\tw@
|
||||
#1%
|
||||
\else
|
||||
\number\c@LT@chunks
|
||||
\fi}%
|
||||
{\the\wd\tw@}}
|
||||
\def\LT@hline{%
|
||||
\noalign{\ifnum0=`}\fi
|
||||
\penalty\@M
|
||||
\futurelet\@let@token\LT@@hline}
|
||||
\def\LT@@hline{%
|
||||
\ifx\@let@token\hline
|
||||
\global\let\@gtempa\@gobble
|
||||
\gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}%
|
||||
\else
|
||||
\global\let\@gtempa\@empty
|
||||
\gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
|
||||
\fi
|
||||
\ifnum0=`{\fi}%
|
||||
\multispan\LT@cols
|
||||
\unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
|
||||
\noalign{\LT@sep}%
|
||||
\multispan\LT@cols
|
||||
\unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
|
||||
\noalign{\penalty\@M}%
|
||||
\@gtempa}
|
||||
\def\LT@caption{%
|
||||
\noalign\bgroup
|
||||
\@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n}
|
||||
\def\LT@c@ption#1[#2]#3{%
|
||||
\LT@makecaption#1\fnum@table{#3}%
|
||||
\def\@tempa{#2}%
|
||||
\ifx\@tempa\@empty\else
|
||||
{\let\\\space
|
||||
\addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}%
|
||||
\fi}
|
||||
\def\LT@capti@n{%
|
||||
\@ifstar
|
||||
{\egroup\LT@c@ption\@gobble[]}%
|
||||
{\egroup\@xdblarg{\LT@c@ption\@firstofone}}}
|
||||
\def\LT@makecaption#1#2#3{%
|
||||
\LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
|
||||
\sbox\@tempboxa{#1{#2: }#3}%
|
||||
\ifdim\wd\@tempboxa>\hsize
|
||||
#1{#2: }#3%
|
||||
\else
|
||||
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
|
||||
\fi
|
||||
\endgraf\vskip\baselineskip}%
|
||||
\hss}}}
|
||||
\def\LT@output{%
|
||||
\ifnum\outputpenalty <-\@Mi
|
||||
\ifnum\outputpenalty > -\LT@end@pen
|
||||
\LT@err{floats and marginpars not allowed in a longtable}\@ehc
|
||||
\else
|
||||
\setbox\z@\vbox{\unvbox\@cclv}%
|
||||
\ifdim \ht\LT@lastfoot>\ht\LT@foot
|
||||
\dimen@\pagegoal
|
||||
\advance\dimen@-\ht\LT@lastfoot
|
||||
\ifdim\dimen@<\ht\z@
|
||||
\setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}%
|
||||
\@makecol
|
||||
\@outputpage
|
||||
\setbox\z@\vbox{\box\LT@head}%
|
||||
\fi
|
||||
\fi
|
||||
\global\@colroom\@colht
|
||||
\global\vsize\@colht
|
||||
\vbox
|
||||
{\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
|
||||
\fi
|
||||
\else
|
||||
\setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}%
|
||||
\@makecol
|
||||
\@outputpage
|
||||
\global\vsize\@colroom
|
||||
\copy\LT@head\nobreak
|
||||
\fi}
|
||||
\def\LT@end@hd@ft#1{%
|
||||
\LT@echunk
|
||||
\ifx\LT@start\endgraf
|
||||
\LT@err
|
||||
{Longtable head or foot not at start of table}%
|
||||
{Increase LTchunksize}%
|
||||
\fi
|
||||
\setbox#1\box\z@
|
||||
\LT@get@widths
|
||||
\LT@bchunk}
|
||||
\def\endfirsthead{\LT@end@hd@ft\LT@firsthead}
|
||||
\def\endhead{\LT@end@hd@ft\LT@head}
|
||||
\def\endfoot{\LT@end@hd@ft\LT@foot}
|
||||
\def\endlastfoot{\LT@end@hd@ft\LT@lastfoot}
|
||||
\def\LT@startpbox#1{%
|
||||
\bgroup
|
||||
\let\@footnotetext\LT@p@ftntext
|
||||
\setlength\hsize{#1}%
|
||||
\@arrayparboxrestore
|
||||
\vrule \@height \ht\@arstrutbox \@width \z@}
|
||||
\def\LT@endpbox{%
|
||||
\@finalstrut\@arstrutbox
|
||||
\egroup
|
||||
\the\LT@p@ftn
|
||||
\global\LT@p@ftn{}%
|
||||
\hfil}
|
||||
%% added \long to prevent:
|
||||
% LaTeX Warning: Command \LT@p@ftntext has changed.
|
||||
%
|
||||
% from the original repository (https://github.com/latex3/latex2e/blob/develop/required/tools/longtable.dtx):
|
||||
% \changes{v4.15}{2021/03/28}
|
||||
% {make long for gh/364}
|
||||
% Inside the `p' column, just save up the footnote text in a token
|
||||
% register.
|
||||
\long\def\LT@p@ftntext#1{%
|
||||
\edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}%
|
||||
\global\LT@p@ftn\expandafter{\@tempa{#1}}}%
|
||||
|
||||
\@namedef{ver@longtable.sty}{2014/10/28 v4.11 Multi-page Table package (DPC) - frozen version for doxygen}
|
||||
\endinput
|
||||
%%
|
||||
%% End of file `longtable.sty'.
|
||||
172
научка/code/pwm_motor_control/Modbus/latex/modbus_8h_source.tex
Normal file
@@ -0,0 +1,172 @@
|
||||
\doxysection{modbus.\+h}
|
||||
\hypertarget{modbus_8h_source}{}\label{modbus_8h_source}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{00001\ \textcolor{comment}{/********************************MODBUS*************************************}}
|
||||
\DoxyCodeLine{00002\ \textcolor{comment}{Данный\ файл\ содержит\ объявления\ базовых\ функции\ и\ дефайны\ для\ реализации\ }}
|
||||
\DoxyCodeLine{00003\ \textcolor{comment}{протоколов\ \ \ \ \ \ \ \ \ \ }}
|
||||
\DoxyCodeLine{00004\ \textcolor{comment}{***************************************************************************/}}
|
||||
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ \_\_MODBUS\_H\_}}
|
||||
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ \_\_MODBUS\_H\_}}
|
||||
\DoxyCodeLine{00007\ }
|
||||
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ "{}main.h"{}}}
|
||||
\DoxyCodeLine{00009\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/DEFINES\ FOR\ MODBUS\ SETTING-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#define\ MB\_UART\_NUMB\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ number\ of\ used\ uart}}
|
||||
\DoxyCodeLine{00011\ \textcolor{comment}{/*\ accord\ to\ this\ define\ sets\ define\ USED\_MB\_UART\ =\ USARTx\ */}}
|
||||
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#define\ MB\_TIM\_NUMB\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 7\ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ number\ of\ used\ uart}}
|
||||
\DoxyCodeLine{00013\ \textcolor{comment}{/*\ accord\ to\ this\ define\ sets\ define\ USED\_MB\_TIM\ =\ TIMx\ */}}
|
||||
\DoxyCodeLine{00014\ }
|
||||
\DoxyCodeLine{00015\ }
|
||||
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#define\ COILS\_NUMB\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 16\ \ \ \ \ \ }\textcolor{comment}{//\ minimum\ 16}}
|
||||
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#define\ INPUT\_REGS\_NUMB\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 100}}
|
||||
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#define\ HOLD\_REGS\_NUMB\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 100\ }}
|
||||
\DoxyCodeLine{00019\ \textcolor{comment}{/*\ defines\ for\ modbus\ behaviour\ */}}
|
||||
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#define\ MB\_MAX\_TIMEOUT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5000\ \ \ \ }\textcolor{comment}{//\ is\ ms}}
|
||||
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ RX\_FIRST\_PART\_IND\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 6\ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ up\ to\ NUMB\ of\ bytes\ if\ its\ there,\ or\ up\ to\ first\ byte\ CRC}}
|
||||
\DoxyCodeLine{00022\ \textcolor{comment}{//\ custom\ define\ for\ size\ of\ receive\ message\ }}
|
||||
\DoxyCodeLine{00023\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00024\ }
|
||||
\DoxyCodeLine{00025\ }
|
||||
\DoxyCodeLine{00028\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/DEFINES\ FOR\ STRUCTURE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00029\ \textcolor{comment}{/*\ defines\ for\ structure\ of\ modbus\ message\ */}}
|
||||
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#define\ DEVICE\_ID\_SIZE\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ size\ of\ (MbAddr)}}
|
||||
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#define\ FUNC\_CODE\_SIZE\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ size\ of\ (Func\_Code)}}
|
||||
\DoxyCodeLine{00032\ \textcolor{preprocessor}{\#define\ DATA\_SIZE\_SIZE\ \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ size\ of\ (ByteCnt)}}
|
||||
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#define\ ADDRESS\_SIZE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ size\ of\ (Qnt)}}
|
||||
\DoxyCodeLine{00034\ \textcolor{preprocessor}{\#define\ NUMBorVAL\_SIZE\ \ \ \ \ \ \ \ \ \ 2\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ size\ of\ (Qnt)}}
|
||||
\DoxyCodeLine{00035\ \textcolor{preprocessor}{\#define\ DATA\_MAX\_SIZE\ \ \ \ \ \ \ \ \ \ \ 32\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ maximum\ number\ of\ data:\ DWORD\ (NOT\ MESSAGE\ SIZE)}}
|
||||
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#define\ CRC\_SIZE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ size\ of\ (MB\_CRC)\ in\ bytes}}
|
||||
\DoxyCodeLine{00037\ }
|
||||
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\#define\ ERR\_VALUES\_START\ \ \ \ \ \ \ \ 0x80U\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\textcolor{comment}{//\ first\ number\ of\ (Except\_Code)}}
|
||||
\DoxyCodeLine{00039\ }
|
||||
\DoxyCodeLine{00040\ \textcolor{comment}{/*\ size\ of\ info\ */}}
|
||||
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#define\ INFO\_SIZE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DEVICE\_ID\_SIZE+FUNC\_CODE\_SIZE+DATA\_SIZE\_SIZE+ADDRESS\_SIZE+NUMBorVAL\_SIZE}}
|
||||
\DoxyCodeLine{00042\ }
|
||||
\DoxyCodeLine{00043\ \textcolor{comment}{/*\ size\ of\ buffer:\ max\ size\ of\ whole\ message\ */}}
|
||||
\DoxyCodeLine{00044\ \textcolor{preprocessor}{\#define\ MSG\_SIZE\_MAX\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (DATA\_MAX\_SIZE+INFO\_SIZE+CRC\_SIZE)\ }\textcolor{comment}{//\ max\ possible\ size\ of\ message}}
|
||||
\DoxyCodeLine{00045\ }
|
||||
\DoxyCodeLine{00046\ \textcolor{preprocessor}{\#define\ Message\_Data(\_msg\_,\ \_ind\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_msg\_-\/>DATA[\_ind\_].DATA}}
|
||||
\DoxyCodeLine{00047\ \textcolor{preprocessor}{\#define\ Message\_Data\_Byte(\_msg\_,\ \_ind\_,\ \_byte\_)\ \ \ \ \ \_msg\_-\/>DATA[\_ind\_].\_byte\_}}
|
||||
\DoxyCodeLine{00048\ }
|
||||
\DoxyCodeLine{00049\ \textcolor{comment}{//\ choose\ certain\ coil}}
|
||||
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#define\ Set\_Coils\_Origin(\_coils\_,\ \_source\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint16\_t\ *(\_coils\_)\ =\ (uint16\_t\ *)(\&(\_source\_))}}
|
||||
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#define\ Set\_Hold\_Regs\_Origin(\_hregs\_,\ \_source\_)\ \ \ \ \ \ \ \ \ uint16\_t\ *(\_hregs\_)\ =\ (uint16\_t\ *)(\&(\_source\_))}}
|
||||
\DoxyCodeLine{00052\ \textcolor{comment}{/*\ Structure\ for\ modbus\ messsage\ */}}
|
||||
\DoxyCodeLine{00053\ }
|
||||
\DoxyCodeLine{00054\ }
|
||||
\DoxyCodeLine{00055\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \textcolor{comment}{//RS\_FunctonTypeDef}}
|
||||
\DoxyCodeLine{00056\ \{}
|
||||
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{comment}{//\ reading}}
|
||||
\DoxyCodeLine{00058\ \ \ \ \ MB\_R\_COILS\ =\ \ \ \ \ \ \ \ \ \ \ \ 0x01,}
|
||||
\DoxyCodeLine{00059\ \ \ \ \ MB\_R\_DISC\_IN\ =\ \ \ \ \ \ 0x02,}
|
||||
\DoxyCodeLine{00060\ \ \ \ \ MB\_R\_IN\_REGS\ =\ \ \ \ \ \ 0x03,}
|
||||
\DoxyCodeLine{00061\ \ \ \ \ MB\_R\_HOLD\_REGS\ =\ \ \ \ 0x04,}
|
||||
\DoxyCodeLine{00062\ \ \ \ \ }
|
||||
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{comment}{//\ writting}}
|
||||
\DoxyCodeLine{00064\ \ \ \ \ MB\_W\_COIL\ =\ \ \ \ \ \ \ \ \ \ \ \ \ 0x05,}
|
||||
\DoxyCodeLine{00065\ \ \ \ \ MB\_W\_HOLD\_REG\ =\ \ \ \ \ 0x06,}
|
||||
\DoxyCodeLine{00066\ \ \ \ \ MB\_W\_COILS\ =\ \ \ \ \ \ \ \ \ \ \ \ 0x0F,}
|
||||
\DoxyCodeLine{00067\ \ \ \ \ MB\_W\_HOLD\_REGS\ =\ \ \ \ 0x10,}
|
||||
\DoxyCodeLine{00068\ \}RS\_FunctonTypeDef;}
|
||||
\DoxyCodeLine{00069\ }
|
||||
\DoxyCodeLine{00070\ }
|
||||
\DoxyCodeLine{00071\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ \ }\textcolor{comment}{//\ RS\_MsgTypeDef}}
|
||||
\DoxyCodeLine{00072\ \{}
|
||||
\DoxyCodeLine{00073\ \ \ \ \ uint8\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MbAddr;}
|
||||
\DoxyCodeLine{00074\ \ \ \ \ RS\_FunctonTypeDef\ \ \ Func\_Code;}
|
||||
\DoxyCodeLine{00075\ \ \ \ \ uint8\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Except\_Code;}
|
||||
\DoxyCodeLine{00076\ \ \ \ \ uint16\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Addr;}
|
||||
\DoxyCodeLine{00077\ \ \ \ \ uint16\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Qnt;}
|
||||
\DoxyCodeLine{00078\ }
|
||||
\DoxyCodeLine{00079\ \ \ \ \ uint8\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ByteCnt;}
|
||||
\DoxyCodeLine{00080\ \ \ \ \ uint16\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ DATA[DATA\_MAX\_SIZE];}
|
||||
\DoxyCodeLine{00081\ \ \ \ \ }
|
||||
\DoxyCodeLine{00082\ \ \ \ \ uint16\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MB\_CRC;}
|
||||
\DoxyCodeLine{00083\ \}\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}};}
|
||||
\DoxyCodeLine{00084\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00085\ }
|
||||
\DoxyCodeLine{00086\ }
|
||||
\DoxyCodeLine{00088\ }
|
||||
\DoxyCodeLine{00089\ }
|
||||
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#define\ write16\_to\_8(\_16bit\_,\ \_2\_8bit\_)}}
|
||||
\DoxyCodeLine{00091\ }
|
||||
\DoxyCodeLine{00092\ }
|
||||
\DoxyCodeLine{00093\ }
|
||||
\DoxyCodeLine{00094\ }
|
||||
\DoxyCodeLine{00095\ }
|
||||
\DoxyCodeLine{00098\ }
|
||||
\DoxyCodeLine{00104\ uint8\_t\ Modbus\_Command\_1(\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg);}
|
||||
\DoxyCodeLine{00111\ uint8\_t\ Modbus\_Command\_3(\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg);}
|
||||
\DoxyCodeLine{00118\ uint8\_t\ Modbus\_Command\_5(\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg);}
|
||||
\DoxyCodeLine{00125\ uint8\_t\ Modbus\_Command\_15(\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *modbus\_msg);}
|
||||
\DoxyCodeLine{00126\ }
|
||||
\DoxyCodeLine{00128\ }
|
||||
\DoxyCodeLine{00129\ }
|
||||
\DoxyCodeLine{00132\ }
|
||||
\DoxyCodeLine{00133\ \textcolor{comment}{/*\ set\ USART\_TypeDef\ for\ choosen\ numb\ of\ usart\ */}}
|
||||
\DoxyCodeLine{00134\ \textcolor{preprocessor}{\#if\ (MB\_UART\_NUMB\ ==\ 1)\ }}
|
||||
\DoxyCodeLine{00135\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_UART\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ USART1\ }}
|
||||
\DoxyCodeLine{00136\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_USART1}}
|
||||
\DoxyCodeLine{00137\ \textcolor{preprocessor}{\#elif\ (MB\_UART\_NUMB\ ==\ 2)}}
|
||||
\DoxyCodeLine{00138\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_UART\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ USART2\ }}
|
||||
\DoxyCodeLine{00139\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_USART2}}
|
||||
\DoxyCodeLine{00140\ \textcolor{preprocessor}{\#elif\ (MB\_UART\_NUMB\ ==\ 3)}}
|
||||
\DoxyCodeLine{00141\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_UART\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ USART3\ }}
|
||||
\DoxyCodeLine{00142\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_USART3}}
|
||||
\DoxyCodeLine{00143\ \textcolor{preprocessor}{\#elif\ (MB\_UART\_NUMB\ ==\ 4)}}
|
||||
\DoxyCodeLine{00144\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_UART\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ UART4\ }}
|
||||
\DoxyCodeLine{00145\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_UART4}}
|
||||
\DoxyCodeLine{00146\ \textcolor{preprocessor}{\#elif\ (MB\_UART\_NUMB\ ==\ 5)}}
|
||||
\DoxyCodeLine{00147\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_UART\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ UART5}}
|
||||
\DoxyCodeLine{00148\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_UART6}}
|
||||
\DoxyCodeLine{00149\ \textcolor{preprocessor}{\#elif\ (MB\_UART\_NUMB\ ==\ 6)}}
|
||||
\DoxyCodeLine{00150\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_UART\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ USART6\ }}
|
||||
\DoxyCodeLine{00151\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_USART6}}
|
||||
\DoxyCodeLine{00152\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{00153\ }
|
||||
\DoxyCodeLine{00154\ \textcolor{preprocessor}{\#if\ (MB\_TIM\_NUMB\ ==\ 1)\ }}
|
||||
\DoxyCodeLine{00155\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM1\ }}
|
||||
\DoxyCodeLine{00156\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM1}}
|
||||
\DoxyCodeLine{00157\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 2)}}
|
||||
\DoxyCodeLine{00158\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM2\ }}
|
||||
\DoxyCodeLine{00159\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM2}}
|
||||
\DoxyCodeLine{00160\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 3)}}
|
||||
\DoxyCodeLine{00161\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM3\ }}
|
||||
\DoxyCodeLine{00162\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM3}}
|
||||
\DoxyCodeLine{00163\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 4)}}
|
||||
\DoxyCodeLine{00164\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM4\ }}
|
||||
\DoxyCodeLine{00165\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM4}}
|
||||
\DoxyCodeLine{00166\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 5)}}
|
||||
\DoxyCodeLine{00167\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM5}}
|
||||
\DoxyCodeLine{00168\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM5}}
|
||||
\DoxyCodeLine{00169\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 6)}}
|
||||
\DoxyCodeLine{00170\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM6\ }}
|
||||
\DoxyCodeLine{00171\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM6}}
|
||||
\DoxyCodeLine{00172\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 7)}}
|
||||
\DoxyCodeLine{00173\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM7\ }}
|
||||
\DoxyCodeLine{00174\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM7}}
|
||||
\DoxyCodeLine{00175\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 8)}}
|
||||
\DoxyCodeLine{00176\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM8}}
|
||||
\DoxyCodeLine{00177\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM8\ }}
|
||||
\DoxyCodeLine{00178\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 9)}}
|
||||
\DoxyCodeLine{00179\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM9\ }}
|
||||
\DoxyCodeLine{00180\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM9}}
|
||||
\DoxyCodeLine{00181\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 10)}}
|
||||
\DoxyCodeLine{00182\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM10\ }}
|
||||
\DoxyCodeLine{00183\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM10}}
|
||||
\DoxyCodeLine{00184\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 11)}}
|
||||
\DoxyCodeLine{00185\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM11}}
|
||||
\DoxyCodeLine{00186\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM11}}
|
||||
\DoxyCodeLine{00187\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 12)}}
|
||||
\DoxyCodeLine{00188\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM12\ }}
|
||||
\DoxyCodeLine{00189\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM12}}
|
||||
\DoxyCodeLine{00190\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 13)}}
|
||||
\DoxyCodeLine{00191\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM13\ }}
|
||||
\DoxyCodeLine{00192\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM13}}
|
||||
\DoxyCodeLine{00193\ \textcolor{preprocessor}{\#elif\ (MB\_TIM\_NUMB\ ==\ 14)}}
|
||||
\DoxyCodeLine{00194\ \textcolor{preprocessor}{\ \ \ \ \#define\ USED\_MODBUS\_TIM\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TIM14\ }}
|
||||
\DoxyCodeLine{00195\ \textcolor{preprocessor}{\ \ \ \ \#define\ USE\_TIM14}}
|
||||
\DoxyCodeLine{00196\ \textcolor{preprocessor}{\#endif}}
|
||||
\DoxyCodeLine{00197\ }
|
||||
\DoxyCodeLine{00198\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\_\_MODBUS\_H\_}}
|
||||
|
||||
\end{DoxyCode}
|
||||
233
научка/code/pwm_motor_control/Modbus/latex/refman.tex
Normal file
@@ -0,0 +1,233 @@
|
||||
% Handle batch mode
|
||||
% to overcome problems with too many open files
|
||||
\let\mypdfximage\pdfximage\def\pdfximage{\immediate\mypdfximage}
|
||||
\pdfminorversion=7
|
||||
% Set document class depending on configuration
|
||||
\documentclass[twoside]{book}
|
||||
%% moved from doxygen.sty due to workaround for LaTex 2019 version and unmaintained tabu package
|
||||
\usepackage{ifthen}
|
||||
\ifx\requestedLaTeXdate\undefined
|
||||
\usepackage{array}
|
||||
\else
|
||||
\usepackage{array}[=2016-10-06]
|
||||
\fi
|
||||
%%
|
||||
% Packages required by doxygen
|
||||
\makeatletter
|
||||
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
|
||||
% suppress package identification of infwarerr as it contains the word "warning"
|
||||
\let\@@protected@wlog\protected@wlog
|
||||
\def\protected@wlog#1{\wlog{package info suppressed}}
|
||||
\RequirePackage{infwarerr}
|
||||
\let\protected@wlog\@@protected@wlog
|
||||
\makeatother
|
||||
\IfFormatAtLeastTF{2016/01/01}{}{\usepackage{fixltx2e}} % for \textsubscript
|
||||
\IfFormatAtLeastTF{2015/01/01}{\pdfsuppresswarningpagegroup=1}{}
|
||||
\usepackage{doxygen}
|
||||
\usepackage{graphicx}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{makeidx}
|
||||
\PassOptionsToPackage{warn}{textcomp}
|
||||
\usepackage{textcomp}
|
||||
\usepackage[nointegrals]{wasysym}
|
||||
\usepackage{ifxetex}
|
||||
% NLS support packages
|
||||
% Define default fonts
|
||||
% Font selection
|
||||
\usepackage[T1]{fontenc}
|
||||
% set main and monospaced font
|
||||
\usepackage[scaled=.90]{helvet}
|
||||
\usepackage{courier}
|
||||
\renewcommand{\familydefault}{\sfdefault}
|
||||
\doxyallsectionsfont{%
|
||||
\fontseries{bc}\selectfont%
|
||||
\color{darkgray}%
|
||||
}
|
||||
\renewcommand{\DoxyLabelFont}{%
|
||||
\fontseries{bc}\selectfont%
|
||||
\color{darkgray}%
|
||||
}
|
||||
\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}}
|
||||
% Arguments of doxygenemoji:
|
||||
% 1) ':<text>:' form of the emoji, already LaTeX-escaped
|
||||
% 2) file with the name of the emoji without the .png extension
|
||||
% in case image exist use this otherwise use the ':<text>:' form
|
||||
\newcommand{\doxygenemoji}[2]{%
|
||||
\IfFileExists{./#2.png}{\raisebox{-0.1em}{\includegraphics[height=0.9em]{./#2.png}}}{#1}%
|
||||
}
|
||||
% Page & text layout
|
||||
\usepackage{geometry}
|
||||
\geometry{%
|
||||
a4paper,%
|
||||
top=2.5cm,%
|
||||
bottom=2.5cm,%
|
||||
left=2.5cm,%
|
||||
right=2.5cm%
|
||||
}
|
||||
\usepackage{changepage}
|
||||
% Allow a bit of overflow to go unnoticed by other means
|
||||
\tolerance=750
|
||||
\hfuzz=15pt
|
||||
\hbadness=750
|
||||
\setlength{\emergencystretch}{15pt}
|
||||
\setlength{\parindent}{0cm}
|
||||
\newcommand{\doxynormalparskip}{\setlength{\parskip}{3ex plus 2ex minus 2ex}}
|
||||
\newcommand{\doxytocparskip}{\setlength{\parskip}{1ex plus 0ex minus 0ex}}
|
||||
\doxynormalparskip
|
||||
% Redefine paragraph/subparagraph environments, using sectsty fonts
|
||||
\makeatletter
|
||||
\renewcommand{\paragraph}{%
|
||||
\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
|
||||
\normalfont\normalsize\bfseries\SS@parafont%
|
||||
}%
|
||||
}
|
||||
\renewcommand{\subparagraph}{%
|
||||
\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
|
||||
\normalfont\normalsize\bfseries\SS@subparafont%
|
||||
}%
|
||||
}
|
||||
\makeatother
|
||||
\makeatletter
|
||||
\newcommand\hrulefilll{\leavevmode\leaders\hrule\hskip 0pt plus 1filll\kern\z@}
|
||||
\makeatother
|
||||
% Headers & footers
|
||||
\usepackage{fancyhdr}
|
||||
\pagestyle{fancyplain}
|
||||
\renewcommand{\footrulewidth}{0.4pt}
|
||||
\fancypagestyle{fancyplain}{
|
||||
\fancyhf{}
|
||||
\fancyhead[LE, RO]{\bfseries\thepage}
|
||||
\fancyhead[LO]{\bfseries\rightmark}
|
||||
\fancyhead[RE]{\bfseries\leftmark}
|
||||
\fancyfoot[LO, RE]{\bfseries\scriptsize Generated by Doxygen }
|
||||
}
|
||||
\fancypagestyle{plain}{
|
||||
\fancyhf{}
|
||||
\fancyfoot[LO, RE]{\bfseries\scriptsize Generated by Doxygen }
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
}
|
||||
\pagestyle{fancyplain}
|
||||
\renewcommand{\chaptermark}[1]{%
|
||||
\markboth{#1}{}%
|
||||
}
|
||||
\renewcommand{\sectionmark}[1]{%
|
||||
\markright{\thesection\ #1}%
|
||||
}
|
||||
% ToC, LoF, LoT, bibliography, and index
|
||||
% Indices & bibliography
|
||||
\usepackage{natbib}
|
||||
\usepackage[titles]{tocloft}
|
||||
\setcounter{tocdepth}{3}
|
||||
\setcounter{secnumdepth}{5}
|
||||
% creating indexes
|
||||
\makeindex
|
||||
\usepackage{newunicodechar}
|
||||
\makeatletter
|
||||
\def\doxynewunicodechar#1#2{%
|
||||
\@tempswafalse
|
||||
\edef\nuc@tempa{\detokenize{#1}}%
|
||||
\if\relax\nuc@tempa\relax
|
||||
\nuc@emptyargerr
|
||||
\else
|
||||
\edef\@tempb{\expandafter\@car\nuc@tempa\@nil}%
|
||||
\nuc@check
|
||||
\if@tempswa
|
||||
\@namedef{u8:\nuc@tempa}{#2}%
|
||||
\fi
|
||||
\fi
|
||||
}
|
||||
\makeatother
|
||||
\doxynewunicodechar{⁻}{${}^{-}$}% Superscript minus
|
||||
\doxynewunicodechar{²}{${}^{2}$}% Superscript two
|
||||
\doxynewunicodechar{³}{${}^{3}$}% Superscript three
|
||||
% Hyperlinks
|
||||
% Hyperlinks (required, but should be loaded last)
|
||||
\ifpdf
|
||||
\usepackage[pdftex,pagebackref=true]{hyperref}
|
||||
\else
|
||||
\ifxetex
|
||||
\usepackage[pagebackref=true]{hyperref}
|
||||
\else
|
||||
\usepackage[ps2pdf,pagebackref=true]{hyperref}
|
||||
\fi
|
||||
\fi
|
||||
\hypersetup{%
|
||||
colorlinks=true,%
|
||||
linkcolor=blue,%
|
||||
citecolor=blue,%
|
||||
unicode,%
|
||||
pdftitle={My Project},%
|
||||
pdfsubject={}%
|
||||
}
|
||||
% Custom commands used by the header
|
||||
% Custom commands
|
||||
\newcommand{\clearemptydoublepage}{%
|
||||
\newpage{\pagestyle{empty}\cleardoublepage}%
|
||||
}
|
||||
% caption style definition
|
||||
\usepackage{caption}
|
||||
\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}
|
||||
% in page table of contents
|
||||
\IfFormatAtLeastTF{2023/05/01}{\usepackage[deeplevels]{etoc}}{\usepackage[deeplevels]{etoc_doxygen}}
|
||||
\etocsettocstyle{\doxytocparskip}{\doxynormalparskip}
|
||||
\etocsetlevel{subsubsubsection}{4}
|
||||
\etocsetlevel{subsubsubsubsection}{5}
|
||||
\etocsetlevel{subsubsubsubsubsection}{6}
|
||||
\etocsetlevel{subsubsubsubsubsubsection}{7}
|
||||
\etocsetlevel{paragraph}{8}
|
||||
\etocsetlevel{subparagraph}{9}
|
||||
% prevent numbers overlap the titles in toc
|
||||
\renewcommand{\numberline}[1]{#1~}
|
||||
% End of preamble, now comes the document contents
|
||||
%===== C O N T E N T S =====
|
||||
\begin{document}
|
||||
\raggedbottom
|
||||
% Titlepage & ToC
|
||||
% To avoid duplicate page anchors due to reuse of same numbers for
|
||||
% the index (be it as roman numbers)
|
||||
\hypersetup{pageanchor=false,
|
||||
bookmarksnumbered=true,
|
||||
pdfencoding=unicode
|
||||
}
|
||||
\pagenumbering{alph}
|
||||
\begin{titlepage}
|
||||
\vspace*{7cm}
|
||||
\begin{center}%
|
||||
{\Large My Project}\\
|
||||
[1ex]\large 1.\+0 \\
|
||||
\vspace*{1cm}
|
||||
{\large Generated by Doxygen 1.10.0}\\
|
||||
\end{center}
|
||||
\end{titlepage}
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{roman}
|
||||
\tableofcontents
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{arabic}
|
||||
% re-enable anchors again
|
||||
\hypersetup{pageanchor=true}
|
||||
%--- Begin generated contents ---
|
||||
\chapter{Data Structure Index}
|
||||
\input{annotated}
|
||||
\chapter{File Index}
|
||||
\input{files}
|
||||
\chapter{Data Structure Documentation}
|
||||
\input{struct_r_s___handle_type_def}
|
||||
\input{struct_r_s___msg_type_def}
|
||||
\input{struct_t_i_m___settings_type_def}
|
||||
\input{struct_u_a_r_t___settings_type_def}
|
||||
\chapter{File Documentation}
|
||||
\input{crc__algs_8h_source}
|
||||
\input{modbus_8h_source}
|
||||
\input{rs__message_8h_source}
|
||||
\input{tim__general_8h_source}
|
||||
%--- End generated contents ---
|
||||
% Index
|
||||
\backmatter
|
||||
\newpage
|
||||
\phantomsection
|
||||
\clearemptydoublepage
|
||||
\addcontentsline{toc}{chapter}{\indexname}
|
||||
\printindex
|
||||
% Required for some languages (in combination with latexdocumentpre from the header)
|
||||
\end{document}
|
||||
@@ -0,0 +1,244 @@
|
||||
\doxysection{rs\+\_\+message.\+h}
|
||||
\hypertarget{rs__message_8h_source}{}\label{rs__message_8h_source}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ \_\_UART\_USER\_H\_}}
|
||||
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ \_\_UART\_USER\_H\_}}
|
||||
\DoxyCodeLine{00003\ }
|
||||
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ HAL\_UART\_MODULE\_ENABLED\ \ \ \ \ }\textcolor{comment}{//\ need\ to\ uncomment\ these\ defines\ in\ stm32f4xx\_hal\_conf.h}}
|
||||
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#define\ HAL\_USART\_MODULE\_ENABLED\ \ \ \ }\textcolor{comment}{//\ also\ need\ to\ add\ hal\_uart.c\ (source\ code)}}
|
||||
\DoxyCodeLine{00008\ }
|
||||
\DoxyCodeLine{00009\ \textcolor{comment}{//\#define\ USE\_USART1}}
|
||||
\DoxyCodeLine{00010\ \textcolor{comment}{//\#define\ USE\_USART2}}
|
||||
\DoxyCodeLine{00011\ \textcolor{comment}{//\#define\ USE\_USART3}}
|
||||
\DoxyCodeLine{00012\ \textcolor{comment}{//\#define\ USE\_UART4}}
|
||||
\DoxyCodeLine{00013\ \textcolor{comment}{//\#define\ USE\_UART5}}
|
||||
\DoxyCodeLine{00014\ \textcolor{comment}{//\#define\ USE\_USART6}}
|
||||
\DoxyCodeLine{00015\ \textcolor{comment}{/*\ note:\ used\ uart\ defines\ in\ modbus.h\ */}}
|
||||
\DoxyCodeLine{00016\ }
|
||||
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ "{}modbus.h"{}}\ }
|
||||
\DoxyCodeLine{00019\ }
|
||||
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ "{}stm32f4xx\_hal.h"{}}}
|
||||
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ "{}crc\_algs.h"{}}}
|
||||
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#include\ "{}tim\_general.h"{}}}
|
||||
\DoxyCodeLine{00023\ }
|
||||
\DoxyCodeLine{00026\ \textcolor{comment}{/*\ Clear\ message-\/uart\ buffer\ */}}
|
||||
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#define\ RS\_Clear\_Buff(\_buff\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ for(int\ i=0;\ i<MSG\_SIZE\_MAX;i++)\ \ \ \ \_buff\_[i]\ =\ NULL}}
|
||||
\DoxyCodeLine{00028\ }
|
||||
\DoxyCodeLine{00029\ \textcolor{comment}{/*\ Set/Reset\ flags\ */}}
|
||||
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#define\ RS\_Set\_Free(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_hRS\_-\/>fRS\_Busy\ =\ 0}}
|
||||
\DoxyCodeLine{00031\ \textcolor{preprocessor}{\#define\ RS\_Set\_Busy(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_hRS\_-\/>fRS\_Busy\ =\ 1}}
|
||||
\DoxyCodeLine{00032\ }
|
||||
\DoxyCodeLine{00033\ \textcolor{preprocessor}{\#define\ RS\_Set\_RX\_Flags(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \_hRS\_-\/>fRX\_Busy\ =\ 1;\ \_hRS\_-\/>fRX\_Done\ =\ 0;\ \_hRS\_-\/>fRX\_Half\ =\ 0}}
|
||||
\DoxyCodeLine{00034\ \textcolor{preprocessor}{\#define\ RS\_Set\_TX\_Flags(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \_hRS\_-\/>fTX\_Busy\ =\ 1;\ \_hRS\_-\/>fTX\_Done\ =\ 0}}
|
||||
\DoxyCodeLine{00035\ }
|
||||
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#define\ RS\_Reset\_RX\_Flags(\_hRS\_)\ \ \ \ \ \ \ \ \_hRS\_-\/>fRX\_Busy\ =\ 0;\ \_hRS\_-\/>fRX\_Done\ =\ 0;\ \_hRS\_-\/>fRX\_Half\ =\ 0}}
|
||||
\DoxyCodeLine{00037\ \textcolor{preprocessor}{\#define\ RS\_Reset\_TX\_Flags(\_hRS\_)\ \ \ \ \ \ \ \ \_hRS\_-\/>fTX\_Busy\ =\ 0;\ \_hRS\_-\/>fTX\_Done\ =\ 0}}
|
||||
\DoxyCodeLine{00038\ }
|
||||
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\#define\ RS\_Set\_RX\_End\_Flag(\_hRS\_)\ \ \ \ \ \ \ \_hRS\_-\/>fRX\_Done\ =\ 1}}
|
||||
\DoxyCodeLine{00040\ \textcolor{preprocessor}{\#define\ RS\_Set\_TX\_End\_Flag(\_hRS\_)\ \ \ \ \ \ \ \_hRS\_-\/>fTX\_Done\ =\ 1}}
|
||||
\DoxyCodeLine{00041\ }
|
||||
\DoxyCodeLine{00042\ \textcolor{preprocessor}{\#define\ RS\_Set\_RX\_End(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RS\_Reset\_RX\_Flags(\_hRS\_);\ RS\_Set\_RX\_End\_Flag(\_hRS\_)}}
|
||||
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#define\ RS\_Set\_TX\_End(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RS\_Reset\_TX\_Flags(\_hRS\_);\ RS\_Set\_TX\_End\_Flag(\_hRS\_)}}
|
||||
\DoxyCodeLine{00044\ }
|
||||
\DoxyCodeLine{00045\ \textcolor{comment}{/*\ Clear\ all\ RS\ stuff\ */}}
|
||||
\DoxyCodeLine{00046\ \textcolor{preprocessor}{\#define\ RS\_Clear\_All(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RS\_Clear\_Buff(\_hRS\_-\/>pBufferPtr);\ \ \ RS\_Reset\_RX\_Flags(\_hRS\_);\ \ \ RS\_Reset\_TX\_Flags(\_hRS\_);}}
|
||||
\DoxyCodeLine{00047\ }
|
||||
\DoxyCodeLine{00048\ \textcolor{comment}{//\#define\ MB\_Is\_RX\_Busy(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_hRS\_-\/>huartx-\/>gState\&HAL\_USART\_STATE\_BUSY\_RX)\ ==\ HAL\_USART\_STATE\_BUSY\_RX)}}
|
||||
\DoxyCodeLine{00049\ \textcolor{comment}{//\#define\ MB\_Is\_TX\_Busy(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ ((\_hRS\_-\/>huartx-\/>gState\&HAL\_USART\_STATE\_BUSY\_RX)\ ==\ HAL\_USART\_STATE\_BUSY\_TX)}}
|
||||
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#define\ RS\_Is\_RX\_Busy(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\_hRS\_-\/>fRX\_Busy\ ==\ 1)}}
|
||||
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#define\ RS\_Is\_TX\_Busy(\_hRS\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\_hRS\_-\/>fTX\_Busy\ ==\ 1)}}
|
||||
\DoxyCodeLine{00052\ }
|
||||
\DoxyCodeLine{00053\ }
|
||||
\DoxyCodeLine{00054\ \textcolor{preprocessor}{\#define\ IS\_IRQ\_MASKED()\ \ \ \ \ \ \ \ \ \ \ (\_\_get\_PRIMASK()\ !=\ 0U)}}
|
||||
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#define\ IS\_IRQ\_MODE()\ \ \ \ \ \ \ \ \ \ \ \ \ (\_\_get\_IPSR()\ !=\ 0U)}}
|
||||
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#define\ IS\_IRQ()\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (IS\_IRQ\_MODE()\ ||\ IS\_IRQ\_MASKED())}}
|
||||
\DoxyCodeLine{00058\ }
|
||||
\DoxyCodeLine{00059\ }
|
||||
\DoxyCodeLine{00060\ }
|
||||
\DoxyCodeLine{00063\ }
|
||||
\DoxyCodeLine{00064\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\textcolor{comment}{//\ struct\ with\ settings\ for\ custom\ function}}
|
||||
\DoxyCodeLine{00065\ \{}
|
||||
\DoxyCodeLine{00066\ \ \ \ \ UART\_HandleTypeDef\ *huartx;}
|
||||
\DoxyCodeLine{00067\ \ \ \ \ DMA\_HandleTypeDef\ *hdma\_uartx\_rx;}
|
||||
\DoxyCodeLine{00068\ \ \ \ \ }
|
||||
\DoxyCodeLine{00069\ \ \ \ \ GPIO\_TypeDef\ *GPIOx;}
|
||||
\DoxyCodeLine{00070\ \ \ \ \ uint16\_t\ GPIO\_PIN\_RX;}
|
||||
\DoxyCodeLine{00071\ \ \ \ \ uint16\_t\ GPIO\_PIN\_TX;}
|
||||
\DoxyCodeLine{00072\ \ \ \ \ }
|
||||
\DoxyCodeLine{00073\ \ \ \ \ DMA\_Stream\_TypeDef\ *DMAChannel;\ \textcolor{comment}{//\ DMAChannel\ =\ 0\ if\ doesnt\ need}}
|
||||
\DoxyCodeLine{00074\ \ \ \ \ uint32\_t\ DMA\_CHANNEL\_X;\ \textcolor{comment}{//\ DMAChannel\ =\ 0\ if\ doesnt\ need}}
|
||||
\DoxyCodeLine{00075\ \ \ \ \ }
|
||||
\DoxyCodeLine{00076\ \ \ \ \ }
|
||||
\DoxyCodeLine{00077\ \}\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}};}
|
||||
\DoxyCodeLine{00078\ }
|
||||
\DoxyCodeLine{00079\ }
|
||||
\DoxyCodeLine{00080\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/ENUMERATIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00081\ \textcolor{comment}{/*\ Enums\ for\ respond\ CMD\ about\ RS\ status*/}}
|
||||
\DoxyCodeLine{00082\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \ \ \ \ \ \ \ \textcolor{comment}{//\ RS\_StatusTypeDef}}
|
||||
\DoxyCodeLine{00083\ \{}
|
||||
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{comment}{/*\ IN-\/CODE\ STATUS\ (start\ from\ 0x01,\ and\ goes\ up)*/}}
|
||||
\DoxyCodeLine{00085\ \ \ \ \ \textcolor{comment}{/*0x01*/}\ \ \ \ RS\_OK\ =\ 0x01,}
|
||||
\DoxyCodeLine{00086\ \ \ \ \ \textcolor{comment}{/*0x02*/}\ \ \ \ RS\_ERR,\ }
|
||||
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{comment}{/*0x03*/}\ \ \ \ RS\_ABORTED,\ }
|
||||
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{comment}{/*0x04*/}\ \ \ \ RS\_BUSY,}
|
||||
\DoxyCodeLine{00089\ \ \ \ \ }
|
||||
\DoxyCodeLine{00090\ \ \ \ \ \textcolor{comment}{/*0x06*/}\ \ \ \ RS\_COLLECT\_MSG\_ERR,}
|
||||
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{comment}{/*0x07*/}\ \ \ \ RS\_PARSE\_MSG\_ERR,}
|
||||
\DoxyCodeLine{00092\ \ \ \ \ \textcolor{comment}{/*0x01*/}\ \ \ \ RS\_NOT\_MINE\_DATA,}
|
||||
\DoxyCodeLine{00093\ \ \ \ \ }
|
||||
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{comment}{//\ reserved\ values}}
|
||||
\DoxyCodeLine{00095\ \textcolor{comment}{//\ \ /*0x00*/\ \ \ \ RS\_UNKNOWN\_ERR\ =\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0x00,\ //\ reserved\ for\ case,\ if\ no\ one\ error\ founded\ (nothing\ changed\ response\ from\ zero)}}
|
||||
\DoxyCodeLine{00096\ \}RS\_StatusTypeDef;}
|
||||
\DoxyCodeLine{00097\ }
|
||||
\DoxyCodeLine{00098\ }
|
||||
\DoxyCodeLine{00099\ \textcolor{comment}{/*\ Enums\ for\ RS\ Modes\ */}}
|
||||
\DoxyCodeLine{00100\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \ \ \ \textcolor{comment}{//\ RS\_ModeTypeDef}}
|
||||
\DoxyCodeLine{00101\ \{}
|
||||
\DoxyCodeLine{00102\ \ \ \ \ SLAVE\_ALWAYS\_WAIT\ =\ \ \ \ \ \ \ \ \ \ \ \ \ 0x01,\ \ \ \ \ \ \ \textcolor{comment}{//\ Slave\ mode\ with\ infinity\ waiting}}
|
||||
\DoxyCodeLine{00103\ \ \ \ \ SLAVE\_TIMEOUT\_WAIT\ =\ \ \ \ \ \ \ \ \ \ \ \ 0x02,\ \ \ \ \ \ \ \textcolor{comment}{//\ Slave\ mode\ with\ waiting\ with\ timeout}}
|
||||
\DoxyCodeLine{00104\ \textcolor{comment}{//\ \ MASTER\ =\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0x03,\ \ \ \ \ \ \ //\ Master\ mode}}
|
||||
\DoxyCodeLine{00105\ \}RS\_ModeTypeDef;}
|
||||
\DoxyCodeLine{00106\ }
|
||||
\DoxyCodeLine{00107\ \textcolor{comment}{/*\ Enums\ for\ RS\ UART\ Modes\ */}}
|
||||
\DoxyCodeLine{00108\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \ \ \ \textcolor{comment}{//\ RS\_ITModeTypeDef}}
|
||||
\DoxyCodeLine{00109\ \{}
|
||||
\DoxyCodeLine{00110\ \ \ \ \ BLCK\_MODE\ =\ \ \ \ \ \ \ \ \ 0x00,\ \ \ \ \ \ \ \textcolor{comment}{//\ Blocking\ mode}}
|
||||
\DoxyCodeLine{00111\ \ \ \ \ IT\_MODE\ =\ \ \ \ \ \ \ \ \ \ \ 0x01,\ \ \ \ \ \ \ \textcolor{comment}{//\ Interrupt\ mode}}
|
||||
\DoxyCodeLine{00112\ \}RS\_ITModeTypeDef;}
|
||||
\DoxyCodeLine{00113\ }
|
||||
\DoxyCodeLine{00114\ \textcolor{comment}{/*\ Enums\ for\ Response\ modes\ */}}
|
||||
\DoxyCodeLine{00115\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \ \ \ \textcolor{comment}{//\ RS\_RespModeTypeDef}}
|
||||
\DoxyCodeLine{00116\ \{}
|
||||
\DoxyCodeLine{00117\ \ \ \ \ NO\_RESPONSE\ =\ \ \ 0x00,\ \ \ \ \ \ \ \textcolor{comment}{//\ No\ response:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ only\ receive/transmit\ without\ any\ response}}
|
||||
\DoxyCodeLine{00118\ \ \ \ \ SING\_RESPONSE\ =\ 0x01,\ \ \ \ \ \ \ \textcolor{comment}{//\ Single\ response:\ \ \ \ \ \ \ \ \ respond\ once\ after\ receive\ /\ wait\ for\ one\ respond\ after\ transmit}}
|
||||
\DoxyCodeLine{00119\ \ \ \ \ CIRC\_RESPONSE\ =\ 0x02,\ \ \ \ \ \ \ \textcolor{comment}{//\ Circular\ response:\ \ \ }}
|
||||
\DoxyCodeLine{00120\ \textcolor{comment}{//\ IT\_MODE:\ \ \ \ \ Receive\ -\/\ permanent\ receive\ mode\ and\ after\ any\ received\ message\ send\ respond,\ Transmit\ -\/\ same\ as\ in\ Receive,\ but\ it\ start\ with\ Transmit}}
|
||||
\DoxyCodeLine{00121\ \textcolor{comment}{//\ BLCK\_MODE:\ Transmit\ -\/\ transmit\ until\ response\ is\ taken,\ Receive\ -\/\ unused}}
|
||||
\DoxyCodeLine{00122\ \}RS\_RespModeTypeDef;}
|
||||
\DoxyCodeLine{00123\ }
|
||||
\DoxyCodeLine{00124\ \textcolor{comment}{/*\ Enums\ for\ Abort\ modes\ */}}
|
||||
\DoxyCodeLine{00125\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \ \ \ \textcolor{comment}{//\ RS\_AbortTypeDef}}
|
||||
\DoxyCodeLine{00126\ \{}
|
||||
\DoxyCodeLine{00127\ \ \ \ \ ABORT\_TX\ =\ \ \ \ \ \ \ \ \ \ 0x01,\ \ \ \ \ \ \ \textcolor{comment}{//\ Abort\ transmit}}
|
||||
\DoxyCodeLine{00128\ \ \ \ \ ABORT\_RX\ =\ \ \ \ \ \ \ \ \ \ 0x02,\ \ \ \ \ \ \ \textcolor{comment}{//\ Abort\ receive}}
|
||||
\DoxyCodeLine{00129\ \ \ \ \ ABORT\_RX\_TX\ =\ \ \ \ \ \ \ 0x03,\ \ \ \ \ \ \ \textcolor{comment}{//\ Abort\ receive\ and\ transmit}}
|
||||
\DoxyCodeLine{00130\ \ \ \ \ ABORT\_RS\ =\ \ \ \ \ \ \ \ \ \ 0x04,\ \ \ \ \ \ \ \textcolor{comment}{//\ Abort\ uart\ and\ reset\ RS\ structure}}
|
||||
\DoxyCodeLine{00131\ \}RS\_AbortTypeDef;}
|
||||
\DoxyCodeLine{00132\ }
|
||||
\DoxyCodeLine{00133\ \textcolor{comment}{/*\ Enums\ for\ RX\ Size\ modes\ */}}
|
||||
\DoxyCodeLine{00134\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}\ \ \ \ \textcolor{comment}{//\ RS\_RXSizeTypeDef}}
|
||||
\DoxyCodeLine{00135\ \{}
|
||||
\DoxyCodeLine{00136\ \ \ \ \ RS\_RX\_Size\_Const\ =\ \ \ \ \ \ 0x01,\ \ \ \ \ \ \ \textcolor{comment}{//\ size\ of\ receiving\ message\ is\ constant}}
|
||||
\DoxyCodeLine{00137\ \ \ \ \ RS\_RX\_Size\_NotConst\ =\ \ \ 0x02,\ \ \ \ \ \ \ \textcolor{comment}{//\ size\ of\ receiving\ message\ isnt\ constant}}
|
||||
\DoxyCodeLine{00138\ \}RS\_RXSizeTypeDef;}
|
||||
\DoxyCodeLine{00139\ }
|
||||
\DoxyCodeLine{00140\ }
|
||||
\DoxyCodeLine{00141\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/STRUCTURE\ FOR\ HANDLE\ RS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00146\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ \ }\textcolor{comment}{//\ RS\_HandleTypeDef}}
|
||||
\DoxyCodeLine{00147\ \{\ \ \ \ \ \ \ }
|
||||
\DoxyCodeLine{00148\ \ \ \ \ \textcolor{comment}{/*\ MESSAGE\ */}}
|
||||
\DoxyCodeLine{00149\ \ \ \ \ uint8\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ID;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ ID\ of\ RS\ "{}channel"{}}}
|
||||
\DoxyCodeLine{00150\ \ \ \ \ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *pMessagePtr;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ pointer\ to\ message\ struct}}
|
||||
\DoxyCodeLine{00151\ \ \ \ \ uint8\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *pBufferPtr;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ pointer\ to\ message\ buffer}}
|
||||
\DoxyCodeLine{00152\ \ \ \ \ uint32\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RS\_Message\_Size;\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ size\ of\ whole\ message,\ not\ only\ data}}
|
||||
\DoxyCodeLine{00153\ \ \ \ \ }
|
||||
\DoxyCodeLine{00154\ \ \ \ \ \textcolor{comment}{/*\ HANDLERS\ and\ SETTINGS\ */}}
|
||||
\DoxyCodeLine{00155\ \ \ \ \ UART\_HandleTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ *huartx;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ handler\ for\ used\ uart}}
|
||||
\DoxyCodeLine{00156\ \ \ \ \ TIM\_HandleTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *htimx;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ handler\ for\ used\ tim}}
|
||||
\DoxyCodeLine{00157\ \ \ \ \ RS\_ModeTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sRS\_Mode;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ slave\ or\ master\ @ref\ RS\_ModeTypeDef}}
|
||||
\DoxyCodeLine{00158\ \ \ \ \ RS\_ITModeTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sRS\_IT\_Mode;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ IT\ mode,\ \ \ \ \ 0\ -\/\ Blocking\ mode\ }}
|
||||
\DoxyCodeLine{00159\ \ \ \ \ uint32\_t\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sRS\_Timeout;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ setting:\ timeout\ in\ ms}}
|
||||
\DoxyCodeLine{00160\ \ \ \ \ RS\_RXSizeTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sRS\_RX\_Size\_Mode;\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ setting:\ 1\ -\/\ not\ const,\ 0\ -\/\ const\ }}
|
||||
\DoxyCodeLine{00161\ \ \ \ \ }
|
||||
\DoxyCodeLine{00162\ \ \ \ \ \textcolor{comment}{/*\ FLAGS\ */}\ \ \ \ \ }
|
||||
\DoxyCodeLine{00163\ \ \ \ \ \textcolor{comment}{//\ These\ flags\ for\ controling\ receive/transmit}}
|
||||
\DoxyCodeLine{00164\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fRX\_Half:1;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 0\ -\/\ receiving\ msg\ before\ ByteCnt,\ \ \ \ 0\ -\/\ receiving\ msg\ after\ ByteCnt}}
|
||||
\DoxyCodeLine{00165\ \ \ \ \ }
|
||||
\DoxyCodeLine{00166\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fRS\_Busy:1;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ RS\ is\ busy,\ 0\ -\/\ RS\ isnt\ busy\ \ \ \ \ }}
|
||||
\DoxyCodeLine{00167\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fRX\_Busy:1;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ receiving\ is\ active,\ \ \ \ \ 0\ -\/\ receiving\ isnt\ active}}
|
||||
\DoxyCodeLine{00168\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fTX\_Busy:1;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ transmiting\ is\ active,\ 0\ -\/\ transmiting\ isnt\ active\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }}
|
||||
\DoxyCodeLine{00169\ \ \ \ \ }
|
||||
\DoxyCodeLine{00170\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fRX\_Done:1;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ receiving\ is\ done,\ 0\ -\/\ receiving\ isnt\ done\ \ \ }}
|
||||
\DoxyCodeLine{00171\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fTX\_Done:1;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ transmiting\ is\ done,\ 0\ -\/\ transmiting\ isnt\ done\ \ \ }}
|
||||
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ }
|
||||
\DoxyCodeLine{00173\ \ \ \ \ \textcolor{comment}{//\ setted\ by\ user}}
|
||||
\DoxyCodeLine{00174\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fMessageHandled:1;\ \ \ \ \ \ \textcolor{comment}{//\ 1\ -\/\ RS\ command\ is\ handled,\ 0\ -\/\ RS\ command\ isnt\ handled\ yet}}
|
||||
\DoxyCodeLine{00175\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fEchoResponse:1;\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 0\ -\/\ receiving\ msg\ before\ ByteCnt,\ \ \ \ 0\ -\/\ receiving\ msg\ after\ ByteCnt}}
|
||||
\DoxyCodeLine{00176\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fDeferredResponse:1;\ \ \ \ \textcolor{comment}{//\ 0\ -\/\ receiving\ msg\ before\ ByteCnt,\ \ \ \ 0\ -\/\ receiving\ msg\ after\ ByteCnt}}
|
||||
\DoxyCodeLine{00177\ \ \ \ \ }
|
||||
\DoxyCodeLine{00178\ \ \ \ \ \textcolor{comment}{/*\ RS\ STATUS\ */}}
|
||||
\DoxyCodeLine{00179\ \ \ \ \ RS\_StatusTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RS\_STATUS;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ RS\ status}}
|
||||
\DoxyCodeLine{00180\ \ \ \ \ RS\_FunctonTypeDef\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RS\_RESPONSE;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ RS\ response}}
|
||||
\DoxyCodeLine{00181\ \}\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}};}
|
||||
\DoxyCodeLine{00182\ }
|
||||
\DoxyCodeLine{00183\ }
|
||||
\DoxyCodeLine{00185\ }
|
||||
\DoxyCodeLine{00186\ }
|
||||
\DoxyCodeLine{00187\ }
|
||||
\DoxyCodeLine{00188\ }
|
||||
\DoxyCodeLine{00189\ }
|
||||
\DoxyCodeLine{00190\ }
|
||||
\DoxyCodeLine{00191\ }
|
||||
\DoxyCodeLine{00192\ }
|
||||
\DoxyCodeLine{00193\ }
|
||||
\DoxyCodeLine{00194\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/FUNCTIONS\ FOR\ PROCESSING\ MESSAGE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00195\ \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/Defined\ by\ users\ purposes-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
|
||||
\DoxyCodeLine{00203\ RS\_StatusTypeDef\ RS\_Response(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg);}
|
||||
\DoxyCodeLine{00204\ }
|
||||
\DoxyCodeLine{00213\ RS\_StatusTypeDef\ Collect\_Message(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg,\ uint8\_t\ *msg\_uart\_buff);}
|
||||
\DoxyCodeLine{00214\ }
|
||||
\DoxyCodeLine{00223\ RS\_StatusTypeDef\ Parse\_Message(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg,\ uint8\_t\ *msg\_uart\_buff);}
|
||||
\DoxyCodeLine{00224\ }
|
||||
\DoxyCodeLine{00232\ RS\_StatusTypeDef\ RS\_Define\_Size\_of\_RX\_Message(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ uint32\_t\ *rx\_data\_size);}
|
||||
\DoxyCodeLine{00233\ }
|
||||
\DoxyCodeLine{00234\ }
|
||||
\DoxyCodeLine{00235\ \textcolor{comment}{/*\ MORE\ USER\ FUNCTION\ BEGIN*/}}
|
||||
\DoxyCodeLine{00236\ \textcolor{comment}{/*\ MORE\ USER\ FUNCTION\ END*/}}
|
||||
\DoxyCodeLine{00237\ }
|
||||
\DoxyCodeLine{00238\ }
|
||||
\DoxyCodeLine{00239\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GENERAL\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00240\ \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/Should\ be\ called\ from\ main\ code-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
|
||||
\DoxyCodeLine{00248\ RS\_StatusTypeDef\ RS\_Receive\_IT(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg);}
|
||||
\DoxyCodeLine{00249\ }
|
||||
\DoxyCodeLine{00257\ RS\_StatusTypeDef\ RS\_Transmit\_IT(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg);}
|
||||
\DoxyCodeLine{00258\ }
|
||||
\DoxyCodeLine{00268\ RS\_StatusTypeDef\ RS\_Init(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart,\ \mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}}\ *stim,\ uint8\_t\ *pRS\_BufferPtr);}
|
||||
\DoxyCodeLine{00269\ }
|
||||
\DoxyCodeLine{00283\ RS\_StatusTypeDef\ RS\_Abort(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ RS\_AbortTypeDef\ AbortMode);}
|
||||
\DoxyCodeLine{00284\ }
|
||||
\DoxyCodeLine{00285\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/SUPPORT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
|
||||
\DoxyCodeLine{00286\ \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/Called\ from\ General\ functions-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
|
||||
\DoxyCodeLine{00294\ RS\_StatusTypeDef\ RS\_Handle\_Receive\_Start(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg);}
|
||||
\DoxyCodeLine{00302\ RS\_StatusTypeDef\ RS\_Handle\_Transmit\_Start(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg);}
|
||||
\DoxyCodeLine{00303\ \textcolor{comment}{/*\ UART\ RX\ Callback:\ define\ behaviour\ after\ receiving\ message\ */}}
|
||||
\DoxyCodeLine{00304\ RS\_StatusTypeDef\ RS\_UART\_RxCpltCallback(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS);}
|
||||
\DoxyCodeLine{00305\ \textcolor{comment}{/*\ UART\ RX\ Callback:\ define\ behaviour\ after\ transmiting\ message\ */}}
|
||||
\DoxyCodeLine{00306\ RS\_StatusTypeDef\ RS\_UART\_TxCpltCallback(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS);}
|
||||
\DoxyCodeLine{00307\ \textcolor{comment}{/*\ Handler\ for\ UART\ */}}
|
||||
\DoxyCodeLine{00308\ \textcolor{keywordtype}{void}\ RS\_UART\_Handler(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS);}
|
||||
\DoxyCodeLine{00309\ \textcolor{comment}{/*\ Handler\ for\ TIM\ */}}
|
||||
\DoxyCodeLine{00310\ \textcolor{keywordtype}{void}\ RS\_TIM\_Handler(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS);}
|
||||
\DoxyCodeLine{00311\ }
|
||||
\DoxyCodeLine{00312\ }
|
||||
\DoxyCodeLine{00313\ }
|
||||
\DoxyCodeLine{00314\ }
|
||||
\DoxyCodeLine{00315\ }
|
||||
\DoxyCodeLine{00316\ }
|
||||
\DoxyCodeLine{00317\ HAL\_StatusTypeDef\ RS\_UART\_Init(\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart);}
|
||||
\DoxyCodeLine{00318\ \textcolor{keywordtype}{void}\ UART\_GPIO\_Init(GPIO\_TypeDef\ *GPIOx,\ uint16\_t\ GPIO\_PIN\_RX,\ uint16\_t\ GPIO\_PIN\_TX);}
|
||||
\DoxyCodeLine{00319\ \textcolor{keywordtype}{void}\ UART\_DMA\_Init(UART\_HandleTypeDef\ *huart,\ DMA\_HandleTypeDef\ *hdma\_rx,\ DMA\_Stream\_TypeDef\ *DMAChannel,\ uint32\_t\ DMA\_CHANNEL\_X);}
|
||||
\DoxyCodeLine{00320\ \textcolor{keywordtype}{void}\ User\_UART\_MspInit(UART\_HandleTypeDef\ *huart);}
|
||||
\DoxyCodeLine{00321\ }
|
||||
\DoxyCodeLine{00322\ HAL\_StatusTypeDef\ User\_UART\_Check(\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\_SettingsTypeDef}}\ *suart);}
|
||||
\DoxyCodeLine{00323\ }
|
||||
\DoxyCodeLine{00324\ \textcolor{preprocessor}{\#define\ \_\_USER\_LINKDMA(\_\_HANDLE\_\_,\ \_\_PPP\_DMA\_FIELD\_\_,\ \_\_DMA\_HANDLE\_\_)\ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{00325\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
|
||||
\DoxyCodeLine{00326\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\_\_HANDLE\_\_)-\/>\_\_PPP\_DMA\_FIELD\_\_\ =\ (\_\_DMA\_HANDLE\_\_);\ \(\backslash\)}}
|
||||
\DoxyCodeLine{00327\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\_\_DMA\_HANDLE\_\_)-\/>Parent\ =\ (\_\_HANDLE\_\_);\}\ while(0U)}}
|
||||
\DoxyCodeLine{00328\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
|
||||
\DoxyCodeLine{00329\ }
|
||||
\DoxyCodeLine{00330\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
|
||||
\DoxyCodeLine{00331\ }
|
||||
\DoxyCodeLine{00332\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_UART\_USER\_H\_}}
|
||||
|
||||
\end{DoxyCode}
|
||||
@@ -0,0 +1,90 @@
|
||||
\doxysection{RS\+\_\+\+Handle\+Type\+Def Struct Reference}
|
||||
\hypertarget{struct_r_s___handle_type_def}{}\label{struct_r_s___handle_type_def}\index{RS\_HandleTypeDef@{RS\_HandleTypeDef}}
|
||||
|
||||
|
||||
Handle for RS communication.
|
||||
|
||||
|
||||
|
||||
|
||||
{\ttfamily \#include $<$rs\+\_\+message.\+h$>$}
|
||||
|
||||
\doxysubsubsection*{Data Fields}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_ae05e4021c05cb62085215a5b3d03c0bc}\label{struct_r_s___handle_type_def_ae05e4021c05cb62085215a5b3d03c0bc}
|
||||
uint8\+\_\+t {\bfseries ID}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a88ae0a4f03c2dcacd81b52096623d889}\label{struct_r_s___handle_type_def_a88ae0a4f03c2dcacd81b52096623d889}
|
||||
\mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*} {\bfseries p\+Message\+Ptr}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a669517eccd963ae4f9d2d577e2d0934f}\label{struct_r_s___handle_type_def_a669517eccd963ae4f9d2d577e2d0934f}
|
||||
uint8\+\_\+t \texorpdfstring{$\ast$}{*} {\bfseries p\+Buffer\+Ptr}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a16caf9f00c09a4d54890da6e4fc4274b}\label{struct_r_s___handle_type_def_a16caf9f00c09a4d54890da6e4fc4274b}
|
||||
uint32\+\_\+t {\bfseries RS\+\_\+\+Message\+\_\+\+Size}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a0e36e9b1b63956cd293971aed1093181}\label{struct_r_s___handle_type_def_a0e36e9b1b63956cd293971aed1093181}
|
||||
UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries huartx}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a910371de958804a12d90272976015b91}\label{struct_r_s___handle_type_def_a910371de958804a12d90272976015b91}
|
||||
TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries htimx}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a5a3d42cab7d7603dc8d31be5c8645e02}\label{struct_r_s___handle_type_def_a5a3d42cab7d7603dc8d31be5c8645e02}
|
||||
RS\+\_\+\+Mode\+Type\+Def {\bfseries s\+RS\+\_\+\+Mode}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a95952089da1c4c2eef20380db162bb77}\label{struct_r_s___handle_type_def_a95952089da1c4c2eef20380db162bb77}
|
||||
RS\+\_\+\+ITMode\+Type\+Def {\bfseries s\+RS\+\_\+\+IT\+\_\+\+Mode}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_adc5c4a4075d22fc7cdd538d284c45158}\label{struct_r_s___handle_type_def_adc5c4a4075d22fc7cdd538d284c45158}
|
||||
uint32\+\_\+t {\bfseries s\+RS\+\_\+\+Timeout}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a08481653f3280f5486083bd696598634}\label{struct_r_s___handle_type_def_a08481653f3280f5486083bd696598634}
|
||||
RS\+\_\+\+RXSize\+Type\+Def {\bfseries s\+RS\+\_\+\+RX\+\_\+\+Size\+\_\+\+Mode}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a0ab58800ad233c8d78c3f5bd84d5dd05}\label{struct_r_s___handle_type_def_a0ab58800ad233c8d78c3f5bd84d5dd05}
|
||||
unsigned {\bfseries f\+RX\+\_\+\+Half}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a9e1f372e541cf388be0c52d47bb80cb8}\label{struct_r_s___handle_type_def_a9e1f372e541cf388be0c52d47bb80cb8}
|
||||
unsigned {\bfseries f\+RS\+\_\+\+Busy}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a947a1fe0d91ba0395187d18a14b505fb}\label{struct_r_s___handle_type_def_a947a1fe0d91ba0395187d18a14b505fb}
|
||||
unsigned {\bfseries f\+RX\+\_\+\+Busy}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a24ccf83bfa9917253d2ff36cc312df27}\label{struct_r_s___handle_type_def_a24ccf83bfa9917253d2ff36cc312df27}
|
||||
unsigned {\bfseries f\+TX\+\_\+\+Busy}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_ae79c8a604d2842548e685fce1635040c}\label{struct_r_s___handle_type_def_ae79c8a604d2842548e685fce1635040c}
|
||||
unsigned {\bfseries f\+RX\+\_\+\+Done}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a5b45936c5266e15b9daa67cbd1480706}\label{struct_r_s___handle_type_def_a5b45936c5266e15b9daa67cbd1480706}
|
||||
unsigned {\bfseries f\+TX\+\_\+\+Done}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a6909a2ee1bb3513505bbd4984ff591b5}\label{struct_r_s___handle_type_def_a6909a2ee1bb3513505bbd4984ff591b5}
|
||||
unsigned {\bfseries f\+Message\+Handled}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_aec772d6a0db85220c5db8634ddf16120}\label{struct_r_s___handle_type_def_aec772d6a0db85220c5db8634ddf16120}
|
||||
unsigned {\bfseries f\+Echo\+Response}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a0c3c3aee0342b80b75a782aec6d46c2e}\label{struct_r_s___handle_type_def_a0c3c3aee0342b80b75a782aec6d46c2e}
|
||||
unsigned {\bfseries f\+Deferred\+Response}\+:1
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_a81db00ae327dbd10d04207c3db186fbf}\label{struct_r_s___handle_type_def_a81db00ae327dbd10d04207c3db186fbf}
|
||||
RS\+\_\+\+Status\+Type\+Def {\bfseries RS\+\_\+\+STATUS}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___handle_type_def_ac5e044058c7c85e15623836e8e832057}\label{struct_r_s___handle_type_def_ac5e044058c7c85e15623836e8e832057}
|
||||
RS\+\_\+\+Functon\+Type\+Def {\bfseries RS\+\_\+\+RESPONSE}
|
||||
\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Detailed Description}
|
||||
Handle for RS communication.
|
||||
|
||||
\begin{DoxyNote}{Note}
|
||||
Prefixes\+: h -\/ handle, s -\/ settings, f -\/ flag
|
||||
\end{DoxyNote}
|
||||
|
||||
|
||||
The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
|
||||
\item
|
||||
rs\+\_\+message.\+h\end{DoxyCompactItemize}
|
||||
@@ -0,0 +1,34 @@
|
||||
\doxysection{RS\+\_\+\+Msg\+Type\+Def Struct Reference}
|
||||
\hypertarget{struct_r_s___msg_type_def}{}\label{struct_r_s___msg_type_def}\index{RS\_MsgTypeDef@{RS\_MsgTypeDef}}
|
||||
\doxysubsubsection*{Data Fields}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_a6186caa23a7d17866abb7d27cb8d9b13}\label{struct_r_s___msg_type_def_a6186caa23a7d17866abb7d27cb8d9b13}
|
||||
uint8\+\_\+t {\bfseries Mb\+Addr}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_a49661162da2af9d2e939dfd8ccec633b}\label{struct_r_s___msg_type_def_a49661162da2af9d2e939dfd8ccec633b}
|
||||
RS\+\_\+\+Functon\+Type\+Def {\bfseries Func\+\_\+\+Code}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_ac2fbbe9d6ed859cacb2928626be8f70d}\label{struct_r_s___msg_type_def_ac2fbbe9d6ed859cacb2928626be8f70d}
|
||||
uint8\+\_\+t {\bfseries Except\+\_\+\+Code}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_aba418f23e6ab48bb7fe6ff160373d10f}\label{struct_r_s___msg_type_def_aba418f23e6ab48bb7fe6ff160373d10f}
|
||||
uint16\+\_\+t {\bfseries Addr}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_aab19fca65df39b3dfc1161bf1abd2530}\label{struct_r_s___msg_type_def_aab19fca65df39b3dfc1161bf1abd2530}
|
||||
uint16\+\_\+t {\bfseries Qnt}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_a98b3d756f2da2ddac397749bee665e60}\label{struct_r_s___msg_type_def_a98b3d756f2da2ddac397749bee665e60}
|
||||
uint8\+\_\+t {\bfseries Byte\+Cnt}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_af808c7dd6b4ba12cf5e106f027cf324c}\label{struct_r_s___msg_type_def_af808c7dd6b4ba12cf5e106f027cf324c}
|
||||
uint16\+\_\+t {\bfseries DATA} \mbox{[}DATA\+\_\+\+MAX\+\_\+\+SIZE\mbox{]}
|
||||
\item
|
||||
\Hypertarget{struct_r_s___msg_type_def_ab36aadc5b220463d41e442a39f3f13e8}\label{struct_r_s___msg_type_def_ab36aadc5b220463d41e442a39f3f13e8}
|
||||
uint16\+\_\+t {\bfseries MB\+\_\+\+CRC}
|
||||
\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
|
||||
\item
|
||||
modbus.\+h\end{DoxyCompactItemize}
|
||||
@@ -0,0 +1,16 @@
|
||||
\doxysection{TIM\+\_\+\+Settings\+Type\+Def Struct Reference}
|
||||
\hypertarget{struct_t_i_m___settings_type_def}{}\label{struct_t_i_m___settings_type_def}\index{TIM\_SettingsTypeDef@{TIM\_SettingsTypeDef}}
|
||||
\doxysubsubsection*{Data Fields}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\Hypertarget{struct_t_i_m___settings_type_def_a910371de958804a12d90272976015b91}\label{struct_t_i_m___settings_type_def_a910371de958804a12d90272976015b91}
|
||||
TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries htimx}
|
||||
\item
|
||||
\Hypertarget{struct_t_i_m___settings_type_def_a8d6c153e149fb61b28a4eb94f1e6a939}\label{struct_t_i_m___settings_type_def_a8d6c153e149fb61b28a4eb94f1e6a939}
|
||||
TIM\+\_\+\+ITMode\+Type\+Def {\bfseries TIM\+\_\+\+IT\+\_\+\+MODE}\+:1
|
||||
\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
|
||||
\item
|
||||
tim\+\_\+general.\+h\end{DoxyCompactItemize}
|
||||
@@ -0,0 +1,31 @@
|
||||
\doxysection{UART\+\_\+\+Settings\+Type\+Def Struct Reference}
|
||||
\hypertarget{struct_u_a_r_t___settings_type_def}{}\label{struct_u_a_r_t___settings_type_def}\index{UART\_SettingsTypeDef@{UART\_SettingsTypeDef}}
|
||||
\doxysubsubsection*{Data Fields}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_a0e36e9b1b63956cd293971aed1093181}\label{struct_u_a_r_t___settings_type_def_a0e36e9b1b63956cd293971aed1093181}
|
||||
UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries huartx}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_a2320e05e7b39955a916a627a7a27a332}\label{struct_u_a_r_t___settings_type_def_a2320e05e7b39955a916a627a7a27a332}
|
||||
DMA\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries hdma\+\_\+uartx\+\_\+rx}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_a1cb502d7339fa12f24109da591102eb2}\label{struct_u_a_r_t___settings_type_def_a1cb502d7339fa12f24109da591102eb2}
|
||||
GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries GPIOx}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_abaeeb4afab801fd79f4ec7d2a5dea905}\label{struct_u_a_r_t___settings_type_def_abaeeb4afab801fd79f4ec7d2a5dea905}
|
||||
uint16\+\_\+t {\bfseries GPIO\+\_\+\+PIN\+\_\+\+RX}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_a94c85d6469c4e147ad9eb64c90c65361}\label{struct_u_a_r_t___settings_type_def_a94c85d6469c4e147ad9eb64c90c65361}
|
||||
uint16\+\_\+t {\bfseries GPIO\+\_\+\+PIN\+\_\+\+TX}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_a33f6f0ee5f51c9743f371c9f0cd150cd}\label{struct_u_a_r_t___settings_type_def_a33f6f0ee5f51c9743f371c9f0cd150cd}
|
||||
DMA\+\_\+\+Stream\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*} {\bfseries DMAChannel}
|
||||
\item
|
||||
\Hypertarget{struct_u_a_r_t___settings_type_def_a368dd11dde59368be144107b6027e892}\label{struct_u_a_r_t___settings_type_def_a368dd11dde59368be144107b6027e892}
|
||||
uint32\+\_\+t {\bfseries DMA\+\_\+\+CHANNEL\+\_\+X}
|
||||
\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
|
||||
\item
|
||||
rs\+\_\+message.\+h\end{DoxyCompactItemize}
|
||||
2557
научка/code/pwm_motor_control/Modbus/latex/tabu_doxygen.sty
Normal file
@@ -0,0 +1,59 @@
|
||||
\doxysection{tim\+\_\+general.\+h}
|
||||
\hypertarget{tim__general_8h_source}{}\label{tim__general_8h_source}
|
||||
\begin{DoxyCode}{0}
|
||||
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ \_\_TIM\_USER\_H\_}}
|
||||
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ \_\_TIM\_USER\_H\_}}
|
||||
\DoxyCodeLine{00003\ }
|
||||
\DoxyCodeLine{00004\ }
|
||||
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#define\ HAL\_TIM\_MODULE\_ENABLED\ }\textcolor{comment}{//\ need\ to\ uncomment\ this\ define\ in\ stm32f4xx\_hal\_conf.h}}
|
||||
\DoxyCodeLine{00008\ }
|
||||
\DoxyCodeLine{00009\ \textcolor{comment}{//\#define\ USE\_TIM1}}
|
||||
\DoxyCodeLine{00010\ \textcolor{comment}{//\#define\ USE\_TIM2}}
|
||||
\DoxyCodeLine{00011\ \textcolor{comment}{//\#define\ USE\_TIM3}}
|
||||
\DoxyCodeLine{00012\ \textcolor{comment}{//\#define\ USE\_TIM4}}
|
||||
\DoxyCodeLine{00013\ \textcolor{comment}{//\#define\ USE\_TIM5}}
|
||||
\DoxyCodeLine{00014\ \textcolor{comment}{//\#define\ USE\_TIM6}}
|
||||
\DoxyCodeLine{00015\ \textcolor{comment}{//\#define\ USE\_TIM7}}
|
||||
\DoxyCodeLine{00016\ \textcolor{comment}{//\#define\ USE\_TIM8}}
|
||||
\DoxyCodeLine{00017\ \textcolor{comment}{//\#define\ USE\_TIM9}}
|
||||
\DoxyCodeLine{00018\ \textcolor{comment}{//\#define\ USE\_TIM10}}
|
||||
\DoxyCodeLine{00019\ \textcolor{comment}{//\#define\ USE\_TIM11}}
|
||||
\DoxyCodeLine{00020\ \textcolor{comment}{//\#define\ USE\_TIM12}}
|
||||
\DoxyCodeLine{00021\ \textcolor{comment}{//\#define\ USE\_TIM13}}
|
||||
\DoxyCodeLine{00022\ \textcolor{comment}{//\#define\ USE\_TIM14}}
|
||||
\DoxyCodeLine{00023\ \textcolor{comment}{/*\ note:\ used\ uart\ defines\ in\ modbus.h\ */}}
|
||||
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ "{}modbus.h"{}}\ }
|
||||
\DoxyCodeLine{00025\ }
|
||||
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#include\ "{}stm32f4xx\_hal.h"{}}}
|
||||
\DoxyCodeLine{00028\ }
|
||||
\DoxyCodeLine{00029\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{enum}}
|
||||
\DoxyCodeLine{00030\ \{}
|
||||
\DoxyCodeLine{00031\ \ \ \ \ TIM\_IT\_DISABLE\ =\ 0x00,}
|
||||
\DoxyCodeLine{00032\ \ \ \ \ TIM\_IT\_ENABLE\ =\ 0x01,}
|
||||
\DoxyCodeLine{00033\ \}TIM\_ITModeTypeDef;}
|
||||
\DoxyCodeLine{00034\ }
|
||||
\DoxyCodeLine{00035\ }
|
||||
\DoxyCodeLine{00036\ \textcolor{comment}{//typedef\ enum}}
|
||||
\DoxyCodeLine{00037\ \textcolor{comment}{//\{}}
|
||||
\DoxyCodeLine{00038\ \textcolor{comment}{//\ \ TIM\_1MS\_BASE\ =\ 0xFFFF,}}
|
||||
\DoxyCodeLine{00039\ \textcolor{comment}{//\ \ TIM\_1US\_BASE\ =\ 0xFFFF-\/1,}}
|
||||
\DoxyCodeLine{00040\ \textcolor{comment}{//\}TIM\_TickBaseTypeDef;}}
|
||||
\DoxyCodeLine{00041\ }
|
||||
\DoxyCodeLine{00042\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }\textcolor{comment}{//\ struct\ with\ settings\ for\ custom\ function}}
|
||||
\DoxyCodeLine{00043\ \{}
|
||||
\DoxyCodeLine{00044\ \ \ \ \ TIM\_HandleTypeDef\ *htimx;}
|
||||
\DoxyCodeLine{00045\ \ \ \ \ }
|
||||
\DoxyCodeLine{00046\ \textcolor{comment}{//\ \ TIM\_TickBaseTypeDef\ TickBase;}}
|
||||
\DoxyCodeLine{00047\ \textcolor{comment}{//\ \ TIM\_TickBaseTypeDef\ TimPeriod;}}
|
||||
\DoxyCodeLine{00048\ \ \ \ \ }
|
||||
\DoxyCodeLine{00049\ \ \ \ \ TIM\_ITModeTypeDef\ \ \ TIM\_IT\_MODE:1;}
|
||||
\DoxyCodeLine{00050\ \ \ \ \ }
|
||||
\DoxyCodeLine{00051\ \}\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}};}
|
||||
\DoxyCodeLine{00052\ }
|
||||
\DoxyCodeLine{00053\ HAL\_StatusTypeDef\ User\_TIM\_Init(\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}}*\ stim);}
|
||||
\DoxyCodeLine{00054\ \textcolor{keywordtype}{void}\ User\_TIM\_Base\_MspInit(TIM\_HandleTypeDef*\ htim,\ TIM\_ITModeTypeDef\ it\_mode);}
|
||||
\DoxyCodeLine{00055\ }
|
||||
\DoxyCodeLine{00056\ }
|
||||
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ \_\_TIM\_BOOT\_H}}
|
||||
|
||||
\end{DoxyCode}
|
||||
77
научка/code/pwm_motor_control/Modbus/modbus_data.h
Normal file
@@ -0,0 +1,77 @@
|
||||
//-----------MODBUS DEVICE DATA SETTING-------------
|
||||
//--------------DEFINES FOR REGISTERS---------------
|
||||
// DEFINES FOR ARRAYS
|
||||
#define LOG_SIZE 500
|
||||
|
||||
#define R_SINE_LOG_ADDR 0
|
||||
#define R_SINE_LOG_QNT LOG_SIZE
|
||||
|
||||
#define R_PWM_LOG_ADDR 500
|
||||
#define R_PWM_LOG_QNT LOG_SIZE
|
||||
|
||||
#define R_CNT_LOG_ADDR 1000
|
||||
#define R_CNT_LOG_QNT LOG_SIZE
|
||||
|
||||
#define R_TIME_LOG_ADDR 1500
|
||||
#define R_TIME_LOG_QNT LOG_SIZE
|
||||
|
||||
|
||||
#define R_SETTINGS_START_ADDR 20000
|
||||
|
||||
#define R_PWM_CTRL_ADDR R_SETTINGS_START_ADDR
|
||||
#define R_PWM_CTRL_QNT 8
|
||||
|
||||
#define R_LOG_CTRL_ADDR (R_SETTINGS_START_ADDR+8)
|
||||
#define R_LOG_CTRL_QNT 8
|
||||
|
||||
#define R_UART_CTRL_ADDR R_SETTINGS_START_ADDR+16
|
||||
#define R_UART_CTRL_QNT 8
|
||||
|
||||
// DEFINES FOR REGISTERS
|
||||
|
||||
#define R_PWM_CTRL_PWM_VALUE 0 // PWM value: sin freq OR pwm duty
|
||||
#define R_PWM_CTRL_PWM_HZ 1 // frequency of PWM Timer
|
||||
#define R_PWM_CTRL_DUTY_BRIDGE 2 // duty of PWM for DC+BRIDGE mode
|
||||
#define R_PWM_CTRL_MAX_PULSE_DUR 3 // duration of shortest pulse in sine PWM
|
||||
#define R_PWM_CTRL_MIN_PULSE_DUR 4 // duration of longest pulse in sine PWM
|
||||
#define R_PWM_CTRL_DEAD_TIME 5 // duration between between switches half waves (channels)
|
||||
#define R_PWM_CTRL_SIN_TABLE_SIZE 6 // size of sinus table
|
||||
|
||||
#define R_LOG_CTRL_LOG_SIZE 0 // size of number elements in log
|
||||
#define R_LOG_CTRL_LOG_PWM_NUMB 1 // number of PWM periods in log
|
||||
#define R_LOG_CTRL_LOG_HZ 2 // frequency of log Timer
|
||||
|
||||
#define R_UART_CTRL_SPEED 0 // sin frequency
|
||||
|
||||
|
||||
//----------------DEFINES FOR COILS-----------------
|
||||
// DEFINES FOR ARRAYS
|
||||
#define C_GPIOD_ADDR 0
|
||||
#define C_GPIOD_QNT 16 // minimum 16
|
||||
|
||||
#define C_CTRL_COILS_ADDR 0x10
|
||||
#define C_CTRL_COILS_QNT 160 // minimum 16
|
||||
|
||||
|
||||
// DEFINES FOR COILS
|
||||
#define COIL_GPIOD_LED1 12
|
||||
#define COIL_GPIOD_LED2 13
|
||||
#define COIL_GPIOD_LED3 14
|
||||
#define COIL_GPIOD_LED4 15
|
||||
#define COIL_GPIOD_LED1_GLOBAL (C_GPIOD_ADDR+COIL_GPIOD_LED1)
|
||||
#define COIL_GPIOD_LED2_GLOBAL (C_GPIOD_ADDR+COIL_GPIOD_LED2)
|
||||
#define COIL_GPIOD_LED3_GLOBAL (C_GPIOD_ADDR+COIL_GPIOD_LED3)
|
||||
#define COIL_GPIOD_LED4_GLOBAL (C_GPIOD_ADDR+COIL_GPIOD_LED4)
|
||||
|
||||
#define COIL_UART_CTRL (0)
|
||||
#define COIL_UART_CTRL_GLOBAL (C_CTRL_COILS_ADDR+COIL_UART_CTRL)
|
||||
#define COIL_PWM_DC_MODE (1)
|
||||
#define COIL_PWM_DC_MODE_GLOBAL (C_CTRL_COILS_ADDR+COIL_PWM_DC_MODE)
|
||||
#define COIL_PWM_BRIDGE_MODE (2)
|
||||
#define COIL_PWM_BRIDGE_MODE_GLOBAL (C_CTRL_COILS_ADDR+COIL_PWM_BRIDGE_MODE)
|
||||
#define COIL_PWM_PHASE_MODE (3)
|
||||
#define COIL_PWM_PHASE_MODE_GLOBAL (C_CTRL_COILS_ADDR+COIL_PWM_PHASE_MODE)
|
||||
#define COIL_PWM_POLARITY (4)
|
||||
#define COIL_PWM_POLARITY_GLOBAL (C_CTRL_COILS_ADDR+COIL_PWM_POLARITY)
|
||||
#define COIL_PWM_ACTIVECHANNEL (5)
|
||||
#define COIL_PWM_ACTIVECHANNEL_GLOBAL (C_CTRL_COILS_ADDR+COIL_PWM_ACTIVECHANNEL)
|
||||
502
научка/code/pwm_motor_control/Modbus/rs_message.c
Normal file
@@ -0,0 +1,502 @@
|
||||
/**********************************RS***************************************
|
||||
Данный файл содержит базовые функции для реализации протоколов по RS/UART.
|
||||
//-------------------Функции-------------------//
|
||||
@func users
|
||||
- Parse_Message/Collect_Message Заполнение структуры сообщения и буфера
|
||||
- RS_Response Ответ на сообщение
|
||||
- RS_Define_Size_of_RX_Message Определение размера принимаемых данных
|
||||
|
||||
@func general
|
||||
- RS_Receive_IT Ожидание комманды и ответ на неё
|
||||
- RS_Transmit_IT Отправление комманды и ожидание ответа
|
||||
- RS_Init Инициализация переферии и структуры для RS
|
||||
- RS_ReInit_UART Реинициализация UART для RS
|
||||
- RS_Abort Отмена приема/передачи по ЮАРТ
|
||||
- RS_Init Инициализация периферии и modbus handler
|
||||
|
||||
@func callback/handler
|
||||
- RS_Handle_Receive_Start Функция для запуска приема или остановки RS
|
||||
- RS_Handle_Transmit_Start Функция для запуска передачи или остановки RS
|
||||
|
||||
- RS_UART_RxCpltCallback Коллбек при окончании приема или передачи
|
||||
RS_UART_TxCpltCallback
|
||||
|
||||
- RS_UART_Handler Обработчик прерывания для UART
|
||||
- RS_TIM_Handler Обработчик прерывания для TIM
|
||||
|
||||
@func uart initialize (это было в отдельных файлах, мб надо обратно разнести)
|
||||
- UART_Base_Init Инициализация UART для RS
|
||||
- RS_UART_GPIO_Init Инициализация GPIO для RS
|
||||
- UART_DMA_Init Инициализация DMA для RS
|
||||
- UART_MspInit Аналог HAL_MspInit для RS
|
||||
- UART_MspDeInit Аналог HAL_MspDeInit для RS
|
||||
|
||||
//-------------------Общее--------------------//
|
||||
@note Для настройки RS/UART под нужный протокол, необходимо:
|
||||
- Определить структуру сообщения RS_MsgTypeDef и
|
||||
дефайны RX_FIRST_PART_SIZE и MSG_SIZE_MAX.
|
||||
- Подключить этот файл в раздел USER SETTINGS rs_message.h.
|
||||
- Определить функции для обработки сообщения @func users.
|
||||
- Добавить UART/TIM Handler в Хендлер используемых UART/TIM.
|
||||
***************************************************************************/
|
||||
#include "rs_message.h"
|
||||
|
||||
uint8_t RS_Buffer[MSG_SIZE_MAX]; // uart buffer
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------GENERAL FUNCTIONS-------------------------
|
||||
/**
|
||||
* @brief Start receive IT.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации приема.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Receive_IT(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg)
|
||||
{
|
||||
RS_StatusTypeDef RS_RES = 0;
|
||||
HAL_StatusTypeDef uart_res = 0;
|
||||
|
||||
//-------------CHECK RS LINE----------------
|
||||
// check that receive isnt busy
|
||||
if( RS_Is_RX_Busy(hRS) ) // if tx busy - return busy status
|
||||
return RS_BUSY;
|
||||
|
||||
//-----------INITIALIZE RECEIVE-------------
|
||||
// if all OK: start receiving
|
||||
RS_Set_Busy(hRS); // set RS busy
|
||||
RS_Set_RX_Flags(hRS); // initialize flags for receive
|
||||
hRS->pMessagePtr = RS_msg; // set pointer to message structire for filling it from UARTHandler fucntions
|
||||
|
||||
// start receiving
|
||||
uart_res = HAL_UART_Receive_IT(hRS->huart, hRS->pBufferPtr, RX_FIRST_PART_SIZE); // receive until ByteCnt+1 byte,
|
||||
// then in Callback restart receive for rest bytes
|
||||
|
||||
// if receive isnt started - abort RS
|
||||
if(uart_res != HAL_OK)
|
||||
{
|
||||
RS_RES = RS_Abort(hRS, ABORT_RS);
|
||||
}
|
||||
else
|
||||
RS_RES = RS_OK;
|
||||
|
||||
hRS->RS_STATUS = RS_RES;
|
||||
return RS_RES; // returns result of receive init
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start transmit IT.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации передачи.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Transmit_IT(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg)
|
||||
{
|
||||
RS_StatusTypeDef RS_RES = 0;
|
||||
HAL_StatusTypeDef uart_res = 0;
|
||||
|
||||
//-------------CHECK RS LINE----------------
|
||||
// check that transmit isnt busy
|
||||
if( RS_Is_TX_Busy(hRS) ) // if tx busy - return busy status
|
||||
return RS_BUSY;
|
||||
// check receive line
|
||||
|
||||
|
||||
//------------COLLECT MESSAGE---------------
|
||||
RS_RES = Collect_Message(hRS, RS_msg, hRS->pBufferPtr);
|
||||
if (RS_RES != RS_OK) // if message isnt collect - stop RS and return error in RS_RES
|
||||
{// need collect message status, so doesnt write abort to RS_RES
|
||||
RS_Abort(hRS, ABORT_RS);
|
||||
RS_Handle_Receive_Start(hRS, hRS->pMessagePtr); // restart receive
|
||||
}
|
||||
else // if collect successful
|
||||
{
|
||||
|
||||
//----------INITIALIZE TRANSMIT-------------
|
||||
RS_Set_Busy(hRS); // set RS busy
|
||||
RS_Set_TX_Flags(hRS); // initialize flags for transmit IT
|
||||
hRS->pMessagePtr = RS_msg; // set pointer for filling given structure from UARTHandler fucntion
|
||||
|
||||
// if all OK: start transmitting
|
||||
uart_res = HAL_UART_Transmit_IT(hRS->huart, hRS->pBufferPtr, hRS->RS_Message_Size);
|
||||
// if transmit isnt started - abort RS
|
||||
if(uart_res != HAL_OK)
|
||||
{
|
||||
RS_RES = RS_Abort(hRS, ABORT_RS);
|
||||
}
|
||||
else
|
||||
RS_RES = RS_OK;
|
||||
}
|
||||
|
||||
|
||||
hRS->RS_STATUS = RS_RES;
|
||||
return RS_RES; // returns result of transmit init
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize UART and handle RS stucture.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param suart - указатель на структуру с настройками UART.
|
||||
* @param stim - указатель на структуру с настройками таймера.
|
||||
* @param pRS_BufferPtr - указатель на буффер для приема-передачи по UART. Если он NULL, то поставиться библиотечный буфер.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации.
|
||||
* @note Инициализация перефирии и структуры для приема-передачи по RS.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Init(RS_HandleTypeDef *hRS, UART_SettingsTypeDef *suart, TIM_SettingsTypeDef *stim, uint8_t *pRS_BufferPtr)
|
||||
{
|
||||
// check that hRS is defined
|
||||
if (hRS == NULL)
|
||||
return RS_ERR;
|
||||
|
||||
// check that huart is defined
|
||||
if ((suart->huart.Instance == NULL) || (suart->huart.Init.BaudRate == NULL))
|
||||
return RS_ERR;
|
||||
|
||||
// init uart
|
||||
UART_Base_Init(suart);
|
||||
hRS->huart = &suart->huart;
|
||||
|
||||
|
||||
|
||||
// check that timeout in interrupt needed
|
||||
if (hRS->sRS_Timeout)
|
||||
{
|
||||
if (stim->htim.Instance == NULL) // check is timer defined
|
||||
return RS_ERR;
|
||||
|
||||
// calc frequency corresponding to timeout and tims 1ms tickbase
|
||||
stim->sTickBaseMHz = TIM_TickBase_1MS;
|
||||
stim->htim.Init.Period = hRS->sRS_Timeout;
|
||||
|
||||
TIM_Base_Init(stim);
|
||||
hRS->htim = &stim->htim;
|
||||
}
|
||||
|
||||
if (hRS->sRS_RX_Size_Mode == NULL)
|
||||
return RS_ERR;
|
||||
|
||||
// check that buffer is defined
|
||||
if (hRS->pBufferPtr == NULL)
|
||||
{
|
||||
hRS->pBufferPtr = RS_Buffer; // if no - set default
|
||||
}
|
||||
else
|
||||
hRS->pBufferPtr = pRS_BufferPtr; // if yes - set by user
|
||||
|
||||
return RS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ReInitialize UART and RS receive.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param suart - указатель на структуру с настройками UART.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации.
|
||||
* @note Реинициализация UART и приема по RS.
|
||||
*/
|
||||
HAL_StatusTypeDef RS_ReInit_UART(RS_HandleTypeDef *hRS, UART_SettingsTypeDef *suart)
|
||||
{
|
||||
HAL_StatusTypeDef RS_RES;
|
||||
hRS->fReInit_UART = 0;
|
||||
|
||||
// check is settings are valid
|
||||
if(Check_UART_Init_Struct(suart) != HAL_OK)
|
||||
return HAL_ERROR;
|
||||
|
||||
RS_Abort(hRS, ABORT_RS);
|
||||
UART_MspDeInit(&suart->huart);
|
||||
RS_RES = UART_Base_Init(suart);
|
||||
|
||||
|
||||
RS_Receive_IT(hRS, hRS->pMessagePtr);
|
||||
return RS_RES;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Abort RS/UART.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param AbortMode - выбор, что надо отменить.
|
||||
- ABORT_TX: Отмена передачи по ЮАРТ, с очищением флагов TX,
|
||||
- ABORT_RX: Отмена приема по ЮАРТ, с очищением флагов RX,
|
||||
- ABORT_RX_TX: Отмена приема и передачи по ЮАРТ,
|
||||
- ABORT_RS: Отмена приема-передачи RS, с очищением всей структуры.
|
||||
* @return RS_RES - статус о состоянии RS после аборта.
|
||||
* @note Отмена работы UART в целом или отмена приема/передачи RS.
|
||||
Также очищается хендл hRS.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Abort(RS_HandleTypeDef *hRS, RS_AbortTypeDef AbortMode)
|
||||
{
|
||||
HAL_StatusTypeDef uart_res = 0;
|
||||
hRS->htim->Instance->CNT = 0;
|
||||
__HAL_TIM_CLEAR_IT(hRS->htim, TIM_IT_UPDATE);
|
||||
|
||||
if(hRS->sRS_Timeout) // if timeout setted
|
||||
HAL_TIM_Base_Stop_IT(hRS->htim); // stop timeout
|
||||
|
||||
if((AbortMode&ABORT_RS) == 0x00)
|
||||
{
|
||||
if((AbortMode&ABORT_RX) == ABORT_RX)
|
||||
{
|
||||
uart_res = HAL_UART_AbortReceive(hRS->huart); // abort receive
|
||||
RS_Reset_RX_Flags(hRS);
|
||||
}
|
||||
|
||||
if((AbortMode&ABORT_TX) == ABORT_TX)
|
||||
{
|
||||
uart_res = HAL_UART_AbortTransmit(hRS->huart); // abort transmit
|
||||
RS_Reset_TX_Flags(hRS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uart_res = HAL_UART_Abort(hRS->huart);
|
||||
RS_Clear_All(hRS);
|
||||
}
|
||||
hRS->RS_STATUS = RS_ABORTED;
|
||||
return RS_ABORTED;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------GENERAL FUNCTIONS-------------------------
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//--------------------CALLBACK/HANDLER FUNCTIONS---------------------
|
||||
/**
|
||||
* @brief Handle for starting receive.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации приема или окончания общения.
|
||||
* @note Определяет начинать прием команды/ответа или нет.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Handle_Receive_Start(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg)
|
||||
{
|
||||
RS_StatusTypeDef RS_RES = 0;
|
||||
|
||||
switch(hRS->sRS_Mode)
|
||||
{
|
||||
case SLAVE_ALWAYS_WAIT: // in slave mode with permanent waiting
|
||||
RS_RES = RS_Receive_IT(hRS, RS_msg); break; // start receiving again
|
||||
case SLAVE_TIMEOUT_WAIT: // in slave mode with timeout waiting (start receiving cmd by request)
|
||||
RS_Set_Free(hRS); RS_RES = RS_OK; break; // end RS communication (set RS unbusy)
|
||||
}
|
||||
|
||||
return RS_RES;
|
||||
}
|
||||
/**
|
||||
* @brief Handle for starting transmit.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации передачи.
|
||||
* @note Определяет отвечать ли на команду или нет.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Handle_Transmit_Start(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg)
|
||||
{
|
||||
RS_StatusTypeDef RS_RES = 0;
|
||||
|
||||
switch(hRS->sRS_Mode)
|
||||
{
|
||||
case SLAVE_ALWAYS_WAIT: // in slave mode always response
|
||||
case SLAVE_TIMEOUT_WAIT: // transmit response
|
||||
RS_RES = RS_Transmit_IT(hRS, RS_msg); break;
|
||||
}
|
||||
return RS_RES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UART RX Callback: define behaviour after receiving parts of message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @return RS_RES - статус о состоянии RS после обработки приема.
|
||||
* @note Контролирует прием сообщения: определяет размер принимаемой посылки и обрабатывает его.
|
||||
*/
|
||||
RS_StatusTypeDef RS_UART_RxCpltCallback(RS_HandleTypeDef *hRS)
|
||||
{
|
||||
RS_StatusTypeDef RS_RES = 0;
|
||||
HAL_StatusTypeDef uart_res = 0;
|
||||
|
||||
// if we had received bytes before ByteCnt
|
||||
if((hRS->sRS_RX_Size_Mode == RS_RX_Size_NotConst) && (hRS->fRX_Half == 0)) // if data size isnt constant and its first half, and
|
||||
{ // First receive part of message, then define size of rest of message, and start receive it
|
||||
hRS->fRX_Half = 1;
|
||||
//---------------FIND DATA SIZE-----------------
|
||||
uint32_t NuRS_of_Rest_Bytes = 0;
|
||||
RS_RES = RS_Define_Size_of_RX_Message(hRS, &NuRS_of_Rest_Bytes);
|
||||
|
||||
|
||||
// if there is no bytes to receive OR we need to skip this message - restart receive
|
||||
if ((NuRS_of_Rest_Bytes == 0) || (RS_RES == RS_SKIP))
|
||||
{
|
||||
RS_Abort(hRS, ABORT_RX);
|
||||
RS_RES = RS_Handle_Receive_Start(hRS, hRS->pMessagePtr);
|
||||
return RS_RES;
|
||||
}
|
||||
|
||||
//-------------START UART RECEIVE---------------
|
||||
uart_res = HAL_UART_Receive_IT(hRS->huart, (hRS->pBufferPtr + RX_FIRST_PART_SIZE), NuRS_of_Rest_Bytes);
|
||||
|
||||
if(uart_res != HAL_OK)
|
||||
{// need uart status, so doesnt write abort to RS_RES
|
||||
RS_RES = RS_Abort(hRS, ABORT_RS);
|
||||
}
|
||||
else
|
||||
RS_RES = RS_OK;
|
||||
}
|
||||
else // if we had received whole message
|
||||
{
|
||||
hRS->fRX_Half = 0;
|
||||
|
||||
//---------PROCESS DATA & ENDING RECEIVING--------
|
||||
RS_Set_RX_End(hRS);
|
||||
|
||||
if(hRS->sRS_Timeout) // if timeout setted
|
||||
HAL_TIM_Base_Stop_IT(hRS->htim); // stop timeout
|
||||
|
||||
// parse received data
|
||||
RS_RES = Parse_Message(hRS, hRS->pMessagePtr, hRS->pBufferPtr); // parse message
|
||||
|
||||
// RESPONSE
|
||||
RS_RES = RS_Response(hRS, hRS->pMessagePtr);
|
||||
}
|
||||
|
||||
return RS_RES;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief UART TX Callback: define behaviour after transmiting message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @return RS_RES - статус о состоянии RS после обработки приема.
|
||||
* @note Определяет поведение RS после передачи сообщения.
|
||||
*/
|
||||
RS_StatusTypeDef RS_UART_TxCpltCallback(RS_HandleTypeDef *hRS)
|
||||
{
|
||||
RS_StatusTypeDef RS_RES = RS_OK;
|
||||
HAL_StatusTypeDef uart_res = 0;
|
||||
|
||||
//--------------ENDING TRANSMITTING-------------
|
||||
RS_Set_TX_End(hRS);
|
||||
|
||||
//-----------START RECEIVING or END RS----------
|
||||
RS_RES = RS_Handle_Receive_Start(hRS, hRS->pMessagePtr);
|
||||
|
||||
return RS_RES;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handler for UART.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @note Обрабатывает ошибки если есть и вызывает RS Коллбеки.
|
||||
* Добавить вызов этой функции в UARTx_IRQHandler().
|
||||
*/
|
||||
void RS_UART_Handler(RS_HandleTypeDef *hRS)
|
||||
{
|
||||
HAL_UART_IRQHandler(hRS->huart);
|
||||
//-------------CALL RS CALLBACKS------------
|
||||
/* IF NO ERROR OCCURS */
|
||||
if(hRS->huart->ErrorCode == 0)
|
||||
{
|
||||
hRS->htim->Instance->CNT = 0; // reset cnt;
|
||||
/* Start timeout */
|
||||
if(hRS->sRS_Timeout) // if timeout setted
|
||||
if((hRS->huart->RxXferCount+1 == hRS->huart->RxXferSize) && RS_Is_RX_Busy(hRS)) // if first byte is received and receive is active
|
||||
HAL_TIM_Base_Start_IT(hRS->htim);
|
||||
|
||||
/* RX Callback */
|
||||
if (( hRS->huart->RxXferCount == 0U) && RS_Is_RX_Busy(hRS) && // if all bytes are received and receive is active
|
||||
hRS->huart->RxState != HAL_UART_STATE_BUSY_RX) // also check that receive "REALLY" isnt busy
|
||||
RS_UART_RxCpltCallback(hRS);
|
||||
|
||||
/* TX Callback */
|
||||
if (( hRS->huart->TxXferCount == 0U) && RS_Is_TX_Busy(hRS) && // if all bytes are transmited and transmit is active
|
||||
hRS->huart->gState != HAL_UART_STATE_BUSY_TX) // also check that receive "REALLY" isnt busy
|
||||
RS_UART_TxCpltCallback(hRS);
|
||||
}
|
||||
//----------------ERRORS HANDLER----------------
|
||||
else
|
||||
{
|
||||
/* de-init uart transfer */
|
||||
RS_Abort(hRS, ABORT_RS);
|
||||
RS_Handle_Receive_Start(hRS, hRS->pMessagePtr);
|
||||
|
||||
// later, maybe, will be added specific handlers for err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Handler for TIM.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @note Попадание сюда = таймаут и перезапуск RS приема
|
||||
* Добавить вызов этой функции в TIMx_IRQHandler().
|
||||
*/
|
||||
void RS_TIM_Handler(RS_HandleTypeDef *hRS)
|
||||
{
|
||||
HAL_TIM_IRQHandler(hRS->htim);
|
||||
HAL_TIM_Base_Stop_IT(hRS->htim);
|
||||
RS_Abort(hRS, ABORT_RS);
|
||||
|
||||
RS_Handle_Receive_Start(hRS, hRS->pMessagePtr);
|
||||
}
|
||||
//--------------------CALLBACK/HANDLER FUNCTIONS---------------------
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//--------------WEAK PROTOTYPES FOR PROCESSING MESSAGE---------------
|
||||
/**
|
||||
* @brief Respond accord to received message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о результате ответа на комманду.
|
||||
* @note Обработка принятой комманды и ответ на неё.
|
||||
*/
|
||||
__weak RS_StatusTypeDef RS_Response(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg)
|
||||
{
|
||||
/* Redefine function for user purposes */
|
||||
return RS_ERR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Collect message in buffer to transmit it.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @param msg_uart_buff - указатель на буффер UART.
|
||||
* @return RS_RES - статус о результате заполнения буфера.
|
||||
* @note Заполнение буффера UART из структуры сообщения.
|
||||
*/
|
||||
__weak RS_StatusTypeDef Collect_Message(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg, uint8_t *msg_uart_buff)
|
||||
{
|
||||
/* Redefine function for user purposes */
|
||||
return RS_ERR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Parse message from buffer to process it.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @param msg_uart_buff - указатель на буффер UART.
|
||||
* @return RS_RES - статус о результате заполнения структуры.
|
||||
* @note Заполнение структуры сообщения из буффера UART.
|
||||
*/
|
||||
__weak RS_StatusTypeDef Parse_Message(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg, uint8_t *msg_uart_buff)
|
||||
{
|
||||
/* Redefine function for user purposes */
|
||||
return RS_ERR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Define size of RX Message that need to be received.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param rx_data_size - указатель на переменную для записи кол-ва байт для принятия.
|
||||
* @return RS_RES - статус о корректности рассчета кол-ва байт для принятия.
|
||||
* @note Определение сколько байтов надо принять по протоколу.
|
||||
*/
|
||||
__weak RS_StatusTypeDef RS_Define_Size_of_RX_Message(RS_HandleTypeDef *hRS, uint32_t *rx_data_size)
|
||||
{
|
||||
/* Redefine function for user purposes */
|
||||
return RS_ERR;
|
||||
}
|
||||
//--------------WEAK PROTOTYPES FOR PROCESSING MESSAGE---------------
|
||||
//-------------------------------------------------------------------
|
||||
297
научка/code/pwm_motor_control/Modbus/rs_message.h
Normal file
@@ -0,0 +1,297 @@
|
||||
/**********************************RS***************************************
|
||||
Данный файл содержит объявления базовых функции и дефайны для реализации
|
||||
протоколов по RS/UART.
|
||||
***************************************************************************/
|
||||
#ifndef __RS_LIB_H_
|
||||
#define __RS_LIB_H_
|
||||
|
||||
#include "modbus.h"
|
||||
|
||||
#include "periph_general.h"
|
||||
#include "crc_algs.h"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////---DEFINES---////////////////////////////
|
||||
/* Check that all defines required by RS are defined */
|
||||
#ifndef MSG_SIZE_MAX
|
||||
#error Define MSG_SIZE_MAX (Maximum size of message). This is necessary to create buffer for UART.
|
||||
#endif
|
||||
|
||||
#ifndef RX_FIRST_PART_SIZE
|
||||
#error Define RX_FIRST_PART_SIZE (Size of first part of message). This is necessary to receive the first part of the message, from which determine the size of the remaining part of the message.
|
||||
#endif
|
||||
|
||||
|
||||
/* Clear message-uart buffer */
|
||||
#define RS_Clear_Buff(_buff_) for(int i=0; i<MSG_SIZE_MAX;i++) _buff_[i] = NULL
|
||||
|
||||
/* Set/Reset flags */
|
||||
#define RS_Set_Free(_hRS_) _hRS_->fRS_Busy = 0
|
||||
#define RS_Set_Busy(_hRS_) _hRS_->fRS_Busy = 1
|
||||
|
||||
#define RS_Set_RX_Flags(_hRS_) _hRS_->fRX_Busy = 1; _hRS_->fRX_Done = 0; _hRS_->fRX_Half = 0
|
||||
#define RS_Set_TX_Flags(_hRS_) _hRS_->fTX_Busy = 1; _hRS_->fTX_Done = 0
|
||||
|
||||
#define RS_Reset_RX_Flags(_hRS_) _hRS_->fRX_Busy = 0; _hRS_->fRX_Done = 0; _hRS_->fRX_Half = 0
|
||||
#define RS_Reset_TX_Flags(_hRS_) _hRS_->fTX_Busy = 0; _hRS_->fTX_Done = 0
|
||||
|
||||
#define RS_Set_RX_End_Flag(_hRS_) _hRS_->fRX_Done = 1
|
||||
#define RS_Set_TX_End_Flag(_hRS_) _hRS_->fTX_Done = 1
|
||||
|
||||
#define RS_Set_RX_End(_hRS_) RS_Reset_RX_Flags(_hRS_); RS_Set_RX_End_Flag(_hRS_)
|
||||
#define RS_Set_TX_End(_hRS_) RS_Reset_TX_Flags(_hRS_); RS_Set_TX_End_Flag(_hRS_)
|
||||
|
||||
/* Clear all RS stuff */
|
||||
#define RS_Clear_All(_hRS_) RS_Clear_Buff(_hRS_->pBufferPtr); RS_Reset_RX_Flags(_hRS_); RS_Reset_TX_Flags(_hRS_);
|
||||
|
||||
//#define MB_Is_RX_Busy(_hRS_) ((_hRS_->huart->gState&HAL_USART_STATE_BUSY_RX) == HAL_USART_STATE_BUSY_RX)
|
||||
//#define MB_Is_TX_Busy(_hRS_) ((_hRS_->huart->gState&HAL_USART_STATE_BUSY_RX) == HAL_USART_STATE_BUSY_TX)
|
||||
#define RS_Is_RX_Busy(_hRS_) (_hRS_->fRX_Busy == 1)
|
||||
#define RS_Is_TX_Busy(_hRS_) (_hRS_->fTX_Busy == 1)
|
||||
////////////////////////////---DEFINES---////////////////////////////
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
///////////////////////---STRUCTURES & ENUMS---//////////////////////
|
||||
//------------------ENUMERATIONS--------------------
|
||||
/* Enums for respond CMD about RS status*/
|
||||
typedef enum // RS_StatusTypeDef
|
||||
{
|
||||
/* IN-CODE STATUS (start from 0x01, and goes up)*/
|
||||
/*0x01*/ RS_OK = 0x01,
|
||||
/*0x02*/ RS_ERR,
|
||||
/*0x03*/ RS_ABORTED,
|
||||
/*0x04*/ RS_BUSY,
|
||||
/*0x05*/ RS_SKIP,
|
||||
|
||||
/*0x06*/ RS_COLLECT_MSG_ERR,
|
||||
/*0x07*/ RS_PARSE_MSG_ERR,
|
||||
|
||||
// reserved values
|
||||
// /*0x00*/ RS_UNKNOWN_ERR = 0x00, // reserved for case, if no one error founded (nothing changed response from zero)
|
||||
}RS_StatusTypeDef;
|
||||
|
||||
|
||||
/* Enums for RS Modes */
|
||||
typedef enum // RS_ModeTypeDef
|
||||
{
|
||||
SLAVE_ALWAYS_WAIT = 0x01, // Slave mode with infinity waiting
|
||||
SLAVE_TIMEOUT_WAIT = 0x02, // Slave mode with waiting with timeout
|
||||
// MASTER = 0x03, // Master mode
|
||||
}RS_ModeTypeDef;
|
||||
|
||||
/* Enums for RS UART Modes */
|
||||
typedef enum // RS_ITModeTypeDef
|
||||
{
|
||||
BLCK_MODE = 0x00, // Blocking mode
|
||||
IT_MODE = 0x01, // Interrupt mode
|
||||
}RS_ITModeTypeDef;
|
||||
|
||||
/* Enums for Abort modes */
|
||||
typedef enum // RS_AbortTypeDef
|
||||
{
|
||||
ABORT_TX = 0x01, // Abort transmit
|
||||
ABORT_RX = 0x02, // Abort receive
|
||||
ABORT_RX_TX = 0x03, // Abort receive and transmit
|
||||
ABORT_RS = 0x04, // Abort uart and reset RS structure
|
||||
}RS_AbortTypeDef;
|
||||
|
||||
/* Enums for RX Size modes */
|
||||
typedef enum // RS_RXSizeTypeDef
|
||||
{
|
||||
RS_RX_Size_Const = 0x01, // size of receiving message is constant
|
||||
RS_RX_Size_NotConst = 0x02, // size of receiving message isnt constant
|
||||
}RS_RXSizeTypeDef;
|
||||
|
||||
|
||||
//-----------STRUCTURE FOR HANDLE RS------------
|
||||
/**
|
||||
* @brief Handle for RS communication.
|
||||
* @note Prefixes: h - handle, s - settings, f - flag
|
||||
*/
|
||||
typedef struct // RS_HandleTypeDef
|
||||
{
|
||||
/* MESSAGE */
|
||||
uint8_t ID; // ID of RS "channel"
|
||||
RS_MsgTypeDef *pMessagePtr; // pointer to message struct
|
||||
uint8_t *pBufferPtr; // pointer to message buffer
|
||||
uint32_t RS_Message_Size; // size of whole message, not only data
|
||||
|
||||
/* HANDLERS and SETTINGS */
|
||||
UART_HandleTypeDef *huart; // handler for used uart
|
||||
TIM_HandleTypeDef *htim; // handler for used tim
|
||||
RS_ModeTypeDef sRS_Mode; // setting: slave or master @ref RS_ModeTypeDef
|
||||
RS_ITModeTypeDef sRS_IT_Mode; // setting: 1 - IT mode, 0 - Blocking mode
|
||||
uint16_t sRS_Timeout; // setting: timeout in ms
|
||||
RS_RXSizeTypeDef sRS_RX_Size_Mode; // setting: 1 - not const, 0 - const
|
||||
|
||||
/* FLAGS */
|
||||
// These flags for controling receive/transmit
|
||||
unsigned fRX_Half:1; // flag: 0 - receiving msg before ByteCnt, 0 - receiving msg after ByteCnt
|
||||
|
||||
unsigned fRS_Busy:1; // flag: 1 - RS is busy, 0 - RS isnt busy
|
||||
unsigned fRX_Busy:1; // flag: 1 - receiving is active, 0 - receiving isnt active
|
||||
unsigned fTX_Busy:1; // flag: 1 - transmiting is active, 0 - transmiting isnt active
|
||||
|
||||
unsigned fRX_Done:1; // flag: 1 - receiving is done, 0 - receiving isnt done
|
||||
unsigned fTX_Done:1; // flag: 1 - transmiting is done, 0 - transmiting isnt done
|
||||
|
||||
// setted by user
|
||||
unsigned fMessageHandled:1; // flag: 1 - RS command is handled, 0 - RS command isnt handled yet
|
||||
unsigned fEchoResponse:1; // flag: 1 - response with received msg, 0 - response with own msg
|
||||
unsigned fDeferredResponse:1; // flag: 1 - response not in interrupt, 0 - response in interrupt
|
||||
unsigned fReInit_UART:1; // flag: 1 - need to reinitialize uart, 0 - nothing
|
||||
|
||||
/* RS STATUS */
|
||||
RS_StatusTypeDef RS_STATUS; // RS status
|
||||
}RS_HandleTypeDef;
|
||||
|
||||
|
||||
///////////////////////---STRUCTURES & ENUMS---//////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////---FUNCTIONS---///////////////////////////
|
||||
//----------------FUNCTIONS FOR PROCESSING MESSAGE-------------------
|
||||
/*--------------------Defined by users purposes--------------------*/
|
||||
/**
|
||||
* @brief Respond accord to received message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о результате ответа на комманду.
|
||||
* @note Обработка принятой комманды и ответ на неё.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Response(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg);
|
||||
|
||||
/**
|
||||
* @brief Collect message in buffer to transmit it.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @param msg_uart_buff - указатель на буффер UART.
|
||||
* @return RS_RES - статус о результате заполнения буфера.
|
||||
* @note Заполнение буффера UART из структуры сообщения.
|
||||
*/
|
||||
RS_StatusTypeDef Collect_Message(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg, uint8_t *msg_uart_buff);
|
||||
|
||||
/**
|
||||
* @brief Parse message from buffer to process it.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @param msg_uart_buff - указатель на буффер UART.
|
||||
* @return RS_RES - статус о результате заполнения структуры.
|
||||
* @note Заполнение структуры сообщения из буффера UART.
|
||||
*/
|
||||
RS_StatusTypeDef Parse_Message(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg, uint8_t *msg_uart_buff);
|
||||
|
||||
/**
|
||||
* @brief Define size of RX Message that need to be received.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param rx_data_size - указатель на переменную для записи кол-ва байт для принятия.
|
||||
* @return RS_RES - статус о корректности рассчета кол-ва байт для принятия.
|
||||
* @note Определение сколько байтов надо принять по протоколу.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Define_Size_of_RX_Message(RS_HandleTypeDef *hRS, uint32_t *rx_data_size);
|
||||
|
||||
|
||||
//-------------------------GENERAL FUNCTIONS-------------------------
|
||||
/*-----------------Should be called from main code-----------------*/
|
||||
/**
|
||||
* @brief Start receive IT.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации приема.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Receive_IT(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg);
|
||||
|
||||
/**
|
||||
* @brief Start transmit IT.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации передачи.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Transmit_IT(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg);
|
||||
|
||||
/**
|
||||
* @brief Initialize UART and handle RS stucture.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param suart - указатель на структуру с настройками UART.
|
||||
* @param stim - указатель на структуру с настройками таймера.
|
||||
* @param pRS_BufferPtr - указатель на буффер для приема-передачи по UART. Если он NULL, то поставиться библиотечный буфер.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Init(RS_HandleTypeDef *hRS, UART_SettingsTypeDef *suart, TIM_SettingsTypeDef *stim, uint8_t *pRS_BufferPtr);
|
||||
/**
|
||||
* @brief ReInitialize UART and RS receive.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param suart - указатель на структуру с настройками UART.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации.
|
||||
*/
|
||||
HAL_StatusTypeDef RS_ReInit_UART(RS_HandleTypeDef *hRS, UART_SettingsTypeDef *suart);
|
||||
/**
|
||||
* @brief Abort RS/UART.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param AbortMode - выбор, что надо отменить.
|
||||
- ABORT_TX: Отмена передачи по ЮАРТ, с очищением флагов TX,
|
||||
- ABORT_RX: Отмена приема по ЮАРТ, с очищением флагов RX,
|
||||
- ABORT_RX_TX: Отмена приема и передачи по ЮАРТ,
|
||||
- ABORT_RS: Отмена приема-передачи RS, с очищением всей структуры.
|
||||
* @return RS_RES - статус о состоянии RS после аборта.
|
||||
* @note Отмена работы UART в целом или отмена приема/передачи RS.
|
||||
Также очищается хендл hRS.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Abort(RS_HandleTypeDef *hRS, RS_AbortTypeDef AbortMode);
|
||||
//-------------------------GENERAL FUNCTIONS-------------------------
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//--------------------CALLBACK/HANDLER FUNCTIONS---------------------
|
||||
/**
|
||||
* @brief Handle for starting receive.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации приема или окончания общения.
|
||||
* @note Определяет начинать прием команды/ответа или нет.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Handle_Receive_Start(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg);
|
||||
/**
|
||||
* @brief Handle for starting transmit.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @param RS_msg - указатель на структуру сообщения.
|
||||
* @return RS_RES - статус о состоянии RS после инициализации передачи.
|
||||
* @note Определяет отвечать ли на команду или нет.
|
||||
*/
|
||||
RS_StatusTypeDef RS_Handle_Transmit_Start(RS_HandleTypeDef *hRS, RS_MsgTypeDef *RS_msg);
|
||||
/**
|
||||
* @brief UART RX Callback: define behaviour after receiving parts of message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @return RS_RES - статус о состоянии RS после обработки приема.
|
||||
* @note Контролирует прием сообщения: определяет размер принимаемой посылки и обрабатывает его.
|
||||
*/
|
||||
RS_StatusTypeDef RS_UART_RxCpltCallback(RS_HandleTypeDef *hRS);
|
||||
/**
|
||||
* @brief UART TX Callback: define behaviour after transmiting message.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @return RS_RES - статус о состоянии RS после обработки приема.
|
||||
* @note Определяет поведение RS после передачи сообщения.
|
||||
*/
|
||||
RS_StatusTypeDef RS_UART_TxCpltCallback(RS_HandleTypeDef *hRS);
|
||||
/**
|
||||
* @brief Handler for UART.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @note Обрабатывает ошибки если есть и вызывает RS Коллбеки.
|
||||
* Добавить вызов этой функции в UARTx_IRQHandler().
|
||||
*/
|
||||
void RS_UART_Handler(RS_HandleTypeDef *hRS);
|
||||
/**
|
||||
* @brief Handler for TIM.
|
||||
* @param hRS - указатель на хендлер RS.
|
||||
* @note Попадание сюда = таймаут и перезапуск RS приема
|
||||
* Добавить вызов этой функции в TIMx_IRQHandler().
|
||||
*/
|
||||
void RS_TIM_Handler(RS_HandleTypeDef *hRS);
|
||||
//--------------------CALLBACK/HANDLER FUNCTIONS---------------------
|
||||
///////////////////////////---FUNCTIONS---///////////////////////////
|
||||
|
||||
#endif // __RS_LIB_H_
|
||||