The details about the battery measurement is already given in the heart rate example project document available in PSOC creator examples.
a) We have VREF pin which can be used as an reference voltage for ADC. To measure the voltage of the battery, we have to measure the voltage level with some constant reference voltage.
When writing to the register we enable the connection between internal bandgap regulator and the VREF pin which always the cap connected to VREF to charge to 1.204V. Once the cap is charged(waiting for some fixed amount time), we change the reference voltage back to internal VDDA/2 which reflects the battery voltage directly. So by comparing VDDA/2 with fixed VREF voltage we easure the battery level.
For heart rate:
refer the function description above the function HeartRate_Measure(). It cleary explains the process and way we measure heart rate.