Added GPS reset code

master
Richard Meadows 2015-10-08 21:33:18 +01:00
rodzic f10d6861ff
commit c2822a5d8f
3 zmienionych plików z 34 dodań i 0 usunięć

Wyświetl plik

@ -48,6 +48,7 @@ uint8_t gps_is_locked(void);
void gps_set_powersave_auto(void);
void gps_usart_init_enable(uint32_t baud_rate);
void gps_reset(void);
void gps_init(void);
void usart_loopback_test(void);

Wyświetl plik

@ -28,6 +28,7 @@
#include "hw_config.h"
#include "system/system.h"
#include "system/port.h"
#include "system/interrupt.h"
#include "sercom/sercom.h"
#include "sercom/usart.h"
@ -503,11 +504,42 @@ void gps_usart_init_enable(uint32_t baud_rate)
usart_enable(GPS_SERCOM);
}
/**
* GPS reset pin
*/
void gps_reset_on(void)
{
#ifdef GPS_RESET_PIN
port_pin_set_output_level(GPS_RESET_PIN, 0); /* active low */
#endif
}
void gps_reset_off(void)
{
#ifdef GPS_RESET_PIN
port_pin_set_output_level(GPS_RESET_PIN, 1); /* active low */
#endif
}
/**
* Reset. Places the GPS in a RESET state
*/
void gps_reset(void)
{
#ifdef GPS_RESET_PIN
port_pin_set_config(GPS_RESET_PIN,
PORT_PIN_DIR_OUTPUT, /* Direction */
PORT_PIN_PULL_NONE, /* Pull */
false); /* Powersave */
port_pin_set_output_level(GPS_RESET_PIN, 0); /* active low */
#endif
}
/**
* Init
*/
void gps_init(void)
{
/* Bring GPS out of reset */
gps_reset_on();
/* Enable usart */
gps_usart_init_enable(GPS_BAUD_RATE);

Wyświetl plik

@ -75,6 +75,7 @@ void init(timepulse_callback_t callback, enum init_type init_t)
* --------------------------------------------------------------------------
*/
led_reset();
gps_reset();
si_trx_shutdown();
/**