14 #include "hpm_soc_feature.h"
17 #define LIN_ID_DATA_LEN_SHIFT 4U
18 #define LIN_ID_DATA_LEN_MASK 0x30U
19 #define LIN_ID_DATA_LEN_GET(x) (((uint8_t)(x) & LIN_ID_DATA_LEN_MASK) >> LIN_ID_DATA_LEN_SHIFT)
uint32_t hpm_stat_t
Definition: hpm_common.h:123
lin_id_data_length_t
data length in ID bit4 and bit5
Definition: hpm_lin_drv.h:31
static void lin_slave_ack(LIN_Type *ptr)
lin slave ack
Definition: hpm_lin_drv.h:146
static void lin_wakeup(LIN_Type *ptr)
lin wakeup
Definition: hpm_lin_drv.h:116
static void lin_set_mode(LIN_Type *ptr, bool master)
lin set mode
Definition: hpm_lin_drv.h:179
static void lin_reset_error(LIN_Type *ptr)
lin reset error
Definition: hpm_lin_drv.h:106
void lin_slave_transfer(LIN_Type *ptr, lin_trans_config_t *config)
lin transfer on slave mode
Definition: hpm_lin_drv.c:232
static void lin_slave_set_bus_inactivity_time(LIN_Type *ptr, lin_bus_inactivity_time_t time)
lin slave set bus inactivity time
Definition: hpm_lin_drv.h:157
uint8_t lin_get_data_length(LIN_Type *ptr)
get data length
Definition: hpm_lin_drv.c:86
hpm_stat_t lin_master_sent(LIN_Type *ptr, lin_trans_config_t *config)
lin send data on master mode
Definition: hpm_lin_drv.c:127
static uint8_t lin_get_data_byte(LIN_Type *ptr, uint8_t index)
lin get data value in byte
Definition: hpm_lin_drv.h:195
static bool lin_is_complete(LIN_Type *ptr)
lin complete status
Definition: hpm_lin_drv.h:229
static void lin_write_data_byte(LIN_Type *ptr, uint8_t index, uint8_t data)
lin write data value in byte
Definition: hpm_lin_drv.h:207
static void lin_reset_interrupt(LIN_Type *ptr)
lin reset interrupt
Definition: hpm_lin_drv.h:96
static uint8_t lin_get_status(LIN_Type *ptr)
lin get STATE register value
Definition: hpm_lin_drv.h:86
hpm_stat_t lin_slave_configure_timing(LIN_Type *ptr, uint32_t src_freq_in_hz)
lin config timing on slave mode
Definition: hpm_lin_drv.c:43
lin_wakeup_repeat_time_t
wakeup repeat time
Definition: hpm_lin_drv.h:51
static bool lin_is_active(LIN_Type *ptr)
lin active status
Definition: hpm_lin_drv.h:218
static void lin_sleep(LIN_Type *ptr)
lin sleep
Definition: hpm_lin_drv.h:126
static uint8_t lin_get_id(LIN_Type *ptr)
lin get ID
Definition: hpm_lin_drv.h:240
static void lin_slave_stop(LIN_Type *ptr)
lin slave stop
Definition: hpm_lin_drv.h:136
hpm_stat_t lin_slave_receive(LIN_Type *ptr, lin_trans_config_t *config)
lin receive data on slave mode
Definition: hpm_lin_drv.c:308
lin_bus_inactivity_time_t
bus inactivity tome to go to sleep
Definition: hpm_lin_drv.h:41
hpm_stat_t lin_master_receive(LIN_Type *ptr, lin_trans_config_t *config)
lin receive data on master mode
Definition: hpm_lin_drv.c:179
void lin_master_transfer(LIN_Type *ptr, lin_trans_config_t *config)
lin transfer on master mode
Definition: hpm_lin_drv.c:97
hpm_stat_t lin_slave_sent(LIN_Type *ptr, lin_trans_config_t *config)
lin send data on slave mode
Definition: hpm_lin_drv.c:257
static void lin_slave_set_wakeup_repeat_time(LIN_Type *ptr, lin_wakeup_repeat_time_t time)
lin slave set wakeup repeat time
Definition: hpm_lin_drv.h:168
hpm_stat_t lin_master_configure_timing(LIN_Type *ptr, lin_timing_t *timing)
lin configure timing on master mode
Definition: hpm_lin_drv.c:12
@ id_data_length_2bytes
Definition: hpm_lin_drv.h:32
@ id_data_length_4bytes
Definition: hpm_lin_drv.h:34
@ id_data_length_8bytes
Definition: hpm_lin_drv.h:35
@ id_data_length_2bytes_2
Definition: hpm_lin_drv.h:33
@ wakeup_repeat_time_240ms
Definition: hpm_lin_drv.h:55
@ wakeup_repeat_time_200ms
Definition: hpm_lin_drv.h:53
@ wakeup_repeat_time_180ms
Definition: hpm_lin_drv.h:52
@ wakeup_repeat_time_220ms
Definition: hpm_lin_drv.h:54
@ bus_inactivity_time_10s
Definition: hpm_lin_drv.h:45
@ bus_inactivity_time_6s
Definition: hpm_lin_drv.h:43
@ bus_inactivity_time_4s
Definition: hpm_lin_drv.h:42
@ bus_inactivity_time_8s
Definition: hpm_lin_drv.h:44
#define LIN_CONTROL_DATA_ACK_MASK
Definition: hpm_lin_regs.h:72
#define LIN_CONTROL_STOP_MASK
Definition: hpm_lin_regs.h:42
#define LIN_STATE_LIN_ACTIVE_MASK
Definition: hpm_lin_regs.h:123
#define LIN_CONTROL_RESET_ERROR_MASK
Definition: hpm_lin_regs.h:92
#define LIN_CONTROL_SLEEP_MASK
Definition: hpm_lin_regs.h:52
#define LIN_CONTROL_WAKEUP_REQ_MASK
Definition: hpm_lin_regs.h:102
#define LIN_TV_MASTER_MODE_MASK
Definition: hpm_lin_regs.h:317
#define LIN_STATE_COMPLETE_MASK
Definition: hpm_lin_regs.h:186
#define LIN_CONTROL_RESET_INT_MASK
Definition: hpm_lin_regs.h:82
#define LIN_TV_BUS_INACTIVITY_TIME_SET(x)
Definition: hpm_lin_regs.h:329
#define LIN_TV_WUP_REPEAT_TIME_SET(x)
Definition: hpm_lin_regs.h:339
Definition: hpm_lin_regs.h:12
__RW uint32_t DATABYTE[8]
Definition: hpm_lin_regs.h:13
__RW uint32_t ID
Definition: hpm_lin_regs.h:20
__R uint32_t STATE
Definition: hpm_lin_regs.h:15
__RW uint32_t CONTROL
Definition: hpm_lin_regs.h:14
__RW uint32_t TV
Definition: hpm_lin_regs.h:21
Definition: hpm_lin_drv.h:58
uint32_t src_freq_in_hz
Definition: hpm_lin_drv.h:59
uint32_t baudrate
Definition: hpm_lin_drv.h:60
LIN config.
Definition: hpm_lin_drv.h:66
uint8_t id
Definition: hpm_lin_drv.h:67
bool enhanced_checksum
Definition: hpm_lin_drv.h:71
bool data_length_from_id
Definition: hpm_lin_drv.h:69
uint8_t * data_buff
Definition: hpm_lin_drv.h:68
bool transmit
Definition: hpm_lin_drv.h:72
uint8_t data_length
Definition: hpm_lin_drv.h:70