Lines Matching refs:val
87 uint16_t val = mraa_i2c_read_word_data(m_i2c, reg); in readWord() local
91 b1 = (val & 0xff00) >> 8; in readWord()
92 val <<= 8; in readWord()
93 val |= b1; in readWord()
95 return val; in readWord()
104 float ADC121C021::valueToVolts(uint16_t val) in valueToVolts() argument
111 return (val * m_vref / ADC121C021_RESOLUTION); in valueToVolts()
150 uint8_t val = readByte(ADC121C021_REG_CONFIG); in enableAlertFlag() local
153 val |= 0x08; in enableAlertFlag()
155 val &= ~0x08; in enableAlertFlag()
158 writeByte(ADC121C021_REG_CONFIG, val); in enableAlertFlag()
164 uint8_t val = readByte(ADC121C021_REG_CONFIG); in enableAlertPin() local
167 val |= 0x04; in enableAlertPin()
169 val &= ~0x04; in enableAlertPin()
172 writeByte(ADC121C021_REG_CONFIG, val); in enableAlertPin()
178 uint8_t val = readByte(ADC121C021_REG_CONFIG); in enableAlertHold() local
181 val |= 0x10; in enableAlertHold()
183 val &= ~0x10; in enableAlertHold()
186 writeByte(ADC121C021_REG_CONFIG, val); in enableAlertHold()
192 uint8_t val = readByte(ADC121C021_REG_CONFIG); in enableAlertPinPolarityHigh() local
195 val |= 0x01; in enableAlertPinPolarityHigh()
197 val &= ~0x01; in enableAlertPinPolarityHigh()
200 writeByte(ADC121C021_REG_CONFIG, val); in enableAlertPinPolarityHigh()
208 uint8_t val = readByte(ADC121C021_REG_CONFIG) & 0x1f; in setAutomaticConversion() local
210 val |= ((uint8_t)cycleTime << 5); in setAutomaticConversion()
213 writeByte(ADC121C021_REG_CONFIG, val); in setAutomaticConversion()