hirokuma hirokuma / RCS730
Embed: (wiki syntax)

« Back to documentation index

RCS730 Class Reference

FeliCa Link(RC-S730) class. More...

#include <RCS730.h>

Data Structures

struct  callbacktable_t
 Callback Table. More...

Public Types

enum  OpMode { OPMODE_LITES_HT = 0x00, OPMODE_PLUG = 0x01, OPMODE_NFCDEP = 0x02, OPMODE_LITES = 0x03 }
 

Operation Mode.

More...
enum  PlugSysCode { PLUG_SYS_CODE_FEEL = 0, PLUG_SYS_CODE_NDEF = 2 }
 

System Code in Plug mode.

More...

Public Member Functions

 RCS730 (I2C &I2c)
 constructor
virtual ~RCS730 ()
 destructor
void setCallbackTable (const callbacktable_t *pInitTable)
 Set Callback Table.
int byteWrite (uint16_t MemAddr, uint8_t Data)
 Byte Write(1byte)
int pageWrite (uint16_t MemAddr, const uint8_t *pData, int Length)
 Page Write.
int randomRead (uint16_t MemAddr, uint8_t *pData)
 Random Read(1byte)
int sequentialRead (uint16_t MemAddr, uint8_t *pData, int Length)
 Sequential Read.
int currentAddrRead (uint8_t *pData)
 Current Address Read(1byte)
int readRegister (uint16_t Reg, uint32_t *pData)
 Read Register.
int writeRegisterForce (uint16_t Reg, uint32_t Data)
 Write Register Force.
int writeRegister (uint16_t Reg, uint32_t Data, uint32_t Mask=0xffffffff)
 Write Register.
int setRegOpMode (OpMode Mode)
 Set operation mode.
int setRegSlaveAddr (int SAddr)
 Set I2C Slave Address.
int setRegInterruptMask (uint32_t Mask, uint32_t Value)
 Set interrupt mask.
int setRegPlugSysCode (PlugSysCode SysCode)
 Set System Code in Plug mode.
int goToInitializeStatus ()
 go to initialize status
int initFTMode (OpMode Mode)
 initialize to FeliCa Through(FT) mode
int initNfcDepMode ()
 initialize to NFC-DEP mode
void isrIrq ()
 Interrupt Service Routine(IRQ pin)

Static Public Attributes

static const uint16_t BLK_PAD0 = 0x0000
 [addr]PAD0
static const uint16_t BLK_PAD1 = 0x0001
 [addr]PAD1
static const uint16_t BLK_PAD2 = 0x0002
 [addr]PAD2
static const uint16_t BLK_PAD3 = 0x0003
 [addr]PAD3
static const uint16_t BLK_PAD4 = 0x0004
 [addr]PAD4
static const uint16_t BLK_PAD5 = 0x0005
 [addr]PAD5
static const uint16_t BLK_PAD6 = 0x0006
 [addr]PAD6
static const uint16_t BLK_PAD7 = 0x0007
 [addr]PAD7
static const uint16_t BLK_PAD8 = 0x0008
 [addr]PAD8
static const uint16_t BLK_PAD9 = 0x0009
 [addr]PAD9
static const uint16_t BLK_PAD10 = 0x000a
 [addr]PAD10
static const uint16_t BLK_PAD11 = 0x000b
 [addr]PAD11
static const uint16_t BLK_PAD12 = 0x000c
 [addr]PAD12
static const uint16_t BLK_PAD13 = 0x000d
 [addr]PAD13
static const uint16_t BLK_REG = 0x000e
 [addr]REG
static const uint16_t BLK_RC = 0x0080
 [addr]RC
static const uint16_t BLK_MAC = 0x0081
 [addr]MAC
static const uint16_t BLK_ID = 0x0082
 [addr]ID
static const uint16_t BLK_D_ID = 0x0083
 [addr]D_ID
static const uint16_t BLK_SER_C = 0x0084
 [addr]SER_C
static const uint16_t BLK_SYS_C = 0x0085
 [addr]SYS_C
static const uint16_t BLK_CKV = 0x0086
 [addr]CKV
static const uint16_t BLK_CK = 0x0087
 [addr]CK
static const uint16_t BLK_MC = 0x0088
 [addr]MC
static const uint16_t BLK_WCNT = 0x0090
 [addr]WCNT
static const uint16_t BLK_MAC_A = 0x0091
 [addr]MAC_A
static const uint16_t BLK_STATE = 0x0092
 [addr]STATE
static const uint16_t BLK_CRC_CHECK = 0x00a0
 [addr]CRC_CHECK
static const uint16_t REG_OPMODE = 0x0b00
 [addr]Operation Mode register
static const uint16_t REG_TAG_TX_CTRL = 0x0b04
 [addr]Tag TX Control register
static const uint16_t REG_TAG_RX_CTRL = 0x0b08
 [addr]Tag RX Control register
static const uint16_t REG_RF_STATUS = 0x0b0c
 [addr]RF Status register
static const uint16_t REG_I2C_SLAVE_ADDR = 0x0b10
 [addr]I2C Slave Address register
static const uint16_t REG_I2C_BUFF_CTRL = 0x0b14
 [addr]I2C Buffer Control register
static const uint16_t REG_I2C_STATUS = 0x0b18
 [addr]I2C Status register
static const uint16_t REG_INT_MASK = 0x0b20
 [addr]Interrupt Mask register
static const uint16_t REG_INT_RAW_STATUS = 0x0b24
 [addr]Interrupt Raw Status register
static const uint16_t REG_INT_STATUS = 0x0b28
 [addr]Interrupt Status register
static const uint16_t REG_INT_CLEAR = 0x0b2c
 [addr]Interrupt Clear register
static const uint16_t REG_WRT_PROTECT = 0x0b30
 [addr]Write Protect register
static const uint16_t REG_STBY_CTRL = 0x0b34
 [addr]Standby Control register
static const uint16_t REG_INIT_CTRL = 0x0b38
 [addr]Initialize Control register
static const uint16_t REG_HOST_IF_SECURITY = 0x0b40
 [addr]Host Interface Security register
static const uint16_t REG_HOST_IF_WCNT = 0x0b44
 [addr]Host Interface WCNT register
static const uint16_t REG_RF_PARAM = 0x0b50
 [addr]RF Parameter register
static const uint16_t REG_LITES_HT_CONF = 0x0b60
 [addr]Lite-S Host Through Configration register
static const uint16_t REG_LITES_PMM = 0x0b64
 [addr]Lite-S PMm register
static const uint16_t REG_PLUG_CONF1 = 0x0b80
 [addr]Plug Configration 1 register
static const uint16_t REG_PLUG_CONF2 = 0x0b84
 [addr]Plug Configration 2 register
static const uint16_t REG_PLUG_CONF3 = 0x0b88
 [addr]Plug Configration 3 register
static const uint16_t REG_DEP_CONF = 0x0ba0
 [addr]DEP Configration register
static const uint16_t REG_DEP_PMM1 = 0x0ba4
 [addr]DEP PMm1 register
static const uint16_t REG_DEP_PMM2 = 0x0ba8
 [addr]DEP PMm2 register
static const uint16_t REG_RW_CONF = 0x0bc0
 [addr]RW Configration register
static const uint16_t REG_RW_CTRL = 0x0b4c
 [addr]RW Control register
static const uint16_t REG_RW_TIMEOUT = 0x0bc8
 [addr]RW Timeout register
static const uint16_t BUF_RF_COMM = 0x0c00
 [addr]RF Communication
static const uint16_t BUF_I2CFELICA_COMM = 0x0d00
 [addr]I2C FeliCa Communication
static const uint32_t MSK_MODE_CHANGED = 0x80000000
 OPMODE changed.
static const uint32_t MSK_INT_RW_RX_ERROR = 0x00080000
 [R/W]
static const uint32_t MSK_INT_RW_RX_TIMEOUT = 0x00040000
 [R/W]
static const uint32_t MSK_INT_RW_RX_DONE = 0x00020000
 [R/W]
static const uint32_t MSK_INT_RW_TX_DONE = 0x00010000
 [R/W]
static const uint32_t MSK_INT_I2C_FELICA_CMD_ERROR = 0x00000200
 [I2C]
static const uint32_t MSK_INT_I2C_FELICA_CMD_DONE = 0x00000100
 [I2C]
static const uint32_t MSK_INT_TAG_TX_DONE = 0x00000040
 [tag/DEP]Tx done
static const uint32_t MSK_INT_TAG_NFC_DEP_RX_DONE = 0x00000020
 [DEP]D4 command Rx done
static const uint32_t MSK_INT_TAG_RW_RX_DONE3 = 0x00000010
 [tag]Write w/o Enc Rx done for HT block
static const uint32_t MSK_INT_TAG_RW_RX_DONE2 = 0x00000008
 [tag]Read or Write w/o Enc Rx done for HT block
static const uint32_t MSK_INT_TAG_RW_RX_DONE1 = 0x00000004
 [tag]Write w/o Enc Rx done for User block
static const uint32_t MSK_INT_TAG_PL_RX_DONE = 0x00000002
 [tag]Polling Rx done
static const uint32_t MSK_INT_TAG_RX_DONE = 0x00000001
 [tag]Read or Write w/o Enc Rx done

Detailed Description

FeliCa Link(RC-S730) class.

Definition at line 21 of file RCS730.h.


Member Enumeration Documentation

enum OpMode

Operation Mode.

Enumerator:
OPMODE_LITES_HT 

Lite-S HT mode.

OPMODE_PLUG 

Plug mode.

OPMODE_NFCDEP 

NFC-DEP mode.

OPMODE_LITES 

Lite-S mode.

Definition at line 106 of file RCS730.h.

System Code in Plug mode.

Enumerator:
PLUG_SYS_CODE_FEEL 

0xFEE1

PLUG_SYS_CODE_NDEF 

0x12FC

Definition at line 118 of file RCS730.h.


Constructor & Destructor Documentation

RCS730 ( I2C &  I2c )

constructor

Parameters:
[in,out]I2cI2C

Definition at line 45 of file RCS730.cpp.

~RCS730 (  ) [virtual]

destructor

Definition at line 54 of file RCS730.cpp.


Member Function Documentation

int byteWrite ( uint16_t  MemAddr,
uint8_t  Data 
)

Byte Write(1byte)

Parameters:
[in]MemAddrmemory address to write
[in]pDatadata to write
Return values:
0success

Definition at line 65 of file RCS730.cpp.

int currentAddrRead ( uint8_t *  pData )

Current Address Read(1byte)

Parameters:
[out]pDatadata buffer to read
Return values:
0success

Definition at line 135 of file RCS730.cpp.

int goToInitializeStatus (  )

go to initialize status

Return values:
0success

Definition at line 210 of file RCS730.cpp.

int initFTMode ( OpMode  Mode )

initialize to FeliCa Through(FT) mode

Parameters:
[in]ModeOperation Mode(OPMODE_LITES_HT or OPMODE_PLUG)
Return values:
0success

Definition at line 216 of file RCS730.cpp.

int initNfcDepMode (  )

initialize to NFC-DEP mode

Return values:
0success

Definition at line 234 of file RCS730.cpp.

void isrIrq (  )

Interrupt Service Routine(IRQ pin)

Definition at line 248 of file RCS730.cpp.

int pageWrite ( uint16_t  MemAddr,
const uint8_t *  pData,
int  Length 
)

Page Write.

Parameters:
[in]MemAddrmemory address to write
[in]pDatadata to write
[in]LengthpData Length
Return values:
0success

Definition at line 83 of file RCS730.cpp.

int randomRead ( uint16_t  MemAddr,
uint8_t *  pData 
)

Random Read(1byte)

Parameters:
[in]MemAddrmemory address to read
[out]pDatadata buffer to read
Return values:
0success

Definition at line 109 of file RCS730.cpp.

int readRegister ( uint16_t  Reg,
uint32_t *  pData 
)

Read Register.

Parameters:
[in]RegFeliCa Link Register
[out]pDatadata buffer to read
Return values:
0success

Definition at line 148 of file RCS730.cpp.

int sequentialRead ( uint16_t  MemAddr,
uint8_t *  pData,
int  Length 
)

Sequential Read.

Parameters:
[in]MemAddrmemory address to read
[out]pDatadata buffer to read
[in]LengthpData Length
Return values:
0success

Definition at line 115 of file RCS730.cpp.

void setCallbackTable ( const callbacktable_t pInitTable )

Set Callback Table.

Parameters:
[in]pInitTablecallback table

Definition at line 59 of file RCS730.cpp.

int setRegInterruptMask ( uint32_t  Mask,
uint32_t  Value 
)

Set interrupt mask.

Parameters:
[in]MaskBit Mask
[in]ValueSet value to Mask
Return values:
0success
Note:
  • This value is written to non-volatile memory in FeliCa Link.

Definition at line 198 of file RCS730.cpp.

int setRegOpMode ( OpMode  Mode )

Set operation mode.

Parameters:
[in]ModeOperation Mode
Return values:
0success
Note:
  • This value is written to non-volatile memory in FeliCa Link.

Definition at line 178 of file RCS730.cpp.

int setRegPlugSysCode ( PlugSysCode  SysCode )

Set System Code in Plug mode.

Parameters:
[in]SysCodeSystem Code
Return values:
0success
Note:
  • This value is written to non-volatile memory in FeliCa Link.

Definition at line 204 of file RCS730.cpp.

int setRegSlaveAddr ( int  SAddr )

Set I2C Slave Address.

Parameters:
[in]SAddrSlave Address(7bit address)
Return values:
0success
Attention:
  • SAddr is "7bit" address(not 8bit address).
Note:
  • This value is written to non-volatile memory in FeliCa Link.
  • Default slave address is 0x40.

Definition at line 184 of file RCS730.cpp.

int writeRegister ( uint16_t  Reg,
uint32_t  Data,
uint32_t  Mask = 0xffffffff 
)

Write Register.

Write Register if not same value.

Parameters:
[in]RegFeliCa Link Register
[in]Datadata buffer to write
[in]Maskwrite mask(default: 0xffffffff)
Return values:
0success
Note:
  • this API like below:
                  uint32_t val_old = REG[Reg];
                  uint32_t val_new = (val_old & ~Mask) | Data;
                  if (val_old != val_new) {
                      REG[Reg] = val_new;
                  }
    

Definition at line 160 of file RCS730.cpp.

int writeRegisterForce ( uint16_t  Reg,
uint32_t  Data 
)

Write Register Force.

Parameters:
[in]RegFeliCa Link Register
[in]Datadata buffer to write
Return values:
0success

Definition at line 154 of file RCS730.cpp.


Field Documentation

const uint16_t BLK_CK = 0x0087 [static]

[addr]CK

Definition at line 45 of file RCS730.h.

const uint16_t BLK_CKV = 0x0086 [static]

[addr]CKV

Definition at line 44 of file RCS730.h.

const uint16_t BLK_CRC_CHECK = 0x00a0 [static]

[addr]CRC_CHECK

Definition at line 50 of file RCS730.h.

const uint16_t BLK_D_ID = 0x0083 [static]

[addr]D_ID

Definition at line 41 of file RCS730.h.

const uint16_t BLK_ID = 0x0082 [static]

[addr]ID

Definition at line 40 of file RCS730.h.

const uint16_t BLK_MAC = 0x0081 [static]

[addr]MAC

Definition at line 39 of file RCS730.h.

const uint16_t BLK_MAC_A = 0x0091 [static]

[addr]MAC_A

Definition at line 48 of file RCS730.h.

const uint16_t BLK_MC = 0x0088 [static]

[addr]MC

Definition at line 46 of file RCS730.h.

const uint16_t BLK_PAD0 = 0x0000 [static]

[addr]PAD0

Definition at line 23 of file RCS730.h.

const uint16_t BLK_PAD1 = 0x0001 [static]

[addr]PAD1

Definition at line 24 of file RCS730.h.

const uint16_t BLK_PAD10 = 0x000a [static]

[addr]PAD10

Definition at line 33 of file RCS730.h.

const uint16_t BLK_PAD11 = 0x000b [static]

[addr]PAD11

Definition at line 34 of file RCS730.h.

const uint16_t BLK_PAD12 = 0x000c [static]

[addr]PAD12

Definition at line 35 of file RCS730.h.

const uint16_t BLK_PAD13 = 0x000d [static]

[addr]PAD13

Definition at line 36 of file RCS730.h.

const uint16_t BLK_PAD2 = 0x0002 [static]

[addr]PAD2

Definition at line 25 of file RCS730.h.

const uint16_t BLK_PAD3 = 0x0003 [static]

[addr]PAD3

Definition at line 26 of file RCS730.h.

const uint16_t BLK_PAD4 = 0x0004 [static]

[addr]PAD4

Definition at line 27 of file RCS730.h.

const uint16_t BLK_PAD5 = 0x0005 [static]

[addr]PAD5

Definition at line 28 of file RCS730.h.

const uint16_t BLK_PAD6 = 0x0006 [static]

[addr]PAD6

Definition at line 29 of file RCS730.h.

const uint16_t BLK_PAD7 = 0x0007 [static]

[addr]PAD7

Definition at line 30 of file RCS730.h.

const uint16_t BLK_PAD8 = 0x0008 [static]

[addr]PAD8

Definition at line 31 of file RCS730.h.

const uint16_t BLK_PAD9 = 0x0009 [static]

[addr]PAD9

Definition at line 32 of file RCS730.h.

const uint16_t BLK_RC = 0x0080 [static]

[addr]RC

Definition at line 38 of file RCS730.h.

const uint16_t BLK_REG = 0x000e [static]

[addr]REG

Definition at line 37 of file RCS730.h.

const uint16_t BLK_SER_C = 0x0084 [static]

[addr]SER_C

Definition at line 42 of file RCS730.h.

const uint16_t BLK_STATE = 0x0092 [static]

[addr]STATE

Definition at line 49 of file RCS730.h.

const uint16_t BLK_SYS_C = 0x0085 [static]

[addr]SYS_C

Definition at line 43 of file RCS730.h.

const uint16_t BLK_WCNT = 0x0090 [static]

[addr]WCNT

Definition at line 47 of file RCS730.h.

const uint16_t BUF_I2CFELICA_COMM = 0x0d00 [static]

[addr]I2C FeliCa Communication

Definition at line 82 of file RCS730.h.

const uint16_t BUF_RF_COMM = 0x0c00 [static]

[addr]RF Communication

Definition at line 81 of file RCS730.h.

const uint32_t MSK_INT_I2C_FELICA_CMD_DONE = 0x00000100 [static]

[I2C]

Definition at line 90 of file RCS730.h.

const uint32_t MSK_INT_I2C_FELICA_CMD_ERROR = 0x00000200 [static]

[I2C]

Definition at line 89 of file RCS730.h.

const uint32_t MSK_INT_RW_RX_DONE = 0x00020000 [static]

[R/W]

Definition at line 87 of file RCS730.h.

const uint32_t MSK_INT_RW_RX_ERROR = 0x00080000 [static]

[R/W]

Definition at line 85 of file RCS730.h.

const uint32_t MSK_INT_RW_RX_TIMEOUT = 0x00040000 [static]

[R/W]

Definition at line 86 of file RCS730.h.

const uint32_t MSK_INT_RW_TX_DONE = 0x00010000 [static]

[R/W]

Definition at line 88 of file RCS730.h.

const uint32_t MSK_INT_TAG_NFC_DEP_RX_DONE = 0x00000020 [static]

[DEP]D4 command Rx done

Definition at line 92 of file RCS730.h.

const uint32_t MSK_INT_TAG_PL_RX_DONE = 0x00000002 [static]

[tag]Polling Rx done

Definition at line 96 of file RCS730.h.

const uint32_t MSK_INT_TAG_RW_RX_DONE1 = 0x00000004 [static]

[tag]Write w/o Enc Rx done for User block

Definition at line 95 of file RCS730.h.

const uint32_t MSK_INT_TAG_RW_RX_DONE2 = 0x00000008 [static]

[tag]Read or Write w/o Enc Rx done for HT block

Definition at line 94 of file RCS730.h.

const uint32_t MSK_INT_TAG_RW_RX_DONE3 = 0x00000010 [static]

[tag]Write w/o Enc Rx done for HT block

Definition at line 93 of file RCS730.h.

const uint32_t MSK_INT_TAG_RX_DONE = 0x00000001 [static]

[tag]Read or Write w/o Enc Rx done

Definition at line 97 of file RCS730.h.

const uint32_t MSK_INT_TAG_TX_DONE = 0x00000040 [static]

[tag/DEP]Tx done

Definition at line 91 of file RCS730.h.

const uint32_t MSK_MODE_CHANGED = 0x80000000 [static]

OPMODE changed.

Definition at line 84 of file RCS730.h.

const uint16_t REG_DEP_CONF = 0x0ba0 [static]

[addr]DEP Configration register

Definition at line 74 of file RCS730.h.

const uint16_t REG_DEP_PMM1 = 0x0ba4 [static]

[addr]DEP PMm1 register

Definition at line 75 of file RCS730.h.

const uint16_t REG_DEP_PMM2 = 0x0ba8 [static]

[addr]DEP PMm2 register

Definition at line 76 of file RCS730.h.

const uint16_t REG_HOST_IF_SECURITY = 0x0b40 [static]

[addr]Host Interface Security register

Definition at line 66 of file RCS730.h.

const uint16_t REG_HOST_IF_WCNT = 0x0b44 [static]

[addr]Host Interface WCNT register

Definition at line 67 of file RCS730.h.

const uint16_t REG_I2C_BUFF_CTRL = 0x0b14 [static]

[addr]I2C Buffer Control register

Definition at line 57 of file RCS730.h.

const uint16_t REG_I2C_SLAVE_ADDR = 0x0b10 [static]

[addr]I2C Slave Address register

Definition at line 56 of file RCS730.h.

const uint16_t REG_I2C_STATUS = 0x0b18 [static]

[addr]I2C Status register

Definition at line 58 of file RCS730.h.

const uint16_t REG_INIT_CTRL = 0x0b38 [static]

[addr]Initialize Control register

Definition at line 65 of file RCS730.h.

const uint16_t REG_INT_CLEAR = 0x0b2c [static]

[addr]Interrupt Clear register

Definition at line 62 of file RCS730.h.

const uint16_t REG_INT_MASK = 0x0b20 [static]

[addr]Interrupt Mask register

Definition at line 59 of file RCS730.h.

const uint16_t REG_INT_RAW_STATUS = 0x0b24 [static]

[addr]Interrupt Raw Status register

Definition at line 60 of file RCS730.h.

const uint16_t REG_INT_STATUS = 0x0b28 [static]

[addr]Interrupt Status register

Definition at line 61 of file RCS730.h.

const uint16_t REG_LITES_HT_CONF = 0x0b60 [static]

[addr]Lite-S Host Through Configration register

Definition at line 69 of file RCS730.h.

const uint16_t REG_LITES_PMM = 0x0b64 [static]

[addr]Lite-S PMm register

Definition at line 70 of file RCS730.h.

const uint16_t REG_OPMODE = 0x0b00 [static]

[addr]Operation Mode register

Definition at line 52 of file RCS730.h.

const uint16_t REG_PLUG_CONF1 = 0x0b80 [static]

[addr]Plug Configration 1 register

Definition at line 71 of file RCS730.h.

const uint16_t REG_PLUG_CONF2 = 0x0b84 [static]

[addr]Plug Configration 2 register

Definition at line 72 of file RCS730.h.

const uint16_t REG_PLUG_CONF3 = 0x0b88 [static]

[addr]Plug Configration 3 register

Definition at line 73 of file RCS730.h.

const uint16_t REG_RF_PARAM = 0x0b50 [static]

[addr]RF Parameter register

Definition at line 68 of file RCS730.h.

const uint16_t REG_RF_STATUS = 0x0b0c [static]

[addr]RF Status register

Definition at line 55 of file RCS730.h.

const uint16_t REG_RW_CONF = 0x0bc0 [static]

[addr]RW Configration register

Definition at line 77 of file RCS730.h.

const uint16_t REG_RW_CTRL = 0x0b4c [static]

[addr]RW Control register

Definition at line 78 of file RCS730.h.

const uint16_t REG_RW_TIMEOUT = 0x0bc8 [static]

[addr]RW Timeout register

Definition at line 79 of file RCS730.h.

const uint16_t REG_STBY_CTRL = 0x0b34 [static]

[addr]Standby Control register

Definition at line 64 of file RCS730.h.

const uint16_t REG_TAG_RX_CTRL = 0x0b08 [static]

[addr]Tag RX Control register

Definition at line 54 of file RCS730.h.

const uint16_t REG_TAG_TX_CTRL = 0x0b04 [static]

[addr]Tag TX Control register

Definition at line 53 of file RCS730.h.

const uint16_t REG_WRT_PROTECT = 0x0b30 [static]

[addr]Write Protect register

Definition at line 63 of file RCS730.h.