57 #include "ethernetif.h" 82 static void BSP_Config(
void);
84 static void Netif_Config(
void);
126 #if defined(__GNUC__) 150 struct udp_pcb *pcb1, *pcb2;
154 static unsigned char aBuf[48 * 2 * 3];
159 unsigned char *pAudio;
161 unsigned char *paBuf;
175 if (len == 48 * 2 * 3 + 1 + 8)
178 pAudio = (
unsigned char *)p->
payload;
185 for (i = 0; i < (288); i += 3)
187 *(paBuf + 1) = *pAudio++;
188 *(paBuf + 0) = *pAudio++;
214 err = udp_bind(
pcb0, IP_ADDR_ANY, 14337);
221 err = udp_bind(pcb1, IP_ADDR_ANY, 14339);
227 err = udp_bind(pcb2, IP_ADDR_ANY, 14341);
234 extern u16_t UDANTE_UDPPort;
235 err = udp_bind(
pcb0, IP_ADDR_ANY, UDANTE_UDPPort);
275 #if defined(__GNUC__) 297 ip_addr_copy_from_ip4(ipaddr, ipAddr);
336 static void Netif_Config(
void)
387 static void BSP_Config(
void)
407 LCD_UsrLog((
char *)
" State: Ethernet Initialization ...\n");
443 RCC_OscInitStruct.
PLL.
PLLM = 25;
444 RCC_OscInitStruct.
PLL.
PLLN = 400;
446 RCC_OscInitStruct.
PLL.
PLLQ = 9;
484 MPU_Region_InitTypeDef MPU_InitStruct;
490 MPU_InitStruct.Enable = MPU_REGION_ENABLE;
491 MPU_InitStruct.BaseAddress = 0x20010000;
492 MPU_InitStruct.Size = MPU_REGION_SIZE_256KB;
493 MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
494 MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
495 MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
496 MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
497 MPU_InitStruct.Number = MPU_REGION_NUMBER0;
498 MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
499 MPU_InitStruct.SubRegionDisable = 0x00;
500 MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
502 HAL_MPU_ConfigRegion(&MPU_InitStruct);
505 HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
523 #ifdef USE_FULL_ASSERT 531 void assert_failed(uint8_t* file, uint32_t line)
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
osStatus osKernelStart(void)
Start the RTOS Kernel with executing the specified thread.
err_t(* netif_input_fn)(struct pbuf *p, struct netif *inp)
#define RCC_CLOCKTYPE_PCLK1
#define RCC_SYSCLKSOURCE_PLLCLK
void http_taskCreate(void)
void SystemClock_Config(void)
System Clock Configuration The system Clock is configured as follow : System Clock source = PLL (HSE)...
void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)
Initializes the LCD layers.
RCC System, AHB and APB busses clock configuration structure definition.
void BSP_LCD_SelectLayer(uint32_t LayerIndex)
Selects the LCD Layer.
#define RCC_CLOCKTYPE_HCLK
void BSP_LCD_SetFont(sFONT *fonts)
Sets the LCD text font.
#define LCD_FB_START_ADDRESS
LCD FB_StartAddress.
void CPU_CACHE_Enable(void)
CPU L1-Cache enable.
#define RCC_CLOCKTYPE_SYSCLK
void main_UDanteUDP(void)
uint8_t BSP_LCD_Init(void)
Initializes the DSI LCD.
void LCD_LOG_Init(void)
Initializes the LCD Log module.
#define netif_is_link_up(netif)
void StartHTTPDThread(void const *argument)
Start Thread.
void netif_set_default(struct netif *netif)
#define LCD_DEFAULT_FONT
LCD default font.
void netif_set_up(struct netif *netif)
#define osThreadDef(name, thread, priority, instances, stacksz)
u8_t pbuf_free(struct pbuf *p)
priority: normal (default)
err_t tcpip_input(struct pbuf *p, struct netif *inp)
HAL_StatusTypeDef HAL_Init(void)
This function is used to initialize the HAL Library; it must be the first instruction to be executed ...
void MPU_Config(void)
Configure the MPU attributes as Write Through for SRAM1/2.
HAL_StatusTypeDef HAL_PWREx_EnableOverDrive(void)
__STATIC_INLINE void SCB_EnableICache(void)
Enable I-Cache.
void LCD_LOG_SetFooter(uint8_t *footer)
Display the application footer on the LCD screen.
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
osStatus osThreadTerminate(osThreadId thread_id)
Terminate execution of a thread and remove it from Active Threads.
void AUDIO_Player_QueueBuf(uint8_t *buf, int len)
Put the Network Audio samples into SAI output buffer.
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
#define RCC_OSCILLATORTYPE_HSE
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
void tcpip_init(tcpip_init_done_fn initfunc, void *arg)
#define RCC_PLLSOURCE_HSE
void Netif_AddUDANTE(ip_addr_t ipAddr)
RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition.
void User_notification(struct netif *netif)
Notify the User about the network interface config status.
header for the lcd_log.c file
void netif_set_down(struct netif *netif)
int main_http(void)
Main program.
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
void UDanteUDP_Receive(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
struct netif gnetifUDANTE
void http_server_netconn_init(void)
Initialize the HTTP server (start its thread)
#define configMINIMAL_STACK_SIZE
void LCD_LOG_SetHeader(uint8_t *header)
Display the application header on the LCD screen.
struct netif * netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input)
HAL_StatusTypeDef
HAL Status structures definition.
#define RCC_CLOCKTYPE_PCLK2
__STATIC_INLINE void SCB_EnableDCache(void)
Enable D-Cache.
err_t ethernetif_init(struct netif *netif)
Should be called at the beginning of the program to set up the network interface. It calls the functi...