![]() |
Kinetis SDK v.1.2 Demo Applications User's Guide
Rev. 0
Freescale Semiconductor, Inc.
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "fsl_clock_manager.h"
#include "fsl_os_abstraction.h"
#include "board.h"
#include "fsl_mpu_driver.h"
#include "fsl_sdhc_card.h"
#include "fsl_sdmmc_card.h"
#include "sdhc_sdcard.h"
#include "fsl_debug_console.h"
Macros | |
#define | TEST_BLOCK_NUM |
#define | TEST_START_BLOCK |
Enumerations | |
enum | test_result_t { kTestResultPassed, kTestResultFailed, kTestResultInitFailed, kTestResultAborted } |
Functions | |
static uint32_t | fill_reference_data (uint8_t *pdata, uint8_t seed, uint32_t len) |
A function to fill a memory buffer of 'len' no of bytes with a reference data governed by a seed value. More... | |
static void | show_card_cid (sdcard_cid_t *cid) |
Function to show few card information. More... | |
static float | decode_taac (uint8_t taac) |
Function to decode card read access time '1' value. More... | |
static float | decode_transpeed (uint8_t ts) |
Function to decode card data transfer speed. More... | |
static void | show_card_csd (sdcard_csd_t *csd) |
Function to parse and show Card Specific Data fields. More... | |
static void | show_card_scr (sdcard_scr_t *scr) |
Function to parse and show Card Configuration Register (CSR) fields. More... | |
static void | show_card_info (sdhc_card_t *card, bool showDetail) |
Function to show Card informations. More... | |
void | sdhc_card_detection (bool inserted) |
Function to indicate whether a card is detected or not. More... | |
void | sdhc_cd_irqhandler (void) |
Function to be called from Card detection interrupt context etc. More... | |
static test_result_t | demo_card_data_access (void) |
This function demonstrates read, write and erase functionalities of the card. More... | |
int | main (void) |
Main demo function. More... | |
Variables | |
const char * | monthStr [] |
static uint8_t | refData [FSL_SDHC_CARD_DEFAULT_BLOCK_SIZE] |
static uint8_t | testData [FSL_SDHC_CARD_DEFAULT_BLOCK_SIZE] |
static uint8_t | refData2 [FSL_SDHC_CARD_DEFAULT_BLOCK_SIZE *TEST_BLOCK_NUM] |
static uint8_t | testData2 [FSL_SDHC_CARD_DEFAULT_BLOCK_SIZE *TEST_BLOCK_NUM] |
static semaphore_t | cd |
static volatile uint32_t | cardInserted |
static volatile uint32_t | cardInited |
#define TEST_BLOCK_NUM |
#define TEST_START_BLOCK |
enum test_result_t |
|
static |
|
static |
|
static |
|
static |
int main | ( | void | ) |
Function prototype for main function.
receiveBuff | Buffer used to hold received data |
Return code from each SSD function
Address of the target location
Return protection status
Number of longword or phrase to be verified
0=normal, 1=user, 2=factory - margin read for reading
Indicate LED is brighter or dimmer
Use LPTMR in Time Counter mode
When hit compare value, set counter back to zero
bypass prescaler
use 1kHz Low Power Clock
void sdhc_card_detection | ( | bool | inserted | ) |
void sdhc_cd_irqhandler | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
Flag to indicate the card has been initialized successfully
|
static |
Flag to indicate a card has been inserted
|
static |
Semaphore for card detection indication
const char* monthStr[] |
|
static |
Buffer to hold a reference data used for write/read/compare tests
|
static |
Buffer to hold a reference data used for write/read/compare tests
|
static |
Buffer to reac back data from card for write/read/compare tests
|
static |
Buffer to reac back data from card for write/read/compare tests