Subversion Repositories libSerial

Rev

Rev 10 | Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 12
Line 6... Line 6...
6
 */
6
 */
7
 
7
 
8
#pragma once 
8
#pragma once 
9
 
9
 
10
#include "main.h"
10
#include "main.h"
-
 
11
 
-
 
12
 
11
typedef struct
13
typedef struct
12
{
14
{
13
        UART_HandleTypeDef *Handle;
15
        UART_HandleTypeDef *Handle;
14
 
16
 
15
        volatile uint8_t tx_usart_buff[TX_USART_BUFF_SIZ];
17
        volatile uint8_t tx_usart_buff[TX_USART_BUFF_SIZ];
Line 45... Line 47...
45
///@brief  returns the number of characters in the recieve buffer
47
///@brief  returns the number of characters in the recieve buffer
46
extern uint16_t SerialCharsReceived(usart_ctl *instance);
48
extern uint16_t SerialCharsReceived(usart_ctl *instance);
47
///@brief Get the amount of free space in the transmit buffer.
49
///@brief Get the amount of free space in the transmit buffer.
48
extern uint16_t SerialTransmitSpace(usart_ctl *instance);
50
extern uint16_t SerialTransmitSpace(usart_ctl *instance);
49
 
51
 
-
 
52
/// @brief Return 1 if there are any characters in the receive buffer
-
 
53
/// @param instance Pointer to usart_ctl structure
-
 
54
/// @return 1 if any characters 
50
extern uint8_t PollSerial(usart_ctl *instance);
55
extern uint8_t PollSerial(usart_ctl *instance);
-
 
56
 
-
 
57
/// @brief Return character code
-
 
58
/// @param instance 
-
 
59
/// @return 
51
extern uint8_t GetCharSerial(usart_ctl *instance);
60
extern uint8_t GetCharSerial(usart_ctl *instance);
-
 
61
 
-
 
62
/// @brief Enable the receive interrupt 
-
 
63
/// @param instance 
52
extern void EnableSerialRxInterrupt(usart_ctl *instance);
64
extern void EnableSerialRxInterrupt(usart_ctl *instance);
53
 
65
 
54
extern void UART_IRQHandler(usart_ctl *instance);
66
extern void UART_IRQHandler(usart_ctl *instance);
55
 
67
 
56
extern void PutCharSerial(usart_ctl *instance, uint8_t c);
68
extern void PutCharSerial(usart_ctl *instance, uint8_t c);