OpenBIC
OpenSource Bridge-IC
altera.c File Reference
#include "altera.h"
#include "hal_i2c.h"
#include "util_spi.h"
#include <logging/log.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <zephyr.h>
Include dependency graph for altera.c:

Macros

#define MAX_RETRY   3
 
#define CHECK_ALTERA_STATUS_DELAY_US   100
 
#define SWAP_LSB_TO_MSB(x)
 

Functions

 LOG_MODULE_REGISTER (dev_altera)
 
__weak int pal_load_altera_max10_attr (altera_max10_attr *altera_max10_config)
 
int change_word_to_byte (uint8_t *output, int intput)
 
int get_register_via_i2c (int reg, int *val)
 
int max10_reg_read (int address)
 
int max10_status_read (void)
 
int set_register_via_i2c (int reg, int val)
 
int max10_reg_write (int address, int data)
 
int max10_write_flash_data (int address, int data)
 
int cpld_altera_max10_fw_update (uint32_t offset, uint16_t msg_len, uint8_t *msg)
 

Macro Definition Documentation

◆ CHECK_ALTERA_STATUS_DELAY_US

#define CHECK_ALTERA_STATUS_DELAY_US   100

◆ MAX_RETRY

#define MAX_RETRY   3

◆ SWAP_LSB_TO_MSB

#define SWAP_LSB_TO_MSB (   x)
Value:
x = (((x & 0xaa) >> 1) | ((x & 0x55) << 1)); \
x = (((x & 0xcc) >> 2) | ((x & 0x33) << 2)); \
x = (((x & 0xf0) >> 4) | ((x & 0x0f) << 4));

Function Documentation

◆ change_word_to_byte()

int change_word_to_byte ( uint8_t *  output,
int  intput 
)

◆ cpld_altera_max10_fw_update()

int cpld_altera_max10_fw_update ( uint32_t  offset,
uint16_t  msg_len,
uint8_t *  msg 
)
Here is the call graph for this function:

◆ get_register_via_i2c()

int get_register_via_i2c ( int  reg,
int *  val 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_altera  )

◆ max10_reg_read()

int max10_reg_read ( int  address)
Here is the call graph for this function:

◆ max10_reg_write()

int max10_reg_write ( int  address,
int  data 
)
Here is the call graph for this function:

◆ max10_status_read()

int max10_status_read ( void  )
Here is the call graph for this function:

◆ max10_write_flash_data()

int max10_write_flash_data ( int  address,
int  data 
)
Here is the call graph for this function:

◆ pal_load_altera_max10_attr()

__weak int pal_load_altera_max10_attr ( altera_max10_attr altera_max10_config)

◆ set_register_via_i2c()

int set_register_via_i2c ( int  reg,
int  val 
)
Here is the call graph for this function: