mirror of
https://github.com/adrcs/ip400.git
synced 2025-07-03 10:41:17 +03:00
Updated to latest V1.1
This commit is contained in:
parent
7a7995e422
commit
921ab8ea96
|
@ -26,7 +26,7 @@
|
||||||
// the board type is selected here...
|
// the board type is selected here...
|
||||||
#define PI_BOARD 0 // pi board
|
#define PI_BOARD 0 // pi board
|
||||||
#define NUCLEO_BOARD 1 // Nucleo board
|
#define NUCLEO_BOARD 1 // Nucleo board
|
||||||
#define _BOARD_TYPE PI_BOARD // board type in use
|
#define _BOARD_TYPE NUCLEO_BOARD // board type in use
|
||||||
|
|
||||||
// gps receiver enabled
|
// gps receiver enabled
|
||||||
#if _BOARD_TYPE == PI_BOARD
|
#if _BOARD_TYPE == PI_BOARD
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
#ifndef INC_LED_H_
|
#ifndef INC_LED_H_
|
||||||
#define INC_LED_H_
|
#define INC_LED_H_
|
||||||
|
|
||||||
// config
|
#include <config.h>
|
||||||
#define REVERSE_LEADS 1 // reverse Bi-color LED leads on some boards
|
|
||||||
|
|
||||||
// LED functions
|
// LED functions
|
||||||
enum {
|
enum {
|
||||||
|
@ -41,31 +40,37 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
#if _BOARD_TYPE == PI_BOARD
|
#if _BOARD_TYPE == PI_BOARD
|
||||||
// define the LED ports
|
// bidirectional LED
|
||||||
#define LED_Pin GPIO_PIN_15
|
|
||||||
#define LED_GPIO_Port GPIOB
|
|
||||||
#if REVERSE_LEADS
|
|
||||||
// green on PA9, red on PB0
|
|
||||||
#define LED_Green_Pin GPIO_PIN_9
|
|
||||||
#define LED_Green_GPIO_Port GPIOA
|
|
||||||
#define LED_Red_Pin GPIO_PIN_0
|
|
||||||
#define LED_Red_GPIO_Port GPIOB
|
|
||||||
#else
|
|
||||||
// green on PB0, red on PA9
|
|
||||||
#define LED_Green_Pin GPIO_PIN_0
|
#define LED_Green_Pin GPIO_PIN_0
|
||||||
#define LED_Green_GPIO_Port GPIOB
|
#define LED_Green_GPIO_Port GPIOB
|
||||||
#define LED_Red_Pin GPIO_PIN_9
|
#define LED_Red_Pin GPIO_PIN_9
|
||||||
#define LED_Red_GPIO_Port GPIOA
|
#define LED_Red_GPIO_Port GPIOA
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
// Tx LED
|
||||||
#define TXLED_Pin GPIO_PIN_15
|
#define TXLED_Pin GPIO_PIN_15
|
||||||
#define TXLED_GPIO_Port GPIOB
|
#define TXLED_GPIO_Port GPIOB
|
||||||
//
|
|
||||||
|
// PA enable pin
|
||||||
#define PA_ENA_Pin GPIO_PIN_0
|
#define PA_ENA_Pin GPIO_PIN_0
|
||||||
#define PA_ENA_GPIO_Port GPIOA
|
#define PA_ENA_GPIO_Port GPIOA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if _BOARD_TYPE == TELEM_BOARD
|
||||||
|
// define the LED ports
|
||||||
|
#define LED_Green_Pin GPIO_PIN_14
|
||||||
|
#define LED_Green_GPIO_Port GPIOB
|
||||||
|
#define LED_Red_Pin GPIO_PIN_15
|
||||||
|
#define LED_Red_GPIO_Port GPIOB
|
||||||
|
|
||||||
|
// Tx LED
|
||||||
|
#define TXLED_Pin GPIO_PIN_0
|
||||||
|
#define TXLED_GPIO_Port GPIOA
|
||||||
|
|
||||||
|
// PA enable pin
|
||||||
|
#define PA_ENA_Pin GPIO_PIN_7
|
||||||
|
#define PA_ENA_GPIO_Port GPIOA
|
||||||
|
#endif
|
||||||
|
|
||||||
void SetLEDMode(uint8_t mode);
|
void SetLEDMode(uint8_t mode);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ union {
|
||||||
|
|
||||||
#define NETMASK 0xF8 // mask for last byte
|
#define NETMASK 0xF8 // mask for last byte
|
||||||
|
|
||||||
|
#ifdef __OLDIPSCHEME
|
||||||
/*
|
/*
|
||||||
* Create an IP 10.x.x.x from the compressed callsign field
|
* Create an IP 10.x.x.x from the compressed callsign field
|
||||||
*/
|
*/
|
||||||
|
@ -97,6 +98,7 @@ void GetIP172Addr(IP400_MAC *fr, SOCKADDR_IN *ipaddr)
|
||||||
// port number from source
|
// port number from source
|
||||||
ipaddr->sin_port = 0;
|
ipaddr->sin_port = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an IP 172.16.x.x from the compressed callsign field and unique ID
|
* Create an IP 172.16.x.x from the compressed callsign field and unique ID
|
||||||
|
|
|
@ -33,11 +33,6 @@
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "dataq.h"
|
#include "dataq.h"
|
||||||
#include "tasks.h"
|
#include "tasks.h"
|
||||||
#include "led.h"
|
|
||||||
|
|
||||||
// conditionals
|
|
||||||
#define __ENABLE_SPI_ON_TXENA 0 // enable spi sync output on TX enable for E04 modules
|
|
||||||
#define __ENABLE_SPI_ON_PB1 0 // enable SPI sync output on PB0 for IP400 module
|
|
||||||
|
|
||||||
#define SPI_MAX_TIME 200 // 200 ms max no activity timeout
|
#define SPI_MAX_TIME 200 // 200 ms max no activity timeout
|
||||||
#define NO_SPI_TIMEOUT (SPI_MAX_TIME/SPI_TASK_SCHED) // timeout in schedule ticks
|
#define NO_SPI_TIMEOUT (SPI_MAX_TIME/SPI_TASK_SCHED) // timeout in schedule ticks
|
||||||
|
@ -226,10 +221,6 @@ void SPI_Task_Exec(void)
|
||||||
// scope trigger on nucleo board
|
// scope trigger on nucleo board
|
||||||
#if _BOARD_TYPE==NUCLEO_BOARD // board type in use
|
#if _BOARD_TYPE==NUCLEO_BOARD // board type in use
|
||||||
HAL_GPIO_TogglePin(SCOPE_GPIO_Port, SCOPE_Pin);
|
HAL_GPIO_TogglePin(SCOPE_GPIO_Port, SCOPE_Pin);
|
||||||
#else
|
|
||||||
#if __ENABLE_SPI_ON_TXENA
|
|
||||||
HAL_GPIO_TogglePin(PA_ENA_GPIO_Port, PA_ENA_Pin);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue