Sensor API Platform Bus Interfaces.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
uint8_t | bus_reg_fieldget (bus_desc_t *bus, uint8_t addr, uint8_t mask) |
Read a field stored at a device register or memory address. More... | |
void | bus_reg_fieldset (bus_desc_t *bus, uint8_t addr, uint8_t mask, uint8_t value) |
Write a field stored at a device register or memory address. More... | |
uint8_t bus_reg_fieldget | ( | bus_desc_t * | bus, |
uint8_t | addr, | ||
uint8_t | mask | ||
) |
Read a field stored at a device register or memory address.
Sensor Platform Board ConfigurationThis routine reads a specified value from a bit field within a 1-Byte device register or memory address. The set bits in the mask parameter determine the field location. For example, if the mask is 30h and the value AFh is stored in the register, the value 2h will be returned.
bus | An initialized bus interface descriptor. |
addr | The device register or memory address. |
mask | The mask of the field to set. |
References bus_get().
void bus_reg_fieldset | ( | bus_desc_t * | bus, |
uint8_t | addr, | ||
uint8_t | mask, | ||
uint8_t | value | ||
) |
Write a field stored at a device register or memory address.
This routine writes a specified value to a bit field within a 1-Byte device register or memory address. The set bits in the mask parameter determine the field location. For example, if the mask is 30h and the value is 2h, the value 20h will be bitwise logically OR'd into the 1-Byte register value after clearing the bit values in the field.
bus | An initialized bus interface descriptor. |
addr | The device register or memory address. |
mask | The mask of the field to set. |
value | The value of the field to set. |