OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [example/] [demo_twi/] [main.c] - Diff between revs 14 and 35

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 14 Rev 35
Line 58... Line 58...
void send_twi(void);
void send_twi(void);
uint32_t hexstr_to_uint(char *buffer, uint8_t length);
uint32_t hexstr_to_uint(char *buffer, uint8_t length);
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
 * This program generates a simple dimming sequence for PWM channel 0,1,2.
 * This program provides an interactive console to communicate with TWI devices.
 *
 *
 * @note This program requires the UART and the TWI to be synthesized.
 * @note This program requires the UART and the PWM to be synthesized.
 *
 *
 * @return Irrelevant.
 * @return Irrelevant.
 **************************************************************************/
 **************************************************************************/
int main() {
int main() {
 
 
Line 99... Line 99...
 
 
  // info
  // info
  neorv32_uart_printf("This program allows to create TWI transfers by hand.\n"
  neorv32_uart_printf("This program allows to create TWI transfers by hand.\n"
                      "Type 'help' to see the help menu.\n\n");
                      "Type 'help' to see the help menu.\n\n");
 
 
  // configure TWI, second slowest clock, no IRQ
  // configure TWI, second slowest clock, no IRQ, no clock-stretching
  neorv32_twi_setup(CLK_PRSC_2048, 0);
  neorv32_twi_setup(CLK_PRSC_2048, 0, 0);
 
 
  // no active bus session yet
  // no active bus session yet
  bus_claimed = 0;
  bus_claimed = 0;
 
 
  // Main menu
  // Main menu

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.