16 #ifdef __MSP430_HAS_REF__
21 void Ref_setReferenceVoltage (uint16_t baseAddress,
22 uint8_t referenceVoltageSelect)
24 HWREG8(baseAddress + OFS_REFCTL0_L) &= ~(REFVSEL_3);
25 HWREG8(baseAddress + OFS_REFCTL0_L) |= referenceVoltageSelect;
28 void Ref_disableTempSensor (uint16_t baseAddress)
30 HWREG8(baseAddress + OFS_REFCTL0_L) |= REFTCOFF;
33 void Ref_enableTempSensor (uint16_t baseAddress)
35 HWREG8(baseAddress + OFS_REFCTL0_L) &= ~(REFTCOFF);
38 void Ref_enableReferenceVoltageOutput (uint16_t baseAddress)
40 HWREG8(baseAddress + OFS_REFCTL0_L) |= REFOUT;
43 void Ref_disableReferenceVoltageOutput (uint16_t baseAddress)
45 HWREG8(baseAddress + OFS_REFCTL0_L) &= ~(REFOUT);
48 void Ref_enableReferenceVoltage (uint16_t baseAddress)
50 HWREG8(baseAddress + OFS_REFCTL0_L) |= REFON;
53 void Ref_disableReferenceVoltage (uint16_t baseAddress)
55 HWREG8(baseAddress + OFS_REFCTL0_L) &= ~(REFON);
58 uint16_t Ref_getBandgapMode (uint16_t baseAddress)
60 return (
HWREG16((baseAddress) + OFS_REFCTL0) & BGMODE);
63 bool Ref_isBandgapActive (uint16_t baseAddress)
65 if (
HWREG16((baseAddress) + OFS_REFCTL0) & REFBGACT){
68 return (REF_INACTIVE) ;
72 uint16_t Ref_isRefGenBusy (uint16_t baseAddress)
74 return (
HWREG16((baseAddress) + OFS_REFCTL0) & REFGENBUSY);
77 bool Ref_isRefGenActive (uint16_t baseAddress)
79 if (
HWREG16((baseAddress) + OFS_REFCTL0) & REFGENACT){
82 return (REF_INACTIVE) ;