no-OS
|
#include "afe_config.h"
Functions | |
int | init_lcd (void) |
Initialize LCD screen and text. More... | |
int | afe_init (void) |
Initializes SPI handler, AFE register values. More... | |
int | afe_start (void) |
Starts the AFE. More... | |
int | config_afe_irq (void) |
Configures IRQ flags. More... | |
int | config_wfb (void) |
configure WFB_CFB register, initialized with start filling More... | |
int | afe_read_waveform (uint16_t *pData, uint16_t numSamples) |
reads waveform buffer. More... | |
int | afe_read_period (uint32_t *pPeriod, uint16_t numPeriods) |
reads period registers. More... | |
int | afe_read_rms_one (uint32_t *pRMS, uint16_t numRMS) |
reads rmsonevalue registers. More... | |
int | afe_read_rms_1012 (uint32_t *pRMS, uint16_t numRMS) |
reads rms1012value registers. More... | |
int | afe_read_angle (uint16_t *pAngle, uint16_t numAngles, uint16_t angleVolCur) |
reads angle registers. More... | |
int | afe_read_status_1 (uint32_t *pSTATUS1) |
Read STATUS1 register. More... | |
int | afe_read_version (uint32_t *pVersion) |
reads AFE version. More... | |
int | afe_write_32bit_reg (uint16_t addr, uint32_t *pData) |
write the 32bit value to the register More... | |
int | afe_write_16bit_reg (uint16_t addr, uint16_t *pData) |
write the 16bit value to the register More... | |
int | afe_read_32bit_buff (uint16_t addr, uint16_t numSamples, uint32_t *pData) |
reads the 32bit value from the register and saves to a 32bit buffer. More... | |
int | afe_read_16bit_buff (uint16_t addr, uint16_t numSamples, uint16_t *pData) |
reads the 16bit value from the register and saves to a 16bitbuffer. More... | |
int | reset_afe (void) |
resets the AFE More... | |
int | spi_device_init (void) |
SPI Initialization Function. More... | |
int | afe_read_status0 (uint32_t *pSTATUS0) |
Read STATUS0 register. More... | |
void | afe_wait_settling (uint32_t cycles) |
Waits for passed number of cycles. More... | |
int | afe_set_acc_mode (uint16_t frequency, uint16_t vconsel, uint16_t iconsel) |
sets ACCMODE register for nominal frequency, ICONSEL, VCONSEL. More... | |
int | afe_set_ref_channel (uint16_t refChannel) |
sets refChannel. More... | |
Variables | |
struct no_os_spi_desc * | hSPI |
struct no_os_spi_msg | spiMsg |
struct no_os_gpio_init_param | reset_gpio_ip |
int afe_init | ( | void | ) |
Initializes SPI handler, AFE register values.
int afe_read_16bit_buff | ( | uint16_t | addr, |
uint16_t | numSamples, | ||
uint16_t * | pData | ||
) |
reads the 16bit value from the register and saves to a 16bitbuffer.
[in] | addr | - register address |
[in] | numSamples | - number of samples to be read |
[in] | pData | - pointer to read pData |
int afe_read_32bit_buff | ( | uint16_t | addr, |
uint16_t | numSamples, | ||
uint32_t * | pData | ||
) |
reads the 32bit value from the register and saves to a 32bit buffer.
[in] | addr | - register address |
[in] | numSamples | - number of samples to be write |
[out] | pData | - pointer to write pData |
int afe_read_angle | ( | uint16_t * | pAngle, |
uint16_t | numAngles, | ||
uint16_t | angleVolCur | ||
) |
reads angle registers.
[out] | pAngle | - pointer to read angle values. |
[in] | numAngles | - number of angle values to be read. |
[in] | angleVolCur | - address of current or voltage angle |
int afe_read_period | ( | uint32_t * | pPeriod, |
uint16_t | numPeriods | ||
) |
reads period registers.
[out] | pPeriod | - pointer to read period. |
[in] | numPeriods | - number of periods to be read. |
int afe_read_rms_1012 | ( | uint32_t * | pRMS, |
uint16_t | numRMS | ||
) |
reads rms1012value registers.
[out] | pRMS | - pointer to read RMS1012 values. |
[in] | numRMS | - number of rms values to be read. |
int afe_read_rms_one | ( | uint32_t * | pRMS, |
uint16_t | numRMS | ||
) |
reads rmsonevalue registers.
[out] | pRMS | - pointer to read RMSOne values. |
[in] | numRMS | - number of rms values to be read. |
int afe_read_status0 | ( | uint32_t * | pSTATUS0 | ) |
Read STATUS0 register.
[out] | pSTATUS0 | - pointer to read STATUS0. |
int afe_read_status_1 | ( | uint32_t * | pSTATUS1 | ) |
Read STATUS1 register.
[out] | pSTATUS1 | - pointer to read STATUS1. |
int afe_read_version | ( | uint32_t * | pVersion | ) |
reads AFE version.
[out] | pVersion | - pointer to read AFE version. |
int afe_read_waveform | ( | uint16_t * | pData, |
uint16_t | numSamples | ||
) |
reads waveform buffer.
[out] | pData | - pointer to read waveform buffer data. |
[in] | numSamples | - number of samples to be read. |
int afe_set_acc_mode | ( | uint16_t | frequency, |
uint16_t | vconsel, | ||
uint16_t | iconsel | ||
) |
sets ACCMODE register for nominal frequency, ICONSEL, VCONSEL.
[in] | frequency | - nomianl frequency |
[in] | vconsel | - vconsel bits |
[in] | iconsel | - iconsel bits |
int afe_set_ref_channel | ( | uint16_t | refChannel | ) |
sets refChannel.
[in] | refChannel | - refChannel |
int afe_start | ( | void | ) |
Starts the AFE.
void afe_wait_settling | ( | uint32_t | cycles | ) |
Waits for passed number of cycles.
[in] | cycles | - Number of cycles to wait |
int afe_write_16bit_reg | ( | uint16_t | addr, |
uint16_t * | pData | ||
) |
write the 16bit value to the register
[in] | addr | - register address |
[in] | pData | - pointer to write data |
int afe_write_32bit_reg | ( | uint16_t | addr, |
uint32_t * | pData | ||
) |
write the 32bit value to the register
[in] | addr | - register address |
[in] | pData | - pointer to write data |
int config_afe_irq | ( | void | ) |
Configures IRQ flags.
int config_wfb | ( | void | ) |
configure WFB_CFB register, initialized with start filling
int init_lcd | ( | void | ) |
Initialize LCD screen and text.
int reset_afe | ( | void | ) |
resets the AFE
int spi_device_init | ( | void | ) |
SPI Initialization Function.
status | 0 for success |
struct no_os_spi_desc* hSPI |
struct no_os_gpio_init_param reset_gpio_ip |
struct no_os_spi_msg spiMsg |