There were several threads that commented on CLOCK_SPEED_xxx
being missing on the Photon and the general answer is
As a temporary work around (till the new firmware 0.4.2 gets pushed for cloud build) try adding
#ifdef PLATFORM_ID
#include "i2c_hal.h"
#endif