As reported by Guns.com:
During the Civil War, an enterprising cavalry colonel attached to the Springfield Armory came up with the idea to put a mill in the stock of a Sharps Carbine to grind feed and the rest is fakery legend.
The idea was that the mill would be enclosed in the stock itself with a detachable crank on the right-hand side. The horse trooper would dump wheat or oats in the opening at the bottom and grind them up for horse feed while on the move if needed... Historians with the National Park Service attempted to grind coffee beans with one of the rifles in their collection and found that it was unsuitable...
As for the guns themselves, it's believed that fewer than 100 were ever converted and only 12 are believed to be around today. In fact, so few verified “coffee grinder” Sharps are in circulation, that Springfield Armory specifically mentions them as an example of one of the more commonly faked relic firearms of the 19th Century.
More photos at the link.