Windmills came into use during the 12th century for the milling of grain into flour. Pope Celestine III issued a decree around 1191 mandating windmill owners should pay a tithe to the church because the wind belonged to God. There were other options for grinding grain. In early days, people used a quern-stone to grind grain by hand. Watermills and animal-powered mills were also used in the middle ages.
To learn more about medieval windmills:
My medieval novels are available on Amazon: