|
STM8S/A Standard Peripherals Firmware Library
|
Defines | |
| #define | BUFFER_SIZE (countof(TxBuffer)-1) |
| #define | countof(a) (sizeof(a) / sizeof(*(a))) |
Functions | |
| static ErrorStatus | Buffercmp (uint8_t *pBuffer1, uint8_t *pBuffer2, uint16_t BufferLength) |
| Compares two buffers. | |
| static void | CLK_Config (void) |
| Configure system clock to run at 16Mhz. | |
| void | Delay (uint16_t nCount) |
| Delay. | |
| static void | GPIO_Config (void) |
| Configure GPIO for LEDs available on the evaluation board. | |
| INTERRUPT_HANDLER (TLI_IRQHandler, 0) | |
| Top Level Interrupt routine. | |
| INTERRUPT_HANDLER (AWU_IRQHandler, 1) | |
| Auto Wake Up Interrupt routine. | |
| INTERRUPT_HANDLER (CLK_IRQHandler, 2) | |
| Clock Controller Interrupt routine. | |
| INTERRUPT_HANDLER (EXTI_PORTA_IRQHandler, 3) | |
| External Interrupt PORTA Interrupt routine. | |
| INTERRUPT_HANDLER (EXTI_PORTB_IRQHandler, 4) | |
| External Interrupt PORTB Interrupt routine. | |
| INTERRUPT_HANDLER (EXTI_PORTC_IRQHandler, 5) | |
| External Interrupt PORTC Interrupt routine. | |
| INTERRUPT_HANDLER (EXTI_PORTD_IRQHandler, 6) | |
| External Interrupt PORTD Interrupt routine. | |
| INTERRUPT_HANDLER (EXTI_PORTE_IRQHandler, 7) | |
| External Interrupt PORTE Interrupt routine. | |
| INTERRUPT_HANDLER (SPI_IRQHandler, 10) | |
| SPI Interrupt routine. | |
| INTERRUPT_HANDLER (TIM1_UPD_OVF_TRG_BRK_IRQHandler, 11) | |
| Timer1 Update/Overflow/Trigger/Break Interrupt routine. | |
| INTERRUPT_HANDLER (TIM1_CAP_COM_IRQHandler, 12) | |
| Timer1 Capture/Compare Interrupt routine. | |
| INTERRUPT_HANDLER (TIM2_UPD_OVF_BRK_IRQHandler, 13) | |
| Timer2 Update/Overflow/Break Interrupt routine. | |
| INTERRUPT_HANDLER (TIM2_CAP_COM_IRQHandler, 14) | |
| Timer2 Capture/Compare Interrupt routine. | |
| INTERRUPT_HANDLER (I2C_IRQHandler, 19) | |
| I2C Interrupt routine. | |
| INTERRUPT_HANDLER (ADC1_IRQHandler, 22) | |
| ADC1 interrupt routine. | |
| INTERRUPT_HANDLER (TIM4_UPD_OVF_IRQHandler, 23) | |
| Timer4 Update/Overflow Interrupt routine. | |
| INTERRUPT_HANDLER (EEPROM_EEC_IRQHandler, 24) | |
| Eeprom EEC Interrupt routine. | |
| INTERRUPT_HANDLER_TRAP (TRAP_IRQHandler) | |
| TRAP interrupt routine. | |
| void | main (void) |
| Main program. | |
Variables | |
| uint8_t | RxBuffer [BUFFER_SIZE] = {0} |
| __IO uint16_t | Status = 0 |
| __IO ErrorStatus | TransferStatus = ERROR |
| uint8_t | TxBuffer [] = "STM8S SPI Firmware Library Example: communication with a microSD card" |
Define Documentation
| #define BUFFER_SIZE (countof(TxBuffer)-1) |
Definition at line 42 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.
Referenced by main().
| #define countof | ( | a | ) | (sizeof(a) / sizeof(*(a))) |
Definition at line 39 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.
Function Documentation
| static ErrorStatus Buffercmp | ( | uint8_t * | pBuffer1, |
| uint8_t * | pBuffer2, | ||
| uint16_t | BufferLength | ||
| ) | [static] |
Compares two buffers.
pBufferx: buffers to be compared.
- Parameters:
-
BufferLength,: buffer's length
- Return values:
-
ErrorStatus : result of the comparison - PASSED: pBuffer1 identical to pBuffer2
- FAILED: pBuffer1 differs from pBuffer2
| static void CLK_Config | ( | void | ) | [static] |
Configure system clock to run at 16Mhz.
- Parameters:
-
None
- Return values:
-
None
| void Delay | ( | uint16_t | nCount | ) |
Delay.
- Parameters:
-
nCount
- Return values:
-
None
Definition at line 297 of file STM8S_StdPeriph_Examples/AWU/AWU_ActiveHaltMode/main.c.
| static void GPIO_Config | ( | void | ) | [static] |
Configure GPIO for LEDs available on the evaluation board.
- Parameters:
-
None
- Return values:
-
None
| INTERRUPT_HANDLER | ( | TLI_IRQHandler | , |
| 0 | |||
| ) |
Top Level Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 88 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | AWU_IRQHandler | , |
| 1 | |||
| ) |
Auto Wake Up Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 101 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | CLK_IRQHandler | , |
| 2 | |||
| ) |
Clock Controller Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 114 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | EXTI_PORTA_IRQHandler | , |
| 3 | |||
| ) |
External Interrupt PORTA Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 127 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | EXTI_PORTB_IRQHandler | , |
| 4 | |||
| ) |
External Interrupt PORTB Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 139 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | EXTI_PORTC_IRQHandler | , |
| 5 | |||
| ) |
External Interrupt PORTC Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 152 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | EXTI_PORTD_IRQHandler | , |
| 6 | |||
| ) |
External Interrupt PORTD Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 165 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | EXTI_PORTE_IRQHandler | , |
| 7 | |||
| ) |
External Interrupt PORTE Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 178 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | SPI_IRQHandler | , |
| 10 | |||
| ) |
SPI Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 233 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | TIM1_UPD_OVF_TRG_BRK_IRQHandler | , |
| 11 | |||
| ) |
Timer1 Update/Overflow/Trigger/Break Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 246 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | TIM1_CAP_COM_IRQHandler | , |
| 12 | |||
| ) |
Timer1 Capture/Compare Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 259 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | TIM2_UPD_OVF_BRK_IRQHandler | , |
| 13 | |||
| ) |
Timer2 Update/Overflow/Break Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 299 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | TIM2_CAP_COM_IRQHandler | , |
| 14 | |||
| ) |
Timer2 Capture/Compare Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 312 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | I2C_IRQHandler | , |
| 19 | |||
| ) |
I2C Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 384 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | ADC1_IRQHandler | , |
| 22 | |||
| ) |
ADC1 interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 466 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | TIM4_UPD_OVF_IRQHandler | , |
| 23 | |||
| ) |
Timer4 Update/Overflow Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 494 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER | ( | EEPROM_EEC_IRQHandler | , |
| 24 | |||
| ) |
Eeprom EEC Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 508 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| INTERRUPT_HANDLER_TRAP | ( | TRAP_IRQHandler | ) |
TRAP interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 74 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/stm8s_it.c.
| void main | ( | void | ) |
Main program.
- Parameters:
-
None
- Return values:
-
None
Definition at line 64 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.
References BUFFER_SIZE, Buffercmp(), CLK_Config(), Delay(), GPIO_Config(), LED1, LED2, LED3, LED4, RxBuffer, SD_Detect(), SD_Init(), SD_NOT_PRESENT, SD_ReadBlock(), SD_WriteBlock(), Status, STM_EVAL_LEDToggle(), SUCCESS, TransferStatus, and TxBuffer.
Variable Documentation
Definition at line 47 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.
Definition at line 45 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.
Referenced by main(), and SD_GetStatus().
| __IO ErrorStatus TransferStatus = ERROR |
Definition at line 48 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.
Referenced by main().
Definition at line 46 of file STM8S_StdPeriph_Examples/SPI/SPI_FastCommunicationMicroSD/main.c.