DMA_I2C_RAM
[STM32F10x_StdPeriph_Examples]

Defines

#define BufferSize   8
#define ClockSpeed   100000
#define I2C1_DR_Address   0x40005410
#define I2C1_SLAVE_ADDRESS7   0x30
#define I2C2_DR_Address   0x40005810
#define I2C2_SLAVE_ADDRESS7   0x30

Enumerations

enum  TestStatus {
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED,
  FAILED = 0, PASSED = !FAILED, FAILED = 0, PASSED = !FAILED
}

Functions

TestStatus Buffercmp (uint8_t *pBuffer, uint8_t *pBuffer1, uint16_t BufferLength)
 Compares two buffers.
void BusFault_Handler (void)
 This function handles Bus Fault exception.
void DebugMon_Handler (void)
 This function handles Debug Monitor exception.
void GPIO_Configuration (void)
 Configures the different GPIO ports.
void HardFault_Handler (void)
 This function handles Hard Fault exception.
int main (void)
 Main program.
void MemManage_Handler (void)
 This function handles Memory Manage exception.
void NMI_Handler (void)
 This function handles NMI exception.
void PendSV_Handler (void)
 This function handles PendSV_Handler exception.
void RCC_Configuration (void)
 Configures the different system clocks.
void SVC_Handler (void)
 This function handles SVCall exception.
void SysTick_Handler (void)
 This function handles SysTick Handler.
void UsageFault_Handler (void)
 This function handles Usage Fault exception.

Variables

DMA_InitTypeDef DMA_InitStructure
uint8_t I2C1_Buffer_Tx [BufferSize] = {1, 2, 3, 4, 5, 6, 7, 8}
uint8_t I2C2_Buffer_Rx [BufferSize]
I2C_InitTypeDef I2C_InitStructure
uint8_t Rx_Idx = 0
volatile TestStatus TransferStatus
uint8_t Tx_Idx = 0

Define Documentation

#define BufferSize   8
#define ClockSpeed   100000

Definition at line 41 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().

#define I2C1_DR_Address   0x40005410

Definition at line 36 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().

#define I2C1_SLAVE_ADDRESS7   0x30

Definition at line 38 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().

#define I2C2_DR_Address   0x40005810

Definition at line 37 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().

#define I2C2_SLAVE_ADDRESS7   0x30

Definition at line 39 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().


Enumeration Type Documentation

enum TestStatus
Enumerator:
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 
FAILED 
PASSED 

Definition at line 33 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.


Function Documentation

TestStatus Buffercmp ( uint8_t *  pBuffer,
uint8_t *  pBuffer1,
uint16_t  BufferLength 
)

Compares two buffers.

Parameters:
pBuffer,pBuffer1,: buffers to be compared.
BufferLength,: buffer's length
Return values:
PASSED,: pBuffer identical to pBuffer1 FAILED: pBuffer differs from pBuffer1

Definition at line 209 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

References FAILED, and PASSED.

void BusFault_Handler ( void   ) 

This function handles Bus Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 85 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void DebugMon_Handler ( void   ) 

This function handles Debug Monitor exception.

Parameters:
None 
Return values:
None 

Definition at line 120 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void GPIO_Configuration ( void   ) 
void HardFault_Handler ( void   ) 

This function handles Hard Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 59 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

int main ( void   ) 

Main program.

Parameters:
None 
Return values:
None 

< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f10x_xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f10x.c file

Definition at line 64 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

References Buffercmp(), BufferSize, ClockSpeed, DMA1_Channel5, DMA1_Channel6, DMA1_FLAG_TC5, DMA1_FLAG_TC6, DMA_InitTypeDef::DMA_BufferSize, DMA_Cmd(), DMA_DeInit(), DMA_InitTypeDef::DMA_DIR, DMA_DIR_PeripheralDST, DMA_DIR_PeripheralSRC, DMA_GetFlagStatus(), DMA_Init(), DMA_InitTypeDef::DMA_M2M, DMA_M2M_Disable, DMA_InitTypeDef::DMA_MemoryBaseAddr, DMA_InitTypeDef::DMA_MemoryDataSize, DMA_MemoryDataSize_Byte, DMA_InitTypeDef::DMA_MemoryInc, DMA_MemoryInc_Enable, DMA_InitTypeDef::DMA_Mode, DMA_Mode_Normal, DMA_InitTypeDef::DMA_PeripheralBaseAddr, DMA_InitTypeDef::DMA_PeripheralDataSize, DMA_InitTypeDef::DMA_PeripheralInc, DMA_PeripheralInc_Disable, DMA_InitTypeDef::DMA_Priority, DMA_Priority_High, DMA_Priority_VeryHigh, ENABLE, GPIO_Configuration(), I2C1, I2C1_Buffer_Tx, I2C1_DR_Address, I2C1_SLAVE_ADDRESS7, I2C2, I2C2_Buffer_Rx, I2C2_DR_Address, I2C2_SLAVE_ADDRESS7, I2C_InitTypeDef::I2C_Ack, I2C_Ack_Enable, I2C_InitTypeDef::I2C_AcknowledgedAddress, I2C_AcknowledgedAddress_7bit, I2C_CheckEvent(), I2C_InitTypeDef::I2C_ClockSpeed, I2C_Cmd(), I2C_Direction_Transmitter, I2C_DMACmd(), I2C_InitTypeDef::I2C_DutyCycle, I2C_DutyCycle_2, I2C_EVENT_MASTER_MODE_SELECT, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED, I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED, I2C_EVENT_SLAVE_STOP_DETECTED, I2C_FLAG_STOPF, I2C_GenerateSTART(), I2C_GenerateSTOP(), I2C_GetFlagStatus(), I2C_Init(), I2C_InitTypeDef::I2C_Mode, I2C_Mode_I2C, I2C_InitTypeDef::I2C_OwnAddress1, I2C_Send7bitAddress(), RCC_Configuration(), and TransferStatus.

void MemManage_Handler ( void   ) 

This function handles Memory Manage exception.

Parameters:
None 
Return values:
None 

Definition at line 72 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void NMI_Handler ( void   ) 

This function handles NMI exception.

Parameters:
None 
Return values:
None 

Definition at line 50 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void PendSV_Handler ( void   ) 

This function handles PendSV_Handler exception.

Parameters:
None 
Return values:
None 

Definition at line 129 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void RCC_Configuration ( void   ) 

Configures the different system clocks.

Parameters:
None 
Return values:
None 

Definition at line 172 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

References ENABLE, RCC_AHBPeriph_DMA1, RCC_AHBPeriphClockCmd(), RCC_APB1Periph_I2C1, RCC_APB1Periph_I2C2, RCC_APB1PeriphClockCmd(), RCC_APB2Periph_GPIOB, and RCC_APB2PeriphClockCmd().

void SVC_Handler ( void   ) 

This function handles SVCall exception.

Parameters:
None 
Return values:
None 

Definition at line 111 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void SysTick_Handler ( void   ) 

This function handles SysTick Handler.

Parameters:
None 
Return values:
None 

Definition at line 138 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.

void UsageFault_Handler ( void   ) 

This function handles Usage Fault exception.

Parameters:
None 
Return values:
None 

Definition at line 98 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/stm32f10x_it.c.


Variable Documentation

uint8_t I2C1_Buffer_Tx[BufferSize] = {1, 2, 3, 4, 5, 6, 7, 8}

Definition at line 47 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().

uint8_t I2C2_Buffer_Rx[BufferSize]

Definition at line 48 of file STM32F10x_StdPeriph_Examples/DMA/I2C_RAM/main.c.

Referenced by main().

uint8_t Rx_Idx = 0
uint8_t Tx_Idx = 0
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32