LINV2 driver APIs. More...
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... | |
LINV2 driver APIs.
| #define LIN_ID_DATA_LEN_GET | ( | x | ) | (((uint8_t)(x) & LIN_ID_DATA_LEN_MASK) >> LIN_ID_DATA_LEN_SHIFT) |
#include <drivers/inc/hpm_linv2_drv.h>
| #define LIN_ID_DATA_LEN_MASK 0x30U |
#include <drivers/inc/hpm_linv2_drv.h>
| #define LIN_ID_DATA_LEN_SHIFT 4U |
#include <drivers/inc/hpm_linv2_drv.h>
bit4 and bit5 encode data length in ID
#include <drivers/inc/hpm_linv2_drv.h>
bus inactivity tome to go to sleep
| Enumerator | |
|---|---|
| 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 | |
| enum lin_id_data_length_t |
#include <drivers/inc/hpm_linv2_drv.h>
data length in ID bit4 and bit5
#include <drivers/inc/hpm_linv2_drv.h>
wakeup repeat time
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin get checksum value
| ptr | lin base address |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin get control and status register value
| [in] | ptr | lin base address |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin get data value in byte
| ptr | lin base address |
| index | byte index |
| uint8_t lin_get_data_length | ( | LINV2_Type * | ptr | ) |
#include <drivers/inc/hpm_linv2_drv.h>
get data length
| ptr | lin base address |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin get ID
| ptr | lin base address |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin active status
| ptr | lin base address |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin complete status
| ptr | lin base address |
| hpm_stat_t lin_master_configure_timing | ( | LINV2_Type * | ptr, |
| lin_timing_t * | timing | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin configure timing on master mode
| ptr | lin base address |
| timing | lin_timing_t |
set master mode
src =20MHz baudrate = 19.2KHz
bt_div = 260, scaler = 1, bt_mul = 0
| hpm_stat_t lin_master_receive | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin receive data on master mode
| ptr | lin base address |
| config | lin_trans_config_t |
waiting for lin inactive
config id
receive
start
waiting for receive complete
load register data into buffer
| hpm_stat_t lin_master_sent | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin send data on master mode
| ptr | lin base address |
| config | lin_trans_config_t |
wait for lin inactive
config id
load data into registers
start
waiting for lin complete
| void lin_master_transfer | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin transfer on master mode
| ptr | lin base address |
| config | lin_trans_config_t |
config id
sent or receive
start
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin set checksum mode
| ptr | lin base address |
| enhance_checksum | true for enhance checksum mode, false for normal checksum mode |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin set mode
| ptr | lin base address |
| master | true for master mode, false for slave mode |
|
inlinestatic |
| hpm_stat_t lin_slave_configure_timing | ( | LINV2_Type * | ptr, |
| uint32_t | src_freq_in_hz | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin config timing on slave mode
| ptr | lin base address |
| src_freq_in_hz | source frequency |
set slave mode, clean bt_div, bit_mul, prescl
src = 20MHz, prescaler = 1, bt_div = 250
| void lin_slave_dma_transfer | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin slave dma transfer
| ptr | lin base address |
| config | lin_trans_config_t |
| hpm_stat_t lin_slave_receive | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin receive data on slave mode
| ptr | lin base address |
| config | lin_trans_config_t |
waiting for lin data_req
receive
data ack
waiting for lin complete
| hpm_stat_t lin_slave_sent | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin send data on slave mode
| ptr | lin base address |
| config | lin_trans_config_t |
waiting for lin data_req
transmit
data ack
waiting for lin complete
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin slave set bus inactivity time
| ptr | lin base address |
| time | lin_bus_inactivity_time_t |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin slave set wakeup repeat time
| ptr | lin base address |
| time | lin_wakeup_repeat_time_t |
|
inlinestatic |
| void lin_slave_transfer | ( | LINV2_Type * | ptr, |
| lin_trans_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_linv2_drv.h>
lin transfer on slave mode
| ptr | lin base address |
| config | lin_trans_config_t |
transmit or receive
data ack
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
#include <drivers/inc/hpm_linv2_drv.h>
lin write data value in byte
| ptr | lin base address |
| index | byte index |
| data | byte value |