kopia lustrzana https://github.com/bristol-seds/pico-tracker
Added GPS reset code
rodzic
f10d6861ff
commit
c2822a5d8f
|
@ -48,6 +48,7 @@ uint8_t gps_is_locked(void);
|
||||||
void gps_set_powersave_auto(void);
|
void gps_set_powersave_auto(void);
|
||||||
|
|
||||||
void gps_usart_init_enable(uint32_t baud_rate);
|
void gps_usart_init_enable(uint32_t baud_rate);
|
||||||
|
void gps_reset(void);
|
||||||
void gps_init(void);
|
void gps_init(void);
|
||||||
void usart_loopback_test(void);
|
void usart_loopback_test(void);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "hw_config.h"
|
#include "hw_config.h"
|
||||||
#include "system/system.h"
|
#include "system/system.h"
|
||||||
|
#include "system/port.h"
|
||||||
#include "system/interrupt.h"
|
#include "system/interrupt.h"
|
||||||
#include "sercom/sercom.h"
|
#include "sercom/sercom.h"
|
||||||
#include "sercom/usart.h"
|
#include "sercom/usart.h"
|
||||||
|
@ -503,11 +504,42 @@ void gps_usart_init_enable(uint32_t baud_rate)
|
||||||
usart_enable(GPS_SERCOM);
|
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
|
* Init
|
||||||
*/
|
*/
|
||||||
void gps_init(void)
|
void gps_init(void)
|
||||||
{
|
{
|
||||||
|
/* Bring GPS out of reset */
|
||||||
|
gps_reset_on();
|
||||||
|
|
||||||
/* Enable usart */
|
/* Enable usart */
|
||||||
gps_usart_init_enable(GPS_BAUD_RATE);
|
gps_usart_init_enable(GPS_BAUD_RATE);
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ void init(timepulse_callback_t callback, enum init_type init_t)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
led_reset();
|
led_reset();
|
||||||
|
gps_reset();
|
||||||
si_trx_shutdown();
|
si_trx_shutdown();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Ładowanie…
Reference in New Issue