test public

Dependencies:   HttpServer_snapshot_mbed-os

Committer:
anhtran
Date:
Fri Oct 18 03:09:43 2019 +0000
Revision:
0:e9fd5575b10e
abc

Who changed what in which revision?

UserRevisionLine numberNew contents of line
anhtran 0:e9fd5575b10e 1 /*******************************************************************************
anhtran 0:e9fd5575b10e 2 * DISCLAIMER
anhtran 0:e9fd5575b10e 3 * This software is supplied by Renesas Electronics Corporation and is only
anhtran 0:e9fd5575b10e 4 * intended for use with Renesas products. No other uses are authorized. This
anhtran 0:e9fd5575b10e 5 * software is owned by Renesas Electronics Corporation and is protected under
anhtran 0:e9fd5575b10e 6 * all applicable laws, including copyright laws.
anhtran 0:e9fd5575b10e 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
anhtran 0:e9fd5575b10e 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
anhtran 0:e9fd5575b10e 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
anhtran 0:e9fd5575b10e 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
anhtran 0:e9fd5575b10e 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
anhtran 0:e9fd5575b10e 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
anhtran 0:e9fd5575b10e 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
anhtran 0:e9fd5575b10e 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
anhtran 0:e9fd5575b10e 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
anhtran 0:e9fd5575b10e 16 * Renesas reserves the right, without notice, to make changes to this software
anhtran 0:e9fd5575b10e 17 * and to discontinue the availability of this software. By using this software,
anhtran 0:e9fd5575b10e 18 * you agree to the additional terms and conditions found by accessing the
anhtran 0:e9fd5575b10e 19 * following link:
anhtran 0:e9fd5575b10e 20 * http://www.renesas.com/disclaimer*
anhtran 0:e9fd5575b10e 21 * Copyright (C) 2018 Renesas Electronics Corporation. All rights reserved.
anhtran 0:e9fd5575b10e 22 *******************************************************************************/
anhtran 0:e9fd5575b10e 23
anhtran 0:e9fd5575b10e 24 #include "r_bsp_cmn.h"
anhtran 0:e9fd5575b10e 25 #include "R_BSP_Ssif.h"
anhtran 0:e9fd5575b10e 26 #include "ssif_if.h"
anhtran 0:e9fd5575b10e 27 #include "ssif_api.h"
anhtran 0:e9fd5575b10e 28
anhtran 0:e9fd5575b10e 29 R_BSP_Ssif::R_BSP_Ssif(PinName sck, PinName ws, PinName tx, PinName rx, PinName audio_clk) : ssif_ch(-1) {
anhtran 0:e9fd5575b10e 30 int32_t wk_channel;
anhtran 0:e9fd5575b10e 31
anhtran 0:e9fd5575b10e 32 wk_channel = ssif_init(sck, ws, tx, rx, audio_clk);
anhtran 0:e9fd5575b10e 33 if (wk_channel != NC) {
anhtran 0:e9fd5575b10e 34 ssif_ch = wk_channel;
anhtran 0:e9fd5575b10e 35 }
anhtran 0:e9fd5575b10e 36 }
anhtran 0:e9fd5575b10e 37
anhtran 0:e9fd5575b10e 38 R_BSP_Ssif::~R_BSP_Ssif() {
anhtran 0:e9fd5575b10e 39 // do nothing
anhtran 0:e9fd5575b10e 40 }
anhtran 0:e9fd5575b10e 41
anhtran 0:e9fd5575b10e 42 void R_BSP_Ssif::init(const ssif_channel_cfg_t* const p_ch_cfg, int32_t max_write_num, int32_t max_read_num) {
anhtran 0:e9fd5575b10e 43 if (ssif_ch >= 0) {
anhtran 0:e9fd5575b10e 44 init_channel(R_SSIF_MakeCbTbl_mbed(), ssif_ch, (void *)p_ch_cfg, max_write_num, max_read_num);
anhtran 0:e9fd5575b10e 45 }
anhtran 0:e9fd5575b10e 46 }
anhtran 0:e9fd5575b10e 47
anhtran 0:e9fd5575b10e 48
anhtran 0:e9fd5575b10e 49 bool R_BSP_Ssif::ConfigChannel(const ssif_channel_cfg_t* const p_ch_cfg) {
anhtran 0:e9fd5575b10e 50 return ioctl(SSIF_CONFIG_CHANNEL, (void *)p_ch_cfg);
anhtran 0:e9fd5575b10e 51 }
anhtran 0:e9fd5575b10e 52
anhtran 0:e9fd5575b10e 53 bool R_BSP_Ssif::GetStatus(uint32_t* const p_status) {
anhtran 0:e9fd5575b10e 54 return ioctl(SSIF_CONFIG_CHANNEL, (void *)p_status);
anhtran 0:e9fd5575b10e 55 }