добавлена реализация onewire через uart и переделана структуруа шины OneWire и инциализация

Теперь при выборе UART, в функцию Dallas_BusFirstInit передается hdallas, huart, ow, ds

А при выборе GPIO ножки: hdallas, gpiox, gpio_pin, ow, ds

но надо как-то структуруизировать дальше
This commit is contained in:
2025-06-30 18:34:17 +03:00
parent 175bcd539f
commit fa32d653e8
14 changed files with 373 additions and 61 deletions

View File

@@ -14,10 +14,8 @@
/* Includes ------------------------------------------------------------------*/
#include "ow_port.h"
/* Driver Selection ----------------------------------------------------------*/
//#define LL_Driver
//#define CMSIS_Driver
/* OneWire Timings -----------------------------------------------------------*/
#define ONEWIRE_RESET_PULSE_US 480 // Длительность импульса сброса
#define ONEWIRE_PRESENCE_WAIT_US 70 // Ожидание ответа от датчика
@@ -49,8 +47,12 @@ typedef struct
uint8_t LastDeviceFlag;
uint8_t RomByte[8];
uint8_t RomCnt;
#if defined(UART_Driver)
UART_HandleTypeDef *huart;
#else
uint16_t DataPin;
GPIO_TypeDef *DataPort;
#endif
} OneWire_t;
/* External Function ---------------------------------------------------------*/