Rev 3 | Rev 5 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3 | Rev 4 | ||
|---|---|---|---|
| Line 6... | Line 6... | ||
| 6 | */ |
6 | */ |
| 7 | 7 | ||
| 8 | #ifndef INC_SERIAL_H_ |
8 | #ifndef INC_SERIAL_H_ |
| 9 | #define INC_SERIAL_H_ |
9 | #define INC_SERIAL_H_ |
| 10 | 10 | ||
| 11 | - | ||
| 12 | - | ||
| 13 | #include "main.h" |
11 | #include "main.h" |
| 14 | 12 | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 18 | #define TX_USART_BUFF_SIZ 1024 |
- | |
| 19 | #define RX_USART_BUFF_SIZ 1024 |
- | |
| 20 | - | ||
| 21 | typedef struct { |
13 | typedef struct { |
| 22 | USART_TypeDef *Instance; |
14 | USART_TypeDef *Instance; |
| 23 | 15 | ||
| 24 | volatile uint8_t tx_usart_buff[TX_USART_BUFF_SIZ]; |
16 | volatile uint8_t tx_usart_buff[TX_USART_BUFF_SIZ]; |
| 25 | volatile unsigned int tx_usart_in_Ptr; |
17 | volatile unsigned int tx_usart_in_Ptr; |
| Line 60... | Line 52... | ||
| 60 | extern void PutCharSerial(usart_ctl * instance,uint8_t c); |
52 | extern void PutCharSerial(usart_ctl * instance,uint8_t c); |
| 61 | extern void ResetTxBuffer(usart_ctl * instance); |
53 | extern void ResetTxBuffer(usart_ctl * instance); |
| 62 | extern void ResetRxBuffer(usart_ctl * instance); |
54 | extern void ResetRxBuffer(usart_ctl * instance); |
| 63 | extern void FlushSerial(usart_ctl * instance); |
55 | extern void FlushSerial(usart_ctl * instance); |
| 64 | extern uint8_t TxBufferEmpty(usart_ctl * instance); |
56 | extern uint8_t TxBufferEmpty(usart_ctl * instance); |
| - | 57 | ///@brief wait until the USART buffer is empty and all characters are sent |
|
| - | 58 | extern void TxWaitEmpty(usart_ctl *instance); |
|
| - | 59 | ||
| - | 60 | ||
| 65 | extern void init_usart_ctl(usart_ctl * instance, USART_TypeDef * hardware); |
61 | extern void init_usart_ctl(usart_ctl * instance, |
| - | 62 | USART_TypeDef * usart); |
|
| 66 | 63 | ||
| 67 | 64 | ||
| 68 | 65 | ||
| 69 | #endif /* INC_SERIAL_H_ */ |
66 | #endif /* INC_SERIAL_H_ */ |