33 #include <board_hw_defs.c>
34 #include <manualcontrolsettings.h>
35 #include <modulesettings.h>
36 #include <hwtaulink.h>
40 #if defined(PIOS_INCLUDE_PPM)
46 #define PIOS_COM_TELEM_RX_BUF_LEN 450
47 #define PIOS_COM_TELEM_TX_BUF_LEN 450
48 #define PIOS_COM_FRSKYSPORT_TX_BUF_LEN 24
59 #if defined(PIOS_INCLUDE_ANNUNC)
63 #if defined(PIOS_INCLUDE_FLASH) && defined(PIOS_INCLUDE_LOGFS_SETTINGS)
69 uint32_t num_partitions;
70 flash_partition_table = PIOS_BOARD_HW_DEFS_GetPartitionTable(bdinfo->
board_rev, &num_partitions);
78 #if defined(PIOS_LED_HEARTBEAT)
87 if (
PIOS_SPI_Init(&pios_spi_rfm22b_id, &pios_spi_rfm22b_cfg)) {
91 #ifdef PIOS_INCLUDE_WDG
96 #if defined(PIOS_INCLUDE_RTC)
101 HwTauLinkInitialize();
103 #if defined(PIOS_INCLUDE_TIM)
115 HwTauLinkData hwTauLink;
116 HwTauLinkGet(&hwTauLink);
119 bool usb_cdc_present =
false;
121 #if defined(PIOS_INCLUDE_USB_CDC)
125 usb_cdc_present =
true;
133 uintptr_t pios_usb_id;
139 #if defined(PIOS_INCLUDE_USB_CDC)
140 if (usb_cdc_present) {
145 PIOS_HAL_ConfigurePort(hwTauLink.MainPort,
146 &pios_usart_serial_cfg,
157 ModuleSettingsInitialize();
158 ModuleSettingsData moduleSettings;
159 ModuleSettingsGet(&moduleSettings);
161 moduleSettings.ComUsbBridgeSpeed = hwTauLink.ComSpeed;
162 moduleSettings.TelemetrySpeed = hwTauLink.ComSpeed;
164 ModuleSettingsSet(&moduleSettings);
166 #ifdef PIOS_INCLUDE_OPENLRS
167 const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(bdinfo->
board_rev);
169 PIOS_HAL_ConfigureRFM22B(pios_spi_rfm22b_id,
171 hwTauLink.RfBand, hwTauLink.MaxRfPower,
172 openlrs_cfg, &openlrs_handle);
180 .USART_BaudRate = 9600,
181 .USART_WordLength = USART_WordLength_8b,
182 .USART_Parity = USART_Parity_No,
183 .USART_StopBits = USART_StopBits_1,
184 .USART_HardwareFlowControl = USART_HardwareFlowControl_None,
185 .USART_Mode = USART_Mode_Rx | USART_Mode_Tx,
189 switch (hwTauLink.BTPort) {
190 case HWTAULINK_BTPORT_TELEMETRY:
195 uintptr_t pios_usart2_id;
196 if (
PIOS_USART_Init(&pios_usart2_id, &pios_usart_bluetooth_cfg, &pios_usart_bluetooth_params)) {
206 case HWTAULINK_BTPORT_COMBRIDGE:
210 uintptr_t pios_usart2_id;
211 if (
PIOS_USART_Init(&pios_usart2_id, &pios_usart_bluetooth_cfg, &pios_usart_bluetooth_params)) {
223 case HWTAULINK_BTPORT_DISABLED:
232 .USART_BaudRate = 57600,
233 .USART_WordLength = USART_WordLength_8b,
234 .USART_Parity = USART_Parity_No,
235 .USART_StopBits = USART_StopBits_1,
236 .USART_HardwareFlowControl = USART_HardwareFlowControl_None,
237 .USART_Mode = USART_Mode_Tx,
241 switch (hwTauLink.PPMPort) {
242 case HWTAULINK_PPMPORT_PPM:
244 #if defined(PIOS_INCLUDE_PPM)
246 uintptr_t pios_ppm_id;
257 case HWTAULINK_PPMPORT_SPORT:
258 #if defined(PIOS_INCLUDE_TARANIS_SPORT)
263 case HWTAULINK_PPMPORT_PPMSPORT:
265 #if defined(PIOS_INCLUDE_TARANIS_SPORT)
269 #if defined(PIOS_INCLUDE_PPM)
271 uintptr_t pios_ppm_id;
281 case HWTAULINK_PPMPORT_DISABLED:
287 GPIO_PinRemapConfig( GPIO_Remap_SWJ_NoJTRST, ENABLE);
289 #ifdef PIOS_INCLUDE_ADC
uintptr_t pios_com_telem_uart_bluetooth_id
int32_t PIOS_Flash_Internal_Init(uintptr_t *flash_id, const struct pios_flash_internal_cfg *cfg)
uintptr_t pios_com_frsky_sport_id
int32_t PIOS_USB_DESC_HID_CDC_Init(void)
void PIOS_HAL_ConfigureCDC(HwSharedUSB_VCPPortOptions port_type, uintptr_t usb_id, const struct pios_usb_cdc_cfg *cdc_cfg)
#define PIOS_COM_TELEM_RX_BUF_LEN
Main PiOS header to include all the compiled in PiOS options.
uintptr_t pios_rcvr_group_map[]
#define PIOS_DEBUG_Assert(test)
uintptr_t pios_uavo_settings_fs_id
void PIOS_ANNUNC_Off(uint32_t annunc_id)
int32_t PIOS_FLASHFS_Logfs_Init(uintptr_t *fs_id, const struct flashfs_logfs_cfg *cfg, enum pios_flash_partition_labels partition_label)
Initialize the flash object setting FS.
#define PIOS_COM_FRSKYSPORT_TX_BUF_LEN
const struct pios_board_info pios_board_info_blob
#define PIOS_COM_TELEM_TX_BUF_LEN
static const struct pios_tim_clock_cfg tim_4_cfg
const struct pios_com_driver pios_usart_com_driver
int32_t PIOS_TIM_InitClock(const struct pios_tim_clock_cfg *cfg)
int32_t PIOS_RCVR_Init(uintptr_t *rcvr_id, const struct pios_rcvr_driver *driver, const uintptr_t lower_id)
int32_t PIOS_SPI_Init(pios_spi_t *spi_dev, const struct pios_spi_cfg *cfg)
uintptr_t pios_ppm_rcvr_id
int32_t PIOS_ANNUNC_Init(const struct pios_annunc_cfg *cfg)
static const struct pios_tim_clock_cfg tim_1_cfg
void PIOS_RTC_Init(const struct pios_rtc_cfg *cfg)
int32_t PIOS_USB_DESC_HID_ONLY_Init(void)
void PIOS_HAL_ConfigureHID(HwSharedUSB_HIDPortOptions port_type, uintptr_t usb_id, const struct pios_usb_hid_cfg *hid_cfg)
int32_t PIOS_USART_Init(uintptr_t *usart_id, const struct pios_usart_cfg *cfg, struct pios_usart_params *params)
int32_t PIOS_COM_Init(uintptr_t *com_id, const struct pios_com_driver *driver, uintptr_t lower_id, uint16_t rx_buffer_len, uint16_t tx_buffer_len)
void PIOS_FLASH_register_partition_table(const struct pios_flash_partition partition_table[], uint8_t num_partitions)
int32_t PIOS_PPM_Init(uintptr_t *ppm_id, const struct pios_ppm_cfg *cfg)
Includes PiOS and core architecture components.
int32_t PIOS_USB_Init(uintptr_t *usb_id, const struct pios_usb_cfg *cfg)
uint16_t PIOS_WDG_Init()
Initialize the watchdog timer for a specified timeout.
int32_t PIOS_ADC_Init(uintptr_t *adc_id, const struct pios_adc_driver *driver, uintptr_t lower_id)
static const struct pios_tim_clock_cfg tim_3_cfg
int32_t PIOS_FLASHFS_Format(uintptr_t fs_id)
Erases all filesystem arenas and activate the first arena.
const struct pios_rcvr_driver pios_ppm_rcvr_driver
uintptr_t pios_com_bridge_id
static const struct pios_tim_clock_cfg tim_2_cfg
#define PIOS_Assert(test)
#define TAULINK_VERSION_MODULE
int32_t PIOS_USB_BOARD_DATA_Init(void)
#define PIOS_LED_HEARTBEAT