Driver API for SERCOM (plib_sercom0_i2c_host.h) More...
Macros | |
| #define | I2C_CLIENT_ERROR_BUSERR SERCOM_I2CS_STATUS_BUSERR_Msk |
| Bus error detected on the I2C bus. | |
| #define | I2C_CLIENT_ERROR_COLL SERCOM_I2CS_STATUS_COLL_Msk |
| Collision detected on the I2C bus. | |
| #define | I2C_CLIENT_ERROR_LOWTOUT SERCOM_I2CS_STATUS_LOWTOUT_Msk |
| SCL low timeout error detected. | |
| #define | I2C_CLIENT_ERROR_SEXTTOUT SERCOM_I2CS_STATUS_SEXTTOUT_Msk |
| Slave SCL extend timeout error detected. | |
| #define | I2C_CLIENT_ERROR_ALL (I2C_CLIENT_ERROR_BUSERR | I2C_CLIENT_ERROR_COLL | I2C_CLIENT_ERROR_LOWTOUT | I2C_CLIENT_ERROR_SEXTTOUT) |
| Mask for all I2C client error conditions. | |
| #define | SERCOM_SPI_BAUD_MAX (0xFFU) |
| Maximum value for the SPI baud rate register. | |
| #define | USART_ERROR_NONE 0U |
| Error status when no error has occurred. | |
| #define | USART_ERROR_PARITY SERCOM_USART_INT_STATUS_PERR_Msk |
| Error status when a parity error has occurred. | |
| #define | USART_ERROR_FRAMING SERCOM_USART_INT_STATUS_FERR_Msk |
| Error status when a framing error has occurred. | |
| #define | USART_ERROR_OVERRUN SERCOM_USART_INT_STATUS_BUFOVF_Msk |
| Error status when an overrun error has occurred. | |
| #define | USART_ERROR_COLLISION SERCOM_USART_INT_STATUS_COLL_Msk |
| Error status when a collision detection has occurred. | |
Typedefs | |
| typedef void(* | SERCOM_INTERRUPT_HANDLER) (void) |
| Function pointer type for SERCOM1 interrupt handlers. | |
| typedef void(* | SERCOM_I2C_CALLBACK_HANDLER) (void) |
| Function pointer type for SERCOM I2C event callback handler. | |
| typedef void(* | SERCOM_SPI_CALLBACK) (uint8_t intr) |
| Callback function type for SPI interrupts. | |
| typedef uint16_t | USART_ERROR |
| Type for representing USART error status. | |
| typedef void(* | SERCOM_USART_CALLBACK_HANDLER) (USART_EVENT event) |
| Function pointer type for SERCOM USART event callback handler. | |
Enumerations | |
| enum | I2C_OPMODE { CLIENT_MODE = 0x4U , HOST_MODE = 0x5U } |
| I2C operating mode selection. More... | |
| enum | I2C_HOST_HWREG_STATUS { I2C_HOST_HWREG_OK = 0 , I2C_HOST_HWREG_ERROR , I2C_HOST_HWREG_INVALID_PARAM , I2C_HOST_HWREG_TIMEOUT , I2C_HOST_HWREG_BUSY , I2C_HOST_HWREG_UNSUPPORTED } |
| Status codes for USART hardware register operations. More... | |
| enum | I2C_HOST_EVENT { I2C_HOST_EVENT_BUS_ERROR = 1U , I2C_HOST_EVENT_ARBITRATION_LOST = 2U , I2C_HOST_EVENT_NACK = 4U , I2C_HOST_EVENT_TRANSFER = 8U } |
| I2C interrupt event codes. More... | |
| enum | I2C_HOST_INTERRUPT { HOST_ON_BUS_INTERRUPT = SERCOM_I2CM_INTENSET_MB_Msk , CLIENT_ON_BUS_INTERRUPT = SERCOM_I2CM_INTENSET_SB_Msk , ERROR_INTERRUPT = SERCOM_I2CM_INTENSET_ERROR_Msk , HOST_INTERRUPT_ALL = SERCOM_I2CM_INTENSET_Msk } |
| I2C Interrupts selection. More... | |
| enum | I2C_HOST_TRANSFER_SPEED_MODE { I2C_HOST_STANDARD_MODE = 0UL , I2C_HOST_FAST_MODE = 0UL , I2C_HOST_FAST_MODE_PLUS = 1UL , I2C_HOST_HIGH_SPEED_MODE = 2UL } |
| I2C Speed mode selection. More... | |
| enum | I2C_HOST_ACK_ACTION { I2C_HOST_SEND_ACK = 0 , I2C_HOST_SEND_NACK = 1 } |
| Acknowledge Action selection. More... | |
| enum | I2C_HOST_SDA_HOLD_TIME { I2C_HOST_HOLD_TIME_DISABLE = 0x0 , I2C_HOST_HOLD_TIME_75NS = 0x1 , I2C_HOST_HOLD_TIME_450NS = 0x2 , I2C_HOST_HOLD_TIME_600NS = 0x3 } |
| SDA Hold time selection. More... | |
| enum | I2C_HOST_SCL_CLK_STRETCH_MODE { SLC_STRETCH_BEFORE_OR_AFTER_ACK = 0 , SLC_STRETCH_ONLY_AFTER_ACK = 1 } |
| Selection for stretching SCL for software interaction. More... | |
| enum | I2C_CLIENT_DIR { I2C_CLIENT_DIR_WRITE = 0 , I2C_CLIENT_DIR_READ = 1 } |
| I2C client transfer direction. More... | |
| enum | I2C_CLIENT_ACK_STATUS { I2C_CLIENT_ACK_RECEIVED = 0 , I2C_CLIENT_NACK_RECEIVED = 1 } |
| ACK/NACK status for last data packet sent. More... | |
| enum | I2C_CLIENT_COMMAND { I2C_CLIENT_COMMAND_SEND_ACK = 0 , I2C_CLIENT_COMMAND_SEND_NAK , I2C_CLIENT_COMMAND_RECEIVE_ACK_NAK , I2C_CLIENT_COMMAND_WAIT_FOR_START } |
| I2C client command actions. More... | |
| enum | I2C_CLIENT_TRANSFER_EVENT { I2C_CLIENT_TRANSFER_EVENT_NONE = 0 , I2C_CLIENT_TRANSFER_EVENT_ADDR_MATCH , I2C_CLIENT_TRANSFER_EVENT_RX_READY , I2C_CLIENT_TRANSFER_EVENT_TX_READY , I2C_CLIENT_TRANSFER_EVENT_STOP_BIT_RECEIVED , I2C_CLIENT_TRANSFER_EVENT_ERROR } |
| I2C client transfer event types. More... | |
| enum | I2C_CLIENT_INTERRUPT { I2C_CLIENT_INT_ERROR = SERCOM_I2CS_INTENSET_ERROR_Msk , I2C_CLIENT_INT_DRDY = SERCOM_I2CS_INTENSET_DRDY_Msk , I2C_CLIENT_INT_AMATCH = SERCOM_I2CS_INTENSET_AMATCH_Msk , I2C_CLIENT_INT_PREC = SERCOM_I2CS_INTENSET_PREC_Msk , I2C_CLIENT_INT_ALL = SERCOM_I2CS_INTENSET_Msk } |
| I2C Client Interrupt options. More... | |
| enum | I2C_CLIENT_INTFLAG { I2C_CLIENT_INTFLAG_PREC = SERCOM_I2CS_INTFLAG_PREC_Msk , I2C_CLIENT_INTFLAG_AMATCH = SERCOM_I2CS_INTFLAG_AMATCH_Msk , I2C_CLIENT_INTFLAG_DRDY = SERCOM_I2CS_INTFLAG_DRDY_Msk , I2C_CLIENT_INTFLAG_ERROR = SERCOM_I2CS_INTFLAG_ERROR_Msk , I2C_CLIENT_INTFLAG_ALL = SERCOM_I2CS_INTFLAG_Msk } |
| SERCOM I2C interrupt flag bits. More... | |
| enum | SPI_HWREG_STATUS { SPI_HWREG_OK = 0 , SPI_HWREG_ERROR , SPI_HWREG_INVALID_PARAM , SPI_HWREG_TIMEOUT , SPI_HWREG_BUSY , SPI_HWREG_UNSUPPORTED } |
| Status codes for SPI hardware register operations. More... | |
| enum | SPI_OPERATING_MODE { SPI_CLIENT_MODE = 2U , SPI_HOST_MODE = 3U } |
| SPI operating modes. More... | |
| enum | SERCOM_SPI_CHSIZE { SPI_CHSIZE_8BIT = SERCOM_SPI_CTRLB_CHSIZE(0U) , SPI_CHSIZE_9BIT = SERCOM_SPI_CTRLB_CHSIZE(1U) } |
| SPI character size options. More... | |
| enum | SPI_ADDRESS_MODE { SPI_AMODE_MASK = SERCOM_SPI_CTRLB_AMODE(0) , SPI_AMODE_2ADDRS = SERCOM_SPI_CTRLB_AMODE(1) , SPI_AMODE_RANGE = SERCOM_SPI_CTRLB_AMODE(2) } |
| SPI address mode options. More... | |
| enum | SPI_FRAME_FORMAT { SPI_FRAME_FORMAT_SPI = SERCOM_SPI_CTRLA_FORM(0) , SPI_FRAME_FORMAT_SPI_ADDR = SERCOM_SPI_CTRLA_FORM(2) } |
| SPI frame format options. More... | |
| enum | SPI_DATAIN_PIN { SPI_DI_PAD0 = SERCOM_SPI_CTRLA_DIPO(0) , SPI_DI_PAD1 = SERCOM_SPI_CTRLA_DIPO(1) , SPI_DI_PAD2 = SERCOM_SPI_CTRLA_DIPO(2) , SPI_DI_PAD3 = SERCOM_SPI_CTRLA_DIPO(3) } |
| Enumeration of SERCOM SPI data input (DI) pin configurations. More... | |
| enum | SPI_DATAOUT_PIN { SPI_DO_PAD0_SCK_PAD1_SS_PAD2 = SERCOM_SPI_CTRLA_DOPO(0) , SPI_DO_PAD2_SCK_PAD3_SS_PAD1 = SERCOM_SPI_CTRLA_DOPO(1) , SPI_DO_PAD3_SCK_PAD1_SS_PAD2 = SERCOM_SPI_CTRLA_DOPO(2) , SPI_DO_PAD0_SCK_PAD3_SS_PAD1 = SERCOM_SPI_CTRLA_DOPO(3) } |
| Enumeration of possible SERCOM SPI data output pin configurations. More... | |
| enum | SPI_INTERRUPT_SOURCE { SPI_INTERRUPT_NONE = 0U , SPI_INTERRUPT_DRE = SERCOM_SPI_INTENSET_DRE_Msk , SPI_INTERRUPT_TXC = SERCOM_SPI_INTENSET_TXC_Msk , SPI_INTERRUPT_RXC = SERCOM_SPI_INTENSET_RXC_Msk , SPI_INTERRUPT_SSL = SERCOM_SPI_INTENSET_SSL_Msk , SPI_INTERRUPT_ERROR = SERCOM_SPI_INTENSET_ERROR_Msk , SPI_INTERRUPT_ALL = SERCOM_SPI_INTENSET_Msk } |
| SPI interrupt sources. More... | |
| enum | SPI_INTERRUPT_FLAG { SPI_FLAG_ERROR = SERCOM_SPI_INTFLAG_ERROR_Msk , SPI_FLAG_SSL = SERCOM_SPI_INTFLAG_SSL_Msk , SPI_FLAG_TXC = SERCOM_SPI_INTFLAG_TXC_Msk , SPI_FLAG_DRE = SERCOM_SPI_INTFLAG_DRE_Msk , SPI_FLAG_RXC = SERCOM_SPI_INTFLAG_RXC_Msk , SPI_FLAG_ALL = SERCOM_SPI_INTFLAG_Msk } |
| SPI interrupt flags. More... | |
| enum | USART_HWREG_STATUS { USART_HWREG_OK = 0 , USART_HWREG_ERROR , USART_HWREG_INVALID_PARAM , USART_HWREG_TIMEOUT , USART_HWREG_BUSY , USART_HWREG_UNSUPPORTED } |
| Status codes for USART hardware register operations. More... | |
| enum | USART_OPMODE { USART_EXT = 0 , USART_INT = 1 } |
| USART operating mode selection. More... | |
| enum | USART_CHARSIZE { USART_DATA_8_BIT = 0 , USART_DATA_9_BIT = 1 , USART_DATA_5_BIT = 5 , USART_DATA_6_BIT = 6 , USART_DATA_7_BIT = 7 } |
| USART character size selection. More... | |
| enum | USART_FRAME_FORMAT { USART_FRAME = 0 , USART_FRAME_WITH_PARITY = 1 } |
| USART frame format selection. More... | |
| enum | USART_PARITY_MODE { USART_EVEN_PARITY = 0 , USART_ODD_PARITY = 1 } |
| USART parity mode selection. More... | |
| enum | USART_COMM_MODE { USART_ASYNC_MODE = 0 , USART_SYNC_MODE = 1 } |
| USART communication mode selection. More... | |
| enum | USART_STOPBITS { USART_STOP_1_BIT = 0 , USART_STOP_2_BIT = 1 } |
| USART stop bits selection. More... | |
| enum | USART_DATA_ORDER { USART_MSB_FIRST = 0 , USART_LSB_FIRST = 1 } |
| USART data order selection. More... | |
| enum | USART_RXDATA_PINOUT { USART_RX_PAD0 = 0 , USART_RX_PAD1 = 1 , USART_RX_PAD2 = 2 , USART_RX_PAD3 = 3 } |
| USART RX data pinout selection. More... | |
| enum | USART_TXDATA_PINOUT { USART_TX_PAD0 = 0 , USART_TX_PAD2 = 1 , USART_TX_PAD0_WITH_RTS_CTS = 2 , USART_TX_PAD0_WITH_TE = 3 } |
| USART TX data pinout selection. More... | |
| enum | USART_EVENT { USART_EVENT_REGISTER_EMPTY = 0 , USART_EVENT_TRANSMIT_COMPLETE , USART_EVENT_RECEIVE_COMPLETE , USART_EVENT_ERROR } |
| USART interrupt event list. More... | |
Functions | |
| void | SERCOM0_I2CS_ResetSoftware (void) |
| Resets the SERCOM0 I2C client peripheral. | |
| void | SERCOM0_I2CS_Enable (void) |
| Enables the SERCOM0 I2C client peripheral. | |
| void | SERCOM0_I2CS_Disable (void) |
| Disables the SERCOM0 I2C client peripheral. | |
| void | SERCOM0_I2CS_SetOperatingMode (void) |
| Sets up the SERCOM0 I2C client mode. | |
| void | SERCOM0_I2CS_Set7bitAddress (uint8_t addr) |
| Sets the I2C client address. | |
| void | SERCOM0_I2CS_Set7bitAddressMask (uint8_t addr_mask) |
| Sets the I2C client address mask. | |
| void | SERCOM0_I2CS_SetGeneralCall (bool value) |
| Enables or disables general call address recognition. | |
| uint8_t | SERCOM0_I2CS_ReceiveData (void) |
| Reads a byte of data from the I2C client. | |
| void | SERCOM0_I2CS_SendData (uint8_t data) |
| Writes a byte of data to the I2C client. | |
| uint32_t | SERCOM0_I2CS_GetError (void) |
| Gets and clears error status for the I2C client. | |
| I2C_CLIENT_DIR | SERCOM0_I2CS_GetTransferDirection (void) |
| Gets the current transfer direction (read/write). | |
| I2C_CLIENT_ACK_STATUS | SERCOM0_I2CS_GetLastByteAckStatus (void) |
| Gets the ACK/NACK status for the last data packet sent. | |
| void | SERCOM0_I2CS_SetCommand (I2C_CLIENT_COMMAND command) |
| Sets a command for the I2C client. | |
| I2C_CLIENT_TRANSFER_EVENT | SERCOM0_I2CS_GetBusStatus (void) |
| Get current I2C bus status for SERCOM0. | |
| void | SERCOM0_I2CS_EnableInterrupts (I2C_CLIENT_INTERRUPT interrupts) |
| Enables specific I2C client interrupts. | |
| void | SERCOM0_I2CS_DisableInterrupts (I2C_CLIENT_INTERRUPT interrupts) |
| Disables specific I2C client interrupts. | |
| void | SERCOM0_I2CS_ClearInterruptFlags (I2C_CLIENT_INTFLAG interrupt_flags) |
| Clears specific I2C client interrupt flags. | |
| void | SERCOM0_I2CM_Enable (void) |
| Enables the SERCOM0 I2C peripheral. | |
| void | SERCOM0_I2CM_Disable (void) |
| Disables the SERCOM0 I2C peripheral. | |
| void | SERCOM0_I2CM_SetTransferSpeed (I2C_HOST_TRANSFER_SPEED_MODE transfer_speed) |
| Sets the I2C transfer speed mode for SERCOM0. | |
| void | SERCOM0_I2CM_SetIdle (void) |
| Sets the SERCOM0 I2C peripheral to idle state. | |
| void | SERCOM0_I2CM_ResetSoftware (void) |
| Performs a software reset of the SERCOM0 I2C peripheral. | |
| void | SERCOM0_I2CM_EnableSmartMode (bool smart_mode) |
| Enables or disables Smart Mode for SERCOM0 I2C. | |
| void | SERCOM0_I2CM_SetOperatingMode (void) |
| Sets the operating mode for SERCOM0 I2C. | |
| void | SERCOM0_I2CM_SetSDAHoldTime (I2C_HOST_SDA_HOLD_TIME hold_time) |
| Sets the SDA hold time for SERCOM0 I2C. | |
| void | SERCOM0_I2CM_SetSCLCLockStretchMode (I2C_HOST_SCL_CLK_STRETCH_MODE clock_stretch_mode) |
| Sets the SCL clock stretch mode for SERCOM0 I2C. | |
| I2C_HOST_HWREG_STATUS | SERCOM0_I2CM_SetBaudRate (uint32_t srcClkFreq, uint32_t i2cClkSpeed) |
| Sets the SERCOM0 I2C baud rate. | |
| void | SERCOM0_I2CM_SetAckAction (I2C_HOST_ACK_ACTION ack_action) |
| Sets the ACK action for SERCOM0 I2C. | |
| void | SERCOM0_I2CM_SendAddress (uint32_t address, bool direction) |
| Sends an I2C address on the SERCOM0 bus. | |
| bool | SERCOM0_I2CM_BusIsIdle (void) |
| Checks if the SERCOM0 I2C bus is idle. | |
| void | SERCOM0_I2CM_SendStop (void) |
| Sends a STOP condition on the SERCOM0 I2C bus. | |
| void | SERCOM0_I2CM_SendData (uint8_t data) |
| Sends a data byte on the SERCOM0 I2C bus. | |
| uint8_t | SERCOM0_I2CM_ReceiveData (void) |
| Receives a data byte from the SERCOM0 I2C bus. | |
| uint8_t | SERCOM0_I2CM_GetSyncBusyStatus (void) |
| Gets the synchronization busy status for SERCOM0 I2C. | |
| void | SERCOM0_I2CM_EnableInterrupts (I2C_HOST_INTERRUPT interrupts) |
| Enables specific SERCOM0 I2C interrupts. | |
| void | SERCOM0_I2CM_DisableInterrupts (I2C_HOST_INTERRUPT interrupts) |
| Disables specific SERCOM0 I2C interrupts. | |
| void | SERCOM0_I2CM_ClearInterruptFlag (I2C_HOST_INTERRUPT interrupt_flag) |
| Clears specific SERCOM0 I2C interrupt flags. | |
| void | SERCOM0_I2CM_SetCallbackHandler (SERCOM_I2C_CALLBACK_HANDLER callback) |
| Sets the callback handler for SERCOM0 I2C events. | |
| void | SERCOM0_I2CM_SetInterruptHandler (void) |
| Assigns the interrupt handler for SERCOM0 I2C. | |
| uint32_t | SERCOM0_I2CM_GetBusStatus (void) |
| Gets SERCOM0 I2C bus status, reads the status register. | |
| void | SERCOM0_SPI_Enable (void) |
| Enables the SERCOM0 SPI peripheral. | |
| void | SERCOM0_SPI_Disable (void) |
| Disables the SERCOM0 SPI peripheral. | |
| void | SERCOM0_SPI_ResetSoftware (void) |
| Performs a software reset of the SERCOM0 SPI peripheral. | |
| void | SERCOM0_SPI_EnableReceiver (void) |
| Enables the SPI receiver. | |
| void | SERCOM0_SPI_DisableReceiver (void) |
| Disables the SPI receiver. | |
| SPI_HWREG_STATUS | SERCOM0_SPI_SetBusSpeed (uint32_t bus_speed, uint32_t clk_frequency) |
| Sets the SPI bus speed. | |
| uint32_t | SERCOM0_SPI_GetBusSpeed (uint32_t clk_frequency) |
| Returns the SPI bus speed. | |
| void | SERCOM0_SPI_SetDataOrder (bool lsb_first) |
| Sets the SPI data order. | |
| void | SERCOM0_SPI_SetClockPolarity (bool cpol_high) |
| Sets the SPI clock polarity. | |
| void | SERCOM0_SPI_SetClockPhase (bool cpha_trailing) |
| Sets the SPI clock phase. | |
| void | SERCOM0_SPI_SetOperatingMode (SPI_OPERATING_MODE mode) |
| Sets the SPI operating mode. | |
| void | SERCOM0_SPI_SetCharacterSize (SERCOM_SPI_CHSIZE chsize) |
| Sets the character size for the SERCOM0 SPI module. | |
| void | SERCOM0_SPI_SetPinOut (SPI_DATAIN_PIN dipo, SPI_DATAOUT_PIN dopo) |
| Set SERCOM0 SPI data in (DIPO) and data out (DOPO) pinout. | |
| void | SERCOM0_SPI_Send (uint16_t data) |
| Writes data to the SPI bus. | |
| uint16_t | SERCOM0_SPI_Receive (void) |
| Reads data from the SPI bus. | |
| bool | SERCOM0_SPI_RxIsReady (void) |
| Checks if the SPI receive buffer is ready. | |
| bool | SERCOM0_SPI_TxIsReady (void) |
| Checks if the SPI transmit buffer is ready. | |
| void | SERCOM0_SPI_SetImmediateBufferOverflow (bool immediate) |
| Sets immediate buffer overflow behavior. | |
| bool | SERCOM0_SPI_BufferIsOverflow (void) |
| Checks for SPI buffer overflow. | |
| void | SERCOM0_SPI_ClearBufferOverflow (void) |
| Clears the SPI buffer overflow flag. | |
| void | SERCOM0_SPI_SetAddressMode (SPI_ADDRESS_MODE mode) |
| Sets the SPI address mode. | |
| void | SERCOM0_SPI_SetFrameFormat (SPI_FRAME_FORMAT form) |
| Sets the SPI frame format. | |
| void | SERCOM0_SPI_SetAddress (uint8_t addr) |
| Sets the SPI client address for address recognition. | |
| void | SERCOM0_SPI_SetAddressMask (uint8_t mask) |
| Sets the SPI address mask for address recognition. | |
| void | SERCOM0_SPI_SetDebugStopMode (bool halt_on_debug) |
| Sets the debug stop mode behavior. | |
| void | SERCOM0_SPI_EnableHardwareSS (bool enable) |
| Enables or disables hardware slave select (SS) management. | |
| void | SERCOM0_SPI_EnableSSLowDetect (bool enable) |
| Enables or disables slave select low detect. | |
| void | SERCOM0_SPI_SetRunInStandby (bool run_stdby) |
| Sets the SPI to run in standby mode. | |
| void | SERCOM0_SPI_EnablePreload (bool enable) |
| Enables or disables SPI preload feature. | |
| void | SERCOM0_SPI_EnableInterrupt (SPI_INTERRUPT_SOURCE src) |
| Enables a specific SPI interrupt source. | |
| void | SERCOM0_SPI_DisableInterrupt (SPI_INTERRUPT_SOURCE src) |
| Disables a specific SPI interrupt source. | |
| bool | SERCOM0_SPI_InterruptFlagIsSet (SPI_INTERRUPT_FLAG flag) |
| Checks if the specified SPI interrupt flag is set. | |
| void | SERCOM0_SPI_ClearInterruptFlag (SPI_INTERRUPT_FLAG flag) |
| Clears the specified SPI interrupt flag. | |
| void | SERCOM0_SPI_SetCallbackHandler (SERCOM_SPI_CALLBACK cb) |
| Registers a callback function for SPI interrupts. | |
| void | SERCOM0_SPI_SetInterruptHandler (void) |
| Assigns the interrupt handler for SERCOM0 SPI. | |
| void | SERCOM0_USART_Enable (void) |
| Enables the SERCOM USART peripheral. | |
| void | SERCOM0_USART_Disable (void) |
| Disables the SERCOM USART peripheral. | |
| void | SERCOM0_USART_EnableTransmitter (void) |
| Enables the USART transmitter. | |
| void | SERCOM0_USART_DisableTransmitter (void) |
| Disables the USART transmitter. | |
| void | SERCOM0_USART_EnableReceiver (void) |
| Enables the USART receiver. | |
| void | SERCOM0_USART_DisableReceiver (void) |
| Disables the USART receiver. | |
| void | SERCOM0_USART_SetOperatingMode (USART_OPMODE mode) |
| Sets the USART operating mode. | |
| void | SERCOM0_USART_SetCommunicationMode (USART_COMM_MODE comm_mode) |
| Sets the USART communication mode. | |
| void | SERCOM0_USART_SetTxDataPinout (USART_TXDATA_PINOUT tx_pinout) |
| Sets the USART TX data pinout. | |
| void | SERCOM0_USART_SetRxDataPinout (USART_RXDATA_PINOUT rx_pinout) |
| Sets the USART RX data pinout. | |
| void | SERCOM0_USART_SetDataSize (USART_CHARSIZE char_size) |
| Sets the USART data size. | |
| void | SERCOM0_USART_SetFrameFormat (USART_FRAME_FORMAT frame_format) |
| Sets the USART frame format. | |
| void | SERCOM0_USART_SetParityMode (USART_PARITY_MODE parity) |
| Sets the USART parity mode. | |
| void | SERCOM0_USART_SetStopBits (USART_STOPBITS stop_bits) |
| Sets the USART stop bits. | |
| void | SERCOM0_USART_SetDataOrder (USART_DATA_ORDER data_order) |
| Sets the USART data order. | |
| USART_HWREG_STATUS | SERCOM0_USART_SetBaudrate (uint32_t baud, uint32_t clk_frequency) |
| Sets the USART baud rate. | |
| void | SERCOM0_USART_DisableRxCompleteInterrupt (void) |
| Disables the receive complete interrupt. | |
| void | SERCOM0_USART_EnableRxCompleteInterrupt (void) |
| Enables the receive complete interrupt. | |
| void | SERCOM0_USART_DisableTxCompleteInterrupt (void) |
| Disables the transmit complete interrupt. | |
| void | SERCOM0_USART_EnableTxCompleteInterrupt (void) |
| Enables the transmit complete interrupt. | |
| void | SERCOM0_USART_DisableDataRegEmptyInterrupt (void) |
| Disables the data register empty interrupt. | |
| void | SERCOM0_USART_EnableDataRegEmptyInterrupt (void) |
| Enables the data register empty interrupt. | |
| void | SERCOM0_USART_DisableErrorInterrupt (void) |
| Disables the error interrupt. | |
| void | SERCOM0_USART_EnableErrorInterrupt (void) |
| Enables the error interrupt. | |
| void | SERCOM0_USART_EnableCollisionDetection (bool collision_detection) |
| Enables or disables collision detection. | |
| void | SERCOM0_USART_Send (uint8_t data) |
| Sends a byte of data via USART. | |
| uint8_t | SERCOM0_USART_Receive (void) |
| Receives a byte of data from USART. | |
| void | SERCOM0_USART_Send9Bit (uint16_t data) |
| Sends 9-bit data via USART. | |
| uint16_t | SERCOM0_USART_Receive9Bit (void) |
| Receives 9-bit data from USART. | |
| bool | SERCOM0_USART_TxIsReady (void) |
| Checks if the USART transmitter is ready. | |
| bool | SERCOM0_USART_RxIsReady (void) |
| Checks if the USART receiver is ready. | |
| bool | SERCOM0_USART_TxIsDone (void) |
| Checks if the USART transmission is complete. | |
| USART_ERROR | SERCOM0_USART_ErrorGet (void) |
| Gets the current USART error status and clears it. | |
| void | SERCOM0_USART_SetCallbackHandler (SERCOM_USART_CALLBACK_HANDLER callback) |
| Registers callback for the USART interrupt events. | |
| void | SERCOM0_USART_ResetSoftware (void) |
| Performs a software reset of the USART peripheral. | |
| void | SERCOM0_USART_SetInterruptHandler (void) |
| Assigns the interrupt handler for SERCOM0 USART. | |
Variables | |
| volatile SERCOM_INTERRUPT_HANDLER | SERCOM0_InterruptHandler |
| Interrupt handler for SERCOM0 peripheral. | |
Driver API for SERCOM (plib_sercom0_i2c_host.h)
Driver API for SERCOM (plib_sercom0_spi.h)
| #define I2C_CLIENT_ERROR_ALL (I2C_CLIENT_ERROR_BUSERR | I2C_CLIENT_ERROR_COLL | I2C_CLIENT_ERROR_LOWTOUT | I2C_CLIENT_ERROR_SEXTTOUT) |
Mask for all I2C client error conditions.
| #define I2C_CLIENT_ERROR_BUSERR SERCOM_I2CS_STATUS_BUSERR_Msk |
Bus error detected on the I2C bus.
| #define I2C_CLIENT_ERROR_COLL SERCOM_I2CS_STATUS_COLL_Msk |
Collision detected on the I2C bus.
| #define I2C_CLIENT_ERROR_LOWTOUT SERCOM_I2CS_STATUS_LOWTOUT_Msk |
SCL low timeout error detected.
| #define I2C_CLIENT_ERROR_SEXTTOUT SERCOM_I2CS_STATUS_SEXTTOUT_Msk |
Slave SCL extend timeout error detected.
| #define SERCOM_SPI_BAUD_MAX (0xFFU) |
Maximum value for the SPI baud rate register.
| #define USART_ERROR_COLLISION SERCOM_USART_INT_STATUS_COLL_Msk |
Error status when a collision detection has occurred.
| #define USART_ERROR_FRAMING SERCOM_USART_INT_STATUS_FERR_Msk |
Error status when a framing error has occurred.
| #define USART_ERROR_NONE 0U |
Error status when no error has occurred.
| #define USART_ERROR_OVERRUN SERCOM_USART_INT_STATUS_BUFOVF_Msk |
Error status when an overrun error has occurred.
| #define USART_ERROR_PARITY SERCOM_USART_INT_STATUS_PERR_Msk |
Error status when a parity error has occurred.
| SERCOM_I2C_CALLBACK_HANDLER |
Function pointer type for SERCOM I2C event callback handler.
| SERCOM_INTERRUPT_HANDLER |
Function pointer type for SERCOM1 interrupt handlers.
This typedef defines a function pointer for interrupt handlers associated with SERCOM. The handler function must take no parameters and return void.
| SERCOM_SPI_CALLBACK |
Callback function type for SPI interrupts.
| intr | The interrupt source that triggered the callback. |
| SERCOM_USART_CALLBACK_HANDLER |
Function pointer type for SERCOM USART event callback handler.
This typedef defines a callback function type that is called when a USART event occurs. The callback receives a single parameter indicating the event type.
| event | The USART event that triggered the callback. |
Type for representing USART error status.
| enum I2C_CLIENT_COMMAND |
| enum I2C_CLIENT_DIR |
| enum I2C_CLIENT_INTERRUPT |
I2C Client Interrupt options.
| enum I2C_CLIENT_INTFLAG |
I2C client transfer event types.
| enum I2C_HOST_ACK_ACTION |
| enum I2C_HOST_EVENT |
Status codes for USART hardware register operations.
| enum I2C_HOST_INTERRUPT |
I2C Speed mode selection.
| enum I2C_OPMODE |
| enum SERCOM_SPI_CHSIZE |
| enum SPI_ADDRESS_MODE |
| enum SPI_DATAIN_PIN |
Enumeration of SERCOM SPI data input (DI) pin configurations.
This enum specifies the mapping of the SPI data input (DI) signal to SERCOM PADs. The DI signal corresponds to:
The value programmed into the SERCOM_SPI_CTRLA_DIPO register determines which PAD is used for DI.
| Enumerator | |
|---|---|
| SPI_DI_PAD0 | |
| SPI_DI_PAD1 | |
| SPI_DI_PAD2 | |
| SPI_DI_PAD3 | |
| enum SPI_DATAOUT_PIN |
Enumeration of possible SERCOM SPI data output pin configurations.
This enum defines the mapping of SPI data output (MOSI/MISO), clock (SCK), and slave select (SS) pins to SERCOM PADs for both Host and Client modes. The mapping depends on the value programmed into the SERCOM_SPI_CTRLA_DOPO register.
| Enumerator | |
|---|---|
| SPI_DO_PAD0_SCK_PAD1_SS_PAD2 | |
| SPI_DO_PAD2_SCK_PAD3_SS_PAD1 | |
| SPI_DO_PAD3_SCK_PAD1_SS_PAD2 | |
| SPI_DO_PAD0_SCK_PAD3_SS_PAD1 | |
| enum SPI_FRAME_FORMAT |
| enum SPI_HWREG_STATUS |
| enum SPI_INTERRUPT_FLAG |
| enum SPI_INTERRUPT_SOURCE |
| enum SPI_OPERATING_MODE |
| enum USART_CHARSIZE |
| enum USART_COMM_MODE |
| enum USART_DATA_ORDER |
| enum USART_EVENT |
| enum USART_FRAME_FORMAT |
| enum USART_HWREG_STATUS |
Status codes for USART hardware register operations.
| enum USART_OPMODE |
| enum USART_PARITY_MODE |
| enum USART_RXDATA_PINOUT |
| enum USART_STOPBITS |
| enum USART_TXDATA_PINOUT |
| bool SERCOM0_I2CM_BusIsIdle | ( | void | ) |
Checks if the SERCOM0 I2C bus is idle.
| None. |
| void SERCOM0_I2CM_ClearInterruptFlag | ( | I2C_HOST_INTERRUPT | interrupt_flag | ) |
Clears specific SERCOM0 I2C interrupt flags.
| interrupt_flag | - Bitmask specifying which interrupt flags to clear. |
| void SERCOM0_I2CM_Disable | ( | void | ) |
Disables the SERCOM0 I2C peripheral.
| None. |
| void SERCOM0_I2CM_DisableInterrupts | ( | I2C_HOST_INTERRUPT | interrupts | ) |
Disables specific SERCOM0 I2C interrupts.
| interrupts | - Bitmask specifying which interrupts to disable. |
| void SERCOM0_I2CM_Enable | ( | void | ) |
Enables the SERCOM0 I2C peripheral.
| None. |
| void SERCOM0_I2CM_EnableInterrupts | ( | I2C_HOST_INTERRUPT | interrupts | ) |
Enables specific SERCOM0 I2C interrupts.
| interrupts | - Bitmask specifying which interrupts to enable. |
| void SERCOM0_I2CM_EnableSmartMode | ( | bool | smart_mode | ) |
Enables or disables Smart Mode for SERCOM0 I2C.
| smart_mode | - true to enable, false to disable. |
| uint32_t SERCOM0_I2CM_GetBusStatus | ( | void | ) |
Gets SERCOM0 I2C bus status, reads the status register.
| None. |
| uint8_t SERCOM0_I2CM_GetSyncBusyStatus | ( | void | ) |
Gets the synchronization busy status for SERCOM0 I2C.
| None. |
| uint8_t SERCOM0_I2CM_ReceiveData | ( | void | ) |
Receives a data byte from the SERCOM0 I2C bus.
| None. |
| void SERCOM0_I2CM_ResetSoftware | ( | void | ) |
Performs a software reset of the SERCOM0 I2C peripheral.
| None. |
| void SERCOM0_I2CM_SendAddress | ( | uint32_t | address, |
| bool | direction ) |
Sends an I2C address on the SERCOM0 bus.
| address | - I2C address to send. |
| direction | - true for read, false for write. |
| void SERCOM0_I2CM_SendData | ( | uint8_t | data | ) |
Sends a data byte on the SERCOM0 I2C bus.
| data | - Data byte to send. |
| void SERCOM0_I2CM_SendStop | ( | void | ) |
Sends a STOP condition on the SERCOM0 I2C bus.
| None. |
| void SERCOM0_I2CM_SetAckAction | ( | I2C_HOST_ACK_ACTION | ack_action | ) |
Sets the ACK action for SERCOM0 I2C.
| ack_action | - ACK action configuration. |
| I2C_HOST_HWREG_STATUS SERCOM0_I2CM_SetBaudRate | ( | uint32_t | srcClkFreq, |
| uint32_t | i2cClkSpeed ) |
Sets the SERCOM0 I2C baud rate.
| srcClkFreq | - System clock frequency in Hz. |
| i2cClkSpeed | - Desired I2C clock speed in Hz. |
| void SERCOM0_I2CM_SetCallbackHandler | ( | SERCOM_I2C_CALLBACK_HANDLER | callback | ) |
Sets the callback handler for SERCOM0 I2C events.
| callback | - Function pointer to the callback handler. |
| void SERCOM0_I2CM_SetIdle | ( | void | ) |
Sets the SERCOM0 I2C peripheral to idle state.
| None. |
| void SERCOM0_I2CM_SetInterruptHandler | ( | void | ) |
Assigns the interrupt handler for SERCOM0 I2C.
| None. |
| void SERCOM0_I2CM_SetOperatingMode | ( | void | ) |
Sets the operating mode for SERCOM0 I2C.
| mode | - Operating mode (master or slave). |
| void SERCOM0_I2CM_SetSCLCLockStretchMode | ( | I2C_HOST_SCL_CLK_STRETCH_MODE | clock_stretch_mode | ) |
Sets the SCL clock stretch mode for SERCOM0 I2C.
| clock_stretch_mode | - SCL clock stretch mode configuration. |
| void SERCOM0_I2CM_SetSDAHoldTime | ( | I2C_HOST_SDA_HOLD_TIME | hold_time | ) |
Sets the SDA hold time for SERCOM0 I2C.
| hold_time | - SDA hold time configuration. |
| void SERCOM0_I2CM_SetTransferSpeed | ( | I2C_HOST_TRANSFER_SPEED_MODE | transfer_speed | ) |
Sets the I2C transfer speed mode for SERCOM0.
| transfer_speed | - Transfer speed mode (e.g., standard, fast, fastplus). |
| void SERCOM0_I2CS_ClearInterruptFlags | ( | I2C_CLIENT_INTFLAG | interrupt_flags | ) |
Clears specific I2C client interrupt flags.
| interrupt_flags | Interrupt flag mask. |
| void SERCOM0_I2CS_Disable | ( | void | ) |
Disables the SERCOM0 I2C client peripheral.
| void SERCOM0_I2CS_DisableInterrupts | ( | I2C_CLIENT_INTERRUPT | interrupts | ) |
Disables specific I2C client interrupts.
| interrupts | Interrupt mask. |
| void SERCOM0_I2CS_Enable | ( | void | ) |
Enables the SERCOM0 I2C client peripheral.
| void SERCOM0_I2CS_EnableInterrupts | ( | I2C_CLIENT_INTERRUPT | interrupts | ) |
Enables specific I2C client interrupts.
| interrupts | Interrupt mask. |
| I2C_CLIENT_TRANSFER_EVENT SERCOM0_I2CS_GetBusStatus | ( | void | ) |
Get current I2C bus status for SERCOM0.
| uint32_t SERCOM0_I2CS_GetError | ( | void | ) |
Gets and clears error status for the I2C client.
| I2C_CLIENT_ACK_STATUS SERCOM0_I2CS_GetLastByteAckStatus | ( | void | ) |
Gets the ACK/NACK status for the last data packet sent.
| I2C_CLIENT_DIR SERCOM0_I2CS_GetTransferDirection | ( | void | ) |
Gets the current transfer direction (read/write).
| uint8_t SERCOM0_I2CS_ReceiveData | ( | void | ) |
Reads a byte of data from the I2C client.
| void SERCOM0_I2CS_ResetSoftware | ( | void | ) |
Resets the SERCOM0 I2C client peripheral.
| void SERCOM0_I2CS_SendData | ( | uint8_t | data | ) |
Writes a byte of data to the I2C client.
| data | Data byte to send. |
| void SERCOM0_I2CS_Set7bitAddress | ( | uint8_t | addr | ) |
Sets the I2C client address.
| addr | 7-bit I2C address. |
| void SERCOM0_I2CS_Set7bitAddressMask | ( | uint8_t | addr_mask | ) |
Sets the I2C client address mask.
| addr_mask | 7-bit address mask. |
| void SERCOM0_I2CS_SetCommand | ( | I2C_CLIENT_COMMAND | command | ) |
Sets a command for the I2C client.
| command | Command enum value. |
| void SERCOM0_I2CS_SetGeneralCall | ( | bool | value | ) |
Enables or disables general call address recognition.
| value | true to enable, false to disable. |
| void SERCOM0_I2CS_SetOperatingMode | ( | void | ) |
Sets up the SERCOM0 I2C client mode.
| bool SERCOM0_SPI_BufferIsOverflow | ( | void | ) |
Checks for SPI buffer overflow.
This function indicates whether a buffer overflow condition has occurred.
| void SERCOM0_SPI_ClearBufferOverflow | ( | void | ) |
Clears the SPI buffer overflow flag.
This function clears the buffer overflow condition in the SPI module.
| void SERCOM0_SPI_ClearInterruptFlag | ( | SPI_INTERRUPT_FLAG | flag | ) |
Clears the specified SPI interrupt flag.
| flag | Interrupt flag to clear. |
| void SERCOM0_SPI_Disable | ( | void | ) |
Disables the SERCOM0 SPI peripheral.
This function clears the enable bit in the SPI control register and waits for synchronization to complete.
| void SERCOM0_SPI_DisableInterrupt | ( | SPI_INTERRUPT_SOURCE | src | ) |
Disables a specific SPI interrupt source.
| src | The interrupt source to disable. |
This function disables the specified SPI interrupt.
| void SERCOM0_SPI_DisableReceiver | ( | void | ) |
Disables the SPI receiver.
This function clears the receiver enable bit and waits for synchronization to complete.
| void SERCOM0_SPI_Enable | ( | void | ) |
Enables the SERCOM0 SPI peripheral.
This function sets the enable bit in the SPI control register and waits for synchronization to complete.
| void SERCOM0_SPI_EnableHardwareSS | ( | bool | enable | ) |
Enables or disables hardware slave select (SS) management.
| enable | If true, enables hardware SS; otherwise, disables. |
| void SERCOM0_SPI_EnableInterrupt | ( | SPI_INTERRUPT_SOURCE | src | ) |
Enables a specific SPI interrupt source.
| src | The interrupt source to enable. |
This function enables the specified SPI interrupt.
| void SERCOM0_SPI_EnablePreload | ( | bool | enable | ) |
Enables or disables SPI preload feature.
| enable | If true, enables preload; otherwise, disables. |
| void SERCOM0_SPI_EnableReceiver | ( | void | ) |
Enables the SPI receiver.
This function sets the receiver enable bit and waits for synchronization to complete.
| void SERCOM0_SPI_EnableSSLowDetect | ( | bool | enable | ) |
Enables or disables slave select low detect.
| enable | If true, enables SS low detect; otherwise, disables. |
| uint32_t SERCOM0_SPI_GetBusSpeed | ( | uint32_t | clk_frequency | ) |
Returns the SPI bus speed.
| clk_frequency | The input clock frequency in Hertz (Hz) supplied to the SPI peripheral. |
This function computes and returns the actual SPI bus speed (in Hz) for the SPI peripheral.
| bool SERCOM0_SPI_InterruptFlagIsSet | ( | SPI_INTERRUPT_FLAG | flag | ) |
Checks if the specified SPI interrupt flag is set.
| flag | Interrupt flag to check. |
| uint16_t SERCOM0_SPI_Receive | ( | void | ) |
Reads data from the SPI bus.
This function reads and returns data received from the SPI bus.
| void SERCOM0_SPI_ResetSoftware | ( | void | ) |
Performs a software reset of the SERCOM0 SPI peripheral.
This function sets the software reset bit and waits for synchronization to complete.
| bool SERCOM0_SPI_RxIsReady | ( | void | ) |
Checks if the SPI receive buffer is ready.
This function indicates whether the SPI receive buffer has unread data.
| void SERCOM0_SPI_Send | ( | uint16_t | data | ) |
Writes data to the SPI bus.
| data | The 16-bit data to be transmitted. |
This function transmits the specified data over the SPI bus.
| void SERCOM0_SPI_SetAddress | ( | uint8_t | addr | ) |
Sets the SPI client address for address recognition.
| addr | The 8-bit address value for this SPI client. |
| void SERCOM0_SPI_SetAddressMask | ( | uint8_t | mask | ) |
Sets the SPI address mask for address recognition.
| mask | The 8-bit address mask value. |
| void SERCOM0_SPI_SetAddressMode | ( | SPI_ADDRESS_MODE | mode | ) |
Sets the SPI address mode.
| mode | Address mode to be set. |
| SPI_HWREG_STATUS SERCOM0_SPI_SetBusSpeed | ( | uint32_t | bus_speed, |
| uint32_t | clk_frequency ) |
Sets the SPI bus speed.
| bus_speed | Desired SPI bus speed in Hz. |
| clk_frequency | Clock frequency in Hz. |
This function calculates and sets the baud rate for the SPI peripheral. Returns SPI_HWREG_INVALID_PARAM if bus_speed is zero, clk_frequency is zero, or if bus_speed exceeds clk_frequency.
| void SERCOM0_SPI_SetCallbackHandler | ( | SERCOM_SPI_CALLBACK | cb | ) |
Registers a callback function for SPI interrupts.
| cb | Callback function to be registered. |
| void SERCOM0_SPI_SetCharacterSize | ( | SERCOM_SPI_CHSIZE | chsize | ) |
Sets the character size for the SERCOM0 SPI module.
| chsize | The desired character size. This should be a value from the SERCOM_SPI_CHSIZE enumeration (e.g., SPI_CHSIZE_8BIT or SPI_CHSIZE_9BIT). |
| void SERCOM0_SPI_SetClockPhase | ( | bool | cpha_trailing | ) |
Sets the SPI clock phase.
| cpha_trailing | If true, sets clock phase to trailing edge; otherwise, leading edge. |
| void SERCOM0_SPI_SetClockPolarity | ( | bool | cpol_high | ) |
Sets the SPI clock polarity.
| cpol_high | If true, sets clock polarity to high when idle; otherwise, low. |
| void SERCOM0_SPI_SetDataOrder | ( | bool | lsb_first | ) |
Sets the SPI data order.
| lsb_first | If true, sets data order to LSB first; otherwise, MSB first. |
| void SERCOM0_SPI_SetDebugStopMode | ( | bool | halt_on_debug | ) |
Sets the debug stop mode behavior.
| halt_on_debug | If true, halts SPI operation during debug; otherwise, continues running. |
| void SERCOM0_SPI_SetFrameFormat | ( | SPI_FRAME_FORMAT | form | ) |
Sets the SPI frame format.
| form | Frame format to be set (SPI_FRAME_FORMAT_SPI or SPI_FRAME_FORMAT_SPI_ADDR). |
| void SERCOM0_SPI_SetImmediateBufferOverflow | ( | bool | immediate | ) |
Sets immediate buffer overflow behavior.
| immediate | If true, enables immediate buffer overflow; otherwise, disables. |
| void SERCOM0_SPI_SetInterruptHandler | ( | void | ) |
Assigns the interrupt handler for SERCOM0 SPI.
| void SERCOM0_SPI_SetOperatingMode | ( | SPI_OPERATING_MODE | mode | ) |
Sets the SPI operating mode.
| mode | SPI operating mode (master, slave, etc.). |
| void SERCOM0_SPI_SetPinOut | ( | SPI_DATAIN_PIN | dipo, |
| SPI_DATAOUT_PIN | dopo ) |
Set SERCOM0 SPI data in (DIPO) and data out (DOPO) pinout.
| dipo | Data in pin selection (SPI_DATAIN_PIN). |
| dopo | Data out pin selection (SPI_DATAOUT_PIN). |
| void SERCOM0_SPI_SetRunInStandby | ( | bool | run_stdby | ) |
Sets the SPI to run in standby mode.
| run_stdby | If true, enables run in standby; otherwise, disables. |
| bool SERCOM0_SPI_TxIsReady | ( | void | ) |
Checks if the SPI transmit buffer is ready.
This function indicates whether the SPI transmit buffer is ready for new data.
| void SERCOM0_USART_Disable | ( | void | ) |
Disables the SERCOM USART peripheral.
| None. |
| void SERCOM0_USART_DisableDataRegEmptyInterrupt | ( | void | ) |
Disables the data register empty interrupt.
| None. |
| void SERCOM0_USART_DisableErrorInterrupt | ( | void | ) |
Disables the error interrupt.
| None. |
| void SERCOM0_USART_DisableReceiver | ( | void | ) |
Disables the USART receiver.
| None. |
| void SERCOM0_USART_DisableRxCompleteInterrupt | ( | void | ) |
Disables the receive complete interrupt.
| None. |
| void SERCOM0_USART_DisableTransmitter | ( | void | ) |
Disables the USART transmitter.
| None. |
| void SERCOM0_USART_DisableTxCompleteInterrupt | ( | void | ) |
Disables the transmit complete interrupt.
| None. |
| void SERCOM0_USART_Enable | ( | void | ) |
Enables the SERCOM USART peripheral.
| None. |
| void SERCOM0_USART_EnableCollisionDetection | ( | bool | collision_detection | ) |
Enables or disables collision detection.
| collision_detection | - true to enable, false to disable. |
| void SERCOM0_USART_EnableDataRegEmptyInterrupt | ( | void | ) |
Enables the data register empty interrupt.
| None. |
| void SERCOM0_USART_EnableErrorInterrupt | ( | void | ) |
Enables the error interrupt.
| None. |
| void SERCOM0_USART_EnableReceiver | ( | void | ) |
Enables the USART receiver.
| None. |
| void SERCOM0_USART_EnableRxCompleteInterrupt | ( | void | ) |
Enables the receive complete interrupt.
| None. |
| void SERCOM0_USART_EnableTransmitter | ( | void | ) |
Enables the USART transmitter.
| None. |
| void SERCOM0_USART_EnableTxCompleteInterrupt | ( | void | ) |
Enables the transmit complete interrupt.
| None. |
| USART_ERROR SERCOM0_USART_ErrorGet | ( | void | ) |
Gets the current USART error status and clears it.
| None. |
| uint8_t SERCOM0_USART_Receive | ( | void | ) |
Receives a byte of data from USART.
| None. |
| uint16_t SERCOM0_USART_Receive9Bit | ( | void | ) |
Receives 9-bit data from USART.
| None. |
| void SERCOM0_USART_ResetSoftware | ( | void | ) |
Performs a software reset of the USART peripheral.
| None. |
| bool SERCOM0_USART_RxIsReady | ( | void | ) |
Checks if the USART receiver is ready.
| None. |
| void SERCOM0_USART_Send | ( | uint8_t | data | ) |
Sends a byte of data via USART.
| data | - Byte to send. |
| void SERCOM0_USART_Send9Bit | ( | uint16_t | data | ) |
Sends 9-bit data via USART.
| data | - 9-bit data to send. |
| USART_HWREG_STATUS SERCOM0_USART_SetBaudrate | ( | uint32_t | baud, |
| uint32_t | clk_frequency ) |
Sets the USART baud rate.
| baud | - Desired baud rate. |
| clk_frequency | - Clock frequency in Hz. |
| void SERCOM0_USART_SetCallbackHandler | ( | SERCOM_USART_CALLBACK_HANDLER | callback | ) |
Registers callback for the USART interrupt events.
| callback | - Pointer to the callback function. |
| void SERCOM0_USART_SetCommunicationMode | ( | USART_COMM_MODE | comm_mode | ) |
Sets the USART communication mode.
| comm_mode | - The desired communication mode (see USART_COMM_MODE). |
| void SERCOM0_USART_SetDataOrder | ( | USART_DATA_ORDER | data_order | ) |
Sets the USART data order.
| data_order | - The desired data order (see USART_DATA_ORDER). |
| void SERCOM0_USART_SetDataSize | ( | USART_CHARSIZE | char_size | ) |
Sets the USART data size.
| char_size | - The desired character size (see USART_CHARSIZE). |
| void SERCOM0_USART_SetFrameFormat | ( | USART_FRAME_FORMAT | frame_format | ) |
Sets the USART frame format.
| frame_format | - The desired frame format (see USART_FRAME_FORMAT). |
| void SERCOM0_USART_SetInterruptHandler | ( | void | ) |
Assigns the interrupt handler for SERCOM0 USART.
| void SERCOM0_USART_SetOperatingMode | ( | USART_OPMODE | mode | ) |
Sets the USART operating mode.
| mode | - The desired operating mode (see USART_OPMODE). |
| void SERCOM0_USART_SetParityMode | ( | USART_PARITY_MODE | parity | ) |
Sets the USART parity mode.
| parity | - The desired parity mode (see USART_PARITY_MODE). |
| void SERCOM0_USART_SetRxDataPinout | ( | USART_RXDATA_PINOUT | rx_pinout | ) |
Sets the USART RX data pinout.
| rx_pinout | - The desired RX pinout (see USART_TXDATA_PINOUT). |
| void SERCOM0_USART_SetStopBits | ( | USART_STOPBITS | stop_bits | ) |
Sets the USART stop bits.
| stop_bits | - The desired number of stop bits (see USART_STOPBITS). |
| void SERCOM0_USART_SetTxDataPinout | ( | USART_TXDATA_PINOUT | tx_pinout | ) |
Sets the USART TX data pinout.
| tx_pinout | - The desired TX pinout (see USART_RXDATA_PINOUT). |
| bool SERCOM0_USART_TxIsDone | ( | void | ) |
Checks if the USART transmission is complete.
| None. |
| bool SERCOM0_USART_TxIsReady | ( | void | ) |
Checks if the USART transmitter is ready.
| None. |
|
extern |
Interrupt handler for SERCOM0 peripheral.
This variable holds the function pointer to the current interrupt handler for the SERCOM0 module. It should be assigned to a function that matches the SERCOM_INTERRUPT_HANDLER signature. The variable is declared as volatile because it may be modified by interrupt service routines.