MINI51DE_BSP V3.02.004
The Board Support Package for Mini51DE Series MCU
Macros | Functions | Variables
i2c_software_gpio.c File Reference

MINI51 series software I2C driver source file. More...

#include <stdio.h>
#include "i2c_software_gpio.h"
Include dependency graph for i2c_software_gpio.c:

Go to the source code of this file.

Macros

#define I2C_SW_SDA   P14
 
#define I2C_SW_CLK   P15
 

Functions

int32_t I2C_SW_Open (uint32_t u32BusClock)
 Prepare to start software I2C. More...
 
int32_t I2C_SW_Send_byte (uint8_t u8Data)
 Send a byte. More...
 
int32_t I2C_SW_Send (uint8_t u8Address, uint8_t *p8Data, uint32_t u32ByteSize)
 Send data. More...
 
uint8_t I2C_SW_Get_byte (uint32_t u32Ack)
 Read a byte. More...
 
int32_t I2C_SW_Get (uint8_t u8Address, uint8_t *p8Data, uint32_t u32ByteSize)
 Read data. More...
 

Variables

uint32_t u32_I2C_SW_Delay
 

Detailed Description

MINI51 series software I2C driver source file.

Version
V0.10
Revision
4
Date
13/09/30 6:48p
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved.

Definition in file i2c_software_gpio.c.

Macro Definition Documentation

◆ I2C_SW_CLK

#define I2C_SW_CLK   P15

Definition at line 18 of file i2c_software_gpio.c.

◆ I2C_SW_SDA

#define I2C_SW_SDA   P14

Definition at line 17 of file i2c_software_gpio.c.

Function Documentation

◆ I2C_SW_Get()

int32_t I2C_SW_Get ( uint8_t  u8Address,
uint8_t *  p8Data,
uint32_t  u32ByteSize 
)

Read data.

Parameters
u8AddressI2C slave address
p8Datadata address
u32ByteSizedata length
Returns
data length

Definition at line 145 of file i2c_software_gpio.c.

Here is the call graph for this function:

◆ I2C_SW_Get_byte()

uint8_t I2C_SW_Get_byte ( uint32_t  u32Ack)

Read a byte.

Parameters
u32AckConfigure to ACK or NACK
Returns
data

Definition at line 113 of file i2c_software_gpio.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ I2C_SW_Open()

int32_t I2C_SW_Open ( uint32_t  u32BusClock)

Prepare to start software I2C.

Parameters
u32BusClockI2C Bus Clock (Hz)
Return values
0Success

Definition at line 27 of file i2c_software_gpio.c.

Here is the call graph for this function:

◆ I2C_SW_Send()

int32_t I2C_SW_Send ( uint8_t  u8Address,
uint8_t *  p8Data,
uint32_t  u32ByteSize 
)

Send data.

Parameters
u8AddressI2C slave address
p8Datadata address
u32ByteSizedata length
Returns
data length

Definition at line 76 of file i2c_software_gpio.c.

Here is the call graph for this function:

◆ I2C_SW_Send_byte()

int32_t I2C_SW_Send_byte ( uint8_t  u8Data)

Send a byte.

Parameters
u8DataData
Return values
0Receive ACK
1Receive NACK

Definition at line 48 of file i2c_software_gpio.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ u32_I2C_SW_Delay

uint32_t u32_I2C_SW_Delay

Definition at line 20 of file i2c_software_gpio.c.