Definition in file AVRGSM_com.c.
#include <ioavr.h>
#include <inavr.h>
#include "AVRGSM_com.h"
Include dependency graph for AVRGSM_com.c:
Go to the source code of this file.
Functions | |
unsigned char * | COM_gets (void) |
Return pointer to receive buffer. | |
void | COM_init (unsigned int baudrate) |
USART0 initialization. | |
void | COM_put_integer (int i) |
This method will print an integer in the range +-(10^5 - 1 ). | |
int | COM_putchar (unsigned char data) |
Adapted putchar method...no need for interrup driven tx-isr. | |
void | COM_puts (unsigned char *str) |
Print unsigned char string. | |
void | COM_putsf (const unsigned char __flash *fstr) |
Print const unsigned char __flash string. | |
void | COM_rx_off (void) |
RX interrupt disable. | |
void | COM_rx_on (void) |
RX interrupt enable. | |
void | COM_rx_reset (void) |
Reset receive interrupt. | |
void | COM_setSearchString (unsigned char Response) |
Set desired search string. | |
int | COM_trim (void) |
Remove trailing O, K, and . | |
__interrupt void | USART0_RX_interrupt (void) |
Receive interrupt routine. | |
Variables | |
const unsigned char __flash | CMTI [] = "+CMTI: " |
New Message arrived. | |
const unsigned char __flash | CR_LF [] = "\r\n" |
Carrige Return Line Feed. | |
const unsigned char __flash | OK [] = "OK\r\n" |
"OK" | |
const unsigned char __flash | READY [] = "> " |
Phone ready to receive text message. | |
int | rx_ack |
Extern flag from AVRSMS_com.c. | |
unsigned char | rx_buffer [RX_BUFFER_SIZE] |
private buffer | |
int | rx_i |
Buffer counter. | |
int | rx_overflow |
Overflow and acknowledge flag. | |
int | rx_wr_i |
Buffer write index. | |
const unsigned char __flash * | searchFor |
Flash pointer. | |
unsigned char | searchStr |
Private pointer. | |
const unsigned char __flash * | searchStrings [4] = {OK, CMTI, READY, CR_LF} |
Initialize pointer. |
|
Return pointer to receive buffer.
Definition at line 317 of file AVRGSM_com.c. References rx_buffer. Referenced by TOOLS__decodeCMGR(), and TOOLS_decodeCMTI().
|
|
USART0 initialization. This function set correct baurate and functionality of the USART0. See data sheet for more details.
Definition at line 66 of file AVRGSM_com.c. References COM_rx_reset(). Referenced by Initialization().
Here is the call graph for this function: ![]() |
|
This method will print an integer in the range +-(10^5 - 1 ).
Local variables Definition at line 224 of file AVRGSM_com.c. References COM_putchar(). Referenced by API_deletemsg(), API_readmsg(), and API_sendmsg().
Here is the call graph for this function: ![]() |
|
Adapted putchar method...no need for interrup driven tx-isr. Adpation of ansi c putchar() method
Definition at line 198 of file AVRGSM_com.c. References RX_WAIT. Referenced by API_sendmsg(), COM_put_integer(), COM_puts(), and COM_putsf().
|
|
Print unsigned char string.
Definition at line 254 of file AVRGSM_com.c. References COM_putchar(). Referenced by API_sendmsg().
Here is the call graph for this function: ![]() |
|
Print const unsigned char __flash string.
Definition at line 270 of file AVRGSM_com.c. References COM_putchar(). Referenced by API_deletemsg(), API_modem_init(), API_readmsg(), and API_sendmsg().
Here is the call graph for this function: ![]() |
|
RX interrupt disable.
Definition at line 114 of file AVRGSM_com.c. Referenced by API_check_acknowledge().
|
|
RX interrupt enable.
Definition at line 101 of file AVRGSM_com.c. Referenced by API_deletemsg(), API_modem_init(), API_readmsg(), API_sendmsg(), ST_delete_msg(), ST_init_phone(), and ST_read().
|
|
Reset receive interrupt.
Definition at line 85 of file AVRGSM_com.c. References rx_ack, rx_buffer, rx_i, rx_overflow, and rx_wr_i. Referenced by API_check_acknowledge(), API_deletemsg(), API_modem_init(), API_readmsg(), API_sendmsg(), COM_init(), ST_delete_msg(), ST_init_phone(), and ST_read().
|
|
Set desired search string.
Definition at line 127 of file AVRGSM_com.c. References rx_i, searchFor, searchStr, and searchStrings. Referenced by API_deletemsg(), API_modem_init(), API_readmsg(), API_sendmsg(), ST_delete_msg(), ST_init_phone(), and ST_read().
|
|
Remove trailing O, K, and If the receive buffer have trailing "OK\r\n" These characters will be deleted.
Local variables Definition at line 289 of file AVRGSM_com.c. References rx_buffer, and rx_wr_i. Referenced by TOOLS__decodeCMGR(), and TOOLS_decodeCMTI().
|
|
Receive interrupt routine. This receive routine buffer incomming messages from the connected GSM modem But also check if the received string was a acknowledge Definition at line 143 of file AVRGSM_com.c. References __interrupt, CMTI_, CRLF_, rx_ack, rx_buffer, RX_BUFFER_MASK, rx_i, rx_overflow, rx_wr_i, searchFor, searchStr, and searchStrings.
|
|
New Message arrived.
Definition at line 50 of file AVRGSM_com.c. |
|
Carrige Return Line Feed.
Definition at line 52 of file AVRGSM_com.c. |
|
"OK"
Definition at line 49 of file AVRGSM_com.c. |
|
Phone ready to receive text message.
Definition at line 51 of file AVRGSM_com.c. |
|
Extern flag from AVRSMS_com.c.
Definition at line 34 of file AVRGSM_com.c. |
|
private buffer
Definition at line 37 of file AVRGSM_com.c. Referenced by COM_gets(), COM_rx_reset(), COM_trim(), and USART0_RX_interrupt(). |
|
Buffer counter.
Definition at line 43 of file AVRGSM_com.c. Referenced by COM_rx_reset(), COM_setSearchString(), and USART0_RX_interrupt(). |
|
Overflow and acknowledge flag.
Definition at line 34 of file AVRGSM_com.c. Referenced by COM_rx_reset(), and USART0_RX_interrupt(). |
|
Buffer write index.
Definition at line 46 of file AVRGSM_com.c. Referenced by COM_rx_reset(), COM_trim(), and USART0_RX_interrupt(). |
|
Flash pointer.
Definition at line 53 of file AVRGSM_com.c. Referenced by COM_setSearchString(), and USART0_RX_interrupt(). |
|
Private pointer.
Definition at line 40 of file AVRGSM_com.c. Referenced by COM_setSearchString(), and USART0_RX_interrupt(). |
|
Initialize pointer.
Definition at line 54 of file AVRGSM_com.c. Referenced by COM_setSearchString(), and USART0_RX_interrupt(). |