MG32L003 Standard Peripherals Firmware Library
Data Structures | Macros | Functions
mg32l003_owire.h File Reference

This file contains all the functions prototypes for the OWIRE firmware library. More...

#include "mg32l003.h"

Go to the source code of this file.

Data Structures

struct  OWIRE_InitTypeDef
 OWIRE Init Structure definition. More...
 

Macros

#define OWIRE_DATASIZE_1BIT   0x00000000U
 
#define OWIRE_DATASIZE_8BIT   OWIRE_CR_SIZE_Msk
 
#define OWIRE_FIRSTBIT_LSB   0x00000000U
 
#define OWIRE_FIRSTBIT_MSB   OWIRE_CR_MSBFIRST_Msk
 
#define OWIRE_CLOCK_DIVIDER_1   0x00000000U
 
#define OWIRE_CLOCK_DIVIDER_2   (0x1U << OWIRE_CR_CLKDIV_Pos)
 
#define OWIRE_CLOCK_DIVIDER_4   (0x2U << OWIRE_CR_CLKDIV_Pos)
 
#define OWIRE_CLOCK_DIVIDER_16   (0x3U << OWIRE_CR_CLKDIV_Pos)
 
#define OWIRE_RDMODE_0   0x00000000U
 
#define OWIRE_RDMODE_1   OWIRE_CR_RDMODE_Msk
 
#define OWIRE_NOISE_FILTER_CLK_DIV_1   0x00000000U
 
#define OWIRE_NOISE_FILTER_CLK_DIV_2   (0x1U << OWIRE_NFCR_NFDIV_Pos)
 
#define OWIRE_NOISE_FILTER_CLK_DIV_4   (0x2U << OWIRE_NFCR_NFDIV_Pos)
 
#define OWIRE_NOISE_FILTER_CLK_DIV_8   (0x3U << OWIRE_NFCR_NFDIV_Pos)
 
#define OWIRE_NOISE_FILTER_ENABLE   (0x1U << OWIRE_NFCR_NFEN_Pos)
 
#define OWIRE_NOISE_FILTER_DISABLE   0x00000000U
 
#define OWIRE_COMMAND_INIT   (0x1U << OWIRE_CMD_CMD_Pos)
 
#define OWIRE_COMMAND_TX   (0x2U << OWIRE_CMD_CMD_Pos)
 
#define OWIRE_COMMAND_RX   (0x3U << OWIRE_CMD_CMD_Pos)
 
#define OWIRE_FLAG_ACKERROR   ((uint32_t)OWIRE_SR_ACKERR_Msk)
 
#define OWIRE_FLAG_INITDONE   ((uint32_t)OWIRE_SR_INITDONE_Msk)
 
#define OWIRE_FLAG_TXDONE   ((uint32_t)OWIRE_SR_TXDONE_Msk)
 
#define OWIRE_FLAG_RXDONE   ((uint32_t)OWIRE_SR_RXDONE_Msk)
 
#define OWIRE_IT_ACKERROR   ((uint32_t)OWIRE_INTEN_ACKERREN_Msk)
 
#define OWIRE_IT_INIT   ((uint32_t)OWIRE_INTEN_INITEN_Msk)
 
#define OWIRE_IT_TXDONE   ((uint32_t)OWIRE_INTEN_TXDONEEN_Msk)
 
#define OWIRE_IT_RXDONE   ((uint32_t)OWIRE_INTEN_RXDONEEN_Msk)
 

Functions

void OWIRE_DeInit (void)
 Deinitializes the OWIRE peripheral registers to their default reset values. More...
 
void OWIRE_Init (OWIRE_InitTypeDef *OWIRE_InitStruct)
 Initializes the OWIRE mode according to the specified parameters in the OWIRE_InitTypeDef and create the associated handler. More...
 
void OWIRE_Cmd (FunctionalState NewState)
 Enables or disables the specified OWIRE peripheral. More...
 
void OWIRE_ITConfig (uint32_t OWIRE_IT, FunctionalState NewState)
 Enables or disables the specified OWIRE interrupts. More...
 
uint8_t OWIRE_ReadData (void)
 Read one data from DATA register. More...
 
void OWIRE_WriteData (uint8_t Data)
 Write one data to DATA register. More...
 
void OWIRE_WriteCommand (uint8_t Command)
 Write command to CMD register. More...
 
FlagStatus OWIRE_GetFlagStatus (uint32_t OWIRE_FLAG)
 Checks whether the specified the OWIRE flag is set or not. More...
 
void OWIRE_ClearFlag (uint32_t OWIRE_FLAG)
 Clears the OWIRE's pending flags. More...
 
ITStatus OWIRE_GetITStatus (uint32_t OWIRE_IT)
 Checks whether the OWIRE interrupt has occurred or not. More...
 
void OWIRE_ClearITPendingBit (uint32_t OWIRE_IT)
 Clears the OWIRE's interrupt pending bits. More...
 

Detailed Description

This file contains all the functions prototypes for the OWIRE firmware library.

Author
megawin Application Team
Version
V0.0.5
Date
13-August-2024