This is the API avariable to access to SLE4442.
More...
Go to the source code of this file.
|
struct | sle_t |
| The main struct which represent the status of the card. More...
|
|
This is the API avariable to access to SLE4442.
Details.
◆ sle_auth()
void sle_auth |
( |
struct sle_t * |
sle, |
|
|
const uint8_t |
pin1, |
|
|
const uint8_t |
pin2, |
|
|
const uint8_t |
pin3 |
|
) |
| |
Perform the authentication.
See the datasheet on how to authenticate.
- Parameters
-
sle | the struct allocated for the card. |
pin1 | byte 1 of the pin number. |
pin2 | byte 2 of the pin number. |
pin3 | byte 3 of the pin number. |
◆ sle_disable_port()
void sle_disable_port |
( |
void |
| ) |
|
Disable the port and restore all the used pins to IN.
- Note
- also restore internals pull-up resistors to OFF.
◆ sle_dump_allmem()
void sle_dump_allmem |
( |
struct sle_t * |
sle | ) |
|
Dump the all memories, normal, secure and protected memory.
- Parameters
-
sle | struct with allocated space for the dump. |
- Warning
- the space have to be already allocated.
◆ sle_dump_memory()
void sle_dump_memory |
( |
uint8_t * |
mm | ) |
|
Dump the card's memory into the mm area.
- Parameters
-
mm | the storage area where to dump the memory card. |
- Warning
- the dump memory should be already allocated and have enought space for the card (256 Byte).
◆ sle_dump_prt_memory()
void sle_dump_prt_memory |
( |
uint8_t * |
mm | ) |
|
Dump the protected memory.
- Parameters
-
mm | allocated 4 Byte space for the dump. |
- Warning
- the space have to be already allocated.
◆ sle_dump_secmem()
void sle_dump_secmem |
( |
uint8_t * |
mm | ) |
|
Dump the secure memory.
- Parameters
-
mm | allocated 4 Byte space for the dump. |
- Warning
- the space have to be already allocated.
◆ sle_enable_port()
void sle_enable_port |
( |
void |
| ) |
|
Initialize the port.
Configure the I/O port's pin as: Card present pin: IN Reset: OUT Clock: OUT IO line: IN
- Note
- If an internal PULL-UP resistors is required for the IN pin, the define SLE_MICRO_PULLUP macro. For example if we have connected the card's pin directly to the micro without external resistors.
◆ sle_free()
void sle_free |
( |
struct sle_t * |
sle | ) |
|
Free the memory allocated to the structure and disable the port connected to the card's reader.
- Parameters
-
sle | the allocated structure. |
- Note
- In theory this function should never be called, unless the software have no need for the card reader.
◆ sle_init()
struct sle_t* sle_init |
( |
void |
| ) |
|
Initialize and allocate the structure and enable the port connected to the card's reader.
- Returns
- sle The allocated structure.
◆ sle_present()
uint8_t sle_present |
( |
struct sle_t * |
sle | ) |
|
Check for the presence of the card.
The status of the card will be stored into the struct.
- Parameters
-
sle | the struct need to store the card's status. |
- Returns
- Card present or not.
◆ sle_reset()
void sle_reset |
( |
uint8_t * |
atr | ) |
|
reset the card.
- Parameters
-
atr | pointer to the string sent to reset the card. |
◆ sle_write_memory()
void sle_write_memory |
( |
struct sle_t * |
sle, |
|
|
const uint8_t |
base, |
|
|
const uint8_t |
len |
|
) |
| |
Write a group of byte into the memory card.
Write one byte at a time from the allocated memory in the sle struct starting from base for len byte.
- Parameters
-
sle | the allocated struct. |
base | the base memory to start copying from. |
len | how many byte to copy. |
◆ sle_write_secmem()
void sle_write_secmem |
( |
struct sle_t * |
sle | ) |
|
Write the secure memory.
Copy the 4 byte secure memory from the allocated struct to the card.
- Parameters
-