Guest User

Untitled

a guest
Oct 23rd, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. static void MX_I2C1_Init(void)
  2. {
  3.  
  4. hi2c1.Instance = I2C1;
  5. hi2c1.Init.ClockSpeed = 100000;
  6. hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
  7. hi2c1.Init.OwnAddress1 = 0;
  8. hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
  9. hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
  10. hi2c1.Init.OwnAddress2 = 0;
  11. hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
  12. hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
  13. if (HAL_I2C_Init(&hi2c1) != HAL_OK)
  14. {
  15. _Error_Handler(__FILE__, __LINE__);
  16. }
  17.  
  18. }
  19.  
  20. HAL_I2C_Master_Transmit(&hi2c1,11<<1,0x09, 1, 100);
Add Comment
Please, Sign In to add comment