I think it's probably part of the inside of the mill power transfer. Inside the building connected to the shaft from the waterwheel there was sometimes a large mostly wood from the pictures I have seen a device, equivalent of a large gear, that transfer power to the mill. Of course, they probably did thing differently in different parts of the country and time periods.