Renesas Solution Starter Kit for RX23W
R20UT4449EG0100 Rev. 1.00
Page 57 of 64
Aug.30.19
5.7
LED Code Integration
Open the file ‘SC_Tutorial.c’. Add the following declaration to the near the top of the file:
#include
"r_smc_entry.h"
#include
"r_okaya_lcd.h"
#include
"r_cg_userdefine.h"
#include
"Config_S12AD0.h"
#include
"r_rssk_switch.h"
#include
"r_rssk_debug.h"
#include
"Config_SCI8.h"
#include
"rsskrx23wdef.h"
/* Variable for flagging user requested ADC conversion */
volatile
uint8_t g_adc_trigger
=
FALSE;
/* Prototype declaration for cb_switch_press */
static
void
cb_switch_press (
void
);
/* Prototype declaration for get_adc */
static
uint16_t get_adc(
void
);
/* Prototype declaration for lcd_display_adc */
static
void
lcd_display_adc (
const
uint16_t adc_result);
/* Prototype declaration for uart_display_adc */
static
void
uart_display_adc(
const
uint8_t gs_adc_count,
const
uint16_t adc_result);
/* Variable to store the A/D conversion count for user display */
static
uint8_t gs_adc_count
=
0;
/* Prototype declaration for led_display_count */
static
void
led_display_count(
const
uint8_t count);
Add the following highlighted code in the main function:
void
main(
void
)
{
/* Initialize the switch module */
R_SWITCH_Init();
/* Set the call back function when SW1 or SW2 is pressed */
R_SWITCH_SetPressCallback(cb_switch_press);
/* Initialize the debug LCD */
R_LCD_Init();
/* Displays the application name on the debug LCD */
R_LCD_Display(0, (uint8_t
*
)
" RSSKRX23W "
);
R_LCD_Display(1, (uint8_t
*
)
" Tutorial "
);
R_LCD_Display(2, (uint8_t
*
)
" Press Any Switch "
);
/* Start the A/D converter */
R_Config_S12AD0_Start();
/* Set up SCI8 receive buffer and callback function */
R_Config_SCI8_Serial_Receive((uint8_t
*
)
&
g_rx_char, 1);
/* Enable SCI8 operations */
R_Config_SCI8_Start();
Содержание RSSK
Страница 64: ...R20UT4449EG0100 RX23W Group ...