Backup point only. YRDK RX63N building but not linking.
parent
aa85a68636
commit
2f199771d5
Binary file not shown.
@ -0,0 +1,149 @@
|
|||||||
|
/***********************************************************************************************************************
|
||||||
|
* DISCLAIMER
|
||||||
|
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||||
|
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||||
|
* applicable laws, including copyright laws.
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||||
|
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||||
|
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||||
|
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||||
|
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||||
|
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||||
|
* following link:
|
||||||
|
* http://www.renesas.com/disclaimer
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
* File Name : r_bsp_config_reference.c
|
||||||
|
* Device(s) : RX63x
|
||||||
|
* Description : The file r_bsp_config.h is used to configure your BSP. r_bsp_config.h should be included
|
||||||
|
* somewhere in your package so that the r_bsp code has access to it. This file (r_bsp_config_reference.h)
|
||||||
|
* is just a reference file that the user can use to make their own r_bsp_config.h file.
|
||||||
|
************************************************************************************************************************
|
||||||
|
* History : DD.MM.YYYY Version Description
|
||||||
|
* : 13.03.2012 1.00 First Release
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
#ifndef R_BSP_CONFIG_REF_HEADER_FILE
|
||||||
|
#define R_BSP_CONFIG_REF_HEADER_FILE
|
||||||
|
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
Configuration Options
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
/* The 'BSP_DECLARE_STACK' macro is checked so that the stack is only declared in one place (resetprg.c). Every time a
|
||||||
|
'#pragma stacksize' is encountered, the stack size is increased. This prevents multiplication of stack size. */
|
||||||
|
#if defined(BSP_DECLARE_STACK)
|
||||||
|
/* User Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||||
|
#pragma stacksize su=0x1000
|
||||||
|
/* Interrupt Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
|
||||||
|
#pragma stacksize si=0x400
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Heap size in bytes. */
|
||||||
|
#define HEAP_BYTES (0x400)
|
||||||
|
|
||||||
|
/* After reset MCU will operate in Supervisor mode. To switch to User mode, set this macro to '1'. For more information
|
||||||
|
on the differences between these 2 modes see the CPU >> Processor Mode section of your MCU's hardware manual.
|
||||||
|
0 = Stay in Supervisor mode.
|
||||||
|
1 = Switch to User mode.
|
||||||
|
*/
|
||||||
|
#define RUN_IN_USER_MODE (0)
|
||||||
|
|
||||||
|
/* To get into User Boot Mode the user must control some pins on the MCU and also set some values in ROM. These values
|
||||||
|
in ROM are described in the Option-Setting Memory section of the hardware manual. This macro sets these values so
|
||||||
|
that User Boot Mode can be used. The user is still responsible for setting the MCU pins appropriately.
|
||||||
|
0 = Single-Chip or USB Boot Mode
|
||||||
|
1 = User Boot Mode
|
||||||
|
*/
|
||||||
|
#define USER_BOOT_ENABLE (0)
|
||||||
|
|
||||||
|
/* Set your desired ID code. NOTE, leave at the default (all 0xFF's) if you do not wish to use an ID code. If you set
|
||||||
|
this value and program it into the MCU then you will need to remember the ID code because the debugger will ask for
|
||||||
|
it when trying to connect. Note that the E1/E20 will ignore the ID code when programming the MCU during debugging.
|
||||||
|
If you set this value and then forget it then you can clear the ID code by connecting up in serial boot mode using
|
||||||
|
FDT. The ID Code is 16 bytes long. The macro below define the ID Code in 4-byte sections. */
|
||||||
|
/* Lowest 4-byte section, address 0xFFFFFFA0. From MSB to LSB: Control Code, ID code 1, ID code 2, ID code 3. */
|
||||||
|
#define ID_CODE_LONG_1 (0xFFFFFFFF)
|
||||||
|
/* 2nd ID Code section, address 0xFFFFFFA4. From MSB to LSB: ID code 4, ID code 5, ID code 6, ID code 7. */
|
||||||
|
#define ID_CODE_LONG_2 (0xFFFFFFFF)
|
||||||
|
/* 3rd ID Code section, address 0xFFFFFFA8. From MSB to LSB: ID code 8, ID code 9, ID code 10, ID code 11. */
|
||||||
|
#define ID_CODE_LONG_3 (0xFFFFFFFF)
|
||||||
|
/* 4th ID Code section, address 0xFFFFFFAC. From MSB to LSB: ID code 12, ID code 13, ID code 14, ID code 15. */
|
||||||
|
#define ID_CODE_LONG_4 (0xFFFFFFFF)
|
||||||
|
|
||||||
|
/* This macro lets other modules no if a RTOS is being used.
|
||||||
|
0 = RTOS is not used.
|
||||||
|
1 = RTOS is used.
|
||||||
|
*/
|
||||||
|
#define RTOS_USED (0)
|
||||||
|
|
||||||
|
/* Clock source select (CKSEL).
|
||||||
|
0 = Low Speed On-Chip Oscillator (LOCO)
|
||||||
|
1 = High Speed On-Chip Oscillator (HOCO)
|
||||||
|
2 = Main Clock Oscillator
|
||||||
|
3 = Sub-Clock Oscillator
|
||||||
|
4 = PLL Circuit
|
||||||
|
*/
|
||||||
|
#define CLOCK_SOURCE (4)
|
||||||
|
|
||||||
|
/* Clock configuration options.
|
||||||
|
The input clock frequency is specified and then the system clocks are set by specifying the multipliers used. The
|
||||||
|
multiplier settings are used to set the clock registers in resetprg.c. If a 12MHz clock is used and the
|
||||||
|
ICLK is 96MHz, PCLKA is 48MHz, PCLKB is 48MHz, FCLK is 48MHz, USB Clock is 48MHz, and BCLK is 12MHz then the
|
||||||
|
settings would be:
|
||||||
|
|
||||||
|
XTAL_HZ = 12000000
|
||||||
|
PLL_DIV = 1 (no division)
|
||||||
|
PLL_MUL = 16 (12MHz x 16 = 192MHz)
|
||||||
|
ICK_DIV = 2 : System Clock (ICLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV) = 96MHz
|
||||||
|
PCKA_DIV = 4 : Peripheral Clock A (PCLKA) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKA_DIV) = 48MHz
|
||||||
|
PCKB_DIV = 4 : Peripheral Clock B (PCLKB) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV) = 48MHz
|
||||||
|
FCK_DIV = 4 : Flash IF Clock (FCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV) = 48MHz
|
||||||
|
BCK_DIV = 8 : External Bus Clock (BCK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / BCK_DIV) = 24MHz
|
||||||
|
UCK_DIV = 4 : USB Clock (UCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / UCK_DIV) = 48MHz
|
||||||
|
*/
|
||||||
|
/* XTAL - Input clock frequency in Hz */
|
||||||
|
#define XTAL_HZ (12000000)
|
||||||
|
/* PLL Input Frequency Divider Select (PLIDIV).
|
||||||
|
Available divisors = /1 (no division), /2, /4
|
||||||
|
*/
|
||||||
|
#define PLL_DIV (1)
|
||||||
|
/* PLL Frequency Multiplication Factor Select (STC).
|
||||||
|
Available multipliers = x8, x10, x12, x16, x20, x24, x25, x50
|
||||||
|
*/
|
||||||
|
#define PLL_MUL (16)
|
||||||
|
/* System Clock Divider (ICK).
|
||||||
|
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||||
|
*/
|
||||||
|
#define ICK_DIV (2)
|
||||||
|
/* Peripheral Module Clock A Divider (PCKA).
|
||||||
|
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||||
|
*/
|
||||||
|
#define PCKA_DIV (4)
|
||||||
|
/* Peripheral Module Clock B Divider (PCKB).
|
||||||
|
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||||
|
*/
|
||||||
|
#define PCKB_DIV (4)
|
||||||
|
/* External Bus Clock Divider (BCK).
|
||||||
|
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||||
|
*/
|
||||||
|
#define BCK_DIV (8)
|
||||||
|
/* Flash IF Clock Divider (FCK).
|
||||||
|
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
|
||||||
|
*/
|
||||||
|
#define FCK_DIV (4)
|
||||||
|
/* IEBUS Clock Divider Select.
|
||||||
|
Available divisors = /1 (no division), /2, /4, /6, /8, /16, /32, /64
|
||||||
|
*/
|
||||||
|
#define IEBCK_DIV (8)
|
||||||
|
/* USB Clock Divider Select.
|
||||||
|
Available divisors = /3, /4
|
||||||
|
*/
|
||||||
|
#define UCK_DIV (4)
|
||||||
|
|
||||||
|
#endif /* R_BSP_CONFIG_REF_HEADER_FILE */
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,118 @@
|
|||||||
|
/***********************************************************************************************************************
|
||||||
|
* DISCLAIMER
|
||||||
|
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
||||||
|
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
||||||
|
* applicable laws, including copyright laws.
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
||||||
|
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
||||||
|
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
||||||
|
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
||||||
|
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
||||||
|
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
||||||
|
* following link:
|
||||||
|
* http:/*www.renesas.com/disclaimer
|
||||||
|
*
|
||||||
|
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
* File Name : yrdkrx63n.h
|
||||||
|
* H/W Platform : YRDKRX63N
|
||||||
|
* Description : Board specific definitions for the RDKRX63N.
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
* History : DD.MM.YYYY Version Description
|
||||||
|
* : 30.11.2011 1.00 First Release
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#ifndef RDK_RX63N_H
|
||||||
|
#define RDK_RX63N_H
|
||||||
|
|
||||||
|
|
||||||
|
/* Local defines */
|
||||||
|
#define LED_ON (0)
|
||||||
|
#define LED_OFF (1)
|
||||||
|
|
||||||
|
/* I/0 port 1 */
|
||||||
|
#define USB_VBUSEN PORT1.PODR.BIT.B6
|
||||||
|
#define AUDIO_OUT_R PORT1.PODR.BIT.B7
|
||||||
|
|
||||||
|
/* I/0 port 2 */
|
||||||
|
#define BL_ENA PORT2.PODR.BIT.B1
|
||||||
|
#define USB_DPUPEA PORT2.PODR.BIT.B3
|
||||||
|
|
||||||
|
/* I/O port 3 */
|
||||||
|
#define CAN_WIFI_TX PORT3.PODR.BIT.B2
|
||||||
|
|
||||||
|
/* I/O port 4: switches and various peripherals */
|
||||||
|
#define SW_ACTIVE (0)
|
||||||
|
#define SW1 PORT4.PIDR.BIT.B0
|
||||||
|
#define SW1_PMR PORT4.PMR.BIT.B0
|
||||||
|
#define SW1_PDR PORT4.PDR.BIT.B0
|
||||||
|
#define SW2 PORT4.PIDR.BIT.B1
|
||||||
|
#define SW2_PMR PORT4.PMR.BIT.B1
|
||||||
|
#define SW2_PDR PORT4.PDR.BIT.B1
|
||||||
|
#define POTENTIOMETER PORT4.PODR.BIT.B2
|
||||||
|
#define JN1_AN3 PORT4.PODR.BIT.B3
|
||||||
|
#define SW3 PORT4.PIDR.BIT.B4
|
||||||
|
#define SW3_PMR PORT4.PMR.BIT.B4
|
||||||
|
#define SW3_PDR PORT4.PDR.BIT.B4
|
||||||
|
#define MICROPHONE PORT4.PODR.BIT.B5
|
||||||
|
#define AUDIO_IN_R PORT4.PODR.BIT.B6
|
||||||
|
#define PWMLP_IN PORT4.PODR.BIT.B7
|
||||||
|
|
||||||
|
/* I/O port 5 */
|
||||||
|
#define LCD_RS PORT5.PODR.BIT.B1
|
||||||
|
#define BCLK PORT5.PODR.BIT.B3
|
||||||
|
#define PWMLP_OUT PORT5.PODR.BIT.B4
|
||||||
|
|
||||||
|
/* I/O port A: Extension slot (JN2) and E/N pins */
|
||||||
|
#define JN2_SSLA1_B PORTA.PODR.BIT.B0
|
||||||
|
#define PMOD1_PIN8 PORTA.PODR.BIT.B1
|
||||||
|
#define AMP_SHDN PORTA.PODR.BIT.B2
|
||||||
|
#define ETH_MDIO PORTA.PODR.BIT.B3
|
||||||
|
#define ETH_MDC PORTA.PODR.BIT.B4
|
||||||
|
#define ETH_LINK PORTA.PODR.BIT.B5
|
||||||
|
|
||||||
|
/* I/O port B: Ethernet I/O pins definitions */
|
||||||
|
#define RMII_RXD1 PORTB.PODR.BIT.B0
|
||||||
|
#define RMII_RXD0 PORTB.PODR.BIT.B1
|
||||||
|
#define ETH_CLK PORTB.PODR.BIT.B2
|
||||||
|
#define RMII_RX_ER PORTB.PODR.BIT.B3
|
||||||
|
#define RMII_TX_EN PORTB.PODR.BIT.B4
|
||||||
|
#define RMII_TXD0 PORTB.PODR.BIT.B5
|
||||||
|
#define RMII_TXD1 PORTB.PODR.BIT.B6
|
||||||
|
#define ETH_CRS PORTB.PODR.BIT.B7
|
||||||
|
|
||||||
|
/* I/O port C: RSPI and peripheral I/O pins definitions */
|
||||||
|
#define RSPI_CHANNEL_0 0
|
||||||
|
#define RSPI_CHANNEL_1 1
|
||||||
|
#define FLASH_CS PORTC.PODR.BIT.B0 /* SSL 1 */
|
||||||
|
#define AUDIO_OUT_L PORTC.PODR.BIT.B1
|
||||||
|
#define LCD_CS PORTC.PODR.BIT.B2 /* SSL 3 */
|
||||||
|
#define LCD_RESET PORTC.PODR.BIT.B3
|
||||||
|
#define SDMICRO_CS PORTC.PODR.BIT.B4 /* SSL 0 */
|
||||||
|
#define RSPI_SCLOCK PORTC.PODR.BIT.B5
|
||||||
|
#define RSPI_MOSI PORTC.PODR.BIT.B6
|
||||||
|
#define RSPI_MISO PORTC.PODR.BIT.B7
|
||||||
|
|
||||||
|
/* I/O ports D & E: LEDs */
|
||||||
|
#define LED4 PORTD.PODR.BIT.B5
|
||||||
|
#define LED5 PORTE.PODR.BIT.B3
|
||||||
|
#define LED6 PORTD.PODR.BIT.B2
|
||||||
|
#define LED7 PORTE.PODR.BIT.B0
|
||||||
|
#define LED8 PORTD.PODR.BIT.B4
|
||||||
|
#define LED9 PORTE.PODR.BIT.B2
|
||||||
|
#define LED10 PORTD.PODR.BIT.B1
|
||||||
|
#define LED11 PORTD.PODR.BIT.B7
|
||||||
|
#define LED12 PORTD.PODR.BIT.B3
|
||||||
|
#define LED13 PORTE.PODR.BIT.B1
|
||||||
|
#define LED14 PORTD.PODR.BIT.B0
|
||||||
|
#define LED15 PORTD.PODR.BIT.B6
|
||||||
|
|
||||||
|
/* WiFi chip select */
|
||||||
|
#define WIFI_CS PORTJ.PODR.BIT.B3
|
||||||
|
|
||||||
|
#endif /* RDK_RX63N_H */
|
||||||
|
|
@ -1,254 +0,0 @@
|
|||||||
/***********************************************************************************************************************
|
|
||||||
* DISCLAIMER
|
|
||||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
|
||||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
|
||||||
* applicable laws, including copyright laws.
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
|
||||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
|
||||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
|
||||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
|
||||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
|
||||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
|
||||||
* following link:
|
|
||||||
* http://www.renesas.com/disclaimer
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* File Name : lcd.c
|
|
||||||
* Device(s) : RX
|
|
||||||
* H/W Platform : RSK+RX63N
|
|
||||||
* Description : Provides variable and function declarations for lcd.c file
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* History : DD.MM.YYYY Version Description
|
|
||||||
* : 22.11.2011 1.00 First Release
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Includes <System Includes> , "Project Includes"
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/* Processor-specific details */
|
|
||||||
#include <machine.h>
|
|
||||||
/* Standard string manipulation & formatting functions */
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
/* Defines standard variable types used in this function */
|
|
||||||
#include <stdint.h>
|
|
||||||
/* Bring in board includes. */
|
|
||||||
#include "platform.h"
|
|
||||||
/* Following header file provides function prototypes for LCD controlling functions & macro defines */
|
|
||||||
#include "lcd.h"
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Private global variables and functions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
static void lcd_delay(volatile int32_t nsecs);
|
|
||||||
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value);
|
|
||||||
static void lcd_write(uint8_t data_or_ctrl, uint8_t value);
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function name : lcd_initialize
|
|
||||||
* Description : Initializes the LCD display.
|
|
||||||
* Arguments : none
|
|
||||||
* Return Value : none
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
void lcd_initialize(void)
|
|
||||||
{
|
|
||||||
/* Set LCD data pins as outputs. */
|
|
||||||
PORT8.PDR.BYTE |= 0xF0;
|
|
||||||
|
|
||||||
/* Set LCD control pins as outputs. */
|
|
||||||
RS_PIN_DDR = 1;
|
|
||||||
E_PIN_DDR = 1;
|
|
||||||
|
|
||||||
/* Power Up Delay for the LCD Module */
|
|
||||||
lcd_delay(50000000);
|
|
||||||
|
|
||||||
/* Display initialises in 8 bit mode - so send one write (seen as 8 bit) to set to 4 bit mode. */
|
|
||||||
lcd_nibble_write(CTRL_WR, 0x03);
|
|
||||||
lcd_delay(5000000);
|
|
||||||
lcd_nibble_write(CTRL_WR, 0x03);
|
|
||||||
lcd_delay(5000000);
|
|
||||||
lcd_nibble_write(CTRL_WR, 0x03);
|
|
||||||
lcd_delay(5000000);
|
|
||||||
|
|
||||||
/* Function Set */
|
|
||||||
lcd_nibble_write(CTRL_WR, 0x02);
|
|
||||||
lcd_delay(39000);
|
|
||||||
lcd_nibble_write(CTRL_WR, 0x02);
|
|
||||||
lcd_nibble_write(CTRL_WR, (LCD_DISPLAY_ON | LCD_TWO_LINE ));
|
|
||||||
lcd_delay(39000);
|
|
||||||
|
|
||||||
/* Display ON/OFF control */
|
|
||||||
lcd_write(CTRL_WR, LCD_CURSOR_OFF);
|
|
||||||
lcd_delay(39000);
|
|
||||||
|
|
||||||
/* Display Clear */
|
|
||||||
lcd_write(CTRL_WR, LCD_CLEAR);
|
|
||||||
lcd_delay(2000000);
|
|
||||||
|
|
||||||
/* Entry Mode Set */
|
|
||||||
lcd_write(CTRL_WR, 0x06);
|
|
||||||
lcd_delay(39000);
|
|
||||||
|
|
||||||
/* Home the cursor */
|
|
||||||
lcd_write(CTRL_WR, LCD_HOME_L1);
|
|
||||||
lcd_delay(5000000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function name : lcd_clear
|
|
||||||
* Description : Clears the LCD
|
|
||||||
* Arguments : none
|
|
||||||
* Return Value : none
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
void lcd_clear(void)
|
|
||||||
{
|
|
||||||
/* Display Clear */
|
|
||||||
lcd_write(CTRL_WR, LCD_CLEAR);
|
|
||||||
lcd_delay(2000000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function name : lcd_display
|
|
||||||
* Description : This function controls LCD writes to line 1 or 2 of the LCD.
|
|
||||||
* You need to use the defines LCD_LINE1 and LCD_LINE2 in order to specify the starting position.
|
|
||||||
* For example, to start at the 2nd position on line 1...
|
|
||||||
* lcd_display(LCD_LINE1 + 1, "Hello")
|
|
||||||
* Arguments : position -
|
|
||||||
* Line number of display
|
|
||||||
* string -
|
|
||||||
* Pointer to null terminated string
|
|
||||||
* Return Value : none
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
void lcd_display(uint8_t position, uint8_t const * string)
|
|
||||||
{
|
|
||||||
/* Declare next position variable */
|
|
||||||
static uint8_t next_pos = 0xFF;
|
|
||||||
|
|
||||||
/* Set line position if needed. We don't want to if we don't need to because LCD control operations take longer
|
|
||||||
than LCD data operations. */
|
|
||||||
if (next_pos != position)
|
|
||||||
{
|
|
||||||
if(position < LCD_LINE2)
|
|
||||||
{
|
|
||||||
/* Display on Line 1 */
|
|
||||||
lcd_write(CTRL_WR, ((uint8_t)(LCD_HOME_L1 + position)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Display on Line 2 */
|
|
||||||
lcd_write(CTRL_WR, ((uint8_t)((LCD_HOME_L2 + position) - LCD_LINE2)));
|
|
||||||
}
|
|
||||||
|
|
||||||
lcd_delay(39000);
|
|
||||||
|
|
||||||
/* set position index to known value */
|
|
||||||
next_pos = position;
|
|
||||||
}
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
/* Write character to LCD. */
|
|
||||||
lcd_write(DATA_WR,*string++);
|
|
||||||
|
|
||||||
lcd_delay(43000);
|
|
||||||
|
|
||||||
/* Increment position index */
|
|
||||||
next_pos++;
|
|
||||||
}
|
|
||||||
while(*string);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function name : lcd_delay
|
|
||||||
* Description : Implements LCD required delays.
|
|
||||||
* Arguments : nsecs -
|
|
||||||
* Number of nanoseconds to delay. RX600 has max clock of 100MHz which gives a cycle time of 10ns.
|
|
||||||
* This means that nothing under 100ns should be input. 100ns would be 10 cycles which is still
|
|
||||||
* being optimistic for getting in and out of this function.
|
|
||||||
* Return Value : none
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
static void lcd_delay(volatile int32_t nsecs)
|
|
||||||
{
|
|
||||||
while (0 < nsecs)
|
|
||||||
{
|
|
||||||
/* Subtract off 10 cycles per iteration. This number was obtained when using the Renesas toolchain at
|
|
||||||
optimization level 2. The number to nanoseconds to subtract off below is calculated off of the ICLK speed. */
|
|
||||||
nsecs -= (int32_t)((100.0)*(100000000.0/(float)ICLK_HZ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function name : lcd_nibble_write
|
|
||||||
* Description : Writes data to display. Sends command to display.
|
|
||||||
* Arguments : value -
|
|
||||||
* The value to write
|
|
||||||
* data_or_ctrl -
|
|
||||||
* Whether to write data or control.
|
|
||||||
* 1 = DATA
|
|
||||||
* 0 = CONTROL
|
|
||||||
* Return Value : none
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value)
|
|
||||||
{
|
|
||||||
/* Set Register Select pin high for Data */
|
|
||||||
if (data_or_ctrl == DATA_WR)
|
|
||||||
{
|
|
||||||
/* Data write. */
|
|
||||||
RS_PIN = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Control write. */
|
|
||||||
RS_PIN = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* tsu1 delay */
|
|
||||||
lcd_delay(60);
|
|
||||||
|
|
||||||
/* EN enable chip (HIGH) */
|
|
||||||
E_PIN = 1;
|
|
||||||
|
|
||||||
/* Output the data */
|
|
||||||
PORT8.PODR.BYTE = (value << 4u);
|
|
||||||
|
|
||||||
/* tw delay */
|
|
||||||
lcd_delay(450);
|
|
||||||
|
|
||||||
/* Latch data by dropping E */
|
|
||||||
E_PIN = 0;
|
|
||||||
|
|
||||||
/* th2 delay */
|
|
||||||
lcd_delay(10);
|
|
||||||
|
|
||||||
/* tc delay */
|
|
||||||
lcd_delay(480);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function name : lcd_write
|
|
||||||
* Description : This function controls LCD writes to line 1 or 2 of the LCD. You need to use the defines LCD_LINE1 and
|
|
||||||
* LCD_LINE2 in order to specify the starting position.
|
|
||||||
* For example, to start at the 2nd position on line 1...
|
|
||||||
* lcd_display(LCD_LINE1 + 1, "Hello")
|
|
||||||
* Arguments : value -
|
|
||||||
* The value to write
|
|
||||||
* data_or_ctrl -
|
|
||||||
* Whether to write data or control.
|
|
||||||
* 1 = DATA
|
|
||||||
* 0 = CONTROL
|
|
||||||
* Return Value : none
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
static void lcd_write(uint8_t data_or_ctrl, uint8_t value)
|
|
||||||
{
|
|
||||||
/* Write upper nibble first */
|
|
||||||
lcd_nibble_write(data_or_ctrl, (uint8_t)((value & 0xF0) >> 4));
|
|
||||||
|
|
||||||
/* Write lower nibble second */
|
|
||||||
lcd_nibble_write(data_or_ctrl, (uint8_t)(value & 0x0F));
|
|
||||||
}
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
|||||||
/***********************************************************************************************************************
|
|
||||||
* DISCLAIMER
|
|
||||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
|
||||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
|
||||||
* applicable laws, including copyright laws.
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
|
||||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
|
||||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
|
||||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
|
||||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
|
||||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
|
||||||
* following link:
|
|
||||||
* http://www.renesas.com/disclaimer
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* File Name : lcd.h
|
|
||||||
* Device(s) : RX
|
|
||||||
* H/W Platform : RSKRX630
|
|
||||||
* Description : Provides variable and function declarations for lcd.c file
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* History : DD.MM.YYYY Version Description
|
|
||||||
* : 22.11.2011 1.00 First Release
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/* Multiple inclusion prevention macro */
|
|
||||||
#ifndef LCD_H
|
|
||||||
#define LCD_H
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Includes <System Includes> , "Project Includes"
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/* Defines standard integer variable types used in this file */
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Macro definitions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/* RS register select pin */
|
|
||||||
#define RS_PIN PORTJ.PODR.BIT.B5
|
|
||||||
#define RS_PIN_DDR PORTJ.PDR.BIT.B5
|
|
||||||
/* Display enable pin */
|
|
||||||
#define E_PIN PORTF.PODR.BIT.B5
|
|
||||||
#define E_PIN_DDR PORTF.PDR.BIT.B5
|
|
||||||
/* Data write/read definition */
|
|
||||||
#define DATA_WR 1
|
|
||||||
/* Control write/read definition */
|
|
||||||
#define CTRL_WR 0
|
|
||||||
/* Maximum characters per line of LCD display. */
|
|
||||||
#define NUMB_CHARS_PER_LINE 8
|
|
||||||
/* Number of lines on the LCD display */
|
|
||||||
#define MAXIMUM_LINES 2
|
|
||||||
/* Character position of LCD line 1 */
|
|
||||||
#define LCD_LINE1 0
|
|
||||||
/* Character position of LCD line 2 */
|
|
||||||
#define LCD_LINE2 16
|
|
||||||
/* Clear LCD display and home cursor */
|
|
||||||
#define LCD_CLEAR 0x01
|
|
||||||
/* Move cursor to line 1 */
|
|
||||||
#define LCD_HOME_L1 0x80
|
|
||||||
/* Move cursor to line 2 */
|
|
||||||
#define LCD_HOME_L2 0xC0
|
|
||||||
/* Cursor auto decrement after R/W */
|
|
||||||
#define CURSOR_MODE_DEC 0x04
|
|
||||||
/* Cursor auto increment after R/W */
|
|
||||||
#define CURSOR_MODE_INC 0x06
|
|
||||||
/* Setup, 4 bits,2 lines, 5X7 */
|
|
||||||
#define FUNCTION_SET 0x28
|
|
||||||
/* Display ON with Cursor */
|
|
||||||
#define LCD_CURSOR_ON 0x0E
|
|
||||||
/* Display ON with Cursor off */
|
|
||||||
#define LCD_CURSOR_OFF 0x0C
|
|
||||||
/* Display on with blinking cursor */
|
|
||||||
#define LCD_CURSOR_BLINK 0x0D
|
|
||||||
/* Move Cursor Left One Position */
|
|
||||||
#define LCD_CURSOR_LEFT 0x10
|
|
||||||
/* Move Cursor Right One Position */
|
|
||||||
#define LCD_CURSOR_RIGHT 0x14
|
|
||||||
/* Enable LCD display */
|
|
||||||
#define LCD_DISPLAY_ON 0x04
|
|
||||||
/* Enable both LCD lines */
|
|
||||||
#define LCD_TWO_LINE 0x08
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Exported global functions (to be accessed by other files)
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/* LCD initialisation function declaration */
|
|
||||||
void lcd_initialize (void);
|
|
||||||
|
|
||||||
/* Update display function declaration */
|
|
||||||
void lcd_display(uint8_t position, uint8_t const * string);
|
|
||||||
|
|
||||||
/* Clear LCD function delcaration */
|
|
||||||
void lcd_clear (void);
|
|
||||||
|
|
||||||
/* End of multiple inclusion prevention macro */
|
|
||||||
#endif
|
|
@ -1,118 +0,0 @@
|
|||||||
/***********************************************************************************************************************
|
|
||||||
* DISCLAIMER
|
|
||||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
|
||||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
|
||||||
* applicable laws, including copyright laws.
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
|
||||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
|
||||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
|
||||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
|
||||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
|
||||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
|
||||||
* following link:
|
|
||||||
* http://www.renesas.com/disclaimer
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* File Name : locking.c
|
|
||||||
* Description : This implements a locking mechanism that can be used by all code. The locking is done atomically so
|
|
||||||
* common resources can be accessed safely.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/**********************************************************************************************************************
|
|
||||||
* History : DD.MM.YYYY Version Description
|
|
||||||
* : 07.03.2012 1.00 First Release
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Includes <System Includes> , "Project Includes"
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/* Fixed-size integer typedefs. */
|
|
||||||
#include <stdint.h>
|
|
||||||
/* bool support. */
|
|
||||||
#include <stdbool.h>
|
|
||||||
/* Has intrinsic support. Includes xchg() which is used in this code. */
|
|
||||||
#include <machine.h>
|
|
||||||
/* Includes board and MCU related header files. */
|
|
||||||
#include "platform.h"
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Macro definitions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Typedef definitions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Exported global variables (to be accessed by other files)
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Private global variables and functions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function Name: R_BSP_Lock
|
|
||||||
* Description : Attempt to acquire the lock that has been sent in.
|
|
||||||
* Arguments : plock -
|
|
||||||
* Pointer to lock structure with lock to try and acquire.
|
|
||||||
* Return Value : true -
|
|
||||||
* Lock was acquired.
|
|
||||||
* false -
|
|
||||||
* Lock was not acquired.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
bool R_BSP_Lock(bsp_lock_t * plock)
|
|
||||||
{
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
/* Variable used in trying to acquire lock. Using the xchg instruction makes this atomic */
|
|
||||||
int32_t is_locked = true;
|
|
||||||
|
|
||||||
/* This example uses the RX MCU's atomic xchg() instruction. plock->lock is the lock we are trying to reserve.
|
|
||||||
The way this works is that 'is_locked' gets the value of the plock->lock and plock->lock gets the value of
|
|
||||||
'is_locked' which we just set to 'true'. Basically this is an atomic 'swap' command. If the lock had not yet been
|
|
||||||
reserved then its value would be 'false' and after the xchg() instruction finished 'is_locked' would have
|
|
||||||
'false'. If it had already been reserved then 'is_locked' would have 'true' after the xchg() instruction. Since
|
|
||||||
plock->lock was already 'true' and we just set it back to 'true' everything is ok. To see if we reserved the lock
|
|
||||||
we just need to check the value of 'is_locked' after this instruction finishes. */
|
|
||||||
|
|
||||||
/* Try to acquire semaphore to obtain lock */
|
|
||||||
xchg(&is_locked, &plock->lock);
|
|
||||||
|
|
||||||
/* Check to see if semaphore was successfully taken */
|
|
||||||
if (is_locked == false)
|
|
||||||
{
|
|
||||||
/* Lock obtained, return success. */
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Lock was not obtained, another task already has it. */
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
} /* End of function R_BSP_Lock() */
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* Function Name: R_BSP_Unlock
|
|
||||||
* Description : Release hold on lock.
|
|
||||||
* Arguments : plock -
|
|
||||||
* Pointer to lock structure with lock to release.
|
|
||||||
* Return Value : true -
|
|
||||||
* Lock was released.
|
|
||||||
* false -
|
|
||||||
* Lock was not released.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
bool R_BSP_Unlock(bsp_lock_t * plock)
|
|
||||||
{
|
|
||||||
/* Set lock back to unlocked. */
|
|
||||||
plock->lock = false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} /* End of function R_BSP_Unlock() */
|
|
||||||
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
|||||||
/***********************************************************************************************************************
|
|
||||||
* DISCLAIMER
|
|
||||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
|
||||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
|
||||||
* applicable laws, including copyright laws.
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
|
||||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
|
||||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
|
||||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
|
||||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
|
||||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
|
||||||
* following link:
|
|
||||||
* http://www.renesas.com/disclaimer
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* File Name : locking.h
|
|
||||||
* Description : This implements a locking mechanism that can be used by all code. The locking is done atomically so
|
|
||||||
* common resources can be accessed safely.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/**********************************************************************************************************************
|
|
||||||
* History : DD.MM.YYYY Version Description
|
|
||||||
* : 07.03.2012 1.00 First Release
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Includes <System Includes> , "Project Includes"
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/* Fixed-size integer typedefs. */
|
|
||||||
#include <stdint.h>
|
|
||||||
/* bool support. */
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Macro definitions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Typedef definitions
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
/* The actual lock. int32_t is used because this is what the xchg() instruction takes as parameters. */
|
|
||||||
int32_t lock;
|
|
||||||
/* Could add a ID for locking and unlocking. In this could protect against any function being able to unlock. */
|
|
||||||
} bsp_lock_t;
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Exported global variables
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
Exported global functions (to be accessed by other files)
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
bool R_BSP_Lock(bsp_lock_t * plock);
|
|
||||||
bool R_BSP_Unlock(bsp_lock_t * plock);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
/***********************************************************************************************************************
|
|
||||||
* DISCLAIMER
|
|
||||||
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
|
|
||||||
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
|
|
||||||
* applicable laws, including copyright laws.
|
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
|
||||||
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
|
|
||||||
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
|
|
||||||
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
|
|
||||||
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
|
|
||||||
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
|
|
||||||
* following link:
|
|
||||||
* http://www.renesas.com/disclaimer
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* File Name : rskrx63n.h
|
|
||||||
* H/W Platform : RSK+RX63N
|
|
||||||
* Description : Board specific definitions for the RSKRX630.
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
/***********************************************************************************************************************
|
|
||||||
* History : DD.MM.YYYY Version Description
|
|
||||||
* : 28.11.2011 1.00 First Release
|
|
||||||
***********************************************************************************************************************/
|
|
||||||
|
|
||||||
#ifndef RSKRX63N_H
|
|
||||||
#define RSKRX63N_H
|
|
||||||
|
|
||||||
/* Local defines */
|
|
||||||
#define LED_ON (0)
|
|
||||||
#define LED_OFF (1)
|
|
||||||
#define SET_BIT_HIGH (1)
|
|
||||||
#define SET_BIT_LOW (0)
|
|
||||||
#define SET_BYTE_HIGH (0xFF)
|
|
||||||
#define SET_BYTE_LOW (0x00)
|
|
||||||
|
|
||||||
/* Switches */
|
|
||||||
#define SW_ACTIVE 0
|
|
||||||
#define SW1 PORT3.PIDR.BIT.B2
|
|
||||||
#define SW2 PORT0.PIDR.BIT.B0
|
|
||||||
#define SW3 PORT0.PIDR.BIT.B7
|
|
||||||
#define SW1_PDR PORT3.PDR.BIT.B2
|
|
||||||
#define SW2_PDR PORT0.PDR.BIT.B0
|
|
||||||
#define SW3_PDR PORT0.PDR.BIT.B7
|
|
||||||
#define SW1_PMR PORT3.PMR.BIT.B2
|
|
||||||
#define SW2_PMR PORT0.PMR.BIT.B0
|
|
||||||
#define SW3_PMR PORT0.PMR.BIT.B7
|
|
||||||
|
|
||||||
/* LEDs */
|
|
||||||
#define LED0 PORT0.PODR.BIT.B3
|
|
||||||
#define LED1 PORT0.PODR.BIT.B5
|
|
||||||
#define LED2 PORT1.PODR.BIT.B0
|
|
||||||
#define LED3 PORT1.PODR.BIT.B1
|
|
||||||
#define LED0_PDR PORT0.PDR.BIT.B3
|
|
||||||
#define LED1_PDR PORT0.PDR.BIT.B5
|
|
||||||
#define LED2_PDR PORT1.PDR.BIT.B0
|
|
||||||
#define LED3_PDR PORT1.PDR.BIT.B1
|
|
||||||
|
|
||||||
/* Slave select. */
|
|
||||||
#define FLASH_CS PORT3.PDR.BIT.B1 // SSLB0
|
|
||||||
|
|
||||||
#endif /* RSKRX63N_H */
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue