clean up for porting - move platform specific stuff into outer project

This commit is contained in:
2018-07-07 23:02:58 +02:00
parent b8909fca06
commit 20639b77a6
35 changed files with 499 additions and 485 deletions
+3 -3
View File
@@ -2,8 +2,8 @@
// Created by MightyPork on 2018/01/27.
//
#ifndef GEX_F072_EVENT_REPORTS_H
#define GEX_F072_EVENT_REPORTS_H
#ifndef GEX_CORE_EVENT_REPORTS_H
#define GEX_CORE_EVENT_REPORTS_H
#ifndef GEX_MESSAGES_H
#error "Include messages.h instead!"
@@ -31,4 +31,4 @@ void EventReport_Data(const uint8_t *buff, uint16_t len);
void EventReport_PB(PayloadBuilder *pb);
void EventReport_End(void);
#endif //GEX_F072_EVENT_REPORTS_H
#endif //GEX_CORE_EVENT_REPORTS_H
+3 -1
View File
@@ -2,6 +2,9 @@
// Created by MightyPork on 2018/04/06.
//
#include "platform.h"
#if SUPPORT_NRF
#include "iface_nordic.h"
#include "nrf_pins.h"
#include "resources.h"
@@ -11,7 +14,6 @@
#include "system_settings.h"
#include "utils/hexdump.h"
#if SUPPORT_NRF
extern osSemaphoreId semVcomTxReadyHandle;
+3 -4
View File
@@ -2,11 +2,10 @@
// Created by MightyPork on 2018/04/06.
//
#ifndef GEX_F072_IFACE_NORDIC_H
#define GEX_F072_IFACE_NORDIC_H
#ifndef GEX_CORE_IFACE_NORDIC_H
#define GEX_CORE_IFACE_NORDIC_H
#include "platform.h"
#if SUPPORT_NRF
void iface_nordic_claim_resources(void);
@@ -21,4 +20,4 @@ void iface_nordic_transmit(const uint8_t *buff, uint32_t len);
#endif // SUPPORT_NRF
#endif //GEX_F072_IFACE_NORDIC_H
#endif //GEX_CORE_IFACE_NORDIC_H
+3 -3
View File
@@ -2,8 +2,8 @@
// Created by MightyPork on 2018/04/06.
//
#ifndef GEX_F072_IFACE_UART_H
#define GEX_F072_IFACE_UART_H
#ifndef GEX_CORE_IFACE_UART_H
#define GEX_CORE_IFACE_UART_H
#include "platform.h"
@@ -17,4 +17,4 @@ void iface_uart_claim_resources(void);
void iface_uart_transmit(const uint8_t *buff, uint32_t len);
#endif //GEX_F072_IFACE_UART_H
#endif //GEX_CORE_IFACE_UART_H
+3 -3
View File
@@ -2,8 +2,8 @@
// Created by MightyPork on 2018/04/06.
//
#ifndef GEX_F072_IFACE_USB_H
#define GEX_F072_IFACE_USB_H
#ifndef GEX_CORE_IFACE_USB_H
#define GEX_CORE_IFACE_USB_H
#include "platform.h"
@@ -17,4 +17,4 @@ bool iface_usb_ready(void);
*/
void iface_usb_transmit(const uint8_t *buff, uint32_t len);
#endif //GEX_F072_IFACE_USB_H
#endif //GEX_CORE_IFACE_USB_H
+3 -3
View File
@@ -2,8 +2,8 @@
// Created by MightyPork on 2018/03/23.
//
#ifndef GEX_F072_COM_INTERFACES_H
#define GEX_F072_COM_INTERFACES_H
#ifndef GEX_CORE_COM_INTERFACES_H
#define GEX_CORE_COM_INTERFACES_H
#include "platform.h"
@@ -34,4 +34,4 @@ void com_release_resources_for_alt_transfers(void);
/** Flush the rx buffer */
void com_iface_flush_buffer(void);
#endif //GEX_F072_COM_INTERFACES_H
#endif //GEX_CORE_COM_INTERFACES_H
+3 -3
View File
@@ -4,8 +4,8 @@
// Bulk read (providing data for bulk read by the PC)
//
#ifndef GEX_F072_MSG_BULKREAD_H
#define GEX_F072_MSG_BULKREAD_H
#ifndef GEX_CORE_MSG_BULKREAD_H
#define GEX_CORE_MSG_BULKREAD_H
#ifndef GEX_MESSAGES_H
#error "Include messages.h instead!"
@@ -45,4 +45,4 @@ struct bulk_read {
void bulkread_start(TinyFrame *tf, BulkRead *bulk);
#endif //GEX_F072_MSG_BULKREAD_H
#endif //GEX_CORE_MSG_BULKREAD_H
+3 -3
View File
@@ -4,8 +4,8 @@
// Bulk write (receiving bulk write from the PC)
//
#ifndef GEX_F072_MSG_BULKWRITE_H
#define GEX_F072_MSG_BULKWRITE_H
#ifndef GEX_CORE_MSG_BULKWRITE_H
#define GEX_CORE_MSG_BULKWRITE_H
#ifndef GEX_MESSAGES_H
#error "Include messages.h instead!"
@@ -44,4 +44,4 @@ struct bulk_write {
void bulkwrite_start(TinyFrame *tf, BulkWrite *bulk);
#endif //GEX_F072_MSG_BULKWRITE_H
#endif //GEX_CORE_MSG_BULKWRITE_H
+3 -3
View File
@@ -4,8 +4,8 @@
// Routines for sending TinyFrame responses.
//
#ifndef GEX_F072_MSG_RESPONSES_H
#define GEX_F072_MSG_RESPONSES_H
#ifndef GEX_CORE_MSG_RESPONSES_H
#define GEX_CORE_MSG_RESPONSES_H
#ifndef GEX_MESSAGES_H
#error "Include messages.h instead!"
@@ -109,4 +109,4 @@ void com_respond_u16(TF_ID frame_id, uint16_t d);
*/
void com_respond_u32(TF_ID frame_id, uint32_t d);
#endif //GEX_F072_MSG_RESPONSES_H
#endif //GEX_CORE_MSG_RESPONSES_H
+4
View File
@@ -3,6 +3,8 @@
//
#include "platform.h"
#if SUPPORT_NRF
#include "nrf.h"
/**
@@ -545,3 +547,5 @@ bool NRF_Init(uint8_t pSpeed)
return true;
}
#endif
+3 -5
View File
@@ -15,11 +15,9 @@
*
*/
#ifndef NORDIC_H_
#define NORDIC_H_
#include "platform.h"
#if SUPPORT_NRF
#include "resources.h"
#include "nrf_pins.h"
@@ -160,6 +158,6 @@ void NRF_EnablePipe(uint8_t pipenum);
*/
void NRF_DisablePipe(uint8_t pipenum);
#endif /* NORDIC_H_ */
#endif // SUPPORT_NRF
#endif //GEX_NRF_NRF_H
-75
View File
@@ -1,75 +0,0 @@
//
// Created by MightyPork on 2018/04/06.
//
#ifndef GEX_F072_NRF_PINS_H
#define GEX_F072_NRF_PINS_H
#include "platform.h"
#if defined(GEX_PLAT_F072_DISCOVERY) || defined(GEX_PLAT_F072_HUB)
// This config was used only for development when NRF was enabled for those platforms. It is normally disabled.
#define NRF_SPI SPI1
#define NRF_R_SPI R_SPI1
#define NRF_IRQ_Pin LL_GPIO_PIN_10
#define NRF_IRQ_GPIO_Port GPIOB
#define NRF_R_IRQ R_PB10
#define NRF_EXTI_LINENUM 10
#define NRF_SYSCFG_EXTI_PORT LL_SYSCFG_EXTI_PORTB
#define NRF_NSS_Pin LL_GPIO_PIN_11
#define NRF_NSS_GPIO_Port GPIOB
#define NRF_R_NSS R_PB11
#define NRF_CE_Pin LL_GPIO_PIN_12
#define NRF_CE_GPIO_Port GPIOB
#define NRF_R_CE R_PB12
#define NRF_RST_Pin LL_GPIO_PIN_13
#define NRF_RST_GPIO_Port GPIOB
#define NRF_R_RST R_PB13
#define NRF_R_SCK R_PA5
#define NRF_SCK_AF LL_GPIO_AF_0
#define NRF_R_MISO R_PA6
#define NRF_MISO_AF LL_GPIO_AF_0
#define NRF_R_MOSI R_PA7
#define NRF_MOSI_AF LL_GPIO_AF_0
#elif defined(GEX_PLAT_F072_ZERO)
#define NRF_SPI SPI2
#define NRF_R_SPI R_SPI2
#define NRF_IRQ_Pin LL_GPIO_PIN_15
#define NRF_IRQ_GPIO_Port GPIOC
#define NRF_R_IRQ R_PC15
#define NRF_EXTI_LINENUM 15
#define NRF_SYSCFG_EXTI_PORT LL_SYSCFG_EXTI_PORTC
#define NRF_NSS_Pin LL_GPIO_PIN_13
#define NRF_NSS_GPIO_Port GPIOC
#define NRF_R_NSS R_PC13
#define NRF_CE_Pin LL_GPIO_PIN_14
#define NRF_CE_GPIO_Port GPIOC
#define NRF_R_CE R_PC14
#define NRF_RST_Pin LL_GPIO_PIN_12
#define NRF_RST_GPIO_Port GPIOC
#define NRF_R_RST R_PC12
#define NRF_R_SCK R_PB13
#define NRF_SCK_AF LL_GPIO_AF_0
#define NRF_R_MISO R_PC2
#define NRF_MISO_AF LL_GPIO_AF_1
#define NRF_R_MOSI R_PC3
#define NRF_MOSI_AF LL_GPIO_AF_1
#else
#error "Missing NRF config for this platform."
#endif
#endif //GEX_F072_NRF_PINS_H