Apparatus and methods described include a pump, which includes a piston, a diaphragm coupled to the piston and defining a wall of a fluid chamber, and a snail cam. The snail cam is configured to, by rotating, alternatingly (i) pump fluid from the fluid chamber, and (ii) draw fluid into the fluid chamber, by driving the piston to move the diaphragm. Other embodiments are also described.