File ns_i2c_register_driver.c
FileList > neuralSPOT > neuralspot > ns-i2c > src > ns_i2c_register_driver.c
Go to the source code of this file
Generic i2c driver for register-based i2c devices. More...
#include "ns_i2c_register_driver.h"
#include "am_hal_iom.h"
#include "ns_i2c.h"
Public Functions
Type | Name |
---|---|
uint32_t | ns_i2c_read_reg (ns_i2c_config_t * cfg, uint32_t devAddr, uint8_t regAddr, uint8_t * value, uint8_t mask) Read 8-bit register over I2C. |
uint32_t | ns_i2c_read_sequential_regs (ns_i2c_config_t * cfg, uint32_t devAddr, uint32_t regAddr, void * buf, uint32_t size) Read sequential 8-bit registers over I2C. |
uint32_t | ns_i2c_write_reg (ns_i2c_config_t * cfg, uint32_t devAddr, uint8_t regAddr, uint8_t value, uint8_t mask) Write 8-bit register over I2C. |
uint32_t | ns_i2c_write_sequential_regs (ns_i2c_config_t * cfg, uint32_t devAddr, uint32_t regAddr, void * buf, uint32_t size) Write sequential 8-bit registers over I2C. |
Detailed Description
Author:
Carlos Morales
Version:
0.1
Date:
2022-08-26
Copyright:
Copyright (c) 2022
Public Functions Documentation
function ns_i2c_read_reg
Read 8-bit register over I2C.
uint32_t ns_i2c_read_reg (
ns_i2c_config_t * cfg,
uint32_t devAddr,
uint8_t regAddr,
uint8_t * value,
uint8_t mask
)
Parameters:
cfg
I2C configurationdevAddr
Device addressregAddr
Register addressvalue
Register Valuemask
Read mask
Returns:
uint32_t status
Parameters:
cfg
Handle obtained from ns_i2c_interface_initdevAddr
Device addressregAddr
8-bit register addressvalue
Register valuemask
Read mask
Returns:
uint32_t status
function ns_i2c_read_sequential_regs
Read sequential 8-bit registers over I2C.
uint32_t ns_i2c_read_sequential_regs (
ns_i2c_config_t * cfg,
uint32_t devAddr,
uint32_t regAddr,
void * buf,
uint32_t size
)
Parameters:
cfg
I2C configurationdevAddr
Device addressregAddr
First register addressbuf
Buffer to store register valuessize
Number of registers to read
Returns:
uint32_t status
Parameters:
cfg
I2C configurationdevAddr
Device addressregAddr
First 8-bit register addressbuf
Buffer to store register valuessize
Number of registers to read
Returns:
uint32_t status
function ns_i2c_write_reg
Write 8-bit register over I2C.
uint32_t ns_i2c_write_reg (
ns_i2c_config_t * cfg,
uint32_t devAddr,
uint8_t regAddr,
uint8_t value,
uint8_t mask
)
Parameters:
cfg
I2C configurationdevAddr
Device addressregAddr
Register addressvalue
Register Valuemask
Write mask
Returns:
uint32_t status
Parameters:
cfg
Handle obtained from ns_i2c_interface_initdevAddr
Device addressregAddr
8-bit register addressvalue
Register valuemask
Write mask
Returns:
uint32_t status
function ns_i2c_write_sequential_regs
Write sequential 8-bit registers over I2C.
uint32_t ns_i2c_write_sequential_regs (
ns_i2c_config_t * cfg,
uint32_t devAddr,
uint32_t regAddr,
void * buf,
uint32_t size
)
Parameters:
cfg
I2C configurationdevAddr
Device addressregAddr
First register addressbuf
Pointer to buffer of values to be writtensize
Number of bytes to write
Returns:
uint32_t status
Parameters:
cfg
I2C configurationdevAddr
Device addressregAddr
First 8-bit register addressbuf
Pointer to buffer of values to be writtensize
Number of bytes to write
Returns:
uint32_t status
The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-i2c/src/ns_i2c_register_driver.c