I am trying to read a DS18B20 temperature sensor with I2C. I use a DS2484 driver to convert the I2C signals to a 1-Wire signal.


I have the following code:
Code:

/* Includes ------------------------------------------------------------------*/
#include "stm32l1xx_hal.h"


/* USER CODE BEGIN Includes */


/* USER CODE END Includes */


/* Private variables ---------------------------------------------------------*/
I2C_HandleTypeDef hi2c2;


RTC_HandleTypeDef hrtc;


/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/


/* USER CODE END PV */


/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_I2C2_Init(void);
static void MX_RTC_Init(void);


/* USER CODE BEGIN PFP */
/* Private function prototypes -----------------------------------------------*/
void ow_setup_ds2484(void);




/* USER CODE END PFP */


/* USER CODE BEGIN 0 */



/* USER CODE END 0 */


int main(void)
{


  /* USER CODE BEGIN 1 */


  /* USER CODE END 1 */


  /* MCU Configuration----------------------------------------------------------*/


  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();


  /* Configure the system clock */
  SystemClock_Config();


  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_I2C2_Init();
  MX_RTC_Init();


    ow_setup_ds2484();
    
  /* USER CODE BEGIN 2 */


  /* USER CODE END 2 */


  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
    
     
    // I2C test
    //    uint8_t dummy_data[2] = {0};
    //    HAL_I2C_Master_Transmit (&hi2c2, 0x10, &dummy_data[0], 2, 1000); // 1sec timeout
        uint8_t byte_array[6];
        byte_array[0] = 0xE1; /* Data 0 */
    byte_array[1] = 0xC3; /* Data 1 */
        byte_array[2] = 0xD2; /* Data 2 */
        byte_array[3] = 0xEE; /* Data 3 */
  //  byte_array[4] = 0x00; /* Data 4 */


            uint8_t dummy_data[25] = 
            {0xF0, // reset 
            0x01, //byte om data mee in te kunnen lezen
            0xD2,//WCFG
            0x22}; 


            uint8_t dummy_data1[25] = 
    {
            0x22}; 




     HAL_I2C_Master_Transmit (&hi2c2, 0x30,  &dummy_data[0], 1, 1000); // reset device


        HAL_I2C_Master_Receive(&hi2c2, 0x31, &dummy_data[1] , 1, 1000); // lees byte in na reset




     HAL_I2C_Master_Transmit (&hi2c2, 0x30,  byte_array, 2, 1000); // set read pointer


    HAL_I2C_Master_Transmit (&hi2c2, 0x30,  &dummy_data[2], 1, 1000); // configureer
            
        HAL_I2C_Master_Receive(&hi2c2, 0x31, &dummy_data[1] , 1, 1000); // lees byte in na configureren
    
   while (1)
  {
            /* USER CODE END WHILE */
            // --- toggle PC4 ---//
            HAL_GPIO_WritePin (GPIOC,GPIO_PIN_9,GPIO_PIN_SET); // enable pin (vcc)
            HAL_Delay (100);
            HAL_GPIO_WritePin (GPIOC,GPIO_PIN_9,GPIO_PIN_RESET); // disable pin (0v)
            HAL_Delay (100); 
        
        
    


    } // while
} // main






/** System Clock Configuration
*/
void SystemClock_Config(void)
{


  RCC_OscInitTypeDef RCC_OscInitStruct;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;
  RCC_PeriphCLKInitTypeDef PeriphClkInit;


  __HAL_RCC_PWR_CLK_ENABLE();


  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);


  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.HSICalibrationValue = 16;
  RCC_OscInitStruct.LSIState = RCC_LSI_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL3;
  RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3;
  HAL_RCC_OscConfig(&RCC_OscInitStruct);


  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
  HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0);


  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC;
  PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
  HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);


  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);


  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);


  /* SysTick_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
}


/* I2C2 init function */
void MX_I2C2_Init(void)
{


  hi2c2.Instance = I2C2;
  hi2c2.Init.ClockSpeed = 100000;
  hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
  hi2c2.Init.OwnAddress1 = 0;
  hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
  hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
  hi2c2.Init.OwnAddress2 = 0;
  hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
  hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
  HAL_I2C_Init(&hi2c2);


}


/* RTC init function */
void MX_RTC_Init(void)
{


  RTC_TimeTypeDef sTime;
  RTC_DateTypeDef sDate;


    /**Initialize RTC and set the Time and Date 
    */
  hrtc.Instance = RTC;
  hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
  hrtc.Init.AsynchPrediv = 127;
  hrtc.Init.SynchPrediv = 255;
  hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
  hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
  hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
  HAL_RTC_Init(&hrtc);


  sTime.Hours = 0x0;
  sTime.Minutes = 0x0;
  sTime.Seconds = 0x0;
  sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
  sTime.StoreOperation = RTC_STOREOPERATION_RESET;
  HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD);


  sDate.WeekDay = RTC_WEEKDAY_MONDAY;
  sDate.Month = RTC_MONTH_JANUARY;
  sDate.Date = 0x1;
  sDate.Year = 0x0;


  HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD);


    /**Enable Calibration 
    */
  HAL_RTCEx_SetCalibrationOutPut(&hrtc, RTC_CALIBOUTPUT_512HZ);


}


/** Configure pins as 
        * Analog 
        * Input 
        * Output
        * EVENT_OUT
        * EXTI
*/
void MX_GPIO_Init(void)
{


  GPIO_InitTypeDef GPIO_InitStruct;


  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  __HAL_RCC_GPIOB_CLK_ENABLE();
  __HAL_RCC_GPIOA_CLK_ENABLE();


  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_RESET);


  /*Configure GPIO pin : PC4 */
  GPIO_InitStruct.Pin = GPIO_PIN_4;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);


}


/* USER CODE BEGIN 4 */


/* USER CODE END 4 */


#ifdef USE_FULL_ASSERT


/**
   * @brief Reports the name of the source file and the source line number
   * where the assert_param error has occurred.
   * @param file: pointer to the source file name
   * @param line: assert_param error line source number
   * @retval None
   */
void assert_failed(uint8_t* file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
    ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */


}


#endif


/**
  * @}
  */ 


/**
  * @}
*/ 


void ow_setup_ds2484(void)
{
    
}


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/



I followed the explanation from the datasheet:


Device Reset (After Power-Up)
S AD,0 A DRST A Sr AD,1 A <byte> A\ P
Activities that are underlined denote an optional read access to verify the success of the command.
Set Read Pointer (To Read from Another Register)
Case A: Valid Read Pointer Code
S AD,0 A SRP A C3h A P
C3h is the read pointer code for the Device Configuration register.
Case B: Invalid Read Pointer Code
S AD,0 A SRP A E5h A\ P
E5h is an invalid read pointer code.
Write Device Configuration (Before Starting 1-Wire Activity)
Case A: 1-Wire Idle (1WB = 0)
S AD,0 A WCFG A <byte> A Sr AD,1 A <byte> A\ P
Activities that are underlined denote an optional read access to verify the success of the command.
Case B: 1-Wire Busy (1WB = 1)
S AD,0 A WCFG A\ P
The master should stop and restart as soon as the DS2484 does not acknowledge the command code.
Adjust 1-Wire Port (after power-up, e.g., to select a 1-Wire timing other than the default)
Case A: 1-Wire Idle (1WB = 0)
Repeat to set additional port parameters
S AD,0 A ADJP A <byte> A <byte> A P


However, I still don't know what to do next to read the DS18B20 sensor. Plese help me