I'm trying to control Adafruit Ultimate GPS through STM32F407, there is an official Arduino [Library][1] and this library has a **sendCommand()** function. I'm trying to implement this sendCommand() function in Keil using HAL library
Code: Select all
// arduino command for setting antenna off
GPS.sendCommand("$PGCMD,33,0*6D\n");
Code: Select all
uint8_t Tx_Buffer[100];
int size;
// Turn off antenna update nuisance data
size = sprintf(Tx_Buffer,"$PGCMD,33,0*6D\n");
HAL_UART_Transmit(&huart1, Tx_Buffer, size, 100);
HAL_Delay(100);
// Set the update speed
size = sprintf(Tx_Buffer,"$PMTK220,500*2B");
HAL_UART_Transmit(&huart1, Tx_Buffer, size, 100);
HAL_Delay(100);
// Request RMC and GGA sentences only
size = sprintf(Tx_Buffer,"$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\n");
HAL_UART_Transmit(&huart1, Tx_Buffer ,size, 100);
HAL_Delay(1000);
Can you help me with the C code? Thanks in advance.
[1]: https://github.com/adafruit/Adafruit_GP ... it_GPS.cpp