nPZero IC
API and Examples for the nPZero
Loading...
Searching...
No Matches
np0_hal_write Example

Description

This example demonstrates the usage of the nPZero driver to setup the ADC and there threshould's. Booth ADC's (Internal and External) are set in the example code, the ADC_IN pin for this example is connected to VDD.

Code nPZero HAL write example

Code snippet ...

np0_status_e np0_hal_write(uint8_t slave_address, uint8_t *pData, uint16_t size, uint32_t timeout)
{
if (HAL_I2C_Master_Transmit(&m_hi2c1, slave_address, pData, size, timeout) != HAL_OK)
{
return ERR;
}
return OK;
}
np0_status_e
Definition: np0.h:31
@ ERR
Definition: np0.h:33
@ OK
Definition: np0.h:32
np0_status_e np0_hal_write(uint8_t slave_address, uint8_t *pData, uint16_t size, uint32_t timeout)
Function to write to registers over I2C.
Definition: np0_hal.c:77

Note

  • Adapt the code to match your MCU throw np0_hal_init.
  • Consult the nPZero driver function documentation for precise function usage.