?? mc_message.h
字號:
/**
* @file mc_message.h
*
* Data structures:
* 1) used to send messages to the MC SWE,
* 2) MC can receive.
*
* @author ()
* @version 0.1
*/
/*
* History:
*
* Date Author Modification
* -------------------------------------------------------------------
* 7/1/2003 () Create.
*
* (C) Copyright 2003 by ICT Embedded B.V., All Rights Reserved
*/
#ifndef __MC_MESSAGE_H_
#define __MC_MESSAGE_H_
#include "rv/rv_general.h"
#include "mc/mc_cfg.h"
#include "mc/mc_env.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
* The message offset must differ for each SWE in order to have
* unique msg_id in the system.
*/
#define MC_MESSAGE_OFFSET BUILD_MESSAGE_OFFSET(MC_USE_ID)
/**
* @name MC_SUBSCRIBE_REQ_MSG
*
* Detailled description
* The T_MC_SUBSCRIBE_REQ_MSG message can be used to subscribe to the
* MC-driver. This message is simular to the mc_subscribe(). The driver
* responds with a T_MC_SUBSCRIBE_RSP_MSG message.
*
*/
/*@{*/
/** Subscribe request. */
#define MC_SUBSCRIBE_REQ_MSG (MC_MESSAGE_OFFSET | 0x001)
typedef struct {
T_RV_HDR os_hdr;
T_MC_SUBSCRIBER *subscriber_p;
T_RV_RETURN return_path;
} T_MC_SUBSCRIBE_REQ_MSG;
/** Subscribe response. */
#define MC_SUBSCRIBE_RSP_MSG (MC_MESSAGE_OFFSET | 0x002)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
T_MC_SUBSCRIBER *subscriber_p;
} T_MC_SUBSCRIBE_RSP_MSG;
/*@}*/
/**
* @name MC_UNSUBSCRIBE_REQ_MSG
*
* Detailled description
* The T_MC_UNSUBSCRIBE_REQ_MSG message can be used to unsubscribe from the MC-driver.
* This message is simular to the mc_unsubscribe() function. The driver responds with
* a T_MC_UNSUBSCRIBE_RSP_MSG message.
*
*/
/*@{*/
/** Unsubscribe request. */
#define MC_UNSUBSCRIBE_REQ_MSG (MC_MESSAGE_OFFSET | 0x003)
typedef struct {
T_RV_HDR os_hdr;
T_MC_SUBSCRIBER *subscriber_p;
} T_MC_UNSUBSCRIBE_REQ_MSG;
/** Unsubscribe response. */
#define MC_UNSUBSCRIBE_RSP_MSG (MC_MESSAGE_OFFSET | 0x004)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
} T_MC_UNSUBSCRIBE_RSP_MSG;
/*@}*/
/**
* @name MC_READ_REQ_MSG
*
* Detailled description
* The T_MC_READ_REQ_MSG message can be used to read data from a MC card.
* This message is simular to the mc_read() function. The driver responds with
* a T_MC_READ_RSP_MSG message.
*
*/
/*@{*/
/** Read request */
#define MC_READ_REQ_MSG (MC_MESSAGE_OFFSET | 0x005)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
T_MC_RW_MODE mode;
UINT32 addr;
UINT8 *data_p;
UINT32 data_size;
T_MC_SUBSCRIBER subscriber;
} T_MC_READ_REQ_MSG;
/** Read response */
#define MC_READ_RSP_MSG (MC_MESSAGE_OFFSET | 0x006)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
UINT8 *data_p;
UINT32 data_size;
} T_MC_READ_RSP_MSG;
/*@}*/
/**
* @name MC_WRITE_REQ_MSG
*
* Detailled description
* The T_MC_ WRITE_REQ_MSG message can be used to write data to a MC card.
* This message is simular to the mc_write() function. The driver responds
* with a T_MC_WRITE_RSP_MSG message.
*
*/
/*@{*/
/** Write request */
#define MC_WRITE_REQ_MSG (MC_MESSAGE_OFFSET | 0x007)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
T_MC_RW_MODE mode;
UINT32 addr;
UINT8 *data_p;
UINT32 data_size;
T_MC_SUBSCRIBER subscriber;
} T_MC_WRITE_REQ_MSG;
/** Write response */
#define MC_WRITE_RSP_MSG (MC_MESSAGE_OFFSET | 0x008)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
UINT8 *data_p;
UINT32 data_size;
} T_MC_WRITE_RSP_MSG;
/*@}*/
/**
* @name MC_ERASE_GROUP_REQ_MSG
*
* Detailled description
* The T_MC_ERASE_GROUP_REQ_MSG message can be used to erase a range of erase
* groups on the card. This message is simular to the mc_erase_group ()
* function. The driver re-sponds with a T_MC_ERASE_GROUP_RSP_MSG message.
*
*/
/*@{*/
/** Erase group request */
#define MC_ERASE_GROUP_REQ_MSG (MC_MESSAGE_OFFSET | 0x009)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
UINT32 erase_group_start;
UINT32 erase_group_end;
T_MC_SUBSCRIBER subscriber;
} T_MC_ERASE_GROUP_REQ_MSG;
/** Erase group respond */
#define MC_ERASE_GROUP_RSP_MSG (MC_MESSAGE_OFFSET | 0x00A)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
} T_MC_ERASE_GROUP_RSP_MSG;
/*@}*/
/**
* @name T_MC_SET_PROTECT_REQ_MSG
*
* Detailled description
* The T_MC_SET_PROTECT_REQ_MSG message can be used to set the write
* protection of the addressed write protect group. This message is simular
* to the mc_set_write_protect() function (see 2.1.6). The driver responds
* with a T_MC_SET_PROTECT_RSP_MSG message.
*
*/
/*@{*/
/** Set protect request */
#define MC_SET_PROTECT_REQ_MSG (MC_MESSAGE_OFFSET | 0x00B)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
UINT32 wr_prot_group;
T_MC_SUBSCRIBER subscriber;
} T_MC_SET_PROTECT_REQ_MSG;
/** Set protect respond */
#define MC_SET_PROTECT_RSP_MSG (MC_MESSAGE_OFFSET | 0x00C)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
} T_MC_SET_PROTECT_RSP_MSG;
/*@}*/
/**
* @name MC_CLR_PROTECT_REQ_MSG
*
* Detailled description
* The T_MC_CLR_PROTECT_REQ_MSG message can be used to clear the write
* protection of the addressed write protect group. This message is simular
* to the mc_clr_write_protect() function. The driver responds to a
* MC_CLR_PROTECT_REQ_MSG message with a T_MC_CLR_PROTECT_RSP_MSG message.
*
*/
/*@{*/
/** Clear write protect request */
#define MC_CLR_PROTECT_REQ_MSG (MC_MESSAGE_OFFSET | 0x00D)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
UINT32 wr_prot_group;
T_MC_SUBSCRIBER subscriber;
} T_MC_CLR_PROTECT_REQ_MSG;
/** Clear write protect respond */
#define MC_CLR_PROTECT_RSP_MSG (MC_MESSAGE_OFFSET | 0x00E)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
} T_MC_CLR_PROTECT_RSP_MSG;
/*@}*/
/**
* @name MC_GET_PROTECT_REQ_MSG
*
* Detailled description
* The T_MC_GET_PROTECT_REQ_MSG message can be used to read 32 write
* protection bits representing 32 write protect groups starting at a
* specified address. This message is simular to the mc_get_write_protect()
* function. The driver responds with a T_MC_GET_PROTECT_RSP_MSG message.
* The wr_proo_grps variable contains the write pro-tection groups.
*
*/
/*@{*/
/** Get write protect request */
#define MC_GET_PROTECT_REQ_MSG (MC_MESSAGE_OFFSET | 0x00F)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
UINT32 wr_prot_group;
T_MC_SUBSCRIBER subscriber;
} T_MC_GET_PROTECT_REQ_MSG;
/** Get write protect respond */
#define MC_GET_PROTECT_RSP_MSG (MC_MESSAGE_OFFSET | 0x010)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
UINT32 wr_prot_grps;
} T_MC_GET_PROTECT_RSP_MSG;
/*@}*/
/**
* @name MC_CARD_STATUS_REQ_MSG
*
* Detailled description
* The T_MC_CARD_STATUS_REQ_MSG message can be used to read 32-bit status
* register of a MC-card. This message is simular to the
* mc_get_card_status() function. The driver responds with a
* T_MC_CARD_STATUS_RSP_MSG message.
*
*/
/*@{*/
/** Get card status request */
#define MC_CARD_STATUS_REQ_MSG (MC_MESSAGE_OFFSET | 0x011)
typedef struct {
T_RV_HDR os_hdr;
T_MC_RCA rca;
T_MC_SUBSCRIBER subscriber;
} T_MC_CARD_STATUS_REQ_MSG;
/** Get card status respond */
#define MC_CARD_STATUS_RSP_MSG (MC_MESSAGE_OFFSET | 0x012)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT32 card_status;
} T_MC_CARD_STATUS_RSP_MSG;
/*@}*/
/**
* @name MC_UPDATE_ACQ_REQ_MSG
*
* Detailled description
* The T_MC_UPDATE_ACQ_REQ_MSG message can be used to start an
* identification cycle of the card stack. This message is simular to the
* mc_update_acq () function. The driver re-sponds with a
* T_MC_UPDATE_ACQ_RSP_MSG message. The stack_size variable in the response
* message contains the number of connected MC-cards.
*
*/
/*@{*/
/** Update acquisition request */
#define MC_UPDATE_ACQ_REQ_MSG (MC_MESSAGE_OFFSET | 0x013)
typedef struct {
T_RV_HDR os_hdr;
T_MC_SUBSCRIBER subscriber;
} T_MC_UPDATE_ACQ_REQ_MSG;
/** Update acquisition response */
#define MC_UPDATE_ACQ_RSP_MSG (MC_MESSAGE_OFFSET | 0x014)
typedef struct {
T_RV_HDR os_hdr;
T_RV_RET result;
UINT16 stack_size;
} T_MC_UPDATE_ACQ_RSP_MSG;
/*@}*/
/**
* @name MC_RESET_REQ_MSG
*
* Detailled description
* This function resets all cards to idle state. This message is simular to
* the mc_reset() function. The driver responds with a T_MC_RESET_MSG
* message.
*
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -