HPM SDK
HPMicro Software Development Kit
hpm_linv2_drv.h File Reference
#include <math.h>
#include "hpm_common.h"
#include "hpm_linv2_regs.h"
#include "hpm_soc_feature.h"

Go to the source code of this file.

Data Structures

struct  lin_timing_t
 
struct  lin_trans_config_t
 LIN config. More...
 

Macros

#define LIN_ID_DATA_LEN_SHIFT   4U
 
#define LIN_ID_DATA_LEN_MASK   0x30U
 
#define LIN_ID_DATA_LEN_GET(x)   (((uint8_t)(x) & LIN_ID_DATA_LEN_MASK) >> LIN_ID_DATA_LEN_SHIFT)
 

Enumerations

enum  lin_id_data_length_t {
  id_data_length_2bytes , id_data_length_2bytes_2 , id_data_length_4bytes , id_data_length_8bytes ,
  id_data_length_2bytes , id_data_length_2bytes_2 , id_data_length_4bytes , id_data_length_8bytes
}
 data length in ID bit4 and bit5 More...
 
enum  lin_bus_inactivity_time_t {
  bus_inactivity_time_4s , bus_inactivity_time_6s , bus_inactivity_time_8s , bus_inactivity_time_10s ,
  bus_inactivity_time_4s , bus_inactivity_time_6s , bus_inactivity_time_8s , bus_inactivity_time_10s
}
 bus inactivity tome to go to sleep More...
 
enum  lin_wakeup_repeat_time_t {
  wakeup_repeat_time_180ms , wakeup_repeat_time_200ms , wakeup_repeat_time_220ms , wakeup_repeat_time_240ms ,
  wakeup_repeat_time_180ms , wakeup_repeat_time_200ms , wakeup_repeat_time_220ms , wakeup_repeat_time_240ms
}
 wakeup repeat time More...
 

Functions

static uint32_t lin_get_control_and_status (LINV2_Type *ptr)
 lin get control and status register value More...
 
static void lin_reset_interrupt (LINV2_Type *ptr)
 lin reset interrupt More...
 
static void lin_reset_error (LINV2_Type *ptr)
 lin reset error More...
 
static void lin_wakeup (LINV2_Type *ptr)
 lin wakeup More...
 
static void lin_sleep (LINV2_Type *ptr)
 lin sleep More...
 
static void lin_slave_stop (LINV2_Type *ptr)
 lin slave stop More...
 
static void lin_slave_ack (LINV2_Type *ptr)
 lin slave ack More...
 
static void lin_slave_set_bus_inactivity_time (LINV2_Type *ptr, lin_bus_inactivity_time_t time)
 lin slave set bus inactivity time More...
 
static void lin_slave_set_wakeup_repeat_time (LINV2_Type *ptr, lin_wakeup_repeat_time_t time)
 lin slave set wakeup repeat time More...
 
static void lin_set_mode (LINV2_Type *ptr, bool master)
 lin set mode More...
 
static void lin_set_checksum_mode (LINV2_Type *ptr, bool enhance_checksum)
 lin set checksum mode More...
 
static uint8_t lin_get_data_byte (LINV2_Type *ptr, uint8_t index)
 lin get data value in byte More...
 
static void lin_write_data_byte (LINV2_Type *ptr, uint8_t index, uint8_t data)
 lin write data value in byte More...
 
static uint8_t lin_get_id (LINV2_Type *ptr)
 lin get ID More...
 
static uint8_t lin_get_checksum (LINV2_Type *ptr)
 lin get checksum value More...
 
static uint8_t lin_is_active (LINV2_Type *ptr)
 lin active status More...
 
static uint8_t lin_is_complete (LINV2_Type *ptr)
 lin complete status More...
 
hpm_stat_t lin_master_configure_timing (LINV2_Type *ptr, lin_timing_t *timing)
 lin configure timing on master mode More...
 
hpm_stat_t lin_slave_configure_timing (LINV2_Type *ptr, uint32_t src_freq_in_hz)
 lin config timing on slave mode More...
 
void lin_master_transfer (LINV2_Type *ptr, lin_trans_config_t *config)
 lin transfer on master mode More...
 
void lin_slave_transfer (LINV2_Type *ptr, lin_trans_config_t *config)
 lin transfer on slave mode More...
 
uint8_t lin_get_data_length (LINV2_Type *ptr)
 get data length More...
 
hpm_stat_t lin_master_sent (LINV2_Type *ptr, lin_trans_config_t *config)
 lin send data on master mode More...
 
hpm_stat_t lin_master_receive (LINV2_Type *ptr, lin_trans_config_t *config)
 lin receive data on master mode More...
 
hpm_stat_t lin_slave_sent (LINV2_Type *ptr, lin_trans_config_t *config)
 lin send data on slave mode More...
 
hpm_stat_t lin_slave_receive (LINV2_Type *ptr, lin_trans_config_t *config)
 lin receive data on slave mode More...
 
void lin_slave_dma_transfer (LINV2_Type *ptr, lin_trans_config_t *config)
 lin slave dma transfer More...