GadgetSeed  0.9.6
stm32f4xx_nucleo_mmc.c ファイル

MMC ドライバ STM32F4xx Nucleo 依存部分 [詳解]

#include "sysconfig.h"
#include "tkprintf.h"
#include "device.h"
#include "device/spi_ioctl.h"
stm32f4xx_nucleo_mmc.c の依存先関係図:

[ソースコード]

マクロ定義

#define RCC_AHB1ENR   (*(volatile unsigned long *)0x40023830)
 
#define RCC_AHB1LPENR   (*(volatile unsigned long *)0x40023850)
 
#define RCC_AHB1_BIT_GPIOB   (1UL<<1)
 
#define GPIOB_MODER   (*(volatile unsigned long *)0x40020400)
 
#define GPIO_MODE_BIT_IN   0x00
 
#define GPIO_MODE_BIT_OUT   0x01
 
#define GPIO_MODE_BIT_AF   0x02
 
#define GPIO_MODE_BIT_AN   0x03
 
#define GPIO_MODE_BIT_ALL   0x03
 
#define GPIOB_OTYPE   (*(volatile unsigned long *)0x40020404)
 
#define GPIO_OTYPE_BIT_PP   0x00
 
#define GPIO_OTYPE_BIT_OD   0x01
 
#define GPIOB_OSPEEDR   (*(volatile unsigned long *)0x40020408)
 
#define GPIO_OSPEED_BIT_ALL   0x03
 
#define GPIO_OSPEED_BIT_50MHz   0x02
 
#define GPIO_OSPEED_BIT_100MHz   0x03
 
#define GPIOB_PUPDR   (*(volatile unsigned long *)0x4002040C)
 
#define GPIO_PUPDR_BIT_NOPULL   0x00
 
#define GPIO_PUPDR_BIT_PUP   0x01
 
#define GPIO_PUPDR_BIT_PDOWN   0x02
 
#define GPIO_PUPDR_BIT_ALL   0x03
 
#define GPIOB_IDR   (*(volatile unsigned long *)0x40020410)
 
#define GPIOB_ODR   (*(volatile unsigned long *)0x40020414)
 
#define GPIOB_BSRRL   (*(volatile unsigned short *)0x40020418)
 
#define GPIOB_BSRRH   (*(volatile unsigned short *)0x4002041A)
 
#define GPIOB_LCKR   (*(volatile unsigned long *)0x4002041C)
 
#define GPIOB_AFRL   (*(volatile unsigned long *)0x40020420)
 
#define GPIOB_AFRH   (*(volatile unsigned long *)0x40020424)
 
#define CS_PIN   6
 

関数

static void init_pin (int pos)
 
static void cs_low (void)
 
static void cs_high (void)
 
static int mmc_register (struct st_device *dev, char *param)
 
static int mmc_getc (struct st_device *dev, unsigned char *rd)
 
static int mmc_read (struct st_device *dev, void *data, unsigned int size)
 
static int mmc_putc (struct st_device *dev, unsigned char ch)
 
static int mmc_write (struct st_device *dev, const void *data, unsigned int size)
 
static int mmc_ioctl (struct st_device *dev, unsigned int com, unsigned int arg, void *param)
 
static int mmc_suspend (struct st_device *dev)
 
static int mmc_resume (struct st_device *dev)
 

変数

static struct st_devicemmc_dev
 
const struct st_device stm_mmc_device
 

詳解

MMC ドライバ STM32F4xx Nucleo 依存部分

SPIドライバ使用

日付
2015.08.11
著者
Takashi SHUDO

CS PB6 WP N/A POWER N/A

stm32f4xx_nucleo_mmc.c に定義があります。

変数詳解

◆ stm_mmc_device

const struct st_device stm_mmc_device
初期値:
= {
.name = "mmc_spi",
.explan = "STM32F4xx Nucleo SPI MMC",
.register_dev = mmc_register,
.read = mmc_read,
.getc = mmc_getc,
.write = mmc_write,
.putc = mmc_putc,
.ioctl = mmc_ioctl,
.suspend = mmc_suspend,
.resume = mmc_resume,
}

stm32f4xx_nucleo_mmc.c189 行目に定義があります。