4. SAMD51 Function Reference
Init Board function
BYTE DSCSAM_InitBoard (BYTE * Board_type)
This function initializes the SPI driver, BUSY GPIO, read the A/D, D/A calibration constants, read the board type and return to application.
Exit Board function
This function releases the SPI driver handle and BUSY GPIO.
Reset Board function
This function resets the SAM.
A/D functions
BYTE DSCSAM_ADSetSettings (DSCSAM_ADSETTINGS* settings)
This function configures the A/D channel(current,low & high), scan settings, A/D Trigger, A/D reference, oversampling/averaging, A/D single ended and A/D differential ended.
BYTE DSCSAM_ADSample (unsigned int* Sample)
This function executes one A/D conversion using the current board settings.
BYTE DSCSAM_ADScan (unsigned int * Sample)
This function executes one A/D scan (sample on all channels between Lowch and Highch).
double DSCSAM_ADCorrect (BYTE ad_channel, double ad_raw_voltage)
This function get the A/D raw voltage and A/D channel number and calculates the corrected A/D voltage using respective A/D channel calibration constants and return the corrected voltage to caller.
D/A functions
BYTE DSCSAM_DAConvert (BYTE Channel, unsigned int DACode, BYTE Loadcal)
This function outputs DA Code to a single D/A channel.
Digital I/O functions
BYTE DSCSAM_DIOConfig (BYTE Port, BYTE Pull, BYTE Drive, BYTE Dir)
This function sets the digital I/O port direction, pull and drive configuration for the selected port.
BYTE DSCSAM_DIOConfigAll (BYTE Pull, BYTEDrive, BYTE*Dir)
This function sets the digital I/O port directions, pull and drive configurations for all ports at once.
BYTE DSCSAM_DIOOutputByte (BYTE Port, BYTE Data)
This function outputs the specified data to the specified port. The data is 8 bits for ports A and 5 bits for port B.
BYTE DSCSAM_DIOInputByte (BYTE Port, BYTE* Data)
This function reads in the data from the specified port and returns it in the location specified by the pointer to data.
BYTE DSCSAM_DIOBitConfig (BYTE Port, BYTE Bit, BYTE Pull, BYTE Drive, BYTE Dir)
This function sets the digital I/O bit direction, pull and drive configuration for the selected port bit.
BYTE DSCSAM_DIOOutputBit (BYTE Port, BYTE Bit, BYTE Value)
This function outputs a single bit to an output port. The other bits remain at their current values.
BYTE DSCSAM_DIOInputBit (BYTE Port, BYTE Bit, BYTE * Value)
This function reads in the specified bit from the specified port and returns it in the location specified by the pointer to data.
Special functions
BYTE DSCSAM_WLANControl (BYTE Value)
This function controls the minicard WLAN specific to Jetson carrier.
BYTE DSCSAM_FANControl (BYTE Value)
This function controls the Fan specific to Jetson carrier.
BYTE DSCSAM_LTEControl (BYTE Value)
This function controls the LTE modem specific to Jetson carrier.
BYTE DSCSAM_LEDControl (BYTE Value)
This function controls the User LED specific to Jetson carrier.
BYTE DSCSAM_CAMERAControl (BYTE Value)
This function controls the camera specific to Jetson carrier.
Serial Port functions
BYTE DSCSAM_SerialPortConfig (BYTE Mode,BYTE Port)
This function configures the serial port mode.
Flash functions
BYTE DSCSAM_FLASHWrite (int Address, BYTE Data)
This function writes the data into user specified flash address
BYTE DSCSAM_FLASHRead (int Address, BYTE * Data)
This function read the data from user specified flash address
Temperature functions
BYTE DSCSAM_TemperatureSensorRead (int* Data)
This function read the SAM device temperature.
Serial Number functions
BYTE DSCSAM_SerialNumberRead (int* SerialNumber)
This function read the SAM device serial number (128 bit).
Board Type Identification and Firmware revision functions
BYTE DSCSAM_BoardType (BYTE * Board_type)
This function read the board type.
BYTE DSCSAM_FirmwareRevision (BYTE * Rev_ID)
This function reads the firmware revision ID.
Last updated