⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 l_target.h

📁 MC68HC908EY16 LIN-BUS源码(编译环境:CodeWarriorV3.1)
💻 H
字号:
/* ************************************************************************ */
/*                                                                          */
/*                  Volcano Communications technologies AB                  */
/*                            All rights reserved                           */
/*                                                                          */
/* ************************************************************************ */

/*         File: l_target.h                                                 */
/*       Author: Anders Kallerdahl/VCT AB                                   */
/*  Description: Target specific definitions for the hc08 microcontroller   */
/*                                                                          */
/*  Date:   Author:     Description:                                        */
/*  -----   -------     ------------                                        */
/*  020925  VCT-AKl     + Copied from Star12                                */
/*                                                                          */
/*  Assumptions: -                                                          */
/*                                                                          */
/****************************************************************************/

#ifndef __L_TARGET_H__
#define __L_TARGET_H__

#include <l_types.h>

typedef volatile unsigned char l_reg8;

/* Struct that can be layed over a ESCI interface. */
typedef struct
{
  l_reg8 scc1;	    /* base + 0  0x0010 */
  l_reg8 scc2;		/* base + 1  0x0011 */
  l_reg8 scc3;		/* base + 2  0x0012 */
  l_reg8 scs1;		/* base + 3  0x0013 */
  l_reg8 scs2;		/* base + 4  0x0014 */
  l_reg8 scdr;		/* base + 5  0x0015 */
  l_reg8 scbr;		/* base + 6  0x0016 */
  l_reg8 scpsc; 	/* base + 7  0x0017 */
  l_reg8 sciactl;	/* base + 8  0x0018 */
  l_reg8 sciadat;	/* base + 9  0x0019 */
} *l_UART_handle;

/* Define the target specific UART descriptor for the hc08 */
typedef struct 
{
  l_UART_handle sreg_base;       /* Base address to SCI controller */
  l_reg8*       port_ddr_reg;    /* Data direction register for RX and TX pin */
  l_reg8*       port_data_reg;   /* Data in/out register for RX and TX pin */
  l_u8          ddr_rx_mask;     /* One bit set mask, masks RX pin in the DDR */
  l_u8          ddr_tx_mask;     /* One bit set mask, masks TX pin in the DDR */
  l_u8          scpsc_norm; 	 /* Prescaler settings for normal operation */
  l_u8          scbr_norm;		 /* Bit rate divider for normal operation */  
  l_u8          scpsc_break; 	 /* Prescaler settings for break generation. */
  l_u8          scbr_break;		 /* Bit rate divider for break generation */  
} l_uart_ram_descriptor, *l_uart_ram_descriptor_handle;

typedef const l_uart_ram_descriptor  l_uart_descriptor;
typedef l_uart_descriptor           *l_uart_descriptor_handle;

/* LIN API function prototypes for master */
L_LIB_PREFIX l_bool l_hc08esci_II_ifc_m_connect (void);
L_LIB_PREFIX l_bool l_hc08esci_II_ifc_m_disconnect (void);
L_LIB_PREFIX void   l_hc08esci_II_ifc_m_init (void);
L_LIB_PREFIX l_u16  l_hc08esci_II_ifc_m_ioctl (l_ioctl_op op, void *pv);
L_LIB_PREFIX void   l_hc08esci_II_ifc_m_rx (void);
L_LIB_PREFIX void   l_hc08esci_II_ifc_m_tx (void);
L_LIB_PREFIX void   l_hc08esci_II_sch_set (l_schedule_handle sch, l_u8 ent);
L_LIB_PREFIX l_u8   l_hc08esci_II_sch_tick (void);
L_LIB_PREFIX void   l_hc08esci_II_ifc_m_goto_sleep (void);
L_LIB_PREFIX l_u16  l_hc08esci_II_ifc_m_read_status(void);

/* LIN API function prototypes for slave */
L_LIB_PREFIX l_bool l_hc08esci_II_ifc_s_connect (void);
L_LIB_PREFIX l_bool l_hc08esci_II_ifc_s_disconnect (void);
L_LIB_PREFIX void   l_hc08esci_II_ifc_s_init (void);
L_LIB_PREFIX l_u16  l_hc08esci_II_ifc_s_ioctl (l_ioctl_op op, void *pv);
L_LIB_PREFIX void   l_hc08esci_II_ifc_s_rx (void);
L_LIB_PREFIX void   l_hc08esci_II_ifc_s_tx (void);
L_LIB_PREFIX l_u16  l_hc08esci_II_ifc_s_read_status(void);
L_LIB_PREFIX void   l_hc08esci_II_ifc_s_wakeup(void);

/* LIN API function prototypes for master & slave */
L_LIB_PREFIX l_bool l_hc08esci_II_sys_init(void);
L_LIB_PREFIX void	l_hc08esci_II_bytes_wr( l_u8 skip, l_u8 count, const l_u8* const data, l_u8* dest);
L_LIB_PREFIX void	l_hc08esci_II_bytes_rd(l_u8 skip, l_u8 count, l_u8* const data, l_u8 *src);

/* LIN API functions for class 2 diagnostic */
L_LIB_PREFIX l_bool ld2_response_slave(l_bool success);
L_LIB_PREFIX l_bool ld2_header_slave(void);
L_LIB_PREFIX void   ld2_init_slave(void);
L_LIB_PREFIX l_u8   ld2_read_by_id(l_u8 rid);
L_LIB_PREFIX void   ld2_prepare_response(l_u8 length);
L_LIB_PREFIX void   ld2_init_master(void);
L_LIB_PREFIX l_bool ld2_header_master(void);
L_LIB_PREFIX l_bool ld2_response_master(l_bool success);


#endif /* __L_TARGET_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -