SAMV71 Xplained Ultra Software Package 1.5

main.c File Reference

#include "board.h"
#include <USBD_Config.h>
#include <USBD_LEDs.h>
#include <CDCHIDDDriver.h>
#include <CDCDSerial.h>
#include <HIDDKeyboard.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define NO_PUSHBUTTON
#define NUM_KEYS   2
#define NUM_NORMAL_KEYS   1
#define NUM_MODIFIER_KEYS   (NUM_KEYS - NUM_NORMAL_KEYS)
#define LED_NUMLOCK   USBD_LEDOTHER
#define DATAPACKETSIZE   CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN)
#define DATABUFFERSIZE   (DATAPACKETSIZE+2)

Functions

 COMPILER_ALIGNED (32)
void USBDDriverCallbacks_ConfigurationChanged (uint8_t cfgnum)
void USBDCallbacks_RequestReceived (const USBGenericRequest *request)
void CDCDSerial_ControlLineStateChanged (uint8_t DTR, uint8_t RTS)
void HIDDKeyboardCallbacks_LedsChanged (uint8_t numLockStatus, uint8_t capsLockStatus, uint8_t scrollLockStatus)
int main (void)

Variables

const USBDDriverDescriptors cdchiddDriverDescriptors

Detailed Description

This file contains all the specific code for the usb_iad_cdc_hid project

Definition in file main.c.


Define Documentation

#define DATABUFFERSIZE   (DATAPACKETSIZE+2)

Size in bytes of the buffer used for reading data from the USB & USART

Definition at line 151 of file main.c.

#define DATAPACKETSIZE   CHIP_USB_ENDPOINTS_MAXPACKETSIZE(CDCDSerialDriverDescriptors_DATAIN)

Size in bytes of the packet used for reading data from USB

Definition at line 147 of file main.c.

#define LED_NUMLOCK   USBD_LEDOTHER

NumLock LED index.

Definition at line 144 of file main.c.

#define NUM_KEYS   2

Number of keys used in the example.

Definition at line 135 of file main.c.

#define NUM_MODIFIER_KEYS   (NUM_KEYS - NUM_NORMAL_KEYS)

Number of modifier keys.

Definition at line 141 of file main.c.

#define NUM_NORMAL_KEYS   1

Number of non-modifiers keys.

Definition at line 138 of file main.c.


Function Documentation

COMPILER_ALIGNED ( 32   ) 

Buffer for storing incoming USB data. List of pinsPushButtons to configure for the application.

Definition at line 164 of file main.c.

void HIDDKeyboardCallbacks_LedsChanged ( uint8_t  numLockStatus,
uint8_t  capsLockStatus,
uint8_t  scrollLockStatus 
)

Invoked when the status of the keyboard LEDs changes. Turns the num. lock LED on or off.

Parameters:
numLockStatus Indicates the current status of the num. lock key.
capsLockStatus Indicates the current status of the caps lock key.
scrollLockStatus Indicates the current status of the scroll lock key

Definition at line 234 of file main.c.

Here is the call graph for this function:

int main ( void   ) 

Initializes drivers and start the USB CDCHID device.

Definition at line 364 of file main.c.

Here is the call graph for this function:

void USBDCallbacks_RequestReceived ( const USBGenericRequest request  ) 

Invoked when a new SETUP request is received from the host. Forwards the request to the Mass Storage device driver handler function.

Parameters:
request Pointer to a USBGenericRequest instance.

Definition at line 206 of file main.c.

Here is the call graph for this function:

void USBDDriverCallbacks_ConfigurationChanged ( uint8_t  cfgnum  ) 

Invoked when the configuration of the device changes. Parse used endpoints.

Parameters:
cfgnum New configuration number.

Definition at line 196 of file main.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines