HPM SDK
HPMicro Software Development Kit
hpm_uart_lin.c File Reference
#include "hpm_uart_lin.h"

Macros

#define HPM_UART_LIN_RETRY_COUNT   (50000U)
 
#define HPM_UART_LIN_BREAK_LENGTH   (13U) /* bits */
 
#define HPM_UART_LIN_WAKEUP_LENGTH   (400U) /* us */
 

Functions

uint8_t hpm_uart_lin_calculate_protected_id (uint8_t id)
 calculate lin pid from id More...
 
static uint8_t hpm_uart_lin_calculate_checksum (uint8_t id, uint8_t *data, uint8_t length, bool enhanced_checksum)
 
static bool hpm_uart_lin_check_checksum (uint8_t id, uint8_t *data, uint8_t length, bool enhanced_checksum, uint8_t checksum)
 
static void hpm_uart_lin_send_break (UART_Type *ptr, uart_lin_master_pin_ctrl_t *pin_ctrl)
 
static void hpm_uart_lin_send_sync (UART_Type *ptr)
 
void hpm_uart_lin_send_wakeup (UART_Type *ptr, uart_lin_master_pin_ctrl_t *pin_ctrl)
 uart_lin send break signal More...
 
uart_lin_stat_t hpm_uart_lin_master_send_frame (uart_lin_master_config_t *config)
 master send lin frame, including break, sync, pid, data and checksum More...
 
uart_lin_stat_t hpm_uart_lin_master_receive_frame (uart_lin_master_config_t *config)
 master receive lin frame. master send break, sync, pid, then receive data and checksum More...
 
void hpm_uart_lin_master_send_head (uart_lin_master_config_t *config)
 master send data and checksum More...
 
void hpm_uart_lin_master_send_data (uart_lin_master_config_t *config)
 master send data and checksum More...
 
uart_lin_stat_t hpm_uart_lin_master_receive_data (uart_lin_master_config_t *config)
 master receive and check data&checksum More...
 
void hpm_uart_lin_slave_send_data (uart_lin_slave_config_t *config)
 slave send data and checksum More...
 
uart_lin_stat_t hpm_uart_lin_slave_receive_data (uart_lin_slave_config_t *config)
 salve receive and check data&checksum More...
 

Macro Definition Documentation

◆ HPM_UART_LIN_BREAK_LENGTH

#define HPM_UART_LIN_BREAK_LENGTH   (13U) /* bits */

◆ HPM_UART_LIN_RETRY_COUNT

#define HPM_UART_LIN_RETRY_COUNT   (50000U)

◆ HPM_UART_LIN_WAKEUP_LENGTH

#define HPM_UART_LIN_WAKEUP_LENGTH   (400U) /* us */

Function Documentation

◆ hpm_uart_lin_calculate_checksum()

static uint8_t hpm_uart_lin_calculate_checksum ( uint8_t  id,
uint8_t *  data,
uint8_t  length,
bool  enhanced_checksum 
)
static

◆ hpm_uart_lin_check_checksum()

static bool hpm_uart_lin_check_checksum ( uint8_t  id,
uint8_t *  data,
uint8_t  length,
bool  enhanced_checksum,
uint8_t  checksum 
)
static

◆ hpm_uart_lin_send_break()

static void hpm_uart_lin_send_break ( UART_Type ptr,
uart_lin_master_pin_ctrl_t pin_ctrl 
)
static

◆ hpm_uart_lin_send_sync()

static void hpm_uart_lin_send_sync ( UART_Type ptr)
static