iNemo and Serial comunication

Temporary and unofficial forum dedicated to the ST event "iNemo Design Challenge". Designers that are planning to use ChibiOS/RT for the challenge can use the forum to exchange code and experience.
antoniolinux
Posts: 38
Joined: Thu Dec 19, 2013 12:59 pm

iNemo and Serial comunication

Postby antoniolinux » Sat Nov 01, 2014 8:49 pm

Hi to all, i have this situetion,
i wanty to comunicate with a shield SiM900, i see the example UART of STM32F1xx
but i have this question:
1) in code i see this:

Code: Select all

static VirtualTimer vt1, vt2; 

why you use this timer?

2) i see this for tx

Code: Select all

/*
 * This callback is invoked when a transmission has physically completed.
 */
static void txend2(UARTDriver *uartp) {
  (void)uartp;
  palSetPad(IOPORT3, GPIOC_LED);
  chSysLockFromIsr();
  if (chVTIsArmedI(&vt1))
    chVTResetI(&vt1);
  chVTSetI(&vt1, MS2ST(5000), restart, NULL);
  chSysUnlockFromIsr();
}

/*
 * This callback is invoked when a character is received but the application
 * was not ready to receive it, the character is passed as parameter.
 */
static void rxchar(UARTDriver *uartp, uint16_t c) {

  (void)uartp;
  (void)c;
  /* Flashing the LED each time a character is received.*/
  palClearPad(IOPORT3, GPIOC_LED);
  chSysLockFromIsr();
  if (chVTIsArmedI(&vt2))
    chVTResetI(&vt2);
  chVTSetI(&vt2, MS2ST(200), ledoff, NULL);
  chSysUnlockFromIsr();
}




do you have a easy system for serial communication?
this example is a good for all serial communication?

best regards
Antonio

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: iNemo and Serial comunication

Postby RoccoMarco » Sat Nov 01, 2014 8:54 pm

Hi,
the demo you are looking for is UART.

Ciao,
RM

antoniolinux
Posts: 38
Joined: Thu Dec 19, 2013 12:59 pm

Re: iNemo and Serial comunication

Postby antoniolinux » Mon Nov 03, 2014 10:38 pm

thanks for your answer, but where can i see example for a serial communication?
i have this problem because i have to send the AT command to the SIM900.


Best regards
Antonio

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: iNemo and Serial comunication

Postby RoccoMarco » Tue Nov 04, 2014 1:09 pm

Hi, you can use chprintf over uart.

Ciao,
RM


Return to “iNemo Design Challenge”

Who is online

Users browsing this forum: No registered users and 1 guest