snickerdoodle Platform Controller
firmware for STM32F0 platform controller
sd_platform.c File Reference

Platform Controller Functions. More...

#include "stm32f0xx_hal.h"
#include "sd_tim.h"
#include "usb_device.h"
#include "sd_gpio.h"
#include "usbd_cdc.h"
#include "sd_usbd_cdc_if.h"
#include "sd_buffer.h"
#include "sd_uart.h"
#include "sd_i2c.h"
#include "sd_spi.h"
#include "sd_led.h"
#include "sd_led_pattern.h"
#include "sd_button.h"
#include "sd_platform.h"

Macros

#define SD_PLATFORM_NORMAL_BOOT   0x00
 
#define SD_PLATFORM_DFU_BOOT   0x03
 

Functions

void sd_zynq_clk_enable (uint8_t enable)
 Zynq Clock Enable Enables the main clock source for the Zynq APU. More...
 
void sd_zynq_jtag_enable (uint8_t enable)
 Zynq JTAG Enable Enables the JTAG interface for programming the PS or PL. More...
 
void sd_wl_clk_enable (uint8_t enable)
 Wireless Clock Enable Enable the wireless module 32kHz clock source. More...
 
void sd_bt_enable (uint8_t enable)
 Bluetooth Enable Enable the Bluetooth interface on the wireless module. More...
 
void sd_zynq_boot_config (enum sd_zynq_boot boot)
 Zynq Boot Config Outputs boot select pins to zynq for desired boot media source. More...
 
void sd_zynq_reset (void)
 Zynq Reset Reset the Zynq APU. More...
 
void sd_zynq_disable (void)
 Disable Zynq Power Disable the Zynq power rails by setting the enable pin low. More...
 
void sd_zynq_enable (void)
 Enable Zynq Power Enable the Zynq power rails by setting the enable pin high. More...
 
void HAL_GPIO_EXTI_Callback (uint16_t pin)
 
void sd_wl18xx_ant_config (uint8_t ant)
 WL18xx Antenna Configuration Outputs antenna select pins for the wireless module. More...
 
enum sd_uart_usb_err sd_uart_usb_bridge_init (void)
 UART to USB Bridge Initialization Initialize UART device structure, UART to USB bridge buffer and set the UART device to use the (previously initialized) UART peripheral and newly initialized buffer. More...
 
enum sd_uart_usb_err sd_uart_usb_transmit (struct sd_uart_dev *dev)
 UART to USB Bridge Transmission Transmit the buffer that has been recieved on the bridged UART over USB communications device. More...
 
void sd_dfu_start (void)
 Enter Device Firmware Upgrade Mode Prepare device to enter system memory by disabling peripheral clocks, disable PLL, clear pending interrupts and disable interrupts. More...
 
enum sd_boot_button sd_boot_get_button_state (void)
 Get button press state.
 
uint8_t sd_boot_timer_expired (uint32_t start, uint32_t end)
 Check if boot timer has expired. More...
 
enum sd_zynq_boot sd_boot_select (void)
 Boot selection.
 

Variables

struct sd_cbuf uart1_rx_cbuff
 
struct sd_cbuf uart2_rx_cbuff
 
struct sd_doub_buff cons_dbuff
 
uint8_t uart1_rx_buff [CONS_UART_RX_BUFF_SIZE]
 
uint8_t uart2_rx_buff [CONS_UART_RX_BUFF_SIZE]
 
uint8_t cons_buff [2][CONS_UART_RX_BUFF_SIZE]
 
uint8_t hci_params_buff [CONS_UART_RX_BUFF_SIZE]
 

Detailed Description

Platform Controller Functions.

Author
R. Bush bush@.nosp@m.krtk.nosp@m.l.com
Version
v1.0
Date
2016 March 28

Copyright (c) 2016, krtkl inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.