Sensor API Platform Bus Interfaces.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
|
|
bool | bus_init (volatile void *busif, uint32_t speed) |
|
size_t | bus_read (bus_desc_t *bus, uint8_t addr, void *data, size_t count) |
| Read multiple Bytes from a bus interface. More...
|
|
size_t | bus_write (bus_desc_t *bus, uint8_t addr, const void *data, size_t count) |
| Write multiple Bytes to a bus interface. More...
|
|
bool | bus_probe (bus_desc_t *bus, int arg) |
| Determine the existence of a bus device. More...
|
|
static uint8_t | bus_get (bus_desc_t *bus, uint8_t addr) |
| Read a single Byte from a bus interface. More...
|
|
static void | bus_put (bus_desc_t *bus, uint8_t addr, uint8_t data) |
| Write a single Byte to a bus interface. More...
|
|
static void | bus_reg_bitclear (bus_desc_t *bus, uint8_t addr, uint8_t mask) |
| Clear a bit at a bus device register or memory address. More...
|
|
static void | bus_reg_bitset (bus_desc_t *bus, uint8_t addr, uint8_t mask) |
| Set a bit at a bus 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. 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.
This 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.
- Parameters
-
bus | An initialized bus interface descriptor. |
addr | The device register or memory address. |
mask | The mask of the field to set. |
- Returns
- The value stored in the register or memory field.
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.
- Parameters
-
bus | An initialized bus interface descriptor. |
addr | The device register or memory address. |
mask | The mask of the field to set. |
- Returns
- The value stored in the register or memory field.
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.
- Parameters
-
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. |
- Returns
- Nothing
References bus_get(), and bus_put().