STM8S/A Standard Peripherals Firmware Library
|
Defines | |
#define | countof(a) (sizeof(a) / sizeof(*(a))) |
#define | TxBufferSize1 (countof(TxBuffer1) - 1) |
#define | TxBufferSize2 (countof(TxBuffer2) - 1) |
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 } |
Functions | |
TestStatus | 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. | |
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. | |
static void | SPI_Config (void) |
Configure SPI for the full duplex communication with UART1. | |
static void | UART1_Config (void) |
Configure UART1 for the synchronous mode communication. | |
Variables | |
uint8_t | NbrOfDataToRead = TxBufferSize1 |
uint8_t | RxBuffer1 [TxBufferSize2] = {0} |
uint8_t | RxBuffer2 [TxBufferSize1] = {0} |
__IO uint8_t | RxCounter = 0 |
__IO TestStatus | TransferStatus1 = FAILED |
__IO TestStatus | TransferStatus2 = FAILED |
uint8_t | TxBuffer1 [] = "UART1 Example: UART1 -> SPI using TXE and RXNE Flags" |
uint8_t | TxBuffer2 [] = "UART1 Example: SPI -> UART1 using TXE and RXNE Flags" |
__IO uint8_t | TxCounter = 0 |
Define Documentation
#define countof | ( | a | ) | (sizeof(a) / sizeof(*(a))) |
Definition at line 42 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
#define TxBufferSize1 (countof(TxBuffer1) - 1) |
Definition at line 39 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Referenced by main().
#define TxBufferSize2 (countof(TxBuffer2) - 1) |
Definition at line 40 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/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
Definition at line 37 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Function Documentation
TestStatus Buffercmp | ( | uint8_t * | pBuffer1, |
uint8_t * | pBuffer2, | ||
uint16_t | BufferLength | ||
) |
Compares two buffers.
- Parameters:
-
pBuffer1 First buffer to be compared. pBuffer2 Second buffer to be compared. BufferLength Buffer's length
- Return values:
-
TestStatus Status of buffer 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.
INTERRUPT_HANDLER | ( | TLI_IRQHandler | , |
0 | |||
) |
Top Level Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 87 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | AWU_IRQHandler | , |
1 | |||
) |
Auto Wake Up Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 100 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | CLK_IRQHandler | , |
2 | |||
) |
Clock Controller Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 113 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | EXTI_PORTA_IRQHandler | , |
3 | |||
) |
External Interrupt PORTA Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 126 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | EXTI_PORTB_IRQHandler | , |
4 | |||
) |
External Interrupt PORTB Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 138 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | EXTI_PORTC_IRQHandler | , |
5 | |||
) |
External Interrupt PORTC Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 151 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | EXTI_PORTD_IRQHandler | , |
6 | |||
) |
External Interrupt PORTD Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 164 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | EXTI_PORTE_IRQHandler | , |
7 | |||
) |
External Interrupt PORTE Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 177 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | SPI_IRQHandler | , |
10 | |||
) |
SPI Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 232 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/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 245 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | TIM1_CAP_COM_IRQHandler | , |
12 | |||
) |
Timer1 Capture/Compare Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 258 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/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 298 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | TIM2_CAP_COM_IRQHandler | , |
14 | |||
) |
Timer2 Capture/Compare Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 311 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | I2C_IRQHandler | , |
19 | |||
) |
I2C Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 383 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | ADC1_IRQHandler | , |
22 | |||
) |
ADC1 interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 465 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | TIM4_UPD_OVF_IRQHandler | , |
23 | |||
) |
Timer4 Update/Overflow Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 493 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER | ( | EEPROM_EEC_IRQHandler | , |
24 | |||
) |
Eeprom EEC Interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 507 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
INTERRUPT_HANDLER_TRAP | ( | TRAP_IRQHandler | ) |
TRAP interrupt routine.
- Parameters:
-
None
- Return values:
-
None
Definition at line 73 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/stm8s_it.c.
void main | ( | void | ) |
Main program.
- Parameters:
-
None
- Return values:
-
None
Definition at line 65 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
References Buffercmp(), CLK_Config(), Delay(), ENABLE, NbrOfDataToRead, RESET, RxBuffer1, RxBuffer2, RxCounter, SPI_Cmd(), SPI_Config(), SPI_FLAG_RXNE, SPI_FLAG_TXE, SPI_GetFlagStatus(), SPI_ReceiveData(), SPI_SendData(), TransferStatus1, TransferStatus2, TxBuffer1, TxBuffer2, TxBufferSize1, TxBufferSize2, TxCounter, UART1_Cmd(), UART1_Config(), UART1_FLAG_RXNE, UART1_FLAG_TXE, UART1_GetFlagStatus(), UART1_ReceiveData8(), and UART1_SendData8().
static void SPI_Config | ( | void | ) | [static] |
Configure SPI for the full duplex communication with UART1.
- Parameters:
-
None
- Return values:
-
None
Definition at line 166 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
References SPI_BAUDRATEPRESCALER_2, SPI_CLOCKPHASE_1EDGE, SPI_CLOCKPOLARITY_LOW, SPI_DATADIRECTION_2LINES_FULLDUPLEX, SPI_DeInit(), SPI_FIRSTBIT_LSB, SPI_Init(), SPI_MODE_SLAVE, and SPI_NSS_SOFT.
Referenced by main().
static void UART1_Config | ( | void | ) | [static] |
Configure UART1 for the synchronous mode communication.
- Parameters:
-
None
- Return values:
-
None
Definition at line 141 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
References DISABLE, UART1_Cmd(), UART1_DeInit(), UART1_Init(), UART1_MODE_TXRX_ENABLE, UART1_PARITY_NO, UART1_STOPBITS_1, UART1_SYNCMODE_CLOCK_ENABLE, UART1_SYNCMODE_CPHA_MIDDLE, UART1_SYNCMODE_CPOL_LOW, UART1_SYNCMODE_LASTBIT_ENABLE, and UART1_WORDLENGTH_8D.
Referenced by main().
Variable Documentation
uint8_t NbrOfDataToRead = TxBufferSize1 |
Definition at line 48 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Definition at line 46 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Definition at line 47 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Definition at line 49 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
__IO TestStatus TransferStatus1 = FAILED |
Definition at line 50 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
__IO TestStatus TransferStatus2 = FAILED |
Definition at line 50 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Definition at line 44 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Definition at line 45 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.
Definition at line 49 of file STM8S_StdPeriph_Examples/UART1/UART1_Synchronous/main.c.